@cursor/july 0.1.34 → 0.1.36
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/AGENTS.md +5 -9
- package/README.md +5 -9
- package/dist/channels/github/github-channel.d.ts +1 -1
- package/dist/channels/github/github-channel.js +1 -1
- package/dist/channels/github/index.d.ts +1 -1
- package/dist/channels/github/index.js +1 -1
- package/dist/channels/slack/index.d.ts +1 -1
- package/dist/channels/slack/index.js +1 -1
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +2 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +8 -17
- package/dist/docs/assets/{ab.md.DAQoJ-up.js → ab.md.6cLOW7--.js} +4 -13
- package/dist/docs/assets/{ab.md.DAQoJ-up.lean.js → ab.md.6cLOW7--.lean.js} +1 -1
- package/dist/docs/assets/{app.FPupl4SP.js → app.DEcxy4oz.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.CnHqvYDd.js → building-with-agents.md.txrcGU2B.js} +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.ByFYcFly.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Cd182Cu0.js → VPLocalSearchBox.n1VOZcy3.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEM3Okcd.js → theme.BaF1MQ9c.js} +2 -2
- package/dist/docs/assets/{concepts.md.DFaQEFkA.js → concepts.md.CqOsxbMU.js} +1 -1
- package/dist/docs/assets/{deployment.md.9MYBuKM1.js → deployment.md.CuK5SNjN.js} +1 -1
- package/dist/docs/assets/{evals.md.BIUoVZ6X.js → evals.md.BQXI3rXy.js} +9 -15
- package/dist/docs/assets/{evals.md.BIUoVZ6X.lean.js → evals.md.BQXI3rXy.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_approval-buddy.md.BhEfleVx.js → example-agents_approval-buddy.md.CIiZ9coo.js} +1 -1
- package/dist/docs/assets/{example-agents_benny.md.2Et1qa8f.js → example-agents_benny.md.l7JTmm8X.js} +1 -1
- package/dist/docs/assets/{example-agents_bugbot.md.ByUexi5i.js → example-agents_bugbot.md.Dp5JqHSQ.js} +2 -2
- package/dist/docs/assets/{example-agents_bugbot.md.ByUexi5i.lean.js → example-agents_bugbot.md.Dp5JqHSQ.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_codebase-wiki.md.B4y-7ZVW.js → example-agents_codebase-wiki.md.D-lteFf0.js} +1 -1
- package/dist/docs/assets/{example-agents_codebase-wiki.md.B4y-7ZVW.lean.js → example-agents_codebase-wiki.md.D-lteFf0.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_codeowners-review.md.D6ay4nvf.js → example-agents_codeowners-review.md.BU2ZXLf-.js} +1 -1
- package/dist/docs/assets/{example-agents_codeowners-review.md.D6ay4nvf.lean.js → example-agents_codeowners-review.md.BU2ZXLf-.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_concierge.md.lL8rhYlj.js → example-agents_concierge.md.DA2al_NK.js} +2 -2
- package/dist/docs/assets/{example-agents_concierge.md.lL8rhYlj.lean.js → example-agents_concierge.md.DA2al_NK.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_fsd.md.DfNKQTHz.js → example-agents_fsd.md.DPz9ezO4.js} +1 -1
- package/dist/docs/assets/{example-agents_knowledge-base.md.CzyZ2DCr.js → example-agents_knowledge-base.md.IneynQSR.js} +1 -1
- package/dist/docs/assets/{example-agents_oncall.md.wFFXXEyW.js → example-agents_oncall.md.ZE0n6ZFN.js} +1 -1
- package/dist/docs/assets/{example-agents_slack-agent.md.DvgvT4nn.js → example-agents_slack-agent.md.06jQXTAI.js} +1 -1
- package/dist/docs/assets/{example-agents_weather-agent.md.BADkPqxQ.js → example-agents_weather-agent.md.CrGZ0SqR.js} +3 -3
- package/dist/docs/assets/{example-agents_weather-agent.md.BADkPqxQ.lean.js → example-agents_weather-agent.md.CrGZ0SqR.lean.js} +1 -1
- package/dist/docs/assets/guides_cloud-runtime.md.V5igN4Sq.js +9 -0
- package/dist/docs/assets/guides_cloud-runtime.md.V5igN4Sq.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.DiAwSR42.js → guides_webhooks.md.BERuBSJW.js} +1 -1
- package/dist/docs/assets/{hillclimbing.md.D9Y1_bYh.js → hillclimbing.md.yXqdlv2R.js} +1 -1
- package/dist/docs/assets/index.md.CmhptOmN.js +24 -0
- package/dist/docs/assets/{index.md.CZqbBJPB.lean.js → index.md.CmhptOmN.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.TnEXYgYW.js → quickstart.md.C_b6ESpD.js} +7 -4
- package/dist/docs/assets/{quickstart.md.TnEXYgYW.lean.js → quickstart.md.C_b6ESpD.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.kuN6-OxK.js → reference_agent-config.md.CRmkoxd6.js} +6 -4
- package/dist/docs/assets/{reference_agent-config.md.kuN6-OxK.lean.js → reference_agent-config.md.CRmkoxd6.lean.js} +1 -1
- package/dist/docs/assets/reference_artifacts.md.BGG4bZo-.js +19 -0
- package/dist/docs/assets/reference_artifacts.md.BGG4bZo-.lean.js +1 -0
- package/dist/docs/assets/{reference_channels.md.CDhTRfUz.js → reference_channels.md.BIabFUAI.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.CDhTRfUz.lean.js → reference_channels.md.BIabFUAI.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.sD-IUWjg.js → reference_cli.md.Byvrg8eu.js} +15 -9
- package/dist/docs/assets/{reference_cli.md.sD-IUWjg.lean.js → reference_cli.md.Byvrg8eu.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.DyLVfE1O.js → reference_hooks.md.BGDw4VLm.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.DyLVfE1O.lean.js → reference_hooks.md.BGDw4VLm.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.DGrw_wOu.js +11 -0
- package/dist/docs/assets/reference_http-api.md.DGrw_wOu.lean.js +1 -0
- package/dist/docs/assets/{reference_project-layout.md.D8E6ZmHJ.js → reference_project-layout.md._XdeMahr.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.D8E6ZmHJ.lean.js → reference_project-layout.md._XdeMahr.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.C_ouF_uf.js → reference_sessions.md.DBVFi2Sx.js} +2 -2
- package/dist/docs/assets/{reference_subagents.md.zWAMNfi1.js → reference_subagents.md.DSrGLIuB.js} +2 -2
- package/dist/docs/assets/{reference_subagents.md.zWAMNfi1.lean.js → reference_subagents.md.DSrGLIuB.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.BswAQM41.js → reference_tools.md.lSrsTxYJ.js} +4 -4
- package/dist/docs/assets/{reference_tools.md.BswAQM41.lean.js → reference_tools.md.lSrsTxYJ.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.mkc3B_ZW.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.Bsr9Pwzu.lean.js → scaffolding-agents.md.mkc3B_ZW.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.xZoiGM58.js → storage.md.mQDtIULc.js} +3 -3
- package/dist/docs/assets/{storage.md.xZoiGM58.lean.js → storage.md.mQDtIULc.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/deployment.html +6 -6
- package/dist/docs/evals.html +13 -19
- package/dist/docs/example-agents/approval-buddy.html +5 -5
- package/dist/docs/example-agents/benny.html +5 -5
- package/dist/docs/example-agents/bugbot.html +5 -5
- package/dist/docs/example-agents/codebase-wiki.html +5 -5
- package/dist/docs/example-agents/codeowners-review.html +5 -5
- package/dist/docs/example-agents/concierge.html +6 -6
- package/dist/docs/example-agents/fsd.html +5 -5
- package/dist/docs/example-agents/index.html +4 -4
- package/dist/docs/example-agents/knowledge-base.html +5 -5
- package/dist/docs/example-agents/oncall.html +5 -5
- package/dist/docs/example-agents/security-reviewer.html +4 -4
- package/dist/docs/example-agents/slack-agent.html +5 -5
- package/dist/docs/example-agents/weather-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.html +5 -5
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/index.html +11 -7
- package/dist/docs/quickstart.html +10 -7
- package/dist/docs/reference/agent-config.html +10 -8
- package/dist/docs/reference/artifacts.html +43 -0
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/cli.html +18 -12
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +7 -7
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/tools.html +7 -7
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/storage.html +6 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -1
- package/dist/files-backends/agent-store-presigned-url.js +15 -22
- package/dist/internal/cli-github.d.ts.map +1 -1
- package/dist/internal/cli-github.js +8 -7
- package/dist/internal/cli-slack.js +9 -9
- package/dist/internal/event-mapper.d.ts +3 -3
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +7 -4
- package/dist/internal/host-kv.d.ts +6 -2
- package/dist/internal/host-kv.d.ts.map +1 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +15 -6
- package/dist/internal/storage-coordinator.d.ts +9 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +7 -0
- package/dist/internal/storage-roles.d.ts +78 -0
- package/dist/internal/storage-roles.d.ts.map +1 -0
- package/dist/internal/storage-roles.js +24 -0
- package/dist/internal/workspace.d.ts +28 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +57 -0
- package/dist/playground/assets/{index-CDDWw0YX.js → index-DOnKC85G.js} +40 -40
- package/dist/playground/assets/index-DoQjqj5w.css +1 -0
- package/dist/playground/index.html +2 -2
- package/docs/README.md +32 -13
- package/docs/ab.md +23 -36
- package/docs/building-with-agents.md +2 -2
- package/docs/concepts.md +3 -2
- package/docs/deployment.md +1 -1
- package/docs/evals.md +102 -33
- package/docs/example-agents/approval-buddy.md +2 -1
- package/docs/example-agents/benny.md +2 -0
- package/docs/example-agents/bugbot.md +3 -0
- package/docs/example-agents/codebase-wiki.md +2 -0
- package/docs/example-agents/codeowners-review.md +2 -0
- package/docs/example-agents/concierge.md +1 -0
- package/docs/example-agents/fsd.md +1 -0
- package/docs/example-agents/knowledge-base.md +2 -0
- package/docs/example-agents/oncall.md +2 -0
- package/docs/example-agents/slack-agent.md +1 -0
- package/docs/example-agents/weather-agent.md +9 -4
- package/docs/guides/cloud-runtime.md +11 -4
- package/docs/guides/webhooks.md +1 -1
- package/docs/hillclimbing.md +1 -1
- package/docs/quickstart.md +39 -7
- package/docs/reference/agent-config.md +74 -14
- package/docs/reference/artifacts.md +117 -0
- package/docs/reference/channels.md +45 -15
- package/docs/reference/cli.md +141 -20
- package/docs/reference/hooks.md +11 -4
- package/docs/reference/http-api.md +50 -4
- package/docs/reference/project-layout.md +6 -0
- package/docs/reference/sessions.md +5 -4
- package/docs/reference/subagents.md +5 -3
- package/docs/reference/tools.md +23 -7
- package/docs/scaffolding-agents.md +11 -2
- package/docs/storage.md +27 -2
- package/package.json +1 -1
- package/src/channels/github/github-channel.ts +1 -1
- package/src/channels/github/index.ts +1 -1
- package/src/channels/slack/index.ts +1 -1
- package/src/channels/slack/init.ts +2 -1
- package/src/files-backends/agent-store-presigned-url.ts +2 -1
- package/src/internal/cli-github.ts +8 -7
- package/src/internal/cli-slack.ts +9 -9
- package/src/internal/event-mapper.ts +9 -4
- package/src/internal/host-kv.ts +6 -2
- package/src/internal/session-engine.ts +20 -8
- package/src/internal/storage-coordinator.ts +15 -1
- package/src/internal/storage-roles.ts +86 -0
- package/src/internal/workspace.ts +66 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.WoYunhnT.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.CDJGvVC4.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.CDJGvVC4.lean.js +0 -1
- package/dist/docs/assets/index.md.CZqbBJPB.js +0 -20
- package/dist/docs/assets/reference_http-api.md.CfVM_ICa.js +0 -11
- package/dist/docs/assets/reference_http-api.md.CfVM_ICa.lean.js +0 -1
- package/dist/docs/assets/scaffolding-agents.md.Bsr9Pwzu.js +0 -1
- package/dist/playground/assets/index-MVuNTd8v.css +0 -1
- /package/dist/docs/assets/{building-with-agents.md.CnHqvYDd.lean.js → building-with-agents.md.txrcGU2B.lean.js} +0 -0
- /package/dist/docs/assets/{concepts.md.DFaQEFkA.lean.js → concepts.md.CqOsxbMU.lean.js} +0 -0
- /package/dist/docs/assets/{deployment.md.9MYBuKM1.lean.js → deployment.md.CuK5SNjN.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_approval-buddy.md.BhEfleVx.lean.js → example-agents_approval-buddy.md.CIiZ9coo.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_benny.md.2Et1qa8f.lean.js → example-agents_benny.md.l7JTmm8X.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_fsd.md.DfNKQTHz.lean.js → example-agents_fsd.md.DPz9ezO4.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_knowledge-base.md.CzyZ2DCr.lean.js → example-agents_knowledge-base.md.IneynQSR.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_oncall.md.wFFXXEyW.lean.js → example-agents_oncall.md.ZE0n6ZFN.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_slack-agent.md.DvgvT4nn.lean.js → example-agents_slack-agent.md.06jQXTAI.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.DiAwSR42.lean.js → guides_webhooks.md.BERuBSJW.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.D9Y1_bYh.lean.js → hillclimbing.md.yXqdlv2R.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.C_ouF_uf.lean.js → reference_sessions.md.DBVFi2Sx.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-engine.d.ts","sourceRoot":"","sources":["../../src/internal/session-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQtE,OAAO,EACL,mBAAmB,EACnB,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAIxB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAI1B,KAAK,eAAe,EACpB,KAAK,YAAY,EAKjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,KAAK,eAAe,EAGpB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAK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,OAAO,CAAC,YAAY;IA6BpB;;;;;;;;;;;OAWG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB3C;YAEa,cAAc;IA4F5B;;;;;;;;OAQG;IACG,mBAAmB,CACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,kBAAkB;YAkBZ,gCAAgC;YAgBhC,sBAAsB;YAWtB,yBAAyB;IAmBvC;;;;;OAKG;YACW,kBAAkB;IAYhC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAO/C;IAED,yEAAyE;IACnE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3B;CACF"}
|
|
@@ -58,7 +58,7 @@ import { StorageCoordinator } from "./storage-coordinator.js";
|
|
|
58
58
|
import { normalizeToolResult, toolCallErrorMessage } from "./tool-result.js";
|
|
59
59
|
import { estimateTurnCostFromApi, roundCostUsd, } from "./turn-cost.js";
|
|
60
60
|
import { TurnGovernor } from "./turn-governor.js";
|
|
61
|
-
import { buildAgentsMdContent, buildCloudMemorySection, isNestedInGitRepo, materializeWorkspace, writeWorkspaceFiles, } from "./workspace.js";
|
|
61
|
+
import { buildAgentsMdContent, buildCloudMemorySection, isNestedInGitRepo, materializeWorkspace, SERVER_TOOLS_MCP_SERVER_NAME, writeWorkspaceFiles, } from "./workspace.js";
|
|
62
62
|
export const HTTP_CHANNEL_ID = "http";
|
|
63
63
|
export { SCHEDULE_CHANNEL_PREFIX } from "./prompt-context.js";
|
|
64
64
|
export class SessionBusyError extends Error {
|
|
@@ -1045,8 +1045,17 @@ export class SessionEngine {
|
|
|
1045
1045
|
if (runtime === "cloud") {
|
|
1046
1046
|
// Cloud VMs have no materialized workspace: ship the full context,
|
|
1047
1047
|
// including agent tool script bodies. On hosted deployments the
|
|
1048
|
-
// shared memory journal is on the store mount — say where.
|
|
1049
|
-
|
|
1048
|
+
// shared memory journal is on the store mount — say where. When the
|
|
1049
|
+
// turn carries the session-bound server-tool MCP endpoint, the
|
|
1050
|
+
// preamble catalogs server tools under that MCP server name *before*
|
|
1051
|
+
// the agent-tool "write the script if missing" recipe, so a model
|
|
1052
|
+
// told to "use <server tool>" calls MCP instead of inventing a .sh.
|
|
1053
|
+
const preamble = buildAgentsMdContent(agent, {
|
|
1054
|
+
includeScripts: true,
|
|
1055
|
+
serverToolsMcpName: this.cloudServerToolsConnection === undefined
|
|
1056
|
+
? undefined
|
|
1057
|
+
: SERVER_TOOLS_MCP_SERVER_NAME,
|
|
1058
|
+
});
|
|
1050
1059
|
const memorySection = isCursorHostedFilesAvailable()
|
|
1051
1060
|
? `\n\n${buildCloudMemorySection(this.project.name)}`
|
|
1052
1061
|
: "";
|
|
@@ -1210,14 +1219,14 @@ export class SessionEngine {
|
|
|
1210
1219
|
sessionId !== undefined &&
|
|
1211
1220
|
this.cloudServerToolsConnection !== undefined &&
|
|
1212
1221
|
this.project.agent.tools.some((tool) => tool.execution === "server")) {
|
|
1213
|
-
if (servers[
|
|
1214
|
-
throw new Error(
|
|
1222
|
+
if (servers[SERVER_TOOLS_MCP_SERVER_NAME] !== undefined) {
|
|
1223
|
+
throw new Error(`MCP connection name "${SERVER_TOOLS_MCP_SERVER_NAME}" is reserved for authored server tools on cloud turns.`);
|
|
1215
1224
|
}
|
|
1216
1225
|
const connection = this.cloudServerToolsConnection;
|
|
1217
1226
|
if ("url" in connection) {
|
|
1218
1227
|
const url = new URL(connection.url);
|
|
1219
1228
|
url.searchParams.set("agentkitSessionId", sessionId);
|
|
1220
|
-
servers[
|
|
1229
|
+
servers[SERVER_TOOLS_MCP_SERVER_NAME] = Object.assign(Object.assign({}, connection), { url: url.toString() });
|
|
1221
1230
|
}
|
|
1222
1231
|
}
|
|
1223
1232
|
return servers;
|
|
@@ -14,19 +14,27 @@
|
|
|
14
14
|
* and A/B metrics go to their dedicated tables (`evals` / `abs`).
|
|
15
15
|
* Reminder documents live on the control plane. Everything shares one
|
|
16
16
|
* bounded, serialized queue.
|
|
17
|
+
*
|
|
18
|
+
* It does three unrelated jobs, declared separately as
|
|
19
|
+
* {@link FrameworkSessionStore}, {@link AuthorKvStore}, and
|
|
20
|
+
* {@link EvalAbStore} — see `storage-roles.ts` for why they differ and where
|
|
21
|
+
* each is headed. The queue stays shared: it is one bounded, serialized chain
|
|
22
|
+
* per agent, and splitting it would change backpressure behavior, which this
|
|
23
|
+
* seam deliberately does not touch.
|
|
17
24
|
*/
|
|
18
25
|
import type { ABMetricSample } from "../ab.js";
|
|
19
26
|
import { type ResolvedStoragePolicy, type StorageContext, type StorageDefinition } from "../storage.js";
|
|
20
27
|
import type { JsonValue, SessionEvent, SessionRecord } from "../types.js";
|
|
21
28
|
import type { ABSnapshot } from "./ab-snapshot.js";
|
|
22
29
|
import type { EvalRunStorage } from "./eval-run-store.js";
|
|
30
|
+
import type { AuthorKvStore, EvalAbStore, FrameworkSessionStore } from "./storage-roles.js";
|
|
23
31
|
export interface StorageCoordinatorOptions {
|
|
24
32
|
definition: StorageDefinition;
|
|
25
33
|
agentName: string;
|
|
26
34
|
projectRoot: string;
|
|
27
35
|
logger: (line: string) => void;
|
|
28
36
|
}
|
|
29
|
-
export declare class StorageCoordinator {
|
|
37
|
+
export declare class StorageCoordinator implements FrameworkSessionStore, AuthorKvStore, EvalAbStore {
|
|
30
38
|
readonly policy: ResolvedStoragePolicy;
|
|
31
39
|
private readonly definition;
|
|
32
40
|
private readonly agentName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-coordinator.d.ts","sourceRoot":"","sources":["../../src/internal/storage-coordinator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"storage-coordinator.d.ts","sourceRoot":"","sources":["../../src/internal/storage-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAA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EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9D;IAED,oEAAoE;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C;IAMD;;;;OAIG;IACH,QAAQ,IAAI,cAAc,GAAG,SAAS,CA2CrC;IAMD,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAcrC;IAED;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI,CAerC;IAED,sEAAsE;IAChE,mBAAmB,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAc3D;IAMD;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAqB3B;IAED,wEAAwE;IACxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAExB;IAED,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,WAAW;IAgBnB,2EAA2E;YAC7D,OAAO;IAkBrB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,OAAO;CAGhB"}
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
* and A/B metrics go to their dedicated tables (`evals` / `abs`).
|
|
15
15
|
* Reminder documents live on the control plane. Everything shares one
|
|
16
16
|
* bounded, serialized queue.
|
|
17
|
+
*
|
|
18
|
+
* It does three unrelated jobs, declared separately as
|
|
19
|
+
* {@link FrameworkSessionStore}, {@link AuthorKvStore}, and
|
|
20
|
+
* {@link EvalAbStore} — see `storage-roles.ts` for why they differ and where
|
|
21
|
+
* each is headed. The queue stays shared: it is one bounded, serialized chain
|
|
22
|
+
* per agent, and splitting it would change backpressure behavior, which this
|
|
23
|
+
* seam deliberately does not touch.
|
|
17
24
|
*/
|
|
18
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three unrelated jobs `defineStorage` currently does, named separately.
|
|
3
|
+
*
|
|
4
|
+
* {@link import("./storage-coordinator.js").StorageCoordinator} implements all
|
|
5
|
+
* three today over one sink and one delivery queue. Splitting the *types* is
|
|
6
|
+
* the seam that lets each job change independently:
|
|
7
|
+
*
|
|
8
|
+
* - {@link FrameworkSessionStore} is framework state. Session records, event
|
|
9
|
+
* chunks, and the continuation index are how a session survives the process,
|
|
10
|
+
* so they belong to Agent Serve, not to the agent. Today they persist only
|
|
11
|
+
* when the author writes `agent/storage.ts` — the defect this seam exists to
|
|
12
|
+
* let us fix, by giving the framework its own provider that is automatic and
|
|
13
|
+
* not author-configurable.
|
|
14
|
+
* - {@link AuthorKvStore} is author state: whatever `ctx.host.kv` was handed.
|
|
15
|
+
* It converges onto the author file plane, which is a different destination
|
|
16
|
+
* from the one above.
|
|
17
|
+
* - {@link EvalAbStore} is playground/experiment bookkeeping with its own
|
|
18
|
+
* dedicated tables, and follows neither.
|
|
19
|
+
*
|
|
20
|
+
* Consumers should depend on the narrowest role they use. That is what keeps a
|
|
21
|
+
* later change to framework persistence from silently reaching author KV, and
|
|
22
|
+
* it is why these are interfaces rather than a comment on one class.
|
|
23
|
+
*/
|
|
24
|
+
import type { ABMetricSample } from "../ab.js";
|
|
25
|
+
import type { StorageContext } from "../storage.js";
|
|
26
|
+
import type { JsonValue, SessionEvent, SessionRecord } from "../types.js";
|
|
27
|
+
import type { ABSnapshot } from "./ab-snapshot.js";
|
|
28
|
+
import type { EvalRunStorage } from "./eval-run-store.js";
|
|
29
|
+
/**
|
|
30
|
+
* Framework-owned session durability: what has to be true for a session to
|
|
31
|
+
* outlive the process that served it.
|
|
32
|
+
*
|
|
33
|
+
* Writes are fire-and-forget by design — a throwing backend is logged and its
|
|
34
|
+
* write dropped, because storage must never stall or fail a turn. That is
|
|
35
|
+
* at-most-once, and it is the property Track F later has to tighten, since a
|
|
36
|
+
* dropped record is a session that cannot be restored.
|
|
37
|
+
*/
|
|
38
|
+
export interface FrameworkSessionStore {
|
|
39
|
+
/** Durable session-record update; coalesced until the next flush. */
|
|
40
|
+
sessionRecord(record: SessionRecord): void;
|
|
41
|
+
/** One appended session event; batched per turn or debounce window. */
|
|
42
|
+
event(event: SessionEvent): void;
|
|
43
|
+
/** Marks an event delivered, for backends that track dispatch. */
|
|
44
|
+
eventDispatched(event: SessionEvent): void;
|
|
45
|
+
/** Flush everything buffered for one session (ordered: events, record). */
|
|
46
|
+
flushSession(sessionId: string, reason?: StorageContext["reason"]): void;
|
|
47
|
+
/** True when the backend can list every session in one bulk read. */
|
|
48
|
+
readonly canBulkRestore: boolean;
|
|
49
|
+
/** True when the backend is the Cursor-hosted one rather than an authored sink. */
|
|
50
|
+
readonly isCursorHosted: boolean;
|
|
51
|
+
listSessions(): Promise<SessionRecord[]>;
|
|
52
|
+
listSessionsFromSink(): Promise<SessionRecord[]>;
|
|
53
|
+
listSessionEvents(sessionId: string): Promise<SessionEvent[]>;
|
|
54
|
+
getSessionById(sessionId: string): Promise<SessionRecord | undefined>;
|
|
55
|
+
getSessionByContinuation(channelId: string, continuationKey: string): Promise<SessionRecord | undefined>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Author-facing durable JSON behind `ctx.host.kv`.
|
|
59
|
+
*
|
|
60
|
+
* Deployment-wide on purpose: the point is state an author saves in one
|
|
61
|
+
* session and reads back in a later one, so unlike `ctx.host.files` there is
|
|
62
|
+
* no session scope to default to.
|
|
63
|
+
*/
|
|
64
|
+
export interface AuthorKvStore {
|
|
65
|
+
/** False when no backend is configured; callers fall back to local disk. */
|
|
66
|
+
readonly supportsAuthorKv: boolean;
|
|
67
|
+
kvGet(authorKey: string): Promise<JsonValue | undefined>;
|
|
68
|
+
kvPut(authorKey: string, value: JsonValue): Promise<void>;
|
|
69
|
+
kvDelete(authorKey: string): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
/** Playground eval batches and live A/B metrics, on their own tables. */
|
|
72
|
+
export interface EvalAbStore {
|
|
73
|
+
evalRuns(): EvalRunStorage | undefined;
|
|
74
|
+
abSample(sample: ABMetricSample): void;
|
|
75
|
+
abSnapshot(snapshot: ABSnapshot): void;
|
|
76
|
+
getLatestAbSnapshot(): Promise<ABSnapshot | undefined>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=storage-roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-roles.d.ts","sourceRoot":"","sources":["../../src/internal/storage-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3C,uEAAuE;IACvE,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,2EAA2E;IAC3E,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAEzE,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEjC,YAAY,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACzC,oBAAoB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACjD,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IACtE,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;CACvC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IACzD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,IAAI,cAAc,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;IACvC,mBAAmB,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three unrelated jobs `defineStorage` currently does, named separately.
|
|
3
|
+
*
|
|
4
|
+
* {@link import("./storage-coordinator.js").StorageCoordinator} implements all
|
|
5
|
+
* three today over one sink and one delivery queue. Splitting the *types* is
|
|
6
|
+
* the seam that lets each job change independently:
|
|
7
|
+
*
|
|
8
|
+
* - {@link FrameworkSessionStore} is framework state. Session records, event
|
|
9
|
+
* chunks, and the continuation index are how a session survives the process,
|
|
10
|
+
* so they belong to Agent Serve, not to the agent. Today they persist only
|
|
11
|
+
* when the author writes `agent/storage.ts` — the defect this seam exists to
|
|
12
|
+
* let us fix, by giving the framework its own provider that is automatic and
|
|
13
|
+
* not author-configurable.
|
|
14
|
+
* - {@link AuthorKvStore} is author state: whatever `ctx.host.kv` was handed.
|
|
15
|
+
* It converges onto the author file plane, which is a different destination
|
|
16
|
+
* from the one above.
|
|
17
|
+
* - {@link EvalAbStore} is playground/experiment bookkeeping with its own
|
|
18
|
+
* dedicated tables, and follows neither.
|
|
19
|
+
*
|
|
20
|
+
* Consumers should depend on the narrowest role they use. That is what keeps a
|
|
21
|
+
* later change to framework persistence from silently reaching author KV, and
|
|
22
|
+
* it is why these are interfaces rather than a comment on one class.
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
@@ -32,6 +32,13 @@ export interface MaterializeWorkspaceOptions {
|
|
|
32
32
|
export declare function buildCloudMemorySection(agentName: string): string;
|
|
33
33
|
/** Relative path of an agent-side tool script inside the session workspace. */
|
|
34
34
|
export declare function agentToolScriptPath(toolName: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Reserved MCP connection name under which authored server tools are served
|
|
37
|
+
* to cloud turns (the session-bound tool MCP endpoint). Shared between the
|
|
38
|
+
* turn's MCP config and the first-prompt server-tool catalog so the model is
|
|
39
|
+
* told exactly where those tools live.
|
|
40
|
+
*/
|
|
41
|
+
export declare const SERVER_TOOLS_MCP_SERVER_NAME = "agentsdk-tools";
|
|
35
42
|
/**
|
|
36
43
|
* Always-on identity line prepended when composing instructions. Sourced from
|
|
37
44
|
* {@link ResolvedAgent.name} (`defineAgent({ name })`, else package/dir name)
|
|
@@ -52,15 +59,36 @@ export declare function withIdentityPreamble(name: string, instructions: string
|
|
|
52
59
|
export declare function buildAgentToolsCatalog(tools: DiscoveredTool[], options?: {
|
|
53
60
|
includeScripts: boolean;
|
|
54
61
|
}): string;
|
|
62
|
+
/**
|
|
63
|
+
* Markdown catalog of authored server tools for the cloud first prompt.
|
|
64
|
+
*
|
|
65
|
+
* Server tools execute on the serve host and reach cloud turns only as MCP
|
|
66
|
+
* tools on {@link SERVER_TOOLS_MCP_SERVER_NAME}. Instructions reference them
|
|
67
|
+
* by bare name. The agent-tool catalog still teaches "write the script if
|
|
68
|
+
* missing" for *agent* tools; this section must come first on cloud and
|
|
69
|
+
* say that server tools are MCP-only, or the model copies that recipe onto
|
|
70
|
+
* a host tool and the host-side marker never appears.
|
|
71
|
+
*/
|
|
72
|
+
export declare function buildServerToolsCatalog(tools: DiscoveredTool[], options: {
|
|
73
|
+
mcpServerName: string;
|
|
74
|
+
}): string;
|
|
55
75
|
/**
|
|
56
76
|
* The full AGENTS.md-equivalent context for an agent: instructions, identity
|
|
57
77
|
* section, and the agent-side tool catalog. Written to the session workspace
|
|
58
78
|
* as `AGENTS.md`, and inlined into the first turn's prompt when the harness
|
|
59
79
|
* cannot discover that file (cloud runtime, or a local workspace the harness
|
|
60
80
|
* will not treat as the project root — see {@link isNestedInGitRepo}).
|
|
81
|
+
*
|
|
82
|
+
* `serverToolsMcpName` is cloud-only: when the turn's MCP config carries the
|
|
83
|
+
* session-bound server-tool endpoint, the catalog names that server so the
|
|
84
|
+
* model calls the real tools instead of inventing local stand-ins. It is
|
|
85
|
+
* emitted *before* the agent-tool catalog so "write the script if missing"
|
|
86
|
+
* cannot be read as applying to server-tool names. Local runtimes omit it —
|
|
87
|
+
* there the harness exposes server tools natively.
|
|
61
88
|
*/
|
|
62
89
|
export declare function buildAgentsMdContent(agent: ResolvedAgent, options: {
|
|
63
90
|
includeScripts: boolean;
|
|
91
|
+
serverToolsMcpName?: string;
|
|
64
92
|
}): string;
|
|
65
93
|
/**
|
|
66
94
|
* True when `dir` sits strictly inside a git repository (a `.git` exists in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/internal/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOjE;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,GAAG,SAAS,CAapB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,GAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAA8B,GAC/D,MAAM,
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/internal/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,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OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -37,6 +37,13 @@ export function buildCloudMemorySection(agentName) {
|
|
|
37
37
|
export function agentToolScriptPath(toolName) {
|
|
38
38
|
return `.agent-serve/tools/${toolName}.sh`;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Reserved MCP connection name under which authored server tools are served
|
|
42
|
+
* to cloud turns (the session-bound tool MCP endpoint). Shared between the
|
|
43
|
+
* turn's MCP config and the first-prompt server-tool catalog so the model is
|
|
44
|
+
* told exactly where those tools live.
|
|
45
|
+
*/
|
|
46
|
+
export const SERVER_TOOLS_MCP_SERVER_NAME = "agentsdk-tools";
|
|
40
47
|
/**
|
|
41
48
|
* Always-on identity line prepended when composing instructions. Sourced from
|
|
42
49
|
* {@link ResolvedAgent.name} (`defineAgent({ name })`, else package/dir name)
|
|
@@ -84,6 +91,7 @@ export function buildAgentToolsCatalog(tools, options = { includeScripts: false
|
|
|
84
91
|
"",
|
|
85
92
|
"These tools run in the agent environment (not on the agent-serve host).",
|
|
86
93
|
"Pass a JSON object on stdin matching the input schema; read the result from stdout.",
|
|
94
|
+
"Only the tools in this section are scripts. Do not create, edit, or run a script for any other tool name.",
|
|
87
95
|
"",
|
|
88
96
|
];
|
|
89
97
|
for (const tool of agentTools) {
|
|
@@ -117,12 +125,56 @@ export function buildAgentToolsCatalog(tools, options = { includeScripts: false
|
|
|
117
125
|
}
|
|
118
126
|
return `${parts.join("\n").trimEnd()}\n`;
|
|
119
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Markdown catalog of authored server tools for the cloud first prompt.
|
|
130
|
+
*
|
|
131
|
+
* Server tools execute on the serve host and reach cloud turns only as MCP
|
|
132
|
+
* tools on {@link SERVER_TOOLS_MCP_SERVER_NAME}. Instructions reference them
|
|
133
|
+
* by bare name. The agent-tool catalog still teaches "write the script if
|
|
134
|
+
* missing" for *agent* tools; this section must come first on cloud and
|
|
135
|
+
* say that server tools are MCP-only, or the model copies that recipe onto
|
|
136
|
+
* a host tool and the host-side marker never appears.
|
|
137
|
+
*/
|
|
138
|
+
export function buildServerToolsCatalog(tools, options) {
|
|
139
|
+
const serverTools = tools.filter((tool) => tool.execution === "server");
|
|
140
|
+
if (serverTools.length === 0) {
|
|
141
|
+
return "";
|
|
142
|
+
}
|
|
143
|
+
const parts = [
|
|
144
|
+
"## Server tools",
|
|
145
|
+
"",
|
|
146
|
+
`These tools execute on the agent-serve host, not in this environment. They are available ONLY as MCP tools on the \`${options.mcpServerName}\` MCP server.`,
|
|
147
|
+
"Call them through your MCP tooling: list that server's tools, then invoke the tool by its exact name (GetMcpTools / CallMcpTool, or the equivalent). There is no `.agent-serve/tools/<name>.sh` for any tool in this section.",
|
|
148
|
+
`If the \`${options.mcpServerName}\` server is not in your MCP server list, stop and report that. Do not write, edit, or run a local script or other substitute. A local re-implementation cannot produce the host-side marker, logs, or session events.`,
|
|
149
|
+
"",
|
|
150
|
+
];
|
|
151
|
+
for (const tool of serverTools) {
|
|
152
|
+
parts.push(`### \`${tool.name}\``);
|
|
153
|
+
parts.push("");
|
|
154
|
+
parts.push(tool.description.trim());
|
|
155
|
+
parts.push("");
|
|
156
|
+
parts.push("Input schema:");
|
|
157
|
+
parts.push("");
|
|
158
|
+
parts.push("```json");
|
|
159
|
+
parts.push(JSON.stringify(tool.inputSchema, null, 2));
|
|
160
|
+
parts.push("```");
|
|
161
|
+
parts.push("");
|
|
162
|
+
}
|
|
163
|
+
return `${parts.join("\n").trimEnd()}\n`;
|
|
164
|
+
}
|
|
120
165
|
/**
|
|
121
166
|
* The full AGENTS.md-equivalent context for an agent: instructions, identity
|
|
122
167
|
* section, and the agent-side tool catalog. Written to the session workspace
|
|
123
168
|
* as `AGENTS.md`, and inlined into the first turn's prompt when the harness
|
|
124
169
|
* cannot discover that file (cloud runtime, or a local workspace the harness
|
|
125
170
|
* will not treat as the project root — see {@link isNestedInGitRepo}).
|
|
171
|
+
*
|
|
172
|
+
* `serverToolsMcpName` is cloud-only: when the turn's MCP config carries the
|
|
173
|
+
* session-bound server-tool endpoint, the catalog names that server so the
|
|
174
|
+
* model calls the real tools instead of inventing local stand-ins. It is
|
|
175
|
+
* emitted *before* the agent-tool catalog so "write the script if missing"
|
|
176
|
+
* cannot be read as applying to server-tool names. Local runtimes omit it —
|
|
177
|
+
* there the harness exposes server tools natively.
|
|
126
178
|
*/
|
|
127
179
|
export function buildAgentsMdContent(agent, options) {
|
|
128
180
|
var _a;
|
|
@@ -130,6 +182,11 @@ export function buildAgentsMdContent(agent, options) {
|
|
|
130
182
|
return [
|
|
131
183
|
(_b = (_a = agent.instructions) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "",
|
|
132
184
|
buildIdentitySection(agent),
|
|
185
|
+
options.serverToolsMcpName === undefined
|
|
186
|
+
? ""
|
|
187
|
+
: buildServerToolsCatalog(agent.tools, {
|
|
188
|
+
mcpServerName: options.serverToolsMcpName,
|
|
189
|
+
}),
|
|
133
190
|
buildAgentToolsCatalog(agent.tools, {
|
|
134
191
|
includeScripts: options.includeScripts,
|
|
135
192
|
}),
|