@grok/agent-sdk 0.3.0 → 0.5.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/dist/channels/match-ready/index.d.ts +4 -0
- package/dist/channels/match-ready/index.d.ts.map +1 -0
- package/dist/channels/match-ready/index.js +2 -0
- package/dist/channels/match-ready/match-ready-channel.d.ts +5 -0
- package/dist/channels/match-ready/match-ready-channel.d.ts.map +1 -0
- package/dist/channels/match-ready/match-ready-channel.js +42 -0
- package/dist/channels/match-ready/types.d.ts +25 -0
- package/dist/channels/match-ready/types.d.ts.map +1 -0
- package/dist/channels/match-ready/types.js +1 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +27 -14
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.BzTUBOAD.js → app.CYdjweqP.js} +4 -4
- package/dist/docs/assets/{building-with-agents.md.BqJ7AAjG.js → building-with-agents.md.Bo3ct-rf.js} +1 -1
- package/dist/docs/assets/changelog.md.BMrJ5WxW.js +1 -0
- package/dist/docs/assets/changelog.md.BMrJ5WxW.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.dUaE1f8e.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DsnRlUT5.js → VPLocalSearchBox.CRATKS9J.js} +1 -1
- package/dist/docs/assets/chunks/{arc.DH8GOhiv.js → arc.BxM78ISR.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.9m9ObyuE.js → architectureDiagram-Q4EWVU46.Bi6MuKaU.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.BXHpx1lE.js → baseUniq.L47qqpDG.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.xY3EX59q.js → blockDiagram-DXYQGD6D.kHFF2FK5.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DnqgMVgc.js → c4Diagram-AHTNJAMY.BTW85ll3.js} +1 -1
- package/dist/docs/assets/chunks/channel.ljJtQtBi.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.BjFxK2A3.js → chunk-4BX2VUAB.Bbh3_48g.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BujS_Spt.js → chunk-4TB4RGXK.WeAmK3fK.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.YbTjhdaM.js → chunk-55IACEB6.DTdUiVHf.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DnQ8t4GC.js → chunk-EDXVE4YY.n5XzANDz.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.B67AwAmj.js → chunk-FMBD7UC4.D51eewCb.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.DrZIAFOm.js → chunk-OYMX7WX6.BrY0U7ZV.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BLmmydkn.js → chunk-QZHKN3VN.B0OA4aFV.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DaoOfw0O.js → chunk-YZCP3GAM.Djt3Mjft.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BZ3Uc-XU.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BZ3Uc-XU.js +1 -0
- package/dist/docs/assets/chunks/clone.BDtbEo69.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DMQuNhM5.js → cose-bilkent-S5V4N54A.DiMcA6Q8.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CZoGVuUf.js → dagre-KV5264BT.BGqI4vrS.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.CLt9uOyL.js → diagram-5BDNPKRD.bDqFuMoH.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.DpczEm1G.js → diagram-G4DWMVQ6.Y0sxaXRU.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.D4r13DvJ.js → diagram-MMDJMWI5.Bg43b0yi.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.CYU9eGFu.js → diagram-TYMM5635.DCfVasEC.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.QA9naWEw.js → erDiagram-SMLLAGMA.C72GaD16.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BbNoVZYd.js → flowDiagram-DWJPFMVM.DxRQj7pP.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.IHjDoG7r.js → ganttDiagram-T4ZO3ILL.DiLZy5Q4.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.B21VMdf5.js → gitGraphDiagram-UUTBAWPF.DL8XkRvh.js} +1 -1
- package/dist/docs/assets/chunks/{graph.DgJ4L-8V.js → graph.3Xub80xJ.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CQjrcthc.js → infoDiagram-42DDH7IO.O3lGaspu.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.D4tPGtVo.js → ishikawaDiagram-UXIWVN3A.w-pCiQzn.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BD3WaNbQ.js → journeyDiagram-VCZTEJTY.Cg_oBs9j.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Ca0o4Tqz.js → kanban-definition-6JOO6SKY.BpfMGPwn.js} +1 -1
- package/dist/docs/assets/chunks/{layout.DXXqX4MQ.js → layout.CtwXs__p.js} +1 -1
- package/dist/docs/assets/chunks/{linear.5c61gNw4.js → linear.NmCskOrP.js} +1 -1
- package/dist/docs/assets/chunks/{min.B1-NAjHX.js → min.DpQtsLKs.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BELznv3-.js → mindmap-definition-QFDTVHPH.B-P-aKVp.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.qPzO1mq5.js → pieDiagram-DEJITSTG.BfjjqK7j.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CxIvzbjX.js → quadrantDiagram-34T5L4WZ.BTzHo53F.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CqA0iJx8.js → requirementDiagram-MS252O5E.DIT2FIKr.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.XRTutBnb.js → sankeyDiagram-XADWPNL6.NK1wCsgt.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.E--7bRLQ.js → sequenceDiagram-FGHM5R23.D9oElkvo.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.C4vGu8zq.js → stateDiagram-FHFEXIEX.IPksnixH.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CbhzVsQE.js +1 -0
- package/dist/docs/assets/chunks/{theme.DMj_7q3B.js → theme.CgKu7tr3.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.C7LgNVAL.js → timeline-definition-GMOUNBTQ.CuAtJapY.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.HUwoZcy_.js → vennDiagram-DHZGUBPP.B87nNW9E.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.BFIVMaoi.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.B2pSo5rB.js → wardleyDiagram-NUSXRM2D.BELjSq8w.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.NQhMiOOL.js → xychartDiagram-5P7HB3ND.5zN5ZGsz.js} +1 -1
- package/dist/docs/assets/{deployment.md.BtqJrHhp.js → deployment.md.DJtuDVLh.js} +3 -3
- package/dist/docs/assets/{deployment.md.BtqJrHhp.lean.js → deployment.md.DJtuDVLh.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.BcmSqL2z.js → guides_agent-to-agent.md.DcB3nhOz.js} +1 -1
- package/dist/docs/assets/{guides_github.md.6jiEH7dg.js → guides_github.md.CcuZ7keS.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.C-Sx_IPa.js → guides_mcp-oauth.md.GVPMKcYl.js} +1 -1
- package/dist/docs/assets/{guides_migrate.md.BbhHYeCr.js → guides_migrate.md.B8CZxnnX.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.BgIGG9ur.js → guides_slack.md.D7Rwyva4.js} +1 -1
- package/dist/docs/assets/{hillclimbing.md.3TkdF79A.js → hillclimbing.md.M51bF-oT.js} +1 -1
- package/dist/docs/assets/index.md.DnJPj_B6.js +14 -0
- package/dist/docs/assets/index.md.DnJPj_B6.lean.js +1 -0
- package/dist/docs/assets/{reference_agent-config.md.C0Tp_Fk9.js → reference_agent-config.md.Bbqf0lgS.js} +13 -5
- package/dist/docs/assets/{reference_agent-config.md.C0Tp_Fk9.lean.js → reference_agent-config.md.Bbqf0lgS.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.B8GdpaRj.js → reference_cli.md.DHm6DmYk.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.CSWmOwMM.js → reference_hooks.md.vbIM394-.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.CSWmOwMM.lean.js → reference_hooks.md.vbIM394-.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.B2OaR1Nb.js → reference_tools.md.BhqW6neF.js} +4 -2
- package/dist/docs/assets/{reference_tools.md.B2OaR1Nb.lean.js → reference_tools.md.BhqW6neF.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +36 -36
- package/dist/docs/building-with-agents.md +3 -3
- package/dist/docs/changelog.html +36 -36
- package/dist/docs/changelog.md +44 -1
- package/dist/docs/deployment.html +37 -37
- package/dist/docs/deployment.md +22 -16
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +37 -37
- package/dist/docs/guides/agent-to-agent.md +4 -2
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +37 -37
- package/dist/docs/guides/github.md +1 -1
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +37 -37
- package/dist/docs/guides/mcp-oauth.md +1 -1
- package/dist/docs/guides/migrate.html +37 -37
- package/dist/docs/guides/migrate.md +1 -1
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/pagerduty.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +1 -1
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +36 -36
- package/dist/docs/hillclimbing.md +1 -1
- package/dist/docs/index.html +42 -48
- package/dist/docs/index.md +8 -14
- package/dist/docs/llms-full.txt +176 -54
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/access.html +35 -35
- package/dist/docs/reference/agent-config.html +47 -39
- package/dist/docs/reference/agent-config.md +75 -10
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +38 -38
- package/dist/docs/reference/cli.md +2 -2
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/hooks.md +1 -1
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/limits.html +35 -35
- package/dist/docs/reference/memory.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +39 -37
- package/dist/docs/reference/tools.md +12 -0
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/reviews.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/filesystem.d.ts +12 -412
- package/dist/filesystem.d.ts.map +1 -1
- package/dist/filesystem.js +37 -980
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/internal/authored-alias-hooks.d.ts +6 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +12 -0
- package/dist/internal/authored-loaders.js +10 -1
- package/dist/internal/cli/commands/scaffold.js +1 -1
- package/dist/internal/continuation-channel.d.ts +3 -3
- package/dist/internal/continuation-channel.js +3 -3
- package/dist/internal/continuation-identity.d.ts +6 -5
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +17 -2
- package/dist/internal/continuation-session-ids.d.ts +15 -0
- package/dist/internal/continuation-session-ids.d.ts.map +1 -0
- package/dist/internal/continuation-session-ids.js +43 -0
- package/dist/internal/direct-file-tools.d.ts +21 -0
- package/dist/internal/direct-file-tools.d.ts.map +1 -0
- package/dist/internal/direct-file-tools.js +60 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +71 -66
- package/dist/internal/filesystem/walk.d.ts +4 -56
- package/dist/internal/filesystem/walk.d.ts.map +1 -1
- package/dist/internal/filesystem/walk.js +4 -198
- package/dist/internal/hosted-catch-protocol.d.ts +3 -3
- package/dist/internal/hosted-catch-protocol.js +3 -3
- package/dist/internal/hosted-fetch.d.ts +7 -0
- package/dist/internal/hosted-fetch.d.ts.map +1 -0
- package/dist/internal/hosted-fetch.js +26 -0
- package/dist/internal/hosted-managed-automation.js +1 -1
- package/dist/internal/install-cursor-skills.d.ts +5 -6
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +19 -4
- package/dist/internal/mcp-endpoint.js +4 -4
- package/dist/internal/model-config.d.ts.map +1 -1
- package/dist/internal/model-config.js +11 -4
- package/dist/internal/otel/http.d.ts +2 -1
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +2 -3
- package/dist/internal/platform-timers.d.ts +3 -7
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +10 -51
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +22 -40
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +6 -1
- package/dist/internal/session-engine.d.ts +36 -19
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +182 -254
- package/dist/internal/tool-paths.d.ts +8 -0
- package/dist/internal/tool-paths.d.ts.map +1 -0
- package/dist/internal/tool-paths.js +12 -0
- package/dist/internal/workspace-tree.d.ts +27 -0
- package/dist/internal/workspace-tree.d.ts.map +1 -0
- package/dist/internal/workspace-tree.js +106 -0
- package/dist/playground/assets/index-D0-FHg1x.css +1 -0
- package/dist/playground/assets/index-D5SLKUy6.js +62 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +43 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/docs/README.md +8 -14
- package/docs/building-with-agents.md +3 -3
- package/docs/changelog.md +44 -1
- package/docs/deployment.md +22 -16
- package/docs/guides/agent-to-agent.md +4 -2
- package/docs/guides/github.md +1 -1
- package/docs/guides/mcp-oauth.md +1 -1
- package/docs/guides/migrate.md +1 -1
- package/docs/guides/slack.md +1 -1
- package/docs/hillclimbing.md +1 -1
- package/docs/reference/agent-config.md +75 -10
- package/docs/reference/cli.md +2 -2
- package/docs/reference/hooks.md +1 -1
- package/docs/reference/tools.md +12 -0
- package/package.json +10 -15
- package/skills/cli/SKILL.md +1 -1
- package/skills/create-agent/SKILL.md +61 -7
- package/skills/debug/SKILL.md +1 -1
- package/skills/deploy/SKILL.md +3 -3
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +2 -2
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/migrate-v2/SKILL.md +2 -2
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +2 -2
- package/dist/docs/assets/changelog.md.BWhC6DET.js +0 -1
- package/dist/docs/assets/changelog.md.BWhC6DET.lean.js +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CWxwVoCG.js +0 -1
- package/dist/docs/assets/chunks/channel.Cctv0f7X.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DU5sqchW.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DU5sqchW.js +0 -1
- package/dist/docs/assets/chunks/clone.B9rdNt6j.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ECMu2BdJ.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.BxFEFYZS.js +0 -162
- package/dist/docs/assets/index.md.DRfaoRCZ.js +0 -20
- package/dist/docs/assets/index.md.DRfaoRCZ.lean.js +0 -1
- package/dist/executors.d.ts +0 -11
- package/dist/executors.d.ts.map +0 -1
- package/dist/executors.js +0 -21
- package/dist/internal/filesystem/errors.d.ts +0 -64
- package/dist/internal/filesystem/errors.d.ts.map +0 -1
- package/dist/internal/filesystem/errors.js +0 -180
- package/dist/internal/filesystem/format.d.ts +0 -28
- package/dist/internal/filesystem/format.d.ts.map +0 -1
- package/dist/internal/filesystem/format.js +0 -209
- package/dist/internal/filesystem/merge.d.ts +0 -34
- package/dist/internal/filesystem/merge.d.ts.map +0 -1
- package/dist/internal/filesystem/merge.js +0 -154
- package/dist/internal/filesystem/nearest.d.ts +0 -15
- package/dist/internal/filesystem/nearest.d.ts.map +0 -1
- package/dist/internal/filesystem/nearest.js +0 -90
- package/dist/internal/filesystem/scratch.d.ts +0 -60
- package/dist/internal/filesystem/scratch.d.ts.map +0 -1
- package/dist/internal/filesystem/scratch.js +0 -187
- package/dist/internal/filesystem/sdk-schemas.d.ts +0 -29
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +0 -1
- package/dist/internal/filesystem/sdk-schemas.js +0 -148
- package/dist/internal/filesystem/subagent-inherit.d.ts +0 -39
- package/dist/internal/filesystem/subagent-inherit.d.ts.map +0 -1
- package/dist/internal/filesystem/subagent-inherit.js +0 -96
- package/dist/internal/filesystem/tools.d.ts +0 -59
- package/dist/internal/filesystem/tools.d.ts.map +0 -1
- package/dist/internal/filesystem/tools.js +0 -634
- package/dist/internal/otel/propagation.d.ts +0 -7
- package/dist/internal/otel/propagation.d.ts.map +0 -1
- package/dist/internal/otel/propagation.js +0 -15
- package/dist/internal/sdk-subagent-inherit-support.d.ts +0 -9
- package/dist/internal/sdk-subagent-inherit-support.d.ts.map +0 -1
- package/dist/internal/sdk-subagent-inherit-support.js +0 -90
- package/dist/playground/assets/index-D6mVn9og.js +0 -62
- package/dist/playground/assets/index-DlALM6gr.css +0 -1
- /package/dist/docs/assets/{building-with-agents.md.BqJ7AAjG.lean.js → building-with-agents.md.Bo3ct-rf.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.BcmSqL2z.lean.js → guides_agent-to-agent.md.DcB3nhOz.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.6jiEH7dg.lean.js → guides_github.md.CcuZ7keS.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.C-Sx_IPa.lean.js → guides_mcp-oauth.md.GVPMKcYl.lean.js} +0 -0
- /package/dist/docs/assets/{guides_migrate.md.BbhHYeCr.lean.js → guides_migrate.md.B8CZxnnX.lean.js} +0 -0
- /package/dist/docs/assets/{guides_slack.md.BgIGG9ur.lean.js → guides_slack.md.D7Rwyva4.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.3TkdF79A.lean.js → hillclimbing.md.M51bF-oT.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.B8GdpaRj.lean.js → reference_cli.md.DHm6DmYk.lean.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compile one `agent/` directory (and its subagents) into a {@link ResolvedAgent}.
|
|
3
3
|
*/
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { assertNoRemovedFileSearchTools,
|
|
4
|
+
import { join, posix } from "node:path";
|
|
5
|
+
import { assertNoRemovedFileSearchTools, isRemovedFileSearchTool } from "../../filesystem.js";
|
|
6
6
|
import { DEFAULT_MODEL, } from "../../types.js";
|
|
7
|
-
import { synthesizedFileSystemToolNames } from "../filesystem/tools.js";
|
|
8
7
|
import { FS_AND_ROOT_CONFLICT, withIdentityPreamble } from "../workspace.js";
|
|
8
|
+
import { confinesWorkspaceReads, treeToolAllowlist } from "../workspace-tree.js";
|
|
9
9
|
import { isValidModelSetting, loadAgentConfig, resolveAgentCwd, resolveArchitecture, resolveConcurrency, resolveFallbackAfterStream, resolveHosting, resolveLocalCwd, rejectPersistentOption, resolveModelFallbacks, } from "./agent-config.js";
|
|
10
10
|
import { loadConnections, loadHostConnections } from "./connections.js";
|
|
11
11
|
import { displayPath, pushConfigDiagnostic } from "./context.js";
|
|
@@ -85,15 +85,12 @@ export async function loadAgent(ctx, agentDir, options) {
|
|
|
85
85
|
const authoredAllowlist = config?.tools;
|
|
86
86
|
const authored = authoredFileSystem(ctx, agentDir, config);
|
|
87
87
|
const root = authored?.fs;
|
|
88
|
-
const hasRoot = authored !== undefined;
|
|
89
88
|
if (authored !== undefined) {
|
|
90
|
-
if (config?.local?.cwd !== undefined ||
|
|
91
|
-
config?.local?.workspaceDir !== undefined ||
|
|
92
|
-
config?.local?.sandbox === true) {
|
|
89
|
+
if (config?.local?.cwd !== undefined || config?.local?.workspaceDir !== undefined) {
|
|
93
90
|
pushConfigDiagnostic(ctx, {
|
|
94
91
|
severity: "error",
|
|
95
92
|
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
96
|
-
message: `\`${authored.field}\` cannot be combined with \`local.cwd
|
|
93
|
+
message: `\`${authored.field}\` cannot be combined with \`local.cwd\` or \`local.workspaceDir\`. Those fields configure the host tree the override replaced.`,
|
|
97
94
|
});
|
|
98
95
|
}
|
|
99
96
|
if (runtime === "cloud") {
|
|
@@ -112,70 +109,58 @@ export async function loadAgent(ctx, agentDir, options) {
|
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
tools: authoredAllowlist,
|
|
118
|
-
}));
|
|
119
|
-
const clash = tools.find((tool) => {
|
|
120
|
-
if (isRemovedFileSearchTool(tool.name) || reservedNames.has(tool.name)) {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
const canonical = canonicalizeFileSystemToolName(tool.name);
|
|
124
|
-
return canonical !== undefined && reservedNames.has(canonical);
|
|
125
|
-
});
|
|
126
|
-
if (clash !== undefined) {
|
|
112
|
+
const removedSearchTool = tools.find((tool) => isRemovedFileSearchTool(tool.name));
|
|
113
|
+
if (removedSearchTool !== undefined) {
|
|
127
114
|
ctx.diagnostics.push({
|
|
128
115
|
severity: "error",
|
|
129
|
-
path: displayPath(ctx, join(agentDir, "tools", `${
|
|
130
|
-
message:
|
|
131
|
-
? `Semantic search has been removed. Use Grep. Tool name "${clash.name}" is not available.`
|
|
132
|
-
: `Tool name "${clash.name}" is reserved for the synthesized FileSystem tool.`,
|
|
116
|
+
path: displayPath(ctx, join(agentDir, "tools", `${removedSearchTool.name}.ts`)),
|
|
117
|
+
message: `Semantic search has been removed. Use Grep. Tool name "${removedSearchTool.name}" is not available.`,
|
|
133
118
|
});
|
|
134
119
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
143
|
-
message: error instanceof FileSystemConfigError
|
|
144
|
-
? error.message
|
|
145
|
-
: error instanceof Error
|
|
146
|
-
? error.message
|
|
147
|
-
: String(error),
|
|
148
|
-
});
|
|
149
|
-
}
|
|
120
|
+
// A sandboxed host agent with file tools and no shell runs on its session
|
|
121
|
+
// workspace as a tree, so its reads stay in the workspace.
|
|
122
|
+
const workspaceConfined = root === undefined &&
|
|
123
|
+
runtime === "local" &&
|
|
124
|
+
confinesWorkspaceReads({ local: config?.local, tools: authoredAllowlist });
|
|
125
|
+
try {
|
|
126
|
+
assertNoRemovedFileSearchTools(authoredAllowlist);
|
|
150
127
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
resolveFileSystemTools({
|
|
158
|
-
root,
|
|
159
|
-
tools: authoredAllowlist,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
resolveRootHarnessAllowlist(authoredAllowlist);
|
|
164
|
-
}
|
|
165
|
-
allowedTools = authoredAllowlist;
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
pushConfigDiagnostic(ctx, {
|
|
169
|
-
severity: "error",
|
|
170
|
-
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
171
|
-
message: error instanceof FileSystemConfigError
|
|
172
|
-
? error.message
|
|
173
|
-
: error instanceof Error
|
|
174
|
-
? error.message
|
|
175
|
-
: String(error),
|
|
176
|
-
});
|
|
177
|
-
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
pushConfigDiagnostic(ctx, {
|
|
130
|
+
severity: "error",
|
|
131
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
132
|
+
message: error instanceof Error ? error.message : String(error),
|
|
133
|
+
});
|
|
178
134
|
}
|
|
135
|
+
const workspaceProblem = checkWorkspace(config?.workspace);
|
|
136
|
+
if (workspaceProblem !== undefined) {
|
|
137
|
+
pushConfigDiagnostic(ctx, {
|
|
138
|
+
severity: "error",
|
|
139
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
140
|
+
message: workspaceProblem,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (root === undefined && !workspaceConfined && config?.workspace !== undefined) {
|
|
144
|
+
pushConfigDiagnostic(ctx, {
|
|
145
|
+
severity: "error",
|
|
146
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
147
|
+
message: "`workspace` places the workspace inside a tree: the one `fs` sets, or the session workspace of a sandboxed agent whose `tools` list file tools and no shell. Set `fs`, or remove it.",
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const treeTools = authoredAllowlist !== undefined && (root !== undefined || workspaceConfined)
|
|
151
|
+
? treeToolAllowlist(authoredAllowlist)
|
|
152
|
+
: undefined;
|
|
153
|
+
if (treeTools !== undefined && treeTools.dropped.length > 0) {
|
|
154
|
+
pushConfigDiagnostic(ctx, {
|
|
155
|
+
severity: "warning",
|
|
156
|
+
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
157
|
+
message: `\`tools\` lists ${treeTools.dropped.join(", ")}, which an agent on a tree cannot run. Agent SDK leaves ${treeTools.dropped.length === 1 ? "it" : "them"} out.`,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const listedTools = treeTools?.tools ?? authoredAllowlist;
|
|
161
|
+
const allowedTools = listedTools === undefined || listedTools.includes("mcp")
|
|
162
|
+
? listedTools
|
|
163
|
+
: [...listedTools, "mcp"];
|
|
179
164
|
// The allowlist states runtime-agnostic intent, but only the local
|
|
180
165
|
// harness can enforce it (the Cursor SDK rejects tool restrictions on
|
|
181
166
|
// cloud agents, and the Grok Bot harness has its own fixed toolset) — a
|
|
@@ -254,6 +239,7 @@ export async function loadAgent(ctx, agentDir, options) {
|
|
|
254
239
|
runtime,
|
|
255
240
|
fs: root,
|
|
256
241
|
root: authored?.field === "root" ? root : undefined,
|
|
242
|
+
workspace: config?.workspace === undefined ? undefined : normalizeWorkspace(config.workspace),
|
|
257
243
|
skillsMount: config?.skills,
|
|
258
244
|
cloud,
|
|
259
245
|
local,
|
|
@@ -278,6 +264,25 @@ export async function loadAgent(ctx, agentDir, options) {
|
|
|
278
264
|
},
|
|
279
265
|
};
|
|
280
266
|
}
|
|
267
|
+
/** `workspace` as the SDK's tree paths spell it: normalized, no trailing slash. */
|
|
268
|
+
function normalizeWorkspace(workspace) {
|
|
269
|
+
const normalized = posix.normalize(workspace);
|
|
270
|
+
return normalized.length > 1 && normalized.endsWith("/") ? normalized.slice(0, -1) : normalized;
|
|
271
|
+
}
|
|
272
|
+
/** Why `workspace` cannot be the workspace inside the tree, if it cannot. */
|
|
273
|
+
function checkWorkspace(workspace) {
|
|
274
|
+
if (workspace === undefined) {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
if (!workspace.startsWith("/") || workspace.includes("\\")) {
|
|
278
|
+
return `\`workspace\` must be an absolute posix path inside \`fs\`, got ${JSON.stringify(workspace)}.`;
|
|
279
|
+
}
|
|
280
|
+
const normalized = posix.normalize(workspace);
|
|
281
|
+
if (normalized === "/tmp" || normalized.startsWith("/tmp/")) {
|
|
282
|
+
return "`workspace` cannot be under `/tmp`: the SDK mounts a fresh `/tmp` over the tree for each turn.";
|
|
283
|
+
}
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
281
286
|
function authoredFileSystem(ctx, agentDir, config) {
|
|
282
287
|
if (config?.fs !== undefined && config.root !== undefined) {
|
|
283
288
|
pushConfigDiagnostic(ctx, {
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* merge already-sorted streams with a k-way heap.
|
|
2
|
+
* Flat-index listing helpers for trees that hold a list of file paths
|
|
3
|
+
* (`hostFs`). `list` is files-only and recursive; `stat` tells file /
|
|
4
|
+
* directory / missing apart.
|
|
6
5
|
*/
|
|
7
|
-
import { type DirEntry, type FileInfo, type
|
|
8
|
-
/**
|
|
9
|
-
* Native LS `directoryTreeRoot` (LocalLsExecutor ingest tree).
|
|
10
|
-
* Synthesis builds this from `list` + `stat` via `buildLsTree`.
|
|
11
|
-
* Not a FileSystem method result and not part of the public
|
|
12
|
-
* Agent SDK surface.
|
|
13
|
-
*/
|
|
14
|
-
export interface LsDirectoryTreeNode {
|
|
15
|
-
absPath: string;
|
|
16
|
-
childrenDirs: LsDirectoryTreeNode[];
|
|
17
|
-
childrenFiles: Array<{
|
|
18
|
-
name: string;
|
|
19
|
-
}>;
|
|
20
|
-
childrenWereProcessed: boolean;
|
|
21
|
-
fullSubtreeExtensionCounts: Record<string, number>;
|
|
22
|
-
numFiles: number;
|
|
23
|
-
}
|
|
24
|
-
/** Filename-character ingest budget; matches LocalLsExecutor. */
|
|
25
|
-
export declare const LS_INGEST_CHARACTER_BUDGET = 2500;
|
|
6
|
+
import { type DirEntry, type FileInfo, type ListOptions } from "../../filesystem.js";
|
|
26
7
|
/**
|
|
27
8
|
* Yield the files under `prefix`, sorted. A file whose path equals
|
|
28
9
|
* `prefix` is not under itself.
|
|
@@ -34,28 +15,6 @@ export declare function normalizeListPrefix(prefix?: string): string;
|
|
|
34
15
|
* key with this prefix → directory; `""` / `/` → directory; else missing.
|
|
35
16
|
*/
|
|
36
17
|
export declare function statFromFilePaths(files: Iterable<string>, path: string): FileInfo;
|
|
37
|
-
export declare function collectList(root: Pick<FileSystem, "list">, prefix?: string, options?: ListOptions): Promise<DirEntry[]>;
|
|
38
|
-
export declare function collectGlob(root: Pick<FileSystem, "glob">, options: {
|
|
39
|
-
pattern: string;
|
|
40
|
-
dir?: string;
|
|
41
|
-
limit?: number;
|
|
42
|
-
}): Promise<DirEntry[]>;
|
|
43
|
-
/**
|
|
44
|
-
* List, then `stat` only when nothing came back. A non-empty listing is
|
|
45
|
-
* already a directory (a file is not under itself).
|
|
46
|
-
*/
|
|
47
|
-
export declare function collectListOrStat(root: Pick<FileSystem, "list" | "stat">, path?: string, options?: ListOptions): Promise<{
|
|
48
|
-
kind: FileInfo["kind"];
|
|
49
|
-
files: DirEntry[];
|
|
50
|
-
}>;
|
|
51
|
-
export declare function mergeSortedByPath(sources: Array<Iterable<DirEntry> | AsyncIterable<DirEntry>>, options?: {
|
|
52
|
-
unique?: boolean;
|
|
53
|
-
}): AsyncGenerator<DirEntry>;
|
|
54
|
-
/**
|
|
55
|
-
* Build the native LS tree from a recursive file listing. Applies the
|
|
56
|
-
* LocalLsExecutor ingest budget so a huge directory truncates the same way.
|
|
57
|
-
*/
|
|
58
|
-
export declare function buildLsTree(dir: string, files: readonly DirEntry[]): LsDirectoryTreeNode;
|
|
59
18
|
/**
|
|
60
19
|
* Native LS ignore_globs: a pattern that is not already recursive is
|
|
61
20
|
* matched at any depth (the same `** /` prefix the Cursor SDK native uses).
|
|
@@ -63,15 +22,4 @@ export declare function buildLsTree(dir: string, files: readonly DirEntry[]): Ls
|
|
|
63
22
|
export declare function applyIgnores(entries: readonly DirEntry[], ignoreGlobs?: readonly string[]): DirEntry[];
|
|
64
23
|
/** True when `path` matches any {@link ListOptions.excludes} glob. */
|
|
65
24
|
export declare function isExcludedPath(path: string, excludes?: readonly string[]): boolean;
|
|
66
|
-
export declare function lsFromList(root: Pick<FileSystem, "list" | "stat">, path?: string, ignoreGlobs?: readonly string[]): Promise<{
|
|
67
|
-
status: "success";
|
|
68
|
-
value: {
|
|
69
|
-
directoryTreeRoot: LsDirectoryTreeNode;
|
|
70
|
-
};
|
|
71
|
-
} | {
|
|
72
|
-
status: "error";
|
|
73
|
-
error: {
|
|
74
|
-
message: string;
|
|
75
|
-
};
|
|
76
|
-
}>;
|
|
77
25
|
//# sourceMappingURL=walk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../../src/internal/filesystem/walk.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../../src/internal/filesystem/walk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,qBAAqB,CAAC;AAU7B;;;GAGG;AACH,wBAAuB,kBAAkB,CACvC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACzB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,cAAc,CAAC,QAAQ,CAAC,CAqB1B;AAED,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAK3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAgBjF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,GAC9B,QAAQ,EAAE,CAOZ;AAkBD,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAKlF"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* merge already-sorted streams with a k-way heap.
|
|
2
|
+
* Flat-index listing helpers for trees that hold a list of file paths
|
|
3
|
+
* (`hostFs`). `list` is files-only and recursive; `stat` tells file /
|
|
4
|
+
* directory / missing apart.
|
|
6
5
|
*/
|
|
7
|
-
import { posix } from "node:path";
|
|
8
6
|
import { minimatch } from "minimatch";
|
|
9
|
-
import {
|
|
10
|
-
import { mergeSorted } from "./merge.js";
|
|
11
|
-
/** Filename-character ingest budget; matches LocalLsExecutor. */
|
|
12
|
-
export const LS_INGEST_CHARACTER_BUDGET = 2_500;
|
|
7
|
+
import { normalizeFsPath, } from "../../filesystem.js";
|
|
13
8
|
function takeLimit(entries, limit) {
|
|
14
9
|
if (limit === undefined || !Number.isFinite(limit)) {
|
|
15
10
|
return [...entries];
|
|
@@ -66,141 +61,6 @@ export function statFromFilePaths(files, path) {
|
|
|
66
61
|
}
|
|
67
62
|
return { kind: "missing" };
|
|
68
63
|
}
|
|
69
|
-
export async function collectList(root, prefix, options) {
|
|
70
|
-
const entries = [];
|
|
71
|
-
if (root.list === undefined) {
|
|
72
|
-
return entries;
|
|
73
|
-
}
|
|
74
|
-
for await (const entry of root.list(prefix, options)) {
|
|
75
|
-
entries.push(entry);
|
|
76
|
-
}
|
|
77
|
-
return entries;
|
|
78
|
-
}
|
|
79
|
-
export async function collectGlob(root, options) {
|
|
80
|
-
const entries = [];
|
|
81
|
-
if (root.glob === undefined) {
|
|
82
|
-
return entries;
|
|
83
|
-
}
|
|
84
|
-
const globOptions = options.limit === undefined ? undefined : { limit: options.limit };
|
|
85
|
-
for await (const entry of root.glob(options.pattern, options.dir, globOptions)) {
|
|
86
|
-
entries.push(entry);
|
|
87
|
-
}
|
|
88
|
-
return entries;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* List, then `stat` only when nothing came back. A non-empty listing is
|
|
92
|
-
* already a directory (a file is not under itself).
|
|
93
|
-
*/
|
|
94
|
-
export async function collectListOrStat(root, path, options) {
|
|
95
|
-
const files = await collectList(root, path, options);
|
|
96
|
-
if (files.length > 0) {
|
|
97
|
-
return { kind: "directory", files };
|
|
98
|
-
}
|
|
99
|
-
if (root.stat === undefined) {
|
|
100
|
-
return { kind: "missing", files };
|
|
101
|
-
}
|
|
102
|
-
const probe = path === undefined || path === "" ? "." : path;
|
|
103
|
-
return { kind: (await root.stat(probe)).kind, files };
|
|
104
|
-
}
|
|
105
|
-
export async function* mergeSortedByPath(sources, options) {
|
|
106
|
-
yield* mergeSorted(sources, {
|
|
107
|
-
compare: (left, right) => left.path.localeCompare(right.path),
|
|
108
|
-
unique: options?.unique === true,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function emptyLsNode(absPath) {
|
|
112
|
-
return {
|
|
113
|
-
absPath,
|
|
114
|
-
childrenDirs: [],
|
|
115
|
-
childrenFiles: [],
|
|
116
|
-
childrenWereProcessed: true,
|
|
117
|
-
fullSubtreeExtensionCounts: {},
|
|
118
|
-
numFiles: 0,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Build the native LS tree from a recursive file listing. Applies the
|
|
123
|
-
* LocalLsExecutor ingest budget so a huge directory truncates the same way.
|
|
124
|
-
*/
|
|
125
|
-
export function buildLsTree(dir, files) {
|
|
126
|
-
const rootPath = normalizeListPrefix(dir);
|
|
127
|
-
const root = emptyLsNode(rootPath);
|
|
128
|
-
const dirNodes = new Map([[rootPath, root]]);
|
|
129
|
-
const state = {
|
|
130
|
-
charactersUsed: rootPath.length,
|
|
131
|
-
budgetExceeded: false,
|
|
132
|
-
};
|
|
133
|
-
for (const file of files) {
|
|
134
|
-
addPathToTree(file.path, rootPath, dirNodes, state, LS_INGEST_CHARACTER_BUDGET);
|
|
135
|
-
}
|
|
136
|
-
return root;
|
|
137
|
-
}
|
|
138
|
-
function addPathToTree(filePath, rootPath, dirNodes, state, characterBudget) {
|
|
139
|
-
const fileName = posix.basename(filePath);
|
|
140
|
-
const dirPath = posixParent(filePath);
|
|
141
|
-
ensureDirectoryPath(dirPath, rootPath, dirNodes, state.budgetExceeded);
|
|
142
|
-
const parentNode = dirNodes.get(dirPath);
|
|
143
|
-
if (parentNode === undefined) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const fileCharCost = fileName.length;
|
|
147
|
-
if (!state.budgetExceeded && state.charactersUsed + fileCharCost <= characterBudget) {
|
|
148
|
-
parentNode.childrenFiles.push({ name: fileName });
|
|
149
|
-
state.charactersUsed += fileCharCost;
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (!state.budgetExceeded) {
|
|
153
|
-
state.budgetExceeded = true;
|
|
154
|
-
let currentDir = dirPath;
|
|
155
|
-
while (currentDir.startsWith(rootPath)) {
|
|
156
|
-
const node = dirNodes.get(currentDir);
|
|
157
|
-
if (node !== undefined) {
|
|
158
|
-
node.childrenWereProcessed = false;
|
|
159
|
-
}
|
|
160
|
-
const parentDir = posixParent(currentDir);
|
|
161
|
-
if (parentDir === currentDir) {
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
currentDir = parentDir;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
const extension = posix.extname(filePath);
|
|
168
|
-
let currentDir = dirPath;
|
|
169
|
-
while (currentDir.startsWith(rootPath)) {
|
|
170
|
-
const node = dirNodes.get(currentDir);
|
|
171
|
-
if (node !== undefined) {
|
|
172
|
-
node.fullSubtreeExtensionCounts[extension] =
|
|
173
|
-
(node.fullSubtreeExtensionCounts[extension] ?? 0) + 1;
|
|
174
|
-
node.numFiles += 1;
|
|
175
|
-
}
|
|
176
|
-
const parentDir = posixParent(currentDir);
|
|
177
|
-
if (parentDir === currentDir) {
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
currentDir = parentDir;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function ensureDirectoryPath(dirPath, rootPath, dirNodes, budgetExceeded) {
|
|
184
|
-
if (dirNodes.has(dirPath) || dirPath === rootPath) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const parentPath = posixParent(dirPath);
|
|
188
|
-
if (parentPath !== dirPath && pathIsUnderRoot(parentPath, rootPath)) {
|
|
189
|
-
ensureDirectoryPath(parentPath, rootPath, dirNodes, budgetExceeded);
|
|
190
|
-
}
|
|
191
|
-
const dirNode = {
|
|
192
|
-
...emptyLsNode(dirPath),
|
|
193
|
-
childrenWereProcessed: !budgetExceeded,
|
|
194
|
-
};
|
|
195
|
-
dirNodes.set(dirPath, dirNode);
|
|
196
|
-
const parentNode = dirNodes.get(parentPath);
|
|
197
|
-
if (parentNode !== undefined) {
|
|
198
|
-
parentNode.childrenDirs.push(dirNode);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function pathIsUnderRoot(path, rootPath) {
|
|
202
|
-
return path === rootPath || path.startsWith(rootPath === "/" ? "/" : `${rootPath}/`);
|
|
203
|
-
}
|
|
204
64
|
/**
|
|
205
65
|
* Native LS ignore_globs: a pattern that is not already recursive is
|
|
206
66
|
* matched at any depth (the same `** /` prefix the Cursor SDK native uses).
|
|
@@ -231,57 +91,3 @@ export function isExcludedPath(path, excludes) {
|
|
|
231
91
|
}
|
|
232
92
|
return excludes.some((glob) => matchesIgnoreGlob(path, glob));
|
|
233
93
|
}
|
|
234
|
-
export async function lsFromList(root, path, ignoreGlobs) {
|
|
235
|
-
const listed = await collectListOrStat(root, path, {
|
|
236
|
-
limit: FILE_SYSTEM_SCAN_LIMIT,
|
|
237
|
-
...(ignoreGlobs === undefined || ignoreGlobs.length === 0 ? {} : { excludes: ignoreGlobs }),
|
|
238
|
-
});
|
|
239
|
-
const treePath = path ?? inferListedRoot(listed.files);
|
|
240
|
-
switch (listed.kind) {
|
|
241
|
-
case "missing":
|
|
242
|
-
return {
|
|
243
|
-
status: "error",
|
|
244
|
-
error: { message: `Path does not exist: ${treePath}` },
|
|
245
|
-
};
|
|
246
|
-
case "file":
|
|
247
|
-
return {
|
|
248
|
-
status: "error",
|
|
249
|
-
error: { message: `Path is not a directory: ${treePath}` },
|
|
250
|
-
};
|
|
251
|
-
case "directory":
|
|
252
|
-
return {
|
|
253
|
-
status: "success",
|
|
254
|
-
value: {
|
|
255
|
-
directoryTreeRoot: buildLsTree(treePath, applyIgnores(listed.files, ignoreGlobs)),
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
default: {
|
|
259
|
-
const unexpected = listed.kind;
|
|
260
|
-
return unexpected;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function inferListedRoot(files) {
|
|
265
|
-
if (files.length === 0) {
|
|
266
|
-
return "/";
|
|
267
|
-
}
|
|
268
|
-
let prefix = posixParent(files[0].path);
|
|
269
|
-
for (const file of files) {
|
|
270
|
-
while (prefix !== "/" && file.path !== prefix && !file.path.startsWith(`${prefix}/`)) {
|
|
271
|
-
const parent = posixParent(prefix);
|
|
272
|
-
if (parent === prefix) {
|
|
273
|
-
return "/";
|
|
274
|
-
}
|
|
275
|
-
prefix = parent;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
return prefix;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* `path.posix.dirname` returns `.` for slash-free paths. Treat that as
|
|
282
|
-
* the virtual root so LS walks terminate and relative files attach to `/`.
|
|
283
|
-
*/
|
|
284
|
-
function posixParent(path) {
|
|
285
|
-
const dir = posix.dirname(path);
|
|
286
|
-
return dir === "." || dir === path ? "/" : dir;
|
|
287
|
-
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Catch ingress wire contract, July copy. The control plane keeps a
|
|
3
3
|
* byte-identical copy of these constants in
|
|
4
|
-
* `backend/packages/server-shared/src/agentServe/agentSdkCatch.ts`;
|
|
5
|
-
*
|
|
6
|
-
* other.
|
|
4
|
+
* `backend/packages/server-shared/src/agentServe/agentSdkCatch.ts`; the
|
|
5
|
+
* `cross-language-constant-parity` repo-lint rule compares the two as text.
|
|
6
|
+
* Neither package imports the other.
|
|
7
7
|
*
|
|
8
8
|
* A caught request is one hosted admission whose `eventType` is
|
|
9
9
|
* {@link AGENT_SDK_CATCH_EVENT_TYPE} and whose `payload` is a
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Catch ingress wire contract, July copy. The control plane keeps a
|
|
3
3
|
* byte-identical copy of these constants in
|
|
4
|
-
* `backend/packages/server-shared/src/agentServe/agentSdkCatch.ts`;
|
|
5
|
-
*
|
|
6
|
-
* other.
|
|
4
|
+
* `backend/packages/server-shared/src/agentServe/agentSdkCatch.ts`; the
|
|
5
|
+
* `cross-language-constant-parity` repo-lint rule compares the two as text.
|
|
6
|
+
* Neither package imports the other.
|
|
7
7
|
*
|
|
8
8
|
* A caught request is one hosted admission whose `eventType` is
|
|
9
9
|
* {@link AGENT_SDK_CATCH_EVENT_TYPE} and whose `payload` is a
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface HostedFetchOptions {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
fetch?: typeof fetch;
|
|
5
|
+
}
|
|
6
|
+
export declare function hostedControlPlaneFetch(options: HostedFetchOptions, method: "GET" | "POST" | "PUT" | "DELETE", path: string, body?: unknown): Promise<Response>;
|
|
7
|
+
//# sourceMappingURL=hosted-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-fetch.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-fetch.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,QAAQ,CAAC,CAanB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const DEFAULT_CURSOR_API_URL = "https://api.cursor.com";
|
|
2
|
+
export async function hostedControlPlaneFetch(options, method, path, body) {
|
|
3
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
4
|
+
const headers = {
|
|
5
|
+
Authorization: `Bearer ${resolveApiKey(options)}`,
|
|
6
|
+
};
|
|
7
|
+
if (body !== undefined) {
|
|
8
|
+
headers["Content-Type"] = "application/json";
|
|
9
|
+
}
|
|
10
|
+
const init = { method, headers };
|
|
11
|
+
if (body !== undefined) {
|
|
12
|
+
init.body = JSON.stringify(body);
|
|
13
|
+
}
|
|
14
|
+
return fetchImpl(`${resolveBaseUrl(options)}${path}`, init);
|
|
15
|
+
}
|
|
16
|
+
function resolveApiKey(options) {
|
|
17
|
+
const key = (options.apiKey ?? process.env.CURSOR_API_KEY)?.trim();
|
|
18
|
+
if (key === undefined || key === "") {
|
|
19
|
+
throw new Error("hosted control plane requires CURSOR_API_KEY (deployment pod credential on Cursor hosting)");
|
|
20
|
+
}
|
|
21
|
+
return key;
|
|
22
|
+
}
|
|
23
|
+
function resolveBaseUrl(options) {
|
|
24
|
+
const raw = (options.baseUrl ?? process.env.CURSOR_API_BASE_URL ?? DEFAULT_CURSOR_API_URL).trim();
|
|
25
|
+
return raw.endsWith("/") ? raw.slice(0, -1) : raw;
|
|
26
|
+
}
|
|
@@ -38,7 +38,7 @@ const MANAGED_AUTOMATION_TTL_MS = 60 * 60_000;
|
|
|
38
38
|
const MANAGED_AUTOMATION_MAX_ENTRIES = 10_000;
|
|
39
39
|
export function recordHostedManagedAutomation(delivery) {
|
|
40
40
|
if (delivery.managedAutomation === undefined) {
|
|
41
|
-
console.info(`[bdk] hosted managedAutomation not recorded deliveryId=${delivery.deliveryId}: admission envelope carried no managedAutomation slice (non-managed delivery, or the
|
|
41
|
+
console.info(`[bdk] hosted managedAutomation not recorded deliveryId=${delivery.deliveryId}: admission envelope carried no managedAutomation slice (non-managed delivery, or the installation has no document for the matched automation)`);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
const managedAutomationByDelivery = managedAutomationTable();
|
|
@@ -25,9 +25,9 @@ export declare const CURSOR_JULY_SKILLS_HOME_ENV = "CURSOR_JULY_SKILLS_HOME";
|
|
|
25
25
|
/** Set to `1` to skip the postinstall skill copy. */
|
|
26
26
|
export declare const CURSOR_JULY_SKIP_SKILL_INSTALL_ENV = "CURSOR_JULY_SKIP_SKILL_INSTALL";
|
|
27
27
|
export interface PackageSkill {
|
|
28
|
-
/** Frontmatter `name` (e.g.
|
|
28
|
+
/** Frontmatter `name` (e.g. agent-sdk-create-agent). */
|
|
29
29
|
name: string;
|
|
30
|
-
/** Leaf install directory under
|
|
30
|
+
/** Leaf install directory under agent-sdk/ (e.g. create-agent). */
|
|
31
31
|
leafDir: string;
|
|
32
32
|
/** Absolute path to the source skill directory in the package. */
|
|
33
33
|
sourceDir: string;
|
|
@@ -48,7 +48,7 @@ export declare function bdkCursorSkillsDir(skillsHome?: string): string;
|
|
|
48
48
|
export declare function skillInstallPath(skill: Pick<PackageSkill, "leafDir">, skillsHome?: string): string;
|
|
49
49
|
/**
|
|
50
50
|
* Skills shipped next to the running package. Uses the frontmatter `name`
|
|
51
|
-
* when present, otherwise `
|
|
51
|
+
* when present, otherwise `agent-sdk-<dir>`.
|
|
52
52
|
*/
|
|
53
53
|
export declare function listShippedPackageSkills(packageRoot?: string): Promise<PackageSkill[]>;
|
|
54
54
|
/** Fill skill text with the name and version from package.json. */
|
|
@@ -67,7 +67,7 @@ export interface SkillInstallResult {
|
|
|
67
67
|
installed: string[];
|
|
68
68
|
/** Leaf dirs deleted because the package no longer ships them. */
|
|
69
69
|
removed: string[];
|
|
70
|
-
/** Leftover
|
|
70
|
+
/** Leftover earlier-install dirs deleted. */
|
|
71
71
|
removedLegacyDirs: string[];
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
@@ -75,8 +75,7 @@ export interface SkillInstallResult {
|
|
|
75
75
|
* Always overwrites so a package upgrade refreshes local Cursor skills.
|
|
76
76
|
* Strips monorepo-only frontmatter, sets `alwaysApply: true` so Cursor
|
|
77
77
|
* loads the body into context, and removes leaf dirs no longer shipped.
|
|
78
|
-
* Also deletes leftover
|
|
79
|
-
* `skillsHome/agentkit/`.
|
|
78
|
+
* Also deletes leftover earlier-install folders under `skillsHome`.
|
|
80
79
|
*/
|
|
81
80
|
export declare function installCursorSkills(skills: readonly PackageSkill[], skillsHome?: string): Promise<SkillInstallResult>;
|
|
82
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"install-cursor-skills.d.ts","sourceRoot":"","sources":["../../src/internal/install-cursor-skills.ts"],"names":[],"mappings":"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"}
|