@loomcycle/client 1.103.0 → 1.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +28 -16
- package/dist/client.d.ts +21 -9
- package/dist/client.js +28 -16
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +194 -15
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -487,11 +487,13 @@ class LoomcycleClient {
|
|
|
487
487
|
* N parallel {@link LoomcycleClient.runStreaming} calls.
|
|
488
488
|
*
|
|
489
489
|
* Each spawn is a fresh run (its `sessionId` is ignored). Capped at 32 —
|
|
490
|
-
* an over-cap batch rejects with InvalidArgumentError.
|
|
491
|
-
* (async handles) is reserved for a future release and rejected today.
|
|
490
|
+
* an over-cap batch rejects with InvalidArgumentError.
|
|
492
491
|
*
|
|
493
|
-
* Blocking: resolves only when the slowest child finishes (or
|
|
494
|
-
* elapses).
|
|
492
|
+
* Blocking by default: resolves only when the slowest child finishes (or
|
|
493
|
+
* `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
|
|
494
|
+
* has started — each with `status: "running"` and its `run_id` — and the
|
|
495
|
+
* runs go on; read one with {@link LoomcycleClient.getRun}. Mirrors
|
|
496
|
+
* POST /v1/runs:batch.
|
|
495
497
|
*/
|
|
496
498
|
async spawnRunBatch(opts) {
|
|
497
499
|
const body = {
|
|
@@ -848,9 +850,11 @@ class LoomcycleClient {
|
|
|
848
850
|
return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, "/v1/_me", opts);
|
|
849
851
|
}
|
|
850
852
|
// ---- v0.8.17/8.18 Pause / Resume / State ----
|
|
851
|
-
/** Quiesce the runtime
|
|
852
|
-
*
|
|
853
|
-
*
|
|
853
|
+
/** Quiesce the runtime: new runs are refused and each in-flight run
|
|
854
|
+
* parks at its next iteration boundary, after the model or tool call it
|
|
855
|
+
* is in finishes — no tool call is cancelled. Waits up to `timeoutMs`
|
|
856
|
+
* (default 30 s, max 5 min) for runs to park; any that did not are named
|
|
857
|
+
* in `warnings`. Raises AlreadyPausingError on 409,
|
|
854
858
|
* PauseNotConfiguredError on 503. */
|
|
855
859
|
async pauseRuntime(opts) {
|
|
856
860
|
const body = opts?.timeoutMs && opts.timeoutMs > 0
|
|
@@ -1501,15 +1505,21 @@ class LoomcycleClient {
|
|
|
1501
1505
|
async retireTeam(defId, retired, opts) {
|
|
1502
1506
|
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_teamdef", { op: "retire", def_id: defId, retired }, opts);
|
|
1503
1507
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1508
|
+
async verifyTeam(name, target, opts) {
|
|
1509
|
+
const body = { op: "verify", name };
|
|
1510
|
+
if (typeof target === "string") {
|
|
1511
|
+
body.content_sha256 = target;
|
|
1512
|
+
}
|
|
1513
|
+
else {
|
|
1514
|
+
body.overlay = target.overlay;
|
|
1515
|
+
if (target.as)
|
|
1516
|
+
body.as = target.as;
|
|
1517
|
+
if (target.parentDefId)
|
|
1518
|
+
body.parent_def_id = target.parentDefId;
|
|
1519
|
+
if (target.description)
|
|
1520
|
+
body.description = target.description;
|
|
1521
|
+
}
|
|
1522
|
+
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_teamdef", body, opts);
|
|
1513
1523
|
}
|
|
1514
1524
|
/** Hard-remove a whole team by name — all versions + the active pointer
|
|
1515
1525
|
* (op=delete), scoped to the caller's tenant. Teams are runtime-only, so
|
|
@@ -1525,6 +1535,8 @@ class LoomcycleClient {
|
|
|
1525
1535
|
body.def_id = target.defId;
|
|
1526
1536
|
if (target.input !== undefined)
|
|
1527
1537
|
body.input = target.input;
|
|
1538
|
+
if (target.vars !== undefined)
|
|
1539
|
+
body.vars = target.vars;
|
|
1528
1540
|
if (target.boardChunkId !== undefined)
|
|
1529
1541
|
body.board_chunk_id = target.boardChunkId;
|
|
1530
1542
|
if (target.boardScope !== undefined)
|
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.
|
|
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
|
|
229
|
-
* elapses).
|
|
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
|
|
543
|
-
*
|
|
544
|
-
*
|
|
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
|
@@ -484,11 +484,13 @@ export class LoomcycleClient {
|
|
|
484
484
|
* N parallel {@link LoomcycleClient.runStreaming} calls.
|
|
485
485
|
*
|
|
486
486
|
* Each spawn is a fresh run (its `sessionId` is ignored). Capped at 32 —
|
|
487
|
-
* an over-cap batch rejects with InvalidArgumentError.
|
|
488
|
-
* (async handles) is reserved for a future release and rejected today.
|
|
487
|
+
* an over-cap batch rejects with InvalidArgumentError.
|
|
489
488
|
*
|
|
490
|
-
* Blocking: resolves only when the slowest child finishes (or
|
|
491
|
-
* elapses).
|
|
489
|
+
* Blocking by default: resolves only when the slowest child finishes (or
|
|
490
|
+
* `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
|
|
491
|
+
* has started — each with `status: "running"` and its `run_id` — and the
|
|
492
|
+
* runs go on; read one with {@link LoomcycleClient.getRun}. Mirrors
|
|
493
|
+
* POST /v1/runs:batch.
|
|
492
494
|
*/
|
|
493
495
|
async spawnRunBatch(opts) {
|
|
494
496
|
const body = {
|
|
@@ -845,9 +847,11 @@ export class LoomcycleClient {
|
|
|
845
847
|
return jsonFetch(this.ctx, "/v1/_me", opts);
|
|
846
848
|
}
|
|
847
849
|
// ---- v0.8.17/8.18 Pause / Resume / State ----
|
|
848
|
-
/** Quiesce the runtime
|
|
849
|
-
*
|
|
850
|
-
*
|
|
850
|
+
/** Quiesce the runtime: new runs are refused and each in-flight run
|
|
851
|
+
* parks at its next iteration boundary, after the model or tool call it
|
|
852
|
+
* is in finishes — no tool call is cancelled. Waits up to `timeoutMs`
|
|
853
|
+
* (default 30 s, max 5 min) for runs to park; any that did not are named
|
|
854
|
+
* in `warnings`. Raises AlreadyPausingError on 409,
|
|
851
855
|
* PauseNotConfiguredError on 503. */
|
|
852
856
|
async pauseRuntime(opts) {
|
|
853
857
|
const body = opts?.timeoutMs && opts.timeoutMs > 0
|
|
@@ -1498,15 +1502,21 @@ export class LoomcycleClient {
|
|
|
1498
1502
|
async retireTeam(defId, retired, opts) {
|
|
1499
1503
|
return postJSON(this.ctx, "/v1/_teamdef", { op: "retire", def_id: defId, retired }, opts);
|
|
1500
1504
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1505
|
+
async verifyTeam(name, target, opts) {
|
|
1506
|
+
const body = { op: "verify", name };
|
|
1507
|
+
if (typeof target === "string") {
|
|
1508
|
+
body.content_sha256 = target;
|
|
1509
|
+
}
|
|
1510
|
+
else {
|
|
1511
|
+
body.overlay = target.overlay;
|
|
1512
|
+
if (target.as)
|
|
1513
|
+
body.as = target.as;
|
|
1514
|
+
if (target.parentDefId)
|
|
1515
|
+
body.parent_def_id = target.parentDefId;
|
|
1516
|
+
if (target.description)
|
|
1517
|
+
body.description = target.description;
|
|
1518
|
+
}
|
|
1519
|
+
return postJSON(this.ctx, "/v1/_teamdef", body, opts);
|
|
1510
1520
|
}
|
|
1511
1521
|
/** Hard-remove a whole team by name — all versions + the active pointer
|
|
1512
1522
|
* (op=delete), scoped to the caller's tenant. Teams are runtime-only, so
|
|
@@ -1522,6 +1532,8 @@ export class LoomcycleClient {
|
|
|
1522
1532
|
body.def_id = target.defId;
|
|
1523
1533
|
if (target.input !== undefined)
|
|
1524
1534
|
body.input = target.input;
|
|
1535
|
+
if (target.vars !== undefined)
|
|
1536
|
+
body.vars = target.vars;
|
|
1525
1537
|
if (target.boardChunkId !== undefined)
|
|
1526
1538
|
body.board_chunk_id = target.boardChunkId;
|
|
1527
1539
|
if (target.boardScope !== undefined)
|
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`
|
|
508
|
-
* ledger a
|
|
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?: {
|
|
@@ -602,7 +633,7 @@ export interface AgentEvent {
|
|
|
602
633
|
interruption?: InterruptionEventInfo;
|
|
603
634
|
/** Payload on `turn_cancelled`. */
|
|
604
635
|
turn_cancelled?: TurnCancelledInfo;
|
|
605
|
-
/** Payload on `spawn_child_started` / `spawn_child_result`. */
|
|
636
|
+
/** Payload on `spawn_child_started` / `spawn_child_result` / `spawn_child_read`. */
|
|
606
637
|
spawn_child?: SpawnChildInfo;
|
|
607
638
|
/** Payload on `prompt_snapshot` (transcript only). */
|
|
608
639
|
prompt_snapshot?: RunPromptSnapshot;
|
|
@@ -1123,9 +1154,11 @@ export interface ClientOptions {
|
|
|
1123
1154
|
/** `rejected` is a run a reviewer turned down without feedback (RFC DJ). */
|
|
1124
1155
|
export type AgentStatus = "configured" | "running" | "completed" | "failed" | "cancelled" | "rejected";
|
|
1125
1156
|
/** What a running run is blocked on: an open Channel subscribe, an open
|
|
1126
|
-
* Interruption ask, a hold for an operator's review verdict,
|
|
1127
|
-
* interactive run parked for the operator's next turn (`input`)
|
|
1128
|
-
|
|
1157
|
+
* Interruption ask, a hold for an operator's review verdict, an
|
|
1158
|
+
* interactive run parked for the operator's next turn (`input`), or a run
|
|
1159
|
+
* that ended its turn and waits for its background (poll-mode) children
|
|
1160
|
+
* to end (`children`). */
|
|
1161
|
+
export type AwaitedState = "channel" | "interrupted" | "review" | "input" | "children";
|
|
1129
1162
|
export interface AgentUsage {
|
|
1130
1163
|
input_tokens?: number;
|
|
1131
1164
|
output_tokens?: number;
|
|
@@ -1162,8 +1195,9 @@ export interface Agent {
|
|
|
1162
1195
|
awaited_state?: AwaitedState;
|
|
1163
1196
|
/** The channel name (`awaited_state: "channel"`; a fan-in `Channel` await
|
|
1164
1197
|
* lists its channels comma-separated, bounded), interruption kind
|
|
1165
|
-
* (`awaited_state: "interrupted"`)
|
|
1166
|
-
* (`awaited_state: "review"`) the run
|
|
1198
|
+
* (`awaited_state: "interrupted"`), the agent_stop hook holding a review
|
|
1199
|
+
* (`awaited_state: "review"`) or the child run ids, comma-separated and
|
|
1200
|
+
* bounded (`awaited_state: "children"`) the run waits on. */
|
|
1167
1201
|
awaited_on?: string;
|
|
1168
1202
|
/** The replica owning the run's live cancel handle. Absent in a
|
|
1169
1203
|
* single-replica deployment. */
|
|
@@ -1272,7 +1306,18 @@ export interface RunSpec {
|
|
|
1272
1306
|
}>;
|
|
1273
1307
|
};
|
|
1274
1308
|
fanout_cap?: number;
|
|
1309
|
+
/** A resident child (Agent op=open), which a resume rebuilds as one. */
|
|
1310
|
+
resident?: boolean;
|
|
1311
|
+
/** Unix seconds a resident child was last polled or cancelled from a
|
|
1312
|
+
* replica that does not hold it; its own replica reads it before it
|
|
1313
|
+
* reaps the child as idle. */
|
|
1314
|
+
addressed_at?: number;
|
|
1275
1315
|
};
|
|
1316
|
+
/** The iteration limit the run started with. Absent for a run with none
|
|
1317
|
+
* (unbounded, or an interactive run with no `max_iterations` of its own)
|
|
1318
|
+
* and for a run recorded before the field existed. Written by the server
|
|
1319
|
+
* only. */
|
|
1320
|
+
iteration_limit?: number;
|
|
1276
1321
|
/** The agent version the run started on, which a resumed run continues on:
|
|
1277
1322
|
* the AgentDef version its agent name resolved to (`def_id` absent for an
|
|
1278
1323
|
* agent with no versions — the operator's yaml or a registered agent). For
|
|
@@ -1285,6 +1330,10 @@ export interface RunSpec {
|
|
|
1285
1330
|
def_id?: string;
|
|
1286
1331
|
registered_sha256?: string;
|
|
1287
1332
|
static?: boolean;
|
|
1333
|
+
/** Set when the run's agent is one of a team's OWN agents (declared in
|
|
1334
|
+
* the team's definition, run as `<team>/<name>`): the team version it
|
|
1335
|
+
* was read from. */
|
|
1336
|
+
team_def_id?: string;
|
|
1288
1337
|
};
|
|
1289
1338
|
/** On a team walk's own run: the team version it ran, its input and the
|
|
1290
1339
|
* arguments it was started with. Written once when the walk starts and
|
|
@@ -1292,6 +1341,48 @@ export interface RunSpec {
|
|
|
1292
1341
|
* versions were: read that as "version not recorded", never as the
|
|
1293
1342
|
* team's current version. Written by the server only. */
|
|
1294
1343
|
team?: RunSpecTeam;
|
|
1344
|
+
/** The team this run belongs to: present on every run in a team walk's
|
|
1345
|
+
* spawn tree (its members, their sub-agents, and theirs) and on a
|
|
1346
|
+
* continuation of one. Names the team VERSION whose own agents the run
|
|
1347
|
+
* may start; a resume or continuation reads them from it. Absent outside
|
|
1348
|
+
* any team, and on the walk's own run (see `team`). Written by the
|
|
1349
|
+
* server only. */
|
|
1350
|
+
team_scope?: {
|
|
1351
|
+
team: string;
|
|
1352
|
+
def_id: string;
|
|
1353
|
+
def_tenant?: string;
|
|
1354
|
+
};
|
|
1355
|
+
/** A code agent's time as of its last pause: the active time it had used
|
|
1356
|
+
* against `run_timeout_seconds`, the time it had spent waiting (which
|
|
1357
|
+
* never counts against that budget), and how long it had lived — waits
|
|
1358
|
+
* included, runtime pauses excluded — against the operator's lifetime
|
|
1359
|
+
* limit. A resumed run continues from it rather than starting fresh.
|
|
1360
|
+
* Absent on a run that never paused, and on every run that is not a code
|
|
1361
|
+
* agent. Written by the server only. */
|
|
1362
|
+
run_clock?: {
|
|
1363
|
+
active_ms: number;
|
|
1364
|
+
waited_ms: number;
|
|
1365
|
+
wall_ms: number;
|
|
1366
|
+
};
|
|
1367
|
+
/** The runtime pauses this run lived through, oldest first: when each
|
|
1368
|
+
* began (when the runtime paused) and, once it ended, when — the resume,
|
|
1369
|
+
* or the run's re-dispatch after a restore or a restart. The last has no
|
|
1370
|
+
* `until` while the pause lasts. A parent re-arming this run's
|
|
1371
|
+
* `timeout_ms` after a resume leaves them out. Past 16 the oldest are
|
|
1372
|
+
* folded into `pauses_folded`. Absent on a run that never lived through a
|
|
1373
|
+
* pause. Written by the server only. */
|
|
1374
|
+
pauses?: {
|
|
1375
|
+
since: string;
|
|
1376
|
+
until?: string;
|
|
1377
|
+
}[];
|
|
1378
|
+
/** The pauses folded out of `pauses`: the time, in nanoseconds, before
|
|
1379
|
+
* `until` that the run's `timeout_ms` was stopped — its pauses and its
|
|
1380
|
+
* review holds, an overlap counted once. Absent until the run has lived
|
|
1381
|
+
* through more than 16 pauses. Written by the server only. */
|
|
1382
|
+
pauses_folded?: {
|
|
1383
|
+
until: string;
|
|
1384
|
+
stopped_ns: number;
|
|
1385
|
+
};
|
|
1295
1386
|
}
|
|
1296
1387
|
/** What a team walk started with (`RunSpec.team`). */
|
|
1297
1388
|
export interface RunSpecTeam {
|
|
@@ -1310,7 +1401,15 @@ export interface RunSpecTeam {
|
|
|
1310
1401
|
input_bytes?: number;
|
|
1311
1402
|
/** Set when `input` was cut. */
|
|
1312
1403
|
input_truncated?: boolean;
|
|
1313
|
-
|
|
1404
|
+
/** The variable values the caller supplied at start (`runTeam`'s `vars`),
|
|
1405
|
+
* with secrets masked like `input`. Only those: a variable left at the
|
|
1406
|
+
* team's default is not listed, and reads from the definition version
|
|
1407
|
+
* this record names. Absent when the start supplied none. */
|
|
1408
|
+
vars?: Record<string, string>;
|
|
1409
|
+
/** How the walk was started: waited for (`sync`), handed back at once and
|
|
1410
|
+
* run outside its caller (`detach`), or run as a background child of the
|
|
1411
|
+
* agent run that started it (`poll`). */
|
|
1412
|
+
mode: "sync" | "detach" | "poll";
|
|
1314
1413
|
/** The board binding; `resumed_from` names the state a persisted board
|
|
1315
1414
|
* resumed the walk from. */
|
|
1316
1415
|
board?: {
|
|
@@ -1363,11 +1462,15 @@ export interface CancelAgentResult {
|
|
|
1363
1462
|
export interface RunBatchOptions {
|
|
1364
1463
|
spawns: RunOptions[];
|
|
1365
1464
|
/** "join" (default) — block until all children settle, returning the
|
|
1366
|
-
* combined envelope. "detach"
|
|
1367
|
-
*
|
|
1368
|
-
|
|
1465
|
+
* combined envelope. "detach" — resolve once every child has started:
|
|
1466
|
+
* each started child reports `status: "running"` with its `run_id`, keeps
|
|
1467
|
+
* running after the call, and is read with {@link LoomcycleClient.getRun}
|
|
1468
|
+
* and stopped with {@link LoomcycleClient.cancelAgent}; a child that could
|
|
1469
|
+
* not start is reported in its slot, as in join. */
|
|
1470
|
+
mode?: "join" | "detach";
|
|
1369
1471
|
/** Optional join deadline (ms): a child still running when it elapses is
|
|
1370
|
-
* cancelled and reported with a cancelled status in-envelope.
|
|
1472
|
+
* cancelled and reported with a cancelled status in-envelope. Rejected
|
|
1473
|
+
* (400) with `mode: "detach"`, which does not wait. */
|
|
1371
1474
|
timeoutMs?: number;
|
|
1372
1475
|
signal?: AbortSignal;
|
|
1373
1476
|
}
|
|
@@ -1677,6 +1780,7 @@ export type RuntimeStateStatus = "running" | "pausing" | "paused";
|
|
|
1677
1780
|
export interface PauseResult {
|
|
1678
1781
|
state: string;
|
|
1679
1782
|
duration_ms: number;
|
|
1783
|
+
/** Always 0: pause cancels no tool call. Kept for wire compatibility. */
|
|
1680
1784
|
force_cancelled_count: number;
|
|
1681
1785
|
paused_runs_count: number;
|
|
1682
1786
|
warnings?: string[];
|
|
@@ -2233,6 +2337,72 @@ export interface TeamVerification {
|
|
|
2233
2337
|
current_sha256: string;
|
|
2234
2338
|
current_def_id: string;
|
|
2235
2339
|
version: number;
|
|
2340
|
+
/** Whether a walk could run the deployed version: false when it references
|
|
2341
|
+
* something that does not resolve (see `issues`). Absent when
|
|
2342
|
+
* `deployed: false`, or when the stored definition does not parse. */
|
|
2343
|
+
runnable?: boolean;
|
|
2344
|
+
/** What the deployed version references but does not contain. Present only
|
|
2345
|
+
* when there is something to report. */
|
|
2346
|
+
issues?: TeamIssue[];
|
|
2347
|
+
}
|
|
2348
|
+
/** What a {@link TeamIssue} is about. A wire enum that only grows: a kind this
|
|
2349
|
+
* client does not know is still a `string`, so a new one never breaks a build. */
|
|
2350
|
+
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 & {});
|
|
2351
|
+
/** One problem with a team definition, from {@link LoomcycleClient.verifyTeam}.
|
|
2352
|
+
*
|
|
2353
|
+
* `severity`: `refused` — a create or fork would be refused (its `detail` is
|
|
2354
|
+
* exactly the refusal); `unrunnable` — it would be stored, but a walk could not
|
|
2355
|
+
* run it; `advisory` — worth reading, stops nothing. */
|
|
2356
|
+
export interface TeamIssue {
|
|
2357
|
+
kind: TeamIssueKind;
|
|
2358
|
+
severity: "refused" | "unrunnable" | "advisory";
|
|
2359
|
+
detail: string;
|
|
2360
|
+
/** JSON path of the value at fault in the definition, e.g.
|
|
2361
|
+
* `states[2].handler.sink.channel` or `local.agents.reviewer`. Absent when
|
|
2362
|
+
* the problem is the definition as a whole. */
|
|
2363
|
+
path?: string;
|
|
2364
|
+
/** The state the problem is in, and the handler field within it. */
|
|
2365
|
+
state?: string;
|
|
2366
|
+
field?: string;
|
|
2367
|
+
/** What the problem names. */
|
|
2368
|
+
channel?: string;
|
|
2369
|
+
agent?: string;
|
|
2370
|
+
skill?: string;
|
|
2371
|
+
side?: "publish" | "subscribe";
|
|
2372
|
+
/** Set (true) on an advisory issue — the older spelling of
|
|
2373
|
+
* `severity: "advisory"`, kept for clients that read it. */
|
|
2374
|
+
advisory?: boolean;
|
|
2375
|
+
}
|
|
2376
|
+
/** An unsaved team for {@link LoomcycleClient.verifyTeam} to check. */
|
|
2377
|
+
export interface TeamDraft {
|
|
2378
|
+
/** Exactly what `createTeam` / `forkTeam` would be sent. */
|
|
2379
|
+
overlay: Record<string, unknown>;
|
|
2380
|
+
/** Check it as a create or as a fork. Omitted: as a save would — a fork of
|
|
2381
|
+
* the active version when the name has one, else a create. */
|
|
2382
|
+
as?: "create" | "fork";
|
|
2383
|
+
/** Check it as a fork of this version. */
|
|
2384
|
+
parentDefId?: string;
|
|
2385
|
+
/** The description the save would carry (its size is checked too). */
|
|
2386
|
+
description?: string;
|
|
2387
|
+
}
|
|
2388
|
+
/** Result of {@link LoomcycleClient.verifyTeam} for a {@link TeamDraft}: every
|
|
2389
|
+
* problem a create or fork would refuse, plus what would make the stored team
|
|
2390
|
+
* unrunnable — all at once. Nothing is written. */
|
|
2391
|
+
export interface TeamDraftVerification extends TeamVerification {
|
|
2392
|
+
/** No `refused` issue: a create or fork with this overlay would be accepted. */
|
|
2393
|
+
valid: boolean;
|
|
2394
|
+
/** Valid, and no `unrunnable` issue. */
|
|
2395
|
+
runnable: boolean;
|
|
2396
|
+
/** How the draft was checked. */
|
|
2397
|
+
checked_as: "create" | "fork";
|
|
2398
|
+
/** The version the fork would start from (`checked_as: "fork"`). */
|
|
2399
|
+
parent_def_id?: string;
|
|
2400
|
+
/** The hash the save would sign. Absent when the overlay cannot be built.
|
|
2401
|
+
* `matches` compares it with the deployed version's. */
|
|
2402
|
+
content_sha256?: string;
|
|
2403
|
+
/** Every problem found, refusals first in the order a save checks them;
|
|
2404
|
+
* empty when there are none. */
|
|
2405
|
+
issues: TeamIssue[];
|
|
2236
2406
|
}
|
|
2237
2407
|
/** Result of {@link LoomcycleClient.runTeam} (op=run) — the walk trace. `status`
|
|
2238
2408
|
* is `"completed"` (a terminal state was reached) or `"iteration_cap"` (a
|
|
@@ -2264,6 +2434,14 @@ export interface TeamRunTarget {
|
|
|
2264
2434
|
defId?: string;
|
|
2265
2435
|
/** The initial task handed to the entry state's agent. */
|
|
2266
2436
|
input?: string;
|
|
2437
|
+
/** Values for this walk's variables, name → text, read by the team's
|
|
2438
|
+
* prompts as `${var.<name>}`. Only a name the team's definition declares in
|
|
2439
|
+
* its `vars` is accepted — any other is refused before anything runs, with
|
|
2440
|
+
* the declared names. A value given here replaces the team's default for
|
|
2441
|
+
* this walk; a `vars` state, a `capture` or a starter's `binds` may still
|
|
2442
|
+
* overwrite it as the walk runs. Literal text: never expanded, no `{{` or
|
|
2443
|
+
* `}}`, at most 4096 bytes. */
|
|
2444
|
+
vars?: Record<string, string>;
|
|
2267
2445
|
/** Bind the walk to a Document chunk task board: each state transition
|
|
2268
2446
|
* persists `chunk.status` = the current team state, and every handler run
|
|
2269
2447
|
* the walk spawns carries the task key on its `parent_context`. */
|
|
@@ -2904,7 +3082,8 @@ export interface RunStateEvent {
|
|
|
2904
3082
|
* field, so a client folding the stream holds the run's current wait. */
|
|
2905
3083
|
awaited_state?: AwaitedState;
|
|
2906
3084
|
/** The channel (a fan-in `Channel` await: its channels, comma-separated),
|
|
2907
|
-
* the interruption kind,
|
|
3085
|
+
* the interruption kind, the agent_stop hook holding a review, or the
|
|
3086
|
+
* background child run ids (comma-separated) a run waits on. */
|
|
2908
3087
|
awaited_on?: string;
|
|
2909
3088
|
/** RFC3339: when a review hold ends as rejected if nobody rules on it.
|
|
2910
3089
|
* 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.
|
|
3
|
+
"version": "1.105.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",
|