@agent-compose/sdk 0.8.5 → 0.8.7
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 +213 -189
- package/dist/agent/agent-context.d.ts +3 -3
- package/dist/agent/agent-loop.d.ts +6 -5
- package/dist/agent/perf-sampler.d.ts +27 -2
- package/dist/agent/run-agent.d.ts +1 -1
- package/dist/client.d.ts +119 -54
- package/dist/directives.d.ts +3 -3
- package/dist/display.d.ts +7 -0
- package/dist/errors.d.ts +1 -1
- package/dist/generated/agentc-commands.d.ts +34 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.js +771 -204
- package/dist/request-context/request-context.d.ts +1 -1
- package/dist/runtimes/_cli-agent.d.ts +185 -68
- package/dist/runtimes/_reported-model.d.ts +16 -0
- package/dist/runtimes/claude-code.d.ts +60 -1
- package/dist/runtimes/claude.d.ts +1 -1
- package/dist/runtimes/codex.d.ts +94 -6
- package/dist/runtimes/codex.mid-turn-hook.test.d.ts +10 -0
- package/dist/runtimes/model-report.test.d.ts +14 -0
- package/dist/runtimes/openai-desktop.js +741 -200
- package/dist/runtimes/opencode.d.ts +48 -11
- package/dist/runtimes/opencode.test.d.ts +14 -0
- package/dist/sandbox/baked-clis.d.ts +75 -0
- package/dist/sandbox/exec-stream.d.ts +1 -2
- package/dist/sandbox/network-policy.d.ts +23 -5
- package/dist/sandbox.d.ts +4 -2
- package/dist/step-invocation/protocol.d.ts +3 -4
- package/dist/step-invocation/server.d.ts +2 -2
- package/dist/step-invocation/types.d.ts +1 -1
- package/dist/types/api-conversations.d.ts +442 -29
- package/dist/types/api-factory.d.ts +99 -10
- package/dist/types/api-projects.d.ts +521 -0
- package/dist/types/api-runs.d.ts +83 -0
- package/dist/types/api-scopes.d.ts +32 -3
- package/dist/types/conversation-stream.d.ts +5 -0
- package/dist/types/execution-context.d.ts +1 -1
- package/dist/types/protocol.d.ts +86 -2
- package/dist/types/runtime.d.ts +9 -2
- package/dist/types/workflow-metadata.d.ts +2 -4
- package/dist/types/workflow-plan.d.ts +1 -3
- package/dist/utils/bundler.d.ts +23 -0
- package/dist/workflow-steps/observability.d.ts +2 -3
- package/dist/workflow-steps/runner.d.ts +5 -8
- package/dist/workflow-steps/types.d.ts +8 -10
- package/dist/workflow-steps/workflow.d.ts +2 -1
- package/dist/workflows/engine.d.ts +3 -5
- package/dist/workflows/invoke-child.d.ts +2 -2
- package/package.json +2 -2
- package/src/agent/agent-context.ts +168 -125
- package/src/agent/agent-loop.ts +7 -6
- package/src/agent/perf-sampler.ts +54 -3
- package/src/agent/run-agent.ts +1 -1
- package/src/client.ts +226 -71
- package/src/directives.ts +3 -3
- package/src/display.ts +12 -0
- package/src/errors.ts +1 -0
- package/src/generated/agentc-commands.ts +571 -0
- package/src/index.ts +57 -21
- package/src/pause/pause-core.ts +2 -1
- package/src/request-context/request-context.ts +1 -1
- package/src/runtimes/_cli-agent.ts +318 -122
- package/src/runtimes/_reported-model.ts +24 -0
- package/src/runtimes/claude-code.ts +195 -12
- package/src/runtimes/claude.ts +9 -2
- package/src/runtimes/codex.ts +188 -19
- package/src/runtimes/opencode.ts +195 -26
- package/src/sandbox/baked-clis.ts +86 -0
- package/src/sandbox/exec-stream.ts +1 -2
- package/src/sandbox/network-policy.ts +51 -7
- package/src/sandbox/providers/e2b.ts +3 -3
- package/src/sandbox/providers/vercel.ts +6 -6
- package/src/sandbox.ts +8 -2
- package/src/step-invocation/invoker.ts +2 -6
- package/src/step-invocation/protocol.ts +3 -4
- package/src/step-invocation/server.ts +2 -2
- package/src/types/api-conversations.ts +366 -23
- package/src/types/api-factory.ts +95 -10
- package/src/types/api-projects.ts +477 -0
- package/src/types/api-runs.ts +73 -0
- package/src/types/api-scopes.ts +32 -3
- package/src/types/conversation-stream.ts +5 -0
- package/src/types/execution-context.ts +1 -1
- package/src/types/protocol.ts +91 -2
- package/src/types/runtime.ts +8 -2
- package/src/types/sandbox-environment.ts +1 -2
- package/src/types/workflow-metadata.ts +2 -4
- package/src/types/workflow-plan.ts +1 -3
- package/src/utils/bundler.ts +88 -19
- package/src/workflow-steps/observability.ts +2 -3
- package/src/workflow-steps/runner.ts +5 -8
- package/src/workflow-steps/types.ts +8 -10
- package/src/workflow-steps/workflow.ts +2 -1
- package/src/workflows/engine.ts +3 -5
- package/src/workflows/invoke-child.ts +2 -2
- package/dist/generated/verb-synopsis.d.ts +0 -34
- package/dist/pause/__tests__/errors.test.d.ts +0 -1
- package/dist/pause/__tests__/wrappers.test.d.ts +0 -1
- package/dist/step-invocation/__tests__/protocol.test.d.ts +0 -1
- package/src/generated/verb-synopsis.ts +0 -544
|
@@ -96,6 +96,18 @@ export interface RegisterWorkflowInput {
|
|
|
96
96
|
factoryDrive?: "required" | "none";
|
|
97
97
|
/** Factory slug. Defaults to `"default"`. */
|
|
98
98
|
factorySlug?: string;
|
|
99
|
+
/** Register INTO a project (`agentc register --project`, ADR-0087): the
|
|
100
|
+
* workflow, its schedules and its runs are visible to the project's
|
|
101
|
+
* members alone, read live, so leaving the project loses them — the
|
|
102
|
+
* registrant included (the workflow belongs to the project, with no
|
|
103
|
+
* personal owner). Any member with a write or owner seat in the project
|
|
104
|
+
* may register into it on a key that holds `invoke`; the `manage` scope
|
|
105
|
+
* is not needed. A read seat is refused (403 `role_read_only`); a
|
|
106
|
+
* project the registrant cannot see answers 404 exactly as one that does
|
|
107
|
+
* not exist. Omitted, a registration from a terminal or an API key is
|
|
108
|
+
* the whole space's and takes `manage` (403 `manage_required`
|
|
109
|
+
* otherwise). */
|
|
110
|
+
projectId?: string;
|
|
99
111
|
}
|
|
100
112
|
export interface TemplateRow {
|
|
101
113
|
name: string;
|
|
@@ -128,9 +140,10 @@ export interface TemplateDetail {
|
|
|
128
140
|
export interface ListTemplatesOptions {
|
|
129
141
|
factorySlug?: string;
|
|
130
142
|
}
|
|
131
|
-
/** One
|
|
132
|
-
*
|
|
133
|
-
*
|
|
143
|
+
/** One connector grant, as `GET /api/v1/connectors` returns it (wire shape
|
|
144
|
+
* verbatim — snake_case): the caller's own grants and the workspace's
|
|
145
|
+
* GitHub installations, never a teammate's other accounts. The typed
|
|
146
|
+
* subset the SDK pins; additional fields flow through untyped. */
|
|
134
147
|
export interface ConnectorGrantSummary {
|
|
135
148
|
id: string;
|
|
136
149
|
provider: string;
|
|
@@ -304,6 +317,8 @@ export interface UpdateFactoryInput {
|
|
|
304
317
|
}
|
|
305
318
|
export interface ScheduleRow {
|
|
306
319
|
id: string;
|
|
320
|
+
/** The factory the schedule (and the workflow it fires) lives in. */
|
|
321
|
+
factoryId: string;
|
|
307
322
|
name: string;
|
|
308
323
|
workflowName: string;
|
|
309
324
|
cron: string;
|
|
@@ -366,18 +381,68 @@ export type SessionSecretInput = {
|
|
|
366
381
|
* single-use page a session writer opens to provide the named values. */
|
|
367
382
|
export interface SessionSecretRequestCreated {
|
|
368
383
|
requestId: string;
|
|
369
|
-
|
|
384
|
+
/** The single-use link, the owner's to tap. Null on a DEDUPED answer: the
|
|
385
|
+
* open ask's link already went out and nothing new exists to send. */
|
|
386
|
+
url: string | null;
|
|
370
387
|
expiresAt: string;
|
|
371
|
-
/** True = a standing auto-approve set
|
|
372
|
-
* mint — nothing is pending
|
|
388
|
+
/** True = a standing auto-approve set or this work's grant already filled
|
|
389
|
+
* the request at the mint — nothing is pending. */
|
|
373
390
|
autoApproved?: boolean;
|
|
391
|
+
/** With autoApproved: true = the values are on the session's RUNNING
|
|
392
|
+
* machine now (its env file, and its egress ruleset for a brokered key),
|
|
393
|
+
* so re-sourcing the session env loads them; false = no machine is
|
|
394
|
+
* running or the push failed, and they land when the next turn starts. */
|
|
395
|
+
loaded?: boolean;
|
|
396
|
+
/** Set with autoApproved when the grant came from this work's earlier
|
|
397
|
+
* worker (the same person's grant, carried with no card): who gave it. */
|
|
398
|
+
carried?: {
|
|
399
|
+
grantedByName: string | null;
|
|
400
|
+
};
|
|
401
|
+
/** True = an OPEN request of the same kind (or the same key set) already
|
|
402
|
+
* stood on this session, and this answer IS that request: no new row, no
|
|
403
|
+
* new card, nobody asked again. `keys` are the open request's key names,
|
|
404
|
+
* the names the values land under; `note` says what to do. */
|
|
405
|
+
deduped?: boolean;
|
|
406
|
+
keys?: string[];
|
|
407
|
+
kind?: VaultRequestKind | null;
|
|
408
|
+
note?: string;
|
|
409
|
+
/** Who holds the ask: the thread's agent (it raises the card once), the
|
|
410
|
+
* owner's assistant, or nobody (no owner, no agent). */
|
|
411
|
+
routedTo?: "agent" | "owner" | null;
|
|
412
|
+
/** A chat's worker: its card is in the chat, where the work was asked for. */
|
|
413
|
+
card?: "in the chat";
|
|
374
414
|
}
|
|
375
415
|
/** What KIND of credential a vault request asks for (advisory): the vault
|
|
376
416
|
* page leads with the user's MATCHING standing entries. */
|
|
377
417
|
export type VaultRequestKind = "login" | "password" | "api_key" | "payment_card" | "env_file" | "note" | "other";
|
|
418
|
+
/** How one requested key is delivered to the session: BROKERED — the egress
|
|
419
|
+
* edge adds `headerName: [scheme ]<value>` on requests to `host`, and the
|
|
420
|
+
* value never enters the machine; INJECTED — the value lands in the session
|
|
421
|
+
* env file. An `api_key` request declares one per key. */
|
|
422
|
+
export type VaultKeyShape = {
|
|
423
|
+
mode: "brokered";
|
|
424
|
+
host: string;
|
|
425
|
+
headerName: string;
|
|
426
|
+
scheme?: string;
|
|
427
|
+
} | {
|
|
428
|
+
mode: "injected";
|
|
429
|
+
};
|
|
430
|
+
/** The STANDING entry a request is for, named by its label and/or (a card)
|
|
431
|
+
* its last four digits — at least one. The card and the vault page lead
|
|
432
|
+
* with that entry, so the person sees which saved credential is meant. */
|
|
433
|
+
export interface RequestedVaultEntry {
|
|
434
|
+
label?: string;
|
|
435
|
+
last4?: string;
|
|
436
|
+
}
|
|
437
|
+
/** A saved payment card's receipts: its network (from the number's issuer
|
|
438
|
+
* prefix; null when unknown) and its last four. Never more. */
|
|
439
|
+
export interface VaultCardHint {
|
|
440
|
+
brand: string | null;
|
|
441
|
+
last4: string;
|
|
442
|
+
}
|
|
378
443
|
/** One STANDING vault entry usable for a session (the catalog read,
|
|
379
|
-
* 2026-08-31) — labels, kinds, and field NAMES only; values
|
|
380
|
-
* and never on this wire. */
|
|
444
|
+
* 2026-08-31) — labels, kinds, identifiers and field NAMES only; values
|
|
445
|
+
* are write-only and never on this wire. */
|
|
381
446
|
export interface VaultCatalogEntry {
|
|
382
447
|
label: string;
|
|
383
448
|
kind: string;
|
|
@@ -386,6 +451,12 @@ export interface VaultCatalogEntry {
|
|
|
386
451
|
ownerName: string | null;
|
|
387
452
|
projectName: string | null;
|
|
388
453
|
lastUsedAt: string | null;
|
|
454
|
+
/** The account the entry belongs to, or a card's network and last four
|
|
455
|
+
* ("Amex •••• 1002") — how look-alike labels are told apart. Absent on
|
|
456
|
+
* an older server. */
|
|
457
|
+
identifier?: string | null;
|
|
458
|
+
/** The card's receipts when the entry is a card; null otherwise. */
|
|
459
|
+
card?: VaultCardHint | null;
|
|
389
460
|
}
|
|
390
461
|
/** A vault link's polled status. */
|
|
391
462
|
export interface SessionSecretRequestStatus {
|
|
@@ -395,7 +466,7 @@ export interface SessionSecretRequestStatus {
|
|
|
395
466
|
expiresAt: string;
|
|
396
467
|
/** Cancellation attribution (task #111) — present on cancelled rows:
|
|
397
468
|
* who ended the ask ('human' = denied; 'agent' = withdrawn) and why. */
|
|
398
|
-
cancelledVia?: "human" | "agent";
|
|
469
|
+
cancelledVia?: "human" | "agent" | "thread_agent";
|
|
399
470
|
cancelReason?: string | null;
|
|
400
471
|
/** The denying human's display name (best-effort; 'human' via only). */
|
|
401
472
|
deniedByName?: string | null;
|
|
@@ -409,12 +480,18 @@ export interface SessionSecretRequestStatus {
|
|
|
409
480
|
export interface SessionSecretRequestSummary {
|
|
410
481
|
requestId: string;
|
|
411
482
|
keys: string[];
|
|
483
|
+
/** What kind of credential the ask is for; null when the requester did not say. */
|
|
484
|
+
kind: VaultRequestKind | null;
|
|
412
485
|
reason: string | null;
|
|
413
486
|
expiresAt: string;
|
|
414
487
|
createdAt: string;
|
|
415
488
|
}
|
|
416
489
|
export interface CreateApiKeyInput {
|
|
417
490
|
name?: string;
|
|
491
|
+
/** Omitted → `read` alone (the read-only default). Anything more —
|
|
492
|
+
* `invoke`, `manage`, `admin` — is chosen explicitly, and the server
|
|
493
|
+
* refuses any scope the minter does not hold (403 `scope_not_held`).
|
|
494
|
+
* `events:read` / `events:write` are deprecated but still accepted. */
|
|
418
495
|
scopes?: string[];
|
|
419
496
|
expiresAt?: string;
|
|
420
497
|
factorySlug?: string;
|
|
@@ -480,6 +557,9 @@ export interface UsageResponse {
|
|
|
480
557
|
* app-level (the platform GitHub App's own webhook) or polling — there
|
|
481
558
|
* is no per-repo webhook setup (retired 2026-08-18). */
|
|
482
559
|
export interface DriveRepoLink {
|
|
560
|
+
/** Last successful API head read; a deferred attempt does not advance it. */
|
|
561
|
+
lastHeadObservedAt: string | null;
|
|
562
|
+
headCheckDeferredUntil: string | null;
|
|
483
563
|
id: string;
|
|
484
564
|
factoryId: string;
|
|
485
565
|
/** Linked directory prefix under the drive root (relative, no slashes
|
|
@@ -517,7 +597,16 @@ export interface DriveRepoLink {
|
|
|
517
597
|
}>;
|
|
518
598
|
lastSyncedGitSha: string | null;
|
|
519
599
|
lastSyncedAcgCommit: string | null;
|
|
520
|
-
|
|
600
|
+
/** 'queued': the branch's first sync (or a full re-ingest) is waiting in
|
|
601
|
+
* the ingest queue; `ingestPriority` / `ingestQueueAhead` say where. */
|
|
602
|
+
syncState: "idle" | "queued" | "syncing" | "pushing" | "error" | "conflict" | "diverged" | "reauth_required";
|
|
603
|
+
/** Drain tier while queued (0 foreground, 1 active, 2 background). */
|
|
604
|
+
ingestPriority: number | null;
|
|
605
|
+
ingestQueuedAt: string | null;
|
|
606
|
+
/** When a runner started this branch's ingest; null when none runs. */
|
|
607
|
+
ingestClaimedAt: string | null;
|
|
608
|
+
/** Queued branches of the same repo ahead of this one (list only). */
|
|
609
|
+
ingestQueueAhead?: number | null;
|
|
521
610
|
/** Human-readable detail when syncState is 'error' or 'conflict'. */
|
|
522
611
|
syncError: string | null;
|
|
523
612
|
createdBy: string | null;
|