@loomcycle/client 1.1.1 → 1.7.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.
@@ -827,6 +827,39 @@ class LoomcycleClient {
827
827
  async volumeDef(input, opts) {
828
828
  return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_volumedef", input, opts);
829
829
  }
830
+ /** Invoke the RFC AL Path VFS tool over HTTP (`POST /v1/_path`). A
831
+ * Unix-like filesystem over your Memory entries, Volume mounts, and
832
+ * Documents — address them by human-readable paths (e.g. /docs/launch).
833
+ * Op-discriminated (`resolve`/`ls`/`stat`/`mkdir`/`mv`/`rm`). Scope
834
+ * (agent/user/tenant) + tenant are resolved server-side from the
835
+ * authenticated principal, never the wire.
836
+ *
837
+ * Response varies per op — an `ls` returns `{path, entries}`, a `resolve`
838
+ * returns the dirent + resource_ref. Narrow as needed.
839
+ *
840
+ * Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
841
+ * path, rm of a non-empty path without recursive, etc.);
842
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
843
+ async path(input, opts) {
844
+ return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_path", input, opts);
845
+ }
846
+ /** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
847
+ * chunked-graph document where each chunk is a first-class unit (UUID,
848
+ * hierarchy, type, fields, graph edges, Markdown body) that agents and
849
+ * humans co-author. Op-discriminated (13 ops: document/chunk lifecycle,
850
+ * edges, query_chunks, type defs). Scope agent/user (tenant deferred);
851
+ * resolved server-side from the principal.
852
+ *
853
+ * Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
854
+ * — the chunk-structure tables live there. Without it the call is refused
855
+ * ({@link SubstrateToolRefusedError}).
856
+ *
857
+ * Response varies per op — `create_document` returns
858
+ * `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
859
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
860
+ async document(input, opts) {
861
+ return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_document", input, opts);
862
+ }
830
863
  /** List the PERSISTENT volume universe for the caller's tenant — every
831
864
  * static volume (the shared bind floor, `source: "static"`, read-only)
832
865
  * plus the tenant's own dynamic VolumeDefs (`source: "dynamic"`). Host
package/dist/cjs/index.js CHANGED
@@ -58,6 +58,10 @@
58
58
  * listVolumes(): Promise<PersistentVolumesResponse>
59
59
  * listEphemeralVolumes(): Promise<EphemeralVolumesResponse>
60
60
  *
61
+ * // Path VFS + chunked-graph Documents on the wire (v1.4.0 — RFC AL / RFC AK)
62
+ * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
63
+ * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
64
+ *
61
65
  * // Library v2 enumeration (v0.10.3 — yaml+substrate merged)
62
66
  * listLibraryAgents(): Promise<LibraryListResponse<LibraryAgentDefinition>>
63
67
  * listLibrarySkills(): Promise<LibraryListResponse<LibrarySkillDefinition>>
package/dist/client.d.ts CHANGED
@@ -24,7 +24,7 @@
24
24
  * full mapping table.
25
25
  */
26
26
  import { InteractiveSession } from "./interactive.js";
27
- 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, RunBatchOptions, RunBatchResult, RunOptions, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, TranscriptResponse, WhoamiResponse } from "./types.js";
27
+ 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, RunBatchOptions, RunBatchResult, RunOptions, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, TranscriptResponse, WhoamiResponse } from "./types.js";
28
28
  export declare class LoomcycleClient {
29
29
  private ctx;
30
30
  constructor(opts?: ClientOptions);
@@ -556,6 +556,39 @@ export declare class LoomcycleClient {
556
556
  volumeDef(input: SubstrateToolInput, opts?: {
557
557
  signal?: AbortSignal;
558
558
  }): Promise<SubstrateToolResponse>;
559
+ /** Invoke the RFC AL Path VFS tool over HTTP (`POST /v1/_path`). A
560
+ * Unix-like filesystem over your Memory entries, Volume mounts, and
561
+ * Documents — address them by human-readable paths (e.g. /docs/launch).
562
+ * Op-discriminated (`resolve`/`ls`/`stat`/`mkdir`/`mv`/`rm`). Scope
563
+ * (agent/user/tenant) + tenant are resolved server-side from the
564
+ * authenticated principal, never the wire.
565
+ *
566
+ * Response varies per op — an `ls` returns `{path, entries}`, a `resolve`
567
+ * returns the dirent + resource_ref. Narrow as needed.
568
+ *
569
+ * Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
570
+ * path, rm of a non-empty path without recursive, etc.);
571
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
572
+ path(input: PathToolInput, opts?: {
573
+ signal?: AbortSignal;
574
+ }): Promise<PathToolResponse>;
575
+ /** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
576
+ * chunked-graph document where each chunk is a first-class unit (UUID,
577
+ * hierarchy, type, fields, graph edges, Markdown body) that agents and
578
+ * humans co-author. Op-discriminated (13 ops: document/chunk lifecycle,
579
+ * edges, query_chunks, type defs). Scope agent/user (tenant deferred);
580
+ * resolved server-side from the principal.
581
+ *
582
+ * Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
583
+ * — the chunk-structure tables live there. Without it the call is refused
584
+ * ({@link SubstrateToolRefusedError}).
585
+ *
586
+ * Response varies per op — `create_document` returns
587
+ * `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
588
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
589
+ document(input: DocumentToolInput, opts?: {
590
+ signal?: AbortSignal;
591
+ }): Promise<DocumentToolResponse>;
559
592
  /** List the PERSISTENT volume universe for the caller's tenant — every
560
593
  * static volume (the shared bind floor, `source: "static"`, read-only)
561
594
  * plus the tenant's own dynamic VolumeDefs (`source: "dynamic"`). Host
package/dist/client.js CHANGED
@@ -824,6 +824,39 @@ export class LoomcycleClient {
824
824
  async volumeDef(input, opts) {
825
825
  return postJSON(this.ctx, "/v1/_volumedef", input, opts);
826
826
  }
827
+ /** Invoke the RFC AL Path VFS tool over HTTP (`POST /v1/_path`). A
828
+ * Unix-like filesystem over your Memory entries, Volume mounts, and
829
+ * Documents — address them by human-readable paths (e.g. /docs/launch).
830
+ * Op-discriminated (`resolve`/`ls`/`stat`/`mkdir`/`mv`/`rm`). Scope
831
+ * (agent/user/tenant) + tenant are resolved server-side from the
832
+ * authenticated principal, never the wire.
833
+ *
834
+ * Response varies per op — an `ls` returns `{path, entries}`, a `resolve`
835
+ * returns the dirent + resource_ref. Narrow as needed.
836
+ *
837
+ * Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
838
+ * path, rm of a non-empty path without recursive, etc.);
839
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
840
+ async path(input, opts) {
841
+ return postJSON(this.ctx, "/v1/_path", input, opts);
842
+ }
843
+ /** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
844
+ * chunked-graph document where each chunk is a first-class unit (UUID,
845
+ * hierarchy, type, fields, graph edges, Markdown body) that agents and
846
+ * humans co-author. Op-discriminated (13 ops: document/chunk lifecycle,
847
+ * edges, query_chunks, type defs). Scope agent/user (tenant deferred);
848
+ * resolved server-side from the principal.
849
+ *
850
+ * Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
851
+ * — the chunk-structure tables live there. Without it the call is refused
852
+ * ({@link SubstrateToolRefusedError}).
853
+ *
854
+ * Response varies per op — `create_document` returns
855
+ * `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
856
+ * {@link InvalidArgumentError} on 400; {@link AuthError} on 401. */
857
+ async document(input, opts) {
858
+ return postJSON(this.ctx, "/v1/_document", input, opts);
859
+ }
827
860
  /** List the PERSISTENT volume universe for the caller's tenant — every
828
861
  * static volume (the shared bind floor, `source: "static"`, read-only)
829
862
  * plus the tenant's own dynamic VolumeDefs (`source: "dynamic"`). Host
package/dist/index.d.ts CHANGED
@@ -57,6 +57,10 @@
57
57
  * listVolumes(): Promise<PersistentVolumesResponse>
58
58
  * listEphemeralVolumes(): Promise<EphemeralVolumesResponse>
59
59
  *
60
+ * // Path VFS + chunked-graph Documents on the wire (v1.4.0 — RFC AL / RFC AK)
61
+ * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
62
+ * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
63
+ *
60
64
  * // Library v2 enumeration (v0.10.3 — yaml+substrate merged)
61
65
  * listLibraryAgents(): Promise<LibraryListResponse<LibraryAgentDefinition>>
62
66
  * listLibrarySkills(): Promise<LibraryListResponse<LibrarySkillDefinition>>
@@ -89,5 +93,5 @@
89
93
  export { LoomcycleClient } from "./client.js";
90
94
  export { InteractiveSession } from "./interactive.js";
91
95
  export type { InteractiveSessionOps } from "./interactive.js";
92
- export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ToolUse, Usage, Agent, AgentStatus, AgentUsage, CancelAgentResult, ListAgentsResponse, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, 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, 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, } from "./types.js";
96
+ 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, 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, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, 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, } from "./types.js";
93
97
  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
@@ -57,6 +57,10 @@
57
57
  * listVolumes(): Promise<PersistentVolumesResponse>
58
58
  * listEphemeralVolumes(): Promise<EphemeralVolumesResponse>
59
59
  *
60
+ * // Path VFS + chunked-graph Documents on the wire (v1.4.0 — RFC AL / RFC AK)
61
+ * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
62
+ * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
63
+ *
60
64
  * // Library v2 enumeration (v0.10.3 — yaml+substrate merged)
61
65
  * listLibraryAgents(): Promise<LibraryListResponse<LibraryAgentDefinition>>
62
66
  * listLibrarySkills(): Promise<LibraryListResponse<LibrarySkillDefinition>>
package/dist/types.d.ts CHANGED
@@ -98,7 +98,13 @@ export type PromptContent = {
98
98
  type: "untrusted-block";
99
99
  kind: string;
100
100
  text: string;
101
+ } | {
102
+ type: "image";
103
+ media_type: ImageMediaType;
104
+ data: string;
101
105
  };
106
+ /** Whitelisted image media types accepted on an `image` content block (RFC AT). */
107
+ export type ImageMediaType = "image/png" | "image/jpeg" | "image/gif" | "image/webp";
102
108
  export interface PromptSegment {
103
109
  role: "system" | "user";
104
110
  content: PromptContent[];
@@ -764,6 +770,65 @@ export type SubstrateToolInput = {
764
770
  * `{name, versions: [...]}`, promote/retire return summary shapes.
765
771
  * Callers narrow as needed. */
766
772
  export type SubstrateToolResponse = unknown;
773
+ /** Input for {@link LoomcycleClient.path} — the RFC AL Unix-like VFS tool
774
+ * (POST /v1/_path). Op-discriminated; the server resolves scope + tenant
775
+ * from the authenticated principal, never the wire. Address Memory entries,
776
+ * Volume mounts, and Documents by human-readable paths (e.g. /docs/launch). */
777
+ export type PathToolInput = {
778
+ op: "resolve" | "ls" | "stat" | "mkdir" | "mv" | "rm";
779
+ /** Absolute path, e.g. /docs/launch. Segments are [a-zA-Z0-9._-]; no "..". */
780
+ path?: string;
781
+ /** Destination path (mv only). */
782
+ to?: string;
783
+ /** Which tree (default agent). user needs a user on the run; tenant is shared. */
784
+ scope?: "agent" | "user" | "tenant";
785
+ /** ls: list descendants. rm: required to remove a path that has descendants. */
786
+ recursive?: boolean;
787
+ /** ls: only entries of this kind (document/volume_mount/memory_entry/directory). */
788
+ kind_filter?: string;
789
+ /** rm: also delete the backing resource (NOT supported in v1). */
790
+ resource_too?: boolean;
791
+ [extra: string]: unknown;
792
+ };
793
+ /** Input for {@link LoomcycleClient.document} — the RFC AK chunked-graph
794
+ * Document tool (POST /v1/_document). Op-discriminated (13 ops); requires
795
+ * SQL Memory on the sidecar. Scope agent/user (tenant deferred). */
796
+ export type DocumentToolInput = {
797
+ op: "create_document" | "get_document" | "delete_document" | "create_chunk" | "get_chunk" | "update_chunk" | "delete_chunk" | "move_chunk" | "link_chunks" | "unlink_chunks" | "query_chunks" | "define_type" | "list_types";
798
+ scope?: "agent" | "user";
799
+ /** Document id (get/delete_document) or chunk id (get/update/delete/move_chunk). */
800
+ id?: string;
801
+ /** create_document: name the doc in the Path tree; get/delete: address by path. */
802
+ path?: string;
803
+ title?: string;
804
+ document_id?: string;
805
+ parent_id?: string;
806
+ new_parent_id?: string;
807
+ type?: string;
808
+ body?: string;
809
+ fields?: Record<string, unknown>;
810
+ status?: string;
811
+ position?: number;
812
+ /** update_chunk: the chunk's current revision (optimistic concurrency). */
813
+ revision?: number;
814
+ from_id?: string;
815
+ to_id?: string;
816
+ kind?: string;
817
+ /** query_chunks: restrict to documents at/under this Path-tree path. */
818
+ under_path?: string;
819
+ /** query_chunks: raw read-only SELECT (escape hatch; validator-gated). */
820
+ sql?: string;
821
+ limit?: number;
822
+ /** define/list_types: the type name. */
823
+ name?: string;
824
+ [extra: string]: unknown;
825
+ };
826
+ /** Response shape for {@link LoomcycleClient.path} and
827
+ * {@link LoomcycleClient.document}. `unknown` because it varies per op —
828
+ * callers narrow as needed (e.g. an `ls` returns `{path, entries}`, a
829
+ * `create_document` returns `{document_id, root_chunk_id, ...}`). */
830
+ export type PathToolResponse = unknown;
831
+ export type DocumentToolResponse = unknown;
767
832
  /** Volume access mode — read-only or read-write (RFC AH). */
768
833
  export type VolumeMode = "ro" | "rw";
769
834
  /** One row of {@link LoomcycleClient.listVolumes} (`GET /v1/_volumes`). */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "1.1.1",
4
- "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 61 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).",
3
+ "version": "1.7.0",
4
+ "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 63 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).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "repository": {