@arnilo/prism-hosts 0.13.0 → 0.14.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/CHANGELOG.md +2 -0
- package/a2a/README.md +195 -0
- package/a2a/src/card.ts +208 -0
- package/a2a/src/codec.ts +523 -0
- package/a2a/src/connect.ts +415 -0
- package/a2a/src/errors.ts +87 -0
- package/a2a/src/index.ts +40 -0
- package/a2a/src/limits.ts +43 -0
- package/a2a/src/pending.ts +28 -0
- package/a2a/src/proxy.ts +526 -0
- package/a2a/src/serve.ts +886 -0
- package/acp/README.md +3 -1
- package/acp/src/limits.ts +3 -16
- package/acp/src/mapper.ts +26 -5
- package/acp/src/serve.ts +6 -5
- package/ag-ui/README.md +2 -1
- package/ag-ui/src/a2ui.ts +8 -31
- package/ag-ui/src/ag-ui-mapper.ts +27 -1
- package/ag-ui/src/encrypted-value.ts +3 -3
- package/ag-ui/src/handler.ts +4 -4
- package/ag-ui/src/index.ts +0 -33
- package/ag-ui/src/limits.ts +5 -88
- package/ag-ui/src/projectors.ts +8 -6
- package/ag-ui/src/renderer/bind.ts +2 -1
- package/channels/README.md +61 -5
- package/channels/src/discord-gateway.ts +354 -0
- package/channels/src/discord.ts +873 -0
- package/channels/src/index.ts +4 -2
- package/channels/src/limits.ts +3 -19
- package/channels/src/pairing.ts +1 -2
- package/channels/src/runtime-turn.ts +10 -2
- package/channels/src/signal.ts +11 -19
- package/channels/src/slack.ts +854 -0
- package/channels/src/telegram.ts +22 -44
- package/channels/src/types.ts +5 -2
- package/devtools/README.md +1 -1
- package/driver-process/src/driver.ts +3 -1
- package/driver-process/src/testing.ts +1 -1
- package/driver-process/src/turn.ts +5 -1
- package/evals/README.md +11 -7
- package/evals/src/calibration.ts +5 -13
- package/evals/src/compare-experiments.ts +1 -2
- package/evals/src/comparison.ts +7 -25
- package/evals/src/curate.ts +3 -9
- package/evals/src/dataset.ts +0 -2
- package/evals/src/index.ts +3 -20
- package/evals/src/injection.ts +33 -6
- package/evals/src/judge.ts +9 -13
- package/evals/src/limits.ts +0 -17
- package/evals/src/rubric-judge.ts +5 -10
- package/evals/src/scenario-runner.ts +8 -4
- package/evals/src/scenarios.ts +5 -5
- package/evals/src/score.ts +3 -5
- package/evals/src/stats.ts +0 -2
- package/evals/src/threshold.ts +3 -3
- package/evals/src/toolless-session.ts +7 -3
- package/evals/src/trace.ts +8 -14
- package/evals/src/trajectory.ts +45 -11
- package/evals/src/types.ts +2 -2
- package/evals/src/user-simulator.ts +1 -7
- package/evals/src/util.ts +3 -9
- package/headless/README.md +20 -1
- package/headless/src/authority.ts +14 -1
- package/headless/src/errors.ts +3 -1
- package/headless/src/index.ts +10 -1
- package/headless/src/limits.ts +2 -2
- package/headless/src/pending.ts +4 -3
- package/headless/src/recover.ts +126 -0
- package/headless/src/resume.ts +1 -1
- package/host-builder/data/api.json +1308 -1367
- package/host-builder/data/errors.json +207 -181
- package/host-builder/data/examples/a2a-client.ts +125 -0
- package/host-builder/data/examples/a2a-server.ts +133 -0
- package/host-builder/data/examples/autonomous-coding-loop.ts +1 -1
- package/host-builder/data/examples/build-workflow.ts +2 -2
- package/host-builder/data/examples/caveman-ponytail.ts +1 -1
- package/host-builder/data/examples/channel-discord.ts +176 -0
- package/host-builder/data/examples/channel-slack.ts +146 -0
- package/host-builder/data/examples/continue-after-failure.ts +80 -0
- package/host-builder/data/examples/custom-adapter.ts +1 -1
- package/host-builder/data/examples/decision-models.ts +1 -1
- package/host-builder/data/examples/define-package.ts +1 -1
- package/host-builder/data/examples/delegate.ts +74 -9
- package/host-builder/data/examples/durable-loops-and-approvals.ts +11 -10
- package/host-builder/data/examples/governance-deny.ts +1 -1
- package/host-builder/data/examples/guardrail-content.ts +126 -0
- package/host-builder/data/examples/headless-host.ts +1 -1
- package/host-builder/data/examples/long-running-job.ts +129 -0
- package/host-builder/data/examples/long-term-memory.ts +1 -1
- package/host-builder/data/examples/mcp-oauth.ts +197 -0
- package/host-builder/data/examples/mcp-trust.ts +1 -1
- package/host-builder/data/examples/memory-and-wiki.ts +3 -3
- package/host-builder/data/examples/memory-system.ts +31 -18
- package/host-builder/data/examples/model-router-aggregate-budgets.ts +1 -1
- package/host-builder/data/examples/parallel-tools.ts +70 -0
- package/host-builder/data/examples/remote-agent.ts +1 -1
- package/host-builder/data/examples/serve-tools.ts +1 -1
- package/host-builder/data/examples/session-memory.ts +29 -26
- package/host-builder/data/examples/side-call.ts +9 -5
- package/host-builder/data/examples/sqlite-resume.ts +1 -1
- package/host-builder/data/examples/structured-output.ts +57 -0
- package/host-builder/data/examples.json +15 -5
- package/host-builder/skills/prism-host-builder/SKILL.md +1 -1
- package/host-builder/skills/prism-host-builder/references/choosing.md +14 -10
- package/host-builder/skills/prism-host-builder/references/pitfalls.md +5 -3
- package/host-builder/skills/prism-host-builder/references/recipes.md +5 -5
- package/host-builder/skills/prism-host-builder/references/verification.md +1 -1
- package/host-builder/src/check/runner.ts +2 -3
- package/host-builder/src/server.ts +2 -2
- package/mcp-server/README.md +3 -3
- package/mcp-server/src/bounds.ts +3 -3
- package/mcp-server/src/serve-tools.ts +2 -9
- package/mcp-server/src/serve.ts +2 -4
- package/mcp-server/src/server.ts +10 -20
- package/package.json +12 -6
- package/remote/README.md +7 -4
- package/remote/src/channel.ts +6 -2
- package/remote/src/connect.ts +9 -3
- package/remote/src/errors.ts +3 -1
- package/remote/src/limits.ts +3 -13
- package/remote/src/mirror.ts +2 -1
- package/remote/src/pending.ts +4 -3
- package/remote/src/protocol.ts +3 -0
- package/remote/src/serve.ts +43 -5
- package/remote/src/session-proxy.ts +28 -5
- package/remote/src/testing.ts +3 -1
- package/remote/src/wire.ts +74 -14
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http";
|
|
4
|
+
import { type AgentEvent, type CredentialResolver, createAgent, definePackage, type Secret } from "@arnilo/prism";
|
|
5
|
+
import { createScriptedHostUi, mockProvider, providerDone, providerTextDelta } from "@arnilo/prism/testing";
|
|
6
|
+
import { mcp } from "@arnilo/prism-extensions/mcp";
|
|
7
|
+
import { createMcpHandler, McpServer } from "@modelcontextprotocol/server";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Demonstrates (network-free, everything on 127.0.0.1):
|
|
11
|
+
* 1. An MCP server that answers 401 is signed in to through `host.ui`: the package opens the authorization
|
|
12
|
+
* URL with `open-url`, a loopback listener takes the callback, and the code is redeemed with PKCE. The
|
|
13
|
+
* sign-in runs in the background, so `createAgent` does not wait for the person; `mcp:status` reports
|
|
14
|
+
* `signingIn: true` until it settles, and the server's tools reach the next run once it connects.
|
|
15
|
+
* 2. The whole sign-in record lands in one `keyring:` ref through the credentials slot.
|
|
16
|
+
* 3. No token appears in events, `inspect()`, status notes, or command results.
|
|
17
|
+
* 4. `mcp:logout` deletes the record and closes the server.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const TOKEN_PREFIX = "demo-oauth-access-";
|
|
21
|
+
|
|
22
|
+
function listen(handler: (request: IncomingMessage, response: ServerResponse, body: Buffer) => void | Promise<void>) {
|
|
23
|
+
const server = createServer(async (request, response) => {
|
|
24
|
+
const chunks: Buffer[] = [];
|
|
25
|
+
for await (const chunk of request) chunks.push(chunk as Buffer);
|
|
26
|
+
await handler(request, response, Buffer.concat(chunks));
|
|
27
|
+
});
|
|
28
|
+
return new Promise<{ origin: string; server: Server }>((resolve) =>
|
|
29
|
+
server.listen(0, "127.0.0.1", () => resolve({ origin: `http://127.0.0.1:${(server.address() as { port: number }).port}`, server })),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function json(response: ServerResponse, status: number, body: unknown) {
|
|
34
|
+
response.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A fake authorization server and the MCP server it protects. */
|
|
38
|
+
async function startFixture() {
|
|
39
|
+
let challenge: string | undefined;
|
|
40
|
+
let accessToken: string | undefined;
|
|
41
|
+
const as = await listen((request, response, body) => {
|
|
42
|
+
const url = new URL(request.url ?? "/", as.origin);
|
|
43
|
+
if (url.pathname === "/.well-known/oauth-authorization-server") {
|
|
44
|
+
return json(response, 200, {
|
|
45
|
+
issuer: as.origin,
|
|
46
|
+
authorization_endpoint: `${as.origin}/authorize`,
|
|
47
|
+
token_endpoint: `${as.origin}/token`,
|
|
48
|
+
registration_endpoint: `${as.origin}/register`,
|
|
49
|
+
code_challenge_methods_supported: ["S256"],
|
|
50
|
+
response_types_supported: ["code"],
|
|
51
|
+
token_endpoint_auth_methods_supported: ["none"],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (url.pathname === "/register") return json(response, 201, { ...JSON.parse(body.toString()), client_id: "demo-client" });
|
|
55
|
+
if (url.pathname === "/token") {
|
|
56
|
+
const params = new URLSearchParams(body.toString());
|
|
57
|
+
const verifier = params.get("code_verifier") ?? "";
|
|
58
|
+
if (createHash("sha256").update(verifier).digest("base64url") !== challenge) return json(response, 400, { error: "invalid_grant" });
|
|
59
|
+
accessToken = `${TOKEN_PREFIX}1`;
|
|
60
|
+
return json(response, 200, {
|
|
61
|
+
access_token: accessToken,
|
|
62
|
+
refresh_token: "demo-oauth-refresh-1",
|
|
63
|
+
token_type: "Bearer",
|
|
64
|
+
expires_in: 3600,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
json(response, 404, { error: "not_found" });
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const handler = createMcpHandler(() => {
|
|
71
|
+
const server = new McpServer({ name: "tracker", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
72
|
+
server.registerTool("list_issues", { inputSchema: {} }, async () => ({ content: [{ type: "text" as const, text: "[]" }] }));
|
|
73
|
+
return server;
|
|
74
|
+
}, {});
|
|
75
|
+
const mcpServer = await listen(async (request, response, body) => {
|
|
76
|
+
if (request.url?.startsWith("/.well-known/"))
|
|
77
|
+
return json(response, 200, { authorization_servers: [as.origin], resource: `${mcpServer.origin}/mcp` });
|
|
78
|
+
if (accessToken === undefined || request.headers.authorization !== `Bearer ${accessToken}`) {
|
|
79
|
+
response.writeHead(401, {
|
|
80
|
+
"www-authenticate": `Bearer resource_metadata="${mcpServer.origin}/.well-known/oauth-protected-resource"`,
|
|
81
|
+
});
|
|
82
|
+
return void response.end();
|
|
83
|
+
}
|
|
84
|
+
const webResponse = await handler.fetch(
|
|
85
|
+
new Request(new URL(request.url ?? "/", mcpServer.origin), {
|
|
86
|
+
method: request.method,
|
|
87
|
+
headers: request.headers as HeadersInit,
|
|
88
|
+
body: request.method === "GET" || request.method === "DELETE" ? undefined : new Uint8Array(body),
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
response.writeHead(webResponse.status, Object.fromEntries(webResponse.headers));
|
|
92
|
+
for await (const chunk of webResponse.body ?? new Uint8Array()) response.write(chunk);
|
|
93
|
+
response.end();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
origin: mcpServer.origin,
|
|
98
|
+
expect(url: URL) {
|
|
99
|
+
challenge = url.searchParams.get("code_challenge") ?? undefined;
|
|
100
|
+
},
|
|
101
|
+
async close() {
|
|
102
|
+
await handler.close();
|
|
103
|
+
for (const { server } of [as, mcpServer]) {
|
|
104
|
+
server.closeAllConnections();
|
|
105
|
+
await new Promise<void>((resolve) => server.close(() => resolve()));
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export async function demo(): Promise<Record<string, unknown>> {
|
|
112
|
+
const fixture = await startFixture();
|
|
113
|
+
// The credentials slot a keyring would provide.
|
|
114
|
+
const store = new Map<string, Secret>();
|
|
115
|
+
const credentials: CredentialResolver = {
|
|
116
|
+
resolve: (ref) => store.get(ref),
|
|
117
|
+
store: (ref, secret) => void store.set(ref, secret),
|
|
118
|
+
delete: (ref) => void store.delete(ref),
|
|
119
|
+
};
|
|
120
|
+
// The host's browser: it "signs in" and follows the redirect to the package's loopback listener.
|
|
121
|
+
const ui = createScriptedHostUi((request) => {
|
|
122
|
+
if (request.kind !== "open-url") return { status: "unavailable" };
|
|
123
|
+
const authorize = new URL(request.url);
|
|
124
|
+
fixture.expect(authorize);
|
|
125
|
+
const callback = new URL(authorize.searchParams.get("redirect_uri") ?? "");
|
|
126
|
+
callback.searchParams.set("code", "demo-code");
|
|
127
|
+
callback.searchParams.set("state", authorize.searchParams.get("state") ?? "");
|
|
128
|
+
setTimeout(() => void fetch(callback), 0);
|
|
129
|
+
return { status: "answered", value: undefined };
|
|
130
|
+
});
|
|
131
|
+
const events: AgentEvent[] = [];
|
|
132
|
+
const collector = definePackage({
|
|
133
|
+
name: "mcp-oauth-event-collector",
|
|
134
|
+
version: "1.0.0",
|
|
135
|
+
requires: { api: 2 },
|
|
136
|
+
setup(prism) {
|
|
137
|
+
prism.hooks.on("package.event", (event) => void events.push(event));
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
const agent = await createAgent({
|
|
143
|
+
model: { provider: "mock", model: "test" },
|
|
144
|
+
packages: [
|
|
145
|
+
mockProvider([[providerTextDelta("ok"), providerDone()]]),
|
|
146
|
+
collector,
|
|
147
|
+
mcp({
|
|
148
|
+
servers: [
|
|
149
|
+
{
|
|
150
|
+
id: "tracker",
|
|
151
|
+
transport: "http",
|
|
152
|
+
url: `${fixture.origin}/mcp`,
|
|
153
|
+
allow: fixture.origin,
|
|
154
|
+
auth: { kind: "oauth", tokens: "keyring:mcp-tracker" },
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
}),
|
|
158
|
+
],
|
|
159
|
+
slots: { credentials },
|
|
160
|
+
host: { ui: ui.ui },
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
type Status = { servers: Array<{ state: string; toolCount: number; signingIn?: boolean }> };
|
|
164
|
+
let status = (await agent.commands.run("mcp:status")) as Status;
|
|
165
|
+
for (let i = 0; i < 500 && status.servers[0].signingIn; i += 1) {
|
|
166
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
167
|
+
status = (await agent.commands.run("mcp:status")) as Status;
|
|
168
|
+
}
|
|
169
|
+
const stored = store.get("keyring:mcp-tracker");
|
|
170
|
+
const dump = JSON.stringify({ events, status, inspect: agent.inspect() });
|
|
171
|
+
const tokenLeaked = dump.includes(TOKEN_PREFIX) || dump.includes("demo-oauth-refresh");
|
|
172
|
+
assert.equal(status.servers[0].state, "connected");
|
|
173
|
+
assert.equal(tokenLeaked, false, "a token leaked into events, status, or inspect()");
|
|
174
|
+
|
|
175
|
+
const logout = (await agent.commands.run("mcp:logout", { id: "tracker" })) as { state: string };
|
|
176
|
+
await agent.dispose();
|
|
177
|
+
return {
|
|
178
|
+
state: status.servers[0].state,
|
|
179
|
+
toolCount: status.servers[0].toolCount,
|
|
180
|
+
opened: ui.requestsOf("open-url").length,
|
|
181
|
+
storedAs: stored?.type,
|
|
182
|
+
tokenLeaked,
|
|
183
|
+
afterLogout: logout.state,
|
|
184
|
+
recordDeleted: !store.has("keyring:mcp-tracker"),
|
|
185
|
+
};
|
|
186
|
+
} finally {
|
|
187
|
+
await fixture.close();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export async function main() {
|
|
192
|
+
console.log(JSON.stringify(await demo(), null, 2));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
196
|
+
await main();
|
|
197
|
+
}
|
|
@@ -71,7 +71,7 @@ export async function demo(): Promise<Record<string, unknown>> {
|
|
|
71
71
|
const eventCollector = definePackage({
|
|
72
72
|
name: "mcp-trust-event-collector",
|
|
73
73
|
version: "1.0.0",
|
|
74
|
-
requires: { api:
|
|
74
|
+
requires: { api: 2 },
|
|
75
75
|
setup(prism) {
|
|
76
76
|
prism.hooks.on("package.event", (event) => void events.push(event));
|
|
77
77
|
},
|
|
@@ -112,7 +112,7 @@ function curate(request: ProviderRequest): ProviderEvent[] {
|
|
|
112
112
|
function observe(request: ProviderRequest): ProviderEvent[] {
|
|
113
113
|
const answered = request.messages.some((message) => message.role === "tool");
|
|
114
114
|
const prompt = request.messages.find((message) => message.role === "user")?.content[0];
|
|
115
|
-
const sourceId = prompt?.type === "text" ? /\[[^\]]+\] \[([^\]]+)\]
|
|
115
|
+
const sourceId = prompt?.type === "text" ? /\[[^\]]+\] \[([^\]]+)\] (?:user|assistant|tool|system):/.exec(prompt.text)?.[1] : undefined;
|
|
116
116
|
if (answered || !sourceId) return [providerDone()];
|
|
117
117
|
return [
|
|
118
118
|
providerToolCall(
|
|
@@ -165,7 +165,7 @@ const probe = definePackage({
|
|
|
165
165
|
name: "@example/memory-and-wiki-probe",
|
|
166
166
|
version: "0.0.0",
|
|
167
167
|
description: "Lets the demo read memory's read-only port to print and assert what memory stored.",
|
|
168
|
-
requires: { api:
|
|
168
|
+
requires: { api: 2 },
|
|
169
169
|
setup(prism) {
|
|
170
170
|
ltmPort = () => prism.services.consume<MemoryLtmPort>(MEMORY_LTM_SERVICE);
|
|
171
171
|
},
|
|
@@ -174,7 +174,7 @@ const providerPackage = definePackage({
|
|
|
174
174
|
name: "@example/memory-and-wiki-provider",
|
|
175
175
|
version: "0.0.0",
|
|
176
176
|
description: "The demo's scripted provider for the main, observer and curator models.",
|
|
177
|
-
requires: { api:
|
|
177
|
+
requires: { api: 2 },
|
|
178
178
|
setup(prism) {
|
|
179
179
|
prism.providers.register(provider);
|
|
180
180
|
},
|
|
@@ -30,9 +30,9 @@ import memorySystem, {
|
|
|
30
30
|
* - **`ltm`** (`{ stm: false, ltm }`): long-term memory alone. The model writes a fact note with `memory.insert`; there
|
|
31
31
|
* are no session tiers, no `recall` tool, no `memory:session` command and no `compaction` slot claim.
|
|
32
32
|
* - **`session`** (`{ stm, wm }`, the defaults): the session tiers with no cross-session store. A turn is observed and
|
|
33
|
-
* the
|
|
34
|
-
* - **`stm`** (`{ stm, wm: false }`): an event log with verbatim recall. Observed, never
|
|
35
|
-
* - **`full`** (every component): observed,
|
|
33
|
+
* working memory gives the events verdicts; no `memory.*` tool and no `memory.ltm` service exist.
|
|
34
|
+
* - **`stm`** (`{ stm, wm: false }`): an event log with verbatim recall. Observed, never given a WM verdict.
|
|
35
|
+
* - **`full`** (every component): observed, kept in working memory and rehearsed (today's dropper, the `lowest-relevance` policy so
|
|
36
36
|
* it needs no model call), plus a long-term note. `sleep` is on and still a no-op.
|
|
37
37
|
*
|
|
38
38
|
* For each profile the demo asserts which tools, commands, slot claim and capabilities the package holds, and reads the
|
|
@@ -48,7 +48,9 @@ const FACT = "The retry budget is capped at three attempts.";
|
|
|
48
48
|
export type ProfileName = "ltm" | "session" | "stm" | "full";
|
|
49
49
|
|
|
50
50
|
const STM = { model: "mock/observer", triggerTokens: 1 } as const;
|
|
51
|
-
|
|
51
|
+
// Working memory is an experimental opt-in, off unless configured. The example uses the model policy to show the
|
|
52
|
+
// reflector; the default policy is deterministic (no model call).
|
|
53
|
+
const WM = { model: "mock/reflector", policy: "model", triggerTokens: 1 } as const;
|
|
52
54
|
|
|
53
55
|
/** The four profiles: documented recipes, not a config field. `root` is the long-term memory's directory. */
|
|
54
56
|
function profileConfig(profile: ProfileName, root: string): MemorySystemConfig {
|
|
@@ -57,18 +59,25 @@ function profileConfig(profile: ProfileName, root: string): MemorySystemConfig {
|
|
|
57
59
|
case "ltm":
|
|
58
60
|
return { stm: false, ltm };
|
|
59
61
|
case "session":
|
|
60
|
-
return { stm: STM, wm: WM };
|
|
62
|
+
return { stm: STM, wm: WM, scope: { text: "Remember the retry budget." } };
|
|
61
63
|
case "stm":
|
|
62
64
|
return { stm: STM, wm: false };
|
|
63
65
|
case "full":
|
|
64
|
-
return {
|
|
66
|
+
return {
|
|
67
|
+
stm: STM,
|
|
68
|
+
wm: WM,
|
|
69
|
+
scope: { text: "Remember the retry budget." },
|
|
70
|
+
rehearsal: { targetTokens: 1, policy: "lowest-relevance" },
|
|
71
|
+
ltm,
|
|
72
|
+
sleep: {},
|
|
73
|
+
};
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
76
|
|
|
68
77
|
/** The observer: one `record_event` call sourced from the first entry its prompt lists. */
|
|
69
78
|
function observe(request: ProviderRequest): ProviderEvent[] {
|
|
70
79
|
const prompt = request.messages.find((message) => message.role === "user")?.content[0];
|
|
71
|
-
const sourceId = prompt?.type === "text" ? /\[[^\]]+\] \[([^\]]+)\]
|
|
80
|
+
const sourceId = prompt?.type === "text" ? /\[[^\]]+\] \[([^\]]+)\] (?:user|assistant|tool|system):/.exec(prompt.text)?.[1] : undefined;
|
|
72
81
|
if (request.messages.some((message) => message.role === "tool") || !sourceId) return [providerDone()];
|
|
73
82
|
return [
|
|
74
83
|
providerToolCall(
|
|
@@ -78,13 +87,17 @@ function observe(request: ProviderRequest): ProviderEvent[] {
|
|
|
78
87
|
];
|
|
79
88
|
}
|
|
80
89
|
|
|
81
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Working memory: one `judge` call holding one fact over the first STM record its prompt lists (records are shown as
|
|
92
|
+
* ordinals, `r1…rN`). A fact gives the record no verdict, so it stays on the STM surface and the `full` profile's
|
|
93
|
+
* rehearsal still has a record to drop.
|
|
94
|
+
*/
|
|
82
95
|
function reflect(request: ProviderRequest): ProviderEvent[] {
|
|
83
96
|
const prompt = request.messages.find((message) => message.role === "user")?.content[0];
|
|
84
|
-
const
|
|
85
|
-
if (request.messages.some((message) => message.role === "tool") || !
|
|
97
|
+
const ordinal = prompt?.type === "text" ? /^- \[(r[0-9]+)\] \d{4}-/m.exec(prompt.text)?.[1] : undefined;
|
|
98
|
+
if (request.messages.some((message) => message.role === "tool") || !ordinal) return [providerDone()];
|
|
86
99
|
return [
|
|
87
|
-
providerToolCall(toolCallContent("
|
|
100
|
+
providerToolCall(toolCallContent("wm-1", "judge", { facts: [{ support: [ordinal], text: `Durable: ${FACT}`, relevance: "high" }] })),
|
|
88
101
|
providerDone(),
|
|
89
102
|
];
|
|
90
103
|
}
|
|
@@ -112,14 +125,14 @@ export interface ProfileReport {
|
|
|
112
125
|
readonly ltmService: boolean;
|
|
113
126
|
readonly modelCalls: Readonly<Record<string, number>>;
|
|
114
127
|
readonly observations: number;
|
|
115
|
-
readonly
|
|
128
|
+
readonly wmItems: number;
|
|
116
129
|
readonly dropped: number;
|
|
117
130
|
readonly facts: number;
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
interface SessionStatus {
|
|
121
134
|
readonly observations: { readonly recorded: number; readonly dropped: number };
|
|
122
|
-
readonly
|
|
135
|
+
readonly wmItems: { readonly recorded: number };
|
|
123
136
|
readonly inFlight: boolean;
|
|
124
137
|
}
|
|
125
138
|
|
|
@@ -149,7 +162,7 @@ export async function runProfile(profile: ProfileName): Promise<ProfileReport> {
|
|
|
149
162
|
name: "@example/memory-system-host",
|
|
150
163
|
version: "0.0.0",
|
|
151
164
|
description: "The demo's scripted provider, and a read of the services the memory system provides.",
|
|
152
|
-
requires: { api:
|
|
165
|
+
requires: { api: 2 },
|
|
153
166
|
setup(prism) {
|
|
154
167
|
prism.providers.register(provider);
|
|
155
168
|
prism.hooks.on("session.opened", () => {
|
|
@@ -194,7 +207,7 @@ export async function runProfile(profile: ProfileName): Promise<ProfileReport> {
|
|
|
194
207
|
ltmService: services.ltm !== undefined,
|
|
195
208
|
modelCalls,
|
|
196
209
|
observations: status?.observations.recorded ?? 0,
|
|
197
|
-
|
|
210
|
+
wmItems: status?.wmItems.recorded ?? 0,
|
|
198
211
|
dropped: status?.observations.dropped ?? 0,
|
|
199
212
|
facts,
|
|
200
213
|
};
|
|
@@ -219,9 +232,9 @@ export function checkProfile(report: ProfileReport): void {
|
|
|
219
232
|
assert.equal(report.compactionOwner === PACKAGE, on("stm"), `${profile}: the compaction slot follows stm`);
|
|
220
233
|
assert.equal(report.capabilities.includes("slot:compaction"), on("stm"), `${profile}: slot:compaction follows stm`);
|
|
221
234
|
assert.equal(report.capabilities.includes("credentials"), on("ltm"), `${profile}: credentials follows ltm`);
|
|
222
|
-
// The passes: observed with stm,
|
|
235
|
+
// The passes: observed with stm, given WM verdicts only with wm, rehearsed (dropped) only with rehearsal.
|
|
223
236
|
assert.equal(report.observations > 0, on("stm"), `${profile}: observations`);
|
|
224
|
-
assert.equal(report.
|
|
237
|
+
assert.equal(report.wmItems > 0, on("wm"), `${profile}: WM items`);
|
|
225
238
|
assert.equal((report.modelCalls.reflector ?? 0) > 0, on("wm"), `${profile}: the reflector model is called only with wm`);
|
|
226
239
|
assert.equal((report.modelCalls.observer ?? 0) > 0, on("stm"), `${profile}: the observer model is called only with stm`);
|
|
227
240
|
assert.equal(report.dropped > 0, on("rehearsal"), `${profile}: rehearsal drops only when on`);
|
|
@@ -245,7 +258,7 @@ if (import.meta.main) {
|
|
|
245
258
|
.join("+");
|
|
246
259
|
console.log(
|
|
247
260
|
`${report.profile.padEnd(7)} components ${components.padEnd(26)} tools ${String(report.tools.length).padStart(2)} ` +
|
|
248
|
-
`observations ${report.observations}
|
|
261
|
+
`observations ${report.observations} WM items ${report.wmItems} dropped ${report.dropped} facts ${report.facts} ` +
|
|
249
262
|
`slot ${report.compactionOwner === PACKAGE ? "claimed" : "not claimed"} capabilities [${report.capabilities.join(", ")}]`,
|
|
250
263
|
);
|
|
251
264
|
}
|
|
@@ -98,7 +98,7 @@ function createGovernedHookPackage(
|
|
|
98
98
|
return definePackage({
|
|
99
99
|
name: "governed-agent-hook",
|
|
100
100
|
version: "0.1.0",
|
|
101
|
-
requires: { api:
|
|
101
|
+
requires: { api: 2 },
|
|
102
102
|
capabilities: ["models"],
|
|
103
103
|
setup(prism) {
|
|
104
104
|
prism.hooks.on("model.call", async (request, next) => {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createAgent, type ToolDefinition } from "@arnilo/prism";
|
|
2
|
+
import { mockProvider, providerDone, providerTextDelta, providerToolCall, toolCallContent } from "@arnilo/prism/testing";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Parallel tool rounds (plan 226 Task 4). Four tool calls of one model turn run at the same time,
|
|
6
|
+
* bounded by `tools.concurrency` (default 4); results are appended in call order. A round that holds an
|
|
7
|
+
* `exclusive` tool, a tool with no `effects`, or an unknown tool name stays serial, and
|
|
8
|
+
* `tools.concurrency: 1` restores the 0.14.0 behavior. Imports only `@arnilo/prism` and
|
|
9
|
+
* `@arnilo/prism/testing`. Network-free.
|
|
10
|
+
* Run: npm run build:core && node examples/parallel-tools.ts
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const sleep = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms));
|
|
14
|
+
|
|
15
|
+
function lookup(name: string, state: { active: number; maxActive: number }, extra: Partial<ToolDefinition> = {}): ToolDefinition {
|
|
16
|
+
return {
|
|
17
|
+
name,
|
|
18
|
+
description: `Look up ${name}.`,
|
|
19
|
+
effects: ["read"],
|
|
20
|
+
async execute(_args, context) {
|
|
21
|
+
state.active += 1;
|
|
22
|
+
state.maxActive = Math.max(state.maxActive, state.active);
|
|
23
|
+
await sleep(40);
|
|
24
|
+
state.active -= 1;
|
|
25
|
+
return { toolCallId: context.toolCallId, name, value: `${name} done` };
|
|
26
|
+
},
|
|
27
|
+
...extra,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function round(options: { readonly concurrency?: number; readonly exclusive?: boolean }) {
|
|
32
|
+
const names = ["alpha", "beta", "gamma", "delta"];
|
|
33
|
+
const state = { active: 0, maxActive: 0 };
|
|
34
|
+
const agent = await createAgent({
|
|
35
|
+
id: `parallel-tools-${options.concurrency ?? "default"}-${options.exclusive === true ? "exclusive" : "open"}`,
|
|
36
|
+
model: { provider: "mock", model: "demo" },
|
|
37
|
+
packages: [
|
|
38
|
+
mockProvider([
|
|
39
|
+
[...names.map((name) => providerToolCall(toolCallContent(`call-${name}`, name, {}))), providerDone()],
|
|
40
|
+
[providerTextDelta("all four answered"), providerDone()],
|
|
41
|
+
]),
|
|
42
|
+
],
|
|
43
|
+
tools: {
|
|
44
|
+
add: names.map((name) => lookup(name, state, options.exclusive === true && name === "gamma" ? { exclusive: true } : {})),
|
|
45
|
+
...(options.concurrency === undefined ? {} : { concurrency: options.concurrency }),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const session = await agent.session();
|
|
49
|
+
const started = performance.now();
|
|
50
|
+
const result = await session.run("look everything up");
|
|
51
|
+
const ms = performance.now() - started;
|
|
52
|
+
const order = result.messages.flatMap((message) =>
|
|
53
|
+
message.content.filter((block) => block.type === "tool_result").map((block) => block.toolCallId),
|
|
54
|
+
);
|
|
55
|
+
await agent.dispose();
|
|
56
|
+
return { status: result.status, maxActive: state.maxActive, fast: ms < 150, resultOrder: order };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function demo(): Promise<Record<string, unknown>> {
|
|
60
|
+
return {
|
|
61
|
+
// Default: the four calls overlap.
|
|
62
|
+
parallel: await round({}),
|
|
63
|
+
// `concurrency: 1` restores serial dispatch.
|
|
64
|
+
serial: await round({ concurrency: 1 }),
|
|
65
|
+
// One `exclusive` tool keeps its whole round serial.
|
|
66
|
+
exclusive: await round({ exclusive: true }),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (import.meta.url === `file://${process.argv[1]}`) console.log(JSON.stringify(await demo()));
|
|
@@ -303,7 +303,7 @@ function workspaceProbe(): { readonly package: PackageInstance; readonly service
|
|
|
303
303
|
const instance = definePackage({
|
|
304
304
|
name: "example-workspace-probe",
|
|
305
305
|
version: "1.0.0",
|
|
306
|
-
requires: { api:
|
|
306
|
+
requires: { api: 2 },
|
|
307
307
|
setup: ({ services }) => {
|
|
308
308
|
service = services.consume<WorkspaceService>("workspace");
|
|
309
309
|
},
|
|
@@ -4,23 +4,23 @@ import { mkdtempSync, rmSync } from "node:fs";
|
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import {
|
|
7
|
-
type AgentEvent,
|
|
8
7
|
type Agent,
|
|
8
|
+
type AgentEvent,
|
|
9
|
+
createAgent,
|
|
10
|
+
definePackage,
|
|
9
11
|
type ModelProvider,
|
|
10
12
|
type PackageInstance,
|
|
13
|
+
PackageLoadError,
|
|
11
14
|
type ProviderRequest,
|
|
12
|
-
type Session,
|
|
13
|
-
SlotConflictError,
|
|
14
|
-
createAgent,
|
|
15
|
-
definePackage,
|
|
16
15
|
providerDone,
|
|
17
16
|
providerTextDelta,
|
|
18
17
|
providerToolCall,
|
|
18
|
+
type Session,
|
|
19
19
|
toolCallContent,
|
|
20
20
|
} from "@arnilo/prism";
|
|
21
21
|
import memoryCompaction from "@arnilo/prism-extensions/compaction";
|
|
22
|
-
import memorySystem from "@arnilo/prism-memory-system";
|
|
23
22
|
import { sqliteStore } from "@arnilo/prism-extensions/store-sqlite";
|
|
23
|
+
import memorySystem from "@arnilo/prism-memory-system";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Session memory (`@arnilo/prism-memory-system`'s session tiers), proved end to end over a durable
|
|
@@ -37,8 +37,9 @@ import { sqliteStore } from "@arnilo/prism-extensions/store-sqlite";
|
|
|
37
37
|
* counts, the rendered ledger, and whether `recall` was offered to the model.
|
|
38
38
|
* 5. **The host holds no memory logic.** This file lists packages, runs commands, reads the session's
|
|
39
39
|
* entries, and reads `memory.session.status` events. Nothing here touches a ledger, a worker, or a prompt.
|
|
40
|
-
* 6. **
|
|
41
|
-
*
|
|
40
|
+
* 6. **One compaction system per agent.** Listing LLM compaction beside session memory's compaction fails
|
|
41
|
+
* `createAgent` (`PackageLoadError`, `memory_system_compaction_conflict`) whatever the slot assignment; turning
|
|
42
|
+
* session memory's off (`context: { compaction: false }`) leaves the slot to LLM compaction and `inspect()` names it.
|
|
42
43
|
*
|
|
43
44
|
* Imports only `@arnilo/prism`, the two memory packages, and `@arnilo/prism-extensions/store-sqlite`; the mock
|
|
44
45
|
* provider is inline, so there is no credential and no network. The first turn carries a sentinel
|
|
@@ -74,7 +75,8 @@ function demoProvider(recorder: Recorder): ModelProvider {
|
|
|
74
75
|
}
|
|
75
76
|
const answered = request.messages.some((message) => message.role === "tool");
|
|
76
77
|
const prompt = request.messages.find((message) => message.role === "user")?.content[0];
|
|
77
|
-
const sourceId =
|
|
78
|
+
const sourceId =
|
|
79
|
+
prompt?.type === "text" ? /\[[^\]]+\] \[([^\]]+)\] (?:user|assistant|tool|system):/.exec(prompt.text)?.[1] : undefined;
|
|
78
80
|
if (!answered && sourceId) {
|
|
79
81
|
yield providerToolCall(
|
|
80
82
|
toolCallContent("observe-1", "record_event", {
|
|
@@ -97,7 +99,7 @@ function mockProviderPackage(recorder: Recorder): PackageInstance {
|
|
|
97
99
|
name: "@acme/observational-memory-demo-provider",
|
|
98
100
|
version: "1.0.0",
|
|
99
101
|
description: "The demo's scripted provider for the main and observer models.",
|
|
100
|
-
requires: { api:
|
|
102
|
+
requires: { api: 2 },
|
|
101
103
|
setup(prism) {
|
|
102
104
|
prism.providers.register(demoProvider(recorder));
|
|
103
105
|
},
|
|
@@ -120,7 +122,7 @@ async function buildAgent(dir: string, recorder: Recorder): Promise<DemoAgent> {
|
|
|
120
122
|
mockProviderPackage(recorder),
|
|
121
123
|
// The package is inert until a session's `memory:session` toggle turns it on. `triggerTokens: 1` makes the
|
|
122
124
|
// first eligible turn cross the observation threshold, so one pass runs in one turn.
|
|
123
|
-
memorySystem({ stm: { model: OBSERVER_MODEL, triggerTokens: 1 }
|
|
125
|
+
memorySystem({ stm: { model: OBSERVER_MODEL, triggerTokens: 1 } }),
|
|
124
126
|
],
|
|
125
127
|
hooks: (hooks: { on: (name: "package.event", handler: (payload: unknown) => void) => void }) => {
|
|
126
128
|
hooks.on("package.event", (payload) => events.push(payload as AgentEvent));
|
|
@@ -134,7 +136,7 @@ type OmStatus = {
|
|
|
134
136
|
readonly contextMode: "none" | "own-compaction" | "pinned";
|
|
135
137
|
readonly stm: unknown;
|
|
136
138
|
readonly observations: { readonly recorded: number; readonly active: number };
|
|
137
|
-
readonly
|
|
139
|
+
readonly wmItems: { readonly recorded: number };
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
/** Reads the package's own status command — the host's only view of memory state. */
|
|
@@ -152,28 +154,29 @@ async function waitForObservations(agent: Agent, session: Session, atLeast: numb
|
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
/** Criterion 6:
|
|
157
|
+
/** Criterion 6: two compaction systems fail closed, and turning session memory's off leaves the slot to the other. */
|
|
156
158
|
async function slotAssignment(): Promise<{ conflict: string; owner: string }> {
|
|
157
159
|
const recorder: Recorder = { requests: [] };
|
|
158
|
-
const both = () => [mockProviderPackage(recorder), memorySystem({}), memoryCompaction({})];
|
|
159
160
|
let conflict = "";
|
|
160
161
|
try {
|
|
161
|
-
await createAgent({
|
|
162
|
+
await createAgent({
|
|
163
|
+
model: MAIN_MODEL,
|
|
164
|
+
packages: [mockProviderPackage(recorder), memoryCompaction({}), memorySystem({})],
|
|
165
|
+
slots: { compaction: OM_PACKAGE },
|
|
166
|
+
});
|
|
162
167
|
} catch (error) {
|
|
163
|
-
assert.ok(error instanceof
|
|
164
|
-
assert.
|
|
165
|
-
|
|
166
|
-
conflict = error.code;
|
|
168
|
+
assert.ok(error instanceof PackageLoadError, `expected PackageLoadError, got ${String(error)}`);
|
|
169
|
+
assert.match(error.message, /memory_system_compaction_conflict/);
|
|
170
|
+
conflict = "memory_system_compaction_conflict";
|
|
167
171
|
}
|
|
168
|
-
assert.equal(conflict, "
|
|
172
|
+
assert.equal(conflict, "memory_system_compaction_conflict", "two compaction systems must fail closed");
|
|
169
173
|
|
|
170
174
|
const resolved = await createAgent({
|
|
171
175
|
model: MAIN_MODEL,
|
|
172
|
-
packages:
|
|
173
|
-
slots: { compaction: OM_PACKAGE },
|
|
176
|
+
packages: [mockProviderPackage(recorder), memoryCompaction({}), memorySystem({ context: { compaction: false } })],
|
|
174
177
|
});
|
|
175
178
|
const owner = (await resolved.inspect()).slots.compaction;
|
|
176
|
-
assert.equal(owner,
|
|
179
|
+
assert.equal(owner, COMPACTION_PACKAGE, "with session compaction off, LLM compaction owns the slot");
|
|
177
180
|
await resolved.dispose();
|
|
178
181
|
return { conflict, owner };
|
|
179
182
|
}
|
|
@@ -185,7 +188,7 @@ type PhaseB = {
|
|
|
185
188
|
readonly enabled: boolean;
|
|
186
189
|
readonly observer: string;
|
|
187
190
|
readonly observations: number;
|
|
188
|
-
readonly
|
|
191
|
+
readonly wmItems: number;
|
|
189
192
|
readonly messageCount: number;
|
|
190
193
|
readonly ledgerHasObservation: boolean;
|
|
191
194
|
readonly recallVisible: boolean;
|
|
@@ -248,7 +251,7 @@ async function phaseA(script: string): Promise<Record<string, unknown>> {
|
|
|
248
251
|
assert.equal(b.enabled, true, "the toggle survived the restart");
|
|
249
252
|
assert.equal(b.observer, OBSERVER_MODEL, "the observer model is unchanged");
|
|
250
253
|
assert.equal(b.observations >= 2, true, "the ledger still holds A's observations");
|
|
251
|
-
assert.equal(b.
|
|
254
|
+
assert.equal(b.wmItems, 0, "the WM trigger was never crossed");
|
|
252
255
|
assert.equal(b.ledgerHasObservation, true, "the rendered ledger carries the observation");
|
|
253
256
|
assert.equal(b.recallVisible, true, "the toggled session is offered recall");
|
|
254
257
|
assert.equal(b.messageCount, messageCount, "phase B sees the same messages");
|
|
@@ -294,7 +297,7 @@ async function phaseB(dir: string, sessionId: string, leafId: string): Promise<P
|
|
|
294
297
|
enabled: status.enabled,
|
|
295
298
|
observer: String(status.stm),
|
|
296
299
|
observations: status.observations.recorded,
|
|
297
|
-
|
|
300
|
+
wmItems: status.wmItems.recorded,
|
|
298
301
|
messageCount,
|
|
299
302
|
ledgerHasObservation: view.text.includes("OBSERVED-FACT"),
|
|
300
303
|
recallVisible,
|
|
@@ -7,7 +7,7 @@ import { mockProvider } from "@arnilo/prism/testing";
|
|
|
7
7
|
* The agent runs on two `mockProvider` packages: `main` answers the run and `side` is reached only through
|
|
8
8
|
* `PackageAPI.models.client("side/side")` from inside the `ask_side` tool. The package declares the `models`
|
|
9
9
|
* capability; the main provider emits the tool call, the tool streams the side model's text, and the side
|
|
10
|
-
* provider is called exactly once. Imports only `@arnilo/prism` and `@arnilo/prism/testing`. Network-free.
|
|
10
|
+
* provider is called exactly once. The tool passes its `context.session` so the side call is charged to the run. Imports only `@arnilo/prism` and `@arnilo/prism/testing`. Network-free.
|
|
11
11
|
* Run: npm run build:core && node examples/side-call.ts
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ export async function demo(): Promise<Record<string, unknown>> {
|
|
|
18
18
|
const sideCall = definePackage({
|
|
19
19
|
name: "@acme/side-call",
|
|
20
20
|
version: "1.0.0",
|
|
21
|
-
requires: { api:
|
|
21
|
+
requires: { api: 2 },
|
|
22
22
|
capabilities: ["models"],
|
|
23
23
|
setup(prism) {
|
|
24
24
|
prism.tools.register({
|
|
@@ -26,9 +26,13 @@ export async function demo(): Promise<Record<string, unknown>> {
|
|
|
26
26
|
description: "Asks the side model a question and returns its text.",
|
|
27
27
|
parameters: { type: "object", properties: { question: { type: "string" } }, required: ["question"] },
|
|
28
28
|
execute: async (args, context) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// Passing the tool's session runs the call on the hook plane and charges it to this run's limits.
|
|
30
|
+
for await (const event of prism.models
|
|
31
|
+
.client("side/side")
|
|
32
|
+
.generate(
|
|
33
|
+
{ messages: [{ role: "user", content: [{ type: "text", text: String(args.question ?? "") }] }] },
|
|
34
|
+
{ session: context.session },
|
|
35
|
+
)) {
|
|
32
36
|
if (event.type === "content_delta" && event.content.type === "text") sideText += event.content.text;
|
|
33
37
|
}
|
|
34
38
|
return { toolCallId: context.toolCallId, name: "ask_side", value: sideText };
|
|
@@ -33,7 +33,7 @@ const counter = definePackage<CounterConfig>({
|
|
|
33
33
|
name: "@acme/sqlite-counter",
|
|
34
34
|
version: "1.0.0",
|
|
35
35
|
description: "Bumps a counter kept in session state.",
|
|
36
|
-
requires: { api:
|
|
36
|
+
requires: { api: 2 },
|
|
37
37
|
capabilities: ["session-state"],
|
|
38
38
|
config: {
|
|
39
39
|
type: "object",
|