@loomcycle/client 1.104.0 → 1.106.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.
@@ -134,6 +134,10 @@ function runBody(opts) {
134
134
  body.user_credentials = opts.userCredentials;
135
135
  if (opts.parentContext !== undefined)
136
136
  body.parent_context = opts.parentContext;
137
+ if (opts.idempotencyKey !== undefined)
138
+ body.idempotency_key = opts.idempotencyKey;
139
+ if (opts.maxWallSeconds !== undefined)
140
+ body.max_wall_seconds = opts.maxWallSeconds;
137
141
  if (opts.metadata !== undefined)
138
142
  body.metadata = opts.metadata;
139
143
  if (opts.runTimeoutSeconds !== undefined)
@@ -487,11 +491,13 @@ class LoomcycleClient {
487
491
  * N parallel {@link LoomcycleClient.runStreaming} calls.
488
492
  *
489
493
  * Each spawn is a fresh run (its `sessionId` is ignored). Capped at 32 —
490
- * an over-cap batch rejects with InvalidArgumentError. `mode: "detach"`
491
- * (async handles) is reserved for a future release and rejected today.
494
+ * an over-cap batch rejects with InvalidArgumentError.
492
495
  *
493
- * Blocking: resolves only when the slowest child finishes (or `timeoutMs`
494
- * elapses). Mirrors POST /v1/runs:batch.
496
+ * Blocking by default: resolves only when the slowest child finishes (or
497
+ * `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
498
+ * has started — each with `status: "running"` and its `run_id` — and the
499
+ * runs go on; read one with {@link LoomcycleClient.getRun}. Mirrors
500
+ * POST /v1/runs:batch.
495
501
  */
496
502
  async spawnRunBatch(opts) {
497
503
  const body = {
@@ -848,9 +854,11 @@ class LoomcycleClient {
848
854
  return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, "/v1/_me", opts);
849
855
  }
850
856
  // ---- v0.8.17/8.18 Pause / Resume / State ----
851
- /** Quiesce the runtime. Idempotent tools cancel immediately;
852
- * non-idempotent + external tools get a grace window then
853
- * force-cancel. Raises AlreadyPausingError on 409,
857
+ /** Quiesce the runtime: new runs are refused and each in-flight run
858
+ * parks at its next iteration boundary, after the model or tool call it
859
+ * is in finishes — no tool call is cancelled. Waits up to `timeoutMs`
860
+ * (default 30 s, max 5 min) for runs to park; any that did not are named
861
+ * in `warnings`. Raises AlreadyPausingError on 409,
854
862
  * PauseNotConfiguredError on 503. */
855
863
  async pauseRuntime(opts) {
856
864
  const body = opts?.timeoutMs && opts.timeoutMs > 0
@@ -1501,15 +1509,21 @@ class LoomcycleClient {
1501
1509
  async retireTeam(defId, retired, opts) {
1502
1510
  return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_teamdef", { op: "retire", def_id: defId, retired }, opts);
1503
1511
  }
1504
- /** Compare a locally computed content hash against the deployed active
1505
- * version (op=verify) — the drift check for a team kept in source control
1506
- * and pushed to several deployments.
1507
- *
1508
- * Never raises for an absent team: a name with no active version answers
1509
- * `{deployed: false, matches: false}`, which a caller distinguishes from a
1510
- * deployed version whose hash differs. */
1511
- async verifyTeam(name, contentSha256, opts) {
1512
- return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_teamdef", { op: "verify", name, content_sha256: contentSha256 }, opts);
1512
+ async verifyTeam(name, target, opts) {
1513
+ const body = { op: "verify", name };
1514
+ if (typeof target === "string") {
1515
+ body.content_sha256 = target;
1516
+ }
1517
+ else {
1518
+ body.overlay = target.overlay;
1519
+ if (target.as)
1520
+ body.as = target.as;
1521
+ if (target.parentDefId)
1522
+ body.parent_def_id = target.parentDefId;
1523
+ if (target.description)
1524
+ body.description = target.description;
1525
+ }
1526
+ return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_teamdef", body, opts);
1513
1527
  }
1514
1528
  /** Hard-remove a whole team by name — all versions + the active pointer
1515
1529
  * (op=delete), scoped to the caller's tenant. Teams are runtime-only, so
package/dist/client.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  */
26
26
  import { InteractiveSession } from "./interactive.js";
27
27
  import { ClientToolHost, type ConnectClientToolsOptions } from "./client-tools.js";
28
- import type { CredentialListResponse, CredentialMeta, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, ListUserTokensResponse, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, TranscriptResponse, WhoamiResponse, UsageDimension, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest } from "./types.js";
28
+ import type { CredentialListResponse, CredentialMeta, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, ListUserTokensResponse, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamDraft, TeamDraftVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, TranscriptResponse, WhoamiResponse, UsageDimension, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest } from "./types.js";
29
29
  export declare class LoomcycleClient {
30
30
  private ctx;
31
31
  constructor(opts?: ClientOptions);
@@ -222,11 +222,13 @@ export declare class LoomcycleClient {
222
222
  * N parallel {@link LoomcycleClient.runStreaming} calls.
223
223
  *
224
224
  * Each spawn is a fresh run (its `sessionId` is ignored). Capped at 32 —
225
- * an over-cap batch rejects with InvalidArgumentError. `mode: "detach"`
226
- * (async handles) is reserved for a future release and rejected today.
225
+ * an over-cap batch rejects with InvalidArgumentError.
227
226
  *
228
- * Blocking: resolves only when the slowest child finishes (or `timeoutMs`
229
- * elapses). Mirrors POST /v1/runs:batch.
227
+ * Blocking by default: resolves only when the slowest child finishes (or
228
+ * `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
229
+ * has started — each with `status: "running"` and its `run_id` — and the
230
+ * runs go on; read one with {@link LoomcycleClient.getRun}. Mirrors
231
+ * POST /v1/runs:batch.
230
232
  */
231
233
  spawnRunBatch(opts: RunBatchOptions): Promise<RunBatchResult>;
232
234
  /**
@@ -539,9 +541,11 @@ export declare class LoomcycleClient {
539
541
  whoami(opts?: {
540
542
  signal?: AbortSignal;
541
543
  }): Promise<WhoamiResponse>;
542
- /** Quiesce the runtime. Idempotent tools cancel immediately;
543
- * non-idempotent + external tools get a grace window then
544
- * force-cancel. Raises AlreadyPausingError on 409,
544
+ /** Quiesce the runtime: new runs are refused and each in-flight run
545
+ * parks at its next iteration boundary, after the model or tool call it
546
+ * is in finishes — no tool call is cancelled. Waits up to `timeoutMs`
547
+ * (default 30 s, max 5 min) for runs to park; any that did not are named
548
+ * in `warnings`. Raises AlreadyPausingError on 409,
545
549
  * PauseNotConfiguredError on 503. */
546
550
  pauseRuntime(opts?: {
547
551
  timeoutMs?: number;
@@ -1023,10 +1027,18 @@ export declare class LoomcycleClient {
1023
1027
  *
1024
1028
  * Never raises for an absent team: a name with no active version answers
1025
1029
  * `{deployed: false, matches: false}`, which a caller distinguishes from a
1026
- * deployed version whose hash differs. */
1030
+ * deployed version whose hash differs.
1031
+ *
1032
+ * Given a {@link TeamDraft} instead of a hash, it checks that UNSAVED team
1033
+ * the way `createTeam` / `forkTeam` would — every check they run, plus
1034
+ * what would make it unrunnable — and returns all the problems at once,
1035
+ * each with the JSON path at fault. Nothing is written. */
1027
1036
  verifyTeam(name: string, contentSha256: string, opts?: {
1028
1037
  signal?: AbortSignal;
1029
1038
  }): Promise<TeamVerification>;
1039
+ verifyTeam(name: string, draft: TeamDraft, opts?: {
1040
+ signal?: AbortSignal;
1041
+ }): Promise<TeamDraftVerification>;
1030
1042
  /** Hard-remove a whole team by name — all versions + the active pointer
1031
1043
  * (op=delete), scoped to the caller's tenant. Teams are runtime-only, so
1032
1044
  * this is how an operator clears an obsolete/test team. */
package/dist/client.js CHANGED
@@ -131,6 +131,10 @@ function runBody(opts) {
131
131
  body.user_credentials = opts.userCredentials;
132
132
  if (opts.parentContext !== undefined)
133
133
  body.parent_context = opts.parentContext;
134
+ if (opts.idempotencyKey !== undefined)
135
+ body.idempotency_key = opts.idempotencyKey;
136
+ if (opts.maxWallSeconds !== undefined)
137
+ body.max_wall_seconds = opts.maxWallSeconds;
134
138
  if (opts.metadata !== undefined)
135
139
  body.metadata = opts.metadata;
136
140
  if (opts.runTimeoutSeconds !== undefined)
@@ -484,11 +488,13 @@ export class LoomcycleClient {
484
488
  * N parallel {@link LoomcycleClient.runStreaming} calls.
485
489
  *
486
490
  * Each spawn is a fresh run (its `sessionId` is ignored). Capped at 32 —
487
- * an over-cap batch rejects with InvalidArgumentError. `mode: "detach"`
488
- * (async handles) is reserved for a future release and rejected today.
491
+ * an over-cap batch rejects with InvalidArgumentError.
489
492
  *
490
- * Blocking: resolves only when the slowest child finishes (or `timeoutMs`
491
- * elapses). Mirrors POST /v1/runs:batch.
493
+ * Blocking by default: resolves only when the slowest child finishes (or
494
+ * `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
495
+ * has started — each with `status: "running"` and its `run_id` — and the
496
+ * runs go on; read one with {@link LoomcycleClient.getRun}. Mirrors
497
+ * POST /v1/runs:batch.
492
498
  */
493
499
  async spawnRunBatch(opts) {
494
500
  const body = {
@@ -845,9 +851,11 @@ export class LoomcycleClient {
845
851
  return jsonFetch(this.ctx, "/v1/_me", opts);
846
852
  }
847
853
  // ---- v0.8.17/8.18 Pause / Resume / State ----
848
- /** Quiesce the runtime. Idempotent tools cancel immediately;
849
- * non-idempotent + external tools get a grace window then
850
- * force-cancel. Raises AlreadyPausingError on 409,
854
+ /** Quiesce the runtime: new runs are refused and each in-flight run
855
+ * parks at its next iteration boundary, after the model or tool call it
856
+ * is in finishes — no tool call is cancelled. Waits up to `timeoutMs`
857
+ * (default 30 s, max 5 min) for runs to park; any that did not are named
858
+ * in `warnings`. Raises AlreadyPausingError on 409,
851
859
  * PauseNotConfiguredError on 503. */
852
860
  async pauseRuntime(opts) {
853
861
  const body = opts?.timeoutMs && opts.timeoutMs > 0
@@ -1498,15 +1506,21 @@ export class LoomcycleClient {
1498
1506
  async retireTeam(defId, retired, opts) {
1499
1507
  return postJSON(this.ctx, "/v1/_teamdef", { op: "retire", def_id: defId, retired }, opts);
1500
1508
  }
1501
- /** Compare a locally computed content hash against the deployed active
1502
- * version (op=verify) — the drift check for a team kept in source control
1503
- * and pushed to several deployments.
1504
- *
1505
- * Never raises for an absent team: a name with no active version answers
1506
- * `{deployed: false, matches: false}`, which a caller distinguishes from a
1507
- * deployed version whose hash differs. */
1508
- async verifyTeam(name, contentSha256, opts) {
1509
- return postJSON(this.ctx, "/v1/_teamdef", { op: "verify", name, content_sha256: contentSha256 }, opts);
1509
+ async verifyTeam(name, target, opts) {
1510
+ const body = { op: "verify", name };
1511
+ if (typeof target === "string") {
1512
+ body.content_sha256 = target;
1513
+ }
1514
+ else {
1515
+ body.overlay = target.overlay;
1516
+ if (target.as)
1517
+ body.as = target.as;
1518
+ if (target.parentDefId)
1519
+ body.parent_def_id = target.parentDefId;
1520
+ if (target.description)
1521
+ body.description = target.description;
1522
+ }
1523
+ return postJSON(this.ctx, "/v1/_teamdef", body, opts);
1510
1524
  }
1511
1525
  /** Hard-remove a whole team by name — all versions + the active pointer
1512
1526
  * (op=delete), scoped to the caller's tenant. Teams are runtime-only, so
package/dist/index.d.ts CHANGED
@@ -130,5 +130,5 @@ export { InteractiveSession } from "./interactive.js";
130
130
  export type { InteractiveSessionOps } from "./interactive.js";
131
131
  export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
132
132
  export type { ClientToolSchema, ClientToolInvocation, ConnectClientToolsOptions, WebSocketLike, WebSocketCtor, } from "./client-tools.js";
133
- export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, ChannelHookCall, ChannelHookResult, HookFailMode, HookPhase, HookToolCall, HookToolResult, PostHookCall, PostHookResult, PreHookCall, PreHookResult, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, PromotedTeam, RetiredTeam, TeamDefDetail, TeamVerification, TeamVersion, TeamVersionList, TeamBreakpoints, TeamRunDetached, TeamRunResult, TeamRunTarget, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, ReleaseChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, EffectiveConfigResponse, EffectiveConfigSource, EffectiveValue, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, } from "./types.js";
133
+ export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, ChannelHookCall, ChannelHookResult, HookFailMode, HookPhase, HookToolCall, HookToolResult, PostHookCall, PostHookResult, PreHookCall, PreHookResult, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, PromotedTeam, RetiredTeam, TeamDefDetail, TeamVerification, TeamDraft, TeamDraftVerification, TeamIssue, TeamIssueKind, TeamVersion, TeamVersionList, TeamBreakpoints, TeamRunDetached, TeamRunResult, TeamRunTarget, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, ReleaseChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, EffectiveConfigResponse, EffectiveConfigSource, EffectiveValue, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, } from "./types.js";
134
134
  export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, NotFoundError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, UnavailableError, } from "./errors.js";
package/dist/types.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * `client.ts` for the input shapes (RunOptions, CreateSnapshotOptions,
8
8
  * etc.) — those are translated to snake_case in the request body.
9
9
  */
10
- export type EventType = "started" | "text" | "tool_call" | "tool_result" | "usage" | "done" | "error" | "retry" | "host_widened" | "session" | "agent" | "awaiting_input" | "awaiting_review" | "subagent_hold" | "steer" | "context_compaction" | "capability_inert" | "hook_decision" | "limit" | "override" | "context_recap" | "context_state" | "context_distill_declined" | "context_exhausted" | "thinking" | "turn_cancelled" | "provider_fallback" | "fallback_suppressed" | "model_downgraded" | "cache_invalidated" | "reasoning_invalidated" | "channel_publish" | "channel_delivery" | "interruption_pending" | "spawn_child_started" | "spawn_child_result" | "prompt_snapshot" | "_meta";
10
+ export type EventType = "started" | "text" | "tool_call" | "tool_result" | "usage" | "done" | "error" | "retry" | "host_widened" | "session" | "agent" | "awaiting_input" | "awaiting_review" | "subagent_hold" | "awaiting_children" | "children_note" | "steer" | "context_compaction" | "capability_inert" | "hook_decision" | "limit" | "override" | "context_recap" | "context_state" | "context_distill_declined" | "context_exhausted" | "thinking" | "turn_cancelled" | "provider_fallback" | "fallback_suppressed" | "model_downgraded" | "cache_invalidated" | "reasoning_invalidated" | "channel_publish" | "channel_delivery" | "interruption_pending" | "spawn_child_started" | "spawn_child_result" | "spawn_child_read" | "prompt_snapshot" | "_meta";
11
11
  export interface ToolUse {
12
12
  id: string;
13
13
  name: string;
@@ -504,17 +504,36 @@ export interface TurnCancelledInfo {
504
504
  reason?: string;
505
505
  since_turn: number;
506
506
  }
507
- /** Payload on `spawn_child_started` / `spawn_child_result` — the two-event
508
- * ledger a fan-out parent writes so an in-flight child survives a pause. */
507
+ /** Payload on `spawn_child_started` / `spawn_child_result` /
508
+ * `spawn_child_read` — the ledger a parent writes so its children survive a
509
+ * pause: a fan-out's in-flight children, and its poll-mode children (`mode:
510
+ * "poll"`) with how each ended and whether the parent has read it. */
509
511
  export interface SpawnChildInfo {
510
512
  tool_use_id: string;
511
513
  index: number;
512
514
  run_id?: string;
513
515
  agent?: string;
516
+ /** "poll" for a poll-mode child; absent for a wait-mode fan-out child. */
517
+ mode?: string;
518
+ batch_id?: string;
519
+ /** "team" for a team walk run in poll mode. */
520
+ kind?: string;
521
+ team?: string;
522
+ def_id?: string;
523
+ /** The child was started with notify: false / on_parent_end: "cancel". */
524
+ no_notify?: boolean;
525
+ cancel_on_parent_end?: boolean;
526
+ /** A poll-mode sub-agent's per-child timeout_ms, on its started row. */
527
+ timeout_ms?: number;
514
528
  ok?: boolean;
515
529
  output?: string;
516
530
  error?: string;
517
531
  state?: Record<string, unknown>;
532
+ /** A poll-mode child's final state (completed, failed, cancelled, timeout). */
533
+ ended?: string;
534
+ status?: string;
535
+ /** A team walk's whole answer, steps included. */
536
+ detail?: Record<string, unknown>;
518
537
  }
519
538
  export interface AgentEvent {
520
539
  type: EventType;
@@ -552,6 +571,18 @@ export interface AgentEvent {
552
571
  * rule on it with {@link LoomcycleClient.reviewRun} on `subagent_run_id`)
553
572
  * or has ended (`state` "released", with `status`). */
554
573
  subagent_hold?: SubagentHoldInfo;
574
+ /** Payload on `event: awaiting_children` — the background children the
575
+ * run waits for before its next turn. */
576
+ awaiting_children?: {
577
+ child_run_ids?: string[];
578
+ since_turn?: number;
579
+ };
580
+ /** Payload on `event: children_note` — the note's text, as the model reads it,
581
+ * and the background children it reports. */
582
+ children_note?: {
583
+ text?: string;
584
+ child_run_ids?: string[];
585
+ };
555
586
  /** Payload on `event: steer` (RFC AI) — the operator's drained turn. On a
556
587
  * re-attach replay, `source` is `"replay"`. Nil on all other event types. */
557
588
  user_input?: {
@@ -580,6 +611,9 @@ export interface AgentEvent {
580
611
  run_id?: string;
581
612
  session_id?: string;
582
613
  parent_agent_id?: string | null;
614
+ /** On the `agent` frame: the request's `idempotencyKey` was already held by
615
+ * a run, and this stream is that existing run's. */
616
+ deduplicated?: boolean;
583
617
  parent_context?: ParentContext;
584
618
  /** Payload on `context_compaction`. */
585
619
  context_compaction?: ContextCompactionInfo;
@@ -602,7 +636,7 @@ export interface AgentEvent {
602
636
  interruption?: InterruptionEventInfo;
603
637
  /** Payload on `turn_cancelled`. */
604
638
  turn_cancelled?: TurnCancelledInfo;
605
- /** Payload on `spawn_child_started` / `spawn_child_result`. */
639
+ /** Payload on `spawn_child_started` / `spawn_child_result` / `spawn_child_read`. */
606
640
  spawn_child?: SpawnChildInfo;
607
641
  /** Payload on `prompt_snapshot` (transcript only). */
608
642
  prompt_snapshot?: RunPromptSnapshot;
@@ -782,6 +816,22 @@ export interface RunOptions extends RunOverrideOptions {
782
816
  * user-initiated request that spawned the whole tree. Not a secret.
783
817
  * Omitted = no tracking context. */
784
818
  parentContext?: ParentContext;
819
+ /** Makes starting this run safe to retry: 1 to 200 characters of
820
+ * `[A-Za-z0-9:._-]`. A second request with the same key, from the same
821
+ * tenant and user, starts nothing. `runStreaming` then yields the existing
822
+ * run's stream — its `agent` frame carries `deduplicated: true` and its
823
+ * events follow from the first — and a `spawnRunBatch` child reports the
824
+ * existing run with `deduplicated: true`. The request body is not
825
+ * compared, so build the key from what makes the work distinct. A fresh
826
+ * run only: refused with `sessionId`. */
827
+ idempotencyKey?: string;
828
+ /** Bound how long the run may LIVE, in seconds (omitted or 0 = no bound; at
829
+ * most 30 days). Past it the run is cancelled, with what it started, and
830
+ * ends `cancelled` with `stop_reason: "wall_limit"`. Waits count; time the
831
+ * runtime is paused does not. It belongs to the run, not to the call, so it
832
+ * is the time bound for a `mode: "detach"` batch child, where `timeoutMs`
833
+ * is refused. Any agent, model-driven or code-js. */
834
+ maxWallSeconds?: number;
785
835
  /** Optional NON-SECRET structured metadata passed to the agent (repo
786
836
  * name, review policy, preferred skills, …) — symmetric with the
787
837
  * WebHook/Schedule trigger paths. As a first-party (bearer-authed)
@@ -1123,9 +1173,11 @@ export interface ClientOptions {
1123
1173
  /** `rejected` is a run a reviewer turned down without feedback (RFC DJ). */
1124
1174
  export type AgentStatus = "configured" | "running" | "completed" | "failed" | "cancelled" | "rejected";
1125
1175
  /** What a running run is blocked on: an open Channel subscribe, an open
1126
- * Interruption ask, a hold for an operator's review verdict, or an
1127
- * interactive run parked for the operator's next turn (`input`). */
1128
- export type AwaitedState = "channel" | "interrupted" | "review" | "input";
1176
+ * Interruption ask, a hold for an operator's review verdict, an
1177
+ * interactive run parked for the operator's next turn (`input`), or a run
1178
+ * that ended its turn and waits for its background (poll-mode) children
1179
+ * to end (`children`). */
1180
+ export type AwaitedState = "channel" | "interrupted" | "review" | "input" | "children";
1129
1181
  export interface AgentUsage {
1130
1182
  input_tokens?: number;
1131
1183
  output_tokens?: number;
@@ -1162,8 +1214,9 @@ export interface Agent {
1162
1214
  awaited_state?: AwaitedState;
1163
1215
  /** The channel name (`awaited_state: "channel"`; a fan-in `Channel` await
1164
1216
  * lists its channels comma-separated, bounded), interruption kind
1165
- * (`awaited_state: "interrupted"`) or the agent_stop hook holding a review
1166
- * (`awaited_state: "review"`) the run waits on. */
1217
+ * (`awaited_state: "interrupted"`), the agent_stop hook holding a review
1218
+ * (`awaited_state: "review"`) or the child run ids, comma-separated and
1219
+ * bounded (`awaited_state: "children"`) the run waits on. */
1167
1220
  awaited_on?: string;
1168
1221
  /** The replica owning the run's live cancel handle. Absent in a
1169
1222
  * single-replica deployment. */
@@ -1218,6 +1271,10 @@ export interface RunSpec {
1218
1271
  context?: Record<string, unknown>;
1219
1272
  max_context_tokens?: number;
1220
1273
  run_timeout_seconds?: number;
1274
+ /** The run's own lifetime limit, in seconds, when it was started with
1275
+ * `maxWallSeconds`: past it the run ends `cancelled` with
1276
+ * `stop_reason: "wall_limit"`. Absent when the run has no such limit. */
1277
+ max_wall_seconds?: number;
1221
1278
  review_ttl_seconds?: number;
1222
1279
  /** Which model serves the run: model / provider / tier / effort. */
1223
1280
  routing?: Record<string, unknown>;
@@ -1272,7 +1329,18 @@ export interface RunSpec {
1272
1329
  }>;
1273
1330
  };
1274
1331
  fanout_cap?: number;
1332
+ /** A resident child (Agent op=open), which a resume rebuilds as one. */
1333
+ resident?: boolean;
1334
+ /** Unix seconds a resident child was last polled or cancelled from a
1335
+ * replica that does not hold it; its own replica reads it before it
1336
+ * reaps the child as idle. */
1337
+ addressed_at?: number;
1275
1338
  };
1339
+ /** The iteration limit the run started with. Absent for a run with none
1340
+ * (unbounded, or an interactive run with no `max_iterations` of its own)
1341
+ * and for a run recorded before the field existed. Written by the server
1342
+ * only. */
1343
+ iteration_limit?: number;
1276
1344
  /** The agent version the run started on, which a resumed run continues on:
1277
1345
  * the AgentDef version its agent name resolved to (`def_id` absent for an
1278
1346
  * agent with no versions — the operator's yaml or a registered agent). For
@@ -1307,6 +1375,37 @@ export interface RunSpec {
1307
1375
  def_id: string;
1308
1376
  def_tenant?: string;
1309
1377
  };
1378
+ /** A code agent's time as of its last pause: the active time it had used
1379
+ * against `run_timeout_seconds`, the time it had spent waiting (which
1380
+ * never counts against that budget), and how long it had lived — waits
1381
+ * included, runtime pauses excluded — against the operator's lifetime
1382
+ * limit. A resumed run continues from it rather than starting fresh.
1383
+ * Absent on a run that never paused, and on every run that is not a code
1384
+ * agent. Written by the server only. */
1385
+ run_clock?: {
1386
+ active_ms: number;
1387
+ waited_ms: number;
1388
+ wall_ms: number;
1389
+ };
1390
+ /** The runtime pauses this run lived through, oldest first: when each
1391
+ * began (when the runtime paused) and, once it ended, when — the resume,
1392
+ * or the run's re-dispatch after a restore or a restart. The last has no
1393
+ * `until` while the pause lasts. A parent re-arming this run's
1394
+ * `timeout_ms` after a resume leaves them out. Past 16 the oldest are
1395
+ * folded into `pauses_folded`. Absent on a run that never lived through a
1396
+ * pause. Written by the server only. */
1397
+ pauses?: {
1398
+ since: string;
1399
+ until?: string;
1400
+ }[];
1401
+ /** The pauses folded out of `pauses`: the time, in nanoseconds, before
1402
+ * `until` that the run's `timeout_ms` was stopped — its pauses and its
1403
+ * review holds, an overlap counted once. Absent until the run has lived
1404
+ * through more than 16 pauses. Written by the server only. */
1405
+ pauses_folded?: {
1406
+ until: string;
1407
+ stopped_ns: number;
1408
+ };
1310
1409
  }
1311
1410
  /** What a team walk started with (`RunSpec.team`). */
1312
1411
  export interface RunSpecTeam {
@@ -1330,7 +1429,10 @@ export interface RunSpecTeam {
1330
1429
  * team's default is not listed, and reads from the definition version
1331
1430
  * this record names. Absent when the start supplied none. */
1332
1431
  vars?: Record<string, string>;
1333
- mode: "sync" | "detach";
1432
+ /** How the walk was started: waited for (`sync`), handed back at once and
1433
+ * run outside its caller (`detach`), or run as a background child of the
1434
+ * agent run that started it (`poll`). */
1435
+ mode: "sync" | "detach" | "poll";
1334
1436
  /** The board binding; `resumed_from` names the state a persisted board
1335
1437
  * resumed the walk from. */
1336
1438
  board?: {
@@ -1383,11 +1485,15 @@ export interface CancelAgentResult {
1383
1485
  export interface RunBatchOptions {
1384
1486
  spawns: RunOptions[];
1385
1487
  /** "join" (default) — block until all children settle, returning the
1386
- * combined envelope. "detach" (async run handles) is reserved for a future
1387
- * release and rejected by the server today. */
1388
- mode?: "join";
1488
+ * combined envelope. "detach" — resolve once every child has started:
1489
+ * each started child reports `status: "running"` with its `run_id`, keeps
1490
+ * running after the call, and is read with {@link LoomcycleClient.getRun}
1491
+ * and stopped with {@link LoomcycleClient.cancelAgent}; a child that could
1492
+ * not start is reported in its slot, as in join. */
1493
+ mode?: "join" | "detach";
1389
1494
  /** Optional join deadline (ms): a child still running when it elapses is
1390
- * cancelled and reported with a cancelled status in-envelope. */
1495
+ * cancelled and reported with a cancelled status in-envelope. Rejected
1496
+ * (400) with `mode: "detach"`, which does not wait. */
1391
1497
  timeoutMs?: number;
1392
1498
  signal?: AbortSignal;
1393
1499
  }
@@ -1403,6 +1509,9 @@ export interface SpawnRunResult {
1403
1509
  final_text?: string;
1404
1510
  usage?: AgentUsage;
1405
1511
  error?: string;
1512
+ /** The child's `idempotencyKey` was already held by a run: the ids, status
1513
+ * and result are that run's, and this request started nothing. */
1514
+ deduplicated?: boolean;
1406
1515
  }
1407
1516
  /** Result of {@link LoomcycleClient.spawnRunBatch} — `results` is index-aligned
1408
1517
  * with the request's `spawns`. */
@@ -1697,6 +1806,7 @@ export type RuntimeStateStatus = "running" | "pausing" | "paused";
1697
1806
  export interface PauseResult {
1698
1807
  state: string;
1699
1808
  duration_ms: number;
1809
+ /** Always 0: pause cancels no tool call. Kept for wire compatibility. */
1700
1810
  force_cancelled_count: number;
1701
1811
  paused_runs_count: number;
1702
1812
  warnings?: string[];
@@ -2253,6 +2363,72 @@ export interface TeamVerification {
2253
2363
  current_sha256: string;
2254
2364
  current_def_id: string;
2255
2365
  version: number;
2366
+ /** Whether a walk could run the deployed version: false when it references
2367
+ * something that does not resolve (see `issues`). Absent when
2368
+ * `deployed: false`, or when the stored definition does not parse. */
2369
+ runnable?: boolean;
2370
+ /** What the deployed version references but does not contain. Present only
2371
+ * when there is something to report. */
2372
+ issues?: TeamIssue[];
2373
+ }
2374
+ /** What a {@link TeamIssue} is about. A wire enum that only grows: a kind this
2375
+ * client does not know is still a `string`, so a new one never breaks a build. */
2376
+ export type TeamIssueKind = "name_invalid" | "parent_not_found" | "overlay_invalid" | "graph_invalid" | "size_cap" | "channel_reserved" | "channel_authority" | "acl_missing" | "channel_undeclared" | "local_channel_invalid" | "local_channel_missing" | "local_agent_invalid" | "local_agent_authority" | "local_agent_collision" | "local_agent_missing" | "local_agent_unreferenced" | "local_skill_invalid" | "local_webhook_authority" | "local_webhook_invalid" | "agent_missing" | "uncheckable" | (string & {});
2377
+ /** One problem with a team definition, from {@link LoomcycleClient.verifyTeam}.
2378
+ *
2379
+ * `severity`: `refused` — a create or fork would be refused (its `detail` is
2380
+ * exactly the refusal); `unrunnable` — it would be stored, but a walk could not
2381
+ * run it; `advisory` — worth reading, stops nothing. */
2382
+ export interface TeamIssue {
2383
+ kind: TeamIssueKind;
2384
+ severity: "refused" | "unrunnable" | "advisory";
2385
+ detail: string;
2386
+ /** JSON path of the value at fault in the definition, e.g.
2387
+ * `states[2].handler.sink.channel` or `local.agents.reviewer`. Absent when
2388
+ * the problem is the definition as a whole. */
2389
+ path?: string;
2390
+ /** The state the problem is in, and the handler field within it. */
2391
+ state?: string;
2392
+ field?: string;
2393
+ /** What the problem names. */
2394
+ channel?: string;
2395
+ agent?: string;
2396
+ skill?: string;
2397
+ side?: "publish" | "subscribe";
2398
+ /** Set (true) on an advisory issue — the older spelling of
2399
+ * `severity: "advisory"`, kept for clients that read it. */
2400
+ advisory?: boolean;
2401
+ }
2402
+ /** An unsaved team for {@link LoomcycleClient.verifyTeam} to check. */
2403
+ export interface TeamDraft {
2404
+ /** Exactly what `createTeam` / `forkTeam` would be sent. */
2405
+ overlay: Record<string, unknown>;
2406
+ /** Check it as a create or as a fork. Omitted: as a save would — a fork of
2407
+ * the active version when the name has one, else a create. */
2408
+ as?: "create" | "fork";
2409
+ /** Check it as a fork of this version. */
2410
+ parentDefId?: string;
2411
+ /** The description the save would carry (its size is checked too). */
2412
+ description?: string;
2413
+ }
2414
+ /** Result of {@link LoomcycleClient.verifyTeam} for a {@link TeamDraft}: every
2415
+ * problem a create or fork would refuse, plus what would make the stored team
2416
+ * unrunnable — all at once. Nothing is written. */
2417
+ export interface TeamDraftVerification extends TeamVerification {
2418
+ /** No `refused` issue: a create or fork with this overlay would be accepted. */
2419
+ valid: boolean;
2420
+ /** Valid, and no `unrunnable` issue. */
2421
+ runnable: boolean;
2422
+ /** How the draft was checked. */
2423
+ checked_as: "create" | "fork";
2424
+ /** The version the fork would start from (`checked_as: "fork"`). */
2425
+ parent_def_id?: string;
2426
+ /** The hash the save would sign. Absent when the overlay cannot be built.
2427
+ * `matches` compares it with the deployed version's. */
2428
+ content_sha256?: string;
2429
+ /** Every problem found, refusals first in the order a save checks them;
2430
+ * empty when there are none. */
2431
+ issues: TeamIssue[];
2256
2432
  }
2257
2433
  /** Result of {@link LoomcycleClient.runTeam} (op=run) — the walk trace. `status`
2258
2434
  * is `"completed"` (a terminal state was reached) or `"iteration_cap"` (a
@@ -2932,7 +3108,8 @@ export interface RunStateEvent {
2932
3108
  * field, so a client folding the stream holds the run's current wait. */
2933
3109
  awaited_state?: AwaitedState;
2934
3110
  /** The channel (a fan-in `Channel` await: its channels, comma-separated),
2935
- * the interruption kind, or the agent_stop hook holding a review. */
3111
+ * the interruption kind, the agent_stop hook holding a review, or the
3112
+ * background child run ids (comma-separated) a run waits on. */
2936
3113
  awaited_on?: string;
2937
3114
  /** RFC3339: when a review hold ends as rejected if nobody rules on it.
2938
3115
  * Absent when the wait has no deadline. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "1.104.0",
3
+ "version": "1.106.0",
4
4
  "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 71 methods covering run streaming, agent metadata, pause/resume/state, resolver re-probe (resolveProbe — issue #88 operator escape hatch), operator-token admin (operatorTokenDef — RFC L OSS multi-tenant auth) + whoami (RFC L authoritative principal, v0.17.0) + tenant-scoped listUsers / listUserAgents, dynamic MCP registration (mcpServerDef + v0.18.0 typed mcpServerDefVerify + ensureMcpServer idempotent register-if-changed), snapshot lifecycle, memory admin (incl. v0.9.0 Vector Memory embed_stats + reembed AND v0.11.5 setMemoryEntry + deleteMemoryEntry), interruption resolve, hook management, v0.8.22 substrate admin (agentDef + skillDef), v0.9.x n8n Phase 0 (listChannels + streamUserRunStates), v0.9.x Channel CRUD (publishChannel + subscribeChannel + peekChannel + ackChannel), v0.11.5 Channel admin CRUD (createChannel + updateChannel + deleteChannel — runtime substrate; yaml channels refuse mutation with HTTP 409), v0.9.x content_sha256 verify, v0.9.1 transcript first-cycle, v0.9.x dynamic MCP server registration (mcpServerDef + MCPServerDefVerifyResult), v0.10.3 Library v2 enumeration (listLibraryAgents + listLibrarySkills + listLibraryMcpServers), and v0.11.0 LLM Gateway (llmChat + llmStream — direct provider routing without agent overhead; primary target is n8n's LoomCycleChatModel AI Agent sub-node and any LangChain-compatible consumer). v0.10.1 — dual ESM + CommonJS distribution (additive — ESM consumers unchanged; CJS consumers like n8n's community-node loader now work). v0.19.0 — typed inline code-js agent ingestion (AgentDefOverlay.code_body + ensureCodeAgent — register a deterministic code agent through the substrate with no host filesystem bind; RFC J). v0.20.0 — ensureMcpServer surfaces discoveredToolCount straight from create (loomcycle now auto-discovers MCP tools at ingestion); rediscover is now an explicit force-refresh. v0.21.0 — run/continue accept optional non-secret `metadata` (repo name, review policy, …) passed to the agent, symmetric with the WebHook/Schedule trigger paths. v0.22.0 — version-aligned lockstep release; no client-surface change (RFC N tenant isolation of the agent/skill/MCP/Schedule/Webhook definition plane + real op-schemas on the builtin MCP meta-tools are both server-side). v0.23.0 — version-aligned lockstep release; no client-surface change (RFCs O/P/R MCP-server hardening + thin client and the RFC Q DeepSeek tool-content fix are all server-side / MCP-transport-side). v0.24.0 — purgeChannel clears a channel's buffered messages without deleting its definition (allowed on yaml-declared channels too, unlike deleteChannel — F20); AgentDefOverlay gains channels / evaluation_scopes / interruption so a COMPLETE interactive/multi-agent agent round-trips over the substrate (F14). (Consolidates the interim 0.24/0.25 package bumps, which were never tag-published, back into lockstep with the loomcycle v0.24.0 tag.) v0.25.0 — adds the RFC S channel fan-in/fan-out client twins: awaitChannels() (wait for any/all/at_least N messages across channels, or a timeout — non-committing) + broadcastChannels() (publish one payload to N channels in one atomic-pre-flight call), the client-facing counterparts of the in-band Channel.await / Channel.broadcast tool ops (the rest of v0.25.0 — the manual-management Web UI console + Context op=time + max_fires self-retiring schedules — is server-side / in-band, no client-surface change). v0.29.1 — Usage gains optional `max_context_tokens` (the serving model's context-window ceiling, stamped by the loop from Provider.Capabilities() on each usage event) so a consumer can render a 'context used / max' gauge without a hard-coded per-model table; additive + optional, no behavior change. (Lockstep catch-up: the field landed in loomcycle v0.29.0 but the adapter publish skipped on a version mismatch; v0.29.1 realigns the package version with the release tag so it publishes.) v0.33.0 — gRPC + TS client parity for the RFC Y external fan-out and the compaction surface: spawnRunBatch() (POST /v1/runs:batch — spawn up to 32 fresh runs concurrently in one call, combined index-aligned envelope, per-child failures in-envelope) + compactRun(runId) (POST /v1/runs/{run_id}/compact — summarize a parked run's context); plus per-run sampling + compaction overrides now accepted on runStreaming / continueSession (an explicit temperature 0 is preserved as deterministic, not dropped as falsy). (The gRPC half adds the matching SpawnRunBatch / CompactRun RPCs + the sampling/compaction fields on RunRequest/ContinueRequest — server-side.) v0.34.0 — version-aligned lockstep release; no client-surface change (context-transform plugins / RFC Z Phase 1a are server-side config; the exp7 hardening pass is server-side; the R2 cross-provider thinking-model downgrade surfaces a new `model_downgraded` SSE event the generic stream passes through unchanged). v0.35.0 — RFC AH dynamic filesystem volumes: volumeDef() (POST /v1/_volumedef — op-discriminated create/get/list/delete/purge; a Volume is flat, so delete unmaps + purge RemoveAll's, no retire/promote/fork) + listVolumes() / listEphemeralVolumes() (GET /v1/_volumes[/ephemeral] — tenant-scoped; host paths redacted for non-operator callers). Tenant-confined; the runtime derives the path inside an operator-blessed dynamic_root, so callers pass name + mode, never a host path. v1.1.1 — RFC AI interactive agentic sessions: an `interactive: true` flag on runStreaming/continueSession (a run that parks at end_turn for steering) + sendRunInput(runId, text) (POST /v1/runs/{id}/input — steer a live run) + streamRunByID(runId, {fromSeq}) (GET /v1/runs/{id}/stream — re-attach by run_id; the operator's prior turns replay as `steer` events so a cold client reconstructs the whole conversation) + a high-level InteractiveSession driver (client.interactiveSession / attachInteractiveSession — events()/send()/cancel(), the adapter port of the Web UI run terminal). The AgentEvent union gains awaiting_input/steer/context_compaction frames. Version-aligned with the loomcycle v1.1.x line so the v1.1.1 tag publishes it (also carrying the previously-unpublished v0.35.0 volume surface). v1.4.0 — RFC AL Path VFS + RFC AK Document on the wire: path(input) (POST /v1/_path — a Unix-like filesystem over Memory/Volumes/Documents; resolve/ls/stat/mkdir/mv/rm) + document(input) (POST /v1/_document — chunked-graph documents; 13 ops, needs SQL Memory on the sidecar). Scope (agent/user/tenant) + tenant are resolved server-side from the authenticated principal, never the wire; an off-run scope:'user' op keys on the principal subject so it interoperates with that user's agent runs. New PathToolInput / DocumentToolInput types; responses are op-varying (unknown — narrow as needed). v1.7.0 — RFC AT image/vision input: the PromptContent union gains an `image` variant ({ type:'image'; media_type: ImageMediaType; data: base64-no-prefix }) accepted in a user segment by runStreaming / continueSession (segments pass through unchanged — no method change). The model must be vision-capable or the run errors before the call. New ImageMediaType type (image/png|jpeg|gif|webp). v1.12.1 — Path/Document browse-by-subject + the full Document op set (RFC AS/AK): path(input, opts) / document(input, opts) accept optional scopeId / tenant browse overrides sent as ?scope_id= / ?tenant= query params (server reads them from the URL, re-checks authorization; omit both to browse your own subject — byte-identical to the pre-RFC-AS request), and DocumentToolInput.op now covers all 16 backend ops (adds set_path, export_md, import_md) with the matching include_metadata / markdown fields. Additive — existing path() / document() callers are unchanged. v1.16.0 — RFC BC client-executed tools (local tool host): connectClientTools({tools,onInvoke}) opens a persistent WebSocket to /v1/client-tools, registers tools this client runs on the user's machine (browser DOM / files / shell), and answers the invoke frames loomcycle routes when an agent of your principal calls a client:<tool> — returning your reply as an ordinary tool result. Returns a ClientToolHost driver (.close() to stop; auto-reconnect); dependency-free (global WebSocket in browsers / Node 22+, or an injected WebSocketImpl like the ws package on older Node); the bearer rides the Sec-WebSocket-Protocol subprotocol (browsers can't set an Authorization header on a WebSocket). The runtime's first WebSocket surface. v1.45.0 — RFC BL P5 subject erasure: erasureReport(subject, {tenant}) (GET /v1/_erasure — what this deployment holds about one subject, in three tiers: deletable with existing primitives, subject-keyed but not deletable, and facts ABOUT the subject in scopes they do not own) + erasureExecute(subject, {dryRun, confirm, tenant}) (POST /v1/_erasure — removes tiers 1 and 2). DEFAULTS TO A DRY RUN: dryRun defaults true and a live run also requires confirm === subject. The tier-3 residue is traceable only through the subject's chats, which a live run deletes, so a report afterwards shows rows: 0 while those facts remain — the returned object is the only durable record of what was not reached; persist it. New ErasureReport / ErasureResult / ErasureTier / ErasureResidue types. v1.47.0 — RFC BV memory-view SDK: memorySearch() (POST /v1/_memory/search — off-run unified semantic search spanning k/v entries AND document-chunk bodies in one ranked list, each hit tagged kind memory|document with chunk_id on document hits) + memoryEmbedStats(scope) + reembedMemory(scope, scopeId, {dryRun,limit}) (the Vector Memory embed-admin reads the memory-view console needs; dry_run defaults true). Fact reads (list_facts + get_chunk's entity block) ride the existing document() passthrough. Additive — existing callers unchanged. v1.61.0 — RFC CJ per-run context-window override: runStreaming / continueSession accept an optional maxContextTokens (integer tokens) that wins over the agent's own max_context_tokens; omitted inherits it (which defers to the provider/driver default). Distinct from a model's output cap; primarily for local inference (Ollama num_ctx). Serialized as the snake_case max_context_tokens field on POST /v1/runs + the continuation body; additive, existing callers unchanged. v1.72.1 — the TeamDef version lifecycle: listTeamVersions(name) (op=list — every version of one team, newest first), promoteTeam(defId) (op=promote — point the active pointer, which is what a run BY NAME executes; forkTeam defaults to promote:false, so authoring and putting in force stay two steps), retireTeam(defId, retired) (op=retire — reversible and version-scoped, unlike deleteTeam) and verifyTeam(name, contentSha256) (op=verify — the drift check for a workflow kept in source control and pushed to several deployments; an absent team answers deployed:false rather than raising). The ops existed on the substrate and over HTTP; a client that could author a team could not put one in force.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",