@loomcycle/client 1.96.0 → 1.97.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 +13 -20
- package/dist/cjs/client.js +0 -49
- package/dist/cjs/errors.js +1 -12
- package/dist/cjs/fetch-helpers.js +0 -6
- package/dist/cjs/index.js +1 -2
- package/dist/client.d.ts +1 -30
- package/dist/client.js +0 -49
- package/dist/errors.d.ts +0 -10
- package/dist/errors.js +0 -10
- package/dist/fetch-helpers.d.ts +0 -1
- package/dist/fetch-helpers.js +1 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types.d.ts +32 -55
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -197,30 +197,23 @@ console.log(`restored memory rows: ${result.memory_restored}`);
|
|
|
197
197
|
|
|
198
198
|
| Method | Returns | Notes |
|
|
199
199
|
|---|---|---|
|
|
200
|
-
| `
|
|
201
|
-
| `listHooks()` | `Promise<Hook[]>` | Every registered hook. **In-memory only — empty after a loomcycle restart.** |
|
|
202
|
-
| `deleteHook(id)` | `Promise<void>` | Raises `HookNotFoundError` on 404. |
|
|
200
|
+
| `hookDef(input)` | `Promise<SubstrateToolResponse>` | Reusable hook definitions (create / fork / get / list / promote / retire / verify / delete). An agent attaches hooks in its own definition (`tools` entries `{name, hooks}` and `hooks`). |
|
|
203
201
|
|
|
204
|
-
|
|
202
|
+
A hook is attached in the agent's definition — a tool entry `{name, hooks}` or the agent's own `hooks` — and loomcycle posts to its URL during the agent's runs. The other side is the **callback receiver**, a small HTTP endpoint your app runs at that URL. The adapter exports the wire shapes (`PreHookCall` / `PostHookCall` / `PreHookResult` / `PostHookResult`) so you can type the handler against the same JSON loomcycle posts.
|
|
205
203
|
|
|
206
|
-
**
|
|
204
|
+
**Attach it in the agent's definition:**
|
|
207
205
|
|
|
208
206
|
```ts
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
phase: "post", // "pre" or "post"
|
|
220
|
-
tools: ["WebFetch"], // empty/omitted = all tools
|
|
221
|
-
callbackUrl: "https://jobember.example/hooks/scan",
|
|
222
|
-
failMode: "open", // "open" = errors pass through; "closed" = errors fail the tool call
|
|
223
|
-
timeoutMs: 3000, // 0 = registry default (5s)
|
|
207
|
+
await client.agentDef({
|
|
208
|
+
op: "fork",
|
|
209
|
+
name: "researcher",
|
|
210
|
+
overlay: {
|
|
211
|
+
tools: [
|
|
212
|
+
"Read",
|
|
213
|
+
{ name: "WebFetch", hooks: { post: [{ name: "scan-webfetch", url: "https://jobember.example/hooks/scan", fail_mode: "open", timeout_ms: 3000 }] } },
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
promote: true,
|
|
224
217
|
});
|
|
225
218
|
```
|
|
226
219
|
|
package/dist/cjs/client.js
CHANGED
|
@@ -1115,55 +1115,6 @@ class LoomcycleClient {
|
|
|
1115
1115
|
signal: opts?.signal,
|
|
1116
1116
|
});
|
|
1117
1117
|
}
|
|
1118
|
-
// ---- Hook management (hooks-connector series, PR C) ----
|
|
1119
|
-
/** Register a pre- or post-tool hook. Its body is a webhook — the
|
|
1120
|
-
* callback_url must be an http:// or https:// endpoint the CONSUMER
|
|
1121
|
-
* runs; loomcycle POSTs PreHookCall / PostHookCall payloads to it —
|
|
1122
|
-
* or a code-js body (`code`), run in-process by loomcycle. Set
|
|
1123
|
-
* exactly one. This method manages registration only; a webhook's
|
|
1124
|
-
* receiver is the consumer's own HTTP framework (Express, Next.js,
|
|
1125
|
-
* etc.).
|
|
1126
|
-
*
|
|
1127
|
-
* Re-registering the same (owner, name) replaces the prior entry
|
|
1128
|
-
* with a fresh id (idempotent app-restart contract).
|
|
1129
|
-
*
|
|
1130
|
-
* Raises InvalidArgumentError on 400 (bad URL / phase / missing
|
|
1131
|
-
* required fields). */
|
|
1132
|
-
async registerHook(opts) {
|
|
1133
|
-
const body = {
|
|
1134
|
-
owner: opts.owner,
|
|
1135
|
-
name: opts.name,
|
|
1136
|
-
phase: opts.phase,
|
|
1137
|
-
};
|
|
1138
|
-
if (opts.callbackUrl !== undefined)
|
|
1139
|
-
body.callback_url = opts.callbackUrl;
|
|
1140
|
-
if (opts.code !== undefined)
|
|
1141
|
-
body.code = opts.code;
|
|
1142
|
-
if (opts.agents !== undefined)
|
|
1143
|
-
body.agents = opts.agents;
|
|
1144
|
-
if (opts.tools !== undefined)
|
|
1145
|
-
body.tools = opts.tools;
|
|
1146
|
-
if (opts.failMode !== undefined)
|
|
1147
|
-
body.fail_mode = opts.failMode;
|
|
1148
|
-
if (opts.timeoutMs !== undefined && opts.timeoutMs > 0) {
|
|
1149
|
-
body.timeout_ms = opts.timeoutMs;
|
|
1150
|
-
}
|
|
1151
|
-
return (0, fetch_helpers_js_1.postJSON)(this.ctx, "/v1/hooks", body, opts);
|
|
1152
|
-
}
|
|
1153
|
-
/** List every currently-registered hook. Returns the array
|
|
1154
|
-
* unwrapped (the wire envelope is `{hooks: [...]}` — we strip
|
|
1155
|
-
* the envelope to match listUserAgents). In-memory only — empty
|
|
1156
|
-
* after a loomcycle restart. */
|
|
1157
|
-
async listHooks(opts) {
|
|
1158
|
-
const resp = await (0, fetch_helpers_js_1.jsonFetch)(this.ctx, "/v1/hooks", opts);
|
|
1159
|
-
return resp.hooks ?? [];
|
|
1160
|
-
}
|
|
1161
|
-
/** Delete a registered hook by id. Raises HookNotFoundError on
|
|
1162
|
-
* 404. Returns void on success (the HTTP 200 body `{deleted: id}`
|
|
1163
|
-
* is dropped — callers already know the id they passed). */
|
|
1164
|
-
async deleteHook(id, opts) {
|
|
1165
|
-
await (0, fetch_helpers_js_1.deleteRequest)(this.ctx, `/v1/hooks/${encodeURIComponent(id)}`, opts);
|
|
1166
|
-
}
|
|
1167
1118
|
// ---- v0.8.22 substrate admin (AgentDef + SkillDef) ----
|
|
1168
1119
|
/** Invoke the AgentDef substrate tool over HTTP. Mirrors the
|
|
1169
1120
|
* MCP `agentdef` meta-tool and the in-band agent tool_use of
|
package/dist/cjs/errors.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* to raise typed errors via `raiseFromResponse`.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.SubstrateToolRefusedError = exports.ChannelCursorRegressionError = exports.
|
|
22
|
+
exports.SubstrateToolRefusedError = exports.ChannelCursorRegressionError = exports.SnapshotVersionError = exports.SnapshotTooLargeError = exports.SnapshotNotFoundError = exports.NotPausedError = exports.AlreadyPausingError = exports.PauseNotConfiguredError = exports.InvalidArgumentError = exports.UnavailableError = exports.AuthError = exports.PerUserQuotaExhaustedError = exports.BackpressureError = exports.AgentIDInUseError = exports.SessionBusyError = exports.SessionNotFoundError = exports.AgentNotFoundError = exports.NotFoundError = exports.LoomcycleError = void 0;
|
|
23
23
|
class LoomcycleError extends Error {
|
|
24
24
|
status;
|
|
25
25
|
bodyText;
|
|
@@ -196,17 +196,6 @@ class SnapshotVersionError extends LoomcycleError {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
exports.SnapshotVersionError = SnapshotVersionError;
|
|
199
|
-
/** HookNotFoundError — raised by deleteHook when no hook has the
|
|
200
|
-
* supplied id (HTTP 404 with "hook" in the body). Extends
|
|
201
|
-
* NotFoundError so consumers catching the broader category get this
|
|
202
|
-
* one too. */
|
|
203
|
-
class HookNotFoundError extends NotFoundError {
|
|
204
|
-
constructor(message, opts) {
|
|
205
|
-
super(message, opts);
|
|
206
|
-
this.name = "HookNotFoundError";
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
exports.HookNotFoundError = HookNotFoundError;
|
|
210
199
|
/** ChannelCursorRegressionError — raised by `client.ackChannel()`
|
|
211
200
|
* when the caller-supplied cursor is older than the currently-
|
|
212
201
|
* committed cursor for the (channel, scope, scope_id) tuple. HTTP
|
|
@@ -169,7 +169,6 @@ async function deleteJSON(ctx, path, opts) {
|
|
|
169
169
|
* 401 → AuthError
|
|
170
170
|
* 404 + "snapshot" → SnapshotNotFoundError ────────┐
|
|
171
171
|
* 404 + "session" → SessionNotFoundError │ All extend
|
|
172
|
-
* 404 + "hook" → HookNotFoundError │ NotFoundError —
|
|
173
172
|
* 404 + "agent" → AgentNotFoundError │ callers can
|
|
174
173
|
* 404 + (other) → NotFoundError (base) │ catch any 404
|
|
175
174
|
* │ with one
|
|
@@ -223,9 +222,6 @@ async function raiseFromResponse(resp) {
|
|
|
223
222
|
// Priority: most-specific keyword wins.
|
|
224
223
|
// - "snapshot" → SnapshotNotFoundError
|
|
225
224
|
// - "session" → SessionNotFoundError
|
|
226
|
-
// - "hook" → HookNotFoundError (must precede "agent" — the
|
|
227
|
-
// hooks 404 body is `no hook with id "..."`,
|
|
228
|
-
// doesn't mention "agent")
|
|
229
225
|
// - "agent" or "agent_id" → AgentNotFoundError
|
|
230
226
|
// - otherwise → NotFoundError (base) — e.g. memory rows, interrupts,
|
|
231
227
|
// or any future 404-returning endpoint that doesn't fit the
|
|
@@ -234,8 +230,6 @@ async function raiseFromResponse(resp) {
|
|
|
234
230
|
throw new errors_js_1.SnapshotNotFoundError(msg, opts);
|
|
235
231
|
if (bodyLower.includes("session"))
|
|
236
232
|
throw new errors_js_1.SessionNotFoundError(msg, opts);
|
|
237
|
-
if (bodyLower.includes("hook"))
|
|
238
|
-
throw new errors_js_1.HookNotFoundError(msg, opts);
|
|
239
233
|
if (bodyLower.includes("agent"))
|
|
240
234
|
throw new errors_js_1.AgentNotFoundError(msg, opts);
|
|
241
235
|
throw new errors_js_1.NotFoundError(msg, opts);
|
package/dist/cjs/index.js
CHANGED
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
* See `adapters/ts/README.md` for usage examples.
|
|
126
126
|
*/
|
|
127
127
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128
|
-
exports.UnavailableError = exports.SubstrateToolRefusedError = exports.SnapshotVersionError = exports.SnapshotTooLargeError = exports.SnapshotNotFoundError = exports.SessionNotFoundError = exports.SessionBusyError = exports.PerUserQuotaExhaustedError = exports.PauseNotConfiguredError = exports.NotPausedError = exports.LoomcycleError = exports.ChannelCursorRegressionError = exports.InvalidArgumentError = exports.NotFoundError = exports.
|
|
128
|
+
exports.UnavailableError = exports.SubstrateToolRefusedError = exports.SnapshotVersionError = exports.SnapshotTooLargeError = exports.SnapshotNotFoundError = exports.SessionNotFoundError = exports.SessionBusyError = exports.PerUserQuotaExhaustedError = exports.PauseNotConfiguredError = exports.NotPausedError = exports.LoomcycleError = exports.ChannelCursorRegressionError = exports.InvalidArgumentError = exports.NotFoundError = exports.BackpressureError = exports.AuthError = exports.AlreadyPausingError = exports.AgentNotFoundError = exports.AgentIDInUseError = exports.CLIENT_TOOL_SUBPROTOCOL = exports.clientToolsURL = exports.ClientToolHost = exports.InteractiveSession = exports.LoomcycleClient = void 0;
|
|
129
129
|
var client_js_1 = require("./client.js");
|
|
130
130
|
Object.defineProperty(exports, "LoomcycleClient", { enumerable: true, get: function () { return client_js_1.LoomcycleClient; } });
|
|
131
131
|
var interactive_js_1 = require("./interactive.js");
|
|
@@ -140,7 +140,6 @@ Object.defineProperty(exports, "AgentNotFoundError", { enumerable: true, get: fu
|
|
|
140
140
|
Object.defineProperty(exports, "AlreadyPausingError", { enumerable: true, get: function () { return errors_js_1.AlreadyPausingError; } });
|
|
141
141
|
Object.defineProperty(exports, "AuthError", { enumerable: true, get: function () { return errors_js_1.AuthError; } });
|
|
142
142
|
Object.defineProperty(exports, "BackpressureError", { enumerable: true, get: function () { return errors_js_1.BackpressureError; } });
|
|
143
|
-
Object.defineProperty(exports, "HookNotFoundError", { enumerable: true, get: function () { return errors_js_1.HookNotFoundError; } });
|
|
144
143
|
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return errors_js_1.NotFoundError; } });
|
|
145
144
|
Object.defineProperty(exports, "InvalidArgumentError", { enumerable: true, get: function () { return errors_js_1.InvalidArgumentError; } });
|
|
146
145
|
Object.defineProperty(exports, "ChannelCursorRegressionError", { enumerable: true, get: function () { return errors_js_1.ChannelCursorRegressionError; } });
|
package/dist/client.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { InteractiveSession } from "./interactive.js";
|
|
27
27
|
import { ClientToolHost, type ConnectClientToolsOptions } from "./client-tools.js";
|
|
28
|
-
import type { CredentialListResponse, CredentialMeta, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse,
|
|
28
|
+
import type { CredentialListResponse, CredentialMeta, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, Agent, AgentEvent, AgentStatus, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, ListUserTokensResponse, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, TranscriptResponse, WhoamiResponse, UsageDimension, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest } from "./types.js";
|
|
29
29
|
export declare class LoomcycleClient {
|
|
30
30
|
private ctx;
|
|
31
31
|
constructor(opts?: ClientOptions);
|
|
@@ -696,35 +696,6 @@ export declare class LoomcycleClient {
|
|
|
696
696
|
resolvedBy?: string;
|
|
697
697
|
signal?: AbortSignal;
|
|
698
698
|
}): Promise<unknown>;
|
|
699
|
-
/** Register a pre- or post-tool hook. Its body is a webhook — the
|
|
700
|
-
* callback_url must be an http:// or https:// endpoint the CONSUMER
|
|
701
|
-
* runs; loomcycle POSTs PreHookCall / PostHookCall payloads to it —
|
|
702
|
-
* or a code-js body (`code`), run in-process by loomcycle. Set
|
|
703
|
-
* exactly one. This method manages registration only; a webhook's
|
|
704
|
-
* receiver is the consumer's own HTTP framework (Express, Next.js,
|
|
705
|
-
* etc.).
|
|
706
|
-
*
|
|
707
|
-
* Re-registering the same (owner, name) replaces the prior entry
|
|
708
|
-
* with a fresh id (idempotent app-restart contract).
|
|
709
|
-
*
|
|
710
|
-
* Raises InvalidArgumentError on 400 (bad URL / phase / missing
|
|
711
|
-
* required fields). */
|
|
712
|
-
registerHook(opts: RegisterHookOptions & {
|
|
713
|
-
signal?: AbortSignal;
|
|
714
|
-
}): Promise<RegisterHookResponse>;
|
|
715
|
-
/** List every currently-registered hook. Returns the array
|
|
716
|
-
* unwrapped (the wire envelope is `{hooks: [...]}` — we strip
|
|
717
|
-
* the envelope to match listUserAgents). In-memory only — empty
|
|
718
|
-
* after a loomcycle restart. */
|
|
719
|
-
listHooks(opts?: {
|
|
720
|
-
signal?: AbortSignal;
|
|
721
|
-
}): Promise<Hook[]>;
|
|
722
|
-
/** Delete a registered hook by id. Raises HookNotFoundError on
|
|
723
|
-
* 404. Returns void on success (the HTTP 200 body `{deleted: id}`
|
|
724
|
-
* is dropped — callers already know the id they passed). */
|
|
725
|
-
deleteHook(id: string, opts?: {
|
|
726
|
-
signal?: AbortSignal;
|
|
727
|
-
}): Promise<void>;
|
|
728
699
|
/** Invoke the AgentDef substrate tool over HTTP. Mirrors the
|
|
729
700
|
* MCP `agentdef` meta-tool and the in-band agent tool_use of
|
|
730
701
|
* the same name — different transport, identical semantics.
|
package/dist/client.js
CHANGED
|
@@ -1112,55 +1112,6 @@ export class LoomcycleClient {
|
|
|
1112
1112
|
signal: opts?.signal,
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
// ---- Hook management (hooks-connector series, PR C) ----
|
|
1116
|
-
/** Register a pre- or post-tool hook. Its body is a webhook — the
|
|
1117
|
-
* callback_url must be an http:// or https:// endpoint the CONSUMER
|
|
1118
|
-
* runs; loomcycle POSTs PreHookCall / PostHookCall payloads to it —
|
|
1119
|
-
* or a code-js body (`code`), run in-process by loomcycle. Set
|
|
1120
|
-
* exactly one. This method manages registration only; a webhook's
|
|
1121
|
-
* receiver is the consumer's own HTTP framework (Express, Next.js,
|
|
1122
|
-
* etc.).
|
|
1123
|
-
*
|
|
1124
|
-
* Re-registering the same (owner, name) replaces the prior entry
|
|
1125
|
-
* with a fresh id (idempotent app-restart contract).
|
|
1126
|
-
*
|
|
1127
|
-
* Raises InvalidArgumentError on 400 (bad URL / phase / missing
|
|
1128
|
-
* required fields). */
|
|
1129
|
-
async registerHook(opts) {
|
|
1130
|
-
const body = {
|
|
1131
|
-
owner: opts.owner,
|
|
1132
|
-
name: opts.name,
|
|
1133
|
-
phase: opts.phase,
|
|
1134
|
-
};
|
|
1135
|
-
if (opts.callbackUrl !== undefined)
|
|
1136
|
-
body.callback_url = opts.callbackUrl;
|
|
1137
|
-
if (opts.code !== undefined)
|
|
1138
|
-
body.code = opts.code;
|
|
1139
|
-
if (opts.agents !== undefined)
|
|
1140
|
-
body.agents = opts.agents;
|
|
1141
|
-
if (opts.tools !== undefined)
|
|
1142
|
-
body.tools = opts.tools;
|
|
1143
|
-
if (opts.failMode !== undefined)
|
|
1144
|
-
body.fail_mode = opts.failMode;
|
|
1145
|
-
if (opts.timeoutMs !== undefined && opts.timeoutMs > 0) {
|
|
1146
|
-
body.timeout_ms = opts.timeoutMs;
|
|
1147
|
-
}
|
|
1148
|
-
return postJSON(this.ctx, "/v1/hooks", body, opts);
|
|
1149
|
-
}
|
|
1150
|
-
/** List every currently-registered hook. Returns the array
|
|
1151
|
-
* unwrapped (the wire envelope is `{hooks: [...]}` — we strip
|
|
1152
|
-
* the envelope to match listUserAgents). In-memory only — empty
|
|
1153
|
-
* after a loomcycle restart. */
|
|
1154
|
-
async listHooks(opts) {
|
|
1155
|
-
const resp = await jsonFetch(this.ctx, "/v1/hooks", opts);
|
|
1156
|
-
return resp.hooks ?? [];
|
|
1157
|
-
}
|
|
1158
|
-
/** Delete a registered hook by id. Raises HookNotFoundError on
|
|
1159
|
-
* 404. Returns void on success (the HTTP 200 body `{deleted: id}`
|
|
1160
|
-
* is dropped — callers already know the id they passed). */
|
|
1161
|
-
async deleteHook(id, opts) {
|
|
1162
|
-
await deleteRequest(this.ctx, `/v1/hooks/${encodeURIComponent(id)}`, opts);
|
|
1163
|
-
}
|
|
1164
1115
|
// ---- v0.8.22 substrate admin (AgentDef + SkillDef) ----
|
|
1165
1116
|
/** Invoke the AgentDef substrate tool over HTTP. Mirrors the
|
|
1166
1117
|
* MCP `agentdef` meta-tool and the in-band agent tool_use of
|
package/dist/errors.d.ts
CHANGED
|
@@ -173,16 +173,6 @@ export declare class SnapshotVersionError extends LoomcycleError {
|
|
|
173
173
|
bodyText?: string;
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
/** HookNotFoundError — raised by deleteHook when no hook has the
|
|
177
|
-
* supplied id (HTTP 404 with "hook" in the body). Extends
|
|
178
|
-
* NotFoundError so consumers catching the broader category get this
|
|
179
|
-
* one too. */
|
|
180
|
-
export declare class HookNotFoundError extends NotFoundError {
|
|
181
|
-
constructor(message: string, opts?: {
|
|
182
|
-
status?: number;
|
|
183
|
-
bodyText?: string;
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
176
|
/** ChannelCursorRegressionError — raised by `client.ackChannel()`
|
|
187
177
|
* when the caller-supplied cursor is older than the currently-
|
|
188
178
|
* committed cursor for the (channel, scope, scope_id) tuple. HTTP
|
package/dist/errors.js
CHANGED
|
@@ -176,16 +176,6 @@ export class SnapshotVersionError extends LoomcycleError {
|
|
|
176
176
|
this.name = "SnapshotVersionError";
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
/** HookNotFoundError — raised by deleteHook when no hook has the
|
|
180
|
-
* supplied id (HTTP 404 with "hook" in the body). Extends
|
|
181
|
-
* NotFoundError so consumers catching the broader category get this
|
|
182
|
-
* one too. */
|
|
183
|
-
export class HookNotFoundError extends NotFoundError {
|
|
184
|
-
constructor(message, opts) {
|
|
185
|
-
super(message, opts);
|
|
186
|
-
this.name = "HookNotFoundError";
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
179
|
/** ChannelCursorRegressionError — raised by `client.ackChannel()`
|
|
190
180
|
* when the caller-supplied cursor is older than the currently-
|
|
191
181
|
* committed cursor for the (channel, scope, scope_id) tuple. HTTP
|
package/dist/fetch-helpers.d.ts
CHANGED
|
@@ -79,7 +79,6 @@ export declare function deleteJSON<T>(ctx: _FetchContext, path: string, opts?: {
|
|
|
79
79
|
* 401 → AuthError
|
|
80
80
|
* 404 + "snapshot" → SnapshotNotFoundError ────────┐
|
|
81
81
|
* 404 + "session" → SessionNotFoundError │ All extend
|
|
82
|
-
* 404 + "hook" → HookNotFoundError │ NotFoundError —
|
|
83
82
|
* 404 + "agent" → AgentNotFoundError │ callers can
|
|
84
83
|
* 404 + (other) → NotFoundError (base) │ catch any 404
|
|
85
84
|
* │ with one
|
package/dist/fetch-helpers.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Method-level code in client.ts stays focused on URL + body shape;
|
|
10
10
|
* the boring fetch + error-translation machinery lives here.
|
|
11
11
|
*/
|
|
12
|
-
import { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, ChannelCursorRegressionError,
|
|
12
|
+
import { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, ChannelCursorRegressionError, InvalidArgumentError, LoomcycleError, NotFoundError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, UnavailableError, } from "./errors.js";
|
|
13
13
|
/** authHeaders builds the standard request header set: JSON Accept
|
|
14
14
|
* + Bearer token when the client was constructed with one. The
|
|
15
15
|
* caller adds Content-Type when posting a body. */
|
|
@@ -159,7 +159,6 @@ export async function deleteJSON(ctx, path, opts) {
|
|
|
159
159
|
* 401 → AuthError
|
|
160
160
|
* 404 + "snapshot" → SnapshotNotFoundError ────────┐
|
|
161
161
|
* 404 + "session" → SessionNotFoundError │ All extend
|
|
162
|
-
* 404 + "hook" → HookNotFoundError │ NotFoundError —
|
|
163
162
|
* 404 + "agent" → AgentNotFoundError │ callers can
|
|
164
163
|
* 404 + (other) → NotFoundError (base) │ catch any 404
|
|
165
164
|
* │ with one
|
|
@@ -213,9 +212,6 @@ export async function raiseFromResponse(resp) {
|
|
|
213
212
|
// Priority: most-specific keyword wins.
|
|
214
213
|
// - "snapshot" → SnapshotNotFoundError
|
|
215
214
|
// - "session" → SessionNotFoundError
|
|
216
|
-
// - "hook" → HookNotFoundError (must precede "agent" — the
|
|
217
|
-
// hooks 404 body is `no hook with id "..."`,
|
|
218
|
-
// doesn't mention "agent")
|
|
219
215
|
// - "agent" or "agent_id" → AgentNotFoundError
|
|
220
216
|
// - otherwise → NotFoundError (base) — e.g. memory rows, interrupts,
|
|
221
217
|
// or any future 404-returning endpoint that doesn't fit the
|
|
@@ -224,8 +220,6 @@ export async function raiseFromResponse(resp) {
|
|
|
224
220
|
throw new SnapshotNotFoundError(msg, opts);
|
|
225
221
|
if (bodyLower.includes("session"))
|
|
226
222
|
throw new SessionNotFoundError(msg, opts);
|
|
227
|
-
if (bodyLower.includes("hook"))
|
|
228
|
-
throw new HookNotFoundError(msg, opts);
|
|
229
223
|
if (bodyLower.includes("agent"))
|
|
230
224
|
throw new AgentNotFoundError(msg, opts);
|
|
231
225
|
throw new NotFoundError(msg, opts);
|
package/dist/index.d.ts
CHANGED
|
@@ -128,5 +128,5 @@ export { InteractiveSession } from "./interactive.js";
|
|
|
128
128
|
export type { InteractiveSessionOps } from "./interactive.js";
|
|
129
129
|
export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
|
|
130
130
|
export type { ClientToolSchema, ClientToolInvocation, ConnectClientToolsOptions, WebSocketLike, WebSocketCtor, } from "./client-tools.js";
|
|
131
|
-
export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, Agent, AgentStatus, AgentUsage, RunResult, RunSpec, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions,
|
|
132
|
-
export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError,
|
|
131
|
+
export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, Agent, AgentStatus, AgentUsage, RunResult, RunSpec, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, CancelTurnResult, ReviewRunResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, UserTokenMeta, ListUserTokensResponse, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, PauseResult, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, HookFailMode, HookPhase, HookToolCall, HookToolResult, PostHookCall, PostHookResult, PreHookCall, PreHookResult, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, PromotedTeam, RetiredTeam, TeamDefDetail, TeamVerification, TeamVersion, TeamVersionList, TeamBreakpoints, TeamRunDetached, TeamRunResult, TeamRunTarget, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, HistoryToolInput, HistoryToolResponse, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, ReleaseChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, EnsureCodeAgentOptions, EnsureCodeAgentResult, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, EffectiveConfigResponse, EffectiveConfigSource, EffectiveValue, RetuneRunResponse, RunConfigRecord, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, } from "./types.js";
|
|
132
|
+
export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, NotFoundError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, UnavailableError, } from "./errors.js";
|
package/dist/index.js
CHANGED
|
@@ -126,4 +126,4 @@
|
|
|
126
126
|
export { LoomcycleClient } from "./client.js";
|
|
127
127
|
export { InteractiveSession } from "./interactive.js";
|
|
128
128
|
export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./client-tools.js";
|
|
129
|
-
export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError,
|
|
129
|
+
export { AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, NotFoundError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, PauseNotConfiguredError, PerUserQuotaExhaustedError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, UnavailableError, } from "./errors.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -1796,60 +1796,6 @@ export interface ResolveInterruptOptions {
|
|
|
1796
1796
|
* the failure's classification in the payload. */
|
|
1797
1797
|
export type HookPhase = "pre" | "post" | "post_failure" | "agent_start" | "agent_stop" | "subagent_start" | "subagent_stop" | "pre_compact" | "post_compact" | "run_end";
|
|
1798
1798
|
export type HookFailMode = "open" | "closed";
|
|
1799
|
-
/** Hook is the full descriptor returned by listHooks. The id +
|
|
1800
|
-
* registered_at are loomcycle-assigned; the rest mirrors what was
|
|
1801
|
-
* POSTed to registerHook. Field names use snake_case to match the
|
|
1802
|
-
* Go server's JSON output. */
|
|
1803
|
-
export interface Hook {
|
|
1804
|
-
id: string;
|
|
1805
|
-
owner: string;
|
|
1806
|
-
name: string;
|
|
1807
|
-
phase: HookPhase;
|
|
1808
|
-
agents: string[];
|
|
1809
|
-
tools: string[];
|
|
1810
|
-
callback_url: string;
|
|
1811
|
-
fail_mode: HookFailMode;
|
|
1812
|
-
timeout_ms: number;
|
|
1813
|
-
registered_at: string;
|
|
1814
|
-
/** The code-js body, when the hook has one instead of a callback_url. */
|
|
1815
|
-
code?: string;
|
|
1816
|
-
}
|
|
1817
|
-
/** RegisterHookOptions uses camelCase (JS norm for method parameters)
|
|
1818
|
-
* and is translated to snake_case in the request body — same split as
|
|
1819
|
-
* RunOptions / CreateSnapshotOptions. */
|
|
1820
|
-
export interface RegisterHookOptions {
|
|
1821
|
-
/** App UID; (owner, name) is the identity tuple. Re-registering the
|
|
1822
|
-
* same pair replaces the prior entry with a fresh id. */
|
|
1823
|
-
owner: string;
|
|
1824
|
-
name: string;
|
|
1825
|
-
phase: HookPhase;
|
|
1826
|
-
/** Agent name globs (exact match or trailing-* prefix). Empty list
|
|
1827
|
-
* matches every agent (equivalent to ["*"]). */
|
|
1828
|
-
agents?: string[];
|
|
1829
|
-
/** Tool name globs (same syntax). Empty matches every tool. */
|
|
1830
|
-
tools?: string[];
|
|
1831
|
-
/** http:// or https:// URL loomcycle POSTs PreHookCall /
|
|
1832
|
-
* PostHookCall payloads to. Set this or `code`. */
|
|
1833
|
-
callbackUrl?: string;
|
|
1834
|
-
/** A code-js body in place of a webhook: JavaScript defining a
|
|
1835
|
-
* top-level `hook(ev)` that returns the decision. Its only tool is
|
|
1836
|
-
* `Interruption` (ask, notify). Needs code hooks enabled on the
|
|
1837
|
-
* server. Set this or `callbackUrl`. */
|
|
1838
|
-
code?: string;
|
|
1839
|
-
/** "open" (default) — webhook errors pass through. "closed" — webhook
|
|
1840
|
-
* errors fail the tool call with IsError=true. */
|
|
1841
|
-
failMode?: HookFailMode;
|
|
1842
|
-
/** Per-call timeout. 0 / omitted = registry default (5 s; 50 ms for a
|
|
1843
|
-
* code body, where it bounds each run of the code, capped at 1 s). */
|
|
1844
|
-
timeoutMs?: number;
|
|
1845
|
-
}
|
|
1846
|
-
export interface RegisterHookResponse {
|
|
1847
|
-
/** Loomcycle-assigned id. Use it on deleteHook. */
|
|
1848
|
-
id: string;
|
|
1849
|
-
}
|
|
1850
|
-
export interface ListHooksResponse {
|
|
1851
|
-
hooks: Hook[];
|
|
1852
|
-
}
|
|
1853
1799
|
export interface HookToolCall {
|
|
1854
1800
|
id: string;
|
|
1855
1801
|
name: string;
|
|
@@ -2872,6 +2818,30 @@ export interface AgentInterruptionACL {
|
|
|
2872
2818
|
kinds?: string[];
|
|
2873
2819
|
max_pending?: number;
|
|
2874
2820
|
}
|
|
2821
|
+
/** A hook event: a tool call's `pre` / `post` / `post_failure`, or a point in
|
|
2822
|
+
* the run. */
|
|
2823
|
+
export type HookEvent = "pre" | "post" | "post_failure" | "agent_start" | "agent_stop" | "subagent_start" | "subagent_stop" | "pre_compact" | "post_compact" | "run_end";
|
|
2824
|
+
/** A webhook written into the definition that attaches it. */
|
|
2825
|
+
export interface InlineWebhook {
|
|
2826
|
+
name: string;
|
|
2827
|
+
url: string;
|
|
2828
|
+
fail_mode?: HookFailMode;
|
|
2829
|
+
timeout_ms?: number;
|
|
2830
|
+
/** Sent with each call. A value may name a credential as `$cred:<name>`,
|
|
2831
|
+
* resolved for the run when the hook is called — keep secrets there, not in
|
|
2832
|
+
* the URL or a literal value. */
|
|
2833
|
+
headers?: Record<string, string>;
|
|
2834
|
+
}
|
|
2835
|
+
/** One hook an agent carries: a HookDef name (`"gate"`, or `"gate@3"` pinned)
|
|
2836
|
+
* or an inline webhook. */
|
|
2837
|
+
export type HookEntry = string | InlineWebhook;
|
|
2838
|
+
/** Hooks per event, in chain order. */
|
|
2839
|
+
export type EventHooks = Partial<Record<HookEvent, HookEntry[]>>;
|
|
2840
|
+
/** A `tools` entry that carries that tool's own hooks. */
|
|
2841
|
+
export interface ToolEntry {
|
|
2842
|
+
name: string;
|
|
2843
|
+
hooks: Partial<Record<"pre" | "post" | "post_failure", HookEntry[]>>;
|
|
2844
|
+
}
|
|
2875
2845
|
export interface AgentDefOverlay {
|
|
2876
2846
|
provider?: string;
|
|
2877
2847
|
model?: string;
|
|
@@ -2889,7 +2859,14 @@ export interface AgentDefOverlay {
|
|
|
2889
2859
|
max_iterations?: number;
|
|
2890
2860
|
max_concurrent_children?: number;
|
|
2891
2861
|
system_prompt?: string;
|
|
2892
|
-
|
|
2862
|
+
/** Tool names; an entry may be `{name, hooks}` to give that tool its own
|
|
2863
|
+
* pre / post hooks (stored as the name plus a `tool_hooks` entry). */
|
|
2864
|
+
tools?: (string | ToolEntry)[];
|
|
2865
|
+
/** The agent's own hooks: run events, and tool events for every tool. A run
|
|
2866
|
+
* takes these verbatim. */
|
|
2867
|
+
hooks?: EventHooks;
|
|
2868
|
+
/** Each tool's own hooks, by tool name. */
|
|
2869
|
+
tool_hooks?: Record<string, Partial<Record<"pre" | "post" | "post_failure", HookEntry[]>>>;
|
|
2893
2870
|
skills?: string[];
|
|
2894
2871
|
memory_scopes?: string[];
|
|
2895
2872
|
/** RFC DF: recall attaches the conversation TURN each fact was distilled from,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcycle/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.97.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",
|