@loomcycle/client 1.113.0 → 1.115.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 +7 -2
- package/dist/client.d.ts +4 -2
- package/dist/client.js +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +101 -6
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -214,6 +214,9 @@ function applyOverridesToWire(body, opts) {
|
|
|
214
214
|
body.tool_choice = opts.toolChoice;
|
|
215
215
|
if (opts.outputFormat !== undefined)
|
|
216
216
|
body.output_format = opts.outputFormat;
|
|
217
|
+
// Same keys on the wire as in the option (queue_aware / switch_after_ms).
|
|
218
|
+
if (opts.routing !== undefined)
|
|
219
|
+
body.routing = opts.routing;
|
|
217
220
|
}
|
|
218
221
|
class LoomcycleClient {
|
|
219
222
|
ctx;
|
|
@@ -516,8 +519,10 @@ class LoomcycleClient {
|
|
|
516
519
|
*
|
|
517
520
|
* Blocking by default: resolves only when the slowest child finishes (or
|
|
518
521
|
* `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
|
|
519
|
-
* has started — each with `status: "running"`
|
|
520
|
-
*
|
|
522
|
+
* has started or queued — each with `status: "running"` (or `"queued"` while
|
|
523
|
+
* it waits for a run slot; it starts by itself when one frees) and its
|
|
524
|
+
* `run_id` — and the runs go on; read one with
|
|
525
|
+
* {@link LoomcycleClient.getRun}. Mirrors
|
|
521
526
|
* POST /v1/runs:batch.
|
|
522
527
|
*/
|
|
523
528
|
async spawnRunBatch(opts) {
|
package/dist/client.d.ts
CHANGED
|
@@ -244,8 +244,10 @@ export declare class LoomcycleClient {
|
|
|
244
244
|
*
|
|
245
245
|
* Blocking by default: resolves only when the slowest child finishes (or
|
|
246
246
|
* `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
|
|
247
|
-
* has started — each with `status: "running"`
|
|
248
|
-
*
|
|
247
|
+
* has started or queued — each with `status: "running"` (or `"queued"` while
|
|
248
|
+
* it waits for a run slot; it starts by itself when one frees) and its
|
|
249
|
+
* `run_id` — and the runs go on; read one with
|
|
250
|
+
* {@link LoomcycleClient.getRun}. Mirrors
|
|
249
251
|
* POST /v1/runs:batch.
|
|
250
252
|
*/
|
|
251
253
|
spawnRunBatch(opts: RunBatchOptions): Promise<RunBatchResult>;
|
package/dist/client.js
CHANGED
|
@@ -211,6 +211,9 @@ function applyOverridesToWire(body, opts) {
|
|
|
211
211
|
body.tool_choice = opts.toolChoice;
|
|
212
212
|
if (opts.outputFormat !== undefined)
|
|
213
213
|
body.output_format = opts.outputFormat;
|
|
214
|
+
// Same keys on the wire as in the option (queue_aware / switch_after_ms).
|
|
215
|
+
if (opts.routing !== undefined)
|
|
216
|
+
body.routing = opts.routing;
|
|
214
217
|
}
|
|
215
218
|
export class LoomcycleClient {
|
|
216
219
|
ctx;
|
|
@@ -513,8 +516,10 @@ export class LoomcycleClient {
|
|
|
513
516
|
*
|
|
514
517
|
* Blocking by default: resolves only when the slowest child finishes (or
|
|
515
518
|
* `timeoutMs` elapses). With `mode: "detach"` it resolves once every child
|
|
516
|
-
* has started — each with `status: "running"`
|
|
517
|
-
*
|
|
519
|
+
* has started or queued — each with `status: "running"` (or `"queued"` while
|
|
520
|
+
* it waits for a run slot; it starts by itself when one frees) and its
|
|
521
|
+
* `run_id` — and the runs go on; read one with
|
|
522
|
+
* {@link LoomcycleClient.getRun}. Mirrors
|
|
518
523
|
* POST /v1/runs:batch.
|
|
519
524
|
*/
|
|
520
525
|
async spawnRunBatch(opts) {
|
package/dist/index.d.ts
CHANGED
|
@@ -176,5 +176,5 @@ export { verifyLoomcycleSignature, verifyLoomcycleDelivery } from "./signature.j
|
|
|
176
176
|
export type { VerifySignatureOptions, VerifiedDelivery } from "./signature.js";
|
|
177
177
|
export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
|
|
178
178
|
export type { ClientToolSchema, ClientToolInvocation, ConnectClientToolsOptions, WebSocketLike, WebSocketCtor, } from "./client-tools.js";
|
|
179
|
-
export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, RunOverrideOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, ListUserAgentsOptions, AgentList, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, RunTreeDeletion, RunTreeNotReached, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, ReplaySessionResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenRestrictions, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, RetentionOverride, 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, CreateTeamOptions, ForkTeamOptions, DefNameSummary, DefNamesResponse, OperatorTokenDefNameSummary, OperatorTokenDefNamesResponse, ScheduleListEntry, ScheduleListResponse, ScheduleActiveRun, ScheduleStateView, ScheduleRunNowResult, SchedulePauseResult, ModelAlias, ModelAliasesResponse, RoutingResponse, RoutingUserTier, RoutingTier, RoutingCandidate, RoutingThroughput, RoutingProvider, SearchRoutingProvider, ProviderModelsResponse, TeamRunStep, TeamDecisionHandler, TeamDecisionQuestion, TeamDecisionAnswer, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, EvaluationEmitterRole, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationScoreStats, EvaluationAggregate, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, ChangeFeedError, ChangeFeedFrame, ChangeFeedStatus, EmbedderHealth, MemoryChange, MemoryChangeScope, MemoryChangeType, StreamChangesOptions, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelReleaseResult, TeamChannelDeclaredIn, TeamChannelDescriptor, TeamChannelPeekResult, TeamChannelsResult, 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, AgentChannelACL, AgentInterruptionACL, AgentDecision, MemoryRerank, AgentSampling, AgentCompaction, AgentContext, TierCandidate, CoreBlock, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, CreateDefOptions, ForkDefOptions, EnsureHookDefOptions, EnsureHookDefResult, HookDefBody, HookDefForkOverlay, HookDefInput, HookDefMatch, HookDefOverlay, HookDefRowResponse, HookDefVerifyResult, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, ScheduledRunHook, ScheduledRunPromptContent, ScheduledRunPromptSegment, WebhookDefAuth, WebhookDefInput, WebhookDefOverlay, WebhookDefRateLimit, WebhookDefRowResponse, WebhookDefSyncResponse, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, AdmissionInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, TeamDecisionInfo, OverrideInfo, FallbackInfo, InterruptionEventInfo, SpawnChildInfo, TurnCancelledInfo, ChannelEventInfo, ContextCompactionInfo, ContextRecapInfo, ContextStateInfo, ContextExhaustedInfo, ContextTierVerdict, ContextDistillDeclinedInfo, EffectiveConfigResponse, EffectiveConfigSource, EffectiveValue, InertContextSetting, AgentOverridableResponse, OverridableField, OverrideLockReason, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, DecideRequest, DecideResponse, DecisionQuestion, DecisionChoiceQuestion, DecisionNoulQuestion, DecisionScoreQuestion, DecisionAnswer, DecisionChoiceAnswer, DecisionNoulAnswer, DecisionScoreAnswer, DecisionModel, DecisionModelsResponse, } from "./types.js";
|
|
179
|
+
export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, RunOverrideOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, ListUserAgentsOptions, AgentList, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, RunTreeDeletion, RunTreeNotReached, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, ReplaySessionResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenRestrictions, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, RetentionOverride, 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, CreateTeamOptions, ForkTeamOptions, DefNameSummary, DefNamesResponse, OperatorTokenDefNameSummary, OperatorTokenDefNamesResponse, ScheduleListEntry, ScheduleListResponse, ScheduleActiveRun, ScheduleStateView, ScheduleRunNowResult, SchedulePauseResult, ModelAlias, ModelAliasesResponse, RoutingResponse, RoutingUserTier, RoutingTier, RoutingCandidate, RoutingThroughput, RoutingProvider, SearchRoutingProvider, ProviderModelsResponse, TeamRunStep, TeamDecisionHandler, TeamDecisionQuestion, TeamDecisionAnswer, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, EvaluationEmitterRole, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationScoreStats, EvaluationAggregate, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, ChangeFeedError, ChangeFeedFrame, ChangeFeedStatus, EmbedderHealth, MemoryChange, MemoryChangeScope, MemoryChangeType, StreamChangesOptions, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelReleaseResult, TeamChannelDeclaredIn, TeamChannelDescriptor, TeamChannelPeekResult, TeamChannelsResult, 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, AgentRouting, AgentChannelACL, AgentInterruptionACL, AgentDecision, MemoryRerank, AgentSampling, AgentCompaction, AgentContext, TierCandidate, CoreBlock, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, CreateDefOptions, ForkDefOptions, EnsureHookDefOptions, EnsureHookDefResult, HookDefBody, HookDefForkOverlay, HookDefInput, HookDefMatch, HookDefOverlay, HookDefRowResponse, HookDefVerifyResult, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, ScheduledRunHook, ScheduledRunPromptContent, ScheduledRunPromptSegment, WebhookDefAuth, WebhookDefFilter, WebhookDefInput, WebhookDefOverlay, WebhookDefRateLimit, WebhookDefRowResponse, WebhookDefDeliveries, WebhookDefSyncResponse, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, AdmissionInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, TeamDecisionInfo, OverrideInfo, FallbackInfo, InterruptionEventInfo, SpawnChildInfo, TurnCancelledInfo, ChannelEventInfo, ContextCompactionInfo, ContextRecapInfo, ContextStateInfo, ContextExhaustedInfo, ContextTierVerdict, ContextDistillDeclinedInfo, EffectiveConfigResponse, EffectiveConfigSource, EffectiveValue, InertContextSetting, AgentOverridableResponse, OverridableField, OverrideLockReason, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, DecideRequest, DecideResponse, DecisionQuestion, DecisionChoiceQuestion, DecisionNoulQuestion, DecisionScoreQuestion, DecisionAnswer, DecisionChoiceAnswer, DecisionNoulAnswer, DecisionScoreAnswer, DecisionModel, DecisionModelsResponse, } from "./types.js";
|
|
180
180
|
export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, NotFoundError, InsufficientScopeError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, PromptTooLargeError, RateLimitedError, RequestTooLargeError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, TokenLimitExceededError, UnavailableError, } from "./errors.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -854,6 +854,15 @@ export interface RunOverrideOptions {
|
|
|
854
854
|
* agent's own whole. On a retune it replaces the run's own and takes
|
|
855
855
|
* effect from the run's next turn; a retune cannot remove it. */
|
|
856
856
|
outputFormat?: OutputFormatOptions;
|
|
857
|
+
/** The run's own `routing:` block: how the agent's tier candidates are
|
|
858
|
+
* walked — at the run's start, and when the run, having lost its lane
|
|
859
|
+
* slot, would wait too long for its next call. REPLACES the agent's block
|
|
860
|
+
* whole — `{}` turns queue-aware routing off. It chooses only among the
|
|
861
|
+
* candidates the definition declares. `queue_aware` on an agent (or a run)
|
|
862
|
+
* pinned to a provider or model is refused (400). On a retune it replaces
|
|
863
|
+
* the run's own and is read at the run's next call boundary. A sub-agent
|
|
864
|
+
* of the same definition inherits it. */
|
|
865
|
+
routing?: AgentRouting;
|
|
857
866
|
}
|
|
858
867
|
export interface RunOptions extends RunOverrideOptions {
|
|
859
868
|
agent: string;
|
|
@@ -1423,6 +1432,9 @@ export interface RunSpec {
|
|
|
1423
1432
|
review_ttl_seconds?: number;
|
|
1424
1433
|
/** Which model serves the run: model / provider / tier / effort. */
|
|
1425
1434
|
routing?: Record<string, unknown>;
|
|
1435
|
+
/** The run's own `routing:` block ({@link RunOptions.routing}), when it
|
|
1436
|
+
* set one. Its own key because `routing` above names the model choice. */
|
|
1437
|
+
queue_routing?: AgentRouting;
|
|
1426
1438
|
/** The run's budget: max_tokens / max_iterations / … */
|
|
1427
1439
|
resources?: Record<string, unknown>;
|
|
1428
1440
|
tuning?: Record<string, unknown>;
|
|
@@ -1656,9 +1668,10 @@ export interface CancelAgentResult {
|
|
|
1656
1668
|
export interface RunBatchOptions {
|
|
1657
1669
|
spawns: RunOptions[];
|
|
1658
1670
|
/** "join" (default) — block until all children settle, returning the
|
|
1659
|
-
* combined envelope. "detach" — resolve once every child has started
|
|
1660
|
-
* each
|
|
1661
|
-
*
|
|
1671
|
+
* combined envelope. "detach" — resolve once every child has started or
|
|
1672
|
+
* queued: each reports `status: "running"` (or `"queued"` while it waits
|
|
1673
|
+
* for a run slot, starting by itself when one frees) with its `run_id`,
|
|
1674
|
+
* goes on after the call, and is read with {@link LoomcycleClient.getRun}
|
|
1662
1675
|
* and stopped with {@link LoomcycleClient.cancelAgent}; a child that could
|
|
1663
1676
|
* not start is reported in its slot, as in join. */
|
|
1664
1677
|
mode?: "join" | "detach";
|
|
@@ -4040,6 +4053,15 @@ export interface CoreBlock {
|
|
|
4040
4053
|
* host filesystem bind — the symmetry that makes code agents work in
|
|
4041
4054
|
* containers / pure-cloud. Requires `LOOMCYCLE_CODE_AGENTS_ENABLED=1` on the
|
|
4042
4055
|
* sidecar; create/fork refuses a non-empty `code_body` otherwise. */
|
|
4056
|
+
/** An agent's `routing:` block (RFC EI P4). */
|
|
4057
|
+
export interface AgentRouting {
|
|
4058
|
+
/** Pass over a cascade candidate whose provider is busy enough that the
|
|
4059
|
+
* run's first call would wait longer than `switch_after_ms`, for the next
|
|
4060
|
+
* available one. */
|
|
4061
|
+
queue_aware?: boolean;
|
|
4062
|
+
/** The estimated wait that passes a candidate over. Default 20000. */
|
|
4063
|
+
switch_after_ms?: number;
|
|
4064
|
+
}
|
|
4043
4065
|
export interface AgentDefOverlay {
|
|
4044
4066
|
provider?: string;
|
|
4045
4067
|
model?: string;
|
|
@@ -4049,6 +4071,9 @@ export interface AgentDefOverlay {
|
|
|
4049
4071
|
code_body?: string;
|
|
4050
4072
|
tier?: string;
|
|
4051
4073
|
effort?: string;
|
|
4074
|
+
/** How the provider and model are chosen when a run starts (RFC EI P4).
|
|
4075
|
+
* Tier-routed agents only. Replaced whole by a fork that sets it. */
|
|
4076
|
+
routing?: AgentRouting;
|
|
4052
4077
|
/** Whether and which tool the model must call (RFC DI). */
|
|
4053
4078
|
tool_choice?: ToolChoiceOptions;
|
|
4054
4079
|
/** The JSON schema the answer must follow (RFC DI). */
|
|
@@ -4440,6 +4465,9 @@ export interface ScheduledRunPromptContent {
|
|
|
4440
4465
|
* input. */
|
|
4441
4466
|
type?: "trusted-text" | "untrusted-block";
|
|
4442
4467
|
text: string;
|
|
4468
|
+
/** An untrusted-block's source label, as on a run's segments; `"code"`
|
|
4469
|
+
* keeps the text exactly as written. Default `"untrusted"`. */
|
|
4470
|
+
kind?: string;
|
|
4443
4471
|
}
|
|
4444
4472
|
/** One segment of a scheduled run's prompt. */
|
|
4445
4473
|
export interface ScheduledRunPromptSegment {
|
|
@@ -4485,6 +4513,13 @@ export interface ScheduleDefOverlay {
|
|
|
4485
4513
|
/** Credential key → env-var NAME the scheduler reads it from (the variable
|
|
4486
4514
|
* must be on LOOMCYCLE_SCHEDULER_ENV_ALLOWLIST). */
|
|
4487
4515
|
user_credentials_from_env?: Record<string, string>;
|
|
4516
|
+
/** The fired run's bearer — what `${run.user_bearer}` in an MCP server's
|
|
4517
|
+
* headers becomes. Only a stored credential, `"$cred:<name>"`: resolved
|
|
4518
|
+
* for each MCP request, for that server's URL, as a tenant-level
|
|
4519
|
+
* credential of the run's tenant (never a user's or an agent's), so a
|
|
4520
|
+
* credential restricted by `allowed_urls` works. Refused on delivery
|
|
4521
|
+
* `channel` or `team`. */
|
|
4522
|
+
user_bearer?: string;
|
|
4488
4523
|
on_complete?: ScheduledRunHook[];
|
|
4489
4524
|
/** Non-secret metadata the agent receives as trusted. */
|
|
4490
4525
|
metadata?: Record<string, unknown>;
|
|
@@ -4579,6 +4614,20 @@ export interface WebhookDefAuth {
|
|
|
4579
4614
|
* verified by either is accepted. */
|
|
4580
4615
|
previous_secret?: string;
|
|
4581
4616
|
}
|
|
4617
|
+
/** One condition a webhook delivery's signed body must meet. Comparison is
|
|
4618
|
+
* typed (a string never equals a number), and a path that is missing, null,
|
|
4619
|
+
* or of another type than the value misses for every `op`, `ne` included. */
|
|
4620
|
+
export interface WebhookDefFilter {
|
|
4621
|
+
/** A JSONPath into the body: `$`, `.key` and `[N]` only. */
|
|
4622
|
+
path: string;
|
|
4623
|
+
/** `glob` takes a string pattern (`*` any run of characters, `?` one);
|
|
4624
|
+
* `in` takes a list of values. */
|
|
4625
|
+
op: "eq" | "ne" | "glob" | "in";
|
|
4626
|
+
/** A literal; set this or `value_from`. */
|
|
4627
|
+
value?: string | number | boolean | Array<string | number | boolean>;
|
|
4628
|
+
/** `"metadata.<key>"`: the definition's own metadata entry of that key. */
|
|
4629
|
+
value_from?: string;
|
|
4630
|
+
}
|
|
4582
4631
|
/** Inbound request rate bound for one webhook. */
|
|
4583
4632
|
export interface WebhookDefRateLimit {
|
|
4584
4633
|
requests_per_minute?: number;
|
|
@@ -4612,6 +4661,13 @@ export interface WebhookDefOverlay {
|
|
|
4612
4661
|
user_credentials_from_env?: Record<string, string>;
|
|
4613
4662
|
/** Credential key → value, handed to the run. */
|
|
4614
4663
|
user_credentials?: Record<string, string>;
|
|
4664
|
+
/** The started run's bearer — what `${run.user_bearer}` in an MCP server's
|
|
4665
|
+
* headers becomes. Only a stored credential, `"$cred:<name>"`: resolved
|
|
4666
|
+
* for each MCP request, for that server's URL, as a tenant-level
|
|
4667
|
+
* credential of the run's tenant (never a user's or an agent's), so a
|
|
4668
|
+
* credential restricted by `allowed_urls` works. Refused on delivery
|
|
4669
|
+
* `channel` or `team`. */
|
|
4670
|
+
user_bearer?: string;
|
|
4615
4671
|
/** Pins the started run's user tier; a delivery never chooses it. Must be
|
|
4616
4672
|
* one of the server's user tiers. */
|
|
4617
4673
|
user_tier?: string;
|
|
@@ -4625,10 +4681,27 @@ export interface WebhookDefOverlay {
|
|
|
4625
4681
|
* `ignored`, the provider's ping 200, and a listed event counts only when
|
|
4626
4682
|
* the signed body has its shape. Unset: every delivery is handled. */
|
|
4627
4683
|
events?: string[];
|
|
4628
|
-
/** The
|
|
4629
|
-
* provider has no shape for, or in place of its.
|
|
4630
|
-
*
|
|
4684
|
+
/** The rules the body of a listed event must meet, for an event the
|
|
4685
|
+
* provider has no shape for, or in place of its. Each rule is a JSONPath
|
|
4686
|
+
* the body holds, `!path` for one it must not hold (missing or null), or
|
|
4687
|
+
* `path == <JSON string, number or boolean>` for a field's value, e.g.
|
|
4688
|
+
* `$.object_kind == "push"`. A fork merges key by key; an empty list
|
|
4689
|
+
* removes that event's shape. */
|
|
4631
4690
|
event_shapes?: Record<string, string[]>;
|
|
4691
|
+
/** Conditions on the signed body every delivery must meet before anything
|
|
4692
|
+
* starts; one that misses answers 202 `filtered`. A fork replaces the
|
|
4693
|
+
* whole list; `[]` removes it. */
|
|
4694
|
+
filters?: WebhookDefFilter[];
|
|
4695
|
+
/** JSONPaths into the signed body whose values together name one event
|
|
4696
|
+
* (for a GitHub push: `$.repository.id`, `$.ref`, `$.after`). A delivery
|
|
4697
|
+
* with the same values is answered as a duplicate whatever its delivery id
|
|
4698
|
+
* or bytes, unless the run the first one started ended `failed`. A body
|
|
4699
|
+
* lacking one answers 400 `dedup_key_unresolvable`. 1 to 16 paths; a fork
|
|
4700
|
+
* replaces the list, `[]` removes it. */
|
|
4701
|
+
dedup_key?: string[];
|
|
4702
|
+
/** How long a `dedup_key` is held, in seconds: default 604800 (7 days),
|
|
4703
|
+
* at most 90 days. Only beside `dedup_key`. */
|
|
4704
|
+
dedup_ttl_seconds?: number;
|
|
4632
4705
|
/** Non-secret metadata the agent receives as trusted. */
|
|
4633
4706
|
metadata?: Record<string, unknown>;
|
|
4634
4707
|
/** The tenant spawned runs execute in — taken from the def, never from the
|
|
@@ -4663,6 +4736,28 @@ export interface WebhookDefRowResponse {
|
|
|
4663
4736
|
/** Same meaning as on {@link ScheduleDefRowResponse}. */
|
|
4664
4737
|
disabled_until_credentials_supplied?: string[];
|
|
4665
4738
|
unusable_credentials?: string[];
|
|
4739
|
+
/** `get` only: how the webhook's deliveries were answered. */
|
|
4740
|
+
status?: {
|
|
4741
|
+
deliveries?: WebhookDefDeliveries;
|
|
4742
|
+
};
|
|
4743
|
+
}
|
|
4744
|
+
/** A webhook's delivery counts, on `webhookDef({op: "get"})` as
|
|
4745
|
+
* `status.deliveries`. They belong to the webhook (its name in its tenant),
|
|
4746
|
+
* not to one version; every replica adds its counts every 30 seconds, so
|
|
4747
|
+
* they are up to that far behind. */
|
|
4748
|
+
export interface WebhookDefDeliveries {
|
|
4749
|
+
accepted: number;
|
|
4750
|
+
duplicate: number;
|
|
4751
|
+
ping: number;
|
|
4752
|
+
ignored: number;
|
|
4753
|
+
filtered: number;
|
|
4754
|
+
/** Refused deliveries by reason: `signature`, `secret`, `event`, `shape`,
|
|
4755
|
+
* `body`, `mapping`, `rate`, `dedup_key`, … */
|
|
4756
|
+
refused: Record<string, number>;
|
|
4757
|
+
/** Deliveries that ended otherwise (a sync `timeout`, `client_gone`). */
|
|
4758
|
+
other?: Record<string, number>;
|
|
4759
|
+
/** When a counted delivery was last written (RFC 3339). */
|
|
4760
|
+
last_at?: string;
|
|
4666
4761
|
}
|
|
4667
4762
|
/** Typed input for {@link LoomcycleClient.webhookDef}, one shape per op. */
|
|
4668
4763
|
export type WebhookDefInput = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcycle/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.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",
|