@loomcycle/client 1.101.2 → 1.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +10 -3
- package/dist/client.d.ts +10 -3
- package/dist/client.js +10 -3
- package/dist/types.d.ts +10 -4
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -310,6 +310,12 @@ class LoomcycleClient {
|
|
|
310
310
|
* (the open `runStreaming` iterator, or a `streamRunByID` re-attach).
|
|
311
311
|
* Returns `{ run_id, delivered }`.
|
|
312
312
|
*
|
|
313
|
+
* A message that reaches a run before it finishes is answered: one sent
|
|
314
|
+
* while a non-interactive run writes its final answer makes the run take
|
|
315
|
+
* one more turn, and that turn's answer is the run's result. Once the run
|
|
316
|
+
* has finished, a message is refused as not in flight
|
|
317
|
+
* ({@link NotFoundError}, 404) rather than accepted and never read.
|
|
318
|
+
*
|
|
313
319
|
* Raises {@link UnavailableError} (503, steering off / no run),
|
|
314
320
|
* {@link AuthError} (401). A full steer queue surfaces as a 429. */
|
|
315
321
|
async sendRunInput(runId, text, opts) {
|
|
@@ -688,9 +694,10 @@ class LoomcycleClient {
|
|
|
688
694
|
return all;
|
|
689
695
|
}
|
|
690
696
|
/** One page of a team walk's runs — the walk's own run (its run id IS the
|
|
691
|
-
* walk id) and every member it spawned, oldest first.
|
|
692
|
-
*
|
|
693
|
-
* `
|
|
697
|
+
* walk id) and every member it spawned, oldest first. The walk's own row
|
|
698
|
+
* carries its `result` (with the `terminal` it reached); member rows do
|
|
699
|
+
* not. Pass the page's `next_cursor` back as `cursor` for the next one; it
|
|
700
|
+
* is "" on the last. `limit` defaults to 100, at most 1000. Mirrors
|
|
694
701
|
* `GET /v1/runs?walk_id=`. Raises NotFoundError for an unknown walk, or
|
|
695
702
|
* one the caller may not see. */
|
|
696
703
|
async listWalkRuns(walkId, opts) {
|
package/dist/client.d.ts
CHANGED
|
@@ -77,6 +77,12 @@ export declare class LoomcycleClient {
|
|
|
77
77
|
* (the open `runStreaming` iterator, or a `streamRunByID` re-attach).
|
|
78
78
|
* Returns `{ run_id, delivered }`.
|
|
79
79
|
*
|
|
80
|
+
* A message that reaches a run before it finishes is answered: one sent
|
|
81
|
+
* while a non-interactive run writes its final answer makes the run take
|
|
82
|
+
* one more turn, and that turn's answer is the run's result. Once the run
|
|
83
|
+
* has finished, a message is refused as not in flight
|
|
84
|
+
* ({@link NotFoundError}, 404) rather than accepted and never read.
|
|
85
|
+
*
|
|
80
86
|
* Raises {@link UnavailableError} (503, steering off / no run),
|
|
81
87
|
* {@link AuthError} (401). A full steer queue surfaces as a 429. */
|
|
82
88
|
sendRunInput(runId: string, text: string, opts?: {
|
|
@@ -391,9 +397,10 @@ export declare class LoomcycleClient {
|
|
|
391
397
|
signal?: AbortSignal;
|
|
392
398
|
}): Promise<Agent[]>;
|
|
393
399
|
/** One page of a team walk's runs — the walk's own run (its run id IS the
|
|
394
|
-
* walk id) and every member it spawned, oldest first.
|
|
395
|
-
*
|
|
396
|
-
* `
|
|
400
|
+
* walk id) and every member it spawned, oldest first. The walk's own row
|
|
401
|
+
* carries its `result` (with the `terminal` it reached); member rows do
|
|
402
|
+
* not. Pass the page's `next_cursor` back as `cursor` for the next one; it
|
|
403
|
+
* is "" on the last. `limit` defaults to 100, at most 1000. Mirrors
|
|
397
404
|
* `GET /v1/runs?walk_id=`. Raises NotFoundError for an unknown walk, or
|
|
398
405
|
* one the caller may not see. */
|
|
399
406
|
listWalkRuns(walkId: string, opts?: {
|
package/dist/client.js
CHANGED
|
@@ -307,6 +307,12 @@ export class LoomcycleClient {
|
|
|
307
307
|
* (the open `runStreaming` iterator, or a `streamRunByID` re-attach).
|
|
308
308
|
* Returns `{ run_id, delivered }`.
|
|
309
309
|
*
|
|
310
|
+
* A message that reaches a run before it finishes is answered: one sent
|
|
311
|
+
* while a non-interactive run writes its final answer makes the run take
|
|
312
|
+
* one more turn, and that turn's answer is the run's result. Once the run
|
|
313
|
+
* has finished, a message is refused as not in flight
|
|
314
|
+
* ({@link NotFoundError}, 404) rather than accepted and never read.
|
|
315
|
+
*
|
|
310
316
|
* Raises {@link UnavailableError} (503, steering off / no run),
|
|
311
317
|
* {@link AuthError} (401). A full steer queue surfaces as a 429. */
|
|
312
318
|
async sendRunInput(runId, text, opts) {
|
|
@@ -685,9 +691,10 @@ export class LoomcycleClient {
|
|
|
685
691
|
return all;
|
|
686
692
|
}
|
|
687
693
|
/** One page of a team walk's runs — the walk's own run (its run id IS the
|
|
688
|
-
* walk id) and every member it spawned, oldest first.
|
|
689
|
-
*
|
|
690
|
-
* `
|
|
694
|
+
* walk id) and every member it spawned, oldest first. The walk's own row
|
|
695
|
+
* carries its `result` (with the `terminal` it reached); member rows do
|
|
696
|
+
* not. Pass the page's `next_cursor` back as `cursor` for the next one; it
|
|
697
|
+
* is "" on the last. `limit` defaults to 100, at most 1000. Mirrors
|
|
691
698
|
* `GET /v1/runs?walk_id=`. Raises NotFoundError for an unknown walk, or
|
|
692
699
|
* one the caller may not see. */
|
|
693
700
|
async listWalkRuns(walkId, opts) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1181,8 +1181,9 @@ export interface Agent {
|
|
|
1181
1181
|
parent_context?: ParentContext;
|
|
1182
1182
|
/** The run's answer (RFC DI) — what the row had no field for; `stop_reason`,
|
|
1183
1183
|
* `error` and `usage` are above. Present on {@link LoomcycleClient.getAgent}
|
|
1184
|
-
* and {@link LoomcycleClient.getRun} only (listings omit it
|
|
1185
|
-
*
|
|
1184
|
+
* and {@link LoomcycleClient.getRun} only (listings omit it, except a walk's
|
|
1185
|
+
* own row in {@link LoomcycleClient.listWalkRuns}), and only once the run has
|
|
1186
|
+
* finished with something to report. */
|
|
1186
1187
|
result?: RunResult;
|
|
1187
1188
|
/** The run's own configuration (RFC DI): the overrides it ran with, merged
|
|
1188
1189
|
* over its definition. {@link LoomcycleClient.getAgent} / getRun only, like
|
|
@@ -1334,6 +1335,10 @@ export interface RunResult {
|
|
|
1334
1335
|
/** The final answer parsed against the run's `outputFormat`; absent when
|
|
1335
1336
|
* the run had none or the answer was not a JSON object. */
|
|
1336
1337
|
structured?: Record<string, unknown>;
|
|
1338
|
+
/** A team walk's run only: the id of the end (terminal) state the walk
|
|
1339
|
+
* reached, which tells two endings of one team apart. Absent when the walk
|
|
1340
|
+
* failed or was cancelled, and on every agent run. */
|
|
1341
|
+
terminal?: string;
|
|
1337
1342
|
}
|
|
1338
1343
|
export interface ListAgentsResponse {
|
|
1339
1344
|
agents: Agent[];
|
|
@@ -2942,8 +2947,9 @@ export interface StreamUserRunStatesOptions {
|
|
|
2942
2947
|
statuses?: string[];
|
|
2943
2948
|
/** Filter to one agent name. Empty means any. */
|
|
2944
2949
|
agent?: string;
|
|
2945
|
-
/** v1.78.0 — SERVER-side filter: only
|
|
2946
|
-
*
|
|
2950
|
+
/** v1.78.0 — SERVER-side filter: only one team walk — the walk's own run
|
|
2951
|
+
* (the event's `run_id`) and the runs it spawned (each event's
|
|
2952
|
+
* `parent_context.walk_id`).
|
|
2947
2953
|
*
|
|
2948
2954
|
* A team walk's own run_id IS its walk id, so a caller that started a team
|
|
2949
2955
|
* with `detach: true` passes back exactly the handle it already holds —
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcycle/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.103.0",
|
|
4
4
|
"description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 71 methods covering run streaming, agent metadata, pause/resume/state, resolver re-probe (resolveProbe — issue #88 operator escape hatch), operator-token admin (operatorTokenDef — RFC L OSS multi-tenant auth) + whoami (RFC L authoritative principal, v0.17.0) + tenant-scoped listUsers / listUserAgents, dynamic MCP registration (mcpServerDef + v0.18.0 typed mcpServerDefVerify + ensureMcpServer idempotent register-if-changed), snapshot lifecycle, memory admin (incl. v0.9.0 Vector Memory embed_stats + reembed AND v0.11.5 setMemoryEntry + deleteMemoryEntry), interruption resolve, hook management, v0.8.22 substrate admin (agentDef + skillDef), v0.9.x n8n Phase 0 (listChannels + streamUserRunStates), v0.9.x Channel CRUD (publishChannel + subscribeChannel + peekChannel + ackChannel), v0.11.5 Channel admin CRUD (createChannel + updateChannel + deleteChannel — runtime substrate; yaml channels refuse mutation with HTTP 409), v0.9.x content_sha256 verify, v0.9.1 transcript first-cycle, v0.9.x dynamic MCP server registration (mcpServerDef + MCPServerDefVerifyResult), v0.10.3 Library v2 enumeration (listLibraryAgents + listLibrarySkills + listLibraryMcpServers), and v0.11.0 LLM Gateway (llmChat + llmStream — direct provider routing without agent overhead; primary target is n8n's LoomCycleChatModel AI Agent sub-node and any LangChain-compatible consumer). v0.10.1 — dual ESM + CommonJS distribution (additive — ESM consumers unchanged; CJS consumers like n8n's community-node loader now work). v0.19.0 — typed inline code-js agent ingestion (AgentDefOverlay.code_body + ensureCodeAgent — register a deterministic code agent through the substrate with no host filesystem bind; RFC J). v0.20.0 — ensureMcpServer surfaces discoveredToolCount straight from create (loomcycle now auto-discovers MCP tools at ingestion); rediscover is now an explicit force-refresh. v0.21.0 — run/continue accept optional non-secret `metadata` (repo name, review policy, …) passed to the agent, symmetric with the WebHook/Schedule trigger paths. v0.22.0 — version-aligned lockstep release; no client-surface change (RFC N tenant isolation of the agent/skill/MCP/Schedule/Webhook definition plane + real op-schemas on the builtin MCP meta-tools are both server-side). v0.23.0 — version-aligned lockstep release; no client-surface change (RFCs O/P/R MCP-server hardening + thin client and the RFC Q DeepSeek tool-content fix are all server-side / MCP-transport-side). v0.24.0 — purgeChannel clears a channel's buffered messages without deleting its definition (allowed on yaml-declared channels too, unlike deleteChannel — F20); AgentDefOverlay gains channels / evaluation_scopes / interruption so a COMPLETE interactive/multi-agent agent round-trips over the substrate (F14). (Consolidates the interim 0.24/0.25 package bumps, which were never tag-published, back into lockstep with the loomcycle v0.24.0 tag.) v0.25.0 — adds the RFC S channel fan-in/fan-out client twins: awaitChannels() (wait for any/all/at_least N messages across channels, or a timeout — non-committing) + broadcastChannels() (publish one payload to N channels in one atomic-pre-flight call), the client-facing counterparts of the in-band Channel.await / Channel.broadcast tool ops (the rest of v0.25.0 — the manual-management Web UI console + Context op=time + max_fires self-retiring schedules — is server-side / in-band, no client-surface change). v0.29.1 — Usage gains optional `max_context_tokens` (the serving model's context-window ceiling, stamped by the loop from Provider.Capabilities() on each usage event) so a consumer can render a 'context used / max' gauge without a hard-coded per-model table; additive + optional, no behavior change. (Lockstep catch-up: the field landed in loomcycle v0.29.0 but the adapter publish skipped on a version mismatch; v0.29.1 realigns the package version with the release tag so it publishes.) v0.33.0 — gRPC + TS client parity for the RFC Y external fan-out and the compaction surface: spawnRunBatch() (POST /v1/runs:batch — spawn up to 32 fresh runs concurrently in one call, combined index-aligned envelope, per-child failures in-envelope) + compactRun(runId) (POST /v1/runs/{run_id}/compact — summarize a parked run's context); plus per-run sampling + compaction overrides now accepted on runStreaming / continueSession (an explicit temperature 0 is preserved as deterministic, not dropped as falsy). (The gRPC half adds the matching SpawnRunBatch / CompactRun RPCs + the sampling/compaction fields on RunRequest/ContinueRequest — server-side.) v0.34.0 — version-aligned lockstep release; no client-surface change (context-transform plugins / RFC Z Phase 1a are server-side config; the exp7 hardening pass is server-side; the R2 cross-provider thinking-model downgrade surfaces a new `model_downgraded` SSE event the generic stream passes through unchanged). v0.35.0 — RFC AH dynamic filesystem volumes: volumeDef() (POST /v1/_volumedef — op-discriminated create/get/list/delete/purge; a Volume is flat, so delete unmaps + purge RemoveAll's, no retire/promote/fork) + listVolumes() / listEphemeralVolumes() (GET /v1/_volumes[/ephemeral] — tenant-scoped; host paths redacted for non-operator callers). Tenant-confined; the runtime derives the path inside an operator-blessed dynamic_root, so callers pass name + mode, never a host path. v1.1.1 — RFC AI interactive agentic sessions: an `interactive: true` flag on runStreaming/continueSession (a run that parks at end_turn for steering) + sendRunInput(runId, text) (POST /v1/runs/{id}/input — steer a live run) + streamRunByID(runId, {fromSeq}) (GET /v1/runs/{id}/stream — re-attach by run_id; the operator's prior turns replay as `steer` events so a cold client reconstructs the whole conversation) + a high-level InteractiveSession driver (client.interactiveSession / attachInteractiveSession — events()/send()/cancel(), the adapter port of the Web UI run terminal). The AgentEvent union gains awaiting_input/steer/context_compaction frames. Version-aligned with the loomcycle v1.1.x line so the v1.1.1 tag publishes it (also carrying the previously-unpublished v0.35.0 volume surface). v1.4.0 — RFC AL Path VFS + RFC AK Document on the wire: path(input) (POST /v1/_path — a Unix-like filesystem over Memory/Volumes/Documents; resolve/ls/stat/mkdir/mv/rm) + document(input) (POST /v1/_document — chunked-graph documents; 13 ops, needs SQL Memory on the sidecar). Scope (agent/user/tenant) + tenant are resolved server-side from the authenticated principal, never the wire; an off-run scope:'user' op keys on the principal subject so it interoperates with that user's agent runs. New PathToolInput / DocumentToolInput types; responses are op-varying (unknown — narrow as needed). v1.7.0 — RFC AT image/vision input: the PromptContent union gains an `image` variant ({ type:'image'; media_type: ImageMediaType; data: base64-no-prefix }) accepted in a user segment by runStreaming / continueSession (segments pass through unchanged — no method change). The model must be vision-capable or the run errors before the call. New ImageMediaType type (image/png|jpeg|gif|webp). v1.12.1 — Path/Document browse-by-subject + the full Document op set (RFC AS/AK): path(input, opts) / document(input, opts) accept optional scopeId / tenant browse overrides sent as ?scope_id= / ?tenant= query params (server reads them from the URL, re-checks authorization; omit both to browse your own subject — byte-identical to the pre-RFC-AS request), and DocumentToolInput.op now covers all 16 backend ops (adds set_path, export_md, import_md) with the matching include_metadata / markdown fields. Additive — existing path() / document() callers are unchanged. v1.16.0 — RFC BC client-executed tools (local tool host): connectClientTools({tools,onInvoke}) opens a persistent WebSocket to /v1/client-tools, registers tools this client runs on the user's machine (browser DOM / files / shell), and answers the invoke frames loomcycle routes when an agent of your principal calls a client:<tool> — returning your reply as an ordinary tool result. Returns a ClientToolHost driver (.close() to stop; auto-reconnect); dependency-free (global WebSocket in browsers / Node 22+, or an injected WebSocketImpl like the ws package on older Node); the bearer rides the Sec-WebSocket-Protocol subprotocol (browsers can't set an Authorization header on a WebSocket). The runtime's first WebSocket surface. v1.45.0 — RFC BL P5 subject erasure: erasureReport(subject, {tenant}) (GET /v1/_erasure — what this deployment holds about one subject, in three tiers: deletable with existing primitives, subject-keyed but not deletable, and facts ABOUT the subject in scopes they do not own) + erasureExecute(subject, {dryRun, confirm, tenant}) (POST /v1/_erasure — removes tiers 1 and 2). DEFAULTS TO A DRY RUN: dryRun defaults true and a live run also requires confirm === subject. The tier-3 residue is traceable only through the subject's chats, which a live run deletes, so a report afterwards shows rows: 0 while those facts remain — the returned object is the only durable record of what was not reached; persist it. New ErasureReport / ErasureResult / ErasureTier / ErasureResidue types. v1.47.0 — RFC BV memory-view SDK: memorySearch() (POST /v1/_memory/search — off-run unified semantic search spanning k/v entries AND document-chunk bodies in one ranked list, each hit tagged kind memory|document with chunk_id on document hits) + memoryEmbedStats(scope) + reembedMemory(scope, scopeId, {dryRun,limit}) (the Vector Memory embed-admin reads the memory-view console needs; dry_run defaults true). Fact reads (list_facts + get_chunk's entity block) ride the existing document() passthrough. Additive — existing callers unchanged. v1.61.0 — RFC CJ per-run context-window override: runStreaming / continueSession accept an optional maxContextTokens (integer tokens) that wins over the agent's own max_context_tokens; omitted inherits it (which defers to the provider/driver default). Distinct from a model's output cap; primarily for local inference (Ollama num_ctx). Serialized as the snake_case max_context_tokens field on POST /v1/runs + the continuation body; additive, existing callers unchanged. v1.72.1 — the TeamDef version lifecycle: listTeamVersions(name) (op=list — every version of one team, newest first), promoteTeam(defId) (op=promote — point the active pointer, which is what a run BY NAME executes; forkTeam defaults to promote:false, so authoring and putting in force stay two steps), retireTeam(defId, retired) (op=retire — reversible and version-scoped, unlike deleteTeam) and verifyTeam(name, contentSha256) (op=verify — the drift check for a workflow kept in source control and pushed to several deployments; an absent team answers deployed:false rather than raising). The ops existed on the substrate and over HTTP; a client that could author a team could not put one in force.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|