@loomcycle/client 0.20.0 → 0.22.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.
@@ -93,6 +93,10 @@ class LoomcycleClient {
93
93
  body.user_credentials = opts.userCredentials;
94
94
  if (opts.parentContext !== undefined)
95
95
  body.parent_context = opts.parentContext;
96
+ if (opts.metadata !== undefined)
97
+ body.metadata = opts.metadata;
98
+ if (opts.runTimeoutSeconds !== undefined)
99
+ body.run_timeout_seconds = opts.runTimeoutSeconds;
96
100
  yield* this.streamSSE("/v1/runs", body, opts.signal, opts.debug);
97
101
  }
98
102
  /**
@@ -133,6 +137,10 @@ class LoomcycleClient {
133
137
  body.user_credentials = opts.userCredentials;
134
138
  if (opts.parentContext !== undefined)
135
139
  body.parent_context = opts.parentContext;
140
+ if (opts.metadata !== undefined)
141
+ body.metadata = opts.metadata;
142
+ if (opts.runTimeoutSeconds !== undefined)
143
+ body.run_timeout_seconds = opts.runTimeoutSeconds;
136
144
  yield* this.streamSSE(`/v1/sessions/${encodeURIComponent(opts.sessionId)}/messages`, body, opts.signal, opts.debug);
137
145
  }
138
146
  // ---- Agent metadata ----
package/dist/client.js CHANGED
@@ -90,6 +90,10 @@ export class LoomcycleClient {
90
90
  body.user_credentials = opts.userCredentials;
91
91
  if (opts.parentContext !== undefined)
92
92
  body.parent_context = opts.parentContext;
93
+ if (opts.metadata !== undefined)
94
+ body.metadata = opts.metadata;
95
+ if (opts.runTimeoutSeconds !== undefined)
96
+ body.run_timeout_seconds = opts.runTimeoutSeconds;
93
97
  yield* this.streamSSE("/v1/runs", body, opts.signal, opts.debug);
94
98
  }
95
99
  /**
@@ -130,6 +134,10 @@ export class LoomcycleClient {
130
134
  body.user_credentials = opts.userCredentials;
131
135
  if (opts.parentContext !== undefined)
132
136
  body.parent_context = opts.parentContext;
137
+ if (opts.metadata !== undefined)
138
+ body.metadata = opts.metadata;
139
+ if (opts.runTimeoutSeconds !== undefined)
140
+ body.run_timeout_seconds = opts.runTimeoutSeconds;
133
141
  yield* this.streamSSE(`/v1/sessions/${encodeURIComponent(opts.sessionId)}/messages`, body, opts.signal, opts.debug);
134
142
  }
135
143
  // ---- Agent metadata ----
package/dist/types.d.ts CHANGED
@@ -148,6 +148,21 @@ export interface RunOptions {
148
148
  * user-initiated request that spawned the whole tree. Not a secret.
149
149
  * Omitted = no tracking context. */
150
150
  parentContext?: ParentContext;
151
+ /** Optional NON-SECRET structured metadata passed to the agent (repo
152
+ * name, review policy, preferred skills, …) — symmetric with the
153
+ * WebHook/Schedule trigger paths. As a first-party (bearer-authed)
154
+ * caller this is TRUSTED: a code-js agent reads it as `input.metadata`;
155
+ * an LLM agent receives it as a trusted prompt block. NOT for secrets —
156
+ * use {@link RunOptions.userCredentials} for tokens. Per-call, not session
157
+ * state: a continuation does not inherit it — re-send on continue(). */
158
+ metadata?: Record<string, unknown>;
159
+ /** Optional ad-hoc per-run wall-clock budget (seconds) for a CODE-JS agent,
160
+ * overriding the agent's `run_timeout_seconds` and the sidecar's global
161
+ * default (precedence: per-run > per-agent > global). Use it for a fan-out
162
+ * orchestrator that blocks in Agent.parallel_spawn awaiting LLM children —
163
+ * its budget spans that wait, so the CPU-oriented default is often too low.
164
+ * Ignored by LLM agents. 0 / omitted = inherit. */
165
+ runTimeoutSeconds?: number;
151
166
  /** Opt-in observability: when true, the iterator emits client-
152
167
  * synthesized `{ type: "_meta", meta_subtype: "stream_open" | "stream_close" }`
153
168
  * events around the real event stream. `meta_reason` carries the
@@ -206,6 +221,14 @@ export interface ContinueOptions {
206
221
  * {@link RunOptions.parentContext} — same shape; a continuation may
207
222
  * (re)set the lineage for the new run it creates. */
208
223
  parentContext?: ParentContext;
224
+ /** Optional NON-SECRET structured metadata for the new run — see
225
+ * {@link RunOptions.metadata}. Same shape + trust posture. NOT inherited
226
+ * from the original run (metadata is a per-call input, not session state):
227
+ * re-send it on the continuation to carry it forward. */
228
+ metadata?: Record<string, unknown>;
229
+ /** Optional ad-hoc per-run code-js wall-clock budget (seconds) for the
230
+ * continuation's new run — see {@link RunOptions.runTimeoutSeconds}. */
231
+ runTimeoutSeconds?: number;
209
232
  /** Opt-in observability: see {@link RunOptions.debug}. Same shape. */
210
233
  debug?: boolean;
211
234
  signal?: AbortSignal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "0.20.0",
4
- "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 51 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.",
3
+ "version": "0.22.0",
4
+ "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 51 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).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "repository": {