@cursor/july 0.1.101 → 0.1.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -1
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +28 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.BASO9Kih.js → app.CLA03RCz.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.DWCwM6p-.js} +2 -2
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.lean.js +1 -0
- package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.js → guides_cloud-runtime.md.BRirbRAN.js} +1 -1
- package/dist/docs/assets/index.md.Kiht7ell.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.Kiht7ell.lean.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.js +56 -0
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +1 -0
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.CA6QP6Lw.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.CA6QP6Lw.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.B1up2r9W.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.DDa4MeEW.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +3 -3
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +93 -0
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +2 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- 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 +4 -4
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -1
- package/dist/docs/llms-full.txt +321 -4
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +5 -5
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +82 -0
- package/dist/docs/reference/extensions.md +200 -0
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- 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/project-layout.md +3 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +2 -0
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +1 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +4 -4
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
- package/dist/extensions.d.ts +38 -14
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +49 -12
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +5 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +22 -18
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +13 -15
- package/dist/internal/cursor/backend-client.d.ts +8 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +25 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +11 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +15 -0
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +101 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +11 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +306 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +17 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +436 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +570 -0
- package/dist/internal/discovery/extensions.d.ts +19 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +238 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +48 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +141 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +101 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +36 -0
- package/dist/internal/discovery/project.d.ts +53 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +239 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +98 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +97 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +17 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +104 -0
- package/dist/internal/discovery/skills.d.ts +16 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +151 -0
- package/dist/internal/discovery/subagent.d.ts +13 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +19 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -62
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +8 -2505
- package/dist/internal/framework-file-storage.js +6 -6
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +37 -20
- package/dist/internal/otel/collector.d.ts +13 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +84 -17
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +2 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +68 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +2 -0
- package/dist/internal/session-engine.d.ts +5 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +68 -32
- package/dist/internal/session-run-log.d.ts +2 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +13 -14
- package/dist/internal/start-log-store.d.ts +1 -1
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +12 -14
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/otel.d.ts +16 -0
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +26 -0
- package/dist/playground/assets/index-B6C9S9nG.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +24 -23
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +68 -65
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +39 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -1
- package/docs/concepts.md +3 -3
- package/docs/guides/cloud-agents.md +98 -0
- package/docs/guides/cloud-runtime.md +2 -0
- package/docs/reference/extensions.md +205 -0
- package/docs/reference/project-layout.md +3 -0
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +2 -0
- package/package.json +1 -1
- package/skills/framework-map/SKILL.md +1 -0
- package/src/channels/slack/api.ts +4 -2
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/manifest.ts +2 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
- package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +55 -12
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +43 -34
- package/src/index.ts +10 -1
- package/src/internal/conversation-mirror.ts +23 -18
- package/src/internal/cursor/backend-client.ts +32 -10
- package/src/internal/cursor/hosted-store-secrets.ts +27 -0
- package/src/internal/discovery/ab.ts +111 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +360 -0
- package/src/internal/discovery/channels.ts +103 -0
- package/src/internal/discovery/connections.ts +540 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +708 -0
- package/src/internal/discovery/extensions.ts +348 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +45 -0
- package/src/internal/discovery/info.ts +179 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +44 -0
- package/src/internal/discovery/project.ts +270 -0
- package/src/internal/discovery/runtime.ts +159 -0
- package/src/internal/discovery/schedules.ts +94 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +124 -0
- package/src/internal/discovery/skills.ts +176 -0
- package/src/internal/discovery/subagent.ts +29 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +20 -3081
- package/src/internal/framework-file-storage.ts +6 -6
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/mcp-host.ts +84 -31
- package/src/internal/otel/collector.ts +125 -25
- package/src/internal/otel/http.ts +2 -12
- package/src/internal/otel/mcp.ts +69 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +2 -0
- package/src/internal/session-engine.ts +96 -11
- package/src/internal/session-run-log.ts +17 -16
- package/src/internal/start-log-store.ts +13 -16
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/otel.ts +38 -0
- package/src/storage-protocol.ts +101 -91
- package/src/storage.ts +4 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +43 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
- package/dist/playground/assets/index-DBQCwFp0.css +0 -1
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
- package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
- /package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.rPzW2HZN.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.lean.js → guides_cloud-runtime.md.BRirbRAN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.B1up2r9W.lean.js} +0 -0
- /package/dist/playground/assets/{index-BnNN1-EK.js → index-ZqNoT8Ie.js} +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile one `agent/` directory (and its subagents) into a {@link ResolvedAgent}.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { DEFAULT_MODEL } from "../../types.js";
|
|
15
|
+
import { builtinTools } from "../builtin-tools/index.js";
|
|
16
|
+
import { withIdentityPreamble } from "../workspace.js";
|
|
17
|
+
import { isValidModelSetting, loadAgentConfig, resolveAgentCwd, resolveArchitecture, resolveConcurrency, resolveHosting, resolveLocalCwd, runtimeArchitectureCompatibilityError, } from "./agent-config.js";
|
|
18
|
+
import { loadConnections, loadHostConnections, resolveMcpConnectionsDir, } from "./connections.js";
|
|
19
|
+
import { displayPath } from "./context.js";
|
|
20
|
+
import { appendExtensions } from "./extensions.js";
|
|
21
|
+
import { findModuleFile, isDirectory, sortedEntries } from "./fs.js";
|
|
22
|
+
import { loadInstructions } from "./instructions.js";
|
|
23
|
+
import { validateName } from "./names.js";
|
|
24
|
+
import { checkGrokBotRuntimeLimitations, resolveRuntime, warnCloudRuntimeLimitations, } from "./runtime.js";
|
|
25
|
+
import { loadSeedFiles } from "./seed-files.js";
|
|
26
|
+
import { loadSkills } from "./skills.js";
|
|
27
|
+
import { subagent } from "./subagent.js";
|
|
28
|
+
import { appendBuiltinTools, loadTools } from "./tools.js";
|
|
29
|
+
export function loadAgent(ctx, agentDir, options) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
var _a, _b, _c, _d;
|
|
32
|
+
var _e;
|
|
33
|
+
const config = yield loadAgentConfig(ctx, agentDir, options.isRoot);
|
|
34
|
+
const name = (_e = config === null || config === void 0 ? void 0 : config.name) !== null && _e !== void 0 ? _e : options.name;
|
|
35
|
+
const authoredInstructions = yield loadInstructions(ctx, agentDir, config, options.isRoot);
|
|
36
|
+
// Subagents run as Cursor SDK custom subagents (prompt + description +
|
|
37
|
+
// model); their other slots are inert today, so don't load them — just
|
|
38
|
+
// warn that they exist.
|
|
39
|
+
if (!options.isRoot) {
|
|
40
|
+
yield warnUnsupportedSubagentSlots(ctx, agentDir);
|
|
41
|
+
if ((config === null || config === void 0 ? void 0 : config.builtinTools) !== undefined) {
|
|
42
|
+
ctx.diagnostics.push({
|
|
43
|
+
severity: "warning",
|
|
44
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
45
|
+
message: "builtinTools is not supported on subagents; ignoring.",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if ((config === null || config === void 0 ? void 0 : config.tools) !== undefined) {
|
|
49
|
+
ctx.diagnostics.push({
|
|
50
|
+
severity: "warning",
|
|
51
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
52
|
+
message: "tools is not supported on subagents (they keep the harness task-tool toolset); ignoring.",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if ((config === null || config === void 0 ? void 0 : config.architecture) !== undefined) {
|
|
56
|
+
ctx.diagnostics.push({
|
|
57
|
+
severity: "warning",
|
|
58
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
59
|
+
message: "architecture is not supported on subagents; ignoring.",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const artifactsPath = yield findModuleFile(agentDir, "artifacts");
|
|
63
|
+
if (artifactsPath !== undefined) {
|
|
64
|
+
ctx.diagnostics.push({
|
|
65
|
+
severity: "warning",
|
|
66
|
+
path: displayPath(ctx, artifactsPath),
|
|
67
|
+
message: "artifacts are not supported on subagents; ignoring.",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return subagent(name, {
|
|
71
|
+
description: config === null || config === void 0 ? void 0 : config.description,
|
|
72
|
+
model: config === null || config === void 0 ? void 0 : config.model,
|
|
73
|
+
prompt: authoredInstructions,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Root agents without authored instructions stay undefined (diagnostic
|
|
77
|
+
// already recorded).
|
|
78
|
+
const instructions = authoredInstructions === undefined
|
|
79
|
+
? undefined
|
|
80
|
+
: withIdentityPreamble(name, authoredInstructions);
|
|
81
|
+
const tools = yield loadTools(ctx, join(agentDir, "tools"));
|
|
82
|
+
const skills = yield loadSkills(ctx, join(agentDir, "skills"));
|
|
83
|
+
const connections = yield loadConnections(ctx, yield resolveMcpConnectionsDir(ctx, agentDir));
|
|
84
|
+
const subagents = yield loadSubagents(ctx, join(agentDir, "subagents"));
|
|
85
|
+
const extensions = yield appendExtensions(ctx, join(agentDir, "extensions"), {
|
|
86
|
+
tools,
|
|
87
|
+
skills,
|
|
88
|
+
connections,
|
|
89
|
+
subagents,
|
|
90
|
+
});
|
|
91
|
+
const hostConnections = yield loadHostConnections(ctx, agentDir, connections);
|
|
92
|
+
const seedFiles = yield loadSeedFiles(ctx, agentDir);
|
|
93
|
+
const runtime = resolveRuntime(ctx, agentDir, config === null || config === void 0 ? void 0 : config.runtime);
|
|
94
|
+
// Keep authored `cloud` even when default runtime is local — per-session
|
|
95
|
+
// `send({ cloud })` merges it under cloudOverride for handoff sessions.
|
|
96
|
+
const cloud = config === null || config === void 0 ? void 0 : config.cloud;
|
|
97
|
+
const localWorkspaceDir = resolveAgentCwd(ctx, (_a = config === null || config === void 0 ? void 0 : config.local) === null || _a === void 0 ? void 0 : _a.workspaceDir);
|
|
98
|
+
const localCwd = yield resolveLocalCwd(ctx, (_b = config === null || config === void 0 ? void 0 : config.local) === null || _b === void 0 ? void 0 : _b.cwd, (_c = config === null || config === void 0 ? void 0 : config.local) === null || _c === void 0 ? void 0 : _c.workspaceDir);
|
|
99
|
+
const localSandbox = ((_d = config === null || config === void 0 ? void 0 : config.local) === null || _d === void 0 ? void 0 : _d.sandbox) === true;
|
|
100
|
+
// Built-in tool allowlist (top-level `tools`). `[]` is meaningful (no
|
|
101
|
+
// native built-in tools), so presence is keyed on the field, not on
|
|
102
|
+
// emptiness. "mcp" is always granted alongside a configured allowlist:
|
|
103
|
+
// it is transport, not capability — this kit's own server tools ride the
|
|
104
|
+
// SDK custom-tool MCP path, so omitting it silently breaks
|
|
105
|
+
// `agent/tools/`, and what MCP actually exposes stays controlled by the
|
|
106
|
+
// second layer (authored tools, mcp-connections, the harness cwd's
|
|
107
|
+
// ambient config).
|
|
108
|
+
const authoredAllowlist = config === null || config === void 0 ? void 0 : config.tools;
|
|
109
|
+
const allowedTools = authoredAllowlist === undefined || authoredAllowlist.includes("mcp")
|
|
110
|
+
? authoredAllowlist
|
|
111
|
+
: [...authoredAllowlist, "mcp"];
|
|
112
|
+
// The allowlist states runtime-agnostic intent, but only the local
|
|
113
|
+
// harness can enforce it (the Cursor SDK rejects tool restrictions on
|
|
114
|
+
// cloud agents, and the Grok Bot harness has its own fixed toolset) — a
|
|
115
|
+
// non-local agent that declares one must fail at serve start, never run
|
|
116
|
+
// unrestricted. (Hybrid per-send cloud sessions fail closed in the
|
|
117
|
+
// session engine.)
|
|
118
|
+
if (allowedTools !== undefined && runtime !== "local") {
|
|
119
|
+
ctx.diagnostics.push({
|
|
120
|
+
severity: "error",
|
|
121
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
122
|
+
message: `tools cannot be enforced on runtime: "${runtime}". Remove \`tools\` or run the agent on the local runtime.`,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Per-session connection features (defineConnection auth/advertiseTools)
|
|
126
|
+
// only run on local turns: advertised tools are in-process server tools,
|
|
127
|
+
// and per-session headers cannot reach a cloud VM's MCP config. A
|
|
128
|
+
// non-local agent that declares them must fail at serve start — never
|
|
129
|
+
// run without the connection's tools or identity. (Hybrid per-send
|
|
130
|
+
// cloud sessions fail closed in the session engine.)
|
|
131
|
+
const perSessionConnection = connections.find((connection) => connection.advertiseTools === true || connection.auth !== undefined);
|
|
132
|
+
if (perSessionConnection !== undefined && runtime !== "local") {
|
|
133
|
+
ctx.diagnostics.push({
|
|
134
|
+
severity: "error",
|
|
135
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
136
|
+
message: `MCP connection "${perSessionConnection.name}" uses advertiseTools/auth, which only run on runtime: "local". Remove them or run the agent on the local runtime.`,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// `execution: "agent"` tool scripts run through the shell tool. Shell is
|
|
140
|
+
// a real capability, so it is never injected — but an allowlist that
|
|
141
|
+
// strands authored scripts deserves a loud diagnostic, not silence.
|
|
142
|
+
if (allowedTools !== undefined &&
|
|
143
|
+
!allowedTools.includes("shell") &&
|
|
144
|
+
tools.some((tool) => tool.execution === "agent")) {
|
|
145
|
+
ctx.diagnostics.push({
|
|
146
|
+
severity: "warning",
|
|
147
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
148
|
+
message: '`tools` omits "shell" but this agent has execution: "agent" tools, which run as shell scripts; the model will not be able to run them.',
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (localCwd !== undefined && localWorkspaceDir !== undefined) {
|
|
152
|
+
ctx.diagnostics.push({
|
|
153
|
+
severity: "warning",
|
|
154
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
155
|
+
message: "local.workspaceDir pins every session to one directory, so local.cwd is unused. Drop one of them.",
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const local = localCwd === undefined && localWorkspaceDir === undefined && !localSandbox
|
|
159
|
+
? undefined
|
|
160
|
+
: {
|
|
161
|
+
cwd: localCwd,
|
|
162
|
+
workspaceDir: localWorkspaceDir,
|
|
163
|
+
sandbox: localSandbox,
|
|
164
|
+
};
|
|
165
|
+
const hosting = resolveHosting(ctx, agentDir, config === null || config === void 0 ? void 0 : config.hosting);
|
|
166
|
+
const concurrency = resolveConcurrency(ctx, agentDir, config === null || config === void 0 ? void 0 : config.concurrency);
|
|
167
|
+
const architecture = resolveArchitecture(ctx, agentDir, config === null || config === void 0 ? void 0 : config.architecture);
|
|
168
|
+
const runtimeArchitectureError = runtimeArchitectureCompatibilityError({
|
|
169
|
+
runtime,
|
|
170
|
+
architecture,
|
|
171
|
+
});
|
|
172
|
+
if (runtimeArchitectureError !== undefined) {
|
|
173
|
+
ctx.diagnostics.push({
|
|
174
|
+
severity: "error",
|
|
175
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
176
|
+
message: runtimeArchitectureError,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (runtime === "cloud") {
|
|
180
|
+
warnCloudRuntimeLimitations(ctx, agentDir, {
|
|
181
|
+
agentTools: tools.filter((tool) => tool.execution === "agent").length,
|
|
182
|
+
skills: skills.length,
|
|
183
|
+
seedFiles: seedFiles.length,
|
|
184
|
+
hasCloudOptions: cloud !== undefined,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
appendBuiltinTools(ctx, agentDir, tools, config === null || config === void 0 ? void 0 : config.builtinTools);
|
|
188
|
+
// After appendBuiltinTools so opted-in built-ins (server-executed) count.
|
|
189
|
+
if (runtime === "grokbot") {
|
|
190
|
+
checkGrokBotRuntimeLimitations(ctx, agentDir, {
|
|
191
|
+
serverTools: tools.filter((tool) => tool.execution === "server").length,
|
|
192
|
+
agentTools: tools.filter((tool) => tool.execution === "agent").length,
|
|
193
|
+
skills: skills.length,
|
|
194
|
+
seedFiles: seedFiles.length,
|
|
195
|
+
connections: connections.length + hostConnections.length,
|
|
196
|
+
subagents: subagents.length,
|
|
197
|
+
hasCloudOptions: cloud !== undefined,
|
|
198
|
+
hasLocalSandbox: localSandbox,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ name, description: config === null || config === void 0 ? void 0 : config.description,
|
|
202
|
+
// Root agents always get a concrete model: authored value or DEFAULT_MODEL.
|
|
203
|
+
model: isValidModelSetting(config === null || config === void 0 ? void 0 : config.model) ? config.model : DEFAULT_MODEL, instructions,
|
|
204
|
+
runtime,
|
|
205
|
+
cloud,
|
|
206
|
+
local }, (allowedTools === undefined ? {} : { allowedTools })), { hosting,
|
|
207
|
+
concurrency }), (architecture === undefined ? {} : { architecture })), { tools,
|
|
208
|
+
skills,
|
|
209
|
+
extensions,
|
|
210
|
+
connections,
|
|
211
|
+
hostConnections,
|
|
212
|
+
subagents,
|
|
213
|
+
seedFiles });
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function loadSubagents(ctx, subagentsDir) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
if (!(yield isDirectory(subagentsDir))) {
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
const subagents = [];
|
|
222
|
+
for (const entry of yield sortedEntries(subagentsDir)) {
|
|
223
|
+
if (!entry.isDirectory()) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const subagentDir = join(subagentsDir, entry.name);
|
|
227
|
+
if (!validateName(ctx, "subagent", entry.name, subagentDir)) {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
subagents.push(yield loadAgent(ctx, subagentDir, { name: entry.name, isRoot: false }));
|
|
231
|
+
}
|
|
232
|
+
return subagents;
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function warnUnsupportedSubagentSlots(ctx, subagentDir) {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
const unsupported = [
|
|
238
|
+
["tools", "tools"],
|
|
239
|
+
["skills", "skills"],
|
|
240
|
+
["extensions", "extensions"],
|
|
241
|
+
["mcp-connections", "MCP connections"],
|
|
242
|
+
["host-connections", "host MCP connections"],
|
|
243
|
+
["connections", "MCP connections"],
|
|
244
|
+
["subagents", "nested subagents"],
|
|
245
|
+
["channels", "channels"],
|
|
246
|
+
["schedules", "schedules"],
|
|
247
|
+
["hooks", "hooks"],
|
|
248
|
+
["sandbox", "sandbox files"],
|
|
249
|
+
];
|
|
250
|
+
for (const [slot, label] of unsupported) {
|
|
251
|
+
if (yield isDirectory(join(subagentDir, slot))) {
|
|
252
|
+
ctx.diagnostics.push({
|
|
253
|
+
severity: "warning",
|
|
254
|
+
path: displayPath(ctx, join(subagentDir, slot)),
|
|
255
|
+
message: `Subagent ${label} are not supported on the Cursor harness yet; the subagent runs with the parent's execution surface. Ignoring.`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
export function warnUnknownSlots(ctx, agentDir) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const known = new Set([
|
|
264
|
+
"agent",
|
|
265
|
+
"instructions",
|
|
266
|
+
"tools",
|
|
267
|
+
"skills",
|
|
268
|
+
"extensions",
|
|
269
|
+
"mcp-connections",
|
|
270
|
+
"host-connections",
|
|
271
|
+
// Legacy slot name; resolveMcpConnectionsDir warns and still loads it.
|
|
272
|
+
"connections",
|
|
273
|
+
"subagents",
|
|
274
|
+
"channels",
|
|
275
|
+
"schedules",
|
|
276
|
+
"hooks",
|
|
277
|
+
"ab",
|
|
278
|
+
"sandbox",
|
|
279
|
+
"lib",
|
|
280
|
+
// Vite playground custom tool chips (agent/playground/tools).
|
|
281
|
+
"playground",
|
|
282
|
+
]);
|
|
283
|
+
for (const entry of yield sortedEntries(agentDir)) {
|
|
284
|
+
if (!entry.isDirectory() || entry.name.startsWith(".")) {
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (entry.name === "node_modules" || known.has(entry.name)) {
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
// Footgun: evals live at project-root `evals/`, not under `agent/`.
|
|
291
|
+
if (entry.name === "evals") {
|
|
292
|
+
ctx.diagnostics.push({
|
|
293
|
+
severity: "warning",
|
|
294
|
+
path: displayPath(ctx, join(agentDir, entry.name)),
|
|
295
|
+
message: 'Directory "evals" under agent/ is ignored — put defineEval files at project-root evals/ instead.',
|
|
296
|
+
});
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
ctx.diagnostics.push({
|
|
300
|
+
severity: "warning",
|
|
301
|
+
path: displayPath(ctx, join(agentDir, entry.name)),
|
|
302
|
+
message: `Unrecognized directory "${entry.name}" under agent/ (not an authored slot; use lib/ for shared code).`,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent/channels/*.ts`: HTTP surfaces beyond the session API.
|
|
3
|
+
*/
|
|
4
|
+
import type { DiscoveredChannel, HttpChannelDefinition } from "../../types.js";
|
|
5
|
+
import { type DiscoveryContext } from "./context.js";
|
|
6
|
+
export declare function loadChannels(ctx: DiscoveryContext, channelsDir: string): Promise<{
|
|
7
|
+
channels: DiscoveredChannel[];
|
|
8
|
+
httpChannelDefinition: HttpChannelDefinition | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/channels.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAEV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,cAAc,CAAC;AAIhF,wBAAsB,YAAY,CAChC,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IACT,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1D,CAAC,CAgFD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent/channels/*.ts`: HTTP surfaces beyond the session API.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { httpChannel } from "../../channels.js";
|
|
15
|
+
import { getDefinitionKind } from "../brand.js";
|
|
16
|
+
import { displayPath, errorMessage } from "./context.js";
|
|
17
|
+
import { isDirectory, isModuleFile, moduleStem, sortedEntries } from "./fs.js";
|
|
18
|
+
import { NAME_PATTERN } from "./names.js";
|
|
19
|
+
export function loadChannels(ctx, channelsDir) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
22
|
+
var _b;
|
|
23
|
+
const channels = [];
|
|
24
|
+
let httpChannelDefinition;
|
|
25
|
+
if (!(yield isDirectory(channelsDir))) {
|
|
26
|
+
return { channels, httpChannelDefinition };
|
|
27
|
+
}
|
|
28
|
+
for (const entry of yield sortedEntries(channelsDir)) {
|
|
29
|
+
const entryPath = join(channelsDir, entry.name);
|
|
30
|
+
if (!entry.isFile() || !isModuleFile(entry.name)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const id = moduleStem(entry.name);
|
|
34
|
+
if (!NAME_PATTERN.test(id)) {
|
|
35
|
+
ctx.diagnostics.push({
|
|
36
|
+
severity: "error",
|
|
37
|
+
path: displayPath(ctx, entryPath),
|
|
38
|
+
message: `Channel id "${id}" must match ${NAME_PATTERN}.`,
|
|
39
|
+
});
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
let mod;
|
|
43
|
+
try {
|
|
44
|
+
mod = yield ctx.importModule(entryPath);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
ctx.diagnostics.push({
|
|
48
|
+
severity: "error",
|
|
49
|
+
path: displayPath(ctx, entryPath),
|
|
50
|
+
message: `Failed to load module: ${errorMessage(error)}`,
|
|
51
|
+
});
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const kind = getDefinitionKind(mod.default);
|
|
55
|
+
if (kind === "http-channel") {
|
|
56
|
+
if (id !== "http") {
|
|
57
|
+
ctx.diagnostics.push({
|
|
58
|
+
severity: "error",
|
|
59
|
+
path: displayPath(ctx, entryPath),
|
|
60
|
+
message: "httpChannel() configures the built-in HTTP channel and must be authored at channels/http.ts.",
|
|
61
|
+
});
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
httpChannelDefinition = mod.default;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (kind !== "channel") {
|
|
68
|
+
ctx.diagnostics.push({
|
|
69
|
+
severity: "error",
|
|
70
|
+
path: displayPath(ctx, entryPath),
|
|
71
|
+
message: id === "http"
|
|
72
|
+
? "channels/http.ts must default-export httpChannel({ ... })."
|
|
73
|
+
: "Channel modules must default-export defineChannel({ ... }).",
|
|
74
|
+
});
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (id === "http") {
|
|
78
|
+
ctx.diagnostics.push({
|
|
79
|
+
severity: "error",
|
|
80
|
+
path: displayPath(ctx, entryPath),
|
|
81
|
+
message: "The channel id `http` is reserved for the built-in HTTP channel; use httpChannel() to configure it.",
|
|
82
|
+
});
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const definition = mod.default;
|
|
86
|
+
for (const notice of (_b = (_a = definition.meta) === null || _a === void 0 ? void 0 : _a.deprecations) !== null && _b !== void 0 ? _b : []) {
|
|
87
|
+
ctx.diagnostics.push({
|
|
88
|
+
severity: "warning",
|
|
89
|
+
path: displayPath(ctx, entryPath),
|
|
90
|
+
message: notice,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
channels.push({ id, definition });
|
|
94
|
+
}
|
|
95
|
+
return { channels, httpChannelDefinition };
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent/mcp-connections/*.ts` and `agent/host-connections/*.ts`: MCP servers for the model and the host.
|
|
3
|
+
*/
|
|
4
|
+
import { type ConnectionDefinition, type ConnectionTransport, type DiscoveredConnection } from "../../types.js";
|
|
5
|
+
import { type DiscoveryContext } from "./context.js";
|
|
6
|
+
/** One-line `/v1/info` label for a connection transport. */
|
|
7
|
+
export declare function connectionTransportLabel(transport: ConnectionTransport): string;
|
|
8
|
+
/**
|
|
9
|
+
* Prefer `agent/mcp-connections/`. Keep loading `agent/connections/` with a
|
|
10
|
+
* deprecation warning so existing agents keep working during the rename.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveMcpConnectionsDir(ctx: DiscoveryContext, agentDir: string): Promise<string>;
|
|
13
|
+
export declare function loadHostConnections(ctx: DiscoveryContext, agentDir: string, modelConnections: readonly DiscoveredConnection[]): Promise<DiscoveredConnection[]>;
|
|
14
|
+
export declare function loadConnections(ctx: DiscoveryContext, connectionsDir: string, role?: "model" | "host"): Promise<DiscoveredConnection[]>;
|
|
15
|
+
/** Validate one `defineConnection` and resolve its transport. */
|
|
16
|
+
export declare function compileConnection(ctx: DiscoveryContext, entryPath: string, name: string, connection: ConnectionDefinition, role: "model" | "host"): Promise<DiscoveredConnection | undefined>;
|
|
17
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/connections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAQ1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,cAAc,CAAC;AAKtB,4DAA4D;AAC5D,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,GAC7B,MAAM,CAeR;AAkGD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAwBjB;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,SAAS,oBAAoB,EAAE,GAChD,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAqCjC;AAED,wBAAsB,eAAe,CACnC,GAAG,EAAE,gBAAgB,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,GAAE,OAAO,GAAG,MAAgB,GAC/B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAuBjC;AAED,iEAAiE;AACjE,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,oBAAoB,EAChC,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAuN3C"}
|