@agentproto/runtime 2.11.0 → 2.12.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 +26 -0
- package/dist/catalog-models.d.ts +1 -1
- package/dist/catalog-models.mjs.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/index.d.ts +167 -5
- package/dist/index.mjs +7871 -6376
- package/dist/index.mjs.map +1 -1
- package/dist/pr-provenance.d.ts +26 -1
- package/dist/pr-provenance.mjs +20 -3
- package/dist/pr-provenance.mjs.map +1 -1
- package/dist/resume-strategies.mjs.map +1 -1
- package/dist/{spawn-defaults-DUnTfwVK.d.ts → spawn-defaults-D4W661ui.d.ts} +8 -0
- package/dist/tool-envelope.d.ts +42 -0
- package/dist/tool-envelope.mjs +60 -0
- package/dist/tool-envelope.mjs.map +1 -0
- package/package.json +23 -17
|
@@ -136,6 +136,14 @@ interface ResolvedSpawnAuthMaterial {
|
|
|
136
136
|
* key" (fail-fast) from "set nothing" (ambient) — both give no credential.
|
|
137
137
|
* DECISION 5. */
|
|
138
138
|
explicit: boolean;
|
|
139
|
+
/** True when the `auth` block came from CONFIG (`defaults.adapters.<slug>.auth`)
|
|
140
|
+
* rather than the per-spawn `agent_start.auth` request. A sandboxed spawn
|
|
141
|
+
* bills on the BOX daemon, which has neither the host's config nor its
|
|
142
|
+
* keychain — the host uses this to know it must resolve the configured
|
|
143
|
+
* wallet credential itself and forward it (see `session-spawn.ts`'s
|
|
144
|
+
* `resolveHostAuth`). A per-spawn `auth` keeps its own raw-forward path
|
|
145
|
+
* and never forces host adapter resolution. */
|
|
146
|
+
explicitConfig: boolean;
|
|
139
147
|
/** Subscription bearer token (per-spawn > config), if configured. STATIC
|
|
140
148
|
* material only — the self-refreshing {@link subscriptionSource} is resolved
|
|
141
149
|
* separately (and impurely) by the caller. */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Shared pagination params, spread into every list tool's input schema. */
|
|
4
|
+
interface PageParams {
|
|
5
|
+
limit?: number;
|
|
6
|
+
cursor?: string;
|
|
7
|
+
since?: number;
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
full?: boolean;
|
|
10
|
+
fields?: string[];
|
|
11
|
+
}
|
|
12
|
+
interface Page<T> {
|
|
13
|
+
items: T[];
|
|
14
|
+
nextCursor?: string;
|
|
15
|
+
total?: number;
|
|
16
|
+
truncated?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Opaque cursor: base64(JSON `{ k: keysetValue, i: index }`). */
|
|
19
|
+
interface CursorPayload {
|
|
20
|
+
k: string | number | null;
|
|
21
|
+
i: number;
|
|
22
|
+
}
|
|
23
|
+
declare function encodeCursor(payload: CursorPayload): string;
|
|
24
|
+
/** No `unknown`/`as`: the JSON boundary is typed by zod's safeParse/parse. */
|
|
25
|
+
declare function decodeCursor(token: string): CursorPayload | null;
|
|
26
|
+
interface PaginateOpts<T> {
|
|
27
|
+
maxLimit: number;
|
|
28
|
+
keyOf?: (item: T) => string | number | null;
|
|
29
|
+
}
|
|
30
|
+
declare function paginate<T>(items: readonly T[], params: PageParams, opts: PaginateOpts<T>): Page<T>;
|
|
31
|
+
/** Compact serializer — replaces every `JSON.stringify(x, null, 2)` in list handlers. */
|
|
32
|
+
declare function toolText<T>(page: Page<T>): string;
|
|
33
|
+
/** Zod fragment to spread into each list tool's input schema. */
|
|
34
|
+
declare const pageParamsShape: {
|
|
35
|
+
readonly limit: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
readonly cursor: z.ZodOptional<z.ZodString>;
|
|
37
|
+
readonly compact: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
readonly full: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
readonly fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { type CursorPayload, type Page, type PageParams, type PaginateOpts, decodeCursor, encodeCursor, pageParamsShape, paginate, toolText };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @agentproto/runtime v0.1.0-alpha
|
|
5
|
+
* Long-running gateway: MCP server + HTTP transport + HEARTBEAT autonomy + conversation persistence over a workspace dir.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
function encodeCursor(payload) {
|
|
9
|
+
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64url");
|
|
10
|
+
}
|
|
11
|
+
var cursorPayloadSchema = z.object({
|
|
12
|
+
k: z.union([z.string(), z.number(), z.null()]),
|
|
13
|
+
i: z.number().int().min(0)
|
|
14
|
+
});
|
|
15
|
+
function decodeCursor(token) {
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
text = Buffer.from(token, "base64url").toString("utf8");
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
return cursorPayloadSchema.parse(JSON.parse(text));
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function paginate(items, params, opts) {
|
|
29
|
+
const limit = Math.min(Math.max(params.limit ?? 50, 1), opts.maxLimit);
|
|
30
|
+
let start = 0;
|
|
31
|
+
if (params.cursor) {
|
|
32
|
+
const decoded = decodeCursor(params.cursor);
|
|
33
|
+
if (decoded && decoded.i >= 0 && decoded.i <= items.length) start = decoded.i;
|
|
34
|
+
}
|
|
35
|
+
const end = start + limit;
|
|
36
|
+
const slice = items.slice(start, end);
|
|
37
|
+
const keyAt = (idx) => {
|
|
38
|
+
const item = items[idx];
|
|
39
|
+
return opts.keyOf && item !== void 0 ? opts.keyOf(item) : null;
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
items: slice,
|
|
43
|
+
...end < items.length ? { nextCursor: encodeCursor({ k: keyAt(end), i: end }) } : {},
|
|
44
|
+
total: items.length
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function toolText(page) {
|
|
48
|
+
return JSON.stringify(page);
|
|
49
|
+
}
|
|
50
|
+
var pageParamsShape = {
|
|
51
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max items per page. Default 50."),
|
|
52
|
+
cursor: z.string().optional().describe("Opaque token from a prior call's `nextCursor`."),
|
|
53
|
+
compact: z.boolean().optional().describe("Compact projection (fewer fields per item). Default false."),
|
|
54
|
+
full: z.boolean().optional().describe("Legacy full-record payload (opts out of compact). Default false."),
|
|
55
|
+
fields: z.array(z.string()).optional().describe("Keep only these fields per item.")
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { decodeCursor, encodeCursor, pageParamsShape, paginate, toolText };
|
|
59
|
+
//# sourceMappingURL=tool-envelope.mjs.map
|
|
60
|
+
//# sourceMappingURL=tool-envelope.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tool-envelope.ts"],"names":[],"mappings":";;;;;;;AAyBO,SAAS,aAAa,OAAA,EAAgC;AAC3D,EAAA,OAAO,MAAA,CAAO,KAAK,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA,EAAG,MAAM,CAAA,CAAE,QAAA,CAAS,WAAW,CAAA;AAC1E;AAEA,IAAM,mBAAA,GAAsB,EAAE,MAAA,CAAO;AAAA,EACnC,CAAA,EAAG,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,CAAA,CAAE,MAAA,EAAO,EAAG,CAAA,CAAE,IAAA,EAAM,CAAC,CAAA;AAAA,EAC7C,GAAG,CAAA,CAAE,MAAA,GAAS,GAAA,EAAI,CAAE,IAAI,CAAC;AAC3B,CAAC,CAAA;AAGM,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI;AACF,IAAA,IAAA,GAAO,OAAO,IAAA,CAAK,KAAA,EAAO,WAAW,CAAA,CAAE,SAAS,MAAM,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AA,EAAG,KAAA,CAAM,GAAG,CAAA,EAAG,CAAA,EAAG,KAAK,CAAA,KAAM,EAAC;AAAA,IACpF,OAAO,KAAA,CAAM;AAAA,GACf;AACF;AAGO,SAAS,SAAY,IAAA,EAAuB;AACjD,EAAA,OAAO,IAAA,CAAK,UAAU,IAAI,CAAA;AAC5B;AAGO,IAAM,eAAA,GAAkB;AAAA,EAC7B,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,KAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA,CAAE,QAAA,EAAS,CAAE,SAAS,iCAAiC,CAAA;AAAA,EAC7F,QAAQ,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,gDAAgD,CAAA;AAAA,EACvF,SAAS,CAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,SAAS,4DAA4D,CAAA;AAAA,EACrG,MAAM,CAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,SAAS,kEAAkE,CAAA;AAAA,EACxG,MAAA,EAAQ,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,MAAA,EAAQ,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,CAAS,kCAAkC;AACpF","file":"tool-envelope.mjs","sourcesContent":["import { z } from \"zod\"\n\n/** Shared pagination params, spread into every list tool's input schema. */\nexport interface PageParams {\n limit?: number\n cursor?: string\n since?: number\n compact?: boolean\n full?: boolean\n fields?: string[]\n}\n\nexport interface Page<T> {\n items: T[]\n nextCursor?: string\n total?: number\n truncated?: boolean\n}\n\n/** Opaque cursor: base64(JSON `{ k: keysetValue, i: index }`). */\nexport interface CursorPayload {\n k: string | number | null\n i: number\n}\n\nexport function encodeCursor(payload: CursorPayload): string {\n return Buffer.from(JSON.stringify(payload), \"utf8\").toString(\"base64url\")\n}\n\nconst cursorPayloadSchema = z.object({\n k: z.union([z.string(), z.number(), z.null()]),\n i: z.number().int().min(0),\n})\n\n/** No `unknown`/`as`: the JSON boundary is typed by zod's safeParse/parse. */\nexport function decodeCursor(token: string): CursorPayload | null {\n let text: string\n try {\n text = Buffer.from(token, \"base64url\").toString(\"utf8\")\n } catch {\n return null\n }\n try {\n return cursorPayloadSchema.parse(JSON.parse(text))\n } catch {\n return null\n }\n}\n\nexport interface PaginateOpts<T> {\n maxLimit: number\n keyOf?: (item: T) => string | number | null\n}\n\nexport function paginate<T>(items: readonly T[], params: PageParams, opts: PaginateOpts<T>): Page<T> {\n const limit = Math.min(Math.max(params.limit ?? 50, 1), opts.maxLimit)\n let start = 0\n if (params.cursor) {\n const decoded = decodeCursor(params.cursor)\n if (decoded && decoded.i >= 0 && decoded.i <= items.length) start = decoded.i\n }\n const end = start + limit\n const slice = items.slice(start, end)\n const keyAt = (idx: number): string | number | null => {\n const item = items[idx]\n return opts.keyOf && item !== undefined ? opts.keyOf(item) : null\n }\n return {\n items: slice,\n ...(end < items.length ? { nextCursor: encodeCursor({ k: keyAt(end), i: end }) } : {}),\n total: items.length,\n }\n}\n\n/** Compact serializer — replaces every `JSON.stringify(x, null, 2)` in list handlers. */\nexport function toolText<T>(page: Page<T>): string {\n return JSON.stringify(page)\n}\n\n/** Zod fragment to spread into each list tool's input schema. */\nexport const pageParamsShape = {\n limit: z.number().int().min(1).max(200).optional().describe(\"Max items per page. Default 50.\"),\n cursor: z.string().optional().describe(\"Opaque token from a prior call's `nextCursor`.\"),\n compact: z.boolean().optional().describe(\"Compact projection (fewer fields per item). Default false.\"),\n full: z.boolean().optional().describe(\"Legacy full-record payload (opts out of compact). Default false.\"),\n fields: z.array(z.string()).optional().describe(\"Keep only these fields per item.\"),\n} as const\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/runtime",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "@agentproto/runtime — long-running gateway that turns an agentproto workspace into a live runtime. Composes @agentproto/mcp-server (CRUD verbs) with HTTP transport, HEARTBEAT.md autonomy loop, and append-only conversation persistence. Drop a workspace dir, point your MCP client at it, and the agent ticks on its own.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -105,6 +105,11 @@
|
|
|
105
105
|
"types": "./dist/user-presets.d.ts",
|
|
106
106
|
"import": "./dist/user-presets.mjs",
|
|
107
107
|
"default": "./dist/user-presets.mjs"
|
|
108
|
+
},
|
|
109
|
+
"./tool-envelope": {
|
|
110
|
+
"types": "./dist/tool-envelope.d.ts",
|
|
111
|
+
"import": "./dist/tool-envelope.mjs",
|
|
112
|
+
"default": "./dist/tool-envelope.mjs"
|
|
108
113
|
}
|
|
109
114
|
},
|
|
110
115
|
"files": [
|
|
@@ -122,34 +127,35 @@
|
|
|
122
127
|
"gray-matter": "^4.0.3",
|
|
123
128
|
"ws": "^8.21.3",
|
|
124
129
|
"zod": "^4.5.4",
|
|
125
|
-
"@agentproto/acp": "0.
|
|
130
|
+
"@agentproto/acp": "0.8.0",
|
|
126
131
|
"@agentproto/agent": "0.2.2",
|
|
127
|
-
"@agentproto/app-
|
|
128
|
-
"@agentproto/
|
|
132
|
+
"@agentproto/app-client": "0.3.0",
|
|
133
|
+
"@agentproto/app-kit": "1.0.0",
|
|
134
|
+
"@agentproto/apps": "0.9.1",
|
|
129
135
|
"@agentproto/auth": "1.0.1",
|
|
130
136
|
"@agentproto/command-sandbox": "0.2.0",
|
|
131
137
|
"@agentproto/driver": "0.2.1",
|
|
132
|
-
"@agentproto/driver-agent-cli": "2.4.
|
|
133
|
-
"@agentproto/eval-reporters": "0.2.
|
|
138
|
+
"@agentproto/driver-agent-cli": "2.4.1",
|
|
139
|
+
"@agentproto/eval-reporters": "0.2.10",
|
|
134
140
|
"@agentproto/manifest": "0.2.1",
|
|
135
|
-
"@agentproto/
|
|
136
|
-
"@agentproto/
|
|
141
|
+
"@agentproto/model-catalog": "0.9.2",
|
|
142
|
+
"@agentproto/mcp-server": "0.2.7",
|
|
137
143
|
"@agentproto/provider-kit": "0.4.2",
|
|
138
144
|
"@agentproto/provider-presets": "0.6.1",
|
|
139
|
-
"@agentproto/providers-store": "0.3.
|
|
145
|
+
"@agentproto/providers-store": "0.3.11",
|
|
140
146
|
"@agentproto/redaction": "0.2.1",
|
|
141
147
|
"@agentproto/routine": "0.2.1",
|
|
142
|
-
"@agentproto/sandbox": "0.
|
|
148
|
+
"@agentproto/sandbox": "0.3.0",
|
|
143
149
|
"@agentproto/secrets": "0.2.4",
|
|
144
|
-
"@agentproto/telemetry-langfuse": "0.2.
|
|
150
|
+
"@agentproto/telemetry-langfuse": "0.2.8",
|
|
151
|
+
"@agentproto/workflow-loader": "0.2.0",
|
|
145
152
|
"@agentproto/tool": "0.2.2",
|
|
146
|
-
"@agentproto/workflow": "0.
|
|
147
|
-
"@agentproto/workflow-
|
|
148
|
-
"@agentproto/
|
|
149
|
-
"@agentproto/workspace-brain": "0.4.2"
|
|
153
|
+
"@agentproto/workflow": "0.4.0",
|
|
154
|
+
"@agentproto/workflow-runtime": "0.10.0",
|
|
155
|
+
"@agentproto/workspace-brain": "0.4.3"
|
|
150
156
|
},
|
|
151
157
|
"optionalDependencies": {
|
|
152
|
-
"@agentproto/sandbox-e2b": "0.
|
|
158
|
+
"@agentproto/sandbox-e2b": "0.4.0"
|
|
153
159
|
},
|
|
154
160
|
"devDependencies": {
|
|
155
161
|
"@types/node": "^25.6.2",
|
|
@@ -159,7 +165,7 @@
|
|
|
159
165
|
"vite-node": "^3.2.4",
|
|
160
166
|
"vitest": "^3.2.4",
|
|
161
167
|
"@agentproto/rendezvous": "0.2.2",
|
|
162
|
-
"@agentproto/tooling": "0.1.0
|
|
168
|
+
"@agentproto/tooling": "0.1.0",
|
|
163
169
|
"@agentproto/transcript-fixtures": "0.2.0"
|
|
164
170
|
},
|
|
165
171
|
"scripts": {
|