@loomcycle/client 1.25.0 → 1.38.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/README.md CHANGED
@@ -143,6 +143,7 @@ The low-level primitives (`runStreaming({interactive:true})` + `sendRunInput` +
143
143
  | `listUserAgents(userId, opts?)` | `Promise<Agent[]>` | Optional filter by status (`running` / `completed` / `failed` / `cancelled`). |
144
144
  | `getTranscript(sessionId)` | `Promise<TranscriptResponse>` | Persisted event log; one row per event with seq/run_id/ts_ns/type/event. |
145
145
  | `health()` | `Promise<HealthResponse>` | Liveness probe. Hits `/healthz` (no `/v1` prefix). Unauthenticated. |
146
+ | `getConfig(opts?)` | `Promise<ConfigResponse>` | v1.38.0 — instance configuration: build identity, the feature matrix, and the live provider/model/search cascade with `active`/`selected`. `view` names the disclosure level (`public` / `authenticated` / `admin`). Also readable with **no bearer** against a deployment running `LOOMCYCLE_PUBLIC_CONFIG=1`, which serves the narrower `public` view — the landing-page case. |
146
147
  | `listUsers()` | `Promise<ListUsersResponse>` | Admin: known users with running-count summary. |
147
148
 
148
149
  ### Pause / Resume / State (v0.8.17 / v0.8.18)
@@ -375,6 +375,20 @@ class LoomcycleClient {
375
375
  const q = params.toString() ? `?${params.toString()}` : "";
376
376
  return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, `/v1/_usage${q}`, opts);
377
377
  }
378
+ /** Instance configuration: build identity, the feature matrix, and the live
379
+ * provider/model/search cascade with coarse active/inactive status. The
380
+ * out-of-band twin of the in-band `Context op=capabilities`, sharing its
381
+ * probe server-side so the two cannot disagree. Mirrors `GET /v1/config`.
382
+ *
383
+ * `view` names the disclosure level the response was rendered at, so you can
384
+ * tell "this deployment has none" from "you weren't shown them". A deployment
385
+ * running with `LOOMCYCLE_PUBLIC_CONFIG=1` also serves this **with no
386
+ * bearer**, returning the narrower `"public"` view — which is what a landing
387
+ * page fetches directly. `models` is one entry per (provider, model),
388
+ * deduplicated across plans, with `selected` marking what actually runs. */
389
+ async getConfig(opts) {
390
+ return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, "/v1/config", opts);
391
+ }
378
392
  /** List the per-scope token budgets visible to the caller (RFC AW), each with
379
393
  * its live month-to-date usage. Tenant-scoped server-side: a tenant operator
380
394
  * sees only its own tenant's budgets; an admin sees all (or focuses one via
@@ -1040,6 +1054,39 @@ class LoomcycleClient {
1040
1054
  query: browseQuery(opts),
1041
1055
  });
1042
1056
  }
1057
+ /** Build the URL of an image chunk's asset (RFC BO) — `GET
1058
+ * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
1059
+ * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
1060
+ * `scope` is "agent" | "user" (default "user"); `scopeId`/`tenant` are the
1061
+ * RFC AS browse overrides. NOTE: the URL needs the bearer to fetch — use
1062
+ * {@link LoomcycleClient.fetchDocumentAsset} for an authenticated GET (a bare
1063
+ * <img src> can't carry the Authorization header). */
1064
+ documentAssetUrl(chunkId, opts) {
1065
+ const q = new URLSearchParams({ scope: opts?.scope ?? "user" });
1066
+ if (opts?.scopeId)
1067
+ q.set("scope_id", opts.scopeId);
1068
+ if (opts?.tenant)
1069
+ q.set("tenant", opts.tenant);
1070
+ return `${this.ctx.baseUrl}/v1/_document/asset/${encodeURIComponent(chunkId)}?${q.toString()}`;
1071
+ }
1072
+ /** Fetch an image chunk's asset bytes (RFC BO) with authentication — returns
1073
+ * the raw {@link Response} so a caller can `.blob()` / `.arrayBuffer()` it.
1074
+ * Adds the bearer header (a bare <img src> can't). Throws on a non-2xx
1075
+ * (a cross-scope / missing asset is an opaque 404). */
1076
+ async fetchDocumentAsset(chunkId, opts) {
1077
+ const headers = {};
1078
+ if (this.ctx.authToken)
1079
+ headers.Authorization = `Bearer ${this.ctx.authToken}`;
1080
+ const resp = await this.ctx.fetchImpl(this.documentAssetUrl(chunkId, opts), {
1081
+ method: "GET",
1082
+ headers,
1083
+ signal: opts?.signal,
1084
+ });
1085
+ if (!resp.ok) {
1086
+ throw new Error(`fetchDocumentAsset: ${resp.status} ${resp.statusText}`);
1087
+ }
1088
+ return resp;
1089
+ }
1043
1090
  /** Invoke the RFC BE History tool over HTTP (`POST /v1/_history`). Browse,
1044
1091
  * search, and annotate PAST CHATS — a chat is a session (it may span
1045
1092
  * several runs). Op-discriminated (`list`/`get`/`search`/`rename`/
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 { Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, Hook, InterruptListResponse, InterruptStatus, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEntriesResponse, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopesResponse, PauseResult, PersistentVolumesResponse, EphemeralVolumesResponse, RegisterHookOptions, RegisterHookResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, ReplaySessionResult, CancelTurnResult, RunBatchOptions, RunBatchResult, RunOptions, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, ListTeamsResponse, TeamDefDetail, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, TranscriptResponse, WhoamiResponse, UsageDimension, UsageReportResponse, TokenLimit, TokenLimitsResponse, SetTokenLimitRequest } from "./types.js";
28
+ import type { Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, Hook, InterruptListResponse, InterruptStatus, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEntriesResponse, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopesResponse, PauseResult, PersistentVolumesResponse, EphemeralVolumesResponse, RegisterHookOptions, RegisterHookResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, ReplaySessionResult, CancelTurnResult, RunBatchOptions, RunBatchResult, RunOptions, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, ListTeamsResponse, TeamDefDetail, 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);
@@ -213,6 +213,20 @@ export declare class LoomcycleClient {
213
213
  tenant?: string;
214
214
  signal?: AbortSignal;
215
215
  }): Promise<UsageReportResponse>;
216
+ /** Instance configuration: build identity, the feature matrix, and the live
217
+ * provider/model/search cascade with coarse active/inactive status. The
218
+ * out-of-band twin of the in-band `Context op=capabilities`, sharing its
219
+ * probe server-side so the two cannot disagree. Mirrors `GET /v1/config`.
220
+ *
221
+ * `view` names the disclosure level the response was rendered at, so you can
222
+ * tell "this deployment has none" from "you weren't shown them". A deployment
223
+ * running with `LOOMCYCLE_PUBLIC_CONFIG=1` also serves this **with no
224
+ * bearer**, returning the narrower `"public"` view — which is what a landing
225
+ * page fetches directly. `models` is one entry per (provider, model),
226
+ * deduplicated across plans, with `selected` marking what actually runs. */
227
+ getConfig(opts?: {
228
+ signal?: AbortSignal;
229
+ }): Promise<ConfigResponse>;
216
230
  /** List the per-scope token budgets visible to the caller (RFC AW), each with
217
231
  * its live month-to-date usage. Tenant-scoped server-side: a tenant operator
218
232
  * sees only its own tenant's budgets; an admin sees all (or focuses one via
@@ -739,6 +753,28 @@ export declare class LoomcycleClient {
739
753
  scopeId?: string;
740
754
  tenant?: string;
741
755
  }): Promise<DocumentToolResponse>;
756
+ /** Build the URL of an image chunk's asset (RFC BO) — `GET
757
+ * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
758
+ * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
759
+ * `scope` is "agent" | "user" (default "user"); `scopeId`/`tenant` are the
760
+ * RFC AS browse overrides. NOTE: the URL needs the bearer to fetch — use
761
+ * {@link LoomcycleClient.fetchDocumentAsset} for an authenticated GET (a bare
762
+ * <img src> can't carry the Authorization header). */
763
+ documentAssetUrl(chunkId: string, opts?: {
764
+ scope?: string;
765
+ scopeId?: string;
766
+ tenant?: string;
767
+ }): string;
768
+ /** Fetch an image chunk's asset bytes (RFC BO) with authentication — returns
769
+ * the raw {@link Response} so a caller can `.blob()` / `.arrayBuffer()` it.
770
+ * Adds the bearer header (a bare <img src> can't). Throws on a non-2xx
771
+ * (a cross-scope / missing asset is an opaque 404). */
772
+ fetchDocumentAsset(chunkId: string, opts?: {
773
+ scope?: string;
774
+ scopeId?: string;
775
+ tenant?: string;
776
+ signal?: AbortSignal;
777
+ }): Promise<Response>;
742
778
  /** Invoke the RFC BE History tool over HTTP (`POST /v1/_history`). Browse,
743
779
  * search, and annotate PAST CHATS — a chat is a session (it may span
744
780
  * several runs). Op-discriminated (`list`/`get`/`search`/`rename`/
package/dist/client.js CHANGED
@@ -372,6 +372,20 @@ export class LoomcycleClient {
372
372
  const q = params.toString() ? `?${params.toString()}` : "";
373
373
  return jsonFetch(this.ctx, `/v1/_usage${q}`, opts);
374
374
  }
375
+ /** Instance configuration: build identity, the feature matrix, and the live
376
+ * provider/model/search cascade with coarse active/inactive status. The
377
+ * out-of-band twin of the in-band `Context op=capabilities`, sharing its
378
+ * probe server-side so the two cannot disagree. Mirrors `GET /v1/config`.
379
+ *
380
+ * `view` names the disclosure level the response was rendered at, so you can
381
+ * tell "this deployment has none" from "you weren't shown them". A deployment
382
+ * running with `LOOMCYCLE_PUBLIC_CONFIG=1` also serves this **with no
383
+ * bearer**, returning the narrower `"public"` view — which is what a landing
384
+ * page fetches directly. `models` is one entry per (provider, model),
385
+ * deduplicated across plans, with `selected` marking what actually runs. */
386
+ async getConfig(opts) {
387
+ return jsonFetch(this.ctx, "/v1/config", opts);
388
+ }
375
389
  /** List the per-scope token budgets visible to the caller (RFC AW), each with
376
390
  * its live month-to-date usage. Tenant-scoped server-side: a tenant operator
377
391
  * sees only its own tenant's budgets; an admin sees all (or focuses one via
@@ -1037,6 +1051,39 @@ export class LoomcycleClient {
1037
1051
  query: browseQuery(opts),
1038
1052
  });
1039
1053
  }
1054
+ /** Build the URL of an image chunk's asset (RFC BO) — `GET
1055
+ * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
1056
+ * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
1057
+ * `scope` is "agent" | "user" (default "user"); `scopeId`/`tenant` are the
1058
+ * RFC AS browse overrides. NOTE: the URL needs the bearer to fetch — use
1059
+ * {@link LoomcycleClient.fetchDocumentAsset} for an authenticated GET (a bare
1060
+ * <img src> can't carry the Authorization header). */
1061
+ documentAssetUrl(chunkId, opts) {
1062
+ const q = new URLSearchParams({ scope: opts?.scope ?? "user" });
1063
+ if (opts?.scopeId)
1064
+ q.set("scope_id", opts.scopeId);
1065
+ if (opts?.tenant)
1066
+ q.set("tenant", opts.tenant);
1067
+ return `${this.ctx.baseUrl}/v1/_document/asset/${encodeURIComponent(chunkId)}?${q.toString()}`;
1068
+ }
1069
+ /** Fetch an image chunk's asset bytes (RFC BO) with authentication — returns
1070
+ * the raw {@link Response} so a caller can `.blob()` / `.arrayBuffer()` it.
1071
+ * Adds the bearer header (a bare <img src> can't). Throws on a non-2xx
1072
+ * (a cross-scope / missing asset is an opaque 404). */
1073
+ async fetchDocumentAsset(chunkId, opts) {
1074
+ const headers = {};
1075
+ if (this.ctx.authToken)
1076
+ headers.Authorization = `Bearer ${this.ctx.authToken}`;
1077
+ const resp = await this.ctx.fetchImpl(this.documentAssetUrl(chunkId, opts), {
1078
+ method: "GET",
1079
+ headers,
1080
+ signal: opts?.signal,
1081
+ });
1082
+ if (!resp.ok) {
1083
+ throw new Error(`fetchDocumentAsset: ${resp.status} ${resp.statusText}`);
1084
+ }
1085
+ return resp;
1086
+ }
1040
1087
  /** Invoke the RFC BE History tool over HTTP (`POST /v1/_history`). Browse,
1041
1088
  * search, and annotate PAST CHATS — a chat is a session (it may span
1042
1089
  * several runs). Op-discriminated (`list`/`get`/`search`/`rename`/
package/dist/index.d.ts CHANGED
@@ -111,5 +111,5 @@ export { InteractiveSession } from "./interactive.js";
111
111
  export type { InteractiveSessionOps } from "./interactive.js";
112
112
  export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
113
113
  export type { ClientToolSchema, ClientToolInvocation, ConnectClientToolsOptions, WebSocketLike, WebSocketCtor, } from "./client-tools.js";
114
- export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ToolUse, Usage, Agent, AgentStatus, AgentUsage, CancelAgentResult, ListAgentsResponse, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, CancelTurnResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, Hook, HookFailMode, HookPhase, HookToolCall, HookToolResult, ListHooksResponse, PostHookCall, PostHookResult, PreHookCall, PreHookResult, RegisterHookOptions, RegisterHookResponse, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, TeamDefDetail, TeamRunResult, 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, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, EnsureCodeAgentOptions, EnsureCodeAgentResult, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, LimitInfo, TokenLimit, TokenLimitsResponse, SetTokenLimitRequest, } from "./types.js";
114
+ export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ToolUse, Usage, Agent, AgentStatus, AgentUsage, CancelAgentResult, ListAgentsResponse, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, CancelTurnResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, Hook, HookFailMode, HookPhase, HookToolCall, HookToolResult, ListHooksResponse, PostHookCall, PostHookResult, PreHookCall, PreHookResult, RegisterHookOptions, RegisterHookResponse, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, TeamDefDetail, TeamRunResult, 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, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, EnsureCodeAgentOptions, EnsureCodeAgentResult, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, LimitInfo, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, } from "./types.js";
115
115
  export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, HookNotFoundError, NotFoundError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, UnavailableError, } from "./errors.js";
package/dist/types.d.ts CHANGED
@@ -1876,6 +1876,72 @@ export interface TokenLimit {
1876
1876
  export interface TokenLimitsResponse {
1877
1877
  limits: TokenLimit[];
1878
1878
  }
1879
+ /** One LLM provider the deployment can route to. `active` is reachable AND not
1880
+ * excluded — one coarse boolean. A provider probe error is never exposed here
1881
+ * (those can carry hostnames, ports, and upstream response bodies); an operator
1882
+ * gets that detail from `GET /v1/_routing`. */
1883
+ export interface ConfigProvider {
1884
+ provider: string;
1885
+ active: boolean;
1886
+ }
1887
+ /** One (provider, model) pair the deployment can route to, flattened and
1888
+ * deduplicated across plans — the same model appears in every plan that
1889
+ * includes it, and a consumer wants it once. */
1890
+ export interface ConfigModel {
1891
+ provider: string;
1892
+ model: string;
1893
+ /** The canonical capability tiers (low/middle/high) this pair serves. These
1894
+ * are loomcycle's own tier names, never the operator's plan names. */
1895
+ tiers: string[];
1896
+ /** At least one tier would route here right now. */
1897
+ active: boolean;
1898
+ /** It is the FIRST available candidate for at least one tier — what runs. */
1899
+ selected: boolean;
1900
+ }
1901
+ /** One web-search provider (RFC BB), in cascade order. */
1902
+ export interface ConfigSearch {
1903
+ provider: string;
1904
+ active: boolean;
1905
+ primary: boolean;
1906
+ }
1907
+ export interface ConfigInstance {
1908
+ /** Identifies the software, not the deployment, so it is public. */
1909
+ version?: string;
1910
+ /** Build provenance — absent from the `public` view. */
1911
+ commit?: string;
1912
+ build_time?: string;
1913
+ /** The operator's advertised base URL — absent from the `public` view. */
1914
+ url?: string;
1915
+ }
1916
+ /** `GET /v1/config` — what this instance is and what it can do.
1917
+ *
1918
+ * Rendered at one of three disclosure levels, named in `view` so a consumer can
1919
+ * tell "this deployment has none" from "you weren't shown them":
1920
+ *
1921
+ * - `public` — version, features, providers, models, search. Reachable with NO
1922
+ * bearer, and only on a deployment running `LOOMCYCLE_PUBLIC_CONFIG=1`.
1923
+ * - `authenticated` — adds commit, build_time, url, limits, user_tiers.
1924
+ * - `admin` — adds `features.storage`.
1925
+ *
1926
+ * In the `public` view every `features` value is a plain boolean; at the other
1927
+ * levels each is an object carrying at least `available`. That is deliberate:
1928
+ * the public view is built by copying only the `available` field, so a
1929
+ * capability gaining a new field later cannot leak to a public reader. */
1930
+ export interface ConfigResponse {
1931
+ generated_at: string;
1932
+ view: "public" | "authenticated" | "admin";
1933
+ instance: ConfigInstance;
1934
+ /** Per-subsystem availability. A `boolean` in the `public` view; otherwise an
1935
+ * object with `available` plus that capability's own detail. */
1936
+ features: Record<string, boolean | Record<string, unknown>>;
1937
+ providers: ConfigProvider[];
1938
+ models: ConfigModel[];
1939
+ search: ConfigSearch[];
1940
+ /** Configured plan names — omitted from the `public` view. */
1941
+ user_tiers?: string[];
1942
+ /** Deployment caps — omitted from the `public` view. */
1943
+ limits?: Record<string, number>;
1944
+ }
1879
1945
  /** The PUT /v1/_limits body (RFC AW). A present `soft_limit`/`hard_limit` sets
1880
1946
  * that tier; omitting it clears the tier (unlimited on that axis) — a full-row
1881
1947
  * upsert. `tenant_id` is an admin-only target; a tenant operator is confined to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "1.25.0",
3
+ "version": "1.38.0",
4
4
  "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 64 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.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",