@loomcycle/client 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/cjs/client.js +43 -14
- package/dist/cjs/fetch-helpers.js +19 -2
- package/dist/client.d.ts +20 -6
- package/dist/client.js +43 -14
- package/dist/fetch-helpers.d.ts +4 -1
- package/dist/fetch-helpers.js +19 -2
- package/dist/types.d.ts +20 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ TypeScript client for the [loomcycle](https://github.com/denn-gubsky/loomcycle)
|
|
|
12
12
|
|
|
13
13
|
### What's new since v0.8.18
|
|
14
14
|
|
|
15
|
+
- **Breaking — `tools` replaces `allowedTools`** — the per-run tool allowlist is now a single canonical key. The `runStreaming` / `continueSession` option is renamed from `allowedTools` to **`tools`**, and the `AgentDefOverlay` + library wire field is likewise **`tools`**, matching the loomcycle YAML rename and aligning with Claude Code agent frontmatter. No dual-key fallback — update call sites to `runStreaming({ …, tools: [...] })`. Requires a loomcycle server carrying the same rename.
|
|
16
|
+
- **Path/Document browse-by-subject + the full Document op set** (v1.12.1, RFC AS/AK) — `path(input, opts)` and `document(input, opts)` accept optional `scopeId` / `tenant` browse overrides, sent as `?scope_id=` / `?tenant=` query params (the server reads them from the URL and re-checks authorization — a tenant principal's `tenant` is ignored, `scopeId` picks any subject it may see); omit both to browse your own subject (byte-identical to the pre-RFC-AS request). `DocumentToolInput.op` now covers all 16 backend ops — adds **`set_path`** (attach/re-home a Path-tree name for an existing document), **`export_md`** (render to Markdown; `include_metadata: false` for clean human-facing output), and **`import_md`** (build a document from export_md-shaped `markdown`). Additive — existing `path()` / `document()` callers are unchanged.
|
|
15
17
|
- **`interactiveSession` / `sendRunInput` / `streamRunByID` + the `interactive` flag** (v1.1.1, RFC AI) — the interactive agentic session, the adapter port of the Web UI's run terminal. Pass `interactive: true` to `runStreaming` / `continueSession` to start a **persistent** run that parks at end_turn (an `awaiting_input` frame) instead of ending; **`sendRunInput(runId, text)`** steers it (the response arrives on the same stream); **`streamRunByID(runId, {fromSeq})`** re-attaches by run_id (the operator's prior turns replay as `steer` events, `user_input.source === "replay"`, so a cold client — e.g. another device — reconstructs the whole conversation). The high-level **`client.interactiveSession({agent, segments})`** returns an `InteractiveSession` with `events()` / `send()` / `cancel()`; **`attachInteractiveSession(runId)`** resumes one. The `AgentEvent` union gains `awaiting_input` / `steer` / `context_compaction`.
|
|
16
18
|
- **`volumeDef` / `listVolumes` / `listEphemeralVolumes`** (v0.35.0, RFC AH) — the dynamic filesystem-volume surface. `volumeDef` is the op-discriminated substrate tool (`create` / `get` / `list` / `delete` / `purge`); a Volume is **flat** (a pointer to mutable on-disk state, not a versioned def), so `delete` unmaps + leaves files while `purge` removes the row **and** the directory tree — there is no retire/promote/fork. Tenant-confined (`ScopeTenant`): the runtime derives the path inside an operator-blessed `dynamic_root`, so you pass `{name, mode}`, never a host path. `listVolumes()` / `listEphemeralVolumes()` return the tenant's persistent + live run-scoped volumes; host paths are redacted (`""`) for a non-operator caller.
|
|
17
19
|
- **`ensureMcpServer` / `mcpServerDefVerify`** (v0.18.0) — typed ergonomics for the dynamic-MCP dedup flow. `ensureMcpServer({name, url, headers?, rediscover?})` registers a callback MCP server **idempotently**: it runs `create` (a no-op in loomcycle ≥ v0.18.0 when the active def already carries identical content) plus an optional `rediscover` (a no-op on unchanged tools), and returns `{defId, version, changed, discoveredToolCount?}` — so a consumer re-registering on every startup gets `changed: false` once its registration content is stable. Keep `${run.*}` / `${LOOMCYCLE_*}` header placeholders **literal** (don't bake a per-restart token) or the content varies each boot and dedup can't engage. `mcpServerDefVerify(name, sha)` is the typed `op: verify` wrapper (`matches: true` = no-op signal).
|
|
@@ -411,8 +413,8 @@ The stream stays open for up to 30 minutes (server-enforced); reconnect on close
|
|
|
411
413
|
- `matches: true` only when both hashes are non-empty AND equal. An empty caller hash NEVER matches (no false-positive when the deployed row's hash is also empty due to a not-yet-completed backfill).
|
|
412
414
|
- `deployed: false` ⇒ `matches: false`. Use this to distinguish "no active row" (first deploy) from "drift" (push update).
|
|
413
415
|
- The CLI hash and the substrate's hash are guaranteed identical for matching content — both compute through the same Go function in `internal/agents.Sign`.
|
|
414
|
-
- Agent hash covers `name + description + system_prompt +
|
|
415
|
-
- Skill hash covers `name + description + body +
|
|
416
|
+
- Agent hash covers `name + description + system_prompt + tools + skills + model + provider + tier + effort + max_tokens + max_iterations + providers + models + memory_scopes + memory_quota_bytes`. Explicitly excluded: `def_id`, `version`, `created_at`, `retired`, **plus** `channels` and `*_scopes` (operator-yaml-only ACL fields that don't round-trip through `set` / `fork`).
|
|
417
|
+
- Skill hash covers `name + description + body + tools`. Skill bodies are normalised before hashing (CRLF → LF; trailing whitespace stripped) so editor drift doesn't cause spurious mismatches.
|
|
416
418
|
|
|
417
419
|
See `help(topic="content-signatures")` from inside an agent run for the full operator narrative.
|
|
418
420
|
|
package/dist/cjs/client.js
CHANGED
|
@@ -77,8 +77,8 @@ function runBody(opts) {
|
|
|
77
77
|
agent: opts.agent,
|
|
78
78
|
segments: opts.segments,
|
|
79
79
|
};
|
|
80
|
-
if (opts.
|
|
81
|
-
body.
|
|
80
|
+
if (opts.tools !== undefined)
|
|
81
|
+
body.tools = opts.tools;
|
|
82
82
|
if (opts.allowedHosts !== undefined && opts.allowedHosts !== null) {
|
|
83
83
|
body.allowed_hosts = opts.allowedHosts;
|
|
84
84
|
}
|
|
@@ -167,8 +167,8 @@ class LoomcycleClient {
|
|
|
167
167
|
const body = {
|
|
168
168
|
segments: opts.segments,
|
|
169
169
|
};
|
|
170
|
-
if (opts.
|
|
171
|
-
body.
|
|
170
|
+
if (opts.tools !== undefined)
|
|
171
|
+
body.tools = opts.tools;
|
|
172
172
|
if (opts.allowedHosts !== undefined && opts.allowedHosts !== null) {
|
|
173
173
|
body.allowed_hosts = opts.allowedHosts;
|
|
174
174
|
}
|
|
@@ -635,8 +635,8 @@ class LoomcycleClient {
|
|
|
635
635
|
* stable and dedup engages on re-register. */
|
|
636
636
|
async ensureCodeAgent(opts, callOpts) {
|
|
637
637
|
const overlay = { provider: "code-js", code_body: opts.code };
|
|
638
|
-
if (opts.
|
|
639
|
-
overlay.
|
|
638
|
+
if (opts.tools)
|
|
639
|
+
overlay.tools = opts.tools;
|
|
640
640
|
if (opts.tier)
|
|
641
641
|
overlay.tier = opts.tier;
|
|
642
642
|
if (opts.model)
|
|
@@ -662,7 +662,7 @@ class LoomcycleClient {
|
|
|
662
662
|
/** Invoke the v0.9.x MCPServerDef substrate tool over HTTP.
|
|
663
663
|
* Dynamic MCP server registration — register an HTTP /
|
|
664
664
|
* Streamable-HTTP MCP server at runtime so its tools become
|
|
665
|
-
* callable from any agent's `
|
|
665
|
+
* callable from any agent's `tools` list without a yaml
|
|
666
666
|
* edit + restart.
|
|
667
667
|
*
|
|
668
668
|
* Operator-admin-only: this endpoint requires the bearer token.
|
|
@@ -882,16 +882,26 @@ class LoomcycleClient {
|
|
|
882
882
|
*
|
|
883
883
|
* Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
|
|
884
884
|
* path, rm of a non-empty path without recursive, etc.);
|
|
885
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
885
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
886
|
+
*
|
|
887
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides
|
|
888
|
+
* (sent as `?scope_id=` / `?tenant=` query params — the server reads them
|
|
889
|
+
* from the URL, not the body, and re-checks authorization: a tenant
|
|
890
|
+
* principal's `tenant` is ignored, `scopeId` picks any subject it may see).
|
|
891
|
+
* Omit both to browse your own subject (byte-identical to the pre-RFC-AS
|
|
892
|
+
* request). */
|
|
886
893
|
async path(input, opts) {
|
|
887
|
-
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_path", input,
|
|
894
|
+
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_path", input, {
|
|
895
|
+
signal: opts?.signal,
|
|
896
|
+
query: browseQuery(opts),
|
|
897
|
+
});
|
|
888
898
|
}
|
|
889
899
|
/** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
|
|
890
900
|
* chunked-graph document where each chunk is a first-class unit (UUID,
|
|
891
901
|
* hierarchy, type, fields, graph edges, Markdown body) that agents and
|
|
892
|
-
* humans co-author. Op-discriminated (
|
|
893
|
-
* edges, query_chunks, type defs). Scope
|
|
894
|
-
* resolved server-side from the principal.
|
|
902
|
+
* humans co-author. Op-discriminated (16 ops: document/chunk lifecycle,
|
|
903
|
+
* set_path, edges, query_chunks, type defs, export_md/import_md). Scope
|
|
904
|
+
* agent/user (tenant deferred); resolved server-side from the principal.
|
|
895
905
|
*
|
|
896
906
|
* Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
|
|
897
907
|
* — the chunk-structure tables live there. Without it the call is refused
|
|
@@ -899,9 +909,15 @@ class LoomcycleClient {
|
|
|
899
909
|
*
|
|
900
910
|
* Response varies per op — `create_document` returns
|
|
901
911
|
* `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
|
|
902
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
912
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
913
|
+
*
|
|
914
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides —
|
|
915
|
+
* see {@link LoomcycleClient.path}. Omit both to browse your own subject. */
|
|
903
916
|
async document(input, opts) {
|
|
904
|
-
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_document", input,
|
|
917
|
+
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/_document", input, {
|
|
918
|
+
signal: opts?.signal,
|
|
919
|
+
query: browseQuery(opts),
|
|
920
|
+
});
|
|
905
921
|
}
|
|
906
922
|
/** List the PERSISTENT volume universe for the caller's tenant — every
|
|
907
923
|
* static volume (the shared bind floor, `source: "static"`, read-only)
|
|
@@ -1509,6 +1525,19 @@ function channelOpPath(channel, scope, userId, op) {
|
|
|
1509
1525
|
}
|
|
1510
1526
|
return `/v1/_channels/${enc}/${op}`;
|
|
1511
1527
|
}
|
|
1528
|
+
// browseQuery maps the RFC AS browse-by-subject opts to the wire query-param
|
|
1529
|
+
// names the off-run Path/Document endpoints read from the URL (scope_id /
|
|
1530
|
+
// tenant — matching web/src/api.ts:substratePost). Only set values are
|
|
1531
|
+
// included; postJSON drops the query entirely when the map is empty, so a
|
|
1532
|
+
// caller passing neither builds the same URL as before RFC AS.
|
|
1533
|
+
function browseQuery(opts) {
|
|
1534
|
+
const q = {};
|
|
1535
|
+
if (opts?.scopeId)
|
|
1536
|
+
q.scope_id = opts.scopeId;
|
|
1537
|
+
if (opts?.tenant)
|
|
1538
|
+
q.tenant = opts.tenant;
|
|
1539
|
+
return q;
|
|
1540
|
+
}
|
|
1512
1541
|
// ---- v0.11.0 LLM Gateway helpers ----
|
|
1513
1542
|
/** serializeLLMOptions strips the AbortSignal (transport concern) and
|
|
1514
1543
|
* forces the stream flag to match the call mode. */
|
|
@@ -28,6 +28,21 @@ function authHeaders(ctx) {
|
|
|
28
28
|
h.Authorization = `Bearer ${ctx.authToken}`;
|
|
29
29
|
return h;
|
|
30
30
|
}
|
|
31
|
+
/** queryString turns an optional param map into a leading-`?` query
|
|
32
|
+
* string, dropping empty-valued entries. Returns "" for an absent or
|
|
33
|
+
* all-empty map so a caller that passes no query builds the same URL as
|
|
34
|
+
* before. Insertion order is preserved (URLSearchParams is stable). */
|
|
35
|
+
function queryString(query) {
|
|
36
|
+
if (!query)
|
|
37
|
+
return "";
|
|
38
|
+
const qs = new URLSearchParams();
|
|
39
|
+
for (const [k, v] of Object.entries(query)) {
|
|
40
|
+
if (v)
|
|
41
|
+
qs.set(k, v);
|
|
42
|
+
}
|
|
43
|
+
const s = qs.toString();
|
|
44
|
+
return s ? `?${s}` : "";
|
|
45
|
+
}
|
|
31
46
|
/** jsonFetch performs a GET and unwraps the JSON body. Non-2xx
|
|
32
47
|
* status maps to a typed error via raiseFromResponse. */
|
|
33
48
|
async function jsonFetch(ctx, path, opts) {
|
|
@@ -43,7 +58,9 @@ async function jsonFetch(ctx, path, opts) {
|
|
|
43
58
|
}
|
|
44
59
|
/** postJSON sends a JSON-encoded body and unwraps the response.
|
|
45
60
|
* When `body` is undefined, no body is sent (Content-Type
|
|
46
|
-
* omitted).
|
|
61
|
+
* omitted). `opts.query` appends URL query params (empty-valued
|
|
62
|
+
* entries are dropped; an all-empty/absent map yields no `?`, so
|
|
63
|
+
* existing callers produce a byte-identical URL). */
|
|
47
64
|
async function postJSON(ctx, path, body, opts) {
|
|
48
65
|
const headers = authHeaders(ctx);
|
|
49
66
|
let bodyStr;
|
|
@@ -51,7 +68,7 @@ async function postJSON(ctx, path, body, opts) {
|
|
|
51
68
|
headers["Content-Type"] = "application/json";
|
|
52
69
|
bodyStr = JSON.stringify(body);
|
|
53
70
|
}
|
|
54
|
-
const resp = await ctx.fetchImpl(ctx.baseUrl + path, {
|
|
71
|
+
const resp = await ctx.fetchImpl(ctx.baseUrl + path + queryString(opts?.query), {
|
|
55
72
|
method: "POST",
|
|
56
73
|
headers,
|
|
57
74
|
body: bodyStr,
|
package/dist/client.d.ts
CHANGED
|
@@ -419,7 +419,7 @@ export declare class LoomcycleClient {
|
|
|
419
419
|
/** Invoke the v0.9.x MCPServerDef substrate tool over HTTP.
|
|
420
420
|
* Dynamic MCP server registration — register an HTTP /
|
|
421
421
|
* Streamable-HTTP MCP server at runtime so its tools become
|
|
422
|
-
* callable from any agent's `
|
|
422
|
+
* callable from any agent's `tools` list without a yaml
|
|
423
423
|
* edit + restart.
|
|
424
424
|
*
|
|
425
425
|
* Operator-admin-only: this endpoint requires the bearer token.
|
|
@@ -608,16 +608,25 @@ export declare class LoomcycleClient {
|
|
|
608
608
|
*
|
|
609
609
|
* Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
|
|
610
610
|
* path, rm of a non-empty path without recursive, etc.);
|
|
611
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
611
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
612
|
+
*
|
|
613
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides
|
|
614
|
+
* (sent as `?scope_id=` / `?tenant=` query params — the server reads them
|
|
615
|
+
* from the URL, not the body, and re-checks authorization: a tenant
|
|
616
|
+
* principal's `tenant` is ignored, `scopeId` picks any subject it may see).
|
|
617
|
+
* Omit both to browse your own subject (byte-identical to the pre-RFC-AS
|
|
618
|
+
* request). */
|
|
612
619
|
path(input: PathToolInput, opts?: {
|
|
613
620
|
signal?: AbortSignal;
|
|
621
|
+
scopeId?: string;
|
|
622
|
+
tenant?: string;
|
|
614
623
|
}): Promise<PathToolResponse>;
|
|
615
624
|
/** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
|
|
616
625
|
* chunked-graph document where each chunk is a first-class unit (UUID,
|
|
617
626
|
* hierarchy, type, fields, graph edges, Markdown body) that agents and
|
|
618
|
-
* humans co-author. Op-discriminated (
|
|
619
|
-
* edges, query_chunks, type defs). Scope
|
|
620
|
-
* resolved server-side from the principal.
|
|
627
|
+
* humans co-author. Op-discriminated (16 ops: document/chunk lifecycle,
|
|
628
|
+
* set_path, edges, query_chunks, type defs, export_md/import_md). Scope
|
|
629
|
+
* agent/user (tenant deferred); resolved server-side from the principal.
|
|
621
630
|
*
|
|
622
631
|
* Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
|
|
623
632
|
* — the chunk-structure tables live there. Without it the call is refused
|
|
@@ -625,9 +634,14 @@ export declare class LoomcycleClient {
|
|
|
625
634
|
*
|
|
626
635
|
* Response varies per op — `create_document` returns
|
|
627
636
|
* `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
|
|
628
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
637
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
638
|
+
*
|
|
639
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides —
|
|
640
|
+
* see {@link LoomcycleClient.path}. Omit both to browse your own subject. */
|
|
629
641
|
document(input: DocumentToolInput, opts?: {
|
|
630
642
|
signal?: AbortSignal;
|
|
643
|
+
scopeId?: string;
|
|
644
|
+
tenant?: string;
|
|
631
645
|
}): Promise<DocumentToolResponse>;
|
|
632
646
|
/** List the PERSISTENT volume universe for the caller's tenant — every
|
|
633
647
|
* static volume (the shared bind floor, `source: "static"`, read-only)
|
package/dist/client.js
CHANGED
|
@@ -74,8 +74,8 @@ function runBody(opts) {
|
|
|
74
74
|
agent: opts.agent,
|
|
75
75
|
segments: opts.segments,
|
|
76
76
|
};
|
|
77
|
-
if (opts.
|
|
78
|
-
body.
|
|
77
|
+
if (opts.tools !== undefined)
|
|
78
|
+
body.tools = opts.tools;
|
|
79
79
|
if (opts.allowedHosts !== undefined && opts.allowedHosts !== null) {
|
|
80
80
|
body.allowed_hosts = opts.allowedHosts;
|
|
81
81
|
}
|
|
@@ -164,8 +164,8 @@ export class LoomcycleClient {
|
|
|
164
164
|
const body = {
|
|
165
165
|
segments: opts.segments,
|
|
166
166
|
};
|
|
167
|
-
if (opts.
|
|
168
|
-
body.
|
|
167
|
+
if (opts.tools !== undefined)
|
|
168
|
+
body.tools = opts.tools;
|
|
169
169
|
if (opts.allowedHosts !== undefined && opts.allowedHosts !== null) {
|
|
170
170
|
body.allowed_hosts = opts.allowedHosts;
|
|
171
171
|
}
|
|
@@ -632,8 +632,8 @@ export class LoomcycleClient {
|
|
|
632
632
|
* stable and dedup engages on re-register. */
|
|
633
633
|
async ensureCodeAgent(opts, callOpts) {
|
|
634
634
|
const overlay = { provider: "code-js", code_body: opts.code };
|
|
635
|
-
if (opts.
|
|
636
|
-
overlay.
|
|
635
|
+
if (opts.tools)
|
|
636
|
+
overlay.tools = opts.tools;
|
|
637
637
|
if (opts.tier)
|
|
638
638
|
overlay.tier = opts.tier;
|
|
639
639
|
if (opts.model)
|
|
@@ -659,7 +659,7 @@ export class LoomcycleClient {
|
|
|
659
659
|
/** Invoke the v0.9.x MCPServerDef substrate tool over HTTP.
|
|
660
660
|
* Dynamic MCP server registration — register an HTTP /
|
|
661
661
|
* Streamable-HTTP MCP server at runtime so its tools become
|
|
662
|
-
* callable from any agent's `
|
|
662
|
+
* callable from any agent's `tools` list without a yaml
|
|
663
663
|
* edit + restart.
|
|
664
664
|
*
|
|
665
665
|
* Operator-admin-only: this endpoint requires the bearer token.
|
|
@@ -879,16 +879,26 @@ export class LoomcycleClient {
|
|
|
879
879
|
*
|
|
880
880
|
* Raises {@link SubstrateToolRefusedError} on tool-level refusals (bad
|
|
881
881
|
* path, rm of a non-empty path without recursive, etc.);
|
|
882
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
882
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
883
|
+
*
|
|
884
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides
|
|
885
|
+
* (sent as `?scope_id=` / `?tenant=` query params — the server reads them
|
|
886
|
+
* from the URL, not the body, and re-checks authorization: a tenant
|
|
887
|
+
* principal's `tenant` is ignored, `scopeId` picks any subject it may see).
|
|
888
|
+
* Omit both to browse your own subject (byte-identical to the pre-RFC-AS
|
|
889
|
+
* request). */
|
|
883
890
|
async path(input, opts) {
|
|
884
|
-
return postJSON(this.ctx, "/v1/_path", input,
|
|
891
|
+
return postJSON(this.ctx, "/v1/_path", input, {
|
|
892
|
+
signal: opts?.signal,
|
|
893
|
+
query: browseQuery(opts),
|
|
894
|
+
});
|
|
885
895
|
}
|
|
886
896
|
/** Invoke the RFC AK Document tool over HTTP (`POST /v1/_document`). A
|
|
887
897
|
* chunked-graph document where each chunk is a first-class unit (UUID,
|
|
888
898
|
* hierarchy, type, fields, graph edges, Markdown body) that agents and
|
|
889
|
-
* humans co-author. Op-discriminated (
|
|
890
|
-
* edges, query_chunks, type defs). Scope
|
|
891
|
-
* resolved server-side from the principal.
|
|
899
|
+
* humans co-author. Op-discriminated (16 ops: document/chunk lifecycle,
|
|
900
|
+
* set_path, edges, query_chunks, type defs, export_md/import_md). Scope
|
|
901
|
+
* agent/user (tenant deferred); resolved server-side from the principal.
|
|
892
902
|
*
|
|
893
903
|
* Requires SQL Memory enabled on the sidecar (`LOOMCYCLE_SQLMEM_ENABLED=1`)
|
|
894
904
|
* — the chunk-structure tables live there. Without it the call is refused
|
|
@@ -896,9 +906,15 @@ export class LoomcycleClient {
|
|
|
896
906
|
*
|
|
897
907
|
* Response varies per op — `create_document` returns
|
|
898
908
|
* `{document_id, root_chunk_id, ...}`, `query_chunks` returns rows.
|
|
899
|
-
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
909
|
+
* {@link InvalidArgumentError} on 400; {@link AuthError} on 401.
|
|
910
|
+
*
|
|
911
|
+
* `opts.scopeId` / `opts.tenant` are the RFC AS browse-by-subject overrides —
|
|
912
|
+
* see {@link LoomcycleClient.path}. Omit both to browse your own subject. */
|
|
900
913
|
async document(input, opts) {
|
|
901
|
-
return postJSON(this.ctx, "/v1/_document", input,
|
|
914
|
+
return postJSON(this.ctx, "/v1/_document", input, {
|
|
915
|
+
signal: opts?.signal,
|
|
916
|
+
query: browseQuery(opts),
|
|
917
|
+
});
|
|
902
918
|
}
|
|
903
919
|
/** List the PERSISTENT volume universe for the caller's tenant — every
|
|
904
920
|
* static volume (the shared bind floor, `source: "static"`, read-only)
|
|
@@ -1505,6 +1521,19 @@ function channelOpPath(channel, scope, userId, op) {
|
|
|
1505
1521
|
}
|
|
1506
1522
|
return `/v1/_channels/${enc}/${op}`;
|
|
1507
1523
|
}
|
|
1524
|
+
// browseQuery maps the RFC AS browse-by-subject opts to the wire query-param
|
|
1525
|
+
// names the off-run Path/Document endpoints read from the URL (scope_id /
|
|
1526
|
+
// tenant — matching web/src/api.ts:substratePost). Only set values are
|
|
1527
|
+
// included; postJSON drops the query entirely when the map is empty, so a
|
|
1528
|
+
// caller passing neither builds the same URL as before RFC AS.
|
|
1529
|
+
function browseQuery(opts) {
|
|
1530
|
+
const q = {};
|
|
1531
|
+
if (opts?.scopeId)
|
|
1532
|
+
q.scope_id = opts.scopeId;
|
|
1533
|
+
if (opts?.tenant)
|
|
1534
|
+
q.tenant = opts.tenant;
|
|
1535
|
+
return q;
|
|
1536
|
+
}
|
|
1508
1537
|
// ---- v0.11.0 LLM Gateway helpers ----
|
|
1509
1538
|
/** serializeLLMOptions strips the AbortSignal (transport concern) and
|
|
1510
1539
|
* forces the stream flag to match the call mode. */
|
package/dist/fetch-helpers.d.ts
CHANGED
|
@@ -39,9 +39,12 @@ export declare function jsonFetch<T>(ctx: _FetchContext, path: string, opts?: {
|
|
|
39
39
|
}): Promise<T>;
|
|
40
40
|
/** postJSON sends a JSON-encoded body and unwraps the response.
|
|
41
41
|
* When `body` is undefined, no body is sent (Content-Type
|
|
42
|
-
* omitted).
|
|
42
|
+
* omitted). `opts.query` appends URL query params (empty-valued
|
|
43
|
+
* entries are dropped; an all-empty/absent map yields no `?`, so
|
|
44
|
+
* existing callers produce a byte-identical URL). */
|
|
43
45
|
export declare function postJSON<T>(ctx: _FetchContext, path: string, body?: unknown, opts?: {
|
|
44
46
|
signal?: AbortSignal;
|
|
47
|
+
query?: Record<string, string>;
|
|
45
48
|
}): Promise<T>;
|
|
46
49
|
/** putJSON sends a JSON-encoded body via PUT and unwraps the
|
|
47
50
|
* response. Idempotent — REST-canonical verb for "create or
|
package/dist/fetch-helpers.js
CHANGED
|
@@ -19,6 +19,21 @@ export function authHeaders(ctx) {
|
|
|
19
19
|
h.Authorization = `Bearer ${ctx.authToken}`;
|
|
20
20
|
return h;
|
|
21
21
|
}
|
|
22
|
+
/** queryString turns an optional param map into a leading-`?` query
|
|
23
|
+
* string, dropping empty-valued entries. Returns "" for an absent or
|
|
24
|
+
* all-empty map so a caller that passes no query builds the same URL as
|
|
25
|
+
* before. Insertion order is preserved (URLSearchParams is stable). */
|
|
26
|
+
function queryString(query) {
|
|
27
|
+
if (!query)
|
|
28
|
+
return "";
|
|
29
|
+
const qs = new URLSearchParams();
|
|
30
|
+
for (const [k, v] of Object.entries(query)) {
|
|
31
|
+
if (v)
|
|
32
|
+
qs.set(k, v);
|
|
33
|
+
}
|
|
34
|
+
const s = qs.toString();
|
|
35
|
+
return s ? `?${s}` : "";
|
|
36
|
+
}
|
|
22
37
|
/** jsonFetch performs a GET and unwraps the JSON body. Non-2xx
|
|
23
38
|
* status maps to a typed error via raiseFromResponse. */
|
|
24
39
|
export async function jsonFetch(ctx, path, opts) {
|
|
@@ -34,7 +49,9 @@ export async function jsonFetch(ctx, path, opts) {
|
|
|
34
49
|
}
|
|
35
50
|
/** postJSON sends a JSON-encoded body and unwraps the response.
|
|
36
51
|
* When `body` is undefined, no body is sent (Content-Type
|
|
37
|
-
* omitted).
|
|
52
|
+
* omitted). `opts.query` appends URL query params (empty-valued
|
|
53
|
+
* entries are dropped; an all-empty/absent map yields no `?`, so
|
|
54
|
+
* existing callers produce a byte-identical URL). */
|
|
38
55
|
export async function postJSON(ctx, path, body, opts) {
|
|
39
56
|
const headers = authHeaders(ctx);
|
|
40
57
|
let bodyStr;
|
|
@@ -42,7 +59,7 @@ export async function postJSON(ctx, path, body, opts) {
|
|
|
42
59
|
headers["Content-Type"] = "application/json";
|
|
43
60
|
bodyStr = JSON.stringify(body);
|
|
44
61
|
}
|
|
45
|
-
const resp = await ctx.fetchImpl(ctx.baseUrl + path, {
|
|
62
|
+
const resp = await ctx.fetchImpl(ctx.baseUrl + path + queryString(opts?.query), {
|
|
46
63
|
method: "POST",
|
|
47
64
|
headers,
|
|
48
65
|
body: bodyStr,
|
package/dist/types.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ export interface PromptSegment {
|
|
|
138
138
|
export interface RunOptions {
|
|
139
139
|
agent: string;
|
|
140
140
|
segments: PromptSegment[];
|
|
141
|
-
|
|
141
|
+
tools?: string[];
|
|
142
142
|
/** Per-request URL allowlist (v0.3.3+). Three-state on the wire:
|
|
143
143
|
* - omitted / `undefined` — no narrowing (operator's static list applies).
|
|
144
144
|
* - `null` — same as omitted (pass-through; convenience for callers
|
|
@@ -288,7 +288,7 @@ export interface ContinueOptions {
|
|
|
288
288
|
/** Required — the session to continue. */
|
|
289
289
|
sessionId: string;
|
|
290
290
|
segments: PromptSegment[];
|
|
291
|
-
|
|
291
|
+
tools?: string[];
|
|
292
292
|
/** Per-call URL allowlist. Same three-state semantics as
|
|
293
293
|
* RunOptions.allowedHosts — continuations re-supply the list each
|
|
294
294
|
* time rather than inheriting from the seed run. */
|
|
@@ -817,10 +817,10 @@ export type PathToolInput = {
|
|
|
817
817
|
[extra: string]: unknown;
|
|
818
818
|
};
|
|
819
819
|
/** Input for {@link LoomcycleClient.document} — the RFC AK chunked-graph
|
|
820
|
-
* Document tool (POST /v1/_document). Op-discriminated (
|
|
820
|
+
* Document tool (POST /v1/_document). Op-discriminated (16 ops); requires
|
|
821
821
|
* SQL Memory on the sidecar. Scope agent/user (tenant deferred). */
|
|
822
822
|
export type DocumentToolInput = {
|
|
823
|
-
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";
|
|
823
|
+
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";
|
|
824
824
|
scope?: "agent" | "user";
|
|
825
825
|
/** Document id (get/delete_document) or chunk id (get/update/delete/move_chunk). */
|
|
826
826
|
id?: string;
|
|
@@ -847,6 +847,14 @@ export type DocumentToolInput = {
|
|
|
847
847
|
limit?: number;
|
|
848
848
|
/** define/list_types: the type name. */
|
|
849
849
|
name?: string;
|
|
850
|
+
/** export_md: embed round-trippable chunk metadata + edges as HTML comments
|
|
851
|
+
* (default true server-side). false = clean human-facing Markdown. */
|
|
852
|
+
include_metadata?: boolean;
|
|
853
|
+
/** import_md: an export_md-shaped Markdown document (headings = hierarchy;
|
|
854
|
+
* `<!-- loom: ... -->` metadata; `<!-- loom-edges: ... -->` trailer). Omit
|
|
855
|
+
* document_id to create a new document; pass it (+ optional parent_id) to
|
|
856
|
+
* import under an existing chunk. */
|
|
857
|
+
markdown?: string;
|
|
850
858
|
[extra: string]: unknown;
|
|
851
859
|
};
|
|
852
860
|
/** Response shape for {@link LoomcycleClient.path} and
|
|
@@ -1254,7 +1262,7 @@ export interface AgentDefVerifyResult {
|
|
|
1254
1262
|
}
|
|
1255
1263
|
/** Response shape for `SkillDef verify`. Same semantics as
|
|
1256
1264
|
* AgentDefVerifyResult; the per-skill content basis is just
|
|
1257
|
-
* smaller (name + description + body +
|
|
1265
|
+
* smaller (name + description + body + tools). */
|
|
1258
1266
|
export interface SkillDefVerifyResult {
|
|
1259
1267
|
matches: boolean;
|
|
1260
1268
|
current_sha256: string;
|
|
@@ -1367,7 +1375,7 @@ export interface AgentDefOverlay {
|
|
|
1367
1375
|
max_iterations?: number;
|
|
1368
1376
|
max_concurrent_children?: number;
|
|
1369
1377
|
system_prompt?: string;
|
|
1370
|
-
|
|
1378
|
+
tools?: string[];
|
|
1371
1379
|
skills?: string[];
|
|
1372
1380
|
memory_scopes?: string[];
|
|
1373
1381
|
memory_quota_bytes?: number;
|
|
@@ -1392,8 +1400,8 @@ export interface EnsureCodeAgentOptions {
|
|
|
1392
1400
|
* is stable across restarts — that's what lets loomcycle dedup the
|
|
1393
1401
|
* re-registration. */
|
|
1394
1402
|
code: string;
|
|
1395
|
-
/** The agent's
|
|
1396
|
-
|
|
1403
|
+
/** The agent's tools ceiling (must be a subset of the caller's). */
|
|
1404
|
+
tools?: string[];
|
|
1397
1405
|
/** Per-user tier policy name (mutually exclusive with `model` in practice). */
|
|
1398
1406
|
tier?: string;
|
|
1399
1407
|
/** Pin a concrete model id (overrides tier resolution). */
|
|
@@ -1437,7 +1445,7 @@ export interface LibraryAgentDefinition {
|
|
|
1437
1445
|
max_iterations?: number;
|
|
1438
1446
|
system_prompt?: string;
|
|
1439
1447
|
system_prompt_base?: string;
|
|
1440
|
-
|
|
1448
|
+
tools?: string[];
|
|
1441
1449
|
skills?: string[];
|
|
1442
1450
|
providers?: string[];
|
|
1443
1451
|
/** Per-tier candidate list. Server-side opaque shape — kept as
|
|
@@ -1450,12 +1458,12 @@ export interface LibraryAgentDefinition {
|
|
|
1450
1458
|
export interface LibrarySkillDefinition {
|
|
1451
1459
|
body?: string;
|
|
1452
1460
|
description?: string;
|
|
1453
|
-
|
|
1461
|
+
tools?: string[];
|
|
1454
1462
|
}
|
|
1455
1463
|
/** Static-side MCP server definition body. Mirrors
|
|
1456
1464
|
* internal/api/http.marshalStaticMCPServer (transport + url + headers
|
|
1457
1465
|
* for http/streamable-http; command/args/env/pool_size for stdio;
|
|
1458
|
-
*
|
|
1466
|
+
* tools narrowing; discovered_tools cached from the pool
|
|
1459
1467
|
* inspector when ready). */
|
|
1460
1468
|
export interface LibraryMcpServerDefinition {
|
|
1461
1469
|
transport?: "http" | "streamable-http" | "stdio";
|
|
@@ -1465,7 +1473,7 @@ export interface LibraryMcpServerDefinition {
|
|
|
1465
1473
|
args?: string[];
|
|
1466
1474
|
env?: Record<string, string>;
|
|
1467
1475
|
pool_size?: number;
|
|
1468
|
-
|
|
1476
|
+
tools?: string[];
|
|
1469
1477
|
/** Substrate-mirror shape of the pool's PeekTools snapshot.
|
|
1470
1478
|
* Omitted when the pool inspector returns nil (init pending or
|
|
1471
1479
|
* failed) — re-check after pool init completes. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcycle/client",
|
|
3
|
-
"version": "1.
|
|
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).",
|
|
3
|
+
"version": "1.13.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). 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.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|