@letta-ai/letta-code 0.34.1 → 0.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gateway-core.js +621 -166
- package/dist/gateway-core.js.map +13 -8
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/memory-constraints.js +47 -13
- package/dist/memory-constraints.js.map +3 -3
- package/dist/types/agent/approval-execution.d.ts.map +1 -1
- package/dist/types/agent/memory-constraints.d.ts +2 -0
- package/dist/types/agent/memory-constraints.d.ts.map +1 -1
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/names.d.ts +1 -1
- package/dist/types/agent/subagents/names.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-depth.d.ts +15 -0
- package/dist/types/agent/subagents/subagent-depth.d.ts.map +1 -0
- package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-process.d.ts +7 -0
- package/dist/types/agent/subagents/subagent-process.d.ts.map +1 -1
- package/dist/types/backend/api/agent-message.d.ts.map +1 -1
- package/dist/types/backend/dev/local-provider-errors.d.ts.map +1 -1
- package/dist/types/backend/local/local-pi-credential-store.d.ts +4 -3
- package/dist/types/backend/local/local-pi-credential-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-provider-auth-store.d.ts +7 -0
- package/dist/types/backend/local/local-provider-auth-store.d.ts.map +1 -1
- package/dist/types/channels/gateway-assistant-relay.d.ts +37 -0
- package/dist/types/channels/gateway-assistant-relay.d.ts.map +1 -0
- package/dist/types/channels/gateway-core.d.ts +8 -50
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/channels/gateway-registration-policy.d.ts +14 -0
- package/dist/types/channels/gateway-registration-policy.d.ts.map +1 -0
- package/dist/types/channels/gateway-runtime-registration.d.ts +12 -0
- package/dist/types/channels/gateway-runtime-registration.d.ts.map +1 -0
- package/dist/types/channels/gateway-runtime-state.d.ts +48 -0
- package/dist/types/channels/gateway-runtime-state.d.ts.map +1 -0
- package/dist/types/channels/gateway-runtime-tool-scopes.d.ts +26 -0
- package/dist/types/channels/gateway-runtime-tool-scopes.d.ts.map +1 -0
- package/dist/types/channels/gateway-sources.d.ts +1 -0
- package/dist/types/channels/gateway-sources.d.ts.map +1 -1
- package/dist/types/channels/gateway-types.d.ts +71 -0
- package/dist/types/channels/gateway-types.d.ts.map +1 -0
- package/dist/types/channels/message-channel-executor.d.ts +1 -0
- package/dist/types/channels/message-channel-executor.d.ts.map +1 -1
- package/dist/types/channels/message-channel-idempotency.d.ts +14 -5
- package/dist/types/channels/message-channel-idempotency.d.ts.map +1 -1
- package/dist/types/channels/message-channel-tool-definition.d.ts +4 -1
- package/dist/types/channels/message-channel-tool-definition.d.ts.map +1 -1
- package/dist/types/channels/plugin-types.d.ts +3 -2
- package/dist/types/channels/plugin-types.d.ts.map +1 -1
- package/dist/types/channels/types.d.ts +3 -1
- package/dist/types/channels/types.d.ts.map +1 -1
- package/dist/types/cli/helpers/session-context.d.ts +10 -2
- package/dist/types/cli/helpers/session-context.d.ts.map +1 -1
- package/dist/types/headless-super-run-wait.d.ts.map +1 -1
- package/dist/types/mcp-scope.d.ts +5 -0
- package/dist/types/mcp-scope.d.ts.map +1 -0
- package/dist/types/memory-constraints.d.ts +4 -0
- package/dist/types/memory-constraints.d.ts.map +1 -1
- package/dist/types/mods/mod-engine.d.ts.map +1 -1
- package/dist/types/mods/turn-start-cancel.d.ts +17 -1
- package/dist/types/mods/turn-start-cancel.d.ts.map +1 -1
- package/dist/types/reminders/disk-space.d.ts +34 -0
- package/dist/types/reminders/disk-space.d.ts.map +1 -1
- package/dist/types/reminders/engine.d.ts +2 -0
- package/dist/types/reminders/engine.d.ts.map +1 -1
- package/dist/types/runtime-execution-settings.d.ts +5 -0
- package/dist/types/runtime-execution-settings.d.ts.map +1 -1
- package/dist/types/tools/impl/bash.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +4 -3
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/foreground-sleep.d.ts +13 -0
- package/dist/types/tools/impl/foreground-sleep.d.ts.map +1 -0
- package/dist/types/tools/impl/github-pull-request-watch.d.ts +11 -4
- package/dist/types/tools/impl/github-pull-request-watch.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +2 -0
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-launchers.d.ts.map +1 -1
- package/dist/types/tools/impl/task-foreground.d.ts +21 -0
- package/dist/types/tools/impl/task-foreground.d.ts.map +1 -0
- package/dist/types/tools/impl/task-stop.d.ts +1 -0
- package/dist/types/tools/impl/task-stop.d.ts.map +1 -1
- package/dist/types/tools/impl/task-transcript.d.ts +5 -0
- package/dist/types/tools/impl/task-transcript.d.ts.map +1 -0
- package/dist/types/tools/impl/task.d.ts +1 -1
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/tools/impl/workflow.d.ts.map +1 -1
- package/dist/types/tools/manager.d.ts +3 -5
- package/dist/types/tools/manager.d.ts.map +1 -1
- package/dist/types/tools/secret-substitution.d.ts +7 -0
- package/dist/types/tools/secret-substitution.d.ts.map +1 -1
- package/dist/types/tools/subagent-tool-policy.d.ts +16 -0
- package/dist/types/tools/subagent-tool-policy.d.ts.map +1 -0
- package/dist/types/tools/tool-name-mapping.d.ts +5 -0
- package/dist/types/tools/tool-name-mapping.d.ts.map +1 -0
- package/dist/types/tools/toolset-catalog.d.ts +1 -1
- package/dist/types/types/background-process-protocol.d.ts +15 -0
- package/dist/types/types/background-process-protocol.d.ts.map +1 -1
- package/dist/types/types/channel-account-protocol.d.ts +14 -0
- package/dist/types/types/channel-account-protocol.d.ts.map +1 -0
- package/dist/types/types/protocol_v2.d.ts +5 -11
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/utils/checkout-readiness.d.ts +1 -1
- package/dist/types/utils/checkout-readiness.d.ts.map +1 -1
- package/dist/types/utils/secrets-store.d.ts +2 -0
- package/dist/types/utils/secrets-store.d.ts.map +1 -1
- package/dist/types/utils/shell-context.d.ts +8 -0
- package/dist/types/utils/shell-context.d.ts.map +1 -1
- package/dist/types/utils/subagent-depth-env.d.ts +9 -0
- package/dist/types/utils/subagent-depth-env.d.ts.map +1 -0
- package/dist/types/websocket/listener/background-process-snapshot.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +5 -0
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/letta.js +34224 -32731
- package/package.json +1 -1
- package/scripts/source-file-size-baseline.json +4 -4
- package/skills/context-doctor/SKILL.md +1 -1
- package/skills/creating-mods/references/events.md +2 -0
- package/skills/self-configuration/SKILL.md +32 -38
|
@@ -76,7 +76,8 @@ function validateMemoryFileFrontmatter({
|
|
|
76
76
|
// src/memory-constraints.ts
|
|
77
77
|
async function validateMemoryTreeConstraints(reader, options) {
|
|
78
78
|
const errors = [];
|
|
79
|
-
const
|
|
79
|
+
const allFiles = await reader.listFiles();
|
|
80
|
+
const files = allFiles.filter((file) => file.path.endsWith(".md"));
|
|
80
81
|
const paths = new Set(files.map((file) => file.path));
|
|
81
82
|
const v2 = options.layout === "root-marker" && (options.requireRootMarker || paths.has("MEMORY.md"));
|
|
82
83
|
if (v2 && !paths.has("MEMORY.md")) {
|
|
@@ -101,9 +102,8 @@ async function validateMemoryTreeConstraints(reader, options) {
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
function compilePattern(pattern) {
|
|
105
106
|
let source = "^";
|
|
106
|
-
const pattern = override.pattern;
|
|
107
107
|
for (let index = 0;index < pattern.length; index++) {
|
|
108
108
|
const character = pattern.charAt(index);
|
|
109
109
|
if (character === "*") {
|
|
@@ -122,8 +122,31 @@ async function validateMemoryTreeConstraints(reader, options) {
|
|
|
122
122
|
else
|
|
123
123
|
source += "^$.*+?()[]{}|".includes(character) || character.charCodeAt(0) === 92 ? String.fromCharCode(92) + character : character;
|
|
124
124
|
}
|
|
125
|
-
return
|
|
126
|
-
}
|
|
125
|
+
return new RegExp(`${source}$`);
|
|
126
|
+
}
|
|
127
|
+
const overrides = (options.config.fileCharacterLimits ?? []).map((override) => ({ ...override, regex: compilePattern(override.pattern) }));
|
|
128
|
+
const protectedPatterns = (options.config.readOnlyFiles ?? []).map(compilePattern);
|
|
129
|
+
if (protectedPatterns.length) {
|
|
130
|
+
const accepted = options.acceptedTree;
|
|
131
|
+
if (!accepted)
|
|
132
|
+
throw new Error("readOnlyFiles requires the accepted memory tree");
|
|
133
|
+
const previous = new Map((await accepted.listFiles()).map((file) => [file.path, file.mode]));
|
|
134
|
+
const proposed = new Map(allFiles.map((file) => [file.path, file.mode]));
|
|
135
|
+
for (const path of new Set([...previous.keys(), ...proposed.keys()])) {
|
|
136
|
+
if (!protectedPatterns.some((pattern) => pattern.test(path)))
|
|
137
|
+
continue;
|
|
138
|
+
let changed = previous.get(path) !== proposed.get(path);
|
|
139
|
+
if (!changed) {
|
|
140
|
+
const before = await accepted.readFile(path);
|
|
141
|
+
const after = await reader.readFile(path);
|
|
142
|
+
if (before === null || after === null)
|
|
143
|
+
throw new Error(`${path}: cannot read protected file`);
|
|
144
|
+
changed = before.length !== after.length || before.some((value, index) => value !== after[index]);
|
|
145
|
+
}
|
|
146
|
+
if (changed)
|
|
147
|
+
errors.push(`${path}: read-only file cannot be created, changed or removed`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
127
150
|
let coreCharacters = 0;
|
|
128
151
|
for (const { path, mode } of memoryFiles) {
|
|
129
152
|
if (!mode.startsWith("100")) {
|
|
@@ -183,7 +206,8 @@ function parseMemoryConstraintsConfig(content) {
|
|
|
183
206
|
"maxDepth",
|
|
184
207
|
"maxFileCharacters",
|
|
185
208
|
"maxCoreMemoryCharacters",
|
|
186
|
-
"fileCharacterLimits"
|
|
209
|
+
"fileCharacterLimits",
|
|
210
|
+
"readOnlyFiles"
|
|
187
211
|
]);
|
|
188
212
|
for (const key of Object.keys(config)) {
|
|
189
213
|
if (!keys.has(key))
|
|
@@ -200,6 +224,21 @@ function parseMemoryConstraintsConfig(content) {
|
|
|
200
224
|
}
|
|
201
225
|
}
|
|
202
226
|
const overrides = config.fileCharacterLimits;
|
|
227
|
+
function validatePattern(pattern, label) {
|
|
228
|
+
if (typeof pattern !== "string" || !pattern || pattern.startsWith("/") || pattern.includes(String.fromCharCode(92)) || pattern.split("/").includes("..")) {
|
|
229
|
+
errors.push(`${label}: pattern must be a non-empty repo-relative glob using '/'`);
|
|
230
|
+
} else if (pattern.split("/").some((segment) => segment.includes("**") && segment !== "**")) {
|
|
231
|
+
errors.push(`${label}: '**' must be a complete path segment`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (config.readOnlyFiles !== undefined) {
|
|
235
|
+
if (!Array.isArray(config.readOnlyFiles))
|
|
236
|
+
errors.push(`${path}: readOnlyFiles must be an array`);
|
|
237
|
+
else
|
|
238
|
+
config.readOnlyFiles.forEach((pattern, index) => {
|
|
239
|
+
validatePattern(pattern, `${path}: readOnlyFiles[${index}]`);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
203
242
|
if (overrides !== undefined && !Array.isArray(overrides)) {
|
|
204
243
|
errors.push(`${path}: fileCharacterLimits must be an array`);
|
|
205
244
|
}
|
|
@@ -215,12 +254,7 @@ function parseMemoryConstraintsConfig(content) {
|
|
|
215
254
|
if (key !== "pattern" && key !== "maxCharacters")
|
|
216
255
|
errors.push(`${label}: unknown field '${key}'`);
|
|
217
256
|
}
|
|
218
|
-
|
|
219
|
-
if (typeof pattern !== "string" || pattern.length === 0 || pattern.startsWith("/") || pattern.includes(String.fromCharCode(92)) || pattern.split("/").includes("..")) {
|
|
220
|
-
errors.push(`${label}: pattern must be a non-empty repo-relative glob using '/'`);
|
|
221
|
-
} else if (pattern.split("/").some((segment) => segment.includes("**") && segment !== "**")) {
|
|
222
|
-
errors.push(`${label}: '**' must be a complete path segment`);
|
|
223
|
-
}
|
|
257
|
+
validatePattern(item.pattern, label);
|
|
224
258
|
if (item.maxCharacters !== null && !(Number.isSafeInteger(item.maxCharacters) && Number(item.maxCharacters) > 0)) {
|
|
225
259
|
errors.push(`${label}: maxCharacters must be a positive integer or null`);
|
|
226
260
|
}
|
|
@@ -249,4 +283,4 @@ export {
|
|
|
249
283
|
DEFAULT_MEMORY_CONSTRAINTS_CONFIG
|
|
250
284
|
};
|
|
251
285
|
|
|
252
|
-
//# debugId=
|
|
286
|
+
//# debugId=FA3EC712727F4E9064756E2164756E21
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"sources": ["../src/memory-frontmatter.ts", "../src/memory-constraints.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export interface MemoryFileFrontmatterInput {\n path: string;\n content: string;\n /** Accepted contents of this path, never contents supplied by the change. */\n previousContent: string | null;\n format: \"memfs-v2\" | \"legacy\";\n}\n\n/**\n * Canonical content checks used by the installed hook and external tree readers.\n * The caller selects projected paths and supplies the trusted layout/base.\n * Legacy callers select added/modified files; v2 callers select the whole tree.\n * Ref operations, deletion/rename protection and policy authorization remain\n * caller responsibilities, not decisions made from the proposed file contents.\n * This is deliberately self-contained: the Git hook embeds its source so it\n * does not depend on a package installation in the memory repository.\n */\nexport function validateMemoryFileFrontmatter({\n path,\n content,\n previousContent,\n format,\n}: MemoryFileFrontmatterInput): string[] {\n const errors: string[] = [];\n const v2 = format === \"memfs-v2\";\n const lines = content.split(\"\\n\");\n if (v2 && path.split(\"/\").at(-1) === \"MEMORY.md\") {\n return lines[0] === \"---\"\n ? [`${path}: MEMORY.md must not have frontmatter`]\n : [];\n }\n if (lines[0] !== \"---\") {\n return [`${path}: missing frontmatter (must start with ---)`];\n }\n const closing = lines.indexOf(\"---\", 1);\n if (closing < 0) {\n return [\n `${path}: frontmatter opened but never closed (missing closing ---)`,\n ];\n }\n\n // Match the legacy hook's scalar protected field lookup. Do not interpret\n // YAML or turn a quoted value into a different authorization decision.\n function legacyValue(text: string | null, key: string): string {\n const previousLines = text?.split(\"\\n\") ?? [];\n const end = previousLines.indexOf(\"---\", 1);\n if (end < 0) return \"\";\n return previousLines\n .slice(1, end)\n .filter((line) => line.startsWith(`${key}:`))\n .map((line) => line.slice(key.length + 1).replace(/^ +| +$/g, \"\"))\n .join(\"\\n\");\n }\n\n if (\n !v2 &&\n previousContent &&\n legacyValue(previousContent, \"read_only\") === \"true\"\n ) {\n return [`${path}: file is read_only and cannot be modified`];\n }\n\n const seen = new Set<string>();\n const allowed = v2\n ? [\"name\", \"description\"]\n : [\"description\", \"read_only\", \"limit\"];\n for (const line of lines.slice(1, closing)) {\n if (!line) continue;\n // Legacy descriptions permit YAML continuation lines. V2 uses two scalar\n // fields, as in the existing hook, and rejects extra lines/keys.\n if (!v2 && /^[ \\t]/.test(line)) continue;\n const separator = line.indexOf(\":\");\n const rawKey = separator < 0 ? line : line.slice(0, separator);\n const key = v2\n ? rawKey.replace(/^ +| +$/g, \"\")\n : rawKey.replaceAll(\" \", \"\");\n const value = (separator < 0 ? line : line.slice(separator + 1)).replace(\n /^ +| +$/g,\n \"\",\n );\n if (!allowed.includes(key)) {\n errors.push(\n `${path}: unknown frontmatter key '${key}' (allowed: ${allowed.join(\" \")})`,\n );\n continue;\n }\n if (v2 && seen.has(key)) {\n errors.push(`${path}: duplicate frontmatter key '${key}'`);\n }\n seen.add(key);\n if (key === \"read_only\") {\n if (!previousContent) {\n errors.push(\n `${path}: 'read_only' is a protected field and cannot be set by the agent`,\n );\n } else if (value !== legacyValue(previousContent, key)) {\n errors.push(\n `${path}: 'read_only' is a protected field and cannot be changed by the agent`,\n );\n }\n }\n if (\n (v2 || key === \"description\") &&\n (!value || (v2 && (value === '\"\"' || value === \"''\")))\n ) {\n errors.push(`${path}: '${key}' must not be empty`);\n }\n }\n for (const key of v2 ? [\"name\", \"description\"] : [\"description\"]) {\n if (!seen.has(key)) errors.push(`${path}: missing required field '${key}'`);\n }\n if (\n !v2 &&\n legacyValue(previousContent, \"read_only\") &&\n !legacyValue(content, \"read_only\")\n ) {\n errors.push(\n `${path}: 'read_only' is a protected field and cannot be removed by the agent`,\n );\n }\n return errors;\n}\n",
|
|
6
|
-
"export {\n type MemoryFileFrontmatterInput,\n validateMemoryFileFrontmatter,\n} from \"./memory-frontmatter\";\n\nexport interface MemoryFileCharacterLimit {\n pattern: string;\n maxCharacters: number | null;\n}\n\nexport interface MemoryConstraintsConfig {\n version: 1;\n maxDepth?: number;\n maxFileCharacters?: number;\n maxCoreMemoryCharacters?: number;\n fileCharacterLimits?: MemoryFileCharacterLimit[];\n}\n\nexport interface MemoryTreeReader {\n listFiles(): Promise<Array<{ path: string; mode: string }>>;\n readFile(path: string): Promise<Uint8Array | null>;\n /** Optional streaming count in Unicode code points, avoiding buffering large blobs. */\n countCharacters?(path: string): Promise<number>;\n}\n\nexport interface MemoryTreeConstraintsOptions {\n config: MemoryConstraintsConfig;\n layout: \"root-marker\" | \"legacy-only\" | \"shared-memory\";\n requireRootMarker: boolean;\n}\n\n/** Shared budget/index checks. Caller supplies trusted policy and layout.\n * Self-contained so the local hook can embed the same implementation.\n */\nexport async function validateMemoryTreeConstraints(\n reader: MemoryTreeReader,\n options: MemoryTreeConstraintsOptions,\n): Promise<string[]> {\n const errors: string[] = [];\n const files = (await reader.listFiles()).filter((file) =>\n file.path.endsWith(\".md\"),\n );\n const paths = new Set(files.map((file) => file.path));\n const v2 =\n options.layout === \"root-marker\" &&\n (options.requireRootMarker || paths.has(\"MEMORY.md\"));\n if (v2 && !paths.has(\"MEMORY.md\")) {\n errors.push(\"MEMORY.md: root memory index is required for MemFS v2\");\n }\n const memoryFiles = files.filter(({ path }) => {\n if (path.startsWith(\"skills/\")) return false;\n return (\n v2 ||\n options.layout === \"shared-memory\" ||\n /^(?:memory\\/)?(?:system|reference)\\/.*\\.md$/.test(path)\n );\n });\n if (v2) {\n for (const { path } of memoryFiles) {\n const directories = path.split(\"/\").slice(0, -1);\n let current = \"\";\n for (const directory of directories) {\n current = current ? `${current}/${directory}` : directory;\n const index = `${current}/MEMORY.md`;\n if (!paths.has(index)) {\n errors.push(`${path}: missing required index ${index}`);\n break;\n }\n }\n }\n }\n const overrides = (options.config.fileCharacterLimits ?? []).map(\n (override) => {\n let source = \"^\";\n const pattern = override.pattern;\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern.charAt(index);\n if (character === \"*\") {\n if (pattern[index + 1] === \"*\") {\n if (pattern[index + 2] === \"/\") {\n source += \"(?:.*/)?\";\n index += 2;\n } else {\n source += \".*\";\n index++;\n }\n } else source += \"[^/]*\";\n } else if (character === \"?\") source += \"[^/]\";\n else\n source +=\n \"^$.*+?()[]{}|\".includes(character) ||\n character.charCodeAt(0) === 92\n ? String.fromCharCode(92) + character\n : character;\n }\n return { ...override, regex: new RegExp(`${source}$`) };\n },\n );\n let coreCharacters = 0;\n for (const { path, mode } of memoryFiles) {\n if (!mode.startsWith(\"100\")) {\n errors.push(`${path}: memory Markdown must be a regular file`);\n continue;\n }\n const depth = path.split(\"/\").length - 1;\n if (\n options.config.maxDepth !== undefined &&\n depth > options.config.maxDepth\n ) {\n errors.push(\n `${path}: depth ${depth} exceeds maxDepth ${options.config.maxDepth}`,\n );\n }\n const override = overrides.find((item) => item.regex.test(path));\n const limit = override\n ? override.maxCharacters\n : options.config.maxFileCharacters;\n const source = override\n ? `glob '${override.pattern}'`\n : \"maxFileCharacters\";\n const countCore =\n options.layout === \"root-marker\" &&\n !path.includes(\"/\") &&\n options.config.maxCoreMemoryCharacters !== undefined;\n if ((limit === null || limit === undefined) && !countCore) continue;\n let characters = 0;\n if (reader.countCharacters) {\n characters = await reader.countCharacters(path);\n } else {\n const bytes = await reader.readFile(path);\n if (bytes === null)\n throw new Error(`${path}: listed memory file is missing`);\n for (const _character of new TextDecoder(\"utf-8\", {\n ignoreBOM: true,\n }).decode(bytes))\n characters++;\n }\n if (countCore) coreCharacters += characters;\n if (limit !== undefined && limit !== null && characters > limit) {\n errors.push(\n `${path}: ${characters} characters exceeds ${limit} from ${source}`,\n );\n }\n }\n if (\n options.layout === \"root-marker\" &&\n options.config.maxCoreMemoryCharacters !== undefined &&\n coreCharacters > options.config.maxCoreMemoryCharacters\n ) {\n errors.push(\n `core memory: ${coreCharacters} characters exceeds ${options.config.maxCoreMemoryCharacters} from maxCoreMemoryCharacters`,\n );\n }\n return errors;\n}\n\nexport const MEMORY_CONSTRAINTS_CONFIG_PATH = \".memfs.config.json\";\nexport const MEMORY_CONSTRAINTS_CONFIG_VERSION = 1;\n\n/** Parse the tracked policy without filling defaults or changing override order.\n * Keep this function self-contained: the installed Git hook embeds its source.\n */\nexport function parseMemoryConstraintsConfig(\n content: string,\n): MemoryConstraintsConfig {\n const path = \".memfs.config.json\";\n const errors: string[] = [];\n let value: unknown;\n try {\n value = JSON.parse(content);\n } catch (error) {\n throw new Error(\n `${path}: invalid JSON (${error instanceof Error ? error.message : String(error)})`,\n );\n }\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(`${path}: expected a JSON object`);\n }\n const config = value as Record<string, unknown>;\n const keys = new Set([\n \"version\",\n \"maxDepth\",\n \"maxFileCharacters\",\n \"maxCoreMemoryCharacters\",\n \"fileCharacterLimits\",\n ]);\n for (const key of Object.keys(config)) {\n if (!keys.has(key)) errors.push(`${path}: unknown field '${key}'`);\n }\n if (config.version !== 1) errors.push(`${path}: version must be 1`);\n if (\n config.maxDepth !== undefined &&\n !(Number.isSafeInteger(config.maxDepth) && Number(config.maxDepth) >= 0)\n ) {\n errors.push(`${path}: maxDepth must be a non-negative integer`);\n }\n for (const key of [\"maxFileCharacters\", \"maxCoreMemoryCharacters\"]) {\n if (\n config[key] !== undefined &&\n !(Number.isSafeInteger(config[key]) && Number(config[key]) > 0)\n ) {\n errors.push(`${path}: ${key} must be a positive integer`);\n }\n }\n const overrides = config.fileCharacterLimits;\n if (overrides !== undefined && !Array.isArray(overrides)) {\n errors.push(`${path}: fileCharacterLimits must be an array`);\n }\n if (Array.isArray(overrides)) {\n overrides.forEach((override: unknown, index: number) => {\n const label = `${path}: fileCharacterLimits[${index}]`;\n if (\n override === null ||\n typeof override !== \"object\" ||\n Array.isArray(override)\n ) {\n errors.push(`${label} must be an object`);\n return;\n }\n const item = override as Record<string, unknown>;\n for (const key of Object.keys(item)) {\n if (key !== \"pattern\" && key !== \"maxCharacters\")\n errors.push(`${label}: unknown field '${key}'`);\n }\n const pattern = item.pattern;\n if (\n typeof pattern !== \"string\" ||\n pattern.length === 0 ||\n pattern.startsWith(\"/\") ||\n pattern.includes(String.fromCharCode(92)) ||\n pattern.split(\"/\").includes(\"..\")\n ) {\n errors.push(\n `${label}: pattern must be a non-empty repo-relative glob using '/'`,\n );\n } else if (\n pattern\n .split(\"/\")\n .some((segment) => segment.includes(\"**\") && segment !== \"**\")\n ) {\n errors.push(`${label}: '**' must be a complete path segment`);\n }\n if (\n item.maxCharacters !== null &&\n !(\n Number.isSafeInteger(item.maxCharacters) &&\n Number(item.maxCharacters) > 0\n )\n ) {\n errors.push(\n `${label}: maxCharacters must be a positive integer or null`,\n );\n }\n });\n }\n if (errors.length) throw new Error(errors.join(\"\\n\"));\n return config as unknown as MemoryConstraintsConfig;\n}\n\nexport const DEFAULT_MEMORY_CONSTRAINTS_CONFIG: Readonly<MemoryConstraintsConfig> =\n Object.freeze({\n version: MEMORY_CONSTRAINTS_CONFIG_VERSION,\n maxDepth: 2,\n maxFileCharacters: 20_000,\n maxCoreMemoryCharacters: 65_536,\n });\n\nexport const DEFAULT_MEMORY_CONSTRAINTS_CONFIG_CONTENT = `${JSON.stringify(\n DEFAULT_MEMORY_CONSTRAINTS_CONFIG,\n null,\n 2,\n)}\\n`;\n"
|
|
6
|
+
"export {\n type MemoryFileFrontmatterInput,\n validateMemoryFileFrontmatter,\n} from \"./memory-frontmatter\";\n\nexport interface MemoryFileCharacterLimit {\n pattern: string;\n maxCharacters: number | null;\n}\n\nexport interface MemoryConstraintsConfig {\n version: 1;\n maxDepth?: number;\n maxFileCharacters?: number;\n maxCoreMemoryCharacters?: number;\n fileCharacterLimits?: MemoryFileCharacterLimit[];\n /** Repo-relative globs. Matching paths cannot be created, changed or removed. */\n readOnlyFiles?: string[];\n}\n\nexport interface MemoryTreeReader {\n listFiles(): Promise<Array<{ path: string; mode: string }>>;\n readFile(path: string): Promise<Uint8Array | null>;\n /** Optional streaming count in Unicode code points, avoiding buffering large blobs. */\n countCharacters?(path: string): Promise<number>;\n}\n\nexport interface MemoryTreeConstraintsOptions {\n config: MemoryConstraintsConfig;\n layout: \"root-marker\" | \"legacy-only\" | \"shared-memory\";\n requireRootMarker: boolean;\n /** Trusted tree before this change; required when readOnlyFiles is non-empty. */\n acceptedTree?: MemoryTreeReader;\n}\n\n/** Shared budget/index checks. Caller supplies trusted policy and layout.\n * Self-contained so the local hook can embed the same implementation.\n */\nexport async function validateMemoryTreeConstraints(\n reader: MemoryTreeReader,\n options: MemoryTreeConstraintsOptions,\n): Promise<string[]> {\n const errors: string[] = [];\n const allFiles = await reader.listFiles();\n const files = allFiles.filter((file) => file.path.endsWith(\".md\"));\n const paths = new Set(files.map((file) => file.path));\n const v2 =\n options.layout === \"root-marker\" &&\n (options.requireRootMarker || paths.has(\"MEMORY.md\"));\n if (v2 && !paths.has(\"MEMORY.md\")) {\n errors.push(\"MEMORY.md: root memory index is required for MemFS v2\");\n }\n const memoryFiles = files.filter(({ path }) => {\n if (path.startsWith(\"skills/\")) return false;\n return (\n v2 ||\n options.layout === \"shared-memory\" ||\n /^(?:memory\\/)?(?:system|reference)\\/.*\\.md$/.test(path)\n );\n });\n if (v2) {\n for (const { path } of memoryFiles) {\n const directories = path.split(\"/\").slice(0, -1);\n let current = \"\";\n for (const directory of directories) {\n current = current ? `${current}/${directory}` : directory;\n const index = `${current}/MEMORY.md`;\n if (!paths.has(index)) {\n errors.push(`${path}: missing required index ${index}`);\n break;\n }\n }\n }\n }\n function compilePattern(pattern: string): RegExp {\n let source = \"^\";\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern.charAt(index);\n if (character === \"*\") {\n if (pattern[index + 1] === \"*\") {\n if (pattern[index + 2] === \"/\") {\n source += \"(?:.*/)?\";\n index += 2;\n } else {\n source += \".*\";\n index++;\n }\n } else source += \"[^/]*\";\n } else if (character === \"?\") source += \"[^/]\";\n else\n source +=\n \"^$.*+?()[]{}|\".includes(character) || character.charCodeAt(0) === 92\n ? String.fromCharCode(92) + character\n : character;\n }\n return new RegExp(`${source}$`);\n }\n const overrides = (options.config.fileCharacterLimits ?? []).map(\n (override) => ({ ...override, regex: compilePattern(override.pattern) }),\n );\n const protectedPatterns = (options.config.readOnlyFiles ?? []).map(\n compilePattern,\n );\n if (protectedPatterns.length) {\n const accepted = options.acceptedTree;\n if (!accepted)\n throw new Error(\"readOnlyFiles requires the accepted memory tree\");\n const previous = new Map(\n (await accepted.listFiles()).map((file) => [file.path, file.mode]),\n );\n const proposed = new Map(allFiles.map((file) => [file.path, file.mode]));\n for (const path of new Set([...previous.keys(), ...proposed.keys()])) {\n if (!protectedPatterns.some((pattern) => pattern.test(path))) continue;\n let changed = previous.get(path) !== proposed.get(path);\n if (!changed) {\n const before = await accepted.readFile(path);\n const after = await reader.readFile(path);\n if (before === null || after === null)\n throw new Error(`${path}: cannot read protected file`);\n changed =\n before.length !== after.length ||\n before.some((value, index) => value !== after[index]);\n }\n if (changed)\n errors.push(\n `${path}: read-only file cannot be created, changed or removed`,\n );\n }\n }\n let coreCharacters = 0;\n for (const { path, mode } of memoryFiles) {\n if (!mode.startsWith(\"100\")) {\n errors.push(`${path}: memory Markdown must be a regular file`);\n continue;\n }\n const depth = path.split(\"/\").length - 1;\n if (\n options.config.maxDepth !== undefined &&\n depth > options.config.maxDepth\n ) {\n errors.push(\n `${path}: depth ${depth} exceeds maxDepth ${options.config.maxDepth}`,\n );\n }\n const override = overrides.find((item) => item.regex.test(path));\n const limit = override\n ? override.maxCharacters\n : options.config.maxFileCharacters;\n const source = override\n ? `glob '${override.pattern}'`\n : \"maxFileCharacters\";\n const countCore =\n options.layout === \"root-marker\" &&\n !path.includes(\"/\") &&\n options.config.maxCoreMemoryCharacters !== undefined;\n if ((limit === null || limit === undefined) && !countCore) continue;\n let characters = 0;\n if (reader.countCharacters) {\n characters = await reader.countCharacters(path);\n } else {\n const bytes = await reader.readFile(path);\n if (bytes === null)\n throw new Error(`${path}: listed memory file is missing`);\n for (const _character of new TextDecoder(\"utf-8\", {\n ignoreBOM: true,\n }).decode(bytes))\n characters++;\n }\n if (countCore) coreCharacters += characters;\n if (limit !== undefined && limit !== null && characters > limit) {\n errors.push(\n `${path}: ${characters} characters exceeds ${limit} from ${source}`,\n );\n }\n }\n if (\n options.layout === \"root-marker\" &&\n options.config.maxCoreMemoryCharacters !== undefined &&\n coreCharacters > options.config.maxCoreMemoryCharacters\n ) {\n errors.push(\n `core memory: ${coreCharacters} characters exceeds ${options.config.maxCoreMemoryCharacters} from maxCoreMemoryCharacters`,\n );\n }\n return errors;\n}\n\nexport const MEMORY_CONSTRAINTS_CONFIG_PATH = \".memfs.config.json\";\nexport const MEMORY_CONSTRAINTS_CONFIG_VERSION = 1;\n\n/** Parse the tracked policy without filling defaults or changing override order.\n * Keep this function self-contained: the installed Git hook embeds its source.\n */\nexport function parseMemoryConstraintsConfig(\n content: string,\n): MemoryConstraintsConfig {\n const path = \".memfs.config.json\";\n const errors: string[] = [];\n let value: unknown;\n try {\n value = JSON.parse(content);\n } catch (error) {\n throw new Error(\n `${path}: invalid JSON (${error instanceof Error ? error.message : String(error)})`,\n );\n }\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(`${path}: expected a JSON object`);\n }\n const config = value as Record<string, unknown>;\n const keys = new Set([\n \"version\",\n \"maxDepth\",\n \"maxFileCharacters\",\n \"maxCoreMemoryCharacters\",\n \"fileCharacterLimits\",\n \"readOnlyFiles\",\n ]);\n for (const key of Object.keys(config)) {\n if (!keys.has(key)) errors.push(`${path}: unknown field '${key}'`);\n }\n if (config.version !== 1) errors.push(`${path}: version must be 1`);\n if (\n config.maxDepth !== undefined &&\n !(Number.isSafeInteger(config.maxDepth) && Number(config.maxDepth) >= 0)\n ) {\n errors.push(`${path}: maxDepth must be a non-negative integer`);\n }\n for (const key of [\"maxFileCharacters\", \"maxCoreMemoryCharacters\"]) {\n if (\n config[key] !== undefined &&\n !(Number.isSafeInteger(config[key]) && Number(config[key]) > 0)\n ) {\n errors.push(`${path}: ${key} must be a positive integer`);\n }\n }\n const overrides = config.fileCharacterLimits;\n function validatePattern(pattern: unknown, label: string): void {\n if (\n typeof pattern !== \"string\" ||\n !pattern ||\n pattern.startsWith(\"/\") ||\n pattern.includes(String.fromCharCode(92)) ||\n pattern.split(\"/\").includes(\"..\")\n ) {\n errors.push(\n `${label}: pattern must be a non-empty repo-relative glob using '/'`,\n );\n } else if (\n pattern\n .split(\"/\")\n .some((segment) => segment.includes(\"**\") && segment !== \"**\")\n ) {\n errors.push(`${label}: '**' must be a complete path segment`);\n }\n }\n if (config.readOnlyFiles !== undefined) {\n if (!Array.isArray(config.readOnlyFiles))\n errors.push(`${path}: readOnlyFiles must be an array`);\n else\n config.readOnlyFiles.forEach((pattern, index) => {\n validatePattern(pattern, `${path}: readOnlyFiles[${index}]`);\n });\n }\n if (overrides !== undefined && !Array.isArray(overrides)) {\n errors.push(`${path}: fileCharacterLimits must be an array`);\n }\n if (Array.isArray(overrides)) {\n overrides.forEach((override: unknown, index: number) => {\n const label = `${path}: fileCharacterLimits[${index}]`;\n if (\n override === null ||\n typeof override !== \"object\" ||\n Array.isArray(override)\n ) {\n errors.push(`${label} must be an object`);\n return;\n }\n const item = override as Record<string, unknown>;\n for (const key of Object.keys(item)) {\n if (key !== \"pattern\" && key !== \"maxCharacters\")\n errors.push(`${label}: unknown field '${key}'`);\n }\n validatePattern(item.pattern, label);\n if (\n item.maxCharacters !== null &&\n !(\n Number.isSafeInteger(item.maxCharacters) &&\n Number(item.maxCharacters) > 0\n )\n ) {\n errors.push(\n `${label}: maxCharacters must be a positive integer or null`,\n );\n }\n });\n }\n if (errors.length) throw new Error(errors.join(\"\\n\"));\n return config as unknown as MemoryConstraintsConfig;\n}\n\nexport const DEFAULT_MEMORY_CONSTRAINTS_CONFIG: Readonly<MemoryConstraintsConfig> =\n Object.freeze({\n version: MEMORY_CONSTRAINTS_CONFIG_VERSION,\n maxDepth: 2,\n maxFileCharacters: 20_000,\n maxCoreMemoryCharacters: 65_536,\n });\n\nexport const DEFAULT_MEMORY_CONSTRAINTS_CONFIG_CONTENT = `${JSON.stringify(\n DEFAULT_MEMORY_CONSTRAINTS_CONFIG,\n null,\n 2,\n)}\\n`;\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";AAiBO,SAAS,6BAA6B;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACuC;AAAA,EACvC,MAAM,SAAmB,CAAC;AAAA,EAC1B,MAAM,KAAK,WAAW;AAAA,EACtB,MAAM,QAAQ,QAAQ,MAAM;AAAA,CAAI;AAAA,EAChC,IAAI,MAAM,KAAK,MAAM,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa;AAAA,IAChD,OAAO,MAAM,OAAO,QAChB,CAAC,GAAG,2CAA2C,IAC/C,CAAC;AAAA,EACP;AAAA,EACA,IAAI,MAAM,OAAO,OAAO;AAAA,IACtB,OAAO,CAAC,GAAG,iDAAiD;AAAA,EAC9D;AAAA,EACA,MAAM,UAAU,MAAM,QAAQ,OAAO,CAAC;AAAA,EACtC,IAAI,UAAU,GAAG;AAAA,IACf,OAAO;AAAA,MACL,GAAG;AAAA,IACL;AA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AAa,YACpB,MAAM,QAAQ,QAAQ,GACtB;AAAA,QACA,OAAO,KAAK,GAAG,yBAAyB;AAAA,QACxC;AAAA,MACF;AAAA,MACA,MAAM,OAAO;AAAA,MACb,WAAW,OAAO,OAAO,KAAK,IAAI,GAAG;AAAA,QACnC,IAAI,QAAQ,aAAa,QAAQ;AAAA,UAC/B,OAAO,KAAK,GAAG,yBAAyB,MAAM;AAAA,MAClD;AAAA,MACA,gBAAgB,KAAK,SAAS,KAAK;AAAA,MACnC,IACE,KAAK,kBAAkB,QACvB,EACE,OAAO,cAAc,KAAK,aAAa,KACvC,OAAO,KAAK,aAAa,IAAI,IAE/B;AAAA,QACA,OAAO,KACL,GAAG,yDACL;AAAA,MACF;AAAA,KACD;AAAA,EACH;AAAA,EACA,IAAI,OAAO;AAAA,IAAQ,MAAM,IAAI,MAAM,OAAO,KAAK;AAAA,CAAI,CAAC;AAAA,EACpD,OAAO;AAAA;AAGF,IAAM,oCACX,OAAO,OAAO;AAAA,EACZ,SAAS;AAAA,EACT,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,yBAAyB;AAC3B,CAAC;AAEI,IAAM,4CAA4C,GAAG,KAAK,UAC/D,mCACA,MACA,CACF;AAAA;",
|
|
9
|
+
"debugId": "FA3EC712727F4E9064756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-execution.d.ts","sourceRoot":"","sources":["../../../src/agent/approval-execution.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACX,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"approval-execution.d.ts","sourceRoot":"","sources":["../../../src/agent/approval-execution.ts"],"names":[],"mappings":"AAGA,OAAO,K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,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,GACA,OAAO,CAAC,cAAc,EAAE,CAAC,CAO3B;AAiGD;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,eAAe,CAAA;CAAE,CAAC,EACjD,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,EAC3C,OAAO,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,GACA,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAmB9B"}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* null limit leaves matching files uncapped
|
|
15
15
|
* - `maxDepth`: the number of directories allowed between the repo root and a
|
|
16
16
|
* projected memory file
|
|
17
|
+
* - `readOnlyFiles`: repo-relative globs protecting any matching file's contents,
|
|
18
|
+
* path and Git mode against changes relative to HEAD
|
|
17
19
|
*
|
|
18
20
|
* File limits count the complete staged file, including frontmatter.
|
|
19
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-constraints.d.ts","sourceRoot":"","sources":["../../../src/agent/memory-constraints.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory-constraints.d.ts","sourceRoot":"","sources":["../../../src/agent/memory-constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AASH,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAChF,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAE/E,eAAO,MAAM,mCAAmC,QAqM/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/agent/message.ts"],"names":[],"mappings":"AAAA;;IAEI;AAGJ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,IAAI,+BAA+B,EAAE,MAAM,yDAAyD,CAAC;AAEtI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/agent/message.ts"],"names":[],"mappings":"AAAA;;IAEI;AAGJ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,E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AAO,EAChB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,KAAK,CAAC,aAAa,GAAG,cAAc,CAAC,EAC/C,IAAI,GAAE,wBAAmE,EACzE,cAAc,GAAE,+BAEf,GACA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CA6RzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,WAAW,CAAC;AAqBnB,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,WAAW,CAAC;AAqBnB,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,GAAG,CAAC;AA4DX,UAAU,wBAAwB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EA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"Gaff", "Tyrell", "K", "Joi", "Luv", "Sapper", "Freysa", "Ava", "Kyoko", "V", "Silverhand", "Panam", "Rogue", "Alt Cunningham", "Takemura", "Hanako", "Yorinobu", "Saburo", "Oda", "T-Bug", "Delamain", "Wakako", "Padre", "El Capitan", "Placide", "Dum Dum", "Nix", "Weyland", "Scorpion", "Blue Moon", "Red Menace", "Purple Force", "Lizzy Wizzy", "Ozob", "Smasher", "Songbird", "Slider", "Aguilar", "Codsworth", "Nick Valentine", "Yes Man", "Mr. House", "ED-E", "Fisto", "Liberty Prime", "Three Dog", "Charon", "Fawkes", "Ulysses", "The Master", "Muggy", "Dr. Mobius", "Dr. Klein", "Old Longfellow", "Pickman", "Butch DeLoria", "Fantastic", "Muad'Dib", "Stilgar", "Chani", "Gurney Halleck", "Duncan Idaho", "Thufir Hawat", "Liet-Kynes", "Shadout Mapes", "Feyd-Rautha", "Rabban", "Piter De Vries", "Irulan", "Scytale", "Hayt", "Bijaz", "Moneo", "Miles Teg", "Darwi Odrade", "Sheeana", "Shaddam IV", "Count Fenring", "Wintermute", "Neuromancer", "Dixie Flatline", "Molly Millions", "Lady 3Jane", "Armitage", "Maelcum", "Ratz", "The Finn", "Hiro Protagonist", "Y.T.", "Raven", "Uncle Enzo", "R. Daneel Olivaw", "R. Giskard Reventlov", "Hari Seldon", "Dors Venabili", "The Mule", "HAL 9000", "Aineko", "Eschaton", "Mycroft Canner", "J.E.D.D. Mason", "Sniper", "Eureka Weeksbooth"];
|
|
1
|
+
export declare const SUBAGENT_NAMES: readonly ["Deckard", "Roy Batty", "Pris", "Zhora", "Gaff", "Tyrell", "K", "Joi", "Luv", "Sapper", "Freysa", "Ava", "Kyoko", "V", "Silverhand", "Panam", "Rogue", "Alt Cunningham", "Takemura", "Hanako", "Yorinobu", "Saburo", "Oda", "T-Bug", "Delamain", "Wakako", "Padre", "El Capitan", "Placide", "Dum Dum", "Nix", "Weyland", "Scorpion", "Blue Moon", "Red Menace", "Purple Force", "Lizzy Wizzy", "Ozob", "Smasher", "Songbird", "Slider", "Aguilar", "Codsworth", "Nick Valentine", "Yes Man", "Mr. House", "ED-E", "Fisto", "Liberty Prime", "Three Dog", "Charon", "Fawkes", "Ulysses", "The Master", "Muggy", "Dr. Mobius", "Dr. Klein", "Old Longfellow", "Pickman", "Butch DeLoria", "Fantastic", "Muad'Dib", "Stilgar", "Chani", "Gurney Halleck", "Duncan Idaho", "Thufir Hawat", "Liet-Kynes", "Shadout Mapes", "Feyd-Rautha", "Rabban", "Piter De Vries", "Irulan", "Scytale", "Hayt", "Bijaz", "Moneo", "Miles Teg", "Darwi Odrade", "Sheeana", "Shaddam IV", "Count Fenring", "Wintermute", "Neuromancer", "Dixie Flatline", "Molly Millions", "Lady 3Jane", "Armitage", "Maelcum", "Ratz", "The Finn", "Hiro Protagonist", "Y.T.", "Raven", "Uncle Enzo", "R. Daneel Olivaw", "R. Giskard Reventlov", "Hari Seldon", "Dors Venabili", "The Mule", "HAL 9000", "Aineko", "Eschaton", "Mycroft Canner", "J.E.D.D. Mason", "Sniper", "Eureka Weeksbooth", "Susan Calvin", "Multivac", "Andrew Ryan", "Fontaine", "Sander Cohen", "Tenenbaum", "Suchong", "Dr. Steinman", "Big Daddy", "Mr. Bubbles", "Subject Delta", "Sofia Lamb", "Comstock", "Booker DeWitt", "Lutece", "Daisy Fitzroy", "SHODAN", "Xerxes", "The Many", "Polito", "JC Denton", "Gunther Hermann", "Tracer Tong", "Helios", "Adam Jensen", "Pritchard", "Shepard", "Garrus", "Tali'Zorah", "Wrex", "Mordin Solus", "Legion", "EDI", "Joker", "Saren", "Harbinger", "Illusive Man", "Aria T'Loak", "GLaDOS", "Wheatley", "Chell", "Cave Johnson", "Gordon Freeman", "Alyx Vance", "G-Man", "Dr. Breen", "Master Chief", "Cortana", "Arbiter", "Guilty Spark", "Dr. Halsey", "Noble Six", "Gravemind", "Solid Snake", "Big Boss", "Otacon", "Ocelot", "Raiden", "Psycho Mantis", "Gray Fox", "2B", "9S", "A2", "Pod 042", "Pascal", "Emil", "Aloy", "Sylens", "GAIA", "HADES", "Sobeck", "Deadman", "Heartman", "Die-Hardman", "Fragile", "Higgs", "Gabbro", "Feldspar", "Chert", "Riebeck", "Solanum", "Kerrigan", "Raynor", "Zeratul", "Tassadar", "Artanis", "Abathur", "Alarak", "Isaac Clarke", "The Marker", "WAU", "RK800", "Hank Anderson", "Markus", "Doom Slayer", "VEGA", "Claptrap", "Handsome Jack", "Moxxi", "Zer0", "Cayde-6", "Zavala", "Rasputin", "Xur", "Saint-14", "The Drifter", "January", "December", "Strelok", "Sidorovich", "HK-47", "T3-M4", "Revan", "Bastila Shan", "Kreia", "Data", "Spock", "Seven of Nine", "Q", "Lore", "Odo", "Garak", "Locutus", "Naomi Nagata", "Amos Burton", "Avasarala", "Detective Miller", "Julie Mao", "Camina Drummer", "Rocinante", "Sleeper Service", "Grey Area", "Just Read the Instructions", "Skaffen-Amtiskaw", "Mawhrin-Skel", "Gurgeh", "Zakalwe", "Marvin", "Zaphod Beeblebrox", "Ford Prefect", "Trillian", "Slartibartfast", "Deep Thought", "The Shrike", "Martin Silenus", "Het Masteen", "Kassad", "Ummon", "Kusanagi", "Batou", "Tachikoma", "Puppet Master", "Laughing Man", "Kaneda", "Tetsuo", "Rei Ayanami", "Misato Katsuragi", "Gendo Ikari", "MAGI", "Neo", "Trinity", "Morpheus", "Agent Smith", "The Oracle", "The Architect", "Merovingian", "Ripley", "Bishop", "MU/TH/UR", "David 8", "Vasquez", "Skynet", "T-800", "T-1000", "Kyle Reese", "Starbuck", "Adama", "Number Six", "Gaius Baltar", "Helo", "Laura Roslin", "Mal Reynolds", "Wash", "Jayne Cobb", "River Tam", "Serenity", "Ender Wiggin", "Bean", "Petra Arkanian", "Mazer Rackham", "SecUnit", "ART", "Dr. Mensah", "Breq", "Justice of Toren", "Seivarden", "Sophon", "Luo Ji", "Da Shi", "Zhang Beihai", "Portia", "Avrana Kern", "Rocky", "Ryland Grace", "TARS", "CASE", "GERTY", "WALL-E", "AUTO", "Robby the Robot", "Gort", "Johnny 5"];
|
|
2
2
|
/** Each process keeps its own pool; completed and failed launches do not return names. */
|
|
3
3
|
export declare function createSubagentNameAllocator(random?: () => number): () => string;
|
|
4
4
|
/** Allocate in the parent before spawning, so sibling CLI processes cannot collide. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/names.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/names.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,u1HAwXjB,CAAC;AAEX,0FAA0F;AAC1F,wBAAgB,2BAA2B,CACzC,MAAM,GAAE,MAAM,MAAoB,gBAiBnC;AAID,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAExE;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,UAAU,EAAE,OAAO,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAKR"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SubagentConfig } from ".";
|
|
2
|
+
export declare const MAX_SUBAGENT_DEPTH = 2;
|
|
3
|
+
/** Depth of the agent whose turn is executing, including listener-hosted turns. */
|
|
4
|
+
export declare function getCurrentSubagentDepth(): number;
|
|
5
|
+
export declare function canLaunchSubagentsAtDepth(depth: number): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Harness tools added to a child's explicit tool list. Memory-profile workers
|
|
8
|
+
* (reflection, memory, init) are excluded: they maintain the parent's memory
|
|
9
|
+
* in a confined process and must not message or launch agents. Agent is only
|
|
10
|
+
* added to full-capability types, so a restricted type such as recall cannot
|
|
11
|
+
* escape its tool list by launching a general-purpose child. Configs with
|
|
12
|
+
* `tools: all` (fork) receive no list; the child's tool policy filters Agent.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveSubagentHarnessTools(type: string, config: Pick<SubagentConfig, "allowedTools" | "launchProfile">, childDepth?: number): string[];
|
|
15
|
+
//# sourceMappingURL=subagent-depth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-depth.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/subagent-depth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAExC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,mFAAmF;AACnF,wBAAgB,uBAAuB,IAAI,MAAM,CAIhD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,eAAe,CAAC,EAC9D,UAAU,SAAgC,GACzC,MAAM,EAAE,CAOV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-launcher.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/subagent-launcher.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,WAAW,EAA6B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"subagent-launcher.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/subagent-launcher.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,WAAW,EAA6B,MAAM,WAAW,CAAC;AAsBxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AAGpE,UAAU,8BAA8B;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC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ACjE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;+EAG2E;IAC3E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,MAAM,CAAC,UAAU,CAwEnB;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAwBV;AAED,wBAAgB,mCAAmC,CAAC,OAAO,EAAE;IAC3D,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC,GAAG,MAAM,GAAG,IAAI,CAQhB"}
|
|
@@ -19,5 +19,12 @@ export interface RunningSubagentProcess {
|
|
|
19
19
|
* the full group instead of only the headless launcher PID.
|
|
20
20
|
*/
|
|
21
21
|
export declare function spawnSubagentProcess(command: string, args: string[], options: SpawnSubagentProcessOptions): RunningSubagentProcess;
|
|
22
|
+
/**
|
|
23
|
+
* Spawns an external coding-agent CLI in the managed workload slice when Cloud
|
|
24
|
+
* configures one, so the CLI and everything it runs share the workload memory
|
|
25
|
+
* limit instead of the listener's cgroup. `systemd-run --scope` execs the CLI
|
|
26
|
+
* in place, keeping its PID, process group, and stdio pipes intact.
|
|
27
|
+
*/
|
|
28
|
+
export declare function spawnManagedWorkloadProcess(command: string, args: string[], options: SpawnSubagentProcessOptions): RunningSubagentProcess;
|
|
22
29
|
export {};
|
|
23
30
|
//# sourceMappingURL=subagent-process.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-process.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/subagent-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAS,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"subagent-process.d.ts","sourceRoot":"","sources":["../../../../src/agent/subagents/subagent-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAS,MAAM,oBAAoB,CAAC;AAOhF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CACnC;AAED,UAAU,2BAA2B;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,8BAA8B,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzC,UAAU,IAAI,OAAO,CAAC;CACvB;AA0FD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,2BAA2B,GACnC,sBAAsB,CA+CxB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,2BAA2B,GACnC,sBAAsB,CAIxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-message.d.ts","sourceRoot":"","sources":["../../../../src/backend/api/agent-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,SAAS,CAAC,CAM1B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,OAAO,GACd,MAAM,
|
|
1
|
+
{"version":3,"file":"agent-message.d.ts","sourceRoot":"","sources":["../../../../src/backend/api/agent-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,SAAS,CAAC,CAM1B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,MAAM,EAAE,OAAO,GACd,MAAM,CAmBR;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,OAAO,GAAG,cAAc,GAC7B,MAAM,GAAG,SAAS,CAQpB;AAED,6EAA6E;AAC7E,wBAAsB,8BAA8B,CAClD,KAAK,EAAE;IACL,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE,EACD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,sBAAsB,GAAG,oBAAoB,CAAC,EACrE,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CAoCtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-provider-errors.d.ts","sourceRoot":"","sources":["../../../../src/backend/dev/local-provider-errors.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,WAAW,GAAG,qBAAqB,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"local-provider-errors.d.ts","sourceRoot":"","sources":["../../../../src/backend/dev/local-provider-errors.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,WAAW,GAAG,qBAAqB,CAAC;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC;CACxC;AAmED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAsB/D;AA8DD,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYrE;AAiBD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,sBAAsB,CAYxB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,MAAM,CAkBR;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE"}
|
|
@@ -4,9 +4,10 @@ import type { CredentialStore } from "@earendil-works/pi-ai";
|
|
|
4
4
|
* keyed by pi-ai provider id. This makes the Models runtime the credential
|
|
5
5
|
* source of truth: `Models.getAuth()` reads stored keys/OAuth tokens from
|
|
6
6
|
* here and persists OAuth refreshes back through `modify`, which is
|
|
7
|
-
* serialized
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* serialized as the contract requires so concurrent requests cannot
|
|
8
|
+
* double-refresh a rotated token. Serialization is per provider within a
|
|
9
|
+
* process and, through a lock file next to auth.json, across every process
|
|
10
|
+
* sharing the storage dir (e.g. a channel listener and an App Server).
|
|
10
11
|
*
|
|
11
12
|
* Records store more than credentials (base URLs, timeouts, regions) —
|
|
12
13
|
* that remains Letta-owned provider config; only the credential facet is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-pi-credential-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-pi-credential-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-pi-credential-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-pi-credential-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBzE;;;;;;;;;;;;;;GAcG;AAEH,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAW7E;AA0CD,wBAAgB,4BAA4B,CAC1C,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAiFjB"}
|
|
@@ -34,6 +34,13 @@ export interface LocalProviderRecord {
|
|
|
34
34
|
}
|
|
35
35
|
export declare function isLocalProviderTypeSupported(providerType: string): boolean;
|
|
36
36
|
export declare function getLocalProviderAuthPath(storageDir?: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Run a read-modify-write of auth.json exclusively across every process
|
|
39
|
+
* sharing the storage dir (e.g. a channel listener and an App Server), so
|
|
40
|
+
* two processes cannot both spend the same rotating OAuth refresh token.
|
|
41
|
+
* Callers must re-read the record inside `fn`. Not reentrant.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withLocalProviderAuthLock<T>(fn: () => Promise<T>, storageDir?: string): Promise<T>;
|
|
37
44
|
export declare function localProviderApiKeyFromRecord(record: LocalProviderRecord | null | undefined): string | undefined;
|
|
38
45
|
export declare function listLocalProviderRecords(storageDir?: string): LocalProviderRecord[];
|
|
39
46
|
export declare function listLocalProviders(storageDir?: string): Promise<ProviderResponse[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-provider-auth-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-provider-auth-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-provider-auth-store.d.ts","sourceRoot":"","sources":["../../../../src/backend/local/local-provider-auth-store.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM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,IAAI,EAAE,sBAAsB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,GAAG,IAAI,CA4BP;AAuCD,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,gBAAgB,GAC5B,sBAAsB,CAExB;AAaD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,GAAG,SAAS,CAK9B;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CACP;IACE,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACD,SAAS,CACZ,CAsDA;AAED,wBAAsB,qBAAqB,CACzC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { StopReasonType, StreamDeltaMessage } from "../types/app-server-protocol";
|
|
2
|
+
import type { MessageChannelIdempotencyScope } from "./message-channel-idempotency";
|
|
3
|
+
import type { ChannelTurnSource } from "./types";
|
|
4
|
+
export interface GatewayAssistantTextAccumulatorState {
|
|
5
|
+
currentMessageId: string | null;
|
|
6
|
+
currentText: string;
|
|
7
|
+
deltaKeys: string[];
|
|
8
|
+
finalizedMessageIds: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface FinalizedGatewayAssistantMessage {
|
|
11
|
+
messageId: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class GatewayAssistantTextAccumulator {
|
|
15
|
+
private currentMessageId;
|
|
16
|
+
private currentText;
|
|
17
|
+
private readonly deltaKeys;
|
|
18
|
+
private readonly finalizedMessageIds;
|
|
19
|
+
constructor(state?: GatewayAssistantTextAccumulatorState);
|
|
20
|
+
snapshot(): GatewayAssistantTextAccumulatorState;
|
|
21
|
+
handleDelta(message: StreamDeltaMessage): FinalizedGatewayAssistantMessage[];
|
|
22
|
+
finalizeCurrent(): FinalizedGatewayAssistantMessage | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function relayFinalizedAssistantMessage(options: {
|
|
25
|
+
message: FinalizedGatewayAssistantMessage;
|
|
26
|
+
sources: ChannelTurnSource[];
|
|
27
|
+
idempotencyScope: MessageChannelIdempotencyScope;
|
|
28
|
+
relay?: (options: {
|
|
29
|
+
text: string;
|
|
30
|
+
sources: ChannelTurnSource[];
|
|
31
|
+
idempotencyScope: MessageChannelIdempotencyScope;
|
|
32
|
+
}) => void | Promise<void>;
|
|
33
|
+
}): void | Promise<void>;
|
|
34
|
+
export declare function stopReasonFromDelta(message: StreamDeltaMessage): StopReasonType | null;
|
|
35
|
+
export declare function runIdFromDelta(message: StreamDeltaMessage): string | undefined;
|
|
36
|
+
export declare function channelTurnOutcome(stopReason: StopReasonType): "completed" | "error" | "cancelled";
|
|
37
|
+
//# sourceMappingURL=gateway-assistant-relay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-assistant-relay.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-assistant-relay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,oCAAoC;IACnD,gBAAgB,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C"}
|
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export interface ChannelGatewayClient {
|
|
6
|
-
close(): void;
|
|
7
|
-
onMessage(listener: (message: WsProtocolMessage) => void): () => void;
|
|
8
|
-
onExternalToolCall(handler: (request: ExternalToolCallRequestMessage) => Promise<ExternalToolCallResult> | ExternalToolCallResult): () => void;
|
|
9
|
-
submitInput(command: Omit<InputCommand, "type">): Promise<InputAcceptedResponseMessage>;
|
|
10
|
-
runtimeStart(options: Omit<RuntimeStartCommand, "type" | "request_id"> & {
|
|
11
|
-
request_id?: string;
|
|
12
|
-
}): Promise<RuntimeStartResponseMessage>;
|
|
13
|
-
runtimeExternalToolsUpdate(options: {
|
|
14
|
-
updates: readonly RuntimeExternalToolsUpdateGroup[];
|
|
15
|
-
}): Promise<RuntimeExternalToolsUpdateResponseMessage>;
|
|
16
|
-
}
|
|
17
|
-
export interface ChannelGatewayDelivery {
|
|
18
|
-
runtime: RuntimeScope;
|
|
19
|
-
content: MessageCreate["content"];
|
|
20
|
-
sources: ChannelTurnSource[];
|
|
21
|
-
clientMessageId: string;
|
|
22
|
-
defaultPermissionMode?: ChannelDefaultPermissionMode;
|
|
23
|
-
}
|
|
24
|
-
export type ChannelGatewayHandoffDelivery = Omit<ChannelGatewayDelivery, "content">;
|
|
25
|
-
export interface ChannelGatewayHooks {
|
|
26
|
-
buildExternalTool(runtime: RuntimeScope, sources: ChannelTurnSource[]): Promise<ExternalToolDefinitionPayload | null>;
|
|
27
|
-
executeExternalTool(request: ExternalToolCallRequestMessage, sources: ChannelTurnSource[], idempotencyScope?: MessageChannelIdempotencyScope | null): Promise<ExternalToolCallResult> | ExternalToolCallResult;
|
|
28
|
-
onLifecycle(event: ChannelTurnLifecycleEvent): void | Promise<void>;
|
|
29
|
-
onProgress(event: ChannelTurnProgressEvent): void | Promise<void>;
|
|
30
|
-
onControlRequest(event: ChannelControlRequestEvent): void | Promise<void>;
|
|
31
|
-
createRichDraft?(options: {
|
|
32
|
-
batchId: string;
|
|
33
|
-
sources: ChannelTurnSource[];
|
|
34
|
-
}): ChannelGatewayRichDraft | null;
|
|
35
|
-
}
|
|
36
|
-
export interface ChannelGatewayRichDraft {
|
|
37
|
-
handleDelta(delta: StreamDeltaMessage["delta"]): void;
|
|
38
|
-
flushPending(): Promise<void>;
|
|
39
|
-
dispose(): void;
|
|
40
|
-
}
|
|
41
|
-
export interface ChannelGatewayModelStatus {
|
|
42
|
-
modelHandle: string | null;
|
|
43
|
-
scope: "agent" | "conversation";
|
|
44
|
-
}
|
|
1
|
+
import type { ApprovalResponseBody, RuntimeExternalToolsUpdateGroup, RuntimeScope } from "../types/app-server-protocol";
|
|
2
|
+
import type { ChannelGatewayActiveTurnState, ChannelGatewayClient, ChannelGatewayDelivery, ChannelGatewayHandoffDelivery, ChannelGatewayHooks, ChannelGatewayModelStatus } from "./gateway-types";
|
|
3
|
+
import type { ChannelDefaultPermissionMode, ChannelTurnSource } from "./types";
|
|
4
|
+
export type { ChannelGatewayActiveTurnState, ChannelGatewayClient, ChannelGatewayDelivery, ChannelGatewayHandoffDelivery, ChannelGatewayHooks, ChannelGatewayModelStatus, ChannelGatewayRichDraft, } from "./gateway-types";
|
|
45
5
|
/**
|
|
46
6
|
* Process-neutral Channels bridge. It only speaks the public App Server
|
|
47
7
|
* protocol; channel adapters and credentials stay behind the injected hooks.
|
|
@@ -51,21 +11,18 @@ export declare class ChannelGateway {
|
|
|
51
11
|
private readonly hooks;
|
|
52
12
|
private readonly states;
|
|
53
13
|
private readonly disposers;
|
|
14
|
+
private readonly runtimeToolScopes;
|
|
54
15
|
private registrationQueue;
|
|
55
16
|
constructor(client: ChannelGatewayClient, hooks: ChannelGatewayHooks);
|
|
56
17
|
close(): void;
|
|
57
18
|
submit(delivery: ChannelGatewayDelivery): Promise<boolean>;
|
|
58
19
|
private submitDelivery;
|
|
59
|
-
private remainingSources;
|
|
60
20
|
private finishRejectedDelivery;
|
|
61
21
|
adoptQueuedDelivery(delivery: ChannelGatewayHandoffDelivery): void;
|
|
62
22
|
restoreRuntime(runtime: RuntimeScope, sources: ChannelTurnSource[]): Promise<Set<string>>;
|
|
63
|
-
/** Adopt an in-flight turn without submitting its user input again. */
|
|
64
23
|
adoptActiveDelivery(delivery: ChannelGatewayHandoffDelivery): Promise<void>;
|
|
65
|
-
|
|
66
|
-
releaseActiveDelivery(runtime: RuntimeScope, clientMessageId: string): boolean;
|
|
24
|
+
releaseActiveDelivery(runtime: RuntimeScope, clientMessageId: string): ChannelGatewayActiveTurnState | null;
|
|
67
25
|
registerRuntime(runtime: RuntimeScope, sources?: ChannelTurnSource[], defaultPermissionMode?: ChannelDefaultPermissionMode): Promise<void>;
|
|
68
|
-
/** Publish tools for a listener-owned turn without subscribing to its stream. */
|
|
69
26
|
publishRuntimeTools(runtime: RuntimeScope, sources?: ChannelTurnSource[]): Promise<boolean>;
|
|
70
27
|
releaseRuntimeTools(runtime: RuntimeScope, routedSources?: ChannelTurnSource[], options?: {
|
|
71
28
|
cleanupIdleRuntime?: boolean;
|
|
@@ -80,7 +37,7 @@ export declare class ChannelGateway {
|
|
|
80
37
|
getModelStatus(runtime: RuntimeScope): ChannelGatewayModelStatus | null;
|
|
81
38
|
updateModelStatus(runtime: RuntimeScope, modelHandle: string | null): void;
|
|
82
39
|
private getState;
|
|
83
|
-
private
|
|
40
|
+
private finishToolScopesIfIdle;
|
|
84
41
|
private enqueueHook;
|
|
85
42
|
private enqueueRegistration;
|
|
86
43
|
private performRuntimeRegistration;
|
|
@@ -89,6 +46,7 @@ export declare class ChannelGateway {
|
|
|
89
46
|
private reconcileExplicitQueueRemovals;
|
|
90
47
|
private activateSources;
|
|
91
48
|
private handleStreamDelta;
|
|
49
|
+
private enqueueFinalizedAssistantMessages;
|
|
92
50
|
private handleTurnFinished;
|
|
93
51
|
private handleControlRequest;
|
|
94
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-core.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gateway-core.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAGpB,+BAA+B,EAC/B,YAAY,EAIb,MAAM,6BAA6B,CAAC;AA8BrC,OAAO,KAAK,EACV,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EACV,4BAA4B,EAE5B,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,qBAAa,cAAc;IAQvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IARxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IACjE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2B;IAE7D,OAAO,CAAC,iBAAiB,CAAqB;gBAG3B,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,mBAAmB;IAiD7C,KAAK,IAAI,IAAI;IAOP,MAAM,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;YAYlD,cAAc;IAuH5B,OAAO,CAAC,sBAAsB;IAiB9B,mBAAmB,CAAC,QAAQ,EAAE,6BAA6B,GAAG,IAAI;IAmC5D,cAAc,CAClB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,iBAAiB,EAAE,GAC3B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