@bevel-software/platform-core-backend 0.34.0 → 0.35.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/agent-guide/access-control.md +146 -300
- package/agent-guide/conventions.md +23 -25
- package/agent-guide/directory-structure.md +72 -120
- package/agent-guide/drafts-and-change-requests.md +92 -0
- package/agent-guide/for-git-users.md +47 -0
- package/agent-guide/glossary.md +36 -0
- package/agent-guide/how-agents-find-things.md +49 -0
- package/agent-guide/html-views.md +16 -11
- package/agent-guide/new-knowledge-base.md +9 -8
- package/agent-guide/skills.md +67 -42
- package/agent-guide/start-here.md +65 -0
- package/agent-guide/tool-manuals.md +132 -154
- package/agent-guide/tools.md +67 -0
- package/agent-guide/where-a-new-file-goes.md +45 -28
- package/dist/core/create-core-server.js +1 -1
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +6 -0
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +7 -4
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +22 -0
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +3 -1
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +75 -0
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +23 -4
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/index.d.ts +1 -1
- package/dist/modules/access/index.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.d.ts +47 -7
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.js +103 -13
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.d.ts +6 -2
- package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.js +45 -31
- package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -1
- package/dist/modules/agent-guide/guide-budget.d.ts +48 -0
- package/dist/modules/agent-guide/guide-budget.d.ts.map +1 -0
- package/dist/modules/agent-guide/guide-budget.js +67 -0
- package/dist/modules/agent-guide/guide-budget.js.map +1 -0
- package/dist/modules/agent-guide/index.d.ts +2 -1
- package/dist/modules/agent-guide/index.d.ts.map +1 -1
- package/dist/modules/agent-guide/index.js +2 -1
- package/dist/modules/agent-guide/index.js.map +1 -1
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +4 -0
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +10 -8
- package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.js +2 -2
- package/dist/modules/code-mode/code-mode.tool.js.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts +0 -12
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.js +1 -38
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +6 -35
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +11 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +159 -24
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +1 -1
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +1 -1
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts +53 -11
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.contract.js +27 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +85 -39
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/oidc-check.d.ts.map +1 -1
- package/dist/modules/settings/oidc-check.js +5 -17
- package/dist/modules/settings/oidc-check.js.map +1 -1
- package/dist/modules/skills/skills.tools.js +1 -1
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-helpers/tool-def.js +1 -1
- package/dist/modules/tool-helpers/tool-def.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts +7 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.js +69 -38
- package/dist/modules/tool-manuals/mcp-json-discovery.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +27 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +12 -8
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +115 -44
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +8 -2
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +31 -10
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +22 -18
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workspace/agent-access.gate.d.ts +1 -1
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-access.gate.js +1 -1
- package/dist/modules/workspace/agent-access.gate.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +3 -2
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +71 -21
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/shared/oauth-token-error.d.ts +23 -0
- package/dist/shared/oauth-token-error.d.ts.map +1 -0
- package/dist/shared/oauth-token-error.js +47 -0
- package/dist/shared/oauth-token-error.js.map +1 -0
- package/dist/shared/read-capped.d.ts +19 -0
- package/dist/shared/read-capped.d.ts.map +1 -0
- package/dist/shared/read-capped.js +45 -0
- package/dist/shared/read-capped.js.map +1 -0
- package/package.json +4 -3
- package/src/__tests__/hexis-catalog.ts +144 -0
- package/src/__tests__/real-disk.ts +21 -0
- package/src/__tests__/tokens.ts +19 -0
- package/src/__tests__/tool-manuals.ts +32 -0
- package/src/__tests__/tool-wiring.ts +25 -0
- package/src/core/__tests__/oauth-sign-in-real-file.test.ts +179 -0
- package/src/core/create-core-server.ts +1 -1
- package/src/core/create-core-services.ts +13 -3
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +52 -12
- package/src/modules/access/__tests__/holder-changes.test.ts +127 -0
- package/src/modules/access/access-control.interface.ts +26 -0
- package/src/modules/access/access-control.service.ts +92 -0
- package/src/modules/access/access.routes.ts +23 -4
- package/src/modules/access/index.ts +1 -1
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +79 -25
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +38 -11
- package/src/modules/agent-guide/__tests__/guide-budget.test.ts +95 -0
- package/src/modules/agent-guide/__tests__/guide-eval.test.ts +182 -0
- package/src/modules/agent-guide/__tests__/guide-matches-code.test.ts +263 -0
- package/src/modules/agent-guide/__tests__/tool-surface.json +514 -0
- package/src/modules/agent-guide/__tests__/tool-surface.test.ts +75 -0
- package/src/modules/agent-guide/agent-guide.tools.ts +49 -31
- package/src/modules/agent-guide/agent-guide.ts +120 -13
- package/src/modules/agent-guide/guide-budget.ts +73 -0
- package/src/modules/agent-guide/index.ts +12 -0
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +4 -4
- package/src/modules/agent-instructions/compose.ts +4 -0
- package/src/modules/agent-instructions/shared-file-rules.ts +10 -8
- package/src/modules/code-mode/code-mode.tool.ts +2 -2
- package/src/modules/connection-probe/__tests__/connection-probe.service.test.ts +5 -24
- package/src/modules/connection-probe/connection-probe.service.ts +1 -34
- package/src/modules/mcp/mcp.service.ts +5 -35
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.oauth.test.ts +430 -3
- package/src/modules/secrets-vault/__tests__/oauth-live-declaration.route.test.ts +218 -0
- package/src/modules/secrets-vault/__tests__/oauth-return-to.route.test.ts +39 -6
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +170 -27
- package/src/modules/secrets-vault/index.ts +1 -1
- package/src/modules/secrets-vault/secrets-vault.contract.ts +61 -11
- package/src/modules/secrets-vault/secrets-vault.routes.ts +91 -39
- package/src/modules/settings/oidc-check.ts +5 -18
- package/src/modules/skills/skills.tools.ts +1 -1
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +19 -11
- package/src/modules/tool-helpers/__tests__/route-tool-schemas.catalog.test.ts +38 -0
- package/src/modules/tool-helpers/tool-def.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +197 -11
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +96 -5
- package/src/modules/tool-manuals/mcp-json-discovery.ts +73 -34
- package/src/modules/tool-manuals/tool-manuals.contract.ts +22 -0
- package/src/modules/tool-manuals/tool-manuals.service.ts +138 -46
- package/src/modules/tool-manuals/tool-manuals.tools.ts +53 -14
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +6 -113
- package/src/modules/workflow/agent-tools/workflow.tools.ts +22 -18
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +8 -10
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +156 -49
- package/src/modules/workspace/agent-access.gate.ts +1 -1
- package/src/modules/workspace/workspace.tools.ts +74 -21
- package/src/shared/__tests__/read-capped.test.ts +68 -0
- package/src/shared/oauth-token-error.ts +46 -0
- package/src/shared/read-capped.ts +40 -0
- package/agent-guide/finding-things.md +0 -7
- package/agent-guide/introduction.md +0 -27
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { GET_AGENT_GUIDE_TOOL, TOOL_DESCRIPTION_CAP } from '../tool-registry/index.js';
|
|
2
2
|
import { ToolError, toolDef } from '../tool-helpers/index.js';
|
|
3
|
-
import { AGENT_GUIDE_FILE, joinGuideSections } from './agent-guide.js';
|
|
3
|
+
import { AGENT_GUIDE_FILE, START_HERE_SECTION_ID, WHOLE_GUIDE_SECTION, joinGuideSections, } from './agent-guide.js';
|
|
4
4
|
export { GET_AGENT_GUIDE_TOOL };
|
|
5
5
|
/**
|
|
6
|
-
* The one tool that returns the guide on its own
|
|
7
|
-
*
|
|
6
|
+
* The one tool that returns the guide on its own: the start section when no
|
|
7
|
+
* section is named, one section by id, or the whole guide (`all`). Start
|
|
8
|
+
* section by default because this is the call every tool description tells
|
|
9
|
+
* an agent, and each sub-agent it starts, to make first: answering it with
|
|
10
|
+
* the whole guide made the most-read text the platform has also its longest.
|
|
11
|
+
* It takes nothing else: the guide is the platform's text for this
|
|
8
12
|
* deployment, the same for every caller and every branch, and reading it
|
|
9
13
|
* touches no file — so no `branch`, no `sessionId`, and no access gate. The
|
|
10
14
|
* other way to the same text is a `read_file` of `AGENTS.md` at the
|
|
@@ -21,25 +25,28 @@ export { GET_AGENT_GUIDE_TOOL };
|
|
|
21
25
|
export function registerAgentGuideTool(registry, router, toolAuth, toolHandler, sections) {
|
|
22
26
|
const build = async () => {
|
|
23
27
|
const list = await sections();
|
|
24
|
-
const describe = (sectionList) => "The platform's guide to this knowledge base
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'`section
|
|
28
|
+
const describe = (sectionList) => "The platform's guide to this knowledge base. ALWAYS call this first, before anything else in the " +
|
|
29
|
+
'platform. With no `section` it returns the start section: the default branch every file tool takes, the ' +
|
|
30
|
+
'first-call rules, and which section answers which question. Then fetch only the section a task needs, by ' +
|
|
31
|
+
'`section`; only `"' +
|
|
32
|
+
WHOLE_GUIDE_SECTION +
|
|
33
|
+
'"` returns the whole guide. `read_file` on `' +
|
|
28
34
|
AGENT_GUIDE_FILE +
|
|
29
|
-
"` at the KB root
|
|
35
|
+
"` at the KB root answers with the same start section (after the knowledge base's own " +
|
|
30
36
|
AGENT_GUIDE_FILE +
|
|
31
|
-
` when it has one. Sections: ${sectionList}.`;
|
|
37
|
+
` when it has one). Returns \`{ guide }\` as markdown. Sections: ${sectionList}.`;
|
|
32
38
|
// The description stays under the cap WHATEVER a distribution adds, in
|
|
33
39
|
// three steps: every id with its title; every id alone; as many ids as
|
|
34
40
|
// fit and a count of the rest. An id a client cut off the end would be a
|
|
35
41
|
// section an agent cannot ask for — so nothing is ever cut: the one
|
|
36
|
-
// complete list of sections is `sections` on the
|
|
37
|
-
// which the description names when it cannot carry them
|
|
42
|
+
// complete list of sections is `sections` on the answer to a call
|
|
43
|
+
// without one, which the description names when it cannot carry them
|
|
44
|
+
// all itself.
|
|
38
45
|
const titled = describe(list.map((s) => `\`${s.id}\` (${s.title})`).join(', '));
|
|
39
46
|
const ids = list.map((s) => `\`${s.id}\``);
|
|
40
47
|
const counted = (shown) => describe(shown === 0
|
|
41
|
-
? `${ids.length}, named under \`sections\` in the
|
|
42
|
-
: [...ids.slice(0, shown), `and ${ids.length - shown} more, all named under \`sections\` in the
|
|
48
|
+
? `${ids.length}, named under \`sections\` in the answer`
|
|
49
|
+
: [...ids.slice(0, shown), `and ${ids.length - shown} more, all named under \`sections\` in the answer`].join(', '));
|
|
43
50
|
let description = titled.length <= TOOL_DESCRIPTION_CAP ? titled : describe(ids.join(', '));
|
|
44
51
|
for (let shown = ids.length; description.length > TOOL_DESCRIPTION_CAP && shown > 0; shown--) {
|
|
45
52
|
description = counted(shown - 1);
|
|
@@ -53,8 +60,10 @@ export function registerAgentGuideTool(registry, router, toolAuth, toolHandler,
|
|
|
53
60
|
properties: {
|
|
54
61
|
section: {
|
|
55
62
|
type: 'string',
|
|
56
|
-
description: 'Optional: the id of one section to read
|
|
57
|
-
'
|
|
63
|
+
description: 'Optional: the id of one section to read (the ids are listed in this description, and every one under ' +
|
|
64
|
+
'`sections` in the answer), or `"' +
|
|
65
|
+
WHOLE_GUIDE_SECTION +
|
|
66
|
+
'"` for the whole guide. Omit it for the start section.',
|
|
58
67
|
},
|
|
59
68
|
},
|
|
60
69
|
additionalProperties: false,
|
|
@@ -62,18 +71,18 @@ export function registerAgentGuideTool(registry, router, toolAuth, toolHandler,
|
|
|
62
71
|
outputs: {
|
|
63
72
|
type: 'object',
|
|
64
73
|
properties: {
|
|
65
|
-
guide: { type: 'string', description: 'The
|
|
74
|
+
guide: { type: 'string', description: 'The section asked for (the start section by default), or the whole guide, as markdown.' },
|
|
66
75
|
sections: {
|
|
67
76
|
type: 'array',
|
|
68
|
-
description:
|
|
77
|
+
description: `Without \`section\`, or with \`"${WHOLE_GUIDE_SECTION}"\`: every section of the guide, in order, by id and heading — the complete list.`,
|
|
69
78
|
items: {
|
|
70
79
|
type: 'object',
|
|
71
80
|
properties: { id: { type: 'string' }, title: { type: 'string' } },
|
|
72
81
|
required: ['id', 'title'],
|
|
73
82
|
},
|
|
74
83
|
},
|
|
75
|
-
section: { type: 'string', description: '
|
|
76
|
-
title: { type: 'string', description: '
|
|
84
|
+
section: { type: 'string', description: 'The id of the one section returned.' },
|
|
85
|
+
title: { type: 'string', description: 'Its heading.' },
|
|
77
86
|
},
|
|
78
87
|
required: ['guide'],
|
|
79
88
|
},
|
|
@@ -84,23 +93,28 @@ export function registerAgentGuideTool(registry, router, toolAuth, toolHandler,
|
|
|
84
93
|
registry.registerExternalTool(build);
|
|
85
94
|
router.post(`/agent/tools/${GET_AGENT_GUIDE_TOOL}`, toolAuth, toolHandler(async (args, ctx) => {
|
|
86
95
|
const list = await sections();
|
|
96
|
+
const index = list.map((s) => ({ id: s.id, title: s.title }));
|
|
87
97
|
const wanted = typeof args.section === 'string' ? args.section.trim() : '';
|
|
88
|
-
// A
|
|
89
|
-
//
|
|
90
|
-
|
|
98
|
+
// A distribution that dropped the start section gets the whole guide by
|
|
99
|
+
// default, as before there was one: never an answer with nothing in it.
|
|
100
|
+
const start = list.find((s) => s.id === START_HERE_SECTION_ID);
|
|
101
|
+
// A connection made as an agent configuration is told so at the top of
|
|
102
|
+
// the guide's first answer and of the whole guide: the catalog it
|
|
103
|
+
// describes is narrowed to that agent. Everything is told nothing new,
|
|
104
|
+
// so its guide is the same text.
|
|
91
105
|
const connection = ctx.connectionScope?.describe() ?? null;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
const told = (guide) => ({
|
|
107
|
+
guide: connection ? `> ${connection}\n\n${guide}` : guide,
|
|
108
|
+
...(connection ? { connection } : {}),
|
|
109
|
+
});
|
|
110
|
+
if (wanted === WHOLE_GUIDE_SECTION || (!wanted && !start))
|
|
111
|
+
return { ...told(joinGuideSections(list)), sections: index };
|
|
112
|
+
if (!wanted)
|
|
113
|
+
return { ...told(start.body), section: start.id, title: start.title, sections: index };
|
|
100
114
|
const one = list.find((s) => s.id === wanted);
|
|
101
115
|
if (!one) {
|
|
102
116
|
throw new ToolError(`The guide has no section "${wanted}". Sections: ${list.map((s) => `\`${s.id}\``).join(', ')}. ` +
|
|
103
|
-
|
|
117
|
+
`Omit \`section\` for the start section, or pass \`"${WHOLE_GUIDE_SECTION}"\` for the whole guide.`, 400);
|
|
104
118
|
}
|
|
105
119
|
return { guide: one.body, section: one.id, title: one.title };
|
|
106
120
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-guide.tools.js","sourceRoot":"","sources":["../../../src/modules/agent-guide/agent-guide.tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,
|
|
1
|
+
{"version":3,"file":"agent-guide.tools.js","sourceRoot":"","sources":["../../../src/modules/agent-guide/agent-guide.tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GAElB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAuB,EACvB,MAAc,EACd,QAAwB,EACxB,WAA+B,EAC/B,QAAkC;IAElC,MAAM,KAAK,GAAG,KAAK,IAAuB,EAAE;QAC1C,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,CAAC,WAAmB,EAAE,EAAE,CACvC,mGAAmG;YACnG,0GAA0G;YAC1G,2GAA2G;YAC3G,oBAAoB;YACpB,mBAAmB;YACnB,8CAA8C;YAC9C,gBAAgB;YAChB,uFAAuF;YACvF,gBAAgB;YAChB,mEAAmE,WAAW,GAAG,CAAC;QACpF,uEAAuE;QACvE,uEAAuE;QACvE,yEAAyE;QACzE,oEAAoE;QACpE,kEAAkE;QAClE,qEAAqE;QACrE,cAAc;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC,IA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C,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,SAAS,CACjB,6BAA6B,MAAM,gBAAgB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBAC9F,sDAAsD,mBAAmB,0BAA0B,EACrG,GAAG,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IAChE,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much each layer of what an agent is told may cost, in tokens.
|
|
3
|
+
*
|
|
4
|
+
* Three layers (openspec/changes/agent-guide-layers/design.md): what every
|
|
5
|
+
* connection carries (the handshake instructions and the tool list), what an
|
|
6
|
+
* agent reads on first contact (the start section `get_agent_guide` answers
|
|
7
|
+
* with), and what it fetches only when a task needs it (every other section).
|
|
8
|
+
* A line in the first layer costs every conversation and every sub-agent; a
|
|
9
|
+
* line in the last costs only the tasks that fetch it. The budgets are what
|
|
10
|
+
* keeps the guide from growing into a document every agent loads whole and
|
|
11
|
+
* reads little of, which is what a customer's agent did fifteen times in one
|
|
12
|
+
* day.
|
|
13
|
+
*
|
|
14
|
+
* Counted with the `o200k_base` encoding by `__tests__/guide-budget.test.ts`.
|
|
15
|
+
* It is a real tokenizer that runs offline; it is not Claude's own, which
|
|
16
|
+
* usually counts somewhat more for the same text, so these are ceilings to
|
|
17
|
+
* compare against each other and over time rather than a model's bill.
|
|
18
|
+
*
|
|
19
|
+
* Every number is one a reviewer may move. The point of pinning them is that
|
|
20
|
+
* growing the guide is a decision someone takes, not a paragraph someone
|
|
21
|
+
* appends: a section that needs more room says why in the pull request that
|
|
22
|
+
* raises its line here.
|
|
23
|
+
*/
|
|
24
|
+
/** The encoding the budgets are counted in. */
|
|
25
|
+
export declare const GUIDE_TOKEN_ENCODING = "o200k_base";
|
|
26
|
+
/** The platform's part of the handshake instructions: the header and the shared file rules. */
|
|
27
|
+
export declare const INSTRUCTIONS_TOKEN_BUDGET = 2000;
|
|
28
|
+
/**
|
|
29
|
+
* The platform's own tools as the hosted endpoint lists them to an MCP client:
|
|
30
|
+
* each name, description (with its `Call:` line and, on the four
|
|
31
|
+
* knowledge-base tools, the purpose prefix) and input schema. Measured over
|
|
32
|
+
* every registrar the root mounts, the change-request readers and `open_page`
|
|
33
|
+
* included: 46 tools, 17,278 tokens at 0.35.0 (an earlier figure of 15,710
|
|
34
|
+
* left those five out).
|
|
35
|
+
*/
|
|
36
|
+
export declare const TOOL_LIST_TOKEN_BUDGET = 17500;
|
|
37
|
+
/** The ceiling for a section a distribution adds, which core's checks cannot see: the same as core's own. */
|
|
38
|
+
export declare const SECTION_TOKEN_BUDGET = 2500;
|
|
39
|
+
/**
|
|
40
|
+
* Each core section's budget, by id. A section without a line here fails the
|
|
41
|
+
* budget test: a new section starts by saying what it may cost.
|
|
42
|
+
*/
|
|
43
|
+
export declare const SECTION_TOKEN_BUDGETS: Readonly<Record<string, number>>;
|
|
44
|
+
/** Every core section at once: what `section: "all"` returns. */
|
|
45
|
+
export declare const WHOLE_GUIDE_TOKEN_BUDGET = 21500;
|
|
46
|
+
/** One task: the start section plus the sections it routes the task to. */
|
|
47
|
+
export declare const TASK_TOKEN_BUDGET = 6000;
|
|
48
|
+
//# sourceMappingURL=guide-budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guide-budget.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-guide/guide-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C,6GAA6G;AAC7G,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBjE,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,OAAQ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much each layer of what an agent is told may cost, in tokens.
|
|
3
|
+
*
|
|
4
|
+
* Three layers (openspec/changes/agent-guide-layers/design.md): what every
|
|
5
|
+
* connection carries (the handshake instructions and the tool list), what an
|
|
6
|
+
* agent reads on first contact (the start section `get_agent_guide` answers
|
|
7
|
+
* with), and what it fetches only when a task needs it (every other section).
|
|
8
|
+
* A line in the first layer costs every conversation and every sub-agent; a
|
|
9
|
+
* line in the last costs only the tasks that fetch it. The budgets are what
|
|
10
|
+
* keeps the guide from growing into a document every agent loads whole and
|
|
11
|
+
* reads little of, which is what a customer's agent did fifteen times in one
|
|
12
|
+
* day.
|
|
13
|
+
*
|
|
14
|
+
* Counted with the `o200k_base` encoding by `__tests__/guide-budget.test.ts`.
|
|
15
|
+
* It is a real tokenizer that runs offline; it is not Claude's own, which
|
|
16
|
+
* usually counts somewhat more for the same text, so these are ceilings to
|
|
17
|
+
* compare against each other and over time rather than a model's bill.
|
|
18
|
+
*
|
|
19
|
+
* Every number is one a reviewer may move. The point of pinning them is that
|
|
20
|
+
* growing the guide is a decision someone takes, not a paragraph someone
|
|
21
|
+
* appends: a section that needs more room says why in the pull request that
|
|
22
|
+
* raises its line here.
|
|
23
|
+
*/
|
|
24
|
+
/** The encoding the budgets are counted in. */
|
|
25
|
+
export const GUIDE_TOKEN_ENCODING = 'o200k_base';
|
|
26
|
+
/** The platform's part of the handshake instructions: the header and the shared file rules. */
|
|
27
|
+
export const INSTRUCTIONS_TOKEN_BUDGET = 2_000;
|
|
28
|
+
/**
|
|
29
|
+
* The platform's own tools as the hosted endpoint lists them to an MCP client:
|
|
30
|
+
* each name, description (with its `Call:` line and, on the four
|
|
31
|
+
* knowledge-base tools, the purpose prefix) and input schema. Measured over
|
|
32
|
+
* every registrar the root mounts, the change-request readers and `open_page`
|
|
33
|
+
* included: 46 tools, 17,278 tokens at 0.35.0 (an earlier figure of 15,710
|
|
34
|
+
* left those five out).
|
|
35
|
+
*/
|
|
36
|
+
export const TOOL_LIST_TOKEN_BUDGET = 17_500;
|
|
37
|
+
/** The ceiling for a section a distribution adds, which core's checks cannot see: the same as core's own. */
|
|
38
|
+
export const SECTION_TOKEN_BUDGET = 2_500;
|
|
39
|
+
/**
|
|
40
|
+
* Each core section's budget, by id. A section without a line here fails the
|
|
41
|
+
* budget test: a new section starts by saying what it may cost.
|
|
42
|
+
*/
|
|
43
|
+
export const SECTION_TOKEN_BUDGETS = Object.freeze({
|
|
44
|
+
'start-here': 1_200,
|
|
45
|
+
'how-agents-find-things': SECTION_TOKEN_BUDGET,
|
|
46
|
+
'for-git-users': SECTION_TOKEN_BUDGET,
|
|
47
|
+
glossary: SECTION_TOKEN_BUDGET,
|
|
48
|
+
'directory-structure': SECTION_TOKEN_BUDGET,
|
|
49
|
+
'where-a-new-file-goes': SECTION_TOKEN_BUDGET,
|
|
50
|
+
'working-with-files': SECTION_TOKEN_BUDGET,
|
|
51
|
+
'access-control': SECTION_TOKEN_BUDGET,
|
|
52
|
+
'drafts-and-change-requests': SECTION_TOKEN_BUDGET,
|
|
53
|
+
skills: SECTION_TOKEN_BUDGET,
|
|
54
|
+
tools: SECTION_TOKEN_BUDGET,
|
|
55
|
+
'tool-manuals': SECTION_TOKEN_BUDGET,
|
|
56
|
+
// The page contract is long by nature (the frame, the bridge, the link
|
|
57
|
+
// rules, pages that load live data), and an agent fetches it only to build
|
|
58
|
+
// a page.
|
|
59
|
+
'html-views': 5_500,
|
|
60
|
+
conventions: SECTION_TOKEN_BUDGET,
|
|
61
|
+
'new-knowledge-base': SECTION_TOKEN_BUDGET,
|
|
62
|
+
});
|
|
63
|
+
/** Every core section at once: what `section: "all"` returns. */
|
|
64
|
+
export const WHOLE_GUIDE_TOKEN_BUDGET = 21_500;
|
|
65
|
+
/** One task: the start section plus the sections it routes the task to. */
|
|
66
|
+
export const TASK_TOKEN_BUDGET = 6_000;
|
|
67
|
+
//# sourceMappingURL=guide-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guide-budget.js","sourceRoot":"","sources":["../../../src/modules/agent-guide/guide-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEjD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAqC,MAAM,CAAC,MAAM,CAAC;IACnF,YAAY,EAAE,KAAK;IACnB,wBAAwB,EAAE,oBAAoB;IAC9C,eAAe,EAAE,oBAAoB;IACrC,QAAQ,EAAE,oBAAoB;IAC9B,qBAAqB,EAAE,oBAAoB;IAC3C,uBAAuB,EAAE,oBAAoB;IAC7C,oBAAoB,EAAE,oBAAoB;IAC1C,gBAAgB,EAAE,oBAAoB;IACtC,4BAA4B,EAAE,oBAAoB;IAClD,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,cAAc,EAAE,oBAAoB;IACpC,uEAAuE;IACvE,2EAA2E;IAC3E,UAAU;IACV,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,oBAAoB;IACjC,oBAAoB,EAAE,oBAAoB;CAC3C,CAAC,CAAC;AAEH,iEAAiE;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE/C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { AGENT_GUIDE_FILE, CORE_SECTION_IDS, NEW_KNOWLEDGE_BASE_SECTION_ID, PLATFORM_GUIDE_SEPARATOR, WORKING_WITH_FILES_SECTION_ID, agentGuideSections, composeAgentGuide, coreAgentGuideSections, isAgentGuidePath, isManagedGuide, joinGuideSections, withPlatformGuideAppended, type AgentGuideContext, type AgentGuideHook, type AgentGuideReader, type AgentGuideSection, type AgentGuideSectionsReader, type RenderedGuideSection, } from './agent-guide.js';
|
|
1
|
+
export { AGENT_GUIDE_FILE, CORE_SECTION_IDS, NEW_KNOWLEDGE_BASE_SECTION_ID, PLATFORM_GUIDE_SEPARATOR, START_HERE_SECTION_ID, WHOLE_GUIDE_SECTION, WORKING_WITH_FILES_SECTION_ID, agentGuideSections, composeAgentGuide, coreAgentGuideSections, guideStartText, isAgentGuidePath, isManagedGuide, joinGuideSections, withPlatformGuideAppended, type AgentGuideContext, type AgentGuideHook, type AgentGuideReader, type AgentGuideSection, type AgentGuideSectionsReader, type RenderedGuideSection, } from './agent-guide.js';
|
|
2
2
|
export { GET_AGENT_GUIDE_TOOL, registerAgentGuideTool } from './agent-guide.tools.js';
|
|
3
|
+
export { GUIDE_TOKEN_ENCODING, INSTRUCTIONS_TOKEN_BUDGET, SECTION_TOKEN_BUDGET, SECTION_TOKEN_BUDGETS, TASK_TOKEN_BUDGET, TOOL_LIST_TOKEN_BUDGET, WHOLE_GUIDE_TOKEN_BUDGET, } from './guide-budget.js';
|
|
3
4
|
export { GUIDE_FIRST_SENTENCE, withGuideFirst } from '../tool-registry/index.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { AGENT_GUIDE_FILE, CORE_SECTION_IDS, NEW_KNOWLEDGE_BASE_SECTION_ID, PLATFORM_GUIDE_SEPARATOR, WORKING_WITH_FILES_SECTION_ID, agentGuideSections, composeAgentGuide, coreAgentGuideSections, isAgentGuidePath, isManagedGuide, joinGuideSections, withPlatformGuideAppended, } from './agent-guide.js';
|
|
1
|
+
export { AGENT_GUIDE_FILE, CORE_SECTION_IDS, NEW_KNOWLEDGE_BASE_SECTION_ID, PLATFORM_GUIDE_SEPARATOR, START_HERE_SECTION_ID, WHOLE_GUIDE_SECTION, WORKING_WITH_FILES_SECTION_ID, agentGuideSections, composeAgentGuide, coreAgentGuideSections, guideStartText, isAgentGuidePath, isManagedGuide, joinGuideSections, withPlatformGuideAppended, } from './agent-guide.js';
|
|
2
2
|
export { GET_AGENT_GUIDE_TOOL, registerAgentGuideTool } from './agent-guide.tools.js';
|
|
3
|
+
export { GUIDE_TOKEN_ENCODING, INSTRUCTIONS_TOKEN_BUDGET, SECTION_TOKEN_BUDGET, SECTION_TOKEN_BUDGETS, TASK_TOKEN_BUDGET, TOOL_LIST_TOKEN_BUDGET, WHOLE_GUIDE_TOKEN_BUDGET, } from './guide-budget.js';
|
|
3
4
|
export { GUIDE_FIRST_SENTENCE, withGuideFirst } from '../tool-registry/index.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/agent-guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,GAO1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/agent-guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,GAO1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-instructions/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,EAEL,YAAY,EACZ,aAAa,EACb,eAAe,EAEf,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAExD,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAiE,CAAC;AAEjH;;;;GAIG;AACH,eAAO,MAAM,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MAAM,GAAG,IAAI,EACvB,MAAM,GAAE,QAA4B,GACnC,yBAAyB,CA+B3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAKjG"}
|
|
@@ -38,6 +38,10 @@ export const PLATFORM_HEADER = "Hexis is this organisation's knowledge base, tog
|
|
|
38
38
|
'search the knowledge base: call `start_session` once, then `grep` for the key terms, `list_files` to orient, and `read_file` what matches. ' +
|
|
39
39
|
'Prefer what you find there over memory or the web, and say so when the knowledge base is silent on something the organisation should have documented. ' +
|
|
40
40
|
'Skills are available as prompts and through `list_skills` and `get_skill`. ' +
|
|
41
|
+
// Said here as well as on the write tools: agents wrote to the default
|
|
42
|
+
// branch without asking (the agent-guide benchmark, 2026-10-26), and this
|
|
43
|
+
// text reaches an agent that never fetches the guide.
|
|
44
|
+
'A write to the default branch is live for everyone: unless the person said where, ask first whether to write there or on a draft. ' +
|
|
41
45
|
// There is no one calling shape to state: the knowledge-base tools take
|
|
42
46
|
// their arguments under `body`, a tool that calls another service takes them
|
|
43
47
|
// flat, and an agent told one rule for all of them sends a GET with a body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/modules/agent-instructions/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,uEAAuE;AACvE,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,QAAQ;AACR,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,iBAAiB,GAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAExD,oFAA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AC;IACD,KAAK,EAAE,CAAC;IACR,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gFAAgF;AAChF,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,EAAE,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC,CAAC;aACxB,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;;YAC9C,MAAM;IACb,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,GAAW;IAC/C,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-file-rules.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-instructions/shared-file-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AAGzC,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAUzD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAE3C,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,cAAc,EAAE,CAgI3E;
|
|
1
|
+
{"version":3,"file":"shared-file-rules.d.ts","sourceRoot":"","sources":["../../../src/modules/agent-instructions/shared-file-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AAGzC,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAUzD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAE3C,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,cAAc,EAAE,CAgI3E;AAwCD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAK/D"}
|
|
@@ -151,10 +151,10 @@ export function sharedFileRules(layout) {
|
|
|
151
151
|
heading: 'Dry-run before a move, a copy or a folder delete',
|
|
152
152
|
body: 'move_file, copy_file and delete_folder take `dryRun: true`: it changes nothing and answers the impact — ' +
|
|
153
153
|
'what the call would touch, `allowed`, and `reason` when it may not run. A non-empty folder is deleted, and a ' +
|
|
154
|
-
'move that changes
|
|
154
|
+
'move that changes anyone\'s access runs, only with `confirm: true`; without it the call changes nothing and ' +
|
|
155
155
|
'returns the same impact with `confirmationRequired: true`. Do NOT set `confirm: true` on your first call — ' +
|
|
156
156
|
'dry-run, check the impact, then confirm. delete_file takes neither: check it first with file_stat ' +
|
|
157
|
-
'(`deletable`)
|
|
157
|
+
'(`deletable`). delete_branch has its own `dryRun`.',
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
id: 'managed-items',
|
|
@@ -172,7 +172,7 @@ export function sharedFileRules(layout) {
|
|
|
172
172
|
{
|
|
173
173
|
id: 'refused-for-permissions',
|
|
174
174
|
heading: 'When a write is refused for permissions',
|
|
175
|
-
body: '
|
|
175
|
+
body: 'The `write-denied` error says whether you may propose the ' +
|
|
176
176
|
'change instead (create a branch from this one, repeat the call on it, then `open_change_request` into this ' +
|
|
177
177
|
'branch) and lists those steps.',
|
|
178
178
|
},
|
|
@@ -208,16 +208,18 @@ function platformFileList(layout) {
|
|
|
208
208
|
* The conventions reminder — where the platform's guide is, that the
|
|
209
209
|
* organisation's own conventions file comes with it, and to read both first.
|
|
210
210
|
*
|
|
211
|
-
* The guide is read by name at the repository root, where coding
|
|
212
|
-
* for an `AGENTS.md` by convention, and `get_agent_guide` returns
|
|
211
|
+
* The guide's start is read by name at the repository root, where coding
|
|
212
|
+
* agents look for an `AGENTS.md` by convention, and `get_agent_guide` returns
|
|
213
|
+
* it or any one section.
|
|
213
214
|
* One name on every deployment, so the rule takes no layout. `CLAUDE.md` is
|
|
214
215
|
* named as a fallback because a knowledge base seeded before the rename may
|
|
215
216
|
* still carry one its people edited.
|
|
216
217
|
*/
|
|
217
218
|
function conventionsRule() {
|
|
218
|
-
return ("Before your first read or change in a workspace, call `get_agent_guide
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
return ("Before your first read or change in a workspace, call `get_agent_guide`: it answers the guide's start, " +
|
|
220
|
+
"which names the default branch and the section for each question. " +
|
|
221
|
+
`read_file on \`${LEGACY_AGENTS_FILE}\` at the KB root answers with ` +
|
|
222
|
+
"that start, after the organisation's own conventions file of that name when it has one: follow both. A " +
|
|
221
223
|
`\`${PRE_RENAME_AGENTS_FILE}\` at the KB root is the organisation's own too; read it if it exists.`);
|
|
222
224
|
}
|
|
223
225
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-file-rules.js","sourceRoot":"","sources":["../../../src/modules/agent-instructions/shared-file-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAElG,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAY3C;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,MAAgB;IAC9C,OAAO;QACL;YACE,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE,uCAAuC;YAChD,IAAI,EAAE,eAAe,EAAE;SACxB;QACD;YACE,EAAE,EAAE,eAAe;YACnB,OAAO,EAAE,4CAA4C;YACrD,IAAI,EACF,yEAAyE;gBACzE,+GAA+G;gBAC/G,4GAA4G;gBAC5G,kHAAkH;gBAClH,4GAA4G;gBAC5G,+CAA+C;gBAC/C,uEAAuE;gBACvE,6GAA6G;gBAC7G,8GAA8G;gBAC9G,6GAA6G;gBAC7G,gHAAgH;gBAChH,8GAA8G;gBAC9G,+GAA+G;gBAC/G,4GAA4G;gBAC5G,6GAA6G;gBAC7G,+GAA+G;gBAC/G,uGAAuG;gBACvG,kHAAkH;gBAClH,oEAAoE;SACvE;QACD;YACE,oDAAoD;YACpD,sEAAsE;YACtE,0DAA0D;YAC1D,EAAE,EAAE,eAAe;YACnB,OAAO,EAAE,4CAA4C;YACrD,IAAI,EACF,4GAA4G;gBAC5G,+GAA+G;gBAC/G,6GAA6G;gBAC7G,sCAAsC;SACzC;QACD;YACE,EAAE,EAAE,YAAY;YAChB,OAAO,EAAE,+BAA+B;YACxC,IAAI,EACF,6GAA6G;gBAC7G,gHAAgH;gBAChH,0GAA0G;gBAC1G,6GAA6G;SAChH;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,OAAO,EAAE,iCAAiC;YAC1C,IAAI,EACF,4GAA4G;gBAC5G,mFAAmF;SACtF;QACD;YACE,EAAE,EAAE,kBAAkB;YACtB,OAAO,EAAE,sCAAsC;YAC/C,IAAI,EACF,4GAA4G;gBAC5G,8GAA8G;gBAC9G,8GAA8G;gBAC9G,+GAA+G;gBAC/G,iGAAiG;SACpG;QACD;YACE,yEAAyE;YACzE,wEAAwE;YACxE,4DAA4D;YAC5D,EAAE,EAAE,cAAc;YAClB,OAAO,EAAE,iEAAiE;YAC1E,IAAI,EACF,2GAA2G;gBAC3G,2GAA2G;gBAC3G,4GAA4G;gBAC5G,yEAAyE;gBACzE,wGAAwG;gBACxG,iGAAiG;gBACjG,uEAAuE;SAC1E;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,OAAO,EAAE,kDAAkD;YAC3D,IAAI,EACF,0GAA0G;gBAC1G,+GAA+G;gBAC/G,
|
|
1
|
+
{"version":3,"file":"shared-file-rules.js","sourceRoot":"","sources":["../../../src/modules/agent-instructions/shared-file-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAElG,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,WAAW,CA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CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrG,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,mBAAmB,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAAC;AACzF,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,eAAe;IACtB,OAAO,CACL,yGAAyG;QACzG,oEAAoE;QACpE,kBAAkB,kBAAkB,iCAAiC;QACrE,yGAAyG;QACzG,KAAK,sBAAsB,wEAAwE,CACpG,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAgB;IACrD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC;SACjC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;SACpD,IAAI,CAAC,MAAM,CAAC,CAAC;IAChB,OAAO,MAAM,oBAAoB,OAAO,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -34,7 +34,7 @@ export function createCallToolChainTool(client, spillStore, namespace, tools = [
|
|
|
34
34
|
`There is NO single calling shape: some tools take their arguments under a \`body\` object, others take them flat. Call each tool as the \`Call:\` line at the top of its own description shows — it is generated from that tool's input schema, and every tool in \`${ns}\` has one. Every argument a tool declares REQUIRED must be present; for the knowledge-base tools that includes \`branch\`. Arguments that do not match the schema are refused before anything is sent or run, and the refusal carries the tool's interface.`,
|
|
35
35
|
'Error handling inside the chain: a failing tool call THROWS, and the thrown error\'s `.message` holds the server\'s actual reason (e.g. a 403 with the explanation, not just a status code). If you catch it, surface `err.message` (and `err.status` / `err.data` when present) — NEVER `return { error: err }` or otherwise return the raw Error object, because an Error serializes to `{}` (its `message` is non-enumerable) and the reason is lost. If you don\'t need to handle it, just let it throw — the runtime already reports `err.message` back to you.',
|
|
36
36
|
`Failures are answered, never dropped: a chain that throws comes back with \`success: false\` and the reason, and one that outlives \`timeout\` (default ${CHAIN_TIMEOUT_DEFAULT_MS} ms, maximum ${CHAIN_TIMEOUT_MAX_MS} ms) comes back saying it timed out — raise \`timeout\` or split the work and run it again. Either way your next tool call works as usual.`,
|
|
37
|
-
'Large return values: if the returned value exceeds `max_output_size`, the full JSON is auto-spilled to a shared spill store (outside any workspace, never committed) and the response contains only a `__tool_chain_spill__/…` ref + a truncated marker. You can read the spill back with the regular `read_file` tool — pass that ref as `path` (
|
|
37
|
+
'Large return values: if the returned value exceeds `max_output_size`, the full JSON is auto-spilled to a shared spill store (outside any workspace, never committed) and the response contains only a `__tool_chain_spill__/…` ref + a truncated marker. You can read the spill back with the regular `read_file` tool — pass that ref as `path` (any existing branch as `branch`; it is not used) plus `offset` / `limit` to slice it, never read a multi-MB file in full. Order of preference: (1) re-run `call_tool_chain` with a follow-up code chain that filters/maps the data inline and returns just what you need; (2) narrow the API call — shorter `fields`, tighter date window, lower `limit`; (3) last resort — `read_file` against the spill ref with `offset` / `limit`. The spill is read-only context only; do NOT use it as a way to persist KB content — for KB writes use the regular `write_file` / `edit_file` tools, which go through the lock/commit pipeline.',
|
|
38
38
|
].join('\n\n'),
|
|
39
39
|
inputSchema: z.object({
|
|
40
40
|
code: z
|
|
@@ -104,7 +104,7 @@ export function createCallToolChainTool(client, spillStore, namespace, tools = [
|
|
|
104
104
|
truncated: true,
|
|
105
105
|
result_ref: ref,
|
|
106
106
|
result_bytes: bytes,
|
|
107
|
-
message: `Combined result+logs payload was ${fullJson.length} characters (exceeded max_output_size of ${maxOutputSize}). Full JSON (both \`result\` and \`logs\`) saved to the shared spill store as \`${ref}\` (outside any workspace, uncommitted). Read it back with \`read_file\` — pass that ref as \`path\` (\`branch
|
|
107
|
+
message: `Combined result+logs payload was ${fullJson.length} characters (exceeded max_output_size of ${maxOutputSize}). Full JSON (both \`result\` and \`logs\`) saved to the shared spill store as \`${ref}\` (outside any workspace, uncommitted). Read it back with \`read_file\` — pass that ref as \`path\` (any existing branch as \`branch\`; it is not used) plus \`offset\` / \`limit\` for a slice — or, usually better, narrow the next \`call_tool_chain\` call (smaller fields list, tighter date window, lower limit) so the result fits inline.`,
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-mode.tool.js","sourceRoot":"","sources":["../../../src/modules/code-mode/code-mode.tool.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EAEZ,YAAY,EACZ,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEzG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA0B,EAC1B,UAAsB,EACtB,SAAiB,EACjB,QAAqC,EAAE;IAEvC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/D,yEAAyE;IACzE,kEAAkE;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,mDAAmD,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACzF,OAAO,UAAU,CAAC;QAChB,EAAE,EAAE,iBAAiB;QACrB,WAAW,EAAE;YACX,kBAAkB,CAAC,qBAAqB;YACxC,4HAA4H,MAAM,mYAAmY;YACrgB,uQAAuQ,EAAE,8PAA8P;YACvgB,siBAAsiB;YACtiB,2JAA2J,wBAAwB,gBAAgB,oBAAoB,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sBAAsB,CAAC;wBAAE,MAAM,GAAG,CAAC;oBACxD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YACD,OAAO;gBACL,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;gBACnC,SAAS,EAAE,QAAQ;gBACnB,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACzC,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -91,16 +91,4 @@ export declare class ConnectionProbeService implements IConnectionProbeService {
|
|
|
91
91
|
*/
|
|
92
92
|
private substitute;
|
|
93
93
|
}
|
|
94
|
-
/**
|
|
95
|
-
* At most `limit` bytes of a response body, decoded as text.
|
|
96
|
-
*
|
|
97
|
-
* Each CHUNK is sliced to the remaining budget before being decoded, not just
|
|
98
|
-
* counted against it: a provider that answers in one 5MB chunk would otherwise
|
|
99
|
-
* put the whole thing through the decoder before the loop noticed it was over,
|
|
100
|
-
* which is the bound bypassed by the very party it is meant to bound.
|
|
101
|
-
*
|
|
102
|
-
* Exported for its test — the property here is how much is held in memory,
|
|
103
|
-
* which the caller's 200-character snippet hides completely.
|
|
104
|
-
*/
|
|
105
|
-
export declare function readCapped(res: Response, limit: number): Promise<string>;
|
|
106
94
|
//# sourceMappingURL=connection-probe.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-probe.service.d.ts","sourceRoot":"","sources":["../../../src/modules/connection-probe/connection-probe.service.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,kBAAkB,EAAoC,MAAM,0BAA0B,CAAC;AACrG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"connection-probe.service.d.ts","sourceRoot":"","sources":["../../../src/modules/connection-probe/connection-probe.service.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,kBAAkB,EAAoC,MAAM,0BAA0B,CAAC;AACrG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,KAAK,EAAE,uBAAuB,EAAe,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAwXzG;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,uBAAuB;IAElE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAPb,iBAAiB,EAAE,kBAAkB,EACrC,YAAY,EAAE,oBAAoB;IACnD;;;;OAIG;IACc,YAAY,CAAC,EAAE,MAAM,YAAA;IAGlC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAY1F;;;;;;;;;;;;;OAaG;YACW,QAAQ;IAYtB;;;;;;OAMG;YACW,aAAa;IAqE3B;;;;;OAKG;YACW,iBAAiB;IAyE/B;;;;;;;;;;;OAWG;YACW,iBAAiB;IA+B/B;;;;;;;;;;OAUG;YACW,uBAAuB;IAmBrC;;;;;;;;;OASG;YACW,UAAU;CAqCzB"}
|
|
@@ -9,6 +9,7 @@ import { registerManual } from '@bevel-software/platform-mcp-core';
|
|
|
9
9
|
import { bevelSecretsLoaderConfig } from '../secrets-vault/index.js';
|
|
10
10
|
import { utcpNamespacedKey } from '../../shared/utcp-namespace.js';
|
|
11
11
|
import { assertSafeFetchUrl } from '../../shared/ssrf.js';
|
|
12
|
+
import { readCapped } from '../../shared/read-capped.js';
|
|
12
13
|
/** How long a probe may take before we call it inconclusive. */
|
|
13
14
|
const PROBE_TIMEOUT_MS = 10_000;
|
|
14
15
|
const OK = { status: 'ok', detail: null };
|
|
@@ -697,42 +698,4 @@ async function describeRejection(res, redactor) {
|
|
|
697
698
|
return fallback;
|
|
698
699
|
}
|
|
699
700
|
}
|
|
700
|
-
/**
|
|
701
|
-
* At most `limit` bytes of a response body, decoded as text.
|
|
702
|
-
*
|
|
703
|
-
* Each CHUNK is sliced to the remaining budget before being decoded, not just
|
|
704
|
-
* counted against it: a provider that answers in one 5MB chunk would otherwise
|
|
705
|
-
* put the whole thing through the decoder before the loop noticed it was over,
|
|
706
|
-
* which is the bound bypassed by the very party it is meant to bound.
|
|
707
|
-
*
|
|
708
|
-
* Exported for its test — the property here is how much is held in memory,
|
|
709
|
-
* which the caller's 200-character snippet hides completely.
|
|
710
|
-
*/
|
|
711
|
-
export async function readCapped(res, limit) {
|
|
712
|
-
const reader = res.body?.getReader();
|
|
713
|
-
// No stream (a mocked or already-consumed response): fall back to the whole
|
|
714
|
-
// body, which for those cases is ours and small.
|
|
715
|
-
if (!reader)
|
|
716
|
-
return (await res.text()).slice(0, limit);
|
|
717
|
-
const decoder = new TextDecoder();
|
|
718
|
-
let out = '';
|
|
719
|
-
let read = 0;
|
|
720
|
-
try {
|
|
721
|
-
while (read < limit) {
|
|
722
|
-
const { done, value } = await reader.read();
|
|
723
|
-
if (done)
|
|
724
|
-
break;
|
|
725
|
-
const remaining = limit - read;
|
|
726
|
-
const chunk = value.byteLength > remaining ? value.subarray(0, remaining) : value;
|
|
727
|
-
read += chunk.byteLength;
|
|
728
|
-
out += decoder.decode(chunk, { stream: true });
|
|
729
|
-
if (chunk.byteLength < value.byteLength)
|
|
730
|
-
break;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
finally {
|
|
734
|
-
await reader.cancel().catch(() => { });
|
|
735
|
-
}
|
|
736
|
-
return out;
|
|
737
|
-
}
|
|
738
701
|
//# sourceMappingURL=connection-probe.service.js.map
|