@loomcycle/client 1.45.0 → 1.48.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.
@@ -286,6 +286,44 @@ class LoomcycleClient {
286
286
  * `applied` is "live", "marker", or "noop". Mirrors
287
287
  * POST /v1/runs/{run_id}/compact.
288
288
  */
289
+ /**
290
+ * List the subjects with activity in a tenant (loomcycle v1.46.0+).
291
+ *
292
+ * A "user" here is DERIVED from run activity, not a stored record — there is no
293
+ * create or update, and removing a subject's footprint is
294
+ * {@link erasureExecute}.
295
+ */
296
+ async directoryUsers(opts) {
297
+ const q = opts?.tenant !== undefined
298
+ ? `?tenant=${encodeURIComponent(opts.tenant)}`
299
+ : "";
300
+ return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, `/v1/_users${q}`, opts);
301
+ }
302
+ /**
303
+ * Aggregate one subject's activity, chats, memory, documents, budget and usage
304
+ * in a single call (loomcycle v1.46.0+).
305
+ *
306
+ * An admin token MUST pass `tenant` — a subject id is only unique within one, so
307
+ * the server refuses rather than guessing (`""` selects the default tenant on a
308
+ * single-tenant install). A tenant-scoped principal is confined regardless.
309
+ */
310
+ async directoryInspect(subject, opts) {
311
+ const q = opts?.tenant !== undefined
312
+ ? `?tenant=${encodeURIComponent(opts.tenant)}`
313
+ : "";
314
+ return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, `/v1/_users/${encodeURIComponent(subject)}${q}`, opts);
315
+ }
316
+ /**
317
+ * Enumerate tenants with derived counts (loomcycle v1.46.0+). **Requires an
318
+ * operator-admin token** — the list of tenants is itself cross-tenant
319
+ * information, so a scoped token is refused rather than given a filtered list.
320
+ *
321
+ * Derived from runs: a tenant that has never started a run does not appear, so
322
+ * an empty list means no ACTIVITY, not no tenants.
323
+ */
324
+ async directoryTenants(opts) {
325
+ return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, "/v1/_tenants", opts);
326
+ }
289
327
  /**
290
328
  * Report what this deployment holds about one SUBJECT, in three tiers
291
329
  * separated by what they guarantee (RFC BL P5). Read-only.
@@ -624,6 +662,58 @@ class LoomcycleClient {
624
662
  async getMemoryEntry(scope, scopeID, key, opts) {
625
663
  return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, `/v1/_memory/scopes/${encodeURIComponent(scope)}/${encodeURIComponent(scopeID)}/keys/${encodeURIComponent(key)}`, opts);
626
664
  }
665
+ // ---- RFC BV memory-view: off-run search + embed-admin reads ----
666
+ /** Off-run unified semantic search over one scope's memory
667
+ * (POST /v1/_memory/search). Spans BOTH plain k/v entries AND
668
+ * document-chunk bodies in one ranked list — each hit is tagged
669
+ * `kind: "memory" | "document"`, and a document hit carries
670
+ * `chunk_id` so the caller can fetch its entity block via
671
+ * document({ op: "get_chunk" }). The in-band Memory tool's `search`
672
+ * op is prefix-scoped + run-bound; this is its off-run twin for the
673
+ * admin/operator surface. HTTP-only (no gRPC RPC). `rank` / `dedup`
674
+ * are opaque ranking-config objects passed through as-is. */
675
+ async memorySearch(input, opts) {
676
+ const body = {
677
+ query: input.query,
678
+ scope: input.scope,
679
+ scope_id: input.scopeId,
680
+ };
681
+ // Only send top_k when set — the server defaults + caps it (1..50).
682
+ if (input.topK !== undefined)
683
+ body.top_k = input.topK;
684
+ if (input.rank !== undefined)
685
+ body.rank = input.rank;
686
+ if (input.dedup !== undefined)
687
+ body.dedup = input.dedup;
688
+ return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_memory/search", body, {
689
+ signal: opts?.signal,
690
+ });
691
+ }
692
+ /** Per-(provider, model, dimension) row counts + total embedding
693
+ * bytes for one scope (GET /v1/_memory/embed_stats). The memory-view
694
+ * console shows this to spot a multi-embedder scope BEFORE a reembed
695
+ * migration. */
696
+ async memoryEmbedStats(scope, opts) {
697
+ return (0, fetch_helpers_js_1.jsonFetch)(this.ctx, `/v1/_memory/embed_stats?scope=${encodeURIComponent(scope)}`, opts);
698
+ }
699
+ /** Re-embed a scope's rows whose stored embedder differs from the
700
+ * configured one (POST /v1/_memory/reembed). `dry_run` defaults TRUE
701
+ * server-side, so an omitted `dryRun` returns the planned migration
702
+ * WITHOUT writing; pass `dryRun: false` to commit. `limit` caps the
703
+ * rows processed per call (server default 1000). The response is a
704
+ * discriminated union on `dry_run` — narrow before reading its
705
+ * arm-specific fields. */
706
+ async reembedMemory(scope, scopeId, opts) {
707
+ const query = { scope, scope_id: scopeId };
708
+ // Only send dry_run=false to commit; an omitted flag leaves the
709
+ // server-side default (true) so a caller can't accidentally reembed.
710
+ if (opts?.dryRun === false)
711
+ query.dry_run = "false";
712
+ if (opts?.limit !== undefined && opts.limit > 0) {
713
+ query.limit = String(opts.limit);
714
+ }
715
+ return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_memory/reembed", undefined, { query, signal: opts?.signal });
716
+ }
627
717
  // ---- Interruption ----
628
718
  /** List interrupts addressable to a user_id. Default filter is
629
719
  * status=pending. */
package/dist/cjs/index.js CHANGED
@@ -40,6 +40,11 @@
40
40
  * listMemoryEntries(scope, scopeID, opts?): Promise<MemoryEntriesResponse>
41
41
  * getMemoryEntry(scope, scopeID, key): Promise<MemoryEntryResponse>
42
42
  *
43
+ * // Memory view — off-run search + embed admin (v1.47.0 — RFC BV; HTTP-only)
44
+ * memorySearch(input): Promise<MemorySearchResponse> // unified k/v + document-chunk search
45
+ * memoryEmbedStats(scope): Promise<MemoryEmbedStatsResponse>
46
+ * reembedMemory(scope, scopeId, opts?): Promise<MemoryReembedResponse> // dry_run defaults true
47
+ *
43
48
  * // Interruption (v0.8.16; decline RFC BH)
44
49
  * listUserInterrupts(userId, opts?): Promise<InterruptListResponse>
45
50
  * listRunInterrupts(runId, opts?): Promise<InterruptListResponse>
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 { ErasureReport, ErasureResult, 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";
28
+ import type { DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, 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, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, 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);
@@ -139,6 +139,45 @@ export declare class LoomcycleClient {
139
139
  * `applied` is "live", "marker", or "noop". Mirrors
140
140
  * POST /v1/runs/{run_id}/compact.
141
141
  */
142
+ /**
143
+ * List the subjects with activity in a tenant (loomcycle v1.46.0+).
144
+ *
145
+ * A "user" here is DERIVED from run activity, not a stored record — there is no
146
+ * create or update, and removing a subject's footprint is
147
+ * {@link erasureExecute}.
148
+ */
149
+ directoryUsers(opts?: {
150
+ tenant?: string;
151
+ signal?: AbortSignal;
152
+ }): Promise<{
153
+ users: DirectoryUser[];
154
+ }>;
155
+ /**
156
+ * Aggregate one subject's activity, chats, memory, documents, budget and usage
157
+ * in a single call (loomcycle v1.46.0+).
158
+ *
159
+ * An admin token MUST pass `tenant` — a subject id is only unique within one, so
160
+ * the server refuses rather than guessing (`""` selects the default tenant on a
161
+ * single-tenant install). A tenant-scoped principal is confined regardless.
162
+ */
163
+ directoryInspect(subject: string, opts?: {
164
+ tenant?: string;
165
+ signal?: AbortSignal;
166
+ }): Promise<DirectoryInspection>;
167
+ /**
168
+ * Enumerate tenants with derived counts (loomcycle v1.46.0+). **Requires an
169
+ * operator-admin token** — the list of tenants is itself cross-tenant
170
+ * information, so a scoped token is refused rather than given a filtered list.
171
+ *
172
+ * Derived from runs: a tenant that has never started a run does not appear, so
173
+ * an empty list means no ACTIVITY, not no tenants.
174
+ */
175
+ directoryTenants(opts?: {
176
+ signal?: AbortSignal;
177
+ }): Promise<{
178
+ tenants: DirectoryTenant[];
179
+ notes?: string[];
180
+ }>;
142
181
  /**
143
182
  * Report what this deployment holds about one SUBJECT, in three tiers
144
183
  * separated by what they guarantee (RFC BL P5). Read-only.
@@ -405,6 +444,37 @@ export declare class LoomcycleClient {
405
444
  getMemoryEntry(scope: string, scopeID: string, key: string, opts?: {
406
445
  signal?: AbortSignal;
407
446
  }): Promise<MemoryEntryResponse>;
447
+ /** Off-run unified semantic search over one scope's memory
448
+ * (POST /v1/_memory/search). Spans BOTH plain k/v entries AND
449
+ * document-chunk bodies in one ranked list — each hit is tagged
450
+ * `kind: "memory" | "document"`, and a document hit carries
451
+ * `chunk_id` so the caller can fetch its entity block via
452
+ * document({ op: "get_chunk" }). The in-band Memory tool's `search`
453
+ * op is prefix-scoped + run-bound; this is its off-run twin for the
454
+ * admin/operator surface. HTTP-only (no gRPC RPC). `rank` / `dedup`
455
+ * are opaque ranking-config objects passed through as-is. */
456
+ memorySearch(input: MemorySearchInput, opts?: {
457
+ signal?: AbortSignal;
458
+ }): Promise<MemorySearchResponse>;
459
+ /** Per-(provider, model, dimension) row counts + total embedding
460
+ * bytes for one scope (GET /v1/_memory/embed_stats). The memory-view
461
+ * console shows this to spot a multi-embedder scope BEFORE a reembed
462
+ * migration. */
463
+ memoryEmbedStats(scope: string, opts?: {
464
+ signal?: AbortSignal;
465
+ }): Promise<MemoryEmbedStatsResponse>;
466
+ /** Re-embed a scope's rows whose stored embedder differs from the
467
+ * configured one (POST /v1/_memory/reembed). `dry_run` defaults TRUE
468
+ * server-side, so an omitted `dryRun` returns the planned migration
469
+ * WITHOUT writing; pass `dryRun: false` to commit. `limit` caps the
470
+ * rows processed per call (server default 1000). The response is a
471
+ * discriminated union on `dry_run` — narrow before reading its
472
+ * arm-specific fields. */
473
+ reembedMemory(scope: string, scopeId: string, opts?: {
474
+ dryRun?: boolean;
475
+ limit?: number;
476
+ signal?: AbortSignal;
477
+ }): Promise<MemoryReembedResponse>;
408
478
  /** List interrupts addressable to a user_id. Default filter is
409
479
  * status=pending. */
410
480
  listUserInterrupts(userId: string, opts?: {
package/dist/client.js CHANGED
@@ -283,6 +283,44 @@ export class LoomcycleClient {
283
283
  * `applied` is "live", "marker", or "noop". Mirrors
284
284
  * POST /v1/runs/{run_id}/compact.
285
285
  */
286
+ /**
287
+ * List the subjects with activity in a tenant (loomcycle v1.46.0+).
288
+ *
289
+ * A "user" here is DERIVED from run activity, not a stored record — there is no
290
+ * create or update, and removing a subject's footprint is
291
+ * {@link erasureExecute}.
292
+ */
293
+ async directoryUsers(opts) {
294
+ const q = opts?.tenant !== undefined
295
+ ? `?tenant=${encodeURIComponent(opts.tenant)}`
296
+ : "";
297
+ return jsonFetch(this.ctx, `/v1/_users${q}`, opts);
298
+ }
299
+ /**
300
+ * Aggregate one subject's activity, chats, memory, documents, budget and usage
301
+ * in a single call (loomcycle v1.46.0+).
302
+ *
303
+ * An admin token MUST pass `tenant` — a subject id is only unique within one, so
304
+ * the server refuses rather than guessing (`""` selects the default tenant on a
305
+ * single-tenant install). A tenant-scoped principal is confined regardless.
306
+ */
307
+ async directoryInspect(subject, opts) {
308
+ const q = opts?.tenant !== undefined
309
+ ? `?tenant=${encodeURIComponent(opts.tenant)}`
310
+ : "";
311
+ return jsonFetch(this.ctx, `/v1/_users/${encodeURIComponent(subject)}${q}`, opts);
312
+ }
313
+ /**
314
+ * Enumerate tenants with derived counts (loomcycle v1.46.0+). **Requires an
315
+ * operator-admin token** — the list of tenants is itself cross-tenant
316
+ * information, so a scoped token is refused rather than given a filtered list.
317
+ *
318
+ * Derived from runs: a tenant that has never started a run does not appear, so
319
+ * an empty list means no ACTIVITY, not no tenants.
320
+ */
321
+ async directoryTenants(opts) {
322
+ return jsonFetch(this.ctx, "/v1/_tenants", opts);
323
+ }
286
324
  /**
287
325
  * Report what this deployment holds about one SUBJECT, in three tiers
288
326
  * separated by what they guarantee (RFC BL P5). Read-only.
@@ -621,6 +659,58 @@ export class LoomcycleClient {
621
659
  async getMemoryEntry(scope, scopeID, key, opts) {
622
660
  return jsonFetch(this.ctx, `/v1/_memory/scopes/${encodeURIComponent(scope)}/${encodeURIComponent(scopeID)}/keys/${encodeURIComponent(key)}`, opts);
623
661
  }
662
+ // ---- RFC BV memory-view: off-run search + embed-admin reads ----
663
+ /** Off-run unified semantic search over one scope's memory
664
+ * (POST /v1/_memory/search). Spans BOTH plain k/v entries AND
665
+ * document-chunk bodies in one ranked list — each hit is tagged
666
+ * `kind: "memory" | "document"`, and a document hit carries
667
+ * `chunk_id` so the caller can fetch its entity block via
668
+ * document({ op: "get_chunk" }). The in-band Memory tool's `search`
669
+ * op is prefix-scoped + run-bound; this is its off-run twin for the
670
+ * admin/operator surface. HTTP-only (no gRPC RPC). `rank` / `dedup`
671
+ * are opaque ranking-config objects passed through as-is. */
672
+ async memorySearch(input, opts) {
673
+ const body = {
674
+ query: input.query,
675
+ scope: input.scope,
676
+ scope_id: input.scopeId,
677
+ };
678
+ // Only send top_k when set — the server defaults + caps it (1..50).
679
+ if (input.topK !== undefined)
680
+ body.top_k = input.topK;
681
+ if (input.rank !== undefined)
682
+ body.rank = input.rank;
683
+ if (input.dedup !== undefined)
684
+ body.dedup = input.dedup;
685
+ return postJSON(this.ctx, "/v1/_memory/search", body, {
686
+ signal: opts?.signal,
687
+ });
688
+ }
689
+ /** Per-(provider, model, dimension) row counts + total embedding
690
+ * bytes for one scope (GET /v1/_memory/embed_stats). The memory-view
691
+ * console shows this to spot a multi-embedder scope BEFORE a reembed
692
+ * migration. */
693
+ async memoryEmbedStats(scope, opts) {
694
+ return jsonFetch(this.ctx, `/v1/_memory/embed_stats?scope=${encodeURIComponent(scope)}`, opts);
695
+ }
696
+ /** Re-embed a scope's rows whose stored embedder differs from the
697
+ * configured one (POST /v1/_memory/reembed). `dry_run` defaults TRUE
698
+ * server-side, so an omitted `dryRun` returns the planned migration
699
+ * WITHOUT writing; pass `dryRun: false` to commit. `limit` caps the
700
+ * rows processed per call (server default 1000). The response is a
701
+ * discriminated union on `dry_run` — narrow before reading its
702
+ * arm-specific fields. */
703
+ async reembedMemory(scope, scopeId, opts) {
704
+ const query = { scope, scope_id: scopeId };
705
+ // Only send dry_run=false to commit; an omitted flag leaves the
706
+ // server-side default (true) so a caller can't accidentally reembed.
707
+ if (opts?.dryRun === false)
708
+ query.dry_run = "false";
709
+ if (opts?.limit !== undefined && opts.limit > 0) {
710
+ query.limit = String(opts.limit);
711
+ }
712
+ return postJSON(this.ctx, "/v1/_memory/reembed", undefined, { query, signal: opts?.signal });
713
+ }
624
714
  // ---- Interruption ----
625
715
  /** List interrupts addressable to a user_id. Default filter is
626
716
  * status=pending. */
package/dist/index.d.ts CHANGED
@@ -39,6 +39,11 @@
39
39
  * listMemoryEntries(scope, scopeID, opts?): Promise<MemoryEntriesResponse>
40
40
  * getMemoryEntry(scope, scopeID, key): Promise<MemoryEntryResponse>
41
41
  *
42
+ * // Memory view — off-run search + embed admin (v1.47.0 — RFC BV; HTTP-only)
43
+ * memorySearch(input): Promise<MemorySearchResponse> // unified k/v + document-chunk search
44
+ * memoryEmbedStats(scope): Promise<MemoryEmbedStatsResponse>
45
+ * reembedMemory(scope, scopeId, opts?): Promise<MemoryReembedResponse> // dry_run defaults true
46
+ *
42
47
  * // Interruption (v0.8.16; decline RFC BH)
43
48
  * listUserInterrupts(userId, opts?): Promise<InterruptListResponse>
44
49
  * listRunInterrupts(runId, opts?): Promise<InterruptListResponse>
@@ -111,5 +116,5 @@ export { InteractiveSession } from "./interactive.js";
111
116
  export type { InteractiveSessionOps } from "./interactive.js";
112
117
  export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
113
118
  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, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, 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";
119
+ 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, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, 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, MemorySearchInput, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, 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
120
  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/index.js CHANGED
@@ -39,6 +39,11 @@
39
39
  * listMemoryEntries(scope, scopeID, opts?): Promise<MemoryEntriesResponse>
40
40
  * getMemoryEntry(scope, scopeID, key): Promise<MemoryEntryResponse>
41
41
  *
42
+ * // Memory view — off-run search + embed admin (v1.47.0 — RFC BV; HTTP-only)
43
+ * memorySearch(input): Promise<MemorySearchResponse> // unified k/v + document-chunk search
44
+ * memoryEmbedStats(scope): Promise<MemoryEmbedStatsResponse>
45
+ * reembedMemory(scope, scopeId, opts?): Promise<MemoryReembedResponse> // dry_run defaults true
46
+ *
42
47
  * // Interruption (v0.8.16; decline RFC BH)
43
48
  * listUserInterrupts(userId, opts?): Promise<InterruptListResponse>
44
49
  * listRunInterrupts(runId, opts?): Promise<InterruptListResponse>
package/dist/types.d.ts CHANGED
@@ -429,6 +429,57 @@ export interface RunBatchResult {
429
429
  /** Result of {@link LoomcycleClient.compactRun}. `applied` is "live" (pushed to
430
430
  * the running loop), "marker" (persisted for a terminal run's next
431
431
  * continuation), or "noop" (too short to compact). */
432
+ /**
433
+ * One DERIVED user (RFC-free: a user is a GROUP BY over run activity, not a
434
+ * stored record — so there is no profile here and no way to create one).
435
+ */
436
+ export interface DirectoryUser {
437
+ subject: string;
438
+ running_count: number;
439
+ total_count: number;
440
+ /** RFC3339 UTC; absent when the subject has never started a run. */
441
+ last_started_at?: string;
442
+ }
443
+ /**
444
+ * Token budget for a subject. Both bounds are OPTIONAL because absent and zero
445
+ * differ: absent is "no ceiling at this tier", zero would refuse every run.
446
+ */
447
+ export interface DirectoryBudget {
448
+ soft_limit?: number;
449
+ hard_limit?: number;
450
+ }
451
+ /**
452
+ * One subject's aggregate view (loomcycle v1.46.0+) — the five surfaces an
453
+ * operator otherwise visits separately.
454
+ *
455
+ * `documents` is absent rather than 0 when SQL Memory is not configured: the
456
+ * plane was NOT examined, which is a different statement from empty. Likewise a
457
+ * non-empty `errors` means a plane could not be read, so every count is a LOWER
458
+ * BOUND — do not present the numbers as complete.
459
+ */
460
+ export interface DirectoryInspection {
461
+ tenant: string;
462
+ subject: string;
463
+ activity: DirectoryUser;
464
+ chats: number;
465
+ /** Per scope, not one number: the subject's own rows and what a shared agent
466
+ * holds ABOUT them are different things. */
467
+ memory: Record<string, number>;
468
+ documents?: number;
469
+ budget?: DirectoryBudget;
470
+ usage: {
471
+ calls: number;
472
+ cost: number;
473
+ };
474
+ errors?: string[];
475
+ notes?: string[];
476
+ }
477
+ /** One tenant with derived counts. */
478
+ export interface DirectoryTenant {
479
+ tenant: string;
480
+ users: number;
481
+ runs: number;
482
+ }
432
483
  /**
433
484
  * One tier's per-plane counts in an erasure report.
434
485
  *
@@ -709,6 +760,87 @@ export interface MemoryEntryResponse {
709
760
  scope_id: string;
710
761
  entry: MemoryEntry;
711
762
  }
763
+ /** Input for {@link LoomcycleClient.memorySearch}. camelCase here; the
764
+ * client maps to the snake_case wire body (scopeId→scope_id,
765
+ * topK→top_k). `rank` / `dedup` are opaque ranking-config objects
766
+ * passed through to the server as-is. */
767
+ export interface MemorySearchInput {
768
+ query: string;
769
+ scope: string;
770
+ scopeId: string;
771
+ topK?: number;
772
+ rank?: Record<string, unknown>;
773
+ dedup?: Record<string, unknown>;
774
+ }
775
+ /** One hit in a {@link MemorySearchResponse}. `kind` distinguishes a
776
+ * plain k/v memory entry ("memory") from a document-chunk body
777
+ * ("document"); a document hit also carries `chunk_id` so the viewer
778
+ * can fetch its entity block via document({ op: "get_chunk" }).
779
+ * Field casing mirrors the wire JSON (snake_case). */
780
+ export interface MemorySearchEntry {
781
+ key: string;
782
+ value: unknown;
783
+ /** raw cosine similarity */
784
+ score: number;
785
+ /** hybrid rank the row was ordered by */
786
+ rank_score: number;
787
+ embedded_with: {
788
+ provider: string;
789
+ model: string;
790
+ };
791
+ kind: "memory" | "document";
792
+ chunk_id?: string;
793
+ }
794
+ export interface MemorySearchResponse {
795
+ scope: string;
796
+ scope_id: string;
797
+ entries: MemorySearchEntry[];
798
+ query_embedding_dim: number;
799
+ truncated: boolean;
800
+ }
801
+ /** One row in {@link MemoryEmbedStatsResponse}.models — the wire shape
802
+ * of store.MemoryEmbedModelStats. */
803
+ export interface MemoryEmbedModelStats {
804
+ provider: string;
805
+ model: string;
806
+ dimension: number;
807
+ row_count: number;
808
+ }
809
+ export interface MemoryEmbedStatsResponse {
810
+ scope: string;
811
+ models: MemoryEmbedModelStats[];
812
+ total_embedding_bytes: number;
813
+ }
814
+ /** The configured embedder a reembed call reports back
815
+ * (current_embedder). */
816
+ export interface MemoryReembedConfigured {
817
+ provider: string;
818
+ model: string;
819
+ dimension: number;
820
+ }
821
+ /** Response to {@link LoomcycleClient.reembedMemory}. A discriminated
822
+ * union on `dry_run` (mirrors the two server response shapes): a dry
823
+ * run reports the planned migration WITHOUT writing; a real run
824
+ * reports what was written. Narrow on `dry_run` before reading the
825
+ * arm-specific fields. */
826
+ export type MemoryReembedResponse = {
827
+ scope: string;
828
+ scope_id: string;
829
+ dry_run: true;
830
+ rows_total: number;
831
+ rows_to_reembed: number;
832
+ current_embedder: MemoryReembedConfigured;
833
+ sample_keys: string[];
834
+ sample_keys_capped: boolean;
835
+ } | {
836
+ scope: string;
837
+ scope_id: string;
838
+ dry_run: false;
839
+ rows_reembedded: number;
840
+ rows_failed: number;
841
+ current_embedder: MemoryReembedConfigured;
842
+ failed_keys?: string[];
843
+ };
712
844
  export type InterruptStatus = "pending" | "answered" | "cancelled" | "expired";
713
845
  export interface InterruptRow {
714
846
  interrupt_id: string;
@@ -959,7 +1091,7 @@ export type PathToolInput = {
959
1091
  * requires the operator to grant BOTH `memory_scopes` and `sql_scopes` with
960
1092
  * `tenant`, since a document spans both planes. */
961
1093
  export type DocumentToolInput = {
962
- op: "create_document" | "get_document" | "delete_document" | "set_path" | "create_chunk" | "get_chunk" | "update_chunk" | "delete_chunk" | "move_chunk" | "link_chunks" | "unlink_chunks" | "query_chunks" | "define_type" | "list_types" | "export_md" | "import_md";
1094
+ op: "create_document" | "get_document" | "documents_summary" | "query_documents" | "delete_document" | "set_path" | "create_chunk" | "upsert_chunk" | "get_chunk" | "update_chunk" | "delete_chunk" | "supersede_chunk" | "graph_recall" | "move_chunk" | "reorder_chunk" | "link_chunks" | "unlink_chunks" | "get_edges" | "query_chunks" | "add_tags" | "remove_tags" | "list_tags" | "define_type" | "list_types" | "set_asset" | "get_asset" | "export_md" | "import_md" | "backlinks" | "related" | "unlinked_mentions" | "history" | "get_version" | "diff" | "export_canvas" | "import_canvas";
963
1095
  scope?: "agent" | "user" | "tenant";
964
1096
  /** Document id (get/delete_document) or chunk id (get/update/delete/move_chunk). */
965
1097
  id?: string;
@@ -973,9 +1105,25 @@ export type DocumentToolInput = {
973
1105
  body?: string;
974
1106
  fields?: Record<string, unknown>;
975
1107
  status?: string;
1108
+ /** The chunk's or document's tags (RFC BS). create/update/upsert_chunk +
1109
+ * create_document replace-set the whole set (omit = unchanged, [] = clear);
1110
+ * add_tags/remove_tags take the tags to change. Nested tags use a slash. */
1111
+ tags?: string[];
1112
+ /** query_chunks / query_documents: return only items carrying exactly this tag. */
1113
+ tag?: string;
1114
+ /** query_chunks: match this tag OR anything nested under it (prefix + '/'). */
1115
+ tag_prefix?: string;
976
1116
  position?: number;
977
- /** update_chunk: the chunk's current revision (optimistic concurrency). */
1117
+ /** update_chunk: the chunk's current revision (optimistic concurrency).
1118
+ * get_version: the historical revision to fetch. */
978
1119
  revision?: number;
1120
+ /** diff (RFC BS): the two chunk revisions to compare (from_revision →
1121
+ * to_revision), producing a unified-diff text. */
1122
+ from_revision?: number;
1123
+ to_revision?: number;
1124
+ /** import_canvas (RFC BS): a node/edge canvas graph to build a document from
1125
+ * (the shape export_canvas emits). Opaque here; the backend owns the schema. */
1126
+ canvas?: unknown;
979
1127
  from_id?: string;
980
1128
  to_id?: string;
981
1129
  kind?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "1.45.0",
4
- "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 64 methods covering run streaming, agent metadata, pause/resume/state, resolver re-probe (resolveProbe \u2014 issue #88 operator escape hatch), operator-token admin (operatorTokenDef \u2014 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 \u2014 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 \u2014 direct provider routing without agent overhead; primary target is n8n's LoomCycleChatModel AI Agent sub-node and any LangChain-compatible consumer). v0.10.1 \u2014 dual ESM + CommonJS distribution (additive \u2014 ESM consumers unchanged; CJS consumers like n8n's community-node loader now work). v0.19.0 \u2014 typed inline code-js agent ingestion (AgentDefOverlay.code_body + ensureCodeAgent \u2014 register a deterministic code agent through the substrate with no host filesystem bind; RFC J). v0.20.0 \u2014 ensureMcpServer surfaces discoveredToolCount straight from create (loomcycle now auto-discovers MCP tools at ingestion); rediscover is now an explicit force-refresh. v0.21.0 \u2014 run/continue accept optional non-secret `metadata` (repo name, review policy, \u2026) passed to the agent, symmetric with the WebHook/Schedule trigger paths. v0.22.0 \u2014 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 \u2014 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 \u2014 purgeChannel clears a channel's buffered messages without deleting its definition (allowed on yaml-declared channels too, unlike deleteChannel \u2014 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 \u2014 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 \u2014 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 \u2014 the manual-management Web UI console + Context op=time + max_fires self-retiring schedules \u2014 is server-side / in-band, no client-surface change). v0.29.1 \u2014 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 \u2014 gRPC + TS client parity for the RFC Y external fan-out and the compaction surface: spawnRunBatch() (POST /v1/runs:batch \u2014 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 \u2014 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 \u2014 server-side.) v0.34.0 \u2014 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 \u2014 RFC AH dynamic filesystem volumes: volumeDef() (POST /v1/_volumedef \u2014 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] \u2014 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 \u2014 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 \u2014 steer a live run) + streamRunByID(runId, {fromSeq}) (GET /v1/runs/{id}/stream \u2014 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 \u2014 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 \u2014 RFC AL Path VFS + RFC AK Document on the wire: path(input) (POST /v1/_path \u2014 a Unix-like filesystem over Memory/Volumes/Documents; resolve/ls/stat/mkdir/mv/rm) + document(input) (POST /v1/_document \u2014 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 \u2014 narrow as needed). v1.7.0 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 existing path() / document() callers are unchanged. v1.16.0 \u2014 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> \u2014 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 \u2014 RFC BL P5 subject erasure: erasureReport(subject, {tenant}) (GET /v1/_erasure \u2014 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 \u2014 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 \u2014 the returned object is the only durable record of what was not reached; persist it. New ErasureReport / ErasureResult / ErasureTier / ErasureResidue types.",
3
+ "version": "1.48.0",
4
+ "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 67 methods covering run streaming, agent metadata, pause/resume/state, resolver re-probe (resolveProbe \u2014 issue #88 operator escape hatch), operator-token admin (operatorTokenDef \u2014 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 \u2014 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 \u2014 direct provider routing without agent overhead; primary target is n8n's LoomCycleChatModel AI Agent sub-node and any LangChain-compatible consumer). v0.10.1 \u2014 dual ESM + CommonJS distribution (additive \u2014 ESM consumers unchanged; CJS consumers like n8n's community-node loader now work). v0.19.0 \u2014 typed inline code-js agent ingestion (AgentDefOverlay.code_body + ensureCodeAgent \u2014 register a deterministic code agent through the substrate with no host filesystem bind; RFC J). v0.20.0 \u2014 ensureMcpServer surfaces discoveredToolCount straight from create (loomcycle now auto-discovers MCP tools at ingestion); rediscover is now an explicit force-refresh. v0.21.0 \u2014 run/continue accept optional non-secret `metadata` (repo name, review policy, \u2026) passed to the agent, symmetric with the WebHook/Schedule trigger paths. v0.22.0 \u2014 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 \u2014 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 \u2014 purgeChannel clears a channel's buffered messages without deleting its definition (allowed on yaml-declared channels too, unlike deleteChannel \u2014 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 \u2014 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 \u2014 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 \u2014 the manual-management Web UI console + Context op=time + max_fires self-retiring schedules \u2014 is server-side / in-band, no client-surface change). v0.29.1 \u2014 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 \u2014 gRPC + TS client parity for the RFC Y external fan-out and the compaction surface: spawnRunBatch() (POST /v1/runs:batch \u2014 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 \u2014 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 \u2014 server-side.) v0.34.0 \u2014 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 \u2014 RFC AH dynamic filesystem volumes: volumeDef() (POST /v1/_volumedef \u2014 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] \u2014 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 \u2014 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 \u2014 steer a live run) + streamRunByID(runId, {fromSeq}) (GET /v1/runs/{id}/stream \u2014 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 \u2014 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 \u2014 RFC AL Path VFS + RFC AK Document on the wire: path(input) (POST /v1/_path \u2014 a Unix-like filesystem over Memory/Volumes/Documents; resolve/ls/stat/mkdir/mv/rm) + document(input) (POST /v1/_document \u2014 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 \u2014 narrow as needed). v1.7.0 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 existing path() / document() callers are unchanged. v1.16.0 \u2014 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> \u2014 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 \u2014 RFC BL P5 subject erasure: erasureReport(subject, {tenant}) (GET /v1/_erasure \u2014 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 \u2014 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 \u2014 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.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "repository": {