@dirgha/code 1.43.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -18
- package/LICENSE +202 -101
- package/NOTICE +9 -0
- package/README.md +182 -129
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/bin/build-native.mjs +43 -0
- package/bin/dirgha.mjs +241 -0
- package/dist/cli/flows/full-cycle.d.ts +0 -3
- package/dist/cli/flows/full-cycle.js +1 -9
- package/dist/cli/flows/full-cycle.js.map +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/slash/index.js +0 -2
- package/dist/cli/slash/index.js.map +1 -1
- package/dist/cli/subcommands/index.js +0 -2
- package/dist/cli/subcommands/index.js.map +1 -1
- package/dist/integrations/entitlements.d.ts +1 -2
- package/dist/integrations/entitlements.js.map +1 -1
- package/dist/integrations/index.d.ts +0 -1
- package/dist/integrations/index.js +0 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/mcp/mcp-config.js +27 -3
- package/dist/mcp/mcp-config.js.map +1 -1
- package/dist/safety/policy.d.ts +18 -0
- package/dist/safety/policy.js +95 -1
- package/dist/safety/policy.js.map +1 -1
- package/dist/tools/index.d.ts +1 -2
- package/dist/tools/index.js +1 -8
- package/dist/tools/index.js.map +1 -1
- package/extensions/firefox-mv3/background.js +144 -0
- package/extensions/firefox-mv3/content-agent-dom.js +161 -0
- package/extensions/firefox-mv3/lokahi_gate.wasm +0 -0
- package/extensions/firefox-mv3/manifest.json +33 -0
- package/include/dirgha_kernel.h +41 -0
- package/package.json +63 -61
- package/plugins/dsh-plugin-dirgha/cordis.patch.yml +11 -0
- package/plugins/dsh-plugin-dirgha/index.ts +135 -0
- package/plugins/dsh-plugin-dirgha/package.json +18 -0
- package/plugins/robotics-physical-ai/README.md +11 -0
- package/plugins/robotics-physical-ai/mujoco_eval_sidecar.py +848 -0
- package/plugins/robotics-physical-ai/plugin.toml +23 -0
- package/plugins/robotics-skills-pack/README.md +15 -0
- package/plugins/robotics-skills-pack/plugin.toml +36 -0
- package/vendor/rtk/README.md +7 -0
- package/dist/cli/slash/goal.d.ts +0 -14
- package/dist/cli/slash/goal.js +0 -74
- package/dist/cli/slash/goal.js.map +0 -1
- package/dist/cli/slash/gpu.d.ts +0 -11
- package/dist/cli/slash/gpu.js +0 -58
- package/dist/cli/slash/gpu.js.map +0 -1
- package/dist/cli/subcommands/gpu.d.ts +0 -15
- package/dist/cli/subcommands/gpu.js +0 -187
- package/dist/cli/subcommands/gpu.js.map +0 -1
- package/dist/context/goal.d.ts +0 -27
- package/dist/context/goal.js +0 -77
- package/dist/context/goal.js.map +0 -1
- package/dist/gpu/market.d.ts +0 -30
- package/dist/gpu/market.js +0 -120
- package/dist/gpu/market.js.map +0 -1
- package/dist/integrations/bucky-client.d.ts +0 -105
- package/dist/integrations/bucky-client.js +0 -76
- package/dist/integrations/bucky-client.js.map +0 -1
- package/dist/providers/presets.d.ts +0 -30
- package/dist/providers/presets.js +0 -80
- package/dist/providers/presets.js.map +0 -1
- package/dist/tools/goal.d.ts +0 -11
- package/dist/tools/goal.js +0 -69
- package/dist/tools/goal.js.map +0 -1
- package/dist/tools/gpu-compute.d.ts +0 -19
- package/dist/tools/gpu-compute.js +0 -380
- package/dist/tools/gpu-compute.js.map +0 -1
- package/dist/tui/ink/components/GoalIndicator.d.ts +0 -7
- package/dist/tui/ink/components/GoalIndicator.js +0 -34
- package/dist/tui/ink/components/GoalIndicator.js.map +0 -1
- package/vendor/rtk/linux-x64/rtk +0 -0
package/dist/gpu/market.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* gpu/market.ts — GPU marketplace tools that interact with the
|
|
3
|
-
* Abundance protocol (Bucky marketplace on api.dirgha.ai).
|
|
4
|
-
*
|
|
5
|
-
* Users can list GPU compute for rent, find GPU compute from others,
|
|
6
|
-
* and settle payments via the existing escrow system.
|
|
7
|
-
*/
|
|
8
|
-
import { loadToken } from "../integrations/device-auth.js";
|
|
9
|
-
const GATEWAY = "https://api.dirgha.ai";
|
|
10
|
-
async function apiFetch(path, options = {}) {
|
|
11
|
-
const token = await loadToken().catch(() => null);
|
|
12
|
-
const headers = {
|
|
13
|
-
"Content-Type": "application/json",
|
|
14
|
-
...options.headers,
|
|
15
|
-
};
|
|
16
|
-
if (token?.token)
|
|
17
|
-
headers["Authorization"] = `Bearer ${token.token}`;
|
|
18
|
-
const res = await fetch(`${GATEWAY}${path}`, {
|
|
19
|
-
...options,
|
|
20
|
-
headers,
|
|
21
|
-
signal: AbortSignal.timeout(30_000),
|
|
22
|
-
});
|
|
23
|
-
if (!res.ok) {
|
|
24
|
-
const err = await res.text().catch(() => "unknown");
|
|
25
|
-
throw new Error(`Gateway ${res.status}: ${err.slice(0, 200)}`);
|
|
26
|
-
}
|
|
27
|
-
return res.json();
|
|
28
|
-
}
|
|
29
|
-
export async function postGPUListing(listing) {
|
|
30
|
-
const data = await apiFetch("/api/bucky/listings", {
|
|
31
|
-
method: "POST",
|
|
32
|
-
body: JSON.stringify({
|
|
33
|
-
title: `${listing.gpuType} GPU compute`,
|
|
34
|
-
description: `${listing.gpuType} - ${listing.vramGb}GB VRAM - $${listing.pricePerHr}/hr`,
|
|
35
|
-
category: "compute",
|
|
36
|
-
price: listing.pricePerHr,
|
|
37
|
-
currency: "USD",
|
|
38
|
-
metadata: { gpuType: listing.gpuType, vramGb: listing.vramGb, provider: listing.provider, region: listing.region },
|
|
39
|
-
}),
|
|
40
|
-
});
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
export async function listGPUListings(minVramGb, maxPrice) {
|
|
44
|
-
// Server-side filter: only fetch GPU compute listings
|
|
45
|
-
const data = await apiFetch("/api/bucky/listings?type=compute");
|
|
46
|
-
const listings = Array.isArray(data) ? data : data.listings ?? data.data ?? [];
|
|
47
|
-
return listings
|
|
48
|
-
.map((l) => ({
|
|
49
|
-
id: l.id,
|
|
50
|
-
gpuType: parseGpuType(l),
|
|
51
|
-
vramGb: parseVram(l),
|
|
52
|
-
pricePerHr: l.price_usd ?? l.price ?? 0,
|
|
53
|
-
provider: l.seller_id ?? "self",
|
|
54
|
-
region: parseRegion(l),
|
|
55
|
-
available: l.is_public !== false, // backend uses is_public boolean, not status
|
|
56
|
-
createdBy: l.seller_id,
|
|
57
|
-
}))
|
|
58
|
-
.filter((l) => {
|
|
59
|
-
if (minVramGb && l.vramGb < minVramGb)
|
|
60
|
-
return false;
|
|
61
|
-
if (maxPrice && l.pricePerHr > maxPrice)
|
|
62
|
-
return false;
|
|
63
|
-
return l.available;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
/** Extract GPU model from listing name, description, or tags. */
|
|
67
|
-
function parseGpuType(l) {
|
|
68
|
-
// Check name/description for known GPU patterns
|
|
69
|
-
const text = `${l.name ?? ""} ${l.title ?? ""} ${l.description ?? ""}`.toUpperCase();
|
|
70
|
-
const match = text.match(/\b(A100|H100|RTX\s*\d{3,4}|V100|T4|L40S?|A6000|MI\d{3}X?)\b/i);
|
|
71
|
-
if (match)
|
|
72
|
-
return match[1].replace(/\s+/, " ");
|
|
73
|
-
return l.name ?? l.title ?? "unknown";
|
|
74
|
-
}
|
|
75
|
-
/** Extract VRAM from description or content metadata. */
|
|
76
|
-
function parseVram(l) {
|
|
77
|
-
const text = `${l.name ?? ""} ${l.description ?? ""}`;
|
|
78
|
-
const match = text.match(/(\d+)\s*GB\s*(?:VRAM|vram)/i);
|
|
79
|
-
if (match)
|
|
80
|
-
return parseInt(match[1], 10);
|
|
81
|
-
if (l.content?.vram_gb)
|
|
82
|
-
return Number(l.content.vram_gb);
|
|
83
|
-
return 0;
|
|
84
|
-
}
|
|
85
|
-
/** Extract region from listing description or content metadata. */
|
|
86
|
-
function parseRegion(l) {
|
|
87
|
-
if (l.content?.location)
|
|
88
|
-
return l.content.location;
|
|
89
|
-
const text = l.description ?? "";
|
|
90
|
-
const match = text.match(/\b(Mumbai|Delhi|Bangalore|Singapore|Frankfurt|London|NYC|US-?East|US-?West|EU)\b/i);
|
|
91
|
-
return match ? match[1] : undefined;
|
|
92
|
-
}
|
|
93
|
-
export async function postGPUJob(job) {
|
|
94
|
-
const data = await apiFetch("/api/bucky/jobs", {
|
|
95
|
-
method: "POST",
|
|
96
|
-
body: JSON.stringify({
|
|
97
|
-
listing_id: job.listingId,
|
|
98
|
-
title: `GPU job: ${job.gpuType}`,
|
|
99
|
-
description: `GPU compute: ${job.gpuType} for ${job.durationHrs}h`,
|
|
100
|
-
budget_sats: 0,
|
|
101
|
-
metadata: { gpuType: job.gpuType, durationHrs: job.durationHrs, totalCost: job.totalCost },
|
|
102
|
-
}),
|
|
103
|
-
});
|
|
104
|
-
return data;
|
|
105
|
-
}
|
|
106
|
-
export async function getGPUJobStatus(jobId) {
|
|
107
|
-
const data = await apiFetch(`/api/bucky/jobs/${jobId}`);
|
|
108
|
-
return {
|
|
109
|
-
id: data.id,
|
|
110
|
-
gpuType: data.metadata?.gpuType ?? "unknown",
|
|
111
|
-
listingId: data.listing_id ?? "",
|
|
112
|
-
durationHrs: data.metadata?.durationHrs ?? 0,
|
|
113
|
-
totalCost: data.metadata?.totalCost ?? data.budget_sats ?? 0,
|
|
114
|
-
status: data.status === "active" || data.status === "open" ? "running" : data.status,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
export async function settleGPUJob(jobId) {
|
|
118
|
-
await apiFetch(`/api/bucky/jobs/${jobId}/settle`, { method: "POST" });
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=market.js.map
|
package/dist/gpu/market.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"market.js","sourceRoot":"","sources":["../../src/gpu/market.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAExC,KAAK,U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AC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;KACrF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAa;IAC9C,MAAM,QAAQ,CAAC,mBAAmB,KAAK,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bucky client. Thin wrapper over the Hono.js service (default port
|
|
3
|
-
* 3002). All methods take an explicit bearer token argument so callers
|
|
4
|
-
* can control scope (gateway passthrough vs anonymous for public
|
|
5
|
-
* endpoints).
|
|
6
|
-
*/
|
|
7
|
-
export interface BuckyTask {
|
|
8
|
-
id: string;
|
|
9
|
-
status: string;
|
|
10
|
-
title: string;
|
|
11
|
-
payload?: unknown;
|
|
12
|
-
}
|
|
13
|
-
export interface Team {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
members?: string[];
|
|
17
|
-
}
|
|
18
|
-
export interface MeshStatus {
|
|
19
|
-
peerCount: number;
|
|
20
|
-
peers: Array<{
|
|
21
|
-
id: string;
|
|
22
|
-
addr?: string;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
export interface CodeBlock {
|
|
26
|
-
id: string;
|
|
27
|
-
code: string;
|
|
28
|
-
language: string;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
}
|
|
31
|
-
export interface Proposal {
|
|
32
|
-
id: string;
|
|
33
|
-
title: string;
|
|
34
|
-
description: string;
|
|
35
|
-
status: string;
|
|
36
|
-
}
|
|
37
|
-
export interface VmHandle {
|
|
38
|
-
vmId: string;
|
|
39
|
-
endpoint?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface BuckyClientOptions {
|
|
42
|
-
baseUrl?: string;
|
|
43
|
-
timeoutMs?: number;
|
|
44
|
-
}
|
|
45
|
-
export declare function createBuckyClient(opts?: BuckyClientOptions): {
|
|
46
|
-
tasks: {
|
|
47
|
-
list(token?: string): Promise<{
|
|
48
|
-
tasks: BuckyTask[];
|
|
49
|
-
}>;
|
|
50
|
-
submit(payload: unknown, token?: string): Promise<BuckyTask>;
|
|
51
|
-
};
|
|
52
|
-
dao: {
|
|
53
|
-
listTeams(token?: string): Promise<{
|
|
54
|
-
teams: Team[];
|
|
55
|
-
}>;
|
|
56
|
-
getTeam(id: string, token?: string): Promise<Team>;
|
|
57
|
-
};
|
|
58
|
-
mesh: {
|
|
59
|
-
status(token?: string): Promise<MeshStatus>;
|
|
60
|
-
};
|
|
61
|
-
lightning: {
|
|
62
|
-
balance(token?: string): Promise<{
|
|
63
|
-
sats: number;
|
|
64
|
-
}>;
|
|
65
|
-
};
|
|
66
|
-
reputation: {
|
|
67
|
-
get(userId: string, token?: string): Promise<{
|
|
68
|
-
userId: string;
|
|
69
|
-
score: number;
|
|
70
|
-
}>;
|
|
71
|
-
};
|
|
72
|
-
code: {
|
|
73
|
-
register(code: string, language: string, token?: string): Promise<{
|
|
74
|
-
id: string;
|
|
75
|
-
}>;
|
|
76
|
-
get(id: string, token?: string): Promise<CodeBlock>;
|
|
77
|
-
list(token?: string): Promise<{
|
|
78
|
-
blocks: CodeBlock[];
|
|
79
|
-
}>;
|
|
80
|
-
};
|
|
81
|
-
governance: {
|
|
82
|
-
propose(proposal: Partial<Proposal> & {
|
|
83
|
-
proposer: string;
|
|
84
|
-
title: string;
|
|
85
|
-
}, token?: string): Promise<Proposal>;
|
|
86
|
-
vote(vote: {
|
|
87
|
-
proposalId: string;
|
|
88
|
-
voterId: string;
|
|
89
|
-
balance: number;
|
|
90
|
-
direction: "yes" | "no";
|
|
91
|
-
}, token?: string): Promise<{
|
|
92
|
-
ok: boolean;
|
|
93
|
-
}>;
|
|
94
|
-
list(token?: string): Promise<{
|
|
95
|
-
proposals: Proposal[];
|
|
96
|
-
}>;
|
|
97
|
-
};
|
|
98
|
-
vm: {
|
|
99
|
-
create(cpuCount: number, memoryMB: number, token?: string): Promise<VmHandle>;
|
|
100
|
-
destroy(vmId: string, token?: string): Promise<{
|
|
101
|
-
ok: boolean;
|
|
102
|
-
}>;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export type BuckyClient = ReturnType<typeof createBuckyClient>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bucky client. Thin wrapper over the Hono.js service (default port
|
|
3
|
-
* 3002). All methods take an explicit bearer token argument so callers
|
|
4
|
-
* can control scope (gateway passthrough vs anonymous for public
|
|
5
|
-
* endpoints).
|
|
6
|
-
*/
|
|
7
|
-
import { jsonRequest } from './http.js';
|
|
8
|
-
export function createBuckyClient(opts = {}) {
|
|
9
|
-
const baseUrl = opts.baseUrl ?? process.env.DIRGHA_BUCKY_URL ?? 'http://localhost:3002';
|
|
10
|
-
const timeoutMs = opts.timeoutMs ?? 20_000;
|
|
11
|
-
const req = (options) => jsonRequest({ baseUrl, timeoutMs, ...options });
|
|
12
|
-
return {
|
|
13
|
-
tasks: {
|
|
14
|
-
list(token) {
|
|
15
|
-
return req({ method: 'GET', path: '/api/tasks', token });
|
|
16
|
-
},
|
|
17
|
-
submit(payload, token) {
|
|
18
|
-
return req({ method: 'POST', path: '/api/tasks', body: payload, token });
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
dao: {
|
|
22
|
-
listTeams(token) {
|
|
23
|
-
return req({ method: 'GET', path: '/api/dao/teams', token });
|
|
24
|
-
},
|
|
25
|
-
getTeam(id, token) {
|
|
26
|
-
return req({ method: 'GET', path: `/api/dao/teams/${encodeURIComponent(id)}`, token });
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
mesh: {
|
|
30
|
-
status(token) {
|
|
31
|
-
return req({ method: 'GET', path: '/api/mesh/status', token });
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
lightning: {
|
|
35
|
-
balance(token) {
|
|
36
|
-
return req({ method: 'GET', path: '/api/lightning/balance', token });
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
reputation: {
|
|
40
|
-
get(userId, token) {
|
|
41
|
-
return req({ method: 'GET', path: `/api/reputation/${encodeURIComponent(userId)}`, token });
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
code: {
|
|
45
|
-
register(code, language, token) {
|
|
46
|
-
return req({ method: 'POST', path: '/code/register', body: { code, language }, token });
|
|
47
|
-
},
|
|
48
|
-
get(id, token) {
|
|
49
|
-
return req({ method: 'GET', path: `/code/${encodeURIComponent(id)}`, token });
|
|
50
|
-
},
|
|
51
|
-
list(token) {
|
|
52
|
-
return req({ method: 'GET', path: '/code', token });
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
governance: {
|
|
56
|
-
propose(proposal, token) {
|
|
57
|
-
return req({ method: 'POST', path: '/governance/propose', body: proposal, token });
|
|
58
|
-
},
|
|
59
|
-
vote(vote, token) {
|
|
60
|
-
return req({ method: 'POST', path: '/governance/vote', body: vote, token });
|
|
61
|
-
},
|
|
62
|
-
list(token) {
|
|
63
|
-
return req({ method: 'GET', path: '/governance/proposals', token });
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
vm: {
|
|
67
|
-
create(cpuCount, memoryMB, token) {
|
|
68
|
-
return req({ method: 'POST', path: '/vm/create', body: { cpuCount, memoryMB }, token });
|
|
69
|
-
},
|
|
70
|
-
destroy(vmId, token) {
|
|
71
|
-
return req({ method: 'DELETE', path: `/vm/${encodeURIComponent(vmId)}`, token });
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=bucky-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bucky-client.js","sourceRoot":"","sources":["../../src/integrations/bucky-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAcxC,MAAM,UAAU,iBAAiB,CAAC,OAA2B,EAA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C;YACD,IAAI,CAAC,KAAc;gBACjB,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,CAAC;YACtE,CAAC;SACF;QACD,EAAE,EAAE;YACF,MAAM,CAAC,QAAgB,EAAE,QAAgB,EAAE,KAAc;gBACvD,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1F,CAAC;YACD,OAAO,CAAC,IAAY,EAAE,KAAc;gBAClC,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACnF,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI-compatible provider presets.
|
|
3
|
-
*
|
|
4
|
-
* Each preset is a pure data blob that, when fed through
|
|
5
|
-
* `defineOpenAICompatProvider`, yields a working Provider class. This
|
|
6
|
-
* is the user-facing proof that adding a new chat-completions-style
|
|
7
|
-
* provider is configuration, not a new TypeScript class.
|
|
8
|
-
*
|
|
9
|
-
* Existing per-provider classes (`openai.ts`, `openrouter.ts`,
|
|
10
|
-
* `nvidia.ts`, `fireworks.ts`) are kept for backwards compat with any
|
|
11
|
-
* code that imports them by name — but as of this refactor they could
|
|
12
|
-
* be expressed entirely as preset blobs from this file. The two
|
|
13
|
-
* non-OpenAI-compat providers (`anthropic.ts`, `gemini.ts`) speak
|
|
14
|
-
* different wire protocols and are not covered by this factory.
|
|
15
|
-
*/
|
|
16
|
-
import { type OpenAICompatSpec } from './define-openai-compat.js';
|
|
17
|
-
import type { Provider } from './iface.js';
|
|
18
|
-
export declare const OPENAI_PRESET: OpenAICompatSpec;
|
|
19
|
-
export declare const OPENROUTER_PRESET: OpenAICompatSpec;
|
|
20
|
-
export declare const NVIDIA_PRESET: OpenAICompatSpec;
|
|
21
|
-
export declare const FIREWORKS_PRESET: OpenAICompatSpec;
|
|
22
|
-
export declare const DEEPSEEK_PRESET: OpenAICompatSpec;
|
|
23
|
-
/** Build a provider instance from a preset name + optional overrides. */
|
|
24
|
-
export declare function fromPreset(preset: OpenAICompatSpec, overrides?: {
|
|
25
|
-
apiKey?: string;
|
|
26
|
-
baseUrl?: string;
|
|
27
|
-
timeoutMs?: number;
|
|
28
|
-
}): Provider;
|
|
29
|
-
/** Registry of named presets so config can reference one by string. */
|
|
30
|
-
export declare const PRESETS: Record<string, OpenAICompatSpec>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI-compatible provider presets.
|
|
3
|
-
*
|
|
4
|
-
* Each preset is a pure data blob that, when fed through
|
|
5
|
-
* `defineOpenAICompatProvider`, yields a working Provider class. This
|
|
6
|
-
* is the user-facing proof that adding a new chat-completions-style
|
|
7
|
-
* provider is configuration, not a new TypeScript class.
|
|
8
|
-
*
|
|
9
|
-
* Existing per-provider classes (`openai.ts`, `openrouter.ts`,
|
|
10
|
-
* `nvidia.ts`, `fireworks.ts`) are kept for backwards compat with any
|
|
11
|
-
* code that imports them by name — but as of this refactor they could
|
|
12
|
-
* be expressed entirely as preset blobs from this file. The two
|
|
13
|
-
* non-OpenAI-compat providers (`anthropic.ts`, `gemini.ts`) speak
|
|
14
|
-
* different wire protocols and are not covered by this factory.
|
|
15
|
-
*/
|
|
16
|
-
import { defineOpenAICompatProvider } from './define-openai-compat.js';
|
|
17
|
-
const OPENAI_REASONING_RX = /^o[1-9](?:-.+)?$/i;
|
|
18
|
-
export const OPENAI_PRESET = {
|
|
19
|
-
id: 'openai',
|
|
20
|
-
defaultBaseUrl: 'https://api.openai.com/v1',
|
|
21
|
-
apiKeyEnv: 'OPENAI_API_KEY',
|
|
22
|
-
modelPrefixToStrip: /^openai\//,
|
|
23
|
-
supportsTools: m => /^gpt-/.test(m) || OPENAI_REASONING_RX.test(m.replace(/^openai\//, '')),
|
|
24
|
-
supportsThinking: m => OPENAI_REASONING_RX.test(m.replace(/^openai\//, '')),
|
|
25
|
-
};
|
|
26
|
-
const OPENROUTER_TOOL_RX = [
|
|
27
|
-
/^inclusionai\/ling/, /^anthropic\//, /^openai\//, /^google\/gemini/,
|
|
28
|
-
/^mistralai\//, /^meta-llama\//, /^qwen\//, /^deepseek\//,
|
|
29
|
-
/^moonshotai\//, /^minimaxai?\//, /^z-ai\//, /^tencent\//,
|
|
30
|
-
];
|
|
31
|
-
export const OPENROUTER_PRESET = {
|
|
32
|
-
id: 'openrouter',
|
|
33
|
-
defaultBaseUrl: 'https://openrouter.ai/api/v1',
|
|
34
|
-
apiKeyEnv: 'OPENROUTER_API_KEY',
|
|
35
|
-
modelPrefixToStrip: /^openrouter\//,
|
|
36
|
-
supportsTools: id => {
|
|
37
|
-
const base = id.replace(/:free$/, '').replace(/^openrouter\//, '');
|
|
38
|
-
return OPENROUTER_TOOL_RX.some(rx => rx.test(base));
|
|
39
|
-
},
|
|
40
|
-
supportsThinking: id => /^deepseek-ai\//.test(id) || /^anthropic\/claude-opus/.test(id) || /^openai\/o[1-9]/.test(id),
|
|
41
|
-
extraHeaders: { 'HTTP-Referer': 'https://dirgha.ai', 'X-Title': 'dirgha-cli' },
|
|
42
|
-
};
|
|
43
|
-
export const NVIDIA_PRESET = {
|
|
44
|
-
id: 'nvidia',
|
|
45
|
-
defaultBaseUrl: 'https://integrate.api.nvidia.com/v1',
|
|
46
|
-
apiKeyEnv: 'NVIDIA_API_KEY',
|
|
47
|
-
defaultTimeoutMs: 300_000, // NIM tail latency on tool-followups + reasoning models can take 2-3 minutes
|
|
48
|
-
supportsTools: id => {
|
|
49
|
-
const known = new Set(['moonshotai/kimi-k2-instruct', 'qwen/qwen3-next-80b-a3b-instruct', 'meta/llama-3.3-70b-instruct', 'deepseek-ai/deepseek-v4-pro', 'deepseek-ai/deepseek-v4-flash']);
|
|
50
|
-
return known.has(id);
|
|
51
|
-
},
|
|
52
|
-
supportsThinking: id => /^deepseek-ai\//.test(id) || /thinking/.test(id),
|
|
53
|
-
extraBody: (model, thinking) => thinking ? { chat_template_kwargs: { enable_thinking: true } } : undefined,
|
|
54
|
-
};
|
|
55
|
-
export const FIREWORKS_PRESET = {
|
|
56
|
-
id: 'fireworks',
|
|
57
|
-
defaultBaseUrl: 'https://api.fireworks.ai/inference/v1',
|
|
58
|
-
apiKeyEnv: 'FIREWORKS_API_KEY',
|
|
59
|
-
};
|
|
60
|
-
export const DEEPSEEK_PRESET = {
|
|
61
|
-
id: 'deepseek',
|
|
62
|
-
defaultBaseUrl: 'https://api.deepseek.com/v1',
|
|
63
|
-
apiKeyEnv: 'DEEPSEEK_API_KEY',
|
|
64
|
-
modelPrefixToStrip: /^deepseek\//,
|
|
65
|
-
supportsTools: () => true,
|
|
66
|
-
};
|
|
67
|
-
/** Build a provider instance from a preset name + optional overrides. */
|
|
68
|
-
export function fromPreset(preset, overrides = {}) {
|
|
69
|
-
const Ctor = defineOpenAICompatProvider(preset);
|
|
70
|
-
return new Ctor(overrides);
|
|
71
|
-
}
|
|
72
|
-
/** Registry of named presets so config can reference one by string. */
|
|
73
|
-
export const PRESETS = {
|
|
74
|
-
openai: OPENAI_PRESET,
|
|
75
|
-
openrouter: OPENROUTER_PRESET,
|
|
76
|
-
nvidia: NVIDIA_PRESET,
|
|
77
|
-
fireworks: FIREWORKS_PRESET,
|
|
78
|
-
deepseek: DEEPSEEK_PRESET,
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=presets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/providers/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,0BAA0B,EAAyB,MAAM,2BAA2B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E,EAAE;IAC5H,MAAM,IAAI,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,OAAO,GAAqC;IACvD,MAAM,EAAE,aAAa;IACrB,UAAU,EAAE,iBAAiB;IAC7B,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE,eAAe;CAC1B,CAAC"}
|
package/dist/tools/goal.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* goal.ts — Persistent goal tools for the agent.
|
|
3
|
-
*
|
|
4
|
-
* The agent can read and update the user's persistent goal.
|
|
5
|
-
* Stored in ~/.dirgha/goal.json.
|
|
6
|
-
*/
|
|
7
|
-
import type { Tool } from "./registry.js";
|
|
8
|
-
export declare const goalGetTool: Tool;
|
|
9
|
-
export declare const goalSetTool: Tool;
|
|
10
|
-
export declare const goalProgressTool: Tool;
|
|
11
|
-
export declare const goalCompleteTool: Tool;
|
package/dist/tools/goal.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* goal.ts — Persistent goal tools for the agent.
|
|
3
|
-
*
|
|
4
|
-
* The agent can read and update the user's persistent goal.
|
|
5
|
-
* Stored in ~/.dirgha/goal.json.
|
|
6
|
-
*/
|
|
7
|
-
import { getGoal, setGoal, updateGoalProgress, updateGoalStatus } from "../context/goal.js";
|
|
8
|
-
export const goalGetTool = {
|
|
9
|
-
name: "goal_get",
|
|
10
|
-
description: "Read the user's persistent goal (if any). Shows title, progress, status.",
|
|
11
|
-
inputSchema: { type: "object", properties: {} },
|
|
12
|
-
async execute(_rawInput, _ctx) {
|
|
13
|
-
const goal = await getGoal();
|
|
14
|
-
if (!goal)
|
|
15
|
-
return { isError: false, content: "No goal set." };
|
|
16
|
-
return {
|
|
17
|
-
isError: false,
|
|
18
|
-
content: `Goal: ${goal.title} (${goal.progress}%, ${goal.status})`,
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const goalSetTool = {
|
|
23
|
-
name: "goal_set",
|
|
24
|
-
description: "Set the user's persistent goal. Use this when you understand what the user wants to achieve long-term.",
|
|
25
|
-
inputSchema: {
|
|
26
|
-
type: "object",
|
|
27
|
-
properties: {
|
|
28
|
-
title: { type: "string", description: "Goal title (required)." },
|
|
29
|
-
description: { type: "string", description: "Optional detailed description." },
|
|
30
|
-
tags: { type: "array", items: { type: "string" }, description: "Optional tags." },
|
|
31
|
-
},
|
|
32
|
-
required: ["title"],
|
|
33
|
-
},
|
|
34
|
-
async execute(rawInput, _ctx) {
|
|
35
|
-
const input = rawInput;
|
|
36
|
-
const goal = await setGoal(input);
|
|
37
|
-
return { isError: false, content: `🎯 Goal set: ${goal.title}` };
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
export const goalProgressTool = {
|
|
41
|
-
name: "goal_progress",
|
|
42
|
-
description: "Update the goal's progress percentage (0-100). Use this as you make progress toward the goal.",
|
|
43
|
-
inputSchema: {
|
|
44
|
-
type: "object",
|
|
45
|
-
properties: {
|
|
46
|
-
progress: { type: "integer", minimum: 0, maximum: 100, description: "Progress percentage (required)." },
|
|
47
|
-
note: { type: "string", description: "Optional note about what was accomplished." },
|
|
48
|
-
},
|
|
49
|
-
required: ["progress"],
|
|
50
|
-
},
|
|
51
|
-
async execute(rawInput, _ctx) {
|
|
52
|
-
const input = rawInput;
|
|
53
|
-
const updated = await updateGoalProgress(input.progress);
|
|
54
|
-
if (!updated)
|
|
55
|
-
return { isError: false, content: "No goal set. Use goal_set first." };
|
|
56
|
-
const note = input.note ? ` — ${input.note}` : "";
|
|
57
|
-
return { isError: false, content: `🎯 Goal progress: ${input.progress}%${note}` };
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
export const goalCompleteTool = {
|
|
61
|
-
name: "goal_complete",
|
|
62
|
-
description: "Mark the goal as complete (100%).",
|
|
63
|
-
inputSchema: { type: "object", properties: {} },
|
|
64
|
-
async execute(_rawInput, _ctx) {
|
|
65
|
-
await updateGoalStatus("done");
|
|
66
|
-
return { isError: false, content: "🎉 Goal complete!" };
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=goal.js.map
|
package/dist/tools/goal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"goal.js","sourceRoot":"","sources":["../../src/tools/goal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,0EAA0E;IACvF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IAC/C,KAAK,CAAC,OAAO,CAAC,SAAkB,EAAE,IAAiB;QACjD,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QAC9D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,SAAS,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,MAAM,GAAG;SACnE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,wGAAwG;IACrH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YAChE,WAAW,EAAE,EAAE,IAAI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AAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,qBAAqB,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE,EAAE,CAAC;IACpF,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,mCAAmC;IAChD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IAC/C,KAAK,CAAC,OAAO,CAAC,SAAkB,EAAE,IAAiB;QACjD,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC1D,CAAC;CACF,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tools/gpu-compute.ts — GPU compute tools for the CLI agent.
|
|
3
|
-
*
|
|
4
|
-
* The agent can provision GPU instances, check status, list available
|
|
5
|
-
* GPU types, and destroy instances. Uses the GPU provider abstraction
|
|
6
|
-
* layer (src/gpu/providers.ts).
|
|
7
|
-
*
|
|
8
|
-
* Currently supports: RunPod (+ Spheron, Akash planned).
|
|
9
|
-
*
|
|
10
|
-
* The agent never needs to know which provider — the tool auto-selects
|
|
11
|
-
* the cheapest available GPU that meets the requirements.
|
|
12
|
-
*/
|
|
13
|
-
import type { Tool } from "./registry.js";
|
|
14
|
-
export declare const gpuListTool: Tool;
|
|
15
|
-
export declare const gpuComputeTool: Tool;
|
|
16
|
-
export declare const gpuStatusTool: Tool;
|
|
17
|
-
export declare const gpuMarketListTool: Tool;
|
|
18
|
-
export declare const gpuMarketPostTool: Tool;
|
|
19
|
-
export declare const gpuDestroyTool: Tool;
|