@nodus-ai/equile 0.0.1-preview
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/README.md +544 -0
- package/dist/cli.js +13 -0
- package/dist/desktop-agent-J5A2KK2P.js +59 -0
- package/dist/nodus.cjs +1 -0
- package/dist/nodus.d.cts +709 -0
- package/dist/nodus.d.ts +709 -0
- package/dist/nodus.js +1 -0
- package/package.json +30 -0
package/dist/nodus.d.cts
ADDED
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
type AgentRunStatus = "queued" | "provisioning" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
|
|
2
|
+
type AgentRunMode = "standard" | "goal";
|
|
3
|
+
type AgentRunInputResource = {
|
|
4
|
+
/** HTTPS source the runtime downloads. Provide either url or contentBase64. */
|
|
5
|
+
url?: string;
|
|
6
|
+
/** Inline base64 payload (e.g. an image): Nodus stages it and hands the runtime a private download of its own. ~7 MB max per resource. */
|
|
7
|
+
contentBase64?: string;
|
|
8
|
+
path: string;
|
|
9
|
+
contentType?: string | null;
|
|
10
|
+
sizeBytes?: number | null;
|
|
11
|
+
checksum?: string | null;
|
|
12
|
+
};
|
|
13
|
+
type AgentRunResource = Omit<AgentRunInputResource, "url" | "contentBase64">;
|
|
14
|
+
/** Per-message session attachment (e.g. a pasted image); staged into the
|
|
15
|
+
* session workspace and referenced by path in the delivered turn. */
|
|
16
|
+
type SessionAttachment = {
|
|
17
|
+
name: string;
|
|
18
|
+
contentBase64: string;
|
|
19
|
+
};
|
|
20
|
+
type AgentRunArtifact = {
|
|
21
|
+
id: string;
|
|
22
|
+
path: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
contentType: string;
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
status: "available" | "expired";
|
|
27
|
+
};
|
|
28
|
+
type AgentRunUsage = {
|
|
29
|
+
inputTokens: number;
|
|
30
|
+
cachedInputTokens: number;
|
|
31
|
+
outputTokens: number;
|
|
32
|
+
reasoningOutputTokens: number;
|
|
33
|
+
runtimeSeconds: number;
|
|
34
|
+
model: string | null;
|
|
35
|
+
estimatedCostUsd: number | null;
|
|
36
|
+
};
|
|
37
|
+
type AgentRunMetadata = Record<string, unknown> & {
|
|
38
|
+
workspaceScheduled?: boolean;
|
|
39
|
+
workspaceId?: string;
|
|
40
|
+
scheduledProvider?: string;
|
|
41
|
+
attemptedAgentIds?: string[];
|
|
42
|
+
failoverCount?: number;
|
|
43
|
+
lastFailoverReason?: string;
|
|
44
|
+
};
|
|
45
|
+
type AgentRun = {
|
|
46
|
+
id: string;
|
|
47
|
+
/** Persistent runs keep their sandbox: continue it via sessions.run(sessionId, …). */
|
|
48
|
+
persistent?: boolean;
|
|
49
|
+
sessionId?: string;
|
|
50
|
+
mode: AgentRunMode;
|
|
51
|
+
userAgentId: string;
|
|
52
|
+
agentSessionId: string | null;
|
|
53
|
+
workspaceRevisionId: string | null;
|
|
54
|
+
status: AgentRunStatus;
|
|
55
|
+
/** Legacy alias for prompt. */
|
|
56
|
+
instructions: string;
|
|
57
|
+
prompt: string;
|
|
58
|
+
goal: string | null;
|
|
59
|
+
resources: AgentRunResource[];
|
|
60
|
+
idempotencyKey: string | null;
|
|
61
|
+
queueTimeoutAt: string | null;
|
|
62
|
+
executionTimeoutSeconds: number;
|
|
63
|
+
timeoutAt: string | null;
|
|
64
|
+
metadata: AgentRunMetadata;
|
|
65
|
+
usage: AgentRunUsage;
|
|
66
|
+
artifacts: AgentRunArtifact[];
|
|
67
|
+
finalOutput: string | null;
|
|
68
|
+
/** Parsed JSON deliverable when the run was created with outputSchema. */
|
|
69
|
+
structuredOutput?: unknown;
|
|
70
|
+
/** Where structuredOutput came from: the final message or a captured artifact. */
|
|
71
|
+
structuredOutputSource?: "final_output" | `artifact:${string}` | null;
|
|
72
|
+
error: string | null;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
startedAt: string | null;
|
|
75
|
+
completedAt: string | null;
|
|
76
|
+
cleanupCompletedAt: string | null;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
};
|
|
79
|
+
type AgentRunSummary = Omit<AgentRun, "instructions" | "prompt" | "goal" | "resources" | "metadata">;
|
|
80
|
+
type WorkspaceRuntime = {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
defaultResourceProfile: string;
|
|
84
|
+
latestRevisionId: string | null;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
archivedAt: string | null;
|
|
88
|
+
};
|
|
89
|
+
type WorkspaceRevision = {
|
|
90
|
+
id: string;
|
|
91
|
+
workspaceRuntimeId: string;
|
|
92
|
+
sourceType: "interactive" | "dockerfile";
|
|
93
|
+
status: "ready" | "failed";
|
|
94
|
+
parentRevisionId: string | null;
|
|
95
|
+
capabilities: Record<string, unknown>;
|
|
96
|
+
validationReport: Record<string, unknown>;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
};
|
|
99
|
+
type WorkspaceBuild = {
|
|
100
|
+
id: string;
|
|
101
|
+
workspaceRuntimeId: string;
|
|
102
|
+
mode: "interactive" | "dockerfile";
|
|
103
|
+
status: string;
|
|
104
|
+
baseRevisionId: string | null;
|
|
105
|
+
dockerfilePath: string | null;
|
|
106
|
+
resultRevisionId: string | null;
|
|
107
|
+
error: string | null;
|
|
108
|
+
logs: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
111
|
+
};
|
|
112
|
+
type DesktopRuntimePermission = "full" | "files_only";
|
|
113
|
+
type DesktopRuntimeGrant = {
|
|
114
|
+
runtimeId: string;
|
|
115
|
+
userAgentId: string;
|
|
116
|
+
permission: DesktopRuntimePermission;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
};
|
|
120
|
+
type DesktopRuntime = {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
defaultCwd: string;
|
|
124
|
+
homeDisplay: string;
|
|
125
|
+
skillCatalog: Array<Record<string, unknown>>;
|
|
126
|
+
mcpCatalog: Array<Record<string, unknown>>;
|
|
127
|
+
mode: "full" | "storage_only";
|
|
128
|
+
grantsEnabled: boolean;
|
|
129
|
+
grants: DesktopRuntimeGrant[];
|
|
130
|
+
platform: string;
|
|
131
|
+
codexVersion: string | null;
|
|
132
|
+
lastSeenAt: string | null;
|
|
133
|
+
online: boolean;
|
|
134
|
+
skillCount: number;
|
|
135
|
+
mcpCount: number; /** Legacy exclusive binding. New integrations should use grants. */
|
|
136
|
+
boundAgentId: string | null;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
};
|
|
140
|
+
type QuotaWindow = {
|
|
141
|
+
id: string;
|
|
142
|
+
usedPercent: number;
|
|
143
|
+
resetsAt: string | null;
|
|
144
|
+
};
|
|
145
|
+
type AgentQuota = {
|
|
146
|
+
supported: boolean;
|
|
147
|
+
reason?: string;
|
|
148
|
+
windows: QuotaWindow[];
|
|
149
|
+
exhausted: boolean;
|
|
150
|
+
exhaustedAt?: string | null;
|
|
151
|
+
capturedAt: string;
|
|
152
|
+
lastGoodAt?: string | null;
|
|
153
|
+
error?: string | null;
|
|
154
|
+
errorKind?: "auth" | "transient" | null;
|
|
155
|
+
source?: "poll" | "run_error";
|
|
156
|
+
};
|
|
157
|
+
type ReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
158
|
+
type Agent = {
|
|
159
|
+
id: string;
|
|
160
|
+
workspaceId: string;
|
|
161
|
+
provider: string;
|
|
162
|
+
harness: string;
|
|
163
|
+
displayName: string;
|
|
164
|
+
authStatus: string;
|
|
165
|
+
defaultResourceProfile: string;
|
|
166
|
+
maxConcurrency: number;
|
|
167
|
+
/** Free-form tenant tag set via metadata.ownerTag at create time — lets a
|
|
168
|
+
* product multiplexing many end users over one key filter agents per user. */
|
|
169
|
+
ownerTag: string | null;
|
|
170
|
+
modelId: string | null;
|
|
171
|
+
reasoningEffort: ReasoningEffort | null;
|
|
172
|
+
availableModels: string[];
|
|
173
|
+
createdAt: string;
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
};
|
|
176
|
+
type CredentialProvider = "claude" | "codex" | "grok" | "gemini" | "cursor" | "factory";
|
|
177
|
+
type AgentProvider = CredentialProvider | "opencode" | "goose" | "kimi" | "aider";
|
|
178
|
+
type AgentCreateInput = {
|
|
179
|
+
/** Model and credential provider. */
|
|
180
|
+
provider: CredentialProvider;
|
|
181
|
+
/** Vendor CLI to run. Defaults to provider for backward compatibility. */
|
|
182
|
+
harnessProvider?: AgentProvider;
|
|
183
|
+
harness: "tui" | "headless" | "tmux" | "cli";
|
|
184
|
+
modelId: string;
|
|
185
|
+
displayName?: string;
|
|
186
|
+
defaultResourceProfile?: "small" | "medium" | "large" | "xl";
|
|
187
|
+
maxConcurrency?: number;
|
|
188
|
+
/** Curated metadata only (the SDK surface rejects unknown keys).
|
|
189
|
+
* ownerTag is echoed back as agent.ownerTag for per-tenant filtering. */
|
|
190
|
+
metadata?: {
|
|
191
|
+
ownerTag?: string;
|
|
192
|
+
reasoningEffort?: ReasoningEffort;
|
|
193
|
+
region?: string;
|
|
194
|
+
};
|
|
195
|
+
workspaceId?: string;
|
|
196
|
+
};
|
|
197
|
+
type AgentRunCreateInput = {
|
|
198
|
+
/** Initial request for this run. Prefer prompt; instructions remains backward compatible. */
|
|
199
|
+
instructions?: string;
|
|
200
|
+
prompt?: string;
|
|
201
|
+
/** Markdown Goal specification. Supported when mode is goal. */
|
|
202
|
+
goal?: string;
|
|
203
|
+
agentId?: string;
|
|
204
|
+
provider?: CredentialProvider;
|
|
205
|
+
/** Workspace Provider instance override for an existing Agent. */
|
|
206
|
+
providerId?: string;
|
|
207
|
+
/** Credential override within providerId (or the Agent default Provider). */
|
|
208
|
+
credentialId?: string;
|
|
209
|
+
model?: string;
|
|
210
|
+
mode?: AgentRunMode;
|
|
211
|
+
resources?: AgentRunInputResource[];
|
|
212
|
+
idempotencyKey?: string;
|
|
213
|
+
timeoutSeconds?: number;
|
|
214
|
+
workspaceRevisionId?: string;
|
|
215
|
+
desktopRuntimeId?: string;
|
|
216
|
+
/** Existing Browserbase Session to bind to this run. Nodus releases it with the run. */
|
|
217
|
+
browserSessionId?: string;
|
|
218
|
+
/** Working directory on the paired desktop the run executes in (requires desktopRuntimeId). */
|
|
219
|
+
desktopCwd?: string;
|
|
220
|
+
persistent?: boolean;
|
|
221
|
+
metadata?: Record<string, unknown>;
|
|
222
|
+
/** JSON Schema for the final deliverable. The runtime is instructed to end
|
|
223
|
+
* with exactly one JSON document; Nodus parses it (falling back to captured
|
|
224
|
+
* JSON artifacts) into run.structuredOutput. */
|
|
225
|
+
outputSchema?: Record<string, unknown>;
|
|
226
|
+
};
|
|
227
|
+
type RuntimeEvent = {
|
|
228
|
+
id: string;
|
|
229
|
+
sequence: number;
|
|
230
|
+
turnId: string | null;
|
|
231
|
+
type: string;
|
|
232
|
+
terminal: "none" | "turn" | "run" | "cleanup";
|
|
233
|
+
payload: Record<string, unknown>;
|
|
234
|
+
raw?: {
|
|
235
|
+
provider: string;
|
|
236
|
+
type: string;
|
|
237
|
+
payload: Record<string, unknown>;
|
|
238
|
+
};
|
|
239
|
+
createdAt: string;
|
|
240
|
+
};
|
|
241
|
+
type RuntimeTurn = {
|
|
242
|
+
id: string;
|
|
243
|
+
status: "running" | "completed" | "failed";
|
|
244
|
+
acceptedSequence: number;
|
|
245
|
+
startedAt: string;
|
|
246
|
+
};
|
|
247
|
+
type RuntimeTurnResult = {
|
|
248
|
+
turnId: string;
|
|
249
|
+
status: "running" | "completed" | "failed";
|
|
250
|
+
events: RuntimeEvent[];
|
|
251
|
+
lastSequence: number;
|
|
252
|
+
finalOutput: string | null;
|
|
253
|
+
error: string | null;
|
|
254
|
+
};
|
|
255
|
+
type RuntimeSession = {
|
|
256
|
+
id: string;
|
|
257
|
+
/** Persistent sandbox (claude-only): survives across turns, exempt from idle reaping. */
|
|
258
|
+
persistent?: boolean;
|
|
259
|
+
agentId: string;
|
|
260
|
+
workspaceRevisionId: string | null;
|
|
261
|
+
desktopRuntimeId: string | null;
|
|
262
|
+
status: "created" | "live" | "pausing" | "paused" | "resuming" | "failed" | "destroyed";
|
|
263
|
+
resumeMode: "conversation";
|
|
264
|
+
lastActivityAt: string | null;
|
|
265
|
+
createdAt: string;
|
|
266
|
+
updatedAt: string;
|
|
267
|
+
};
|
|
268
|
+
type RuntimeTelemetry = {
|
|
269
|
+
provider: string;
|
|
270
|
+
busy: boolean;
|
|
271
|
+
live: boolean;
|
|
272
|
+
tokens?: {
|
|
273
|
+
input: number;
|
|
274
|
+
output: number;
|
|
275
|
+
cacheRead: number;
|
|
276
|
+
cacheCreate: number;
|
|
277
|
+
};
|
|
278
|
+
costUsd?: {
|
|
279
|
+
input: number;
|
|
280
|
+
output: number;
|
|
281
|
+
cacheRead: number;
|
|
282
|
+
cacheCreate: number;
|
|
283
|
+
total: number;
|
|
284
|
+
};
|
|
285
|
+
realTotalTokens?: number;
|
|
286
|
+
cacheHitRate?: number;
|
|
287
|
+
usageReported?: boolean;
|
|
288
|
+
assistantMessages?: number;
|
|
289
|
+
userMessages?: number;
|
|
290
|
+
toolUses?: number;
|
|
291
|
+
lastActivityAt?: string | null;
|
|
292
|
+
model?: string | null;
|
|
293
|
+
resources?: {
|
|
294
|
+
cpuPercent: number;
|
|
295
|
+
memoryBytes: number;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
type RuntimeTelemetryPoint = {
|
|
299
|
+
t: number;
|
|
300
|
+
input: number;
|
|
301
|
+
output: number;
|
|
302
|
+
total: number;
|
|
303
|
+
cost: number;
|
|
304
|
+
busy: boolean;
|
|
305
|
+
cpu: number;
|
|
306
|
+
memory: number;
|
|
307
|
+
};
|
|
308
|
+
type RuntimePort = {
|
|
309
|
+
process: string;
|
|
310
|
+
port: number;
|
|
311
|
+
};
|
|
312
|
+
type RuntimeDiff = {
|
|
313
|
+
status?: string;
|
|
314
|
+
patch?: string;
|
|
315
|
+
hash: string;
|
|
316
|
+
unchanged?: boolean;
|
|
317
|
+
};
|
|
318
|
+
declare class NodusError extends Error {
|
|
319
|
+
readonly status: number;
|
|
320
|
+
readonly data: unknown;
|
|
321
|
+
readonly code: string | null;
|
|
322
|
+
readonly retryAt: string | null;
|
|
323
|
+
constructor(message: string, status: number, data: unknown);
|
|
324
|
+
}
|
|
325
|
+
type WaitOptions = {
|
|
326
|
+
timeoutMs?: number;
|
|
327
|
+
pollIntervalMs?: number;
|
|
328
|
+
signal?: AbortSignal;
|
|
329
|
+
};
|
|
330
|
+
type TurnWaitOptions = {
|
|
331
|
+
turnId: string;
|
|
332
|
+
afterSequence?: number;
|
|
333
|
+
timeoutMs?: number;
|
|
334
|
+
waitSeconds?: number;
|
|
335
|
+
signal?: AbortSignal;
|
|
336
|
+
};
|
|
337
|
+
type EventOptions = {
|
|
338
|
+
after?: number;
|
|
339
|
+
};
|
|
340
|
+
type StreamOptions = EventOptions & {
|
|
341
|
+
pollIntervalMs?: number;
|
|
342
|
+
signal?: AbortSignal;
|
|
343
|
+
};
|
|
344
|
+
type AgentRunListOptions = {
|
|
345
|
+
agentId?: string;
|
|
346
|
+
status?: AgentRunStatus;
|
|
347
|
+
cursor?: string;
|
|
348
|
+
limit?: number;
|
|
349
|
+
metadata?: Record<string, string>;
|
|
350
|
+
};
|
|
351
|
+
declare function createNodus(options: {
|
|
352
|
+
baseUrl: string;
|
|
353
|
+
apiKey: string;
|
|
354
|
+
fetch?: typeof fetch;
|
|
355
|
+
requestTimeoutMs?: number;
|
|
356
|
+
}): {
|
|
357
|
+
agents: {
|
|
358
|
+
list: () => Promise<Agent[]>;
|
|
359
|
+
/** Create an agent in the SDK key's workspace. Provider credentials are managed at workspace level. */
|
|
360
|
+
create: (input: AgentCreateInput) => Promise<{
|
|
361
|
+
agent: Agent;
|
|
362
|
+
}>;
|
|
363
|
+
update: (agentId: string, configuration: {
|
|
364
|
+
modelId?: string | null;
|
|
365
|
+
reasoningEffort?: ReasoningEffort | null;
|
|
366
|
+
}) => Promise<{
|
|
367
|
+
agent: Agent;
|
|
368
|
+
}>;
|
|
369
|
+
setRunConcurrency: (agentId: string, maxConcurrency: number) => Promise<{
|
|
370
|
+
agent: {
|
|
371
|
+
id: string;
|
|
372
|
+
maxConcurrency: number;
|
|
373
|
+
};
|
|
374
|
+
}>;
|
|
375
|
+
/** Remaining provider quota for one agent (cc-switch-style windows).
|
|
376
|
+
* `refresh: true` forces a live probe instead of the hourly snapshot. */
|
|
377
|
+
quota: (agentId: string, options?: {
|
|
378
|
+
refresh?: boolean;
|
|
379
|
+
}) => Promise<{
|
|
380
|
+
agentId: string;
|
|
381
|
+
quota: AgentQuota | null;
|
|
382
|
+
}>;
|
|
383
|
+
setConcurrency: (agentId: string, maxConcurrency: number) => Promise<{
|
|
384
|
+
agent: {
|
|
385
|
+
id: string;
|
|
386
|
+
maxConcurrency: number;
|
|
387
|
+
};
|
|
388
|
+
}>;
|
|
389
|
+
};
|
|
390
|
+
agentRuns: {
|
|
391
|
+
list: (listOptions?: AgentRunListOptions) => Promise<{
|
|
392
|
+
runs: AgentRunSummary[];
|
|
393
|
+
nextCursor: string | null;
|
|
394
|
+
}>;
|
|
395
|
+
queueStats: () => Promise<{
|
|
396
|
+
queued: number;
|
|
397
|
+
provisioning: number;
|
|
398
|
+
running: number;
|
|
399
|
+
completedLast10m: number;
|
|
400
|
+
throughputPerMinute: number;
|
|
401
|
+
}>;
|
|
402
|
+
create: (input: AgentRunCreateInput) => Promise<{
|
|
403
|
+
run: AgentRun;
|
|
404
|
+
}>;
|
|
405
|
+
get: (runId: string) => Promise<{
|
|
406
|
+
run: AgentRun;
|
|
407
|
+
}>;
|
|
408
|
+
events: (runId: string, eventOptions?: EventOptions) => Promise<{
|
|
409
|
+
events: RuntimeEvent[];
|
|
410
|
+
}>;
|
|
411
|
+
stream: (runId: string, streamOptions?: StreamOptions) => AsyncGenerator<RuntimeEvent, any, any>;
|
|
412
|
+
cancel: (runId: string) => Promise<{
|
|
413
|
+
run: AgentRun;
|
|
414
|
+
}>;
|
|
415
|
+
cancelMany: (runIds: string[]) => Promise<AgentRun[]>;
|
|
416
|
+
getArtifactDownloadUrl: (runId: string, artifactId: string) => Promise<{
|
|
417
|
+
url: string;
|
|
418
|
+
expiresAt: string;
|
|
419
|
+
}>;
|
|
420
|
+
wait: (runId: string, waitOptions?: WaitOptions) => Promise<AgentRun>;
|
|
421
|
+
createAndWait: (input: AgentRunCreateInput, waitOptions?: WaitOptions) => Promise<AgentRun>;
|
|
422
|
+
};
|
|
423
|
+
sessions: {
|
|
424
|
+
create: (input: {
|
|
425
|
+
agentId: string;
|
|
426
|
+
workspaceRevisionId?: string;
|
|
427
|
+
desktopRuntimeId?: string;
|
|
428
|
+
desktopCwd?: string;
|
|
429
|
+
persistent?: boolean;
|
|
430
|
+
}) => Promise<{
|
|
431
|
+
session: RuntimeSession;
|
|
432
|
+
}>;
|
|
433
|
+
list: (options?: {
|
|
434
|
+
status?: "active" | RuntimeSession["status"];
|
|
435
|
+
limit?: number;
|
|
436
|
+
cursor?: string;
|
|
437
|
+
}) => Promise<{
|
|
438
|
+
sessions: Array<RuntimeSession & {
|
|
439
|
+
provider: string | null;
|
|
440
|
+
runId: string | null;
|
|
441
|
+
runStatus: AgentRunStatus | null;
|
|
442
|
+
resourceProfile: string | null;
|
|
443
|
+
hasWorkspaceSnapshot: boolean;
|
|
444
|
+
hasAgentHomeSnapshot: boolean;
|
|
445
|
+
activeTurnId: string | null;
|
|
446
|
+
lastUsage: RuntimeTelemetry | null;
|
|
447
|
+
lastUsageAt: string | null;
|
|
448
|
+
}>;
|
|
449
|
+
nextCursor: string | null;
|
|
450
|
+
}>;
|
|
451
|
+
get: (sessionId: string) => Promise<{
|
|
452
|
+
session: RuntimeSession;
|
|
453
|
+
}>;
|
|
454
|
+
telemetry: (sessionId: string) => Promise<{
|
|
455
|
+
reachable: boolean;
|
|
456
|
+
telemetry: RuntimeTelemetry | null;
|
|
457
|
+
}>;
|
|
458
|
+
telemetryHistory: (sessionId: string, options?: {
|
|
459
|
+
startMs?: number;
|
|
460
|
+
endMs?: number;
|
|
461
|
+
stepSec?: number;
|
|
462
|
+
}) => Promise<{
|
|
463
|
+
startMs: number;
|
|
464
|
+
endMs: number;
|
|
465
|
+
stepSec: number;
|
|
466
|
+
points: RuntimeTelemetryPoint[];
|
|
467
|
+
}>;
|
|
468
|
+
diff: (sessionId: string, known?: string) => Promise<RuntimeDiff>;
|
|
469
|
+
terminalTicket: (sessionId: string) => Promise<{
|
|
470
|
+
ticket: string;
|
|
471
|
+
}>;
|
|
472
|
+
ports: (sessionId: string, known?: string) => Promise<{
|
|
473
|
+
ports?: RuntimePort[];
|
|
474
|
+
hash: string;
|
|
475
|
+
unchanged?: boolean;
|
|
476
|
+
}>;
|
|
477
|
+
git: (sessionId: string, input: {
|
|
478
|
+
action: "commit" | "revert";
|
|
479
|
+
message?: string;
|
|
480
|
+
path?: string;
|
|
481
|
+
}) => Promise<{
|
|
482
|
+
ok: boolean;
|
|
483
|
+
pushed: boolean;
|
|
484
|
+
output: string;
|
|
485
|
+
}>;
|
|
486
|
+
run: (sessionId: string, text: string, options?: {
|
|
487
|
+
attachments?: SessionAttachment[];
|
|
488
|
+
}) => Promise<{
|
|
489
|
+
turn: RuntimeTurn;
|
|
490
|
+
}>;
|
|
491
|
+
execWorkspace: (sessionId: string, cmd: string, timeoutSeconds?: number) => Promise<{
|
|
492
|
+
exitCode: number;
|
|
493
|
+
stdout: string;
|
|
494
|
+
stderr: string;
|
|
495
|
+
}>;
|
|
496
|
+
waitForIdle: (sessionId: string, options: TurnWaitOptions) => Promise<RuntimeTurnResult>;
|
|
497
|
+
runAndWait: (sessionId: string, text: string, waitOptions?: Omit<TurnWaitOptions, "turnId" | "afterSequence"> & {
|
|
498
|
+
attachments?: SessionAttachment[];
|
|
499
|
+
}) => Promise<RuntimeTurnResult>;
|
|
500
|
+
events: (sessionId: string, eventOptions?: EventOptions) => Promise<{
|
|
501
|
+
events: RuntimeEvent[];
|
|
502
|
+
}>;
|
|
503
|
+
stream: (sessionId: string, streamOptions?: StreamOptions) => AsyncGenerator<RuntimeEvent, any, any>;
|
|
504
|
+
pause: (sessionId: string) => Promise<{
|
|
505
|
+
session: RuntimeSession;
|
|
506
|
+
}>;
|
|
507
|
+
resume: (sessionId: string) => Promise<{
|
|
508
|
+
session: RuntimeSession;
|
|
509
|
+
}>;
|
|
510
|
+
activate: (sessionId: string) => Promise<{
|
|
511
|
+
session: RuntimeSession;
|
|
512
|
+
}>;
|
|
513
|
+
destroy: (sessionId: string) => Promise<{
|
|
514
|
+
session: RuntimeSession;
|
|
515
|
+
}>;
|
|
516
|
+
};
|
|
517
|
+
workspaces: {
|
|
518
|
+
create: (input: {
|
|
519
|
+
name: string;
|
|
520
|
+
defaultResourceProfile?: "small" | "medium" | "large" | "xl";
|
|
521
|
+
}) => Promise<{
|
|
522
|
+
workspace: WorkspaceRuntime;
|
|
523
|
+
}>;
|
|
524
|
+
list: () => Promise<WorkspaceRuntime[]>;
|
|
525
|
+
get: (workspaceId: string) => Promise<{
|
|
526
|
+
workspace: WorkspaceRuntime;
|
|
527
|
+
}>;
|
|
528
|
+
archive: (workspaceId: string) => Promise<{
|
|
529
|
+
workspace: WorkspaceRuntime;
|
|
530
|
+
}>;
|
|
531
|
+
revisions: (workspaceId: string) => Promise<WorkspaceRevision[]>;
|
|
532
|
+
startBuilder: (workspaceId: string, input?: {
|
|
533
|
+
baseRevisionId?: string | null;
|
|
534
|
+
}) => Promise<{
|
|
535
|
+
build: WorkspaceBuild;
|
|
536
|
+
}>;
|
|
537
|
+
getBuild: (buildId: string) => Promise<{
|
|
538
|
+
build: WorkspaceBuild;
|
|
539
|
+
}>;
|
|
540
|
+
exec: (buildId: string, cmd: string, timeoutSeconds?: number) => Promise<{
|
|
541
|
+
exitCode: number;
|
|
542
|
+
stdout: string;
|
|
543
|
+
stderr: string;
|
|
544
|
+
}>;
|
|
545
|
+
listFiles: (buildId: string, path?: string) => Promise<{
|
|
546
|
+
path: string;
|
|
547
|
+
entries: Array<{
|
|
548
|
+
name: string;
|
|
549
|
+
type: "file" | "dir";
|
|
550
|
+
path: string;
|
|
551
|
+
}>;
|
|
552
|
+
}>;
|
|
553
|
+
readFile: (buildId: string, path: string) => Promise<{
|
|
554
|
+
path: string;
|
|
555
|
+
sizeBytes: number;
|
|
556
|
+
contentBase64: string;
|
|
557
|
+
}>;
|
|
558
|
+
writeFile: (buildId: string, path: string, content: string | Uint8Array) => Promise<{
|
|
559
|
+
ok: boolean;
|
|
560
|
+
path: string;
|
|
561
|
+
}>;
|
|
562
|
+
upload: (buildId: string, path: string, content: Uint8Array) => Promise<{
|
|
563
|
+
ok: boolean;
|
|
564
|
+
path: string;
|
|
565
|
+
}>;
|
|
566
|
+
download: (buildId: string, path: string) => Promise<Buffer<ArrayBuffer>>;
|
|
567
|
+
publish: (buildId: string) => Promise<{
|
|
568
|
+
revision: WorkspaceRevision;
|
|
569
|
+
}>;
|
|
570
|
+
destroyBuilder: (buildId: string) => Promise<{
|
|
571
|
+
build: WorkspaceBuild;
|
|
572
|
+
}>;
|
|
573
|
+
createContextUpload: (workspaceId: string) => Promise<{
|
|
574
|
+
objectKey: string;
|
|
575
|
+
uploadUrl: string;
|
|
576
|
+
}>;
|
|
577
|
+
buildFromDockerfile: (workspaceId: string, input: {
|
|
578
|
+
contextBlobKey: string;
|
|
579
|
+
dockerfilePath?: string;
|
|
580
|
+
}) => Promise<{
|
|
581
|
+
build: WorkspaceBuild;
|
|
582
|
+
}>;
|
|
583
|
+
buildFromContext: (workspaceId: string, input: {
|
|
584
|
+
contextBlobKey: string;
|
|
585
|
+
dockerfilePath?: string;
|
|
586
|
+
}) => Promise<{
|
|
587
|
+
build: WorkspaceBuild;
|
|
588
|
+
}>;
|
|
589
|
+
};
|
|
590
|
+
desktopRuntimes: {
|
|
591
|
+
/** options.agentId — only runtimes BOUND to that agent (exact filter). */
|
|
592
|
+
list: (options?: {
|
|
593
|
+
agentId?: string;
|
|
594
|
+
}) => Promise<DesktopRuntime[]>;
|
|
595
|
+
get: (id: string) => Promise<{
|
|
596
|
+
desktopRuntime: DesktopRuntime;
|
|
597
|
+
}>;
|
|
598
|
+
rename: (id: string, name: string) => Promise<{
|
|
599
|
+
desktopRuntime: DesktopRuntime;
|
|
600
|
+
}>;
|
|
601
|
+
/** Bind the runtime to one agent (null unbinds). While bound, only that
|
|
602
|
+
* agent's runs/sessions may execute on the runtime. */
|
|
603
|
+
bind: (id: string, agentId: string | null) => Promise<{
|
|
604
|
+
desktopRuntime: DesktopRuntime;
|
|
605
|
+
}>;
|
|
606
|
+
grants: (id: string) => Promise<{
|
|
607
|
+
grants: DesktopRuntimeGrant[];
|
|
608
|
+
}>;
|
|
609
|
+
grant: (id: string, agentId: string, permission: DesktopRuntimePermission) => Promise<{
|
|
610
|
+
grant: DesktopRuntimeGrant;
|
|
611
|
+
}>;
|
|
612
|
+
revokeGrant: (id: string, agentId: string) => Promise<{
|
|
613
|
+
ok: boolean;
|
|
614
|
+
}>;
|
|
615
|
+
browse: (id: string, input?: {
|
|
616
|
+
path?: string;
|
|
617
|
+
dirsOnly?: boolean;
|
|
618
|
+
}) => Promise<{
|
|
619
|
+
entries: Array<Record<string, unknown>>;
|
|
620
|
+
}>;
|
|
621
|
+
read: (id: string, path: string) => Promise<{
|
|
622
|
+
path: string;
|
|
623
|
+
sizeBytes: number;
|
|
624
|
+
content?: string;
|
|
625
|
+
contentBase64?: string;
|
|
626
|
+
mime?: string;
|
|
627
|
+
}>;
|
|
628
|
+
ports: (id: string, known?: string) => Promise<{
|
|
629
|
+
ports?: RuntimePort[];
|
|
630
|
+
hash: string;
|
|
631
|
+
unchanged?: boolean;
|
|
632
|
+
}>;
|
|
633
|
+
attach: (id: string, input: {
|
|
634
|
+
name: string;
|
|
635
|
+
contentBase64: string;
|
|
636
|
+
}) => Promise<{
|
|
637
|
+
path: string;
|
|
638
|
+
}>;
|
|
639
|
+
terminalTicket: (id: string) => Promise<{
|
|
640
|
+
ticket: string;
|
|
641
|
+
}>;
|
|
642
|
+
reveal: (id: string, input: {
|
|
643
|
+
path: string;
|
|
644
|
+
app?: "finder" | "editor" | "terminal";
|
|
645
|
+
}) => Promise<{
|
|
646
|
+
exitCode: number;
|
|
647
|
+
stdout: string;
|
|
648
|
+
stderr: string;
|
|
649
|
+
}>;
|
|
650
|
+
disconnect: (id: string) => Promise<{
|
|
651
|
+
ok: true;
|
|
652
|
+
}>;
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
type NodusClient = ReturnType<typeof createNodus>;
|
|
656
|
+
declare const NODUS_SDK_VERSION = "0.4.0-preview.47";
|
|
657
|
+
declare function getNodusFeatureManifest(): {
|
|
658
|
+
workspaceCredentialFailover: boolean;
|
|
659
|
+
fixedSessionIdentity: boolean;
|
|
660
|
+
persistentSessionSnapshots: boolean;
|
|
661
|
+
runtimeResourceTelemetry: boolean;
|
|
662
|
+
cliIntrospection: boolean;
|
|
663
|
+
inlineRunResources: boolean;
|
|
664
|
+
sessionAttachments: boolean;
|
|
665
|
+
providers: readonly ["claude", "codex", "grok", "gemini", "cursor", "factory"];
|
|
666
|
+
};
|
|
667
|
+
declare function getNodusCliManifest(): readonly [{
|
|
668
|
+
readonly command: "nodus login|auth status|logout";
|
|
669
|
+
readonly description: "Authorize the CLI in a browser and manage local credential profiles.";
|
|
670
|
+
}, {
|
|
671
|
+
readonly command: "nodus sdk";
|
|
672
|
+
readonly description: "List installed SDK methods, features, and CLI commands.";
|
|
673
|
+
}, {
|
|
674
|
+
readonly command: "nodus capabilities";
|
|
675
|
+
readonly description: "Alias for `nodus sdk`.";
|
|
676
|
+
}, {
|
|
677
|
+
readonly command: "nodus agents list|quota|configure|concurrency";
|
|
678
|
+
readonly description: "Inspect and configure every Agent available to the SDK key.";
|
|
679
|
+
}, {
|
|
680
|
+
readonly command: "nodus agents deploy --provider <provider> --api-key <key> [--name <displayName>] [--owner-tag <tag>]";
|
|
681
|
+
readonly description: "Create an Agent in the key's Workspace and authenticate it with a provider API key.";
|
|
682
|
+
}, {
|
|
683
|
+
readonly command: "nodus run --agent <id> --prompt <text> [--goal-file <markdown>] [--attach <file>]... [--wait]";
|
|
684
|
+
readonly description: "Run one task on a specific Agent. Goal Markdown is stored separately from the initial prompt.";
|
|
685
|
+
}, {
|
|
686
|
+
readonly command: "nodus run --provider <provider> [--model <model>] --prompt <text> [--goal-file <markdown>] [--attach <file>]... [--wait]";
|
|
687
|
+
readonly description: "Let a Workspace key route a task; --goal-file enables Codex Goal mode.";
|
|
688
|
+
}, {
|
|
689
|
+
readonly command: "nodus runs list|get|events|cancel|artifact";
|
|
690
|
+
readonly description: "Inspect and control existing Agent Runs, including artifact download URLs.";
|
|
691
|
+
}, {
|
|
692
|
+
readonly command: "nodus session list|create|get|run|exec|events|telemetry|telemetry-history|diff|ports|git|terminal-ticket|pause|resume|destroy";
|
|
693
|
+
readonly description: "List, create, observe, and control persistent or temporary runtime Sessions.";
|
|
694
|
+
}, {
|
|
695
|
+
readonly command: "nodus workspace create|list|get|revisions|archive|build";
|
|
696
|
+
readonly description: "Create, inspect, archive, and build persistent Workspace runtimes.";
|
|
697
|
+
}, {
|
|
698
|
+
readonly command: "nodus workspace builder start|exec|put|get|files|status|publish|destroy";
|
|
699
|
+
readonly description: "Build and publish Workspace revisions interactively.";
|
|
700
|
+
}, {
|
|
701
|
+
readonly command: "nodus desktop connect|list|get|rename|browse|read|ports|attach|reveal|terminal-ticket|disconnect";
|
|
702
|
+
readonly description: "Attach, inspect, control, or disconnect a local Desktop runtime.";
|
|
703
|
+
}, {
|
|
704
|
+
readonly command: "nodus desktop bind --desktop <id> [--agent <id>|--none]";
|
|
705
|
+
readonly description: "Bind a Desktop runtime to one Agent (only that Agent's runs/sessions may use it) or unbind it.";
|
|
706
|
+
}];
|
|
707
|
+
declare function listNodusCapabilities(client: NodusClient): string[];
|
|
708
|
+
|
|
709
|
+
export { type Agent, type AgentCreateInput, type AgentProvider, type AgentQuota, type AgentRun, type AgentRunArtifact, type AgentRunCreateInput, type AgentRunInputResource, type AgentRunMetadata, type AgentRunMode, type AgentRunResource, type AgentRunStatus, type AgentRunSummary, type AgentRunUsage, type CredentialProvider, type DesktopRuntime, type DesktopRuntimeGrant, type DesktopRuntimePermission, NODUS_SDK_VERSION, type NodusClient, NodusError, type QuotaWindow, type ReasoningEffort, type RuntimeDiff, type RuntimeEvent, type RuntimePort, type RuntimeSession, type RuntimeTelemetry, type RuntimeTelemetryPoint, type RuntimeTurn, type RuntimeTurnResult, type SessionAttachment, type WorkspaceBuild, type WorkspaceRevision, type WorkspaceRuntime, createNodus, getNodusCliManifest, getNodusFeatureManifest, listNodusCapabilities };
|