Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
]

[workspace.package]
version = "0.3.65"
version = "0.3.66"
edition = "2024"
license = "MIT"
repository = "https://github.com/profullstack/c0mpute"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@c0mpute/desktop",
"productName": "c0mpute",
"desktopName": "c0mpute-desktop.desktop",
"version": "0.3.65",
"version": "0.3.66",
"private": true,
"type": "module",
"description": "c0mpute desktop: chat, agent with your MCP servers and skills, node manager, hosting and tasks, with the c0mpute CLI bundled.",
Expand Down
2 changes: 1 addition & 1 deletion apps/tui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/tui",
"version": "0.3.65",
"version": "0.3.66",
"private": true,
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute",
"version": "0.3.65",
"version": "0.3.66",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/releases/latest.json/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const dynamic = "force-dynamic";
* this in sync with the workspace version in `Cargo.toml` on each release so a
* freshly built CLI reports "already latest" rather than a phantom upgrade.
*/
const FALLBACK_VERSION = "0.3.65";
const FALLBACK_VERSION = "0.3.66";
const FALLBACK_MIN_REQUIRED = "0.0.1";

type Channel = "stable" | "beta" | "nightly";
Expand Down
46 changes: 43 additions & 3 deletions apps/web/src/lib/nodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "server-only";
import { fetchFromAggregators } from "./aggregators";
import { aggregatorUrls } from "./aggregators";
import { OPERATOR_SHARE_PCT } from "./market";

/**
Expand Down Expand Up @@ -170,12 +170,52 @@ export function publicRow(row: NodeRow & { cpu?: unknown }): NodeRow {
return rest;
}

type RawNodes = Omit<NodesPayload, "source">;

/**
* Overlay each node's 24h job stats from every aggregator onto `base`, taking
* for each node the answer that counted the most jobs. Each aggregator keeps
* its 24h window in memory, so one restarted by a deploy starts at zero while
* another still holds the whole day; the board should show the fuller one.
*/
export function mergeJobStats(base: NodeRow[], answers: RawNodes[]): NodeRow[] {
const best = new Map<string, NodeJobs>();
for (const a of answers) {
for (const n of Array.isArray(a.nodes) ? a.nodes : []) {
const j = n.jobs_24h;
if (!j || !(j.jobs > 0)) continue;
const cur = best.get(n.id);
if (!cur || j.jobs > cur.jobs) best.set(n.id, j);
}
}
return base.map((n) => {
const j = best.get(n.id);
return j ? { ...n, jobs_24h: j } : n;
});
}

async function fetchNodesFrom(base: string): Promise<RawNodes | null> {
try {
const r = await fetch(`${base}/nodes`, { signal: AbortSignal.timeout(2_000), cache: "no-store" });
return r.ok ? ((await r.json()) as RawNodes) : null;
} catch {
return null;
}
}

export async function getNodesPayload(): Promise<NodesPayload> {
const data = await fetchFromAggregators<Omit<NodesPayload, "source">>("/nodes");
const answers = (await Promise.all(aggregatorUrls().map(fetchNodesFrom))).filter(
(a): a is RawNodes => a !== null && typeof a === "object",
);
// The board itself comes from the aggregator that sees the most workers.
const data = answers.reduce<RawNodes | null>(
(b, a) => (b === null || (a.workers_online ?? 0) > (b.workers_online ?? 0) ? a : b),
null,
);
if (data) {
return {
...data,
nodes: Array.isArray(data.nodes) ? data.nodes.map(publicRow) : [],
nodes: mergeJobStats(Array.isArray(data.nodes) ? data.nodes.map(publicRow) : [], answers),
operators: Array.isArray(data.operators) ? data.operators : [],
referrers: Array.isArray(data.referrers) ? data.referrers : [],
source: "aggregator",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute-monorepo",
"version": "0.3.65",
"version": "0.3.66",
"private": true,
"workspaces": [
"apps/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/captcha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@profullstack/c0mpute-captcha",
"version": "0.3.65",
"version": "0.3.66",
"description": "Solve image, slider, gap, click-text, audio and math captchas on the c0mpute network: library (fetch().then(solveCaptcha)), CLI and stdio MCP server.",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/shared",
"version": "0.3.65",
"version": "0.3.66",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ad-generator-agent/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
[module]
id = "ad-generator-agent"
name = "Ad Generator Agent — every ad type from one URL"
version = "0.3.65"
version = "0.3.66"
kind = "service"
category = "applications"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ads-manager/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[module]
id = "ads-manager"
name = "Ads Manager — shared ad operations layer"
version = "0.3.65"
version = "0.3.66"
kind = "service"
category = "applications"
status = "partial"
Expand Down
2 changes: 1 addition & 1 deletion plugins/apps/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[module]
id = "apps"
name = "Apps — backends with 3x redundancy"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "infrastructure"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/captcha/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[module]
id = "captcha"
name = "Captcha — image, slider, audio and math solving"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/coinpay/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[module]
id = "coinpay"
name = "CoinPay — DID, payments, escrow, reputation"
version = "0.3.65"
version = "0.3.66"
kind = "service"
category = "applications"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/containers/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[module]
id = "containers"
name = "Containers — remote docker builds and jobs"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "developer"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/crawl/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[module]
id = "crawl"
name = "Crawl — distributed web fetching"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "data"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/crowdgpt/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[module]
id = "crowdgpt"
name = "CrowdGPT: donate idle compute"
version = "0.3.65"
version = "0.3.66"
kind = "donation"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ctv-ads/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[module]
id = "ctv-ads"
name = "CTV Ads — VAST and VMAP from every gateway"
version = "0.3.65"
version = "0.3.66"
kind = "service"
category = "applications"
status = "partial"
Expand Down
2 changes: 1 addition & 1 deletion plugins/diffusion/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[module]
id = "diffusion"
name = "Diffusion — image generation"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[module]
id = "embed"
name = "Embeddings — vector generation"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "ai"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/gameserver/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
[module]
id = "gameserver"
name = "Game server — Minecraft / Factorio / Valheim"
version = "0.3.65"
version = "0.3.66"
kind = "workload"
category = "infrastructure"
status = "available"
Expand Down
2 changes: 1 addition & 1 deletion plugins/git/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
[module]
id = "git"
name = "Git — p2p repo hosting"
version = "0.3.65"
version = "0.3.66"
kind = "service"
category = "data"
status = "partial"
Expand Down
Loading
Loading