@cursor/bdk 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +341 -0
- package/LICENSE.md +3 -0
- package/README.md +1190 -0
- package/dist/artifacts.d.ts +34 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +51 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +19 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1578 -0
- package/dist/channels/bitbucket/api.d.ts +217 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +664 -0
- package/dist/channels/bitbucket/binding.d.ts +75 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +277 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +384 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +67 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +60 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +302 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +227 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +45 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +42 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/checks.d.ts +121 -0
- package/dist/channels/checks.d.ts.map +1 -0
- package/dist/channels/checks.js +86 -0
- package/dist/channels/deployments/deployments-channel.d.ts +95 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
- package/dist/channels/deployments/deployments-channel.js +196 -0
- package/dist/channels/deployments/index.d.ts +25 -0
- package/dist/channels/deployments/index.d.ts.map +1 -0
- package/dist/channels/deployments/index.js +24 -0
- package/dist/channels/deployments/types.d.ts +83 -0
- package/dist/channels/deployments/types.d.ts.map +1 -0
- package/dist/channels/deployments/types.js +7 -0
- package/dist/channels/github/api.d.ts +133 -0
- package/dist/channels/github/api.d.ts.map +1 -0
- package/dist/channels/github/api.js +320 -0
- package/dist/channels/github/auth.d.ts +67 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +233 -0
- package/dist/channels/github/binding.d.ts +86 -0
- package/dist/channels/github/binding.d.ts.map +1 -0
- package/dist/channels/github/binding.js +114 -0
- package/dist/channels/github/checks.d.ts +64 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +98 -0
- package/dist/channels/github/cursor-account.d.ts +102 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +194 -0
- package/dist/channels/github/defaults.d.ts +23 -0
- package/dist/channels/github/defaults.d.ts.map +1 -0
- package/dist/channels/github/defaults.js +157 -0
- package/dist/channels/github/events.d.ts +18 -0
- package/dist/channels/github/events.d.ts.map +1 -0
- package/dist/channels/github/events.js +56 -0
- package/dist/channels/github/forward.d.ts +139 -0
- package/dist/channels/github/forward.d.ts.map +1 -0
- package/dist/channels/github/forward.js +267 -0
- package/dist/channels/github/github-channel.d.ts +146 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +1804 -0
- package/dist/channels/github/index.d.ts +54 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +53 -0
- package/dist/channels/github/progress.d.ts +84 -0
- package/dist/channels/github/progress.d.ts.map +1 -0
- package/dist/channels/github/progress.js +236 -0
- package/dist/channels/github/replay.d.ts +115 -0
- package/dist/channels/github/replay.d.ts.map +1 -0
- package/dist/channels/github/replay.js +278 -0
- package/dist/channels/github/state.d.ts +47 -0
- package/dist/channels/github/state.d.ts.map +1 -0
- package/dist/channels/github/state.js +53 -0
- package/dist/channels/github/types.d.ts +491 -0
- package/dist/channels/github/types.d.ts.map +1 -0
- package/dist/channels/github/types.js +1 -0
- package/dist/channels/gitlab/api.d.ts +118 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +234 -0
- package/dist/channels/gitlab/binding.d.ts +63 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +147 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +122 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +64 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +55 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +26 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +388 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +199 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +211 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +35 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/types.js +1 -0
- package/dist/channels/origin/api.d.ts +157 -0
- package/dist/channels/origin/api.d.ts.map +1 -0
- package/dist/channels/origin/api.js +379 -0
- package/dist/channels/origin/binding.d.ts +57 -0
- package/dist/channels/origin/binding.d.ts.map +1 -0
- package/dist/channels/origin/binding.js +57 -0
- package/dist/channels/origin/checks.d.ts +119 -0
- package/dist/channels/origin/checks.d.ts.map +1 -0
- package/dist/channels/origin/checks.js +145 -0
- package/dist/channels/origin/cursor-account.d.ts +24 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -0
- package/dist/channels/origin/cursor-account.js +35 -0
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +109 -0
- package/dist/channels/origin/events.d.ts +10 -0
- package/dist/channels/origin/events.d.ts.map +1 -0
- package/dist/channels/origin/events.js +25 -0
- package/dist/channels/origin/index.d.ts +35 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +34 -0
- package/dist/channels/origin/origin-channel.d.ts +72 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -0
- package/dist/channels/origin/origin-channel.js +634 -0
- package/dist/channels/origin/origin-webhook.d.ts +69 -0
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
- package/dist/channels/origin/origin-webhook.js +231 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +58 -0
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +257 -0
- package/dist/channels/origin/types.d.ts.map +1 -0
- package/dist/channels/origin/types.js +1 -0
- package/dist/channels/slack/agentic-delivery.d.ts +23 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +566 -0
- package/dist/channels/slack/agentic-posted.d.ts +30 -0
- package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
- package/dist/channels/slack/agentic-posted.js +102 -0
- package/dist/channels/slack/agentic-signals.d.ts +48 -0
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
- package/dist/channels/slack/agentic-signals.js +199 -0
- package/dist/channels/slack/api.d.ts +171 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +613 -0
- package/dist/channels/slack/approvals.d.ts +48 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -0
- package/dist/channels/slack/approvals.js +233 -0
- package/dist/channels/slack/assistant.d.ts +23 -0
- package/dist/channels/slack/assistant.d.ts.map +1 -0
- package/dist/channels/slack/assistant.js +67 -0
- package/dist/channels/slack/attachments.d.ts +82 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +503 -0
- package/dist/channels/slack/auth.d.ts +46 -0
- package/dist/channels/slack/auth.d.ts.map +1 -0
- package/dist/channels/slack/auth.js +95 -0
- package/dist/channels/slack/blocks.d.ts +61 -0
- package/dist/channels/slack/blocks.d.ts.map +1 -0
- package/dist/channels/slack/blocks.js +90 -0
- package/dist/channels/slack/bot-mentions.d.ts +108 -0
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
- package/dist/channels/slack/bot-mentions.js +257 -0
- package/dist/channels/slack/channel-watch.d.ts +76 -0
- package/dist/channels/slack/channel-watch.d.ts.map +1 -0
- package/dist/channels/slack/channel-watch.js +264 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +228 -0
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +166 -0
- package/dist/channels/slack/constants.d.ts +25 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +35 -0
- package/dist/channels/slack/credentials.d.ts +35 -0
- package/dist/channels/slack/credentials.d.ts.map +1 -0
- package/dist/channels/slack/credentials.js +88 -0
- package/dist/channels/slack/defaults.d.ts +50 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -0
- package/dist/channels/slack/defaults.js +630 -0
- package/dist/channels/slack/dispatch.d.ts +141 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +730 -0
- package/dist/channels/slack/doctor.d.ts +40 -0
- package/dist/channels/slack/doctor.d.ts.map +1 -0
- package/dist/channels/slack/doctor.js +291 -0
- package/dist/channels/slack/eval-directive.d.ts +59 -0
- package/dist/channels/slack/eval-directive.d.ts.map +1 -0
- package/dist/channels/slack/eval-directive.js +269 -0
- package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
- package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
- package/dist/channels/slack/event-id-dedupe.js +23 -0
- package/dist/channels/slack/external-policy.d.ts +28 -0
- package/dist/channels/slack/external-policy.d.ts.map +1 -0
- package/dist/channels/slack/external-policy.js +64 -0
- package/dist/channels/slack/footer.d.ts +33 -0
- package/dist/channels/slack/footer.d.ts.map +1 -0
- package/dist/channels/slack/footer.js +85 -0
- package/dist/channels/slack/inbound.d.ts +98 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +314 -0
- package/dist/channels/slack/index.d.ts +53 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +52 -0
- package/dist/channels/slack/init.d.ts +45 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +126 -0
- package/dist/channels/slack/interactive.d.ts +65 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +310 -0
- package/dist/channels/slack/links.d.ts +10 -0
- package/dist/channels/slack/links.d.ts.map +1 -0
- package/dist/channels/slack/links.js +19 -0
- package/dist/channels/slack/live-delivery.d.ts +77 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +399 -0
- package/dist/channels/slack/log.d.ts +25 -0
- package/dist/channels/slack/log.d.ts.map +1 -0
- package/dist/channels/slack/log.js +44 -0
- package/dist/channels/slack/manifest.d.ts +80 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -0
- package/dist/channels/slack/manifest.js +159 -0
- package/dist/channels/slack/message-body.d.ts +13 -0
- package/dist/channels/slack/message-body.d.ts.map +1 -0
- package/dist/channels/slack/message-body.js +74 -0
- package/dist/channels/slack/nudge-carrier.d.ts +21 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +213 -0
- package/dist/channels/slack/nudge-store.d.ts +77 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +315 -0
- package/dist/channels/slack/paint-start.d.ts +22 -0
- package/dist/channels/slack/paint-start.d.ts.map +1 -0
- package/dist/channels/slack/paint-start.js +91 -0
- package/dist/channels/slack/placeholder.d.ts +62 -0
- package/dist/channels/slack/placeholder.d.ts.map +1 -0
- package/dist/channels/slack/placeholder.js +266 -0
- package/dist/channels/slack/pr-ref.d.ts +24 -0
- package/dist/channels/slack/pr-ref.d.ts.map +1 -0
- package/dist/channels/slack/pr-ref.js +55 -0
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +122 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +103 -0
- package/dist/channels/slack/reasoning-chip.d.ts +8 -0
- package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-chip.js +30 -0
- package/dist/channels/slack/recording-sink.d.ts +29 -0
- package/dist/channels/slack/recording-sink.d.ts.map +1 -0
- package/dist/channels/slack/recording-sink.js +140 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +47 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +193 -0
- package/dist/channels/slack/setup.d.ts +33 -0
- package/dist/channels/slack/setup.d.ts.map +1 -0
- package/dist/channels/slack/setup.js +101 -0
- package/dist/channels/slack/slack-channel.d.ts +43 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +534 -0
- package/dist/channels/slack/socket-mode.d.ts +26 -0
- package/dist/channels/slack/socket-mode.d.ts.map +1 -0
- package/dist/channels/slack/socket-mode.js +114 -0
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/stream.d.ts +38 -0
- package/dist/channels/slack/stream.d.ts.map +1 -0
- package/dist/channels/slack/stream.js +30 -0
- package/dist/channels/slack/thread-context.d.ts +79 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +396 -0
- package/dist/channels/slack/tool-approval-events.d.ts +38 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
- package/dist/channels/slack/tool-approval-events.js +224 -0
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +172 -0
- package/dist/channels/slack/tool-chip.d.ts +9 -0
- package/dist/channels/slack/tool-chip.d.ts.map +1 -0
- package/dist/channels/slack/tool-chip.js +23 -0
- package/dist/channels/slack/types.d.ts +751 -0
- package/dist/channels/slack/types.d.ts.map +1 -0
- package/dist/channels/slack/types.js +4 -0
- package/dist/channels/slack/upload.d.ts +13 -0
- package/dist/channels/slack/upload.d.ts.map +1 -0
- package/dist/channels/slack/upload.js +135 -0
- package/dist/channels.d.ts +175 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +417 -0
- package/dist/connections.d.ts +131 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +131 -0
- package/dist/dashboard-session-url.d.ts +15 -0
- package/dist/dashboard-session-url.d.ts.map +1 -0
- package/dist/dashboard-session-url.js +25 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.JVQvbRO-.js +309 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.js +9 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.BkhY63uW.js +9 -0
- package/dist/docs/assets/chunks/arc.Cc1unYd3.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.CAY_TPVz.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.my2VD3Xm.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.CQXAOmqd.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.D0AsQFSX.js +10 -0
- package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.DZjhgNls.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.qdcp_qbo.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BHXoZhJ-.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.Cds_Vwj3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.CSl0HknT.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.DJMvAt5N.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BYQzBK9D.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BAvw7N4o.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/clone.zl2qolPE.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.Buf3seya.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.DMGGa3uA.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.DDjnwRmY.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.RwyrIr8Q.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.DRvQV16Z.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.Dw8W9BTk.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.DQT1Hnwf.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.6_Aky-ut.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.DHIwqnqN.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CGd_eJbn.js +106 -0
- package/dist/docs/assets/chunks/graph.ChMEylkh.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.Cd4gMyAz.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.D1uw7MXq.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.AWLXtelc.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.CagPhAn5.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.ClTBBkE_.js +1 -0
- package/dist/docs/assets/chunks/linear.SwS2rOLA.js +1 -0
- package/dist/docs/assets/chunks/min.By_x-Btb.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.By_RAMaP.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.DfAl9sy4.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.CNuqFRBj.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.DJ5CmTCl.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.D-T_AKJj.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BRn9WcrR.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.F12urmm7.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +1 -0
- package/dist/docs/assets/chunks/theme.zK3OJa_C.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.B7GiQBeC.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.D0niwuY_.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.1zhHNRsx.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DKaqpT7K.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.e8BPicch.js +7 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.js +32 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.lean.js +1 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.js +72 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.js +41 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.js +10 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.js +156 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.js +16 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.js +50 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.js +22 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.js +151 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.js +50 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.js +35 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.js +70 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.js +92 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.lean.js +1 -0
- package/dist/docs/assets/index.md.CVc_oOA3.js +27 -0
- package/dist/docs/assets/index.md.CVc_oOA3.lean.js +1 -0
- package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/dist/docs/assets/quickstart.md.wG4shE1f.js +168 -0
- package/dist/docs/assets/quickstart.md.wG4shE1f.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.js +32 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.js +23 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +97 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.js +63 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.js +56 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.js +58 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.js +45 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.js +11 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.js +14 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.js +9 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.js +15 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.js +10 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.js +90 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.lean.js +1 -0
- package/dist/docs/assets/style.C130MVnH.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.js +14 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.js +2 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.js +9 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +135 -0
- package/dist/docs/deployment.html +91 -0
- package/dist/docs/deployment.md +211 -0
- package/dist/docs/evals.html +131 -0
- package/dist/docs/evals.md +257 -0
- package/dist/docs/guides/agent-to-agent.html +100 -0
- package/dist/docs/guides/agent-to-agent.md +152 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +288 -0
- package/dist/docs/guides/cloud-agents.html +69 -0
- package/dist/docs/guides/cloud-agents.md +90 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +183 -0
- package/dist/docs/guides/github.html +215 -0
- package/dist/docs/guides/github.md +326 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +294 -0
- package/dist/docs/guides/grokbot-agents.html +75 -0
- package/dist/docs/guides/grokbot-agents.md +142 -0
- package/dist/docs/guides/hooks.html +109 -0
- package/dist/docs/guides/hooks.md +114 -0
- package/dist/docs/guides/improve.html +81 -0
- package/dist/docs/guides/improve.md +134 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +294 -0
- package/dist/docs/guides/mcp-oauth.html +109 -0
- package/dist/docs/guides/mcp-oauth.md +162 -0
- package/dist/docs/guides/opentelemetry.html +94 -0
- package/dist/docs/guides/opentelemetry.md +153 -0
- package/dist/docs/guides/slack.html +129 -0
- package/dist/docs/guides/slack.md +273 -0
- package/dist/docs/guides/webhooks.html +151 -0
- package/dist/docs/guides/webhooks.md +236 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +137 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +114 -0
- package/dist/docs/llms-full.txt +8439 -0
- package/dist/docs/llms.txt +62 -0
- package/dist/docs/quickstart.html +227 -0
- package/dist/docs/quickstart.md +306 -0
- package/dist/docs/reference/agent-config.html +91 -0
- package/dist/docs/reference/agent-config.md +188 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +116 -0
- package/dist/docs/reference/channels.html +82 -0
- package/dist/docs/reference/channels.md +198 -0
- package/dist/docs/reference/cli.html +156 -0
- package/dist/docs/reference/cli.md +904 -0
- package/dist/docs/reference/connections.html +122 -0
- package/dist/docs/reference/connections.md +272 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +287 -0
- package/dist/docs/reference/extensions.html +117 -0
- package/dist/docs/reference/extensions.md +193 -0
- package/dist/docs/reference/hooks.html +104 -0
- package/dist/docs/reference/hooks.md +190 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +231 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +63 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +42 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +115 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +50 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +170 -0
- package/dist/docs/reference/sessions.html +60 -0
- package/dist/docs/reference/sessions.md +160 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +75 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +62 -0
- package/dist/docs/reference/tools.html +149 -0
- package/dist/docs/reference/tools.md +324 -0
- package/dist/docs/templates/agentic-owners.html +73 -0
- package/dist/docs/templates/agentic-owners.md +95 -0
- package/dist/docs/templates/security-reviewer.html +61 -0
- package/dist/docs/templates/security-reviewer.md +85 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +78 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +77 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +97 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +143 -0
- package/dist/docs/vp-icons.css +0 -0
- package/dist/evals/assertions.d.ts +199 -0
- package/dist/evals/assertions.d.ts.map +1 -0
- package/dist/evals/assertions.js +459 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +187 -0
- package/dist/evals/judge.d.ts +133 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +224 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +124 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +142 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +220 -0
- package/dist/evals/results.d.ts +103 -0
- package/dist/evals/results.d.ts.map +1 -0
- package/dist/evals/results.js +27 -0
- package/dist/evals/run-facts.d.ts +77 -0
- package/dist/evals/run-facts.d.ts.map +1 -0
- package/dist/evals/run-facts.js +214 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +292 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- 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 +280 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +81 -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/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +53 -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 +37 -0
- 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 +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- 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/reply.js +35 -0
- package/dist/extensions/improve/extension.d.ts +48 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +43 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/extensions/jev/extension.d.ts +43 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +47 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +167 -0
- package/dist/extensions/jev/skills/gated-write.md +25 -0
- package/dist/extensions/jev/skills/questions.md +33 -0
- package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
- package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/tools/evaluate.js +83 -0
- package/dist/extensions/slack-communication/extension.d.ts +28 -0
- package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
- package/dist/extensions/slack-communication/extension.js +32 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
- package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/edit-message.js +37 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-card.js +25 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-file.js +75 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-update.js +36 -0
- package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/react.js +27 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/set-status.js +18 -0
- package/dist/extensions.d.ts +85 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +140 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
- package/dist/files-backends/agent-store-presigned-url.js +223 -0
- package/dist/files-backends/cursor-hosted.d.ts +126 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +978 -0
- package/dist/files-backends/local-fs.d.ts +33 -0
- package/dist/files-backends/local-fs.d.ts.map +1 -0
- package/dist/files-backends/local-fs.js +195 -0
- package/dist/files.d.ts +225 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +152 -0
- package/dist/filesystem.d.ts +484 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1698 -0
- package/dist/hooks.d.ts +25 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +25 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/internal/advertise-tools.d.ts +95 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +265 -0
- package/dist/internal/approval-gate.d.ts +33 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +80 -0
- package/dist/internal/artifacts-store.d.ts +125 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +737 -0
- package/dist/internal/as-of.d.ts +37 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +207 -0
- package/dist/internal/auth.d.ts +12 -0
- package/dist/internal/auth.d.ts.map +1 -0
- package/dist/internal/auth.js +34 -0
- package/dist/internal/authored-alias-hooks.d.ts +42 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +93 -0
- package/dist/internal/authored-loaders.d.ts +50 -0
- package/dist/internal/authored-loaders.d.ts.map +1 -0
- package/dist/internal/authored-loaders.js +182 -0
- package/dist/internal/bounded-int.d.ts +11 -0
- package/dist/internal/bounded-int.d.ts.map +1 -0
- package/dist/internal/bounded-int.js +13 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -0
- package/dist/internal/brand.d.ts +6 -0
- package/dist/internal/brand.d.ts.map +1 -0
- package/dist/internal/brand.js +17 -0
- package/dist/internal/browser-origin-guard.d.ts +19 -0
- package/dist/internal/browser-origin-guard.d.ts.map +1 -0
- package/dist/internal/browser-origin-guard.js +51 -0
- package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
- package/dist/internal/builtin-tools/artifacts.js +66 -0
- package/dist/internal/builtin-tools/index.d.ts +17 -0
- package/dist/internal/builtin-tools/index.d.ts.map +1 -0
- package/dist/internal/builtin-tools/index.js +40 -0
- package/dist/internal/builtin-tools/reminders.d.ts +9 -0
- package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
- package/dist/internal/builtin-tools/reminders.js +134 -0
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +75 -0
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +62 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +69 -0
- package/dist/internal/chat-client.d.ts +45 -0
- package/dist/internal/chat-client.d.ts.map +1 -0
- package/dist/internal/chat-client.js +478 -0
- package/dist/internal/cli-ax.d.ts +233 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1864 -0
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +360 -0
- package/dist/internal/cli-convert-automation.d.ts +39 -0
- package/dist/internal/cli-convert-automation.d.ts.map +1 -0
- package/dist/internal/cli-convert-automation.js +281 -0
- package/dist/internal/cli-cursor.d.ts +38 -0
- package/dist/internal/cli-cursor.d.ts.map +1 -0
- package/dist/internal/cli-cursor.js +226 -0
- package/dist/internal/cli-deploy.d.ts +164 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +1930 -0
- package/dist/internal/cli-docs.d.ts +34 -0
- package/dist/internal/cli-docs.d.ts.map +1 -0
- package/dist/internal/cli-docs.js +173 -0
- package/dist/internal/cli-github.d.ts +47 -0
- package/dist/internal/cli-github.d.ts.map +1 -0
- package/dist/internal/cli-github.js +639 -0
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +379 -0
- package/dist/internal/cli-images.d.ts +68 -0
- package/dist/internal/cli-images.d.ts.map +1 -0
- package/dist/internal/cli-images.js +604 -0
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +49 -0
- package/dist/internal/cli-mcp-oauth.d.ts +51 -0
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
- package/dist/internal/cli-mcp-oauth.js +318 -0
- package/dist/internal/cli-mcp.d.ts +75 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +684 -0
- package/dist/internal/cli-skills.d.ts +21 -0
- package/dist/internal/cli-skills.d.ts.map +1 -0
- package/dist/internal/cli-skills.js +77 -0
- package/dist/internal/cli-slack-manual.d.ts +42 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +325 -0
- package/dist/internal/cli-slack.d.ts +59 -0
- package/dist/internal/cli-slack.d.ts.map +1 -0
- package/dist/internal/cli-slack.js +695 -0
- package/dist/internal/cloud-merge.d.ts +25 -0
- package/dist/internal/cloud-merge.d.ts.map +1 -0
- package/dist/internal/cloud-merge.js +36 -0
- package/dist/internal/cloud-turn-cost.d.ts +42 -0
- package/dist/internal/cloud-turn-cost.d.ts.map +1 -0
- package/dist/internal/cloud-turn-cost.js +113 -0
- package/dist/internal/continuation-channel.d.ts +48 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -0
- package/dist/internal/continuation-channel.js +154 -0
- package/dist/internal/continuation-identity.d.ts +113 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +749 -0
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +342 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
- package/dist/internal/convert-automation/convert-workflow.js +998 -0
- package/dist/internal/convert-automation/slug.d.ts +9 -0
- package/dist/internal/convert-automation/slug.d.ts.map +1 -0
- package/dist/internal/convert-automation/slug.js +28 -0
- package/dist/internal/convert-automation/types.d.ts +202 -0
- package/dist/internal/convert-automation/types.d.ts.map +1 -0
- package/dist/internal/convert-automation/types.js +13 -0
- package/dist/internal/cron.d.ts +17 -0
- package/dist/internal/cron.d.ts.map +1 -0
- package/dist/internal/cron.js +60 -0
- package/dist/internal/cursor/account-mcp.d.ts +135 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
- package/dist/internal/cursor/account-mcp.js +510 -0
- package/dist/internal/cursor/backend-client.d.ts +224 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +720 -0
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +195 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +475 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +44 -0
- package/dist/internal/cursor/github-credentials.d.ts +44 -0
- package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
- package/dist/internal/cursor/github-credentials.js +191 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +81 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +63 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +112 -0
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +97 -0
- package/dist/internal/cursor/store-api-client.d.ts +82 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +226 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +66 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +241 -0
- package/dist/internal/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +43 -0
- package/dist/internal/cursor-deployment-relay.d.ts +95 -0
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
- package/dist/internal/cursor-deployment-relay.js +233 -0
- package/dist/internal/cursor-event-relay.d.ts +243 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -0
- package/dist/internal/cursor-event-relay.js +424 -0
- package/dist/internal/cursor-relay-core.d.ts +160 -0
- package/dist/internal/cursor-relay-core.d.ts.map +1 -0
- package/dist/internal/cursor-relay-core.js +470 -0
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +576 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +987 -0
- package/dist/internal/deploy-manifest.d.ts +135 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +231 -0
- package/dist/internal/deploy-source.d.ts +38 -0
- package/dist/internal/deploy-source.d.ts.map +1 -0
- package/dist/internal/deploy-source.js +136 -0
- package/dist/internal/describe-error.d.ts +4 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +29 -0
- package/dist/internal/dev-mode.d.ts +13 -0
- package/dist/internal/dev-mode.d.ts.map +1 -0
- package/dist/internal/dev-mode.js +17 -0
- package/dist/internal/discovery/agent-config.d.ts +48 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +224 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +326 -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 +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +429 -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 +549 -0
- package/dist/internal/discovery/extension-overlay.d.ts +31 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +173 -0
- package/dist/internal/discovery/extensions.d.ts +27 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +352 -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 +61 -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 +168 -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 +104 -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 +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +290 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +65 -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 +97 -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 +118 -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 +26 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +138 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +129 -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 +155 -0
- package/dist/internal/discovery.d.ts +15 -0
- package/dist/internal/discovery.d.ts.map +1 -0
- package/dist/internal/discovery.js +13 -0
- package/dist/internal/distribution.d.ts +65 -0
- package/dist/internal/distribution.d.ts.map +1 -0
- package/dist/internal/distribution.js +102 -0
- package/dist/internal/docs-site.d.ts +41 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +234 -0
- package/dist/internal/duration.d.ts +8 -0
- package/dist/internal/duration.d.ts.map +1 -0
- package/dist/internal/duration.js +35 -0
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/eval-judge-model.d.ts +59 -0
- package/dist/internal/eval-judge-model.d.ts.map +1 -0
- package/dist/internal/eval-judge-model.js +129 -0
- package/dist/internal/eval-run-store.d.ts +119 -0
- package/dist/internal/eval-run-store.d.ts.map +1 -0
- package/dist/internal/eval-run-store.js +468 -0
- package/dist/internal/eval-runner.d.ts +98 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +615 -0
- package/dist/internal/evals-client.d.ts +104 -0
- package/dist/internal/evals-client.d.ts.map +1 -0
- package/dist/internal/evals-client.js +303 -0
- package/dist/internal/event-log.d.ts +94 -0
- package/dist/internal/event-log.d.ts.map +1 -0
- package/dist/internal/event-log.js +347 -0
- package/dist/internal/event-mapper.d.ts +123 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +370 -0
- package/dist/internal/expected-delivery-failure.d.ts +3 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
- package/dist/internal/expected-delivery-failure.js +28 -0
- package/dist/internal/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +172 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +212 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/nearest.d.ts +14 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +101 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +204 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +631 -0
- package/dist/internal/filesystem/walk.d.ts +77 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +350 -0
- package/dist/internal/framework-file-storage.d.ts +75 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +338 -0
- package/dist/internal/framework-storage-selection.d.ts +66 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +123 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +87 -0
- package/dist/internal/github-fanout.d.ts +32 -0
- package/dist/internal/github-fanout.d.ts.map +1 -0
- package/dist/internal/github-fanout.js +120 -0
- package/dist/internal/guest-network.d.ts +98 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +326 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +91 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +199 -0
- package/dist/internal/host-files.d.ts +29 -0
- package/dist/internal/host-files.d.ts.map +1 -0
- package/dist/internal/host-files.js +274 -0
- package/dist/internal/host-kv.d.ts +21 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +77 -0
- package/dist/internal/host-otel.d.ts +25 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +162 -0
- package/dist/internal/host-platforms.d.ts +58 -0
- package/dist/internal/host-platforms.d.ts.map +1 -0
- package/dist/internal/host-platforms.js +126 -0
- package/dist/internal/hosted-admission-adapter.d.ts +36 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-catch-protocol.d.ts +51 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +87 -0
- package/dist/internal/hosted-catch.d.ts +40 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +146 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +199 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +516 -0
- package/dist/internal/hosted-delivery.d.ts +110 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +768 -0
- package/dist/internal/hosted-execution-diag.d.ts +75 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +220 -0
- package/dist/internal/hosted-execution-flush.d.ts +50 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +71 -0
- package/dist/internal/hosted-execution-latency.d.ts +80 -0
- package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
- package/dist/internal/hosted-execution-latency.js +218 -0
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +83 -0
- package/dist/internal/hosting.d.ts +53 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +93 -0
- package/dist/internal/http-channel-define.d.ts +11 -0
- package/dist/internal/http-channel-define.d.ts.map +1 -0
- package/dist/internal/http-channel-define.js +18 -0
- package/dist/internal/http-channel.d.ts +54 -0
- package/dist/internal/http-channel.d.ts.map +1 -0
- package/dist/internal/http-channel.js +534 -0
- package/dist/internal/http-control-plane-session.d.ts +34 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +93 -0
- package/dist/internal/ids.d.ts +19 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +34 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
- package/dist/internal/incoming-headers-to-fetch.js +41 -0
- package/dist/internal/init-interview.d.ts +67 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +295 -0
- package/dist/internal/init-project.d.ts +175 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +531 -0
- package/dist/internal/init-scaffold.d.ts +9 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +172 -0
- package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
- package/dist/internal/inline-stdio-define-stub.js +4 -0
- package/dist/internal/inline-stdio-mcp.d.ts +34 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
- package/dist/internal/inline-stdio-mcp.js +176 -0
- package/dist/internal/install-cursor-skills.d.ts +164 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +498 -0
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts +25 -0
- package/dist/internal/json-schema.d.ts.map +1 -0
- package/dist/internal/json-schema.js +76 -0
- package/dist/internal/legacy-command-guard.d.ts +22 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +51 -0
- package/dist/internal/listen-port.d.ts +22 -0
- package/dist/internal/listen-port.d.ts.map +1 -0
- package/dist/internal/listen-port.js +77 -0
- package/dist/internal/local-control-plane.d.ts +59 -0
- package/dist/internal/local-control-plane.d.ts.map +1 -0
- package/dist/internal/local-control-plane.js +351 -0
- package/dist/internal/local-env.d.ts +10 -0
- package/dist/internal/local-env.d.ts.map +1 -0
- package/dist/internal/local-env.js +55 -0
- package/dist/internal/local-ingress.d.ts +35 -0
- package/dist/internal/local-ingress.d.ts.map +1 -0
- package/dist/internal/local-ingress.js +44 -0
- package/dist/internal/log-ring.d.ts +23 -0
- package/dist/internal/log-ring.d.ts.map +1 -0
- package/dist/internal/log-ring.js +42 -0
- package/dist/internal/logs-client.d.ts +79 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +350 -0
- package/dist/internal/map-pool.d.ts +11 -0
- package/dist/internal/map-pool.d.ts.map +1 -0
- package/dist/internal/map-pool.js +48 -0
- package/dist/internal/mcp-endpoint.d.ts +72 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +530 -0
- package/dist/internal/mcp-host.d.ts +84 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +391 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +90 -0
- package/dist/internal/mcp-oauth.d.ts +118 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -0
- package/dist/internal/mcp-oauth.js +450 -0
- package/dist/internal/net.d.ts +5 -0
- package/dist/internal/net.d.ts.map +1 -0
- package/dist/internal/net.js +28 -0
- package/dist/internal/open-browser.d.ts +5 -0
- package/dist/internal/open-browser.d.ts.map +1 -0
- package/dist/internal/open-browser.js +34 -0
- package/dist/internal/otel/attrs.d.ts +7 -0
- package/dist/internal/otel/attrs.d.ts.map +1 -0
- package/dist/internal/otel/attrs.js +13 -0
- package/dist/internal/otel/collector.d.ts +43 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +650 -0
- package/dist/internal/otel/config.d.ts +40 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +231 -0
- package/dist/internal/otel/http.d.ts +13 -0
- package/dist/internal/otel/http.d.ts.map +1 -0
- package/dist/internal/otel/http.js +95 -0
- 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 +55 -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 +46 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +333 -0
- package/dist/internal/package-inline-stdio.d.ts +12 -0
- package/dist/internal/package-inline-stdio.d.ts.map +1 -0
- package/dist/internal/package-inline-stdio.js +99 -0
- package/dist/internal/peer-connections.d.ts +44 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +67 -0
- package/dist/internal/platform-schedule-sync.d.ts +17 -0
- package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
- package/dist/internal/platform-schedule-sync.js +70 -0
- package/dist/internal/platform-timers.d.ts +35 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +277 -0
- package/dist/internal/playground/static.d.ts +52 -0
- package/dist/internal/playground/static.d.ts.map +1 -0
- package/dist/internal/playground/static.js +231 -0
- package/dist/internal/playground/toolchain.d.ts +57 -0
- package/dist/internal/playground/toolchain.d.ts.map +1 -0
- package/dist/internal/playground/toolchain.js +229 -0
- package/dist/internal/playground-proxy.d.ts +69 -0
- package/dist/internal/playground-proxy.d.ts.map +1 -0
- package/dist/internal/playground-proxy.js +474 -0
- package/dist/internal/process-memory-telemetry.d.ts +89 -0
- package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
- package/dist/internal/process-memory-telemetry.js +244 -0
- package/dist/internal/project-layout.d.ts +7 -0
- package/dist/internal/project-layout.d.ts.map +1 -0
- package/dist/internal/project-layout.js +24 -0
- package/dist/internal/prompt-context.d.ts +38 -0
- package/dist/internal/prompt-context.d.ts.map +1 -0
- package/dist/internal/prompt-context.js +89 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +246 -0
- package/dist/internal/reminder-runner.d.ts +208 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1231 -0
- package/dist/internal/reminder-schedule.d.ts +25 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +82 -0
- package/dist/internal/reminder-store.d.ts +78 -0
- package/dist/internal/reminder-store.d.ts.map +1 -0
- package/dist/internal/reminder-store.js +126 -0
- package/dist/internal/request-error-status.d.ts +14 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +76 -0
- package/dist/internal/request-headers.d.ts +11 -0
- package/dist/internal/request-headers.d.ts.map +1 -0
- package/dist/internal/request-headers.js +14 -0
- package/dist/internal/resolve-prod-target.d.ts +84 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +259 -0
- package/dist/internal/resolved-connections.d.ts +62 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +93 -0
- package/dist/internal/router.d.ts +33 -0
- package/dist/internal/router.d.ts.map +1 -0
- package/dist/internal/router.js +93 -0
- package/dist/internal/run-client.d.ts +68 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +239 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +24 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +54 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +28 -0
- package/dist/internal/schedule-runner.d.ts +31 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +127 -0
- package/dist/internal/scm/pr-url.d.ts +56 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +152 -0
- package/dist/internal/sdk-runner.d.ts +190 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +714 -0
- package/dist/internal/serve-restart.d.ts +42 -0
- package/dist/internal/serve-restart.d.ts.map +1 -0
- package/dist/internal/serve-restart.js +85 -0
- package/dist/internal/server.d.ts +34 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2464 -0
- package/dist/internal/session-cost.d.ts +50 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +157 -0
- package/dist/internal/session-engine.d.ts +912 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4493 -0
- package/dist/internal/session-links.d.ts +14 -0
- package/dist/internal/session-links.d.ts.map +1 -0
- package/dist/internal/session-links.js +67 -0
- package/dist/internal/session-run-log.d.ts +122 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +345 -0
- package/dist/internal/session-store.d.ts +73 -0
- package/dist/internal/session-store.d.ts.map +1 -0
- package/dist/internal/session-store.js +310 -0
- package/dist/internal/session-urls.d.ts +10 -0
- package/dist/internal/session-urls.d.ts.map +1 -0
- package/dist/internal/session-urls.js +25 -0
- package/dist/internal/sessions-client.d.ts +50 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +207 -0
- package/dist/internal/skill-catalog.d.ts +28 -0
- package/dist/internal/skill-catalog.d.ts.map +1 -0
- package/dist/internal/skill-catalog.js +41 -0
- package/dist/internal/skills-sync.d.ts +24 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +56 -0
- package/dist/internal/slack-provision-client.d.ts +198 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +346 -0
- package/dist/internal/slack-thread-key.d.ts +7 -0
- package/dist/internal/slack-thread-key.d.ts.map +1 -0
- package/dist/internal/slack-thread-key.js +10 -0
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/internal/storage-coordinator.d.ts +203 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +705 -0
- package/dist/internal/storage-roles.d.ts +78 -0
- package/dist/internal/storage-roles.d.ts.map +1 -0
- package/dist/internal/storage-roles.js +24 -0
- package/dist/internal/storage.d.ts +2 -0
- package/dist/internal/storage.d.ts.map +1 -0
- package/dist/internal/storage.js +1 -0
- package/dist/internal/store-api-protocol.d.ts +134 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +124 -0
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/stream-progress.d.ts +14 -0
- package/dist/internal/stream-progress.d.ts.map +1 -0
- package/dist/internal/stream-progress.js +229 -0
- package/dist/internal/terminal-style.d.ts +40 -0
- package/dist/internal/terminal-style.d.ts.map +1 -0
- package/dist/internal/terminal-style.js +94 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +70 -0
- package/dist/internal/tool-policy.d.ts +110 -0
- package/dist/internal/tool-policy.d.ts.map +1 -0
- package/dist/internal/tool-policy.js +138 -0
- package/dist/internal/tool-result.d.ts +20 -0
- package/dist/internal/tool-result.d.ts.map +1 -0
- package/dist/internal/tool-result.js +45 -0
- package/dist/internal/trajectory.d.ts +69 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +351 -0
- package/dist/internal/turn-cost.d.ts +41 -0
- package/dist/internal/turn-cost.d.ts.map +1 -0
- package/dist/internal/turn-cost.js +109 -0
- package/dist/internal/turn-governor.d.ts +54 -0
- package/dist/internal/turn-governor.d.ts.map +1 -0
- package/dist/internal/turn-governor.js +111 -0
- package/dist/internal/turn-lease-store.d.ts +44 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +139 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +427 -0
- package/dist/internal/v2-hosting.d.ts +31 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +33 -0
- package/dist/internal/workspace-sync.d.ts +47 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +104 -0
- package/dist/internal/workspace.d.ts +151 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +455 -0
- package/dist/kv/memory-kv.d.ts +24 -0
- package/dist/kv/memory-kv.d.ts.map +1 -0
- package/dist/kv/memory-kv.js +104 -0
- package/dist/kv.d.ts +18 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +16 -0
- package/dist/memory.d.ts +138 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +401 -0
- package/dist/otel-public.d.ts +7 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +131 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +186 -0
- package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
- package/dist/playground/assets/index-BMV_IcEE.css +1 -0
- package/dist/playground/assets/index-FFdUqTt_.js +71 -0
- package/dist/playground/index.html +17 -0
- package/dist/prompt.d.ts +39 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +70 -0
- package/dist/reminders.d.ts +42 -0
- package/dist/reminders.d.ts.map +1 -0
- package/dist/reminders.js +45 -0
- package/dist/schedules.d.ts +23 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/schedules.js +26 -0
- package/dist/skills.d.ts +22 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +22 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts +82 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +171 -0
- package/dist/storage-backends/cursor-hosted.d.ts +107 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +278 -0
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +254 -0
- package/dist/storage-protocol.d.ts +142 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +201 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +154 -0
- package/dist/tools.d.ts +132 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +77 -0
- package/dist/types.d.ts +3375 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +189 -0
- package/docs/README.md +119 -0
- package/docs/building-with-agents.md +140 -0
- package/docs/deployment.md +216 -0
- package/docs/evals.md +262 -0
- package/docs/guides/agent-to-agent.md +157 -0
- package/docs/guides/bitbucket.md +293 -0
- package/docs/guides/cloud-agents.md +95 -0
- package/docs/guides/convert-automation.md +188 -0
- package/docs/guides/github.md +331 -0
- package/docs/guides/gitlab.md +299 -0
- package/docs/guides/grokbot-agents.md +147 -0
- package/docs/guides/hooks.md +119 -0
- package/docs/guides/improve.md +139 -0
- package/docs/guides/jev.md +299 -0
- package/docs/guides/mcp-oauth.md +167 -0
- package/docs/guides/opentelemetry.md +158 -0
- package/docs/guides/slack.md +278 -0
- package/docs/guides/webhooks.md +241 -0
- package/docs/hillclimbing.md +142 -0
- package/docs/quickstart.md +311 -0
- package/docs/reference/agent-config.md +193 -0
- package/docs/reference/artifacts.md +121 -0
- package/docs/reference/channels.md +203 -0
- package/docs/reference/cli.md +909 -0
- package/docs/reference/connections.md +277 -0
- package/docs/reference/evals.md +292 -0
- package/docs/reference/extensions.md +198 -0
- package/docs/reference/hooks.md +195 -0
- package/docs/reference/http-api.md +236 -0
- package/docs/reference/instructions.md +68 -0
- package/docs/reference/playground.md +47 -0
- package/docs/reference/project-layout.md +120 -0
- package/docs/reference/prompt.md +55 -0
- package/docs/reference/schedules.md +175 -0
- package/docs/reference/sessions.md +165 -0
- package/docs/reference/skills.md +80 -0
- package/docs/reference/subagents.md +67 -0
- package/docs/reference/tools.md +329 -0
- package/docs/templates/agentic-owners.md +100 -0
- package/docs/templates/security-reviewer.md +90 -0
- package/docs/templates/thermo-quality-review.md +83 -0
- package/docs/templates/thermo-review.md +82 -0
- package/docs/templates/triage.md +102 -0
- package/docs/troubleshooting.md +148 -0
- package/package.json +384 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +170 -0
- package/skills/debug/SKILL.md +43 -0
- package/skills/deploy/SKILL.md +169 -0
- package/skills/evals/SKILL.md +145 -0
- package/skills/framework-map/SKILL.md +125 -0
- package/skills/github/SKILL.md +110 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +84 -0
- package/skills/otel/SKILL.md +50 -0
- package/skills/setup-slack/SKILL.md +149 -0
- package/src/artifacts.ts +65 -0
- package/src/bin/agent-serve.ts +1833 -0
- package/src/channels/bitbucket/api.ts +891 -0
- package/src/channels/bitbucket/binding.ts +417 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +162 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +519 -0
- package/src/channels/bitbucket/checks.ts +146 -0
- package/src/channels/bitbucket/cursor-account.ts +106 -0
- package/src/channels/bitbucket/defaults.ts +100 -0
- package/src/channels/bitbucket/events.ts +74 -0
- package/src/channels/bitbucket/index.ts +51 -0
- package/src/channels/bitbucket/replay.ts +421 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +261 -0
- package/src/channels/change-monitors/change-monitors-channel.ts +63 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +42 -0
- package/src/channels/checks.ts +185 -0
- package/src/channels/deployments/deployments-channel.ts +224 -0
- package/src/channels/deployments/index.ts +25 -0
- package/src/channels/deployments/types.ts +92 -0
- package/src/channels/github/api.ts +526 -0
- package/src/channels/github/auth.ts +254 -0
- package/src/channels/github/binding.ts +233 -0
- package/src/channels/github/checks.ts +145 -0
- package/src/channels/github/cursor-account.ts +303 -0
- package/src/channels/github/defaults.ts +168 -0
- package/src/channels/github/events.ts +67 -0
- package/src/channels/github/forward.ts +359 -0
- package/src/channels/github/github-channel.ts +2334 -0
- package/src/channels/github/index.ts +54 -0
- package/src/channels/github/progress.ts +365 -0
- package/src/channels/github/replay.ts +372 -0
- package/src/channels/github/state.ts +124 -0
- package/src/channels/github/types.ts +590 -0
- package/src/channels/gitlab/api.ts +329 -0
- package/src/channels/gitlab/binding.ts +231 -0
- package/src/channels/gitlab/checks.ts +228 -0
- package/src/channels/gitlab/cursor-account.ts +105 -0
- package/src/channels/gitlab/defaults.ts +80 -0
- package/src/channels/gitlab/events.ts +37 -0
- package/src/channels/gitlab/gitlab-channel.ts +160 -0
- package/src/channels/gitlab/gitlab-webhook.ts +509 -0
- package/src/channels/gitlab/index.ts +44 -0
- package/src/channels/gitlab/replay.ts +328 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +247 -0
- package/src/channels/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +45 -0
- package/src/channels/issues/types.ts +38 -0
- package/src/channels/origin/api.ts +507 -0
- package/src/channels/origin/binding.ts +114 -0
- package/src/channels/origin/checks.ts +250 -0
- package/src/channels/origin/cursor-account.ts +58 -0
- package/src/channels/origin/defaults.ts +140 -0
- package/src/channels/origin/events.ts +35 -0
- package/src/channels/origin/index.ts +35 -0
- package/src/channels/origin/origin-channel.ts +815 -0
- package/src/channels/origin/origin-webhook.ts +296 -0
- package/src/channels/origin/reactions.ts +72 -0
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +295 -0
- package/src/channels/slack/agentic-delivery.ts +634 -0
- package/src/channels/slack/agentic-posted.ts +135 -0
- package/src/channels/slack/agentic-signals.ts +231 -0
- package/src/channels/slack/api.ts +761 -0
- package/src/channels/slack/approvals.ts +279 -0
- package/src/channels/slack/assistant.ts +76 -0
- package/src/channels/slack/attachments.ts +596 -0
- package/src/channels/slack/auth.ts +127 -0
- package/src/channels/slack/blocks.ts +131 -0
- package/src/channels/slack/bot-mentions.ts +318 -0
- package/src/channels/slack/channel-watch.ts +314 -0
- package/src/channels/slack/cli-project.ts +249 -0
- package/src/channels/slack/code-fences.ts +171 -0
- package/src/channels/slack/constants.ts +38 -0
- package/src/channels/slack/credentials.ts +88 -0
- package/src/channels/slack/defaults.ts +714 -0
- package/src/channels/slack/dispatch.ts +1060 -0
- package/src/channels/slack/doctor.ts +338 -0
- package/src/channels/slack/eval-directive.ts +306 -0
- package/src/channels/slack/event-id-dedupe.ts +30 -0
- package/src/channels/slack/external-policy.ts +75 -0
- package/src/channels/slack/footer.ts +106 -0
- package/src/channels/slack/inbound.ts +416 -0
- package/src/channels/slack/index.ts +53 -0
- package/src/channels/slack/init.ts +169 -0
- package/src/channels/slack/interactive.ts +406 -0
- package/src/channels/slack/links.ts +23 -0
- package/src/channels/slack/live-delivery.ts +489 -0
- package/src/channels/slack/log.ts +70 -0
- package/src/channels/slack/manifest.ts +239 -0
- package/src/channels/slack/message-body.ts +82 -0
- package/src/channels/slack/nudge-carrier.ts +224 -0
- package/src/channels/slack/nudge-store.ts +334 -0
- package/src/channels/slack/paint-start.ts +93 -0
- package/src/channels/slack/placeholder.ts +358 -0
- package/src/channels/slack/pr-ref.ts +74 -0
- package/src/channels/slack/progress-delivery.ts +138 -0
- package/src/channels/slack/reasoning-card.ts +125 -0
- package/src/channels/slack/reasoning-chip.ts +41 -0
- package/src/channels/slack/recording-sink.ts +167 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +279 -0
- package/src/channels/slack/setup.ts +125 -0
- package/src/channels/slack/slack-channel.ts +744 -0
- package/src/channels/slack/socket-mode.ts +140 -0
- package/src/channels/slack/stop.ts +25 -0
- package/src/channels/slack/stream.ts +66 -0
- package/src/channels/slack/thread-context.ts +485 -0
- package/src/channels/slack/tool-approval-events.ts +233 -0
- package/src/channels/slack/tool-cards.ts +198 -0
- package/src/channels/slack/tool-chip.ts +34 -0
- package/src/channels/slack/types.ts +782 -0
- package/src/channels/slack/upload.ts +137 -0
- package/src/channels.ts +543 -0
- package/src/connections.ts +153 -0
- package/src/dashboard-session-url.ts +30 -0
- package/src/evals/assertions.ts +688 -0
- package/src/evals/expect.ts +250 -0
- package/src/evals/judge.ts +329 -0
- package/src/evals/loaders.ts +111 -0
- package/src/evals/matchers.ts +223 -0
- package/src/evals/reporters.ts +257 -0
- package/src/evals/results.ts +130 -0
- package/src/evals/run-facts.ts +306 -0
- package/src/evals.ts +709 -0
- package/src/extensions/cursor-cloud-agents/extension.ts +114 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +386 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +98 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +68 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +19 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +47 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +60 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions/improve/extension.ts +69 -0
- package/src/extensions/improve/skills/yourself.ts +50 -0
- package/src/extensions/jev/extension.ts +95 -0
- package/src/extensions/jev/lib/evaluate.ts +266 -0
- package/src/extensions/jev/skills/gated-write.md +25 -0
- package/src/extensions/jev/skills/questions.md +33 -0
- package/src/extensions/jev/tools/evaluate.ts +82 -0
- package/src/extensions/slack-communication/evals/harness.ts +705 -0
- package/src/extensions/slack-communication/evals/slack-communication.eval.ts +830 -0
- package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +172 -0
- package/src/extensions/slack-communication/extension.ts +44 -0
- package/src/extensions/slack-communication/skills/slack-voice.ts +56 -0
- package/src/extensions/slack-communication/tools/delete-message.ts +33 -0
- package/src/extensions/slack-communication/tools/edit-message.ts +42 -0
- package/src/extensions/slack-communication/tools/post-card.ts +28 -0
- package/src/extensions/slack-communication/tools/post-file.ts +82 -0
- package/src/extensions/slack-communication/tools/post-update.ts +40 -0
- package/src/extensions/slack-communication/tools/react.ts +30 -0
- package/src/extensions/slack-communication/tools/set-status.ts +21 -0
- package/src/extensions.ts +179 -0
- package/src/files-backends/agent-store-presigned-url.ts +11 -0
- package/src/files-backends/cursor-hosted.ts +1212 -0
- package/src/files-backends/local-fs.ts +163 -0
- package/src/files.ts +293 -0
- package/src/filesystem.ts +2005 -0
- package/src/hooks.ts +30 -0
- package/src/index.ts +259 -0
- package/src/internal/advertise-tools.ts +370 -0
- package/src/internal/approval-gate.ts +103 -0
- package/src/internal/artifacts-store.ts +825 -0
- package/src/internal/as-of.ts +257 -0
- package/src/internal/auth.ts +46 -0
- package/src/internal/authored-alias-hooks.ts +138 -0
- package/src/internal/authored-loaders.ts +188 -0
- package/src/internal/bounded-int.ts +24 -0
- package/src/internal/bounded.ts +25 -0
- package/src/internal/brand.ts +28 -0
- package/src/internal/browser-origin-guard.ts +67 -0
- package/src/internal/builtin-tools/artifacts.ts +62 -0
- package/src/internal/builtin-tools/index.ts +53 -0
- package/src/internal/builtin-tools/reminders.ts +145 -0
- package/src/internal/channel-dispatch.ts +129 -0
- package/src/internal/channel-route-dispatch.ts +58 -0
- package/src/internal/channel-state.ts +83 -0
- package/src/internal/chat-client.ts +594 -0
- package/src/internal/cli-ax.ts +2273 -0
- package/src/internal/cli-bitbucket.ts +438 -0
- package/src/internal/cli-convert-automation.ts +335 -0
- package/src/internal/cli-cursor.ts +282 -0
- package/src/internal/cli-deploy.ts +2486 -0
- package/src/internal/cli-docs.ts +192 -0
- package/src/internal/cli-github.ts +806 -0
- package/src/internal/cli-gitlab.ts +452 -0
- package/src/internal/cli-images.ts +672 -0
- package/src/internal/cli-manifest.ts +56 -0
- package/src/internal/cli-mcp-oauth.ts +395 -0
- package/src/internal/cli-mcp.ts +808 -0
- package/src/internal/cli-skills.ts +99 -0
- package/src/internal/cli-slack-manual.ts +418 -0
- package/src/internal/cli-slack.ts +874 -0
- package/src/internal/cloud-merge.ts +51 -0
- package/src/internal/cloud-turn-cost.ts +159 -0
- package/src/internal/continuation-channel.ts +233 -0
- package/src/internal/continuation-identity.ts +935 -0
- package/src/internal/conversation-mirror.ts +423 -0
- package/src/internal/convert-automation/convert-workflow.ts +1377 -0
- package/src/internal/convert-automation/slug.ts +29 -0
- package/src/internal/convert-automation/types.ts +212 -0
- package/src/internal/cron.ts +76 -0
- package/src/internal/cursor/account-mcp.ts +692 -0
- package/src/internal/cursor/backend-client.ts +978 -0
- package/src/internal/cursor/bound-secret-file.ts +101 -0
- package/src/internal/cursor/credentials.ts +560 -0
- package/src/internal/cursor/cursor-api-transport.ts +65 -0
- package/src/internal/cursor/github-credentials.ts +228 -0
- package/src/internal/cursor/hosted-bound-secrets.ts +71 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +100 -0
- package/src/internal/cursor/hosted-store-secrets.ts +152 -0
- package/src/internal/cursor/session-token.ts +111 -0
- package/src/internal/cursor/store-api-client.ts +323 -0
- package/src/internal/cursor-account-mcp-auth.ts +303 -0
- package/src/internal/cursor-agent-template.ts +50 -0
- package/src/internal/cursor-deployment-relay.ts +315 -0
- package/src/internal/cursor-event-relay.ts +675 -0
- package/src/internal/cursor-relay-core.ts +563 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +1504 -0
- package/src/internal/deploy-manifest.ts +361 -0
- package/src/internal/deploy-source.ts +144 -0
- package/src/internal/describe-error.ts +32 -0
- package/src/internal/dev-mode.ts +20 -0
- package/src/internal/discovery/agent-config.ts +288 -0
- package/src/internal/discovery/agent.ts +381 -0
- package/src/internal/discovery/channels.ts +100 -0
- package/src/internal/discovery/connections.ts +505 -0
- package/src/internal/discovery/context.ts +38 -0
- package/src/internal/discovery/cursor-plugin.ts +628 -0
- package/src/internal/discovery/extension-overlay.ts +247 -0
- package/src/internal/discovery/extensions.ts +490 -0
- package/src/internal/discovery/fs.ts +103 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +174 -0
- package/src/internal/discovery/instructions.ts +98 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +319 -0
- package/src/internal/discovery/reminders.ts +65 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +34 -0
- package/src/internal/discovery/services.ts +151 -0
- package/src/internal/discovery/skills.ts +174 -0
- package/src/internal/discovery/subagent.ts +138 -0
- package/src/internal/discovery/tools.ts +170 -0
- package/src/internal/discovery.ts +27 -0
- package/src/internal/distribution.ts +126 -0
- package/src/internal/docs-site.ts +248 -0
- package/src/internal/duration.ts +37 -0
- package/src/internal/env-file.ts +83 -0
- package/src/internal/eval-judge-model.ts +142 -0
- package/src/internal/eval-run-store.ts +585 -0
- package/src/internal/eval-runner.ts +823 -0
- package/src/internal/evals-client.ts +475 -0
- package/src/internal/event-log.ts +342 -0
- package/src/internal/event-mapper.ts +480 -0
- package/src/internal/expected-delivery-failure.ts +34 -0
- package/src/internal/factory-resource-channel.ts +103 -0
- package/src/internal/filesystem/errors.ts +207 -0
- package/src/internal/filesystem/format.ts +253 -0
- package/src/internal/filesystem/merge.ts +192 -0
- package/src/internal/filesystem/nearest.ts +112 -0
- package/src/internal/filesystem/scratch.ts +239 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +804 -0
- package/src/internal/filesystem/walk.ts +366 -0
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/framework-file-storage.ts +357 -0
- package/src/internal/framework-storage-selection.ts +156 -0
- package/src/internal/frontmatter.ts +108 -0
- package/src/internal/github-fanout.ts +144 -0
- package/src/internal/guest-network.ts +391 -0
- package/src/internal/handleAgentServeTrigger.ts +286 -0
- package/src/internal/host-files.ts +341 -0
- package/src/internal/host-kv.ts +81 -0
- package/src/internal/host-otel.ts +231 -0
- package/src/internal/host-platforms.ts +170 -0
- package/src/internal/hosted-admission-adapter.ts +47 -0
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-catch-protocol.ts +112 -0
- package/src/internal/hosted-catch.ts +179 -0
- package/src/internal/hosted-delivery-protocol.ts +787 -0
- package/src/internal/hosted-delivery.ts +1152 -0
- package/src/internal/hosted-execution-diag.ts +291 -0
- package/src/internal/hosted-execution-flush.ts +136 -0
- package/src/internal/hosted-execution-latency.ts +301 -0
- package/src/internal/hosted-managed-automation.ts +116 -0
- package/src/internal/hosting.ts +107 -0
- package/src/internal/http-channel-define.ts +25 -0
- package/src/internal/http-channel.ts +669 -0
- package/src/internal/http-control-plane-session.ts +110 -0
- package/src/internal/ids.ts +39 -0
- package/src/internal/incoming-headers-to-fetch.ts +45 -0
- package/src/internal/init-interview.ts +360 -0
- package/src/internal/init-project.ts +711 -0
- package/src/internal/init-scaffold.ts +182 -0
- package/src/internal/inline-stdio-define-stub.ts +4 -0
- package/src/internal/inline-stdio-mcp.ts +230 -0
- package/src/internal/install-cursor-skills.ts +601 -0
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +95 -0
- package/src/internal/legacy-command-guard.ts +54 -0
- package/src/internal/listen-port.ts +85 -0
- package/src/internal/local-control-plane.ts +442 -0
- package/src/internal/local-env.ts +59 -0
- package/src/internal/local-ingress.ts +90 -0
- package/src/internal/log-ring.ts +59 -0
- package/src/internal/logs-client.ts +477 -0
- package/src/internal/map-pool.ts +39 -0
- package/src/internal/mcp-endpoint.ts +747 -0
- package/src/internal/mcp-host.ts +481 -0
- package/src/internal/mcp-oauth-on-demand.ts +337 -0
- package/src/internal/mcp-oauth-persist.ts +118 -0
- package/src/internal/mcp-oauth.ts +549 -0
- package/src/internal/net.ts +29 -0
- package/src/internal/open-browser.ts +41 -0
- package/src/internal/otel/attrs.ts +16 -0
- package/src/internal/otel/collector.ts +937 -0
- package/src/internal/otel/config.ts +287 -0
- package/src/internal/otel/http.ts +122 -0
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +441 -0
- package/src/internal/package-inline-stdio.ts +114 -0
- package/src/internal/peer-connections.ts +96 -0
- package/src/internal/platform-schedule-sync.ts +75 -0
- package/src/internal/platform-timers.ts +365 -0
- package/src/internal/playground/static.ts +278 -0
- package/src/internal/playground/toolchain.ts +270 -0
- package/src/internal/playground-proxy.ts +564 -0
- package/src/internal/process-memory-telemetry.ts +334 -0
- package/src/internal/project-layout.ts +31 -0
- package/src/internal/prompt-context.ts +116 -0
- package/src/internal/reminder-control-plane-protocol.ts +482 -0
- package/src/internal/reminder-runner.ts +1559 -0
- package/src/internal/reminder-schedule.ts +104 -0
- package/src/internal/reminder-store.ts +176 -0
- package/src/internal/request-error-status.ts +95 -0
- package/src/internal/request-headers.ts +21 -0
- package/src/internal/resolve-prod-target.ts +334 -0
- package/src/internal/resolved-connections.ts +190 -0
- package/src/internal/router.ts +143 -0
- package/src/internal/run-client.ts +354 -0
- package/src/internal/runtime-dispatch-runner.ts +50 -0
- package/src/internal/sanitize-mcp-tool-name.ts +31 -0
- package/src/internal/schedule-runner.ts +154 -0
- package/src/internal/scm/pr-url.ts +245 -0
- package/src/internal/sdk-runner.ts +948 -0
- package/src/internal/serve-restart.ts +113 -0
- package/src/internal/server.ts +3135 -0
- package/src/internal/session-cost.ts +208 -0
- package/src/internal/session-engine.ts +5602 -0
- package/src/internal/session-links.ts +84 -0
- package/src/internal/session-run-log.ts +535 -0
- package/src/internal/session-store.ts +307 -0
- package/src/internal/session-urls.ts +32 -0
- package/src/internal/sessions-client.ts +239 -0
- package/src/internal/skill-catalog.ts +66 -0
- package/src/internal/skills-sync.ts +55 -0
- package/src/internal/slack-provision-client.ts +544 -0
- package/src/internal/slack-thread-key.ts +11 -0
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +164 -0
- package/src/internal/steering.ts +17 -0
- package/src/internal/storage-coordinator.ts +800 -0
- package/src/internal/storage-roles.ts +86 -0
- package/src/internal/storage.ts +1 -0
- package/src/internal/store-api-protocol.ts +205 -0
- package/src/internal/store-mirror.ts +73 -0
- package/src/internal/stream-progress.ts +294 -0
- package/src/internal/terminal-style.ts +133 -0
- package/src/internal/testing/factory-resource-fixtures.ts +84 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +285 -0
- package/src/internal/tool-catalog.ts +104 -0
- package/src/internal/tool-policy.ts +222 -0
- package/src/internal/tool-result.ts +50 -0
- package/src/internal/trajectory.ts +418 -0
- package/src/internal/turn-cost.ts +136 -0
- package/src/internal/turn-governor.ts +145 -0
- package/src/internal/turn-lease-store.ts +144 -0
- package/src/internal/turn-outbox.ts +77 -0
- package/src/internal/update-check.ts +517 -0
- package/src/internal/v2-hosting.ts +52 -0
- package/src/internal/workspace-sync.ts +114 -0
- package/src/internal/workspace.ts +505 -0
- package/src/kv/memory-kv.ts +94 -0
- package/src/kv.ts +18 -0
- package/src/memory.ts +487 -0
- package/src/otel-public.ts +24 -0
- package/src/otel.ts +320 -0
- package/src/prompt.ts +80 -0
- package/src/reminders.ts +65 -0
- package/src/schedules.ts +31 -0
- package/src/skills.ts +27 -0
- package/src/storage-backends/cursor-hosted-v2.ts +204 -0
- package/src/storage-backends/cursor-hosted.ts +388 -0
- package/src/storage-backends/file-kv.ts +276 -0
- package/src/storage-protocol.ts +261 -0
- package/src/storage.ts +408 -0
- package/src/tools.ts +166 -0
- package/src/types.ts +3725 -0
- package/templates/agentic-owners/README.md +76 -0
- package/templates/agentic-owners/bot/agent.ts +8 -0
- package/templates/agentic-owners/bot/channels/github.ts +63 -0
- package/templates/agentic-owners/bot/instructions.md +34 -0
- package/templates/agentic-owners/bot/lib/config.ts +5 -0
- package/templates/agentic-owners/bot/lib/github.ts +217 -0
- package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
- package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
- package/templates/agentic-owners/bot/lib/owners/decision.ts +454 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +219 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +78 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +565 -0
- package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
- package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
- package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
- package/templates/agentic-owners/bot/lib/owners/types.ts +50 -0
- package/templates/agentic-owners/bot/lib/review.ts +722 -0
- package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
- package/templates/agentic-owners/evals/evals.config.ts +5 -0
- package/templates/agentic-owners/evals/owners.eval.ts +111 -0
- package/templates/agentic-owners/package.json +20 -0
- package/templates/agentic-owners/tsconfig.json +12 -0
- package/templates/agents-md/README.md +42 -0
- package/templates/agents-md/bot/agent.ts +8 -0
- package/templates/agents-md/bot/channels/github.ts +10 -0
- package/templates/agents-md/bot/channels/queue.ts +28 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +39 -0
- package/templates/agents-md/bot/lib/collect.ts +415 -0
- package/templates/agents-md/bot/lib/config.ts +8 -0
- package/templates/agents-md/bot/lib/paths.ts +49 -0
- package/templates/agents-md/bot/schedules/weekly.ts +17 -0
- package/templates/agents-md/bot/tools/apply_agents.ts +218 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/templates/code-wiki/README.md +37 -0
- package/templates/code-wiki/bot/agent.ts +8 -0
- package/templates/code-wiki/bot/channels/github.ts +125 -0
- package/templates/code-wiki/bot/instructions.md +39 -0
- package/templates/code-wiki/bot/lib/repos.ts +5 -0
- package/templates/code-wiki/bot/lib/wiki.ts +22 -0
- package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +124 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/README.md +40 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +48 -0
- package/templates/demo/bot/channels/queue.ts +34 -0
- package/templates/demo/bot/instructions.md +8 -0
- package/templates/demo/bot/lib/collect.ts +66 -0
- package/templates/demo/bot/lib/repos.ts +5 -0
- package/templates/demo/bot/tools/record_demo.ts +37 -0
- package/templates/demo/evals/demo.eval.ts +29 -0
- package/templates/demo/evals/evals.config.ts +5 -0
- package/templates/demo/init.json +25 -0
- package/templates/demo/package.json +18 -0
- package/templates/demo/tsconfig.json +12 -0
- package/templates/grokbot-agents/README.md +29 -0
- package/templates/grokbot-agents/bot/agent.ts +6 -0
- package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
- package/templates/grokbot-agents/bot/instructions.md +7 -0
- package/templates/grokbot-agents/evals/evals.config.ts +5 -0
- package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
- package/templates/grokbot-agents/init.json +18 -0
- package/templates/grokbot-agents/package.json +17 -0
- package/templates/grokbot-agents/tsconfig.json +12 -0
- package/templates/pr-autofixer/bot/agent.ts +11 -0
- package/templates/pr-autofixer/bot/channels/drive.ts +37 -0
- package/templates/pr-autofixer/bot/channels/github.ts +155 -0
- package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
- package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
- package/templates/pr-autofixer/bot/instructions.md +83 -0
- package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
- package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
- package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
- package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
- package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
- package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
- package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
- package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
- package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
- package/templates/pr-autofixer/bot/tools/drive_pr.ts +22 -0
- package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
- package/templates/pr-autofixer/evals/evals.config.ts +5 -0
- package/templates/pr-autofixer/init.json +25 -0
- package/templates/pr-autofixer/package.json +18 -0
- package/templates/pr-autofixer/tsconfig.json +12 -0
- package/templates/security-help/README.md +40 -0
- package/templates/security-help/bot/agent.ts +17 -0
- package/templates/security-help/bot/channels/github.ts +13 -0
- package/templates/security-help/bot/channels/slack.ts +84 -0
- package/templates/security-help/bot/instructions.md +19 -0
- package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
- package/templates/security-help/bot/lib/repos.ts +5 -0
- package/templates/security-help/bot/skills/access-request.md +10 -0
- package/templates/security-help/bot/skills/faq.md +31 -0
- package/templates/security-help/bot/skills/security-playbooks.md +12 -0
- package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
- package/templates/security-help/evals/evals.config.ts +5 -0
- package/templates/security-help/evals/security-help.eval.ts +51 -0
- package/templates/security-help/init.json +31 -0
- package/templates/security-help/package.json +17 -0
- package/templates/security-help/tsconfig.json +12 -0
- package/templates/security-reviewer/README.md +34 -0
- package/templates/security-reviewer/bot/agent.ts +8 -0
- package/templates/security-reviewer/bot/channels/github.ts +43 -0
- package/templates/security-reviewer/bot/instructions.md +22 -0
- package/templates/security-reviewer/bot/lib/repos.ts +5 -0
- package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
- package/templates/security-reviewer/evals/evals.config.ts +5 -0
- package/templates/security-reviewer/evals/review.eval.ts +50 -0
- package/templates/security-reviewer/init.json +25 -0
- package/templates/security-reviewer/package.json +18 -0
- package/templates/security-reviewer/tsconfig.json +12 -0
- package/templates/thermo-quality-review/README.md +38 -0
- package/templates/thermo-quality-review/bot/agent.ts +8 -0
- package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
- package/templates/thermo-quality-review/bot/instructions.md +43 -0
- package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
- package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
- package/templates/thermo-quality-review/package.json +18 -0
- package/templates/thermo-quality-review/tsconfig.json +12 -0
- package/templates/thermo-review/README.md +38 -0
- package/templates/thermo-review/bot/agent.ts +8 -0
- package/templates/thermo-review/bot/channels/github.ts +39 -0
- package/templates/thermo-review/bot/instructions.md +40 -0
- package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-review/evals/evals.config.ts +5 -0
- package/templates/thermo-review/evals/review.eval.ts +50 -0
- package/templates/thermo-review/package.json +18 -0
- package/templates/thermo-review/tsconfig.json +12 -0
- package/templates/triage/README.md +50 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +40 -0
- package/templates/triage/bot/channels/webhook.ts +44 -0
- package/templates/triage/bot/hooks/memory.ts +3 -0
- package/templates/triage/bot/instructions.md +38 -0
- package/templates/triage/bot/lib/actuate.ts +703 -0
- package/templates/triage/bot/lib/parse-queue-event.ts +166 -0
- package/templates/triage/bot/lib/tracker.ts +5 -0
- package/templates/triage/bot/lib/types.ts +48 -0
- package/templates/triage/bot/lib/verify-webhook.ts +79 -0
- package/templates/triage/bot/skills/triage-rubric.md +44 -0
- package/templates/triage/bot/tools/record_triage.ts +29 -0
- package/templates/triage/evals/evals.config.ts +5 -0
- package/templates/triage/evals/triage.eval.ts +64 -0
- package/templates/triage/overlays/jira/README.md +24 -0
- package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/overlays/linear/README.md +24 -0
- package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/package.json +18 -0
- package/templates/triage/tsconfig.json +12 -0
|
@@ -0,0 +1,1698 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
22
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
23
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
24
|
+
var m = o[Symbol.asyncIterator], i;
|
|
25
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
26
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
27
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
28
|
+
};
|
|
29
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
30
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
31
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
32
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
33
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
34
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
35
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
36
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
37
|
+
function fulfill(value) { resume("next", value); }
|
|
38
|
+
function reject(value) { resume("throw", value); }
|
|
39
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
40
|
+
};
|
|
41
|
+
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
42
|
+
var i, p;
|
|
43
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
44
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
45
|
+
};
|
|
46
|
+
import { Buffer } from "node:buffer";
|
|
47
|
+
import { mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
48
|
+
import path from "node:path";
|
|
49
|
+
import { minimatch } from "minimatch";
|
|
50
|
+
import { FileConflictError } from "./files.js";
|
|
51
|
+
import { EditError, FileNotFoundError, InvalidGrepPatternError, isFileNotFoundError, isInvalidGrepPatternError, NoMountError, PathError, ReadOnlyMountError, remapPathError, WriteFailedError, } from "./internal/filesystem/errors.js";
|
|
52
|
+
import { MEMORY_DIR_NAME } from "./memory.js";
|
|
53
|
+
export { DeleteNotSupportedError, EditError, FileNotFoundError, InvalidGrepPatternError, isFileNotFoundError, isInvalidGrepPatternError, NoMountError, PathError, ReadOnlyMountError, WriteFailedError, } from "./internal/filesystem/errors.js";
|
|
54
|
+
import { mergeSorted } from "./internal/filesystem/merge.js";
|
|
55
|
+
import { isExcludedPath, listFilesFromPaths, mergeSortedByPath, statFromFilePaths, } from "./internal/filesystem/walk.js";
|
|
56
|
+
/**
|
|
57
|
+
* Default scan cap for synthesized LS / Glob and for Origin
|
|
58
|
+
* `ListRepoPaths` from `/repo`. Smaller than Origin's 10k default
|
|
59
|
+
* so a recursive listing does not materialize a huge response.
|
|
60
|
+
*/
|
|
61
|
+
export const FILE_SYSTEM_SCAN_LIMIT = 1000;
|
|
62
|
+
export const FILE_SYSTEM_TOOL_NAMES = [
|
|
63
|
+
"Read",
|
|
64
|
+
"LS",
|
|
65
|
+
"Glob",
|
|
66
|
+
"Grep",
|
|
67
|
+
"Write",
|
|
68
|
+
"StrReplace",
|
|
69
|
+
"Delete",
|
|
70
|
+
"SemanticSearch",
|
|
71
|
+
];
|
|
72
|
+
const FILE_SYSTEM_TOOL_NAME_SET = new Set(FILE_SYSTEM_TOOL_NAMES);
|
|
73
|
+
const FILE_SYSTEM_TOOL_ALIASES = {
|
|
74
|
+
read: "Read",
|
|
75
|
+
Read: "Read",
|
|
76
|
+
ls: "LS",
|
|
77
|
+
LS: "LS",
|
|
78
|
+
glob: "Glob",
|
|
79
|
+
Glob: "Glob",
|
|
80
|
+
grep: "Grep",
|
|
81
|
+
Grep: "Grep",
|
|
82
|
+
write: "Write",
|
|
83
|
+
Write: "Write",
|
|
84
|
+
edit: "StrReplace",
|
|
85
|
+
StrReplace: "StrReplace",
|
|
86
|
+
delete: "Delete",
|
|
87
|
+
Delete: "Delete",
|
|
88
|
+
semSearch: "SemanticSearch",
|
|
89
|
+
SemanticSearch: "SemanticSearch",
|
|
90
|
+
};
|
|
91
|
+
export function canonicalizeFileSystemToolName(name) {
|
|
92
|
+
return FILE_SYSTEM_TOOL_ALIASES[name];
|
|
93
|
+
}
|
|
94
|
+
export function isFileSystemToolName(name) {
|
|
95
|
+
return FILE_SYSTEM_TOOL_NAME_SET.has(name);
|
|
96
|
+
}
|
|
97
|
+
export function isFileSystemToolAlias(name) {
|
|
98
|
+
return canonicalizeFileSystemToolName(name) !== undefined;
|
|
99
|
+
}
|
|
100
|
+
/** Direct `callTool` names that mutate the tree and must wait on a busy turn. */
|
|
101
|
+
export function isMutatingFileSystemTool(name) {
|
|
102
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
103
|
+
return canonical === "Write" || canonical === "StrReplace" || canonical === "Delete";
|
|
104
|
+
}
|
|
105
|
+
export function isFileSystemMethodPresent(root, method) {
|
|
106
|
+
return typeof root[method] === "function";
|
|
107
|
+
}
|
|
108
|
+
const ADVERTISED_FILE_SYSTEM_TOOL_NAMES = [
|
|
109
|
+
"Read",
|
|
110
|
+
"LS",
|
|
111
|
+
"Glob",
|
|
112
|
+
"Grep",
|
|
113
|
+
"Write",
|
|
114
|
+
"StrReplace",
|
|
115
|
+
"Delete",
|
|
116
|
+
"SemanticSearch",
|
|
117
|
+
];
|
|
118
|
+
export function fileSystemToolNames(_root) {
|
|
119
|
+
return [...ADVERTISED_FILE_SYSTEM_TOOL_NAMES];
|
|
120
|
+
}
|
|
121
|
+
function fileSystemMethodForTool(name) {
|
|
122
|
+
switch (name) {
|
|
123
|
+
case "Read":
|
|
124
|
+
return "read";
|
|
125
|
+
case "LS":
|
|
126
|
+
return "list";
|
|
127
|
+
case "Glob":
|
|
128
|
+
return "glob";
|
|
129
|
+
case "Grep":
|
|
130
|
+
return "grep";
|
|
131
|
+
case "Write":
|
|
132
|
+
case "StrReplace":
|
|
133
|
+
return "write";
|
|
134
|
+
case "Delete":
|
|
135
|
+
return "delete";
|
|
136
|
+
case "SemanticSearch":
|
|
137
|
+
return "search";
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function fileSystemSatisfiesFileTool(root, name) {
|
|
141
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
142
|
+
if (canonical === undefined) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
const method = fileSystemMethodForTool(canonical);
|
|
146
|
+
return method !== undefined && isFileSystemMethodPresent(root, method);
|
|
147
|
+
}
|
|
148
|
+
export class FileSystemConfigError extends Error {
|
|
149
|
+
constructor(message) {
|
|
150
|
+
super(message);
|
|
151
|
+
this.name = "FileSystemConfigError";
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function allowlistHas(tools, ...names) {
|
|
155
|
+
return tools.some(name => names.includes(name));
|
|
156
|
+
}
|
|
157
|
+
export function resolveRootHarnessAllowlist(tools) {
|
|
158
|
+
if (tools === undefined) {
|
|
159
|
+
// File verbs are synthesized, including SemanticSearch from
|
|
160
|
+
// `search`. Web tools are safe under the `/tmp` scratch
|
|
161
|
+
// overlay. Todos are harness conversation state. Do not
|
|
162
|
+
// unlock shell or task.
|
|
163
|
+
return ["webSearch", "webFetch", "updateTodos", "readTodos", "mcp"];
|
|
164
|
+
}
|
|
165
|
+
if (allowlistHas(tools, "shell", "Shell")) {
|
|
166
|
+
throw new FileSystemConfigError('`root` cannot be combined with `tools` containing `"shell"`. ' +
|
|
167
|
+
"Shell is not a FileSystem method and must not bind the host shell onto a virtual tree.");
|
|
168
|
+
}
|
|
169
|
+
if (allowlistHas(tools, "task", "Task")) {
|
|
170
|
+
throw new FileSystemConfigError("`root` cannot list `task`: a child keeps the host toolset and " +
|
|
171
|
+
"would read the real workspace. Sharing `root` with subagents " +
|
|
172
|
+
"needs a Cursor SDK inherit, not an overridden Task tool.");
|
|
173
|
+
}
|
|
174
|
+
if (allowlistHas(tools, "readLints", "ReadLints")) {
|
|
175
|
+
throw new FileSystemConfigError("`root` cannot list `readLints`: FileSystem has no diagnostics " +
|
|
176
|
+
"verb, so the host language service would run against the real workspace.");
|
|
177
|
+
}
|
|
178
|
+
const extras = tools.filter(name => !isFileSystemToolAlias(name));
|
|
179
|
+
return withMcpGrant(extras);
|
|
180
|
+
}
|
|
181
|
+
export function resolveFileSystemTools(options) {
|
|
182
|
+
const harness = resolveRootHarnessAllowlist(options.tools);
|
|
183
|
+
if (options.tools === undefined) {
|
|
184
|
+
return harness;
|
|
185
|
+
}
|
|
186
|
+
const implemented = fileSystemToolNames(options.root);
|
|
187
|
+
const missing = [];
|
|
188
|
+
for (const name of options.tools) {
|
|
189
|
+
if (!fileSystemSatisfiesFileTool(options.root, name)) {
|
|
190
|
+
missing.push(name);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (missing.length > 0) {
|
|
194
|
+
throw new FileSystemConfigError(`\`tools\` names FileSystem method(s) that are not implemented: ${missing.join(", ")}. ` +
|
|
195
|
+
`Implemented file tools: ${implemented.length > 0 ? implemented.join(", ") : "(none)"}.`);
|
|
196
|
+
}
|
|
197
|
+
return harness;
|
|
198
|
+
}
|
|
199
|
+
export function withMcpGrant(tools) {
|
|
200
|
+
return tools.includes("mcp") ? [...tools] : [...tools, "mcp"];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Native Cursor SDK file tools replaced by synthesized FileSystem tools
|
|
204
|
+
* on every local turn. SDK allowlist names (`edit`, not `Write`).
|
|
205
|
+
*/
|
|
206
|
+
export const REPLACED_NATIVE_FILE_TOOLS = [
|
|
207
|
+
"read",
|
|
208
|
+
"ls",
|
|
209
|
+
"grep",
|
|
210
|
+
"glob",
|
|
211
|
+
"edit",
|
|
212
|
+
"delete",
|
|
213
|
+
];
|
|
214
|
+
/**
|
|
215
|
+
* Host-default harness options: keep shell / webSearch / sandbox, but
|
|
216
|
+
* hide the native file tools the synthesized FileSystem now owns.
|
|
217
|
+
*
|
|
218
|
+
* Omitted `tools` leaves the SDK default set and only excludes the
|
|
219
|
+
* replaced natives. `[]` stays empty. A non-empty allowlist drops file
|
|
220
|
+
* aliases (those ride synthesized tools) and grants `mcp`.
|
|
221
|
+
*/
|
|
222
|
+
export function resolveHostHarnessToolOptions(tools) {
|
|
223
|
+
if (tools === undefined) {
|
|
224
|
+
return { disallowedTools: [...REPLACED_NATIVE_FILE_TOOLS] };
|
|
225
|
+
}
|
|
226
|
+
if (tools.length === 0) {
|
|
227
|
+
return { tools: [] };
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
tools: withMcpGrant(tools.filter(name => !isReplacedHostFileAlias(name))),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** File aliases host-default synthesizes. Native `semSearch` stays. */
|
|
234
|
+
function isReplacedHostFileAlias(name) {
|
|
235
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
236
|
+
return canonical !== undefined && canonical !== "SemanticSearch";
|
|
237
|
+
}
|
|
238
|
+
/** Decode a {@link FileSystem.read} result as UTF-8 text. */
|
|
239
|
+
export function fileSystemText(content) {
|
|
240
|
+
return typeof content === "string" ? content : Buffer.from(content).toString("utf8");
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Native Read image formats. Magic bytes first, then extension.
|
|
244
|
+
* Returns undefined for text (and for any other binary).
|
|
245
|
+
*/
|
|
246
|
+
export function detectImageMimeType(bytes, filePath) {
|
|
247
|
+
if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
|
|
248
|
+
return "image/jpeg";
|
|
249
|
+
}
|
|
250
|
+
if (bytes.length >= 8 &&
|
|
251
|
+
bytes[0] === 0x89 &&
|
|
252
|
+
bytes[1] === 0x50 &&
|
|
253
|
+
bytes[2] === 0x4e &&
|
|
254
|
+
bytes[3] === 0x47) {
|
|
255
|
+
return "image/png";
|
|
256
|
+
}
|
|
257
|
+
if (bytes.length >= 6 && bytes[0] === 0x47 && bytes[1] === 0x49 && bytes[2] === 0x46) {
|
|
258
|
+
return "image/gif";
|
|
259
|
+
}
|
|
260
|
+
if (bytes.length >= 12 &&
|
|
261
|
+
bytes[0] === 0x52 &&
|
|
262
|
+
bytes[1] === 0x49 &&
|
|
263
|
+
bytes[2] === 0x46 &&
|
|
264
|
+
bytes[3] === 0x46 &&
|
|
265
|
+
bytes[8] === 0x57 &&
|
|
266
|
+
bytes[9] === 0x45 &&
|
|
267
|
+
bytes[10] === 0x42 &&
|
|
268
|
+
bytes[11] === 0x50) {
|
|
269
|
+
return "image/webp";
|
|
270
|
+
}
|
|
271
|
+
if (filePath === undefined) {
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
const lower = filePath.toLowerCase();
|
|
275
|
+
if (lower.endsWith(".jpg") || lower.endsWith(".jpeg")) {
|
|
276
|
+
return "image/jpeg";
|
|
277
|
+
}
|
|
278
|
+
if (lower.endsWith(".png")) {
|
|
279
|
+
return "image/png";
|
|
280
|
+
}
|
|
281
|
+
if (lower.endsWith(".gif")) {
|
|
282
|
+
return "image/gif";
|
|
283
|
+
}
|
|
284
|
+
if (lower.endsWith(".webp")) {
|
|
285
|
+
return "image/webp";
|
|
286
|
+
}
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
export function fileSystemImage(content, path) {
|
|
290
|
+
if (!(content instanceof Uint8Array)) {
|
|
291
|
+
return undefined;
|
|
292
|
+
}
|
|
293
|
+
const mimeType = detectImageMimeType(content, path);
|
|
294
|
+
if (mimeType === undefined) {
|
|
295
|
+
return undefined;
|
|
296
|
+
}
|
|
297
|
+
return { mimeType, bytes: content };
|
|
298
|
+
}
|
|
299
|
+
function compileGrepPattern(pattern, caseInsensitive, path = "/") {
|
|
300
|
+
try {
|
|
301
|
+
return new RegExp(pattern, caseInsensitive === true ? "i" : undefined);
|
|
302
|
+
}
|
|
303
|
+
catch (_a) {
|
|
304
|
+
throw new InvalidGrepPatternError(pattern, path);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function* grepFileContent(args) {
|
|
308
|
+
const lines = args.content.split("\n");
|
|
309
|
+
for (let i = 0; i < lines.length; i++) {
|
|
310
|
+
const line = lines[i];
|
|
311
|
+
if (args.regex.test(line)) {
|
|
312
|
+
yield { path: args.path, lineNumber: i + 1, line };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function normalizeMaxResults(maxResults) {
|
|
317
|
+
if (maxResults === undefined || !Number.isFinite(maxResults)) {
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
320
|
+
return Math.max(0, Math.floor(maxResults));
|
|
321
|
+
}
|
|
322
|
+
function limitResults(source, maxResults) {
|
|
323
|
+
return __asyncGenerator(this, arguments, function* limitResults_1() {
|
|
324
|
+
var _a, e_1, _b, _c;
|
|
325
|
+
const cap = normalizeMaxResults(maxResults);
|
|
326
|
+
if (cap === 0) {
|
|
327
|
+
return yield __await(void 0);
|
|
328
|
+
}
|
|
329
|
+
let n = 0;
|
|
330
|
+
try {
|
|
331
|
+
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a = source_1_1.done, !_a; _d = true) {
|
|
332
|
+
_c = source_1_1.value;
|
|
333
|
+
_d = false;
|
|
334
|
+
const item = _c;
|
|
335
|
+
yield yield __await(item);
|
|
336
|
+
n++;
|
|
337
|
+
if (cap !== undefined && n >= cap) {
|
|
338
|
+
return yield __await(void 0);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
343
|
+
finally {
|
|
344
|
+
try {
|
|
345
|
+
if (!_d && !_a && (_b = source_1.return)) yield __await(_b.call(source_1));
|
|
346
|
+
}
|
|
347
|
+
finally { if (e_1) throw e_1.error; }
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function grepPushdownLimit(query, opts) {
|
|
352
|
+
// Count and files_with_matches paginate after grouping by file.
|
|
353
|
+
// A line-level cap would hide later files once one file fills the window.
|
|
354
|
+
if (opts.outputMode === "count" || opts.outputMode === "files_with_matches") {
|
|
355
|
+
return query.maxResults;
|
|
356
|
+
}
|
|
357
|
+
const headLimit = opts.headLimit !== undefined && opts.headLimit > 0 ? opts.headLimit : undefined;
|
|
358
|
+
if (headLimit === undefined) {
|
|
359
|
+
return query.maxResults;
|
|
360
|
+
}
|
|
361
|
+
const toolCap = opts.offset + headLimit;
|
|
362
|
+
return query.maxResults === undefined ? toolCap : Math.min(query.maxResults, toolCap);
|
|
363
|
+
}
|
|
364
|
+
function compareGrepResult(left, right) {
|
|
365
|
+
return left.path < right.path
|
|
366
|
+
? -1
|
|
367
|
+
: left.path > right.path
|
|
368
|
+
? 1
|
|
369
|
+
: left.lineNumber - right.lineNumber;
|
|
370
|
+
}
|
|
371
|
+
function compareSearchResult(left, right) {
|
|
372
|
+
if (right.score !== left.score) {
|
|
373
|
+
return right.score - left.score;
|
|
374
|
+
}
|
|
375
|
+
return left.path < right.path ? -1 : left.path > right.path ? 1 : 0;
|
|
376
|
+
}
|
|
377
|
+
export function collectGrepMatches(root, query, opts) {
|
|
378
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
379
|
+
var _a, e_2, _b, _c;
|
|
380
|
+
const matches = [];
|
|
381
|
+
const offset = opts.offset !== undefined && opts.offset > 0 ? opts.offset : 0;
|
|
382
|
+
const headLimit = opts.headLimit !== undefined && opts.headLimit > 0 ? opts.headLimit : undefined;
|
|
383
|
+
const skippedFiles = new Set();
|
|
384
|
+
const acceptedFiles = new Set();
|
|
385
|
+
let skippedItems = 0;
|
|
386
|
+
let takenItems = 0;
|
|
387
|
+
const pushdown = grepPushdownLimit(query, Object.assign({ outputMode: opts.outputMode, offset }, (opts.headLimit === undefined ? {} : { headLimit: opts.headLimit })));
|
|
388
|
+
const grepQuery = pushdown === undefined ? query : Object.assign(Object.assign({}, query), { maxResults: pushdown });
|
|
389
|
+
try {
|
|
390
|
+
for (var _d = true, _e = __asyncValues(root.grep(grepQuery)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
391
|
+
_c = _f.value;
|
|
392
|
+
_d = false;
|
|
393
|
+
const match = _c;
|
|
394
|
+
if (opts.outputMode === "content") {
|
|
395
|
+
if (skippedItems < offset) {
|
|
396
|
+
skippedItems++;
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
matches.push(match);
|
|
400
|
+
takenItems++;
|
|
401
|
+
if (headLimit !== undefined && takenItems >= headLimit) {
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
if (skippedFiles.has(match.path)) {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (!acceptedFiles.has(match.path)) {
|
|
410
|
+
if (skippedItems < offset) {
|
|
411
|
+
skippedFiles.add(match.path);
|
|
412
|
+
skippedItems++;
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (headLimit !== undefined && takenItems >= headLimit) {
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
acceptedFiles.add(match.path);
|
|
419
|
+
takenItems++;
|
|
420
|
+
}
|
|
421
|
+
matches.push(match);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
425
|
+
finally {
|
|
426
|
+
try {
|
|
427
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
428
|
+
}
|
|
429
|
+
finally { if (e_2) throw e_2.error; }
|
|
430
|
+
}
|
|
431
|
+
return matches;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
export function shapeGrepUnion(matches, outputMode) {
|
|
435
|
+
var _a;
|
|
436
|
+
if (outputMode === "files_with_matches") {
|
|
437
|
+
const files = [...new Set(matches.map(match => match.path))];
|
|
438
|
+
return { type: "files", output: { files, count: files.length } };
|
|
439
|
+
}
|
|
440
|
+
if (outputMode === "count") {
|
|
441
|
+
const counts = new Map();
|
|
442
|
+
for (const match of matches) {
|
|
443
|
+
counts.set(match.path, ((_a = counts.get(match.path)) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
type: "count",
|
|
447
|
+
output: {
|
|
448
|
+
counts: [...counts].map(([file, count]) => ({ file, count })),
|
|
449
|
+
total: matches.length,
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
type: "content",
|
|
455
|
+
output: {
|
|
456
|
+
matches: matches.map(match => (Object.assign(Object.assign({ file: match.path, lineNumber: match.lineNumber, line: match.line }, (match.beforeContext === undefined ? {} : { beforeContext: match.beforeContext })), (match.afterContext === undefined ? {} : { afterContext: match.afterContext })))),
|
|
457
|
+
totalMatches: matches.length,
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
export function normalizeFsPath(input) {
|
|
462
|
+
const slashes = input.replace(/\\/g, "/");
|
|
463
|
+
if (slashes === "") {
|
|
464
|
+
return "/";
|
|
465
|
+
}
|
|
466
|
+
const withSlash = slashes.startsWith("/") ? slashes : `/${slashes}`;
|
|
467
|
+
const resolved = path.posix.normalize(withSlash);
|
|
468
|
+
if (resolved.length > 1 && resolved.endsWith("/")) {
|
|
469
|
+
return resolved.slice(0, -1);
|
|
470
|
+
}
|
|
471
|
+
return resolved === "." || resolved === "" ? "/" : resolved;
|
|
472
|
+
}
|
|
473
|
+
/** Path-segment prefix: `/agent` matches `/agent/skills`, not `/agent-tools`. */
|
|
474
|
+
export function pathHasSegmentPrefix(args) {
|
|
475
|
+
const p = normalizeFsPath(args.path);
|
|
476
|
+
const pre = normalizeFsPath(args.prefix);
|
|
477
|
+
if (pre === "/") {
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
return p === pre || p.startsWith(`${pre}/`);
|
|
481
|
+
}
|
|
482
|
+
function matchGlob(relativePath, globPattern) {
|
|
483
|
+
return minimatch(relativePath, globPattern, { dot: true, nocase: false });
|
|
484
|
+
}
|
|
485
|
+
function pathMatchesGlob(filePath, dir, globPattern, options = {}) {
|
|
486
|
+
const posixFile = filePath.replace(/\\/g, "/");
|
|
487
|
+
const posixDir = dir.replace(/\\/g, "/");
|
|
488
|
+
const relative = posixDir === "/" || posixFile.startsWith(`${posixDir}/`)
|
|
489
|
+
? posixDir === "/"
|
|
490
|
+
? posixFile.replace(/^\//, "")
|
|
491
|
+
: posixFile.slice(posixDir.length + 1)
|
|
492
|
+
: posixFile.replace(/^\//, "");
|
|
493
|
+
if (matchGlob(relative, globPattern) || matchGlob(posixFile.replace(/^\//, ""), globPattern)) {
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
// Native grep `--glob '*.ts'` matches the basename at any depth.
|
|
497
|
+
// Glob `*.ts` stays relative to `targetDirectory` and does not.
|
|
498
|
+
if (options.matchBasename === true && !globPattern.includes("/")) {
|
|
499
|
+
const slash = relative.lastIndexOf("/");
|
|
500
|
+
const base = slash === -1 ? relative : relative.slice(slash + 1);
|
|
501
|
+
return matchGlob(base, globPattern);
|
|
502
|
+
}
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Resolve a per-send `workspaceFiles` key onto the virtual `/` namespace.
|
|
507
|
+
* Refuses paths that escape the root, and the reserved `memory` name.
|
|
508
|
+
* Host-default workspaces symlink `memory/` to durable agent state, so a
|
|
509
|
+
* seed under that name would write through the link.
|
|
510
|
+
*/
|
|
511
|
+
export function virtualWorkspaceWritePath(relativePath) {
|
|
512
|
+
if (relativePath.includes("\0")) {
|
|
513
|
+
throw new FileSystemConfigError(`Refusing to write outside the virtual root: ${relativePath}`);
|
|
514
|
+
}
|
|
515
|
+
const posix = relativePath.replaceAll("\\", "/");
|
|
516
|
+
const base = "/virtual-root";
|
|
517
|
+
const target = path.posix.normalize(path.posix.join(base, posix));
|
|
518
|
+
if (target !== base && !target.startsWith(`${base}/`)) {
|
|
519
|
+
throw new FileSystemConfigError(`Refusing to write outside the virtual root: ${relativePath}`);
|
|
520
|
+
}
|
|
521
|
+
const sliced = target.slice(base.length);
|
|
522
|
+
const dest = sliced === "" ? "/" : sliced;
|
|
523
|
+
if (pathHasSegmentPrefix({
|
|
524
|
+
path: dest,
|
|
525
|
+
prefix: `/${MEMORY_DIR_NAME}`,
|
|
526
|
+
})) {
|
|
527
|
+
throw new FileSystemConfigError(`"${MEMORY_DIR_NAME}" is reserved for shared session memory; refusing to write ${relativePath}`);
|
|
528
|
+
}
|
|
529
|
+
return dest;
|
|
530
|
+
}
|
|
531
|
+
export function writeWorkspaceFilesToRoot(root, files) {
|
|
532
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
+
for (const [relativePath, contents] of Object.entries(files)) {
|
|
534
|
+
// Refuse escapes, then write the sanitized relative dest so
|
|
535
|
+
// `localFileSystem` joins against cwd and `tempFs` still normalizes
|
|
536
|
+
// `a.txt` → `/a.txt`. Never forward an absolute host path.
|
|
537
|
+
const dest = virtualWorkspaceWritePath(relativePath);
|
|
538
|
+
const relativeDest = dest.replace(/^\//, "");
|
|
539
|
+
if (relativeDest === "") {
|
|
540
|
+
throw new FileSystemConfigError(`Refusing to write the virtual root: ${relativePath}`);
|
|
541
|
+
}
|
|
542
|
+
const fileText = typeof contents === "string"
|
|
543
|
+
? contents
|
|
544
|
+
: Buffer.from(contents.data, "base64").toString("utf8");
|
|
545
|
+
try {
|
|
546
|
+
yield root.write(relativeDest, fileText);
|
|
547
|
+
}
|
|
548
|
+
catch (error) {
|
|
549
|
+
throw new FileSystemConfigError(`workspaceFiles failed to write ${relativePath}: ${error instanceof Error ? error.message : "write failed"}`);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function replaceLiteral(args) {
|
|
555
|
+
if (args.replaceAll) {
|
|
556
|
+
return args.existing.split(args.oldText).join(args.newText);
|
|
557
|
+
}
|
|
558
|
+
const index = args.existing.indexOf(args.oldText);
|
|
559
|
+
if (index === -1) {
|
|
560
|
+
return args.existing;
|
|
561
|
+
}
|
|
562
|
+
return (args.existing.slice(0, index) + args.newText + args.existing.slice(index + args.oldText.length));
|
|
563
|
+
}
|
|
564
|
+
function countNonOverlapping(haystack, needle) {
|
|
565
|
+
let count = 0;
|
|
566
|
+
let from = 0;
|
|
567
|
+
while (from <= haystack.length - needle.length) {
|
|
568
|
+
const index = haystack.indexOf(needle, from);
|
|
569
|
+
if (index === -1) {
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
count++;
|
|
573
|
+
from = index + needle.length;
|
|
574
|
+
}
|
|
575
|
+
return count;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Exact, non-overlapping str-replace. Uniqueness is the FileSystem
|
|
579
|
+
* contract: more than one match fails unless `replaceAll`.
|
|
580
|
+
*/
|
|
581
|
+
function applyExactEdit(args) {
|
|
582
|
+
if (args.oldText === "") {
|
|
583
|
+
throw new EditError(args.path, "oldText is empty");
|
|
584
|
+
}
|
|
585
|
+
if (args.oldText === args.newText) {
|
|
586
|
+
throw new EditError(args.path, "oldText and newText are exactly the same");
|
|
587
|
+
}
|
|
588
|
+
const occurrences = countNonOverlapping(args.existing, args.oldText);
|
|
589
|
+
if (occurrences === 0) {
|
|
590
|
+
throw new EditError(args.path, "The string to replace was not found in the file");
|
|
591
|
+
}
|
|
592
|
+
if (occurrences > 1 && !args.replaceAll) {
|
|
593
|
+
throw new EditError(args.path, "The string to replace was found multiple times in the file. Use replace_all to replace all occurrences, or include more context to only edit one occurrence.");
|
|
594
|
+
}
|
|
595
|
+
return {
|
|
596
|
+
contents: replaceLiteral({
|
|
597
|
+
existing: args.existing,
|
|
598
|
+
oldText: args.oldText,
|
|
599
|
+
newText: args.newText,
|
|
600
|
+
replaceAll: args.replaceAll,
|
|
601
|
+
}),
|
|
602
|
+
occurrencesModified: occurrences,
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Exact str-replace as `read` + apply + `write`. Uniqueness is
|
|
607
|
+
* this helper's contract; FileSystem implementations do not
|
|
608
|
+
* implement edit. Native StrReplace calls this.
|
|
609
|
+
*/
|
|
610
|
+
export function strReplaceOnFileSystem(root, query) {
|
|
611
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
612
|
+
const existing = yield root.read(query.path);
|
|
613
|
+
if (typeof existing !== "string") {
|
|
614
|
+
throw new EditError(query.path, `${query.path} is not text`);
|
|
615
|
+
}
|
|
616
|
+
const applied = applyExactEdit({
|
|
617
|
+
existing,
|
|
618
|
+
oldText: query.oldText,
|
|
619
|
+
newText: query.newText,
|
|
620
|
+
replaceAll: query.replaceAll === true,
|
|
621
|
+
path: query.path,
|
|
622
|
+
});
|
|
623
|
+
yield root.write(query.path, applied.contents);
|
|
624
|
+
return { occurrencesModified: applied.occurrencesModified };
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
/** Native Read offset/limit: 1-indexed, negative offset counts from the end. */
|
|
628
|
+
export function sliceReadContent(content, offset, limit) {
|
|
629
|
+
if (offset === undefined && limit === undefined) {
|
|
630
|
+
return content;
|
|
631
|
+
}
|
|
632
|
+
const lines = content === "" ? [] : content.split("\n");
|
|
633
|
+
const total = lines.length;
|
|
634
|
+
const effectiveOffset = offset !== null && offset !== void 0 ? offset : 1;
|
|
635
|
+
const effectiveLimit = limit !== null && limit !== void 0 ? limit : (effectiveOffset < 0 ? Math.abs(effectiveOffset) : total);
|
|
636
|
+
const startIndex = effectiveOffset < 0 ? Math.max(0, total + effectiveOffset) : Math.max(0, effectiveOffset - 1);
|
|
637
|
+
const endIndex = Math.min(total, startIndex + effectiveLimit);
|
|
638
|
+
return lines.slice(startIndex, endIndex).join("\n");
|
|
639
|
+
}
|
|
640
|
+
function emptySearch(_query) { return __asyncGenerator(this, arguments, function* emptySearch_1() { }); }
|
|
641
|
+
function emptyStream() { return __asyncGenerator(this, arguments, function* emptyStream_1() { }); }
|
|
642
|
+
/**
|
|
643
|
+
* A FileSystem with no files. Use as an overlay leaf or a missing
|
|
644
|
+
* catalog so a miss stays {@link FileNotFoundError} instead of
|
|
645
|
+
* {@link NoMountError}. Writes and deletes throw
|
|
646
|
+
* {@link ReadOnlyMountError} — an empty tree is never a sink.
|
|
647
|
+
*/
|
|
648
|
+
export function emptyFs() {
|
|
649
|
+
return {
|
|
650
|
+
list: () => emptyStream(),
|
|
651
|
+
glob: () => emptyStream(),
|
|
652
|
+
grep(query) {
|
|
653
|
+
return __asyncGenerator(this, arguments, function* grep_1() {
|
|
654
|
+
compileGrepPattern(query.pattern, query.caseInsensitive, query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path));
|
|
655
|
+
yield __await(yield* __asyncDelegator(__asyncValues(emptyStream())));
|
|
656
|
+
});
|
|
657
|
+
},
|
|
658
|
+
search: emptySearch,
|
|
659
|
+
stat(path) {
|
|
660
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
661
|
+
return statFromFilePaths([], path);
|
|
662
|
+
});
|
|
663
|
+
},
|
|
664
|
+
read(path) {
|
|
665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
666
|
+
throw new FileNotFoundError(normalizeFsPath(path));
|
|
667
|
+
});
|
|
668
|
+
},
|
|
669
|
+
write(path) {
|
|
670
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
671
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
672
|
+
});
|
|
673
|
+
},
|
|
674
|
+
delete(path) {
|
|
675
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
676
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
677
|
+
});
|
|
678
|
+
},
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* In-memory FileSystem for tests and fixtures. Keys are absolute
|
|
683
|
+
* posix paths (`/a.txt`) and are normalized on ingest. Honors the
|
|
684
|
+
* {@link FileSystem} order and path contracts.
|
|
685
|
+
* `search` is empty. Creates `/agent-tools` on first scratch
|
|
686
|
+
* write the same way any other path is created.
|
|
687
|
+
*/
|
|
688
|
+
export function tempFs(files = {}) {
|
|
689
|
+
const store = new Map();
|
|
690
|
+
for (const [path, content] of Object.entries(files)) {
|
|
691
|
+
store.set(normalizeFsPath(path), content);
|
|
692
|
+
}
|
|
693
|
+
const listed = {
|
|
694
|
+
list(prefix, options) {
|
|
695
|
+
return listFilesFromPaths([...store.entries()].map(([filePath, content]) => ({
|
|
696
|
+
path: filePath,
|
|
697
|
+
size: typeof content === "string" ? content.length : content.byteLength,
|
|
698
|
+
})), prefix, options);
|
|
699
|
+
},
|
|
700
|
+
stat(path) {
|
|
701
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
702
|
+
return statFromFilePaths(store.keys(), path);
|
|
703
|
+
});
|
|
704
|
+
},
|
|
705
|
+
};
|
|
706
|
+
return {
|
|
707
|
+
list(prefix, options) {
|
|
708
|
+
return listed.list(prefix, options);
|
|
709
|
+
},
|
|
710
|
+
stat(path) {
|
|
711
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
712
|
+
return listed.stat(path);
|
|
713
|
+
});
|
|
714
|
+
},
|
|
715
|
+
read(inputPath) {
|
|
716
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
717
|
+
const path = normalizeFsPath(inputPath);
|
|
718
|
+
const content = store.get(path);
|
|
719
|
+
if (content === undefined) {
|
|
720
|
+
throw new FileNotFoundError(path);
|
|
721
|
+
}
|
|
722
|
+
return content;
|
|
723
|
+
});
|
|
724
|
+
},
|
|
725
|
+
grep(query) {
|
|
726
|
+
return __asyncGenerator(this, arguments, function* grep_2() {
|
|
727
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), query.maxResults))));
|
|
728
|
+
function uncapped() {
|
|
729
|
+
return __asyncGenerator(this, arguments, function* uncapped_1() {
|
|
730
|
+
var _a, e_3, _b, _c;
|
|
731
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path));
|
|
732
|
+
const scope = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
733
|
+
const exact = store.get(scope);
|
|
734
|
+
if (scope !== "/" && exact !== undefined) {
|
|
735
|
+
if (query.glob !== undefined &&
|
|
736
|
+
!pathMatchesGlob(scope, scope, query.glob, {
|
|
737
|
+
matchBasename: true,
|
|
738
|
+
})) {
|
|
739
|
+
return yield __await(void 0);
|
|
740
|
+
}
|
|
741
|
+
if (isExcludedPath(scope, query.excludes)) {
|
|
742
|
+
return yield __await(void 0);
|
|
743
|
+
}
|
|
744
|
+
yield __await(yield* __asyncDelegator(__asyncValues(grepFileContent({
|
|
745
|
+
path: scope,
|
|
746
|
+
content: fileSystemText(exact),
|
|
747
|
+
regex,
|
|
748
|
+
}))));
|
|
749
|
+
return yield __await(void 0);
|
|
750
|
+
}
|
|
751
|
+
try {
|
|
752
|
+
for (var _d = true, _e = __asyncValues(listed.list(scope === "/" ? undefined : scope, query.excludes === undefined ? undefined : { excludes: query.excludes })), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
753
|
+
_c = _f.value;
|
|
754
|
+
_d = false;
|
|
755
|
+
const entry = _c;
|
|
756
|
+
if (query.glob !== undefined &&
|
|
757
|
+
!pathMatchesGlob(entry.path, scope, query.glob, {
|
|
758
|
+
matchBasename: true,
|
|
759
|
+
})) {
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
const content = store.get(entry.path);
|
|
763
|
+
if (content === undefined) {
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
yield __await(yield* __asyncDelegator(__asyncValues(grepFileContent({
|
|
767
|
+
path: entry.path,
|
|
768
|
+
content: fileSystemText(content),
|
|
769
|
+
regex,
|
|
770
|
+
}))));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
774
|
+
finally {
|
|
775
|
+
try {
|
|
776
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
777
|
+
}
|
|
778
|
+
finally { if (e_3) throw e_3.error; }
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
},
|
|
784
|
+
glob(pattern, dir, options) {
|
|
785
|
+
return __asyncGenerator(this, arguments, function* glob_1() {
|
|
786
|
+
const scope = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
787
|
+
yield __await(yield* __asyncDelegator(__asyncValues(globFromList(listed.list(scope === "/" ? undefined : scope), Object.assign({ pattern, dir: scope }, ((options === null || options === void 0 ? void 0 : options.limit) === undefined ? {} : { limit: options.limit }))))));
|
|
788
|
+
});
|
|
789
|
+
},
|
|
790
|
+
write(inputPath, contents) {
|
|
791
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
792
|
+
store.set(normalizeFsPath(inputPath), contents);
|
|
793
|
+
});
|
|
794
|
+
},
|
|
795
|
+
delete(inputPath) {
|
|
796
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
797
|
+
const path = normalizeFsPath(inputPath);
|
|
798
|
+
if (!store.has(path)) {
|
|
799
|
+
throw new FileNotFoundError(path);
|
|
800
|
+
}
|
|
801
|
+
store.delete(path);
|
|
802
|
+
});
|
|
803
|
+
},
|
|
804
|
+
search: emptySearch,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
function fsErrorMessage(error, fallback) {
|
|
808
|
+
return error instanceof Error ? error.message : fallback;
|
|
809
|
+
}
|
|
810
|
+
function throwLocalReadError(error, filePath) {
|
|
811
|
+
throw new FileNotFoundError(filePath, fsErrorMessage(error, `not found: ${filePath}`));
|
|
812
|
+
}
|
|
813
|
+
function skipWalkDir(name) {
|
|
814
|
+
return name === ".git" || name === "node_modules";
|
|
815
|
+
}
|
|
816
|
+
function walkLocalFiles(rootDir) {
|
|
817
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
818
|
+
const found = [];
|
|
819
|
+
const stack = [rootDir];
|
|
820
|
+
while (stack.length > 0) {
|
|
821
|
+
const current = stack.pop();
|
|
822
|
+
if (current === undefined) {
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
let entries;
|
|
826
|
+
try {
|
|
827
|
+
entries = yield readdir(current, { withFileTypes: true });
|
|
828
|
+
}
|
|
829
|
+
catch (_a) {
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
for (const entry of entries) {
|
|
833
|
+
const full = path.join(current, entry.name);
|
|
834
|
+
// Same as the pre-root host walk and native LS/Glob/Grep: Dirent
|
|
835
|
+
// isDirectory/isFile do not follow links, so workspace `memory/`
|
|
836
|
+
// and other symlinks are not enumerated. Exact-path read/stat still
|
|
837
|
+
// follow.
|
|
838
|
+
if (entry.isDirectory()) {
|
|
839
|
+
if (!skipWalkDir(entry.name)) {
|
|
840
|
+
stack.push(full);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
else if (entry.isFile()) {
|
|
844
|
+
found.push(full);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
found.sort((left, right) => left.localeCompare(right));
|
|
849
|
+
return found;
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
function listLocalFiles(rootDir) {
|
|
853
|
+
return __asyncGenerator(this, arguments, function* listLocalFiles_1() {
|
|
854
|
+
for (const filePath of yield __await(walkLocalFiles(rootDir))) {
|
|
855
|
+
yield yield __await({ path: filePath });
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Host-disk FileSystem. Relative paths resolve against `cwd`; absolute
|
|
861
|
+
* paths are used as-is — the same contract as Cursor SDK native file
|
|
862
|
+
* tools. `search` yields empty results (no host index).
|
|
863
|
+
*
|
|
864
|
+
* Internal. Not part of the public Agent SDK surface.
|
|
865
|
+
*/
|
|
866
|
+
export function localFileSystem(options) {
|
|
867
|
+
const cwd = path.resolve(options.cwd);
|
|
868
|
+
const resolvePath = (input) => path.isAbsolute(input) ? path.resolve(input) : path.resolve(cwd, input);
|
|
869
|
+
return {
|
|
870
|
+
list(prefix, options) {
|
|
871
|
+
return __asyncGenerator(this, arguments, function* list_1() {
|
|
872
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), options === null || options === void 0 ? void 0 : options.limit))));
|
|
873
|
+
function uncapped() {
|
|
874
|
+
return __asyncGenerator(this, arguments, function* uncapped_2() {
|
|
875
|
+
var _a, e_4, _b, _c;
|
|
876
|
+
const dirPath = prefix === undefined || prefix === "" || prefix === "." ? cwd : resolvePath(prefix);
|
|
877
|
+
try {
|
|
878
|
+
for (var _d = true, _e = __asyncValues(listLocalFiles(dirPath)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
879
|
+
_c = _f.value;
|
|
880
|
+
_d = false;
|
|
881
|
+
const entry = _c;
|
|
882
|
+
if (!isExcludedPath(entry.path, options === null || options === void 0 ? void 0 : options.excludes)) {
|
|
883
|
+
yield yield __await(entry);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
888
|
+
finally {
|
|
889
|
+
try {
|
|
890
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
891
|
+
}
|
|
892
|
+
finally { if (e_4) throw e_4.error; }
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
},
|
|
898
|
+
stat(probePath) {
|
|
899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
+
const filePath = resolvePath(probePath);
|
|
901
|
+
try {
|
|
902
|
+
const info = yield stat(filePath);
|
|
903
|
+
return { kind: info.isDirectory() ? "directory" : "file" };
|
|
904
|
+
}
|
|
905
|
+
catch (_a) {
|
|
906
|
+
return { kind: "missing" };
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
},
|
|
910
|
+
read(inputPath) {
|
|
911
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
912
|
+
const filePath = resolvePath(inputPath);
|
|
913
|
+
try {
|
|
914
|
+
const bytes = yield readFile(filePath);
|
|
915
|
+
if (detectImageMimeType(bytes, filePath) !== undefined) {
|
|
916
|
+
return new Uint8Array(bytes);
|
|
917
|
+
}
|
|
918
|
+
return bytes.toString("utf8");
|
|
919
|
+
}
|
|
920
|
+
catch (error) {
|
|
921
|
+
throwLocalReadError(error, filePath);
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
},
|
|
925
|
+
grep(query) {
|
|
926
|
+
return __asyncGenerator(this, arguments, function* grep_3() {
|
|
927
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), query.maxResults))));
|
|
928
|
+
function uncapped() {
|
|
929
|
+
return __asyncGenerator(this, arguments, function* uncapped_3() {
|
|
930
|
+
var _a;
|
|
931
|
+
const searchRoot = resolvePath((_a = query.path) !== null && _a !== void 0 ? _a : cwd);
|
|
932
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, searchRoot);
|
|
933
|
+
let filesToSearch;
|
|
934
|
+
try {
|
|
935
|
+
const info = yield __await(stat(searchRoot));
|
|
936
|
+
filesToSearch = info.isFile() ? [searchRoot] : yield __await(walkLocalFiles(searchRoot));
|
|
937
|
+
}
|
|
938
|
+
catch (error) {
|
|
939
|
+
throwLocalReadError(error, searchRoot);
|
|
940
|
+
}
|
|
941
|
+
for (const filePath of filesToSearch) {
|
|
942
|
+
if (query.glob !== undefined &&
|
|
943
|
+
!pathMatchesGlob(filePath, searchRoot, query.glob, {
|
|
944
|
+
matchBasename: true,
|
|
945
|
+
})) {
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
if (isExcludedPath(filePath, query.excludes)) {
|
|
949
|
+
continue;
|
|
950
|
+
}
|
|
951
|
+
let content;
|
|
952
|
+
try {
|
|
953
|
+
content = yield __await(readFile(filePath, "utf8"));
|
|
954
|
+
}
|
|
955
|
+
catch (_b) {
|
|
956
|
+
continue;
|
|
957
|
+
}
|
|
958
|
+
yield __await(yield* __asyncDelegator(__asyncValues(grepFileContent({ path: filePath, content, regex }))));
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
},
|
|
964
|
+
glob(pattern, dir, options) {
|
|
965
|
+
return __asyncGenerator(this, arguments, function* glob_2() {
|
|
966
|
+
const dirPath = dir === undefined || dir === "" || dir === "." ? cwd : resolvePath(dir);
|
|
967
|
+
yield __await(yield* __asyncDelegator(__asyncValues(globFromList(listLocalFiles(dirPath), Object.assign({ pattern, dir: dirPath }, ((options === null || options === void 0 ? void 0 : options.limit) === undefined ? {} : { limit: options.limit }))))));
|
|
968
|
+
});
|
|
969
|
+
},
|
|
970
|
+
write(inputPath, contents) {
|
|
971
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
972
|
+
const filePath = resolvePath(inputPath);
|
|
973
|
+
try {
|
|
974
|
+
yield mkdir(path.dirname(filePath), { recursive: true });
|
|
975
|
+
yield writeFile(filePath, contents, "utf8");
|
|
976
|
+
}
|
|
977
|
+
catch (error) {
|
|
978
|
+
throw new WriteFailedError(filePath, fsErrorMessage(error, `write failed: ${filePath}`));
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
},
|
|
982
|
+
delete(inputPath) {
|
|
983
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
984
|
+
const filePath = resolvePath(inputPath);
|
|
985
|
+
try {
|
|
986
|
+
yield rm(filePath);
|
|
987
|
+
}
|
|
988
|
+
catch (error) {
|
|
989
|
+
throwLocalReadError(error, filePath);
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
search: emptySearch,
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
function longestMount(path, mounts) {
|
|
997
|
+
let best;
|
|
998
|
+
for (const mount of mounts) {
|
|
999
|
+
if (!pathHasSegmentPrefix({ path, prefix: mount.prefix })) {
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
if (best === undefined || mount.prefix.length > best.prefix.length) {
|
|
1003
|
+
best = mount;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
return best;
|
|
1007
|
+
}
|
|
1008
|
+
/** Namespace path → child path. `/host/a.md` on `/host` is `/a.md`. */
|
|
1009
|
+
function toChildPath(path, prefix) {
|
|
1010
|
+
if (prefix === "/") {
|
|
1011
|
+
return path;
|
|
1012
|
+
}
|
|
1013
|
+
if (path === prefix) {
|
|
1014
|
+
return "/";
|
|
1015
|
+
}
|
|
1016
|
+
if (path.startsWith(`${prefix}/`)) {
|
|
1017
|
+
return path.slice(prefix.length);
|
|
1018
|
+
}
|
|
1019
|
+
return path;
|
|
1020
|
+
}
|
|
1021
|
+
/** Child path → namespace path. `/a.md` on `/host` is `/host/a.md`. */
|
|
1022
|
+
function toParentPath(path, prefix) {
|
|
1023
|
+
if (prefix === "/") {
|
|
1024
|
+
return path;
|
|
1025
|
+
}
|
|
1026
|
+
if (path === "/" || path === "") {
|
|
1027
|
+
return prefix;
|
|
1028
|
+
}
|
|
1029
|
+
return path.startsWith("/") ? `${prefix}${path}` : `${prefix}/${path}`;
|
|
1030
|
+
}
|
|
1031
|
+
function mapMountEntries(source, prefix) {
|
|
1032
|
+
return __asyncGenerator(this, arguments, function* mapMountEntries_1() {
|
|
1033
|
+
var _a, e_5, _b, _c;
|
|
1034
|
+
try {
|
|
1035
|
+
try {
|
|
1036
|
+
for (var _d = true, source_2 = __asyncValues(source), source_2_1; source_2_1 = yield __await(source_2.next()), _a = source_2_1.done, !_a; _d = true) {
|
|
1037
|
+
_c = source_2_1.value;
|
|
1038
|
+
_d = false;
|
|
1039
|
+
const entry = _c;
|
|
1040
|
+
yield yield __await(Object.assign(Object.assign({}, entry), { path: toParentPath(entry.path, prefix) }));
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1044
|
+
finally {
|
|
1045
|
+
try {
|
|
1046
|
+
if (!_d && !_a && (_b = source_2.return)) yield __await(_b.call(source_2));
|
|
1047
|
+
}
|
|
1048
|
+
finally { if (e_5) throw e_5.error; }
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
catch (error) {
|
|
1052
|
+
throw remapPathError(error, prefix);
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
function mapMountGrep(source, prefix) {
|
|
1057
|
+
return __asyncGenerator(this, arguments, function* mapMountGrep_1() {
|
|
1058
|
+
var _a, e_6, _b, _c;
|
|
1059
|
+
try {
|
|
1060
|
+
try {
|
|
1061
|
+
for (var _d = true, source_3 = __asyncValues(source), source_3_1; source_3_1 = yield __await(source_3.next()), _a = source_3_1.done, !_a; _d = true) {
|
|
1062
|
+
_c = source_3_1.value;
|
|
1063
|
+
_d = false;
|
|
1064
|
+
const hit = _c;
|
|
1065
|
+
yield yield __await(Object.assign(Object.assign({}, hit), { path: toParentPath(hit.path, prefix) }));
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1069
|
+
finally {
|
|
1070
|
+
try {
|
|
1071
|
+
if (!_d && !_a && (_b = source_3.return)) yield __await(_b.call(source_3));
|
|
1072
|
+
}
|
|
1073
|
+
finally { if (e_6) throw e_6.error; }
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
catch (error) {
|
|
1077
|
+
throw remapPathError(error, prefix);
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
function mapMountSearch(source, prefix) {
|
|
1082
|
+
return __asyncGenerator(this, arguments, function* mapMountSearch_1() {
|
|
1083
|
+
var _a, e_7, _b, _c;
|
|
1084
|
+
try {
|
|
1085
|
+
try {
|
|
1086
|
+
for (var _d = true, source_4 = __asyncValues(source), source_4_1; source_4_1 = yield __await(source_4.next()), _a = source_4_1.done, !_a; _d = true) {
|
|
1087
|
+
_c = source_4_1.value;
|
|
1088
|
+
_d = false;
|
|
1089
|
+
const hit = _c;
|
|
1090
|
+
yield yield __await(Object.assign(Object.assign({}, hit), { path: toParentPath(hit.path, prefix) }));
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1094
|
+
finally {
|
|
1095
|
+
try {
|
|
1096
|
+
if (!_d && !_a && (_b = source_4.return)) yield __await(_b.call(source_4));
|
|
1097
|
+
}
|
|
1098
|
+
finally { if (e_7) throw e_7.error; }
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
catch (error) {
|
|
1102
|
+
throw remapPathError(error, prefix);
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
function childSearchQuery(query, prefix) {
|
|
1107
|
+
if (query.targetDirectories === undefined || query.targetDirectories.length === 0) {
|
|
1108
|
+
return query;
|
|
1109
|
+
}
|
|
1110
|
+
const dirs = [];
|
|
1111
|
+
for (const dir of query.targetDirectories) {
|
|
1112
|
+
const normalized = normalizeFsPath(dir);
|
|
1113
|
+
// `/` is every mount, the same way grep at `/` fans out.
|
|
1114
|
+
if (normalized === "/") {
|
|
1115
|
+
return Object.assign(Object.assign({}, query), { targetDirectories: undefined });
|
|
1116
|
+
}
|
|
1117
|
+
if (!pathHasSegmentPrefix({ path: normalized, prefix })) {
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
const child = toChildPath(normalized, prefix);
|
|
1121
|
+
if (child === "/") {
|
|
1122
|
+
return Object.assign(Object.assign({}, query), { targetDirectories: undefined });
|
|
1123
|
+
}
|
|
1124
|
+
dirs.push(child);
|
|
1125
|
+
}
|
|
1126
|
+
if (dirs.length === 0) {
|
|
1127
|
+
return undefined;
|
|
1128
|
+
}
|
|
1129
|
+
return Object.assign(Object.assign({}, query), { targetDirectories: dirs });
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Longest-prefix compose, path-segment match. Every verb is
|
|
1133
|
+
* defined. Does not synthesize `shell`. `/agent` is not a
|
|
1134
|
+
* prefix of `/agent-tools`.
|
|
1135
|
+
*
|
|
1136
|
+
* The record keys are mount points. Each child is a FileSystem
|
|
1137
|
+
* rooted at `/`. `unionFs` strips the prefix on the way in and
|
|
1138
|
+
* re-prefixes yields (and error paths) on the way out:
|
|
1139
|
+
* `unionFs({ "/host": hostFs(...) })` — the child never sees
|
|
1140
|
+
* `/host`.
|
|
1141
|
+
*
|
|
1142
|
+
* A path with no mount:
|
|
1143
|
+
* - `read` / `write` / `delete`: throw
|
|
1144
|
+
* `no mount for path: ${path}`
|
|
1145
|
+
* - `list` / `glob` / `grep`: empty iterator
|
|
1146
|
+
* - `stat`: `{ kind: "missing" }` (`/` and exact mount prefixes
|
|
1147
|
+
* are `{ kind: "directory" }`)
|
|
1148
|
+
*
|
|
1149
|
+
* Root `list` / `glob` / `grep` / `search` k-way merge already
|
|
1150
|
+
* sorted sources. List and glob use `unique` so an earlier
|
|
1151
|
+
* mount shadows a later one; grep and search keep every hit.
|
|
1152
|
+
*/
|
|
1153
|
+
export function unionFs(mounts) {
|
|
1154
|
+
const entries = Object.entries(mounts).map(([prefix, fs]) => ({
|
|
1155
|
+
prefix: normalizeFsPath(prefix),
|
|
1156
|
+
fs,
|
|
1157
|
+
}));
|
|
1158
|
+
entries.sort((a, b) => b.prefix.length - a.prefix.length);
|
|
1159
|
+
const noMount = (path) => {
|
|
1160
|
+
throw new NoMountError(path);
|
|
1161
|
+
};
|
|
1162
|
+
const forward = (path, run) => __awaiter(this, void 0, void 0, function* () {
|
|
1163
|
+
const mount = longestMount(path, entries);
|
|
1164
|
+
if (mount === undefined) {
|
|
1165
|
+
return noMount(path);
|
|
1166
|
+
}
|
|
1167
|
+
const childPath = toChildPath(path, mount.prefix);
|
|
1168
|
+
try {
|
|
1169
|
+
return yield run(mount.fs, childPath);
|
|
1170
|
+
}
|
|
1171
|
+
catch (error) {
|
|
1172
|
+
throw remapPathError(error, mount.prefix);
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
const isRootPath = (value) => value === undefined || value === "" || value === "/";
|
|
1176
|
+
return {
|
|
1177
|
+
list(prefix, options) {
|
|
1178
|
+
return __asyncGenerator(this, arguments, function* list_2() {
|
|
1179
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), options === null || options === void 0 ? void 0 : options.limit))));
|
|
1180
|
+
function uncapped() {
|
|
1181
|
+
return __asyncGenerator(this, arguments, function* uncapped_4() {
|
|
1182
|
+
if (isRootPath(prefix)) {
|
|
1183
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mergeSortedByPath(entries.map(mount => mapMountEntries(mount.fs.list(undefined, options), mount.prefix)), { unique: true }))));
|
|
1184
|
+
return yield __await(void 0);
|
|
1185
|
+
}
|
|
1186
|
+
const path = normalizeFsPath(prefix !== null && prefix !== void 0 ? prefix : "/");
|
|
1187
|
+
const mount = longestMount(path, entries);
|
|
1188
|
+
if (mount === undefined) {
|
|
1189
|
+
return yield __await(void 0);
|
|
1190
|
+
}
|
|
1191
|
+
const childPath = toChildPath(path, mount.prefix);
|
|
1192
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mapMountEntries(mount.fs.list(childPath === "/" ? undefined : childPath, options), mount.prefix))));
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
},
|
|
1197
|
+
stat(path) {
|
|
1198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1199
|
+
const normalized = normalizeFsPath(path);
|
|
1200
|
+
if (normalized === "/") {
|
|
1201
|
+
return { kind: "directory" };
|
|
1202
|
+
}
|
|
1203
|
+
if (entries.some(entry => entry.prefix === normalized)) {
|
|
1204
|
+
return { kind: "directory" };
|
|
1205
|
+
}
|
|
1206
|
+
const mount = longestMount(normalized, entries);
|
|
1207
|
+
if (mount === undefined) {
|
|
1208
|
+
return { kind: "missing" };
|
|
1209
|
+
}
|
|
1210
|
+
return mount.fs.stat(toChildPath(normalized, mount.prefix));
|
|
1211
|
+
});
|
|
1212
|
+
},
|
|
1213
|
+
read(path) {
|
|
1214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1215
|
+
const normalized = normalizeFsPath(path);
|
|
1216
|
+
return forward(normalized, (fs, childPath) => fs.read(childPath));
|
|
1217
|
+
});
|
|
1218
|
+
},
|
|
1219
|
+
write(path, contents) {
|
|
1220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1221
|
+
const normalized = normalizeFsPath(path);
|
|
1222
|
+
return forward(normalized, (fs, childPath) => fs.write(childPath, contents));
|
|
1223
|
+
});
|
|
1224
|
+
},
|
|
1225
|
+
delete(path) {
|
|
1226
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1227
|
+
const normalized = normalizeFsPath(path);
|
|
1228
|
+
return forward(normalized, (fs, childPath) => fs.delete(childPath));
|
|
1229
|
+
});
|
|
1230
|
+
},
|
|
1231
|
+
grep(query) {
|
|
1232
|
+
return __asyncGenerator(this, arguments, function* grep_4() {
|
|
1233
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), query.maxResults))));
|
|
1234
|
+
function uncapped() {
|
|
1235
|
+
return __asyncGenerator(this, arguments, function* uncapped_5() {
|
|
1236
|
+
const scope = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
1237
|
+
if (scope === "/") {
|
|
1238
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mergeSorted(entries.map(mount => mapMountGrep(mount.fs.grep(Object.assign(Object.assign({}, query), { path: undefined })), mount.prefix)), { compare: compareGrepResult }))));
|
|
1239
|
+
return yield __await(void 0);
|
|
1240
|
+
}
|
|
1241
|
+
const mount = longestMount(scope, entries);
|
|
1242
|
+
if (mount === undefined) {
|
|
1243
|
+
return yield __await(void 0);
|
|
1244
|
+
}
|
|
1245
|
+
const childPath = toChildPath(scope, mount.prefix);
|
|
1246
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mapMountGrep(mount.fs.grep(Object.assign(Object.assign({}, query), { path: childPath === "/" ? undefined : childPath })), mount.prefix))));
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
},
|
|
1251
|
+
search(query) {
|
|
1252
|
+
return __asyncGenerator(this, arguments, function* search_1() {
|
|
1253
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), query.maxResults))));
|
|
1254
|
+
function uncapped() {
|
|
1255
|
+
return __asyncGenerator(this, arguments, function* uncapped_6() {
|
|
1256
|
+
const sources = [];
|
|
1257
|
+
for (const mount of entries) {
|
|
1258
|
+
const childQuery = childSearchQuery(query, mount.prefix);
|
|
1259
|
+
if (childQuery === undefined) {
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
sources.push(mapMountSearch(mount.fs.search(childQuery), mount.prefix));
|
|
1263
|
+
}
|
|
1264
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mergeSorted(sources, { compare: compareSearchResult }))));
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
},
|
|
1269
|
+
glob(pattern, dir, options) {
|
|
1270
|
+
return __asyncGenerator(this, arguments, function* glob_3() {
|
|
1271
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), options === null || options === void 0 ? void 0 : options.limit))));
|
|
1272
|
+
function uncapped() {
|
|
1273
|
+
return __asyncGenerator(this, arguments, function* uncapped_7() {
|
|
1274
|
+
const scope = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
1275
|
+
if (scope === "/") {
|
|
1276
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mergeSortedByPath(entries.map(mount => mapMountEntries(mount.fs.glob(pattern, undefined, options), mount.prefix)), { unique: true }))));
|
|
1277
|
+
return yield __await(void 0);
|
|
1278
|
+
}
|
|
1279
|
+
const mount = longestMount(scope, entries);
|
|
1280
|
+
if (mount === undefined) {
|
|
1281
|
+
return yield __await(void 0);
|
|
1282
|
+
}
|
|
1283
|
+
const childPath = toChildPath(scope, mount.prefix);
|
|
1284
|
+
yield __await(yield* __asyncDelegator(__asyncValues(mapMountEntries(mount.fs.glob(pattern, childPath === "/" ? undefined : childPath, options), mount.prefix))));
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
},
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
function collectLayerPaths(layer) {
|
|
1292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1293
|
+
var _a, e_8, _b, _c;
|
|
1294
|
+
const paths = [];
|
|
1295
|
+
try {
|
|
1296
|
+
try {
|
|
1297
|
+
for (var _d = true, _e = __asyncValues(layer.list()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
1298
|
+
_c = _f.value;
|
|
1299
|
+
_d = false;
|
|
1300
|
+
const entry = _c;
|
|
1301
|
+
paths.push(entry.path);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1305
|
+
finally {
|
|
1306
|
+
try {
|
|
1307
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
1308
|
+
}
|
|
1309
|
+
finally { if (e_8) throw e_8.error; }
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
catch (_g) {
|
|
1313
|
+
// A layer that cannot list also cannot own paths.
|
|
1314
|
+
}
|
|
1315
|
+
return paths;
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Same-root overlay: earlier layers win. Read-only.
|
|
1320
|
+
*
|
|
1321
|
+
* A downed layer costs its own files, not the overlay. Mutations
|
|
1322
|
+
* throw `read-only mount` / `read-only mount: ${path}`. Empty
|
|
1323
|
+
* `layers` throws `overlayFs needs at least one layer.`
|
|
1324
|
+
*/
|
|
1325
|
+
export function overlayFs(layers) {
|
|
1326
|
+
if (layers.length === 0) {
|
|
1327
|
+
throw new Error("overlayFs needs at least one layer.");
|
|
1328
|
+
}
|
|
1329
|
+
const walkLayers = (collect) => __awaiter(this, void 0, void 0, function* () {
|
|
1330
|
+
var _a, e_9, _b, _c;
|
|
1331
|
+
const streams = [];
|
|
1332
|
+
let failure;
|
|
1333
|
+
let served = false;
|
|
1334
|
+
for (const layer of layers) {
|
|
1335
|
+
const collected = [];
|
|
1336
|
+
try {
|
|
1337
|
+
try {
|
|
1338
|
+
for (var _d = true, _e = (e_9 = void 0, __asyncValues(yield collect(layer))), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
1339
|
+
_c = _f.value;
|
|
1340
|
+
_d = false;
|
|
1341
|
+
const entry = _c;
|
|
1342
|
+
collected.push(entry);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1346
|
+
finally {
|
|
1347
|
+
try {
|
|
1348
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
1349
|
+
}
|
|
1350
|
+
finally { if (e_9) throw e_9.error; }
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
catch (error) {
|
|
1354
|
+
failure !== null && failure !== void 0 ? failure : (failure = error);
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
served = true;
|
|
1358
|
+
streams.push(collected);
|
|
1359
|
+
}
|
|
1360
|
+
return { streams, failure, served };
|
|
1361
|
+
});
|
|
1362
|
+
const collectOverlayHits = (queryFn, rethrow) => __awaiter(this, void 0, void 0, function* () {
|
|
1363
|
+
var _a, e_10, _b, _c;
|
|
1364
|
+
const streams = [];
|
|
1365
|
+
const shadowed = new Set();
|
|
1366
|
+
let failure;
|
|
1367
|
+
let served = false;
|
|
1368
|
+
for (const layer of layers) {
|
|
1369
|
+
const collected = [];
|
|
1370
|
+
try {
|
|
1371
|
+
try {
|
|
1372
|
+
for (var _d = true, _e = (e_10 = void 0, __asyncValues(queryFn(layer))), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
1373
|
+
_c = _f.value;
|
|
1374
|
+
_d = false;
|
|
1375
|
+
const hit = _c;
|
|
1376
|
+
if (!shadowed.has(hit.path)) {
|
|
1377
|
+
collected.push(hit);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1382
|
+
finally {
|
|
1383
|
+
try {
|
|
1384
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
1385
|
+
}
|
|
1386
|
+
finally { if (e_10) throw e_10.error; }
|
|
1387
|
+
}
|
|
1388
|
+
served = true;
|
|
1389
|
+
}
|
|
1390
|
+
catch (error) {
|
|
1391
|
+
if ((rethrow === null || rethrow === void 0 ? void 0 : rethrow(error)) === true) {
|
|
1392
|
+
throw error;
|
|
1393
|
+
}
|
|
1394
|
+
failure !== null && failure !== void 0 ? failure : (failure = error);
|
|
1395
|
+
continue;
|
|
1396
|
+
}
|
|
1397
|
+
streams.push(collected);
|
|
1398
|
+
for (const path of yield collectLayerPaths(layer)) {
|
|
1399
|
+
shadowed.add(path);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
if (!served && failure !== undefined) {
|
|
1403
|
+
throw failure;
|
|
1404
|
+
}
|
|
1405
|
+
return streams;
|
|
1406
|
+
});
|
|
1407
|
+
return {
|
|
1408
|
+
list(prefix, options) {
|
|
1409
|
+
return __asyncGenerator(this, arguments, function* list_3() {
|
|
1410
|
+
const { streams, failure, served } = yield __await(walkLayers(layer => layer.list(prefix, options)));
|
|
1411
|
+
if (!served && failure !== undefined) {
|
|
1412
|
+
throw failure;
|
|
1413
|
+
}
|
|
1414
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(mergeSortedByPath(streams, { unique: true }), options === null || options === void 0 ? void 0 : options.limit))));
|
|
1415
|
+
});
|
|
1416
|
+
},
|
|
1417
|
+
stat(path) {
|
|
1418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1419
|
+
let failure;
|
|
1420
|
+
let sawMissing = false;
|
|
1421
|
+
for (const layer of layers) {
|
|
1422
|
+
try {
|
|
1423
|
+
const info = yield layer.stat(path);
|
|
1424
|
+
if (info.kind !== "missing") {
|
|
1425
|
+
return info;
|
|
1426
|
+
}
|
|
1427
|
+
sawMissing = true;
|
|
1428
|
+
}
|
|
1429
|
+
catch (error) {
|
|
1430
|
+
failure !== null && failure !== void 0 ? failure : (failure = error);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
if (!sawMissing && failure !== undefined) {
|
|
1434
|
+
throw failure;
|
|
1435
|
+
}
|
|
1436
|
+
return { kind: "missing" };
|
|
1437
|
+
});
|
|
1438
|
+
},
|
|
1439
|
+
glob(pattern, dir, options) {
|
|
1440
|
+
return __asyncGenerator(this, arguments, function* glob_4() {
|
|
1441
|
+
const { streams, failure, served } = yield __await(walkLayers(layer => layer.glob(pattern, dir, options)));
|
|
1442
|
+
if (!served && failure !== undefined) {
|
|
1443
|
+
throw failure;
|
|
1444
|
+
}
|
|
1445
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(mergeSortedByPath(streams, { unique: true }), options === null || options === void 0 ? void 0 : options.limit))));
|
|
1446
|
+
});
|
|
1447
|
+
},
|
|
1448
|
+
read(path) {
|
|
1449
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1450
|
+
let failure;
|
|
1451
|
+
for (const layer of layers) {
|
|
1452
|
+
try {
|
|
1453
|
+
return yield layer.read(path);
|
|
1454
|
+
}
|
|
1455
|
+
catch (error) {
|
|
1456
|
+
if (isFileNotFoundError(error)) {
|
|
1457
|
+
continue;
|
|
1458
|
+
}
|
|
1459
|
+
failure !== null && failure !== void 0 ? failure : (failure = error);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
if (failure !== undefined) {
|
|
1463
|
+
throw failure;
|
|
1464
|
+
}
|
|
1465
|
+
throw new FileNotFoundError(path);
|
|
1466
|
+
});
|
|
1467
|
+
},
|
|
1468
|
+
grep(query) {
|
|
1469
|
+
return __asyncGenerator(this, arguments, function* grep_5() {
|
|
1470
|
+
const { maxResults } = query, uncappedQuery = __rest(query, ["maxResults"]);
|
|
1471
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(mergeSorted(yield __await(collectOverlayHits(layer => layer.grep(uncappedQuery), error => isInvalidGrepPatternError(error))), { compare: compareGrepResult }), maxResults))));
|
|
1472
|
+
});
|
|
1473
|
+
},
|
|
1474
|
+
write(path) {
|
|
1475
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1476
|
+
throw new ReadOnlyMountError(path);
|
|
1477
|
+
});
|
|
1478
|
+
},
|
|
1479
|
+
delete(path) {
|
|
1480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1481
|
+
throw new ReadOnlyMountError(path);
|
|
1482
|
+
});
|
|
1483
|
+
},
|
|
1484
|
+
search(query) {
|
|
1485
|
+
return __asyncGenerator(this, arguments, function* search_2() {
|
|
1486
|
+
const { maxResults } = query, uncappedQuery = __rest(query, ["maxResults"]);
|
|
1487
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(mergeSorted(yield __await(collectOverlayHits(layer => layer.search(uncappedQuery))), {
|
|
1488
|
+
compare: compareSearchResult,
|
|
1489
|
+
}), maxResults))));
|
|
1490
|
+
});
|
|
1491
|
+
},
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
function hostKey(path) {
|
|
1495
|
+
const normalized = normalizeFsPath(path);
|
|
1496
|
+
return normalized === "/" ? "" : normalized.slice(1);
|
|
1497
|
+
}
|
|
1498
|
+
function isHostConflict(error) {
|
|
1499
|
+
return (error instanceof FileConflictError ||
|
|
1500
|
+
(error instanceof Error &&
|
|
1501
|
+
(error.name === "FileConflictError" || error.message.includes("lost a race"))));
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* `HostFilesApi` as a FileSystem rooted at `/`.
|
|
1505
|
+
*
|
|
1506
|
+
* Mount it with `unionFs({ "/host": hostFs(files, scope) })`. The
|
|
1507
|
+
* child never sees `/host` — `unionFs` owns the prefix. `scope` is
|
|
1508
|
+
* the HostFiles partition, not a path prefix. `search` is empty
|
|
1509
|
+
* (HostFiles is not an index).
|
|
1510
|
+
*/
|
|
1511
|
+
export function hostFs(files, scope) {
|
|
1512
|
+
const callOptions = { scope };
|
|
1513
|
+
const readEtags = new Map();
|
|
1514
|
+
const listed = {
|
|
1515
|
+
list(prefix, options) {
|
|
1516
|
+
return __asyncGenerator(this, arguments, function* list_4() {
|
|
1517
|
+
const entries = yield __await(files.list(undefined, callOptions));
|
|
1518
|
+
yield __await(yield* __asyncDelegator(__asyncValues(listFilesFromPaths(entries.map(entry => ({
|
|
1519
|
+
path: normalizeFsPath(entry.path),
|
|
1520
|
+
size: entry.size,
|
|
1521
|
+
})), prefix, options))));
|
|
1522
|
+
});
|
|
1523
|
+
},
|
|
1524
|
+
stat(path) {
|
|
1525
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1526
|
+
const entries = yield files.list(undefined, callOptions);
|
|
1527
|
+
return statFromFilePaths(entries.map(entry => normalizeFsPath(entry.path)), path);
|
|
1528
|
+
});
|
|
1529
|
+
},
|
|
1530
|
+
};
|
|
1531
|
+
const readText = (inputPath) => __awaiter(this, void 0, void 0, function* () {
|
|
1532
|
+
const path = normalizeFsPath(inputPath);
|
|
1533
|
+
const key = hostKey(path);
|
|
1534
|
+
if (key === "") {
|
|
1535
|
+
throw new FileNotFoundError(path);
|
|
1536
|
+
}
|
|
1537
|
+
const [content, stat] = yield Promise.all([
|
|
1538
|
+
files.read(key, callOptions),
|
|
1539
|
+
files.stat(key, callOptions),
|
|
1540
|
+
]);
|
|
1541
|
+
if (content === undefined) {
|
|
1542
|
+
throw new FileNotFoundError(path);
|
|
1543
|
+
}
|
|
1544
|
+
if ((stat === null || stat === void 0 ? void 0 : stat.etag) !== undefined) {
|
|
1545
|
+
readEtags.set(key, stat.etag);
|
|
1546
|
+
}
|
|
1547
|
+
return content;
|
|
1548
|
+
});
|
|
1549
|
+
const writeHost = (inputPath, contents) => __awaiter(this, void 0, void 0, function* () {
|
|
1550
|
+
const path = normalizeFsPath(inputPath);
|
|
1551
|
+
const key = hostKey(path);
|
|
1552
|
+
if (key === "") {
|
|
1553
|
+
throw new FileNotFoundError(path);
|
|
1554
|
+
}
|
|
1555
|
+
try {
|
|
1556
|
+
if (files.capabilities.conflictDetection) {
|
|
1557
|
+
const etag = readEtags.get(key);
|
|
1558
|
+
yield files.write(key, contents, Object.assign(Object.assign({}, callOptions), (etag === undefined ? {} : { ifMatch: etag })));
|
|
1559
|
+
}
|
|
1560
|
+
else {
|
|
1561
|
+
yield files.write(key, contents, callOptions);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
catch (error) {
|
|
1565
|
+
if (isHostConflict(error)) {
|
|
1566
|
+
throw new PathError(path, `${path} changed since you read it — read it again and rewrite.`);
|
|
1567
|
+
}
|
|
1568
|
+
throw error;
|
|
1569
|
+
}
|
|
1570
|
+
const stat = yield files.stat(key, callOptions);
|
|
1571
|
+
if ((stat === null || stat === void 0 ? void 0 : stat.etag) !== undefined) {
|
|
1572
|
+
readEtags.set(key, stat.etag);
|
|
1573
|
+
}
|
|
1574
|
+
else {
|
|
1575
|
+
readEtags.delete(key);
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1578
|
+
return {
|
|
1579
|
+
list(prefix, options) {
|
|
1580
|
+
return listed.list(prefix, options);
|
|
1581
|
+
},
|
|
1582
|
+
stat(path) {
|
|
1583
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1584
|
+
return listed.stat(path);
|
|
1585
|
+
});
|
|
1586
|
+
},
|
|
1587
|
+
read(path) {
|
|
1588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1589
|
+
return readText(path);
|
|
1590
|
+
});
|
|
1591
|
+
},
|
|
1592
|
+
grep(query) {
|
|
1593
|
+
return __asyncGenerator(this, arguments, function* grep_6() {
|
|
1594
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), query.maxResults))));
|
|
1595
|
+
function uncapped() {
|
|
1596
|
+
return __asyncGenerator(this, arguments, function* uncapped_8() {
|
|
1597
|
+
var _a, e_11, _b, _c;
|
|
1598
|
+
const scopePath = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
1599
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, scopePath);
|
|
1600
|
+
const info = yield __await(listed.stat(scopePath));
|
|
1601
|
+
if (scopePath !== "/" && info.kind === "file") {
|
|
1602
|
+
if (query.glob !== undefined &&
|
|
1603
|
+
!pathMatchesGlob(scopePath, scopePath, query.glob, {
|
|
1604
|
+
matchBasename: true,
|
|
1605
|
+
})) {
|
|
1606
|
+
return yield __await(void 0);
|
|
1607
|
+
}
|
|
1608
|
+
if (isExcludedPath(scopePath, query.excludes)) {
|
|
1609
|
+
return yield __await(void 0);
|
|
1610
|
+
}
|
|
1611
|
+
yield __await(yield* __asyncDelegator(__asyncValues(grepFileContent({
|
|
1612
|
+
path: scopePath,
|
|
1613
|
+
content: yield __await(readText(scopePath)),
|
|
1614
|
+
regex,
|
|
1615
|
+
}))));
|
|
1616
|
+
return yield __await(void 0);
|
|
1617
|
+
}
|
|
1618
|
+
try {
|
|
1619
|
+
for (var _d = true, _e = __asyncValues(listed.list(scopePath === "/" ? undefined : scopePath, query.excludes === undefined ? undefined : { excludes: query.excludes })), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
1620
|
+
_c = _f.value;
|
|
1621
|
+
_d = false;
|
|
1622
|
+
const entry = _c;
|
|
1623
|
+
if (query.glob !== undefined &&
|
|
1624
|
+
!pathMatchesGlob(entry.path, scopePath, query.glob, {
|
|
1625
|
+
matchBasename: true,
|
|
1626
|
+
})) {
|
|
1627
|
+
continue;
|
|
1628
|
+
}
|
|
1629
|
+
yield __await(yield* __asyncDelegator(__asyncValues(grepFileContent({
|
|
1630
|
+
path: entry.path,
|
|
1631
|
+
content: yield __await(readText(entry.path)),
|
|
1632
|
+
regex,
|
|
1633
|
+
}))));
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1637
|
+
finally {
|
|
1638
|
+
try {
|
|
1639
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
1640
|
+
}
|
|
1641
|
+
finally { if (e_11) throw e_11.error; }
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
},
|
|
1647
|
+
glob(pattern, dir, options) {
|
|
1648
|
+
return __asyncGenerator(this, arguments, function* glob_5() {
|
|
1649
|
+
const dirPath = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
1650
|
+
yield __await(yield* __asyncDelegator(__asyncValues(globFromList(listed.list(dirPath === "/" ? undefined : dirPath), Object.assign({ pattern, dir: dirPath }, ((options === null || options === void 0 ? void 0 : options.limit) === undefined ? {} : { limit: options.limit }))))));
|
|
1651
|
+
});
|
|
1652
|
+
},
|
|
1653
|
+
write(inputPath, contents) {
|
|
1654
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1655
|
+
yield writeHost(inputPath, contents);
|
|
1656
|
+
});
|
|
1657
|
+
},
|
|
1658
|
+
delete(inputPath) {
|
|
1659
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1660
|
+
const path = normalizeFsPath(inputPath);
|
|
1661
|
+
const key = hostKey(path);
|
|
1662
|
+
if (key === "" || !(yield files.exists(key, callOptions))) {
|
|
1663
|
+
throw new FileNotFoundError(path);
|
|
1664
|
+
}
|
|
1665
|
+
yield files.remove(key, callOptions);
|
|
1666
|
+
readEtags.delete(key);
|
|
1667
|
+
});
|
|
1668
|
+
},
|
|
1669
|
+
search: emptySearch,
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
function globFromList(source, options) {
|
|
1673
|
+
return __asyncGenerator(this, arguments, function* globFromList_1() {
|
|
1674
|
+
yield __await(yield* __asyncDelegator(__asyncValues(limitResults(uncapped(), options.limit))));
|
|
1675
|
+
function uncapped() {
|
|
1676
|
+
return __asyncGenerator(this, arguments, function* uncapped_9() {
|
|
1677
|
+
var _a, e_12, _b, _c;
|
|
1678
|
+
try {
|
|
1679
|
+
for (var _d = true, source_5 = __asyncValues(source), source_5_1; source_5_1 = yield __await(source_5.next()), _a = source_5_1.done, !_a; _d = true) {
|
|
1680
|
+
_c = source_5_1.value;
|
|
1681
|
+
_d = false;
|
|
1682
|
+
const entry = _c;
|
|
1683
|
+
if (pathMatchesGlob(entry.path, options.dir, options.pattern)) {
|
|
1684
|
+
yield yield __await(entry);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1689
|
+
finally {
|
|
1690
|
+
try {
|
|
1691
|
+
if (!_d && !_a && (_b = source_5.return)) yield __await(_b.call(source_5));
|
|
1692
|
+
}
|
|
1693
|
+
finally { if (e_12) throw e_12.error; }
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1698
|
+
}
|