@grok/agent-sdk 0.0.0-stage → 0.2.27
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 +336 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE.md +3 -0
- package/README.md +106 -2
- package/dist/artifacts.d.ts +37 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +52 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +20 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1703 -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 +648 -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 +313 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +47 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +173 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +73 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +399 -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 +90 -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 +77 -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 +59 -0
- package/dist/channels/bitbucket/index.d.ts +38 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +37 -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 +326 -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 +30 -0
- package/dist/channels/bitbucket/types.d.ts +236 -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 +76 -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 +188 -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 +373 -0
- package/dist/channels/github/auth.d.ts +71 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +247 -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 +123 -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 +93 -0
- package/dist/channels/github/cursor-account.d.ts +109 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +206 -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 +132 -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 +263 -0
- package/dist/channels/github/github-channel.d.ts +187 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +2089 -0
- package/dist/channels/github/index.d.ts +64 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +52 -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 +235 -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 +269 -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 +77 -0
- package/dist/channels/github/types.d.ts +515 -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 +220 -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 +166 -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 +121 -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 +61 -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 +48 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +173 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +54 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +421 -0
- package/dist/channels/gitlab/index.d.ts +35 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +34 -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 +222 -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 +31 -0
- package/dist/channels/gitlab/types.d.ts +222 -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 +363 -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 +56 -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 +147 -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 +94 -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 +45 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +33 -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 +628 -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 +213 -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 +46 -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 +31 -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/pagerduty/api.d.ts +74 -0
- package/dist/channels/pagerduty/api.d.ts.map +1 -0
- package/dist/channels/pagerduty/api.js +101 -0
- package/dist/channels/pagerduty/defaults.d.ts +42 -0
- package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
- package/dist/channels/pagerduty/defaults.js +132 -0
- package/dist/channels/pagerduty/events.d.ts +24 -0
- package/dist/channels/pagerduty/events.d.ts.map +1 -0
- package/dist/channels/pagerduty/events.js +38 -0
- package/dist/channels/pagerduty/index.d.ts +31 -0
- package/dist/channels/pagerduty/index.d.ts.map +1 -0
- package/dist/channels/pagerduty/index.js +30 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
- package/dist/channels/pagerduty/payload.d.ts +33 -0
- package/dist/channels/pagerduty/payload.d.ts.map +1 -0
- package/dist/channels/pagerduty/payload.js +150 -0
- package/dist/channels/pagerduty/replay.d.ts +35 -0
- package/dist/channels/pagerduty/replay.d.ts.map +1 -0
- package/dist/channels/pagerduty/replay.js +115 -0
- package/dist/channels/pagerduty/secrets.d.ts +16 -0
- package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
- package/dist/channels/pagerduty/secrets.js +23 -0
- package/dist/channels/pagerduty/self-user.d.ts +51 -0
- package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
- package/dist/channels/pagerduty/self-user.js +157 -0
- package/dist/channels/pagerduty/state.d.ts +31 -0
- package/dist/channels/pagerduty/state.d.ts.map +1 -0
- package/dist/channels/pagerduty/state.js +30 -0
- package/dist/channels/pagerduty/types.d.ts +217 -0
- package/dist/channels/pagerduty/types.d.ts.map +1 -0
- package/dist/channels/pagerduty/types.js +1 -0
- package/dist/channels/runs/index.d.ts +4 -0
- package/dist/channels/runs/index.d.ts.map +1 -0
- package/dist/channels/runs/index.js +2 -0
- package/dist/channels/runs/runs-channel.d.ts +5 -0
- package/dist/channels/runs/runs-channel.d.ts.map +1 -0
- package/dist/channels/runs/runs-channel.js +34 -0
- package/dist/channels/runs/types.d.ts +34 -0
- package/dist/channels/runs/types.d.ts.map +1 -0
- package/dist/channels/runs/types.js +1 -0
- package/dist/channels/slack/agentic-delivery.d.ts +24 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +510 -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 +101 -0
- package/dist/channels/slack/agentic-signals.d.ts +43 -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 +172 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +642 -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 +57 -0
- package/dist/channels/slack/attachments.d.ts +85 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +507 -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 +97 -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 +243 -0
- package/dist/channels/slack/channel-watch.d.ts +80 -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 +203 -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 +164 -0
- package/dist/channels/slack/constants.d.ts +27 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +37 -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 +73 -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 +592 -0
- package/dist/channels/slack/dispatch.d.ts +153 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +820 -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 +277 -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 +252 -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 +51 -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 +72 -0
- package/dist/channels/slack/inbound.d.ts +104 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +350 -0
- package/dist/channels/slack/index.d.ts +56 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +55 -0
- package/dist/channels/slack/init.d.ts +41 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +109 -0
- package/dist/channels/slack/interactive.d.ts +73 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +309 -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 +18 -0
- package/dist/channels/slack/live-delivery.d.ts +80 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +386 -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 +186 -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 +201 -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 +288 -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 +76 -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 +237 -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 +109 -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 +90 -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 +128 -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 +56 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +218 -0
- package/dist/channels/slack/self-identity.d.ts +18 -0
- package/dist/channels/slack/self-identity.d.ts.map +1 -0
- package/dist/channels/slack/self-identity.js +49 -0
- package/dist/channels/slack/sender-name.d.ts +26 -0
- package/dist/channels/slack/sender-name.d.ts.map +1 -0
- package/dist/channels/slack/sender-name.js +79 -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 +99 -0
- package/dist/channels/slack/slack-channel.d.ts +46 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +683 -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 +100 -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 +42 -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 +89 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +459 -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 +207 -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 +167 -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 +22 -0
- package/dist/channels/slack/types.d.ts +811 -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 +122 -0
- package/dist/channels/slack/user-info.d.ts +16 -0
- package/dist/channels/slack/user-info.d.ts.map +1 -0
- package/dist/channels/slack/user-info.js +58 -0
- package/dist/channels.d.ts +188 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +421 -0
- package/dist/connections.d.ts +160 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +185 -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 +24 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.wA5xBBcd.js +309 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +9 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.C29HLCVL.js +9 -0
- package/dist/docs/assets/chunks/arc.BOaoYWmh.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.MfG0itQh.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.CUeJciCF.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.BrXMZRtK.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.DfkDHeB9.js +10 -0
- package/dist/docs/assets/chunks/channel.D2BTz0L-.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.xKz8CiXK.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.kkfBh4zk.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BClJGb94.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.P9BpQ9L3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.R4iYi58S.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.Cpn8L1dw.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BLftECqU.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BWDV1AYt.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/clone.CldT1lbQ.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.DGpAcJ55.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.BBXxGEaD.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.EKqOwmK2.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.CB8pdkoZ.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.aHh4WGg9.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.YIsbRH20.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.B3bTCW_e.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.M81hXIXZ.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.BKg7WY--.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CLEMZgO3.js +106 -0
- package/dist/docs/assets/chunks/graph.DS38W_Q-.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.BTiWTi82.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.DcqY_KQL.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.0lQNZ40U.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.L5sKlf7X.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.7u4gFhQa.js +1 -0
- package/dist/docs/assets/chunks/linear.D5v33SOb.js +1 -0
- package/dist/docs/assets/chunks/min.Dc9uCxf9.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.B56nGoB_.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.Cba8e8lS.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.2YjBycHF.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.D4P5RqVI.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.C0Hn8NUm.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BZm7EaoT.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.DcR4f3X2.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +1 -0
- package/dist/docs/assets/chunks/theme.DvfKzyXq.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.CgDh96vg.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.B4fagbC8.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.Ck68omim.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DBUg0bvz.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.DnKSGQE1.js +7 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.js +31 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +1 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.js +68 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.js +42 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +1 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.js +162 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +15 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.js +54 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.js +21 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.js +151 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.js +38 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.lean.js +1 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +7 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.js +75 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.js +93 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.lean.js +1 -0
- package/dist/docs/assets/index.md.CAnsLl8D.js +27 -0
- package/dist/docs/assets/index.md.CAnsLl8D.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.D8JDfkKO.js +170 -0
- package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.js +38 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +22 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +103 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.js +66 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.js +56 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.js +51 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.js +11 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.js +14 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.lean.js +1 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.js +9 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.js +15 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.js +10 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.js +79 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.lean.js +1 -0
- package/dist/docs/assets/style.B9o0luvp.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.lean.js +1 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +5 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +3 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.js +9 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +134 -0
- package/dist/docs/changelog.html +60 -0
- package/dist/docs/changelog.md +114 -0
- package/dist/docs/deployment.html +90 -0
- package/dist/docs/deployment.md +309 -0
- package/dist/docs/evals.html +127 -0
- package/dist/docs/evals.md +239 -0
- package/dist/docs/guides/agent-to-agent.html +101 -0
- package/dist/docs/guides/agent-to-agent.md +162 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +293 -0
- package/dist/docs/guides/cloud-agents.html +68 -0
- package/dist/docs/guides/cloud-agents.md +81 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +180 -0
- package/dist/docs/guides/export-grokbot.html +114 -0
- package/dist/docs/guides/export-grokbot.md +239 -0
- package/dist/docs/guides/github.html +221 -0
- package/dist/docs/guides/github.md +373 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +299 -0
- package/dist/docs/guides/grokbot-agents.html +74 -0
- package/dist/docs/guides/grokbot-agents.md +135 -0
- package/dist/docs/guides/hooks.html +113 -0
- package/dist/docs/guides/hooks.md +116 -0
- package/dist/docs/guides/improve.html +80 -0
- package/dist/docs/guides/improve.md +129 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +298 -0
- package/dist/docs/guides/mcp-oauth.html +97 -0
- package/dist/docs/guides/mcp-oauth.md +148 -0
- package/dist/docs/guides/migrate.html +66 -0
- package/dist/docs/guides/migrate.md +164 -0
- package/dist/docs/guides/opentelemetry.html +96 -0
- package/dist/docs/guides/opentelemetry.md +205 -0
- package/dist/docs/guides/pagerduty.html +119 -0
- package/dist/docs/guides/pagerduty.md +336 -0
- package/dist/docs/guides/slack.html +134 -0
- package/dist/docs/guides/slack.md +309 -0
- package/dist/docs/guides/webhooks.html +152 -0
- package/dist/docs/guides/webhooks.md +250 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +134 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +110 -0
- package/dist/docs/llms-full.txt +10077 -0
- package/dist/docs/llms.txt +68 -0
- package/dist/docs/quickstart.html +229 -0
- package/dist/docs/quickstart.md +307 -0
- package/dist/docs/reference/agent-config.html +97 -0
- package/dist/docs/reference/agent-config.md +238 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +113 -0
- package/dist/docs/reference/channels.html +81 -0
- package/dist/docs/reference/channels.md +214 -0
- package/dist/docs/reference/cli.html +162 -0
- package/dist/docs/reference/cli.md +1098 -0
- package/dist/docs/reference/connections.html +125 -0
- package/dist/docs/reference/connections.md +307 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +294 -0
- package/dist/docs/reference/extensions.html +121 -0
- package/dist/docs/reference/extensions.md +209 -0
- package/dist/docs/reference/hooks.html +110 -0
- package/dist/docs/reference/hooks.md +197 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +221 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +64 -0
- package/dist/docs/reference/memory.html +63 -0
- package/dist/docs/reference/memory.md +114 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +36 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +117 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +47 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +190 -0
- package/dist/docs/reference/sessions.html +81 -0
- package/dist/docs/reference/sessions.md +200 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +72 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +61 -0
- package/dist/docs/reference/tools.html +138 -0
- package/dist/docs/reference/tools.md +306 -0
- package/dist/docs/templates/agentic-owners.html +72 -0
- package/dist/docs/templates/agentic-owners.md +126 -0
- package/dist/docs/templates/grokbot-agents.html +64 -0
- package/dist/docs/templates/grokbot-agents.md +55 -0
- package/dist/docs/templates/security-reviewer.html +62 -0
- package/dist/docs/templates/security-reviewer.md +81 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +75 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +75 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +101 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +149 -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 +447 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +184 -0
- package/dist/evals/judge.d.ts +134 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +221 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +107 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +141 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +196 -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 +213 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +304 -0
- package/dist/executors.d.ts +11 -0
- package/dist/executors.d.ts.map +1 -0
- package/dist/executors.js +21 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +94 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +104 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +118 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +290 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +11 -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 +65 -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/launch-agent.d.ts +47 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +62 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +60 -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 +14 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +85 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +19 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +60 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +41 -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 +19 -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 +43 -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 +14 -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 +49 -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 +25 -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 +26 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +70 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +138 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +46 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +186 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +26 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +21 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +13 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +22 -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 +46 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +56 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +105 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +154 -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 +72 -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 +34 -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 +33 -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 +87 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +141 -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 +65 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +848 -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 +133 -0
- package/dist/files.d.ts +203 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +129 -0
- package/dist/filesystem.d.ts +515 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1596 -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 +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/internal/advertise-tools.d.ts +96 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +255 -0
- package/dist/internal/approval-gate.d.ts +35 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +81 -0
- package/dist/internal/artifacts-store.d.ts +123 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +657 -0
- package/dist/internal/as-of.d.ts +39 -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 +43 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +104 -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 +183 -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 +12 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +21 -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 +87 -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 +39 -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 +115 -0
- package/dist/internal/channel-architecture.d.ts +21 -0
- package/dist/internal/channel-architecture.d.ts.map +1 -0
- package/dist/internal/channel-architecture.js +43 -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 +74 -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 +51 -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 +457 -0
- package/dist/internal/cli-ax.d.ts +227 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1825 -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 +332 -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 +257 -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 +205 -0
- package/dist/internal/cli-deploy.d.ts +171 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +2072 -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 +156 -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 +600 -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 +350 -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 +536 -0
- package/dist/internal/cli-init-grokbot.d.ts +29 -0
- package/dist/internal/cli-init-grokbot.d.ts.map +1 -0
- package/dist/internal/cli-init-grokbot.js +181 -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 +37 -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 +300 -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 +659 -0
- package/dist/internal/cli-migrate.d.ts +18 -0
- package/dist/internal/cli-migrate.d.ts.map +1 -0
- package/dist/internal/cli-migrate.js +351 -0
- package/dist/internal/cli-pagerduty.d.ts +32 -0
- package/dist/internal/cli-pagerduty.d.ts.map +1 -0
- package/dist/internal/cli-pagerduty.js +242 -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 +65 -0
- package/dist/internal/cli-slack-manual.d.ts +41 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +296 -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 +708 -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 +40 -0
- package/dist/internal/cloud-turn-usage.d.ts +34 -0
- package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
- package/dist/internal/cloud-turn-usage.js +94 -0
- package/dist/internal/comment-safe.d.ts +8 -0
- package/dist/internal/comment-safe.d.ts.map +1 -0
- package/dist/internal/comment-safe.js +12 -0
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +83 -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 +170 -0
- package/dist/internal/continuation-identity.d.ts +126 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +897 -0
- package/dist/internal/continuation.d.ts +3 -0
- package/dist/internal/continuation.d.ts.map +1 -0
- package/dist/internal/continuation.js +1 -0
- package/dist/internal/conversation-mirror.d.ts +72 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +401 -0
- package/dist/internal/conversation-pack.d.ts +29 -0
- package/dist/internal/conversation-pack.d.ts.map +1 -0
- package/dist/internal/conversation-pack.js +96 -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 +976 -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/convert-grokbot/answers.d.ts +127 -0
- package/dist/internal/convert-grokbot/answers.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/answers.js +445 -0
- package/dist/internal/convert-grokbot/bot.d.ts +50 -0
- package/dist/internal/convert-grokbot/bot.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/bot.js +72 -0
- package/dist/internal/convert-grokbot/checks.d.ts +26 -0
- package/dist/internal/convert-grokbot/checks.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/checks.js +170 -0
- package/dist/internal/convert-grokbot/convert.d.ts +60 -0
- package/dist/internal/convert-grokbot/convert.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/convert.js +470 -0
- package/dist/internal/convert-grokbot/handoff.d.ts +44 -0
- package/dist/internal/convert-grokbot/handoff.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/handoff.js +160 -0
- package/dist/internal/convert-grokbot/recipe.d.ts +61 -0
- package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/recipe.js +94 -0
- package/dist/internal/convert-grokbot/routine.d.ts +51 -0
- package/dist/internal/convert-grokbot/routine.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/routine.js +128 -0
- package/dist/internal/convert-grokbot/slack.d.ts +28 -0
- package/dist/internal/convert-grokbot/slack.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/slack.js +50 -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 +513 -0
- package/dist/internal/cursor/backend-client.d.ts +229 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +700 -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 +196 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +463 -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 +40 -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 +174 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +45 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +64 -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 +97 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +39 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +84 -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 +85 -0
- package/dist/internal/cursor/store-api-client.d.ts +60 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +189 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +70 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +233 -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 +212 -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 +430 -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 +442 -0
- package/dist/internal/deferred-channel-session.d.ts +21 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +55 -0
- package/dist/internal/deploy-client.d.ts +604 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +1009 -0
- package/dist/internal/deploy-manifest.d.ts +179 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +320 -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 +124 -0
- package/dist/internal/describe-error.d.ts +6 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +31 -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 +55 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +230 -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 +347 -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 +88 -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 +430 -0
- package/dist/internal/discovery/context.d.ts +36 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +84 -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 +513 -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 +142 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +376 -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 +92 -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 +50 -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 +166 -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 +79 -0
- package/dist/internal/discovery/instrumentation.d.ts +10 -0
- package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
- package/dist/internal/discovery/instrumentation.js +29 -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 +88 -0
- package/dist/internal/discovery/names.d.ts +14 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +39 -0
- package/dist/internal/discovery/project-public.d.ts +16 -0
- package/dist/internal/discovery/project-public.d.ts.map +1 -0
- package/dist/internal/discovery/project-public.js +54 -0
- package/dist/internal/discovery/project.d.ts +57 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +298 -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 +54 -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 +107 -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 +30 -0
- package/dist/internal/discovery/services.d.ts +27 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +122 -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 +139 -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 +113 -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 +144 -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 +38 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +216 -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 +74 -0
- package/dist/internal/estimate-cost.d.ts +55 -0
- package/dist/internal/estimate-cost.d.ts.map +1 -0
- package/dist/internal/estimate-cost.js +118 -0
- package/dist/internal/eval-judge-model.d.ts +64 -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 +479 -0
- package/dist/internal/eval-runner.d.ts +106 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +616 -0
- package/dist/internal/eval-transport.d.ts +24 -0
- package/dist/internal/eval-transport.d.ts.map +1 -0
- package/dist/internal/eval-transport.js +22 -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 +299 -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 +302 -0
- package/dist/internal/event-mapper.d.ts +165 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +665 -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 +34 -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 +63 -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 +209 -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 +154 -0
- package/dist/internal/filesystem/nearest.d.ts +15 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +90 -0
- package/dist/internal/filesystem/scratch.d.ts +60 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +190 -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 +154 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts +39 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts.map +1 -0
- package/dist/internal/filesystem/subagent-inherit.js +96 -0
- package/dist/internal/filesystem/tools.d.ts +48 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +648 -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 +283 -0
- package/dist/internal/framework-file-storage.d.ts +51 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +291 -0
- package/dist/internal/framework-storage-selection.d.ts +30 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +84 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +85 -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 +106 -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 +313 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +98 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +194 -0
- package/dist/internal/hmac-secret-values.d.ts +48 -0
- package/dist/internal/hmac-secret-values.d.ts.map +1 -0
- package/dist/internal/hmac-secret-values.js +68 -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 +256 -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 +62 -0
- package/dist/internal/host-otel.d.ts +26 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +184 -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 +118 -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 +54 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +90 -0
- package/dist/internal/hosted-catch.d.ts +42 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +154 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +275 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +708 -0
- package/dist/internal/hosted-delivery.d.ts +135 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +1098 -0
- package/dist/internal/hosted-eval-cases.d.ts +21 -0
- package/dist/internal/hosted-eval-cases.d.ts.map +1 -0
- package/dist/internal/hosted-eval-cases.js +162 -0
- package/dist/internal/hosted-execution-diag.d.ts +64 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +219 -0
- package/dist/internal/hosted-execution-flush.d.ts +65 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +113 -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 +226 -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 +62 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +130 -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 +21 -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 +543 -0
- package/dist/internal/http-control-plane-session.d.ts +54 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +163 -0
- package/dist/internal/ids.d.ts +27 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +54 -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 +40 -0
- package/dist/internal/init-interview.d.ts +64 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +193 -0
- package/dist/internal/init-project.d.ts +188 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +492 -0
- package/dist/internal/init-scaffold.d.ts +20 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +194 -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 +170 -0
- package/dist/internal/install-cursor-skills.d.ts +160 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +464 -0
- package/dist/internal/interview/agent-questions.d.ts +19 -0
- package/dist/internal/interview/agent-questions.d.ts.map +1 -0
- package/dist/internal/interview/agent-questions.js +120 -0
- package/dist/internal/interview/question.d.ts +82 -0
- package/dist/internal/interview/question.d.ts.map +1 -0
- package/dist/internal/interview/question.js +198 -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 +69 -0
- package/dist/internal/legacy-command-guard.d.ts +24 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +47 -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 +66 -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 +341 -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 +50 -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 +41 -0
- package/dist/internal/logs-client.d.ts +98 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +418 -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 +34 -0
- package/dist/internal/mcp-endpoint.d.ts +84 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +566 -0
- package/dist/internal/mcp-host.d.ts +99 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +422 -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 +250 -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 +76 -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 +393 -0
- package/dist/internal/memory-dir.d.ts +8 -0
- package/dist/internal/memory-dir.d.ts.map +1 -0
- package/dist/internal/memory-dir.js +7 -0
- package/dist/internal/model-config.d.ts +7 -0
- package/dist/internal/model-config.d.ts.map +1 -0
- package/dist/internal/model-config.js +67 -0
- package/dist/internal/named-webhook-secret.d.ts +39 -0
- package/dist/internal/named-webhook-secret.d.ts.map +1 -0
- package/dist/internal/named-webhook-secret.js +47 -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 +33 -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 +50 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +765 -0
- package/dist/internal/otel/computer-use-attrs.d.ts +18 -0
- package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
- package/dist/internal/otel/computer-use-attrs.js +30 -0
- package/dist/internal/otel/config.d.ts +59 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +236 -0
- package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
- package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
- package/dist/internal/otel/conversation-span-processor.js +34 -0
- package/dist/internal/otel/customer.d.ts +52 -0
- package/dist/internal/otel/customer.d.ts.map +1 -0
- package/dist/internal/otel/customer.js +727 -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 +93 -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 +46 -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 +41 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +92 -0
- package/dist/internal/otel/tool-error-class.d.ts +4 -0
- package/dist/internal/otel/tool-error-class.d.ts.map +1 -0
- package/dist/internal/otel/tool-error-class.js +36 -0
- package/dist/internal/otel-env.d.ts +6 -0
- package/dist/internal/otel-env.d.ts.map +1 -0
- package/dist/internal/otel-env.js +5 -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 +107 -0
- package/dist/internal/peer-connections.d.ts +63 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +115 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts +57 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts.map +1 -0
- package/dist/internal/persistent-stage-log-mirror.js +231 -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 +55 -0
- package/dist/internal/platform-timers.d.ts +42 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +251 -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 +230 -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 +213 -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 +434 -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 +226 -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 +86 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +196 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +279 -0
- package/dist/internal/reminder-runner.d.ts +223 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1241 -0
- package/dist/internal/reminder-schedule.d.ts +26 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +83 -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 +105 -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 +77 -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 +76 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +215 -0
- package/dist/internal/resolved-connections.d.ts +65 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +108 -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 +78 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +369 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +25 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +35 -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 +42 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +157 -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 +153 -0
- package/dist/internal/sdk-runner.d.ts +204 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +1006 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts +9 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -0
- package/dist/internal/sdk-subagent-inherit-support.js +89 -0
- package/dist/internal/secret-alternatives.d.ts +11 -0
- package/dist/internal/secret-alternatives.d.ts.map +1 -0
- package/dist/internal/secret-alternatives.js +13 -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 +72 -0
- package/dist/internal/server.d.ts +45 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2566 -0
- package/dist/internal/session-cost.d.ts +49 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +147 -0
- package/dist/internal/session-engine.d.ts +955 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4880 -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 +64 -0
- package/dist/internal/session-live-publisher.d.ts +48 -0
- package/dist/internal/session-live-publisher.d.ts.map +1 -0
- package/dist/internal/session-live-publisher.js +415 -0
- package/dist/internal/session-run-log.d.ts +108 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +398 -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 +279 -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 +63 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +215 -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 +36 -0
- package/dist/internal/skills-sync.d.ts +22 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +40 -0
- package/dist/internal/slack-provision-client.d.ts +199 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +320 -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/slug.d.ts +12 -0
- package/dist/internal/slug.d.ts.map +1 -0
- package/dist/internal/slug.js +38 -0
- package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
- package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/internal/sqlite-experimental-warning.js +22 -0
- package/dist/internal/start-log-store.d.ts +53 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +155 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +17 -0
- package/dist/internal/storage-coordinator.d.ts +200 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +747 -0
- package/dist/internal/storage-roles.d.ts +83 -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 +164 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +145 -0
- package/dist/internal/store-mirror.d.ts +28 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +54 -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 +231 -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 +93 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts +53 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -0
- package/dist/internal/testing/conversation-identity-vectors.js +170 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +64 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +55 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
- package/dist/internal/testing/hmac-secret-vectors.js +89 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -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 +257 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts +26 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/slack-continuation-fixtures.js +136 -0
- package/dist/internal/tool-call-retry.d.ts +87 -0
- package/dist/internal/tool-call-retry.d.ts.map +1 -0
- package/dist/internal/tool-call-retry.js +387 -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 +76 -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 +50 -0
- package/dist/internal/trajectory.d.ts +68 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +336 -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 +108 -0
- package/dist/internal/turn-lease-store.d.ts +51 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +172 -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 +65 -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 +401 -0
- package/dist/internal/v2-hosting.d.ts +34 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +35 -0
- package/dist/internal/workspace-sync.d.ts +44 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +85 -0
- package/dist/internal/workspace.d.ts +155 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +468 -0
- package/dist/internal/zod-schema.d.ts +14 -0
- package/dist/internal/zod-schema.d.ts.map +1 -0
- package/dist/internal/zod-schema.js +22 -0
- package/dist/internal/zod3-datetime.d.ts +12 -0
- package/dist/internal/zod3-datetime.d.ts.map +1 -0
- package/dist/internal/zod3-datetime.js +17 -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 +80 -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 +113 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +312 -0
- package/dist/otel-public.d.ts +6 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +31 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +146 -0
- package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
- package/dist/playground/assets/index-B3_YohwW.js +62 -0
- package/dist/playground/assets/index-Cn3-adsJ.css +1 -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 +68 -0
- package/dist/public-deprecated.d.ts +36 -0
- package/dist/public-deprecated.d.ts.map +1 -0
- package/dist/public-deprecated.js +39 -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 +54 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +113 -0
- package/dist/storage-backends/cursor-hosted.d.ts +94 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +225 -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 +226 -0
- package/dist/storage-protocol.d.ts +124 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +181 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +145 -0
- package/dist/tools.d.ts +135 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +78 -0
- package/dist/types.d.ts +3804 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +191 -0
- package/docs/README.md +115 -0
- package/docs/building-with-agents.md +139 -0
- package/docs/changelog.md +119 -0
- package/docs/deployment.md +314 -0
- package/docs/evals.md +244 -0
- package/docs/guides/agent-to-agent.md +167 -0
- package/docs/guides/bitbucket.md +298 -0
- package/docs/guides/cloud-agents.md +86 -0
- package/docs/guides/convert-automation.md +185 -0
- package/docs/guides/export-grokbot.md +244 -0
- package/docs/guides/github.md +378 -0
- package/docs/guides/gitlab.md +304 -0
- package/docs/guides/grokbot-agents.md +140 -0
- package/docs/guides/hooks.md +121 -0
- package/docs/guides/improve.md +134 -0
- package/docs/guides/jev.md +303 -0
- package/docs/guides/mcp-oauth.md +153 -0
- package/docs/guides/migrate.md +169 -0
- package/docs/guides/opentelemetry.md +205 -0
- package/docs/guides/pagerduty.md +341 -0
- package/docs/guides/slack.md +314 -0
- package/docs/guides/webhooks.md +255 -0
- package/docs/hillclimbing.md +139 -0
- package/docs/quickstart.md +312 -0
- package/docs/reference/agent-config.md +243 -0
- package/docs/reference/artifacts.md +118 -0
- package/docs/reference/channels.md +219 -0
- package/docs/reference/cli.md +1103 -0
- package/docs/reference/connections.md +312 -0
- package/docs/reference/evals.md +299 -0
- package/docs/reference/extensions.md +214 -0
- package/docs/reference/hooks.md +202 -0
- package/docs/reference/http-api.md +226 -0
- package/docs/reference/instructions.md +69 -0
- package/docs/reference/memory.md +119 -0
- package/docs/reference/playground.md +41 -0
- package/docs/reference/project-layout.md +122 -0
- package/docs/reference/prompt.md +52 -0
- package/docs/reference/schedules.md +195 -0
- package/docs/reference/sessions.md +205 -0
- package/docs/reference/skills.md +77 -0
- package/docs/reference/subagents.md +66 -0
- package/docs/reference/tools.md +311 -0
- package/docs/templates/agentic-owners.md +131 -0
- package/docs/templates/grokbot-agents.md +60 -0
- package/docs/templates/security-reviewer.md +86 -0
- package/docs/templates/thermo-quality-review.md +80 -0
- package/docs/templates/thermo-review.md +80 -0
- package/docs/templates/triage.md +106 -0
- package/docs/troubleshooting.md +154 -0
- package/package.json +429 -4
- package/schemas/grokbot-answers.schema.json +354 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +175 -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 +128 -0
- package/skills/github/SKILL.md +133 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +60 -0
- package/skills/migrate-v2/SKILL.md +397 -0
- package/skills/otel/SKILL.md +48 -0
- package/skills/setup-slack/SKILL.md +136 -0
- package/templates/agentic-owners/README.md +78 -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 +219 -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 +480 -0
- package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +287 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +147 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +696 -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 +73 -0
- package/templates/agentic-owners/bot/lib/review.ts +723 -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 +43 -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 +23 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +38 -0
- package/templates/agents-md/bot/lib/collect.ts +412 -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 +217 -0
- package/templates/agents-md/evals/agents.eval.ts +136 -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 +34 -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 +37 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +52 -0
- package/templates/demo/bot/channels/queue.ts +24 -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 +27 -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 +24 -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 +21 -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 +46 -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 +33 -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 +35 -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 +35 -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 +47 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +29 -0
- package/templates/triage/bot/channels/webhook.ts +41 -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 +160 -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 +21 -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 +21 -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,1596 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { minimatch } from "minimatch";
|
|
5
|
+
import { FileConflictError } from "./files.js";
|
|
6
|
+
import { EditError, FileNotFoundError, InvalidGrepPatternError, isFileNotFoundError, isInvalidGrepPatternError, NoMountError, PathError, ReadOnlyMountError, remapPathError, WriteFailedError, } from "./internal/filesystem/errors.js";
|
|
7
|
+
import { MEMORY_DIR_NAME } from "./internal/memory-dir.js";
|
|
8
|
+
export { DeleteNotSupportedError, EditError, FileNotFoundError, InvalidGrepPatternError, isFileNotFoundError, isInvalidGrepPatternError, NoMountError, PathError, ReadOnlyMountError, WriteFailedError, } from "./internal/filesystem/errors.js";
|
|
9
|
+
import { mergeSorted } from "./internal/filesystem/merge.js";
|
|
10
|
+
import { isExcludedPath, listFilesFromPaths, mergeSortedByPath, statFromFilePaths, } from "./internal/filesystem/walk.js";
|
|
11
|
+
/**
|
|
12
|
+
* Default scan cap for synthesized LS / Glob and for Origin
|
|
13
|
+
* `ListRepoPaths` from `/repo`. Smaller than Origin's 10k default
|
|
14
|
+
* so a recursive listing does not materialize a huge response.
|
|
15
|
+
*/
|
|
16
|
+
export const FILE_SYSTEM_SCAN_LIMIT = 1_000;
|
|
17
|
+
export const FILE_SYSTEM_TOOL_NAMES = [
|
|
18
|
+
"Read",
|
|
19
|
+
"LS",
|
|
20
|
+
"Glob",
|
|
21
|
+
"Grep",
|
|
22
|
+
"Write",
|
|
23
|
+
"StrReplace",
|
|
24
|
+
"Delete",
|
|
25
|
+
"SemanticSearch",
|
|
26
|
+
];
|
|
27
|
+
const FILE_SYSTEM_TOOL_NAME_SET = new Set(FILE_SYSTEM_TOOL_NAMES);
|
|
28
|
+
const FILE_SYSTEM_TOOL_ALIASES = {
|
|
29
|
+
read: "Read",
|
|
30
|
+
Read: "Read",
|
|
31
|
+
ls: "LS",
|
|
32
|
+
LS: "LS",
|
|
33
|
+
glob: "Glob",
|
|
34
|
+
Glob: "Glob",
|
|
35
|
+
grep: "Grep",
|
|
36
|
+
Grep: "Grep",
|
|
37
|
+
write: "Write",
|
|
38
|
+
Write: "Write",
|
|
39
|
+
edit: "StrReplace",
|
|
40
|
+
StrReplace: "StrReplace",
|
|
41
|
+
delete: "Delete",
|
|
42
|
+
Delete: "Delete",
|
|
43
|
+
semSearch: "SemanticSearch",
|
|
44
|
+
SemanticSearch: "SemanticSearch",
|
|
45
|
+
};
|
|
46
|
+
export function canonicalizeFileSystemToolName(name) {
|
|
47
|
+
return FILE_SYSTEM_TOOL_ALIASES[name];
|
|
48
|
+
}
|
|
49
|
+
export function isFileSystemToolName(name) {
|
|
50
|
+
return FILE_SYSTEM_TOOL_NAME_SET.has(name);
|
|
51
|
+
}
|
|
52
|
+
export function isFileSystemToolAlias(name) {
|
|
53
|
+
return canonicalizeFileSystemToolName(name) !== undefined;
|
|
54
|
+
}
|
|
55
|
+
/** Direct `callTool` names that mutate the tree and must wait on a busy turn. */
|
|
56
|
+
export function isMutatingFileSystemTool(name) {
|
|
57
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
58
|
+
return canonical === "Write" || canonical === "StrReplace" || canonical === "Delete";
|
|
59
|
+
}
|
|
60
|
+
export function isFileSystemMethodPresent(root, method) {
|
|
61
|
+
return typeof root[method] === "function";
|
|
62
|
+
}
|
|
63
|
+
const ADVERTISED_FILE_SYSTEM_TOOL_NAMES = [
|
|
64
|
+
"Read",
|
|
65
|
+
"LS",
|
|
66
|
+
"Glob",
|
|
67
|
+
"Grep",
|
|
68
|
+
"Write",
|
|
69
|
+
"StrReplace",
|
|
70
|
+
"Delete",
|
|
71
|
+
"SemanticSearch",
|
|
72
|
+
];
|
|
73
|
+
export function fileSystemToolNames(_root) {
|
|
74
|
+
return [...ADVERTISED_FILE_SYSTEM_TOOL_NAMES];
|
|
75
|
+
}
|
|
76
|
+
function fileSystemMethodForTool(name) {
|
|
77
|
+
switch (name) {
|
|
78
|
+
case "Read":
|
|
79
|
+
return "read";
|
|
80
|
+
case "LS":
|
|
81
|
+
return "list";
|
|
82
|
+
case "Glob":
|
|
83
|
+
return "glob";
|
|
84
|
+
case "Grep":
|
|
85
|
+
return "grep";
|
|
86
|
+
case "Write":
|
|
87
|
+
case "StrReplace":
|
|
88
|
+
return "write";
|
|
89
|
+
case "Delete":
|
|
90
|
+
return "delete";
|
|
91
|
+
case "SemanticSearch":
|
|
92
|
+
return "search";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function fileSystemSatisfiesFileTool(root, name) {
|
|
96
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
97
|
+
if (canonical === undefined) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
const method = fileSystemMethodForTool(canonical);
|
|
101
|
+
return method !== undefined && isFileSystemMethodPresent(root, method);
|
|
102
|
+
}
|
|
103
|
+
export class FileSystemConfigError extends Error {
|
|
104
|
+
constructor(message) {
|
|
105
|
+
super(message);
|
|
106
|
+
this.name = "FileSystemConfigError";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function allowlistHas(tools, ...names) {
|
|
110
|
+
return tools.some((name) => names.includes(name));
|
|
111
|
+
}
|
|
112
|
+
export function resolveRootHarnessAllowlist(tools) {
|
|
113
|
+
if (tools === undefined) {
|
|
114
|
+
// File verbs are synthesized, including SemanticSearch from
|
|
115
|
+
// `search`. Web tools are safe under the `/tmp` scratch
|
|
116
|
+
// overlay. Todos are harness conversation state. `task`
|
|
117
|
+
// children inherit filesystem executors and this allowlist.
|
|
118
|
+
// Do not unlock shell.
|
|
119
|
+
return ["webSearch", "webFetch", "updateTodos", "readTodos", "task", "mcp"];
|
|
120
|
+
}
|
|
121
|
+
if (allowlistHas(tools, "shell", "Shell")) {
|
|
122
|
+
throw new FileSystemConfigError('`fs` cannot be combined with `tools` containing `"shell"`. ' +
|
|
123
|
+
"Shell is not a FileSystem method and must not bind the host shell onto a virtual tree.");
|
|
124
|
+
}
|
|
125
|
+
if (allowlistHas(tools, "readLints", "ReadLints")) {
|
|
126
|
+
throw new FileSystemConfigError("`fs` cannot list `readLints`: FileSystem has no diagnostics " +
|
|
127
|
+
"verb, so the host language service would run against the real workspace.");
|
|
128
|
+
}
|
|
129
|
+
const extras = tools.filter((name) => !isFileSystemToolAlias(name));
|
|
130
|
+
return withMcpGrant(extras);
|
|
131
|
+
}
|
|
132
|
+
export function resolveFileSystemTools(options) {
|
|
133
|
+
const harness = resolveRootHarnessAllowlist(options.tools);
|
|
134
|
+
if (options.tools === undefined) {
|
|
135
|
+
return harness;
|
|
136
|
+
}
|
|
137
|
+
const implemented = fileSystemToolNames(options.root);
|
|
138
|
+
const missing = [];
|
|
139
|
+
for (const name of options.tools) {
|
|
140
|
+
if (!fileSystemSatisfiesFileTool(options.root, name)) {
|
|
141
|
+
missing.push(name);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (missing.length > 0) {
|
|
145
|
+
throw new FileSystemConfigError(`\`tools\` names FileSystem method(s) that are not implemented: ${missing.join(", ")}. ` +
|
|
146
|
+
`Implemented file tools: ${implemented.length > 0 ? implemented.join(", ") : "(none)"}.`);
|
|
147
|
+
}
|
|
148
|
+
return harness;
|
|
149
|
+
}
|
|
150
|
+
export function withMcpGrant(tools) {
|
|
151
|
+
return tools.includes("mcp") ? [...tools] : [...tools, "mcp"];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Native Cursor SDK file tools replaced by synthesized FileSystem tools
|
|
155
|
+
* on every local turn. SDK allowlist names (`edit`, not `Write`).
|
|
156
|
+
*/
|
|
157
|
+
export const REPLACED_NATIVE_FILE_TOOLS = [
|
|
158
|
+
"read",
|
|
159
|
+
"ls",
|
|
160
|
+
"grep",
|
|
161
|
+
"glob",
|
|
162
|
+
"edit",
|
|
163
|
+
"delete",
|
|
164
|
+
];
|
|
165
|
+
/**
|
|
166
|
+
* Host-default harness options: keep shell / webSearch / sandbox, but
|
|
167
|
+
* hide the native file tools the synthesized FileSystem now owns.
|
|
168
|
+
*
|
|
169
|
+
* Omitted `tools` leaves the SDK default set and only excludes the
|
|
170
|
+
* replaced natives. `[]` stays empty. A non-empty allowlist drops file
|
|
171
|
+
* aliases (those ride synthesized tools) and grants `mcp`.
|
|
172
|
+
*/
|
|
173
|
+
export function resolveHostHarnessToolOptions(tools) {
|
|
174
|
+
if (tools === undefined) {
|
|
175
|
+
return { disallowedTools: [...REPLACED_NATIVE_FILE_TOOLS] };
|
|
176
|
+
}
|
|
177
|
+
if (tools.length === 0) {
|
|
178
|
+
return { tools: [] };
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
tools: withMcpGrant(tools.filter((name) => !isReplacedHostFileAlias(name))),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** File aliases host-default synthesizes. Native `semSearch` stays. */
|
|
185
|
+
function isReplacedHostFileAlias(name) {
|
|
186
|
+
const canonical = canonicalizeFileSystemToolName(name);
|
|
187
|
+
return canonical !== undefined && canonical !== "SemanticSearch";
|
|
188
|
+
}
|
|
189
|
+
/** Decode a {@link FileSystem.read} result as UTF-8 text. */
|
|
190
|
+
export function fileSystemText(content) {
|
|
191
|
+
return typeof content === "string" ? content : Buffer.from(content).toString("utf8");
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Native Read image formats. Magic bytes first, then extension.
|
|
195
|
+
* Returns undefined for text (and for any other binary).
|
|
196
|
+
*/
|
|
197
|
+
export function detectImageMimeType(bytes, filePath) {
|
|
198
|
+
if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
|
|
199
|
+
return "image/jpeg";
|
|
200
|
+
}
|
|
201
|
+
if (bytes.length >= 8 &&
|
|
202
|
+
bytes[0] === 0x89 &&
|
|
203
|
+
bytes[1] === 0x50 &&
|
|
204
|
+
bytes[2] === 0x4e &&
|
|
205
|
+
bytes[3] === 0x47) {
|
|
206
|
+
return "image/png";
|
|
207
|
+
}
|
|
208
|
+
if (bytes.length >= 6 && bytes[0] === 0x47 && bytes[1] === 0x49 && bytes[2] === 0x46) {
|
|
209
|
+
return "image/gif";
|
|
210
|
+
}
|
|
211
|
+
if (bytes.length >= 12 &&
|
|
212
|
+
bytes[0] === 0x52 &&
|
|
213
|
+
bytes[1] === 0x49 &&
|
|
214
|
+
bytes[2] === 0x46 &&
|
|
215
|
+
bytes[3] === 0x46 &&
|
|
216
|
+
bytes[8] === 0x57 &&
|
|
217
|
+
bytes[9] === 0x45 &&
|
|
218
|
+
bytes[10] === 0x42 &&
|
|
219
|
+
bytes[11] === 0x50) {
|
|
220
|
+
return "image/webp";
|
|
221
|
+
}
|
|
222
|
+
if (filePath === undefined) {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
const lower = filePath.toLowerCase();
|
|
226
|
+
if (lower.endsWith(".jpg") || lower.endsWith(".jpeg")) {
|
|
227
|
+
return "image/jpeg";
|
|
228
|
+
}
|
|
229
|
+
if (lower.endsWith(".png")) {
|
|
230
|
+
return "image/png";
|
|
231
|
+
}
|
|
232
|
+
if (lower.endsWith(".gif")) {
|
|
233
|
+
return "image/gif";
|
|
234
|
+
}
|
|
235
|
+
if (lower.endsWith(".webp")) {
|
|
236
|
+
return "image/webp";
|
|
237
|
+
}
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
export function fileSystemImage(content, path) {
|
|
241
|
+
if (!(content instanceof Uint8Array)) {
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
const mimeType = detectImageMimeType(content, path);
|
|
245
|
+
if (mimeType === undefined) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
return { mimeType, bytes: content };
|
|
249
|
+
}
|
|
250
|
+
function compileGrepPattern(pattern, caseInsensitive, path = "/") {
|
|
251
|
+
try {
|
|
252
|
+
return new RegExp(pattern, caseInsensitive === true ? "i" : undefined);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
throw new InvalidGrepPatternError(pattern, path);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function* grepFileContent(args) {
|
|
259
|
+
const lines = args.content.split("\n");
|
|
260
|
+
for (let i = 0; i < lines.length; i++) {
|
|
261
|
+
const line = lines[i];
|
|
262
|
+
if (args.regex.test(line)) {
|
|
263
|
+
yield { path: args.path, lineNumber: i + 1, line };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function normalizeMaxResults(maxResults) {
|
|
268
|
+
if (maxResults === undefined || !Number.isFinite(maxResults)) {
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
return Math.max(0, Math.floor(maxResults));
|
|
272
|
+
}
|
|
273
|
+
async function* limitResults(source, maxResults) {
|
|
274
|
+
const cap = normalizeMaxResults(maxResults);
|
|
275
|
+
if (cap === 0) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
let n = 0;
|
|
279
|
+
for await (const item of source) {
|
|
280
|
+
yield item;
|
|
281
|
+
n++;
|
|
282
|
+
if (cap !== undefined && n >= cap) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function grepPushdownLimit(query, opts) {
|
|
288
|
+
// Count and files_with_matches paginate after grouping by file.
|
|
289
|
+
// A line-level cap would hide later files once one file fills the window.
|
|
290
|
+
if (opts.outputMode === "count" || opts.outputMode === "files_with_matches") {
|
|
291
|
+
return query.maxResults;
|
|
292
|
+
}
|
|
293
|
+
const headLimit = opts.headLimit !== undefined && opts.headLimit > 0 ? opts.headLimit : undefined;
|
|
294
|
+
if (headLimit === undefined) {
|
|
295
|
+
return query.maxResults;
|
|
296
|
+
}
|
|
297
|
+
const toolCap = opts.offset + headLimit;
|
|
298
|
+
return query.maxResults === undefined ? toolCap : Math.min(query.maxResults, toolCap);
|
|
299
|
+
}
|
|
300
|
+
function compareGrepResult(left, right) {
|
|
301
|
+
return left.path < right.path
|
|
302
|
+
? -1
|
|
303
|
+
: left.path > right.path
|
|
304
|
+
? 1
|
|
305
|
+
: left.lineNumber - right.lineNumber;
|
|
306
|
+
}
|
|
307
|
+
function compareSearchResult(left, right) {
|
|
308
|
+
if (right.score !== left.score) {
|
|
309
|
+
return right.score - left.score;
|
|
310
|
+
}
|
|
311
|
+
return left.path < right.path ? -1 : left.path > right.path ? 1 : 0;
|
|
312
|
+
}
|
|
313
|
+
export async function collectGrepMatches(root, query, opts) {
|
|
314
|
+
const matches = [];
|
|
315
|
+
const offset = opts.offset !== undefined && opts.offset > 0 ? opts.offset : 0;
|
|
316
|
+
const headLimit = opts.headLimit !== undefined && opts.headLimit > 0 ? opts.headLimit : undefined;
|
|
317
|
+
const skippedFiles = new Set();
|
|
318
|
+
const acceptedFiles = new Set();
|
|
319
|
+
let skippedItems = 0;
|
|
320
|
+
let takenItems = 0;
|
|
321
|
+
const pushdown = grepPushdownLimit(query, {
|
|
322
|
+
outputMode: opts.outputMode,
|
|
323
|
+
offset,
|
|
324
|
+
...(opts.headLimit === undefined ? {} : { headLimit: opts.headLimit }),
|
|
325
|
+
});
|
|
326
|
+
const grepQuery = pushdown === undefined ? query : { ...query, maxResults: pushdown };
|
|
327
|
+
for await (const match of root.grep(grepQuery)) {
|
|
328
|
+
if (opts.outputMode === "content") {
|
|
329
|
+
if (skippedItems < offset) {
|
|
330
|
+
skippedItems++;
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
matches.push(match);
|
|
334
|
+
takenItems++;
|
|
335
|
+
if (headLimit !== undefined && takenItems >= headLimit) {
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
if (skippedFiles.has(match.path)) {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
if (!acceptedFiles.has(match.path)) {
|
|
344
|
+
if (skippedItems < offset) {
|
|
345
|
+
skippedFiles.add(match.path);
|
|
346
|
+
skippedItems++;
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
if (headLimit !== undefined && takenItems >= headLimit) {
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
acceptedFiles.add(match.path);
|
|
353
|
+
takenItems++;
|
|
354
|
+
}
|
|
355
|
+
matches.push(match);
|
|
356
|
+
}
|
|
357
|
+
return matches;
|
|
358
|
+
}
|
|
359
|
+
export function shapeGrepUnion(matches, outputMode) {
|
|
360
|
+
if (outputMode === "files_with_matches") {
|
|
361
|
+
const files = [...new Set(matches.map((match) => match.path))];
|
|
362
|
+
return { type: "files", output: { files, count: files.length } };
|
|
363
|
+
}
|
|
364
|
+
if (outputMode === "count") {
|
|
365
|
+
const counts = new Map();
|
|
366
|
+
for (const match of matches) {
|
|
367
|
+
counts.set(match.path, (counts.get(match.path) ?? 0) + 1);
|
|
368
|
+
}
|
|
369
|
+
return {
|
|
370
|
+
type: "count",
|
|
371
|
+
output: {
|
|
372
|
+
counts: [...counts].map(([file, count]) => ({ file, count })),
|
|
373
|
+
total: matches.length,
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
return {
|
|
378
|
+
type: "content",
|
|
379
|
+
output: {
|
|
380
|
+
matches: matches.map((match) => ({
|
|
381
|
+
file: match.path,
|
|
382
|
+
lineNumber: match.lineNumber,
|
|
383
|
+
line: match.line,
|
|
384
|
+
...(match.beforeContext === undefined ? {} : { beforeContext: match.beforeContext }),
|
|
385
|
+
...(match.afterContext === undefined ? {} : { afterContext: match.afterContext }),
|
|
386
|
+
})),
|
|
387
|
+
totalMatches: matches.length,
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
export function normalizeFsPath(input) {
|
|
392
|
+
const slashes = input.replace(/\\/g, "/");
|
|
393
|
+
if (slashes === "") {
|
|
394
|
+
return "/";
|
|
395
|
+
}
|
|
396
|
+
const withSlash = slashes.startsWith("/") ? slashes : `/${slashes}`;
|
|
397
|
+
const resolved = path.posix.normalize(withSlash);
|
|
398
|
+
if (resolved.length > 1 && resolved.endsWith("/")) {
|
|
399
|
+
return resolved.slice(0, -1);
|
|
400
|
+
}
|
|
401
|
+
return resolved === "." || resolved === "" ? "/" : resolved;
|
|
402
|
+
}
|
|
403
|
+
/** Path-segment prefix: `/agent` matches `/agent/skills`, not `/agent-tools`. */
|
|
404
|
+
export function pathHasSegmentPrefix(args) {
|
|
405
|
+
const p = normalizeFsPath(args.path);
|
|
406
|
+
const pre = normalizeFsPath(args.prefix);
|
|
407
|
+
if (pre === "/") {
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
return p === pre || p.startsWith(`${pre}/`);
|
|
411
|
+
}
|
|
412
|
+
function matchGlob(relativePath, globPattern) {
|
|
413
|
+
return minimatch(relativePath, globPattern, { dot: true, nocase: false });
|
|
414
|
+
}
|
|
415
|
+
function pathMatchesGlob(filePath, dir, globPattern, options = {}) {
|
|
416
|
+
const posixFile = filePath.replace(/\\/g, "/");
|
|
417
|
+
const posixDir = dir.replace(/\\/g, "/");
|
|
418
|
+
const relative = posixDir === "/" || posixFile.startsWith(`${posixDir}/`)
|
|
419
|
+
? posixDir === "/"
|
|
420
|
+
? posixFile.replace(/^\//, "")
|
|
421
|
+
: posixFile.slice(posixDir.length + 1)
|
|
422
|
+
: posixFile.replace(/^\//, "");
|
|
423
|
+
if (matchGlob(relative, globPattern) || matchGlob(posixFile.replace(/^\//, ""), globPattern)) {
|
|
424
|
+
return true;
|
|
425
|
+
}
|
|
426
|
+
// Native grep `--glob '*.ts'` matches the basename at any depth.
|
|
427
|
+
// Glob `*.ts` stays relative to `targetDirectory` and does not.
|
|
428
|
+
if (options.matchBasename === true && !globPattern.includes("/")) {
|
|
429
|
+
const slash = relative.lastIndexOf("/");
|
|
430
|
+
const base = slash === -1 ? relative : relative.slice(slash + 1);
|
|
431
|
+
return matchGlob(base, globPattern);
|
|
432
|
+
}
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Resolve a per-send `workspaceFiles` key onto the virtual `/` namespace.
|
|
437
|
+
* Refuses paths that escape the root, and the reserved `memory` name.
|
|
438
|
+
* Host-default workspaces symlink `memory/` to durable agent state, so a
|
|
439
|
+
* seed under that name would write through the link.
|
|
440
|
+
*/
|
|
441
|
+
export function virtualWorkspaceWritePath(relativePath) {
|
|
442
|
+
if (relativePath.includes("\0")) {
|
|
443
|
+
throw new FileSystemConfigError(`Refusing to write outside the virtual root: ${relativePath}`);
|
|
444
|
+
}
|
|
445
|
+
const posix = relativePath.replaceAll("\\", "/");
|
|
446
|
+
const base = "/virtual-root";
|
|
447
|
+
const target = path.posix.normalize(path.posix.join(base, posix));
|
|
448
|
+
if (target !== base && !target.startsWith(`${base}/`)) {
|
|
449
|
+
throw new FileSystemConfigError(`Refusing to write outside the virtual root: ${relativePath}`);
|
|
450
|
+
}
|
|
451
|
+
const sliced = target.slice(base.length);
|
|
452
|
+
const dest = sliced === "" ? "/" : sliced;
|
|
453
|
+
if (pathHasSegmentPrefix({
|
|
454
|
+
path: dest,
|
|
455
|
+
prefix: `/${MEMORY_DIR_NAME}`,
|
|
456
|
+
})) {
|
|
457
|
+
throw new FileSystemConfigError(`"${MEMORY_DIR_NAME}" is reserved for shared session memory; refusing to write ${relativePath}`);
|
|
458
|
+
}
|
|
459
|
+
return dest;
|
|
460
|
+
}
|
|
461
|
+
export async function writeWorkspaceFilesToRoot(root, files) {
|
|
462
|
+
for (const [relativePath, contents] of Object.entries(files)) {
|
|
463
|
+
// Refuse escapes, then write the sanitized relative dest so
|
|
464
|
+
// `localFileSystem` joins against cwd and `tempFs` still normalizes
|
|
465
|
+
// `a.txt` → `/a.txt`. Never forward an absolute host path.
|
|
466
|
+
const dest = virtualWorkspaceWritePath(relativePath);
|
|
467
|
+
const relativeDest = dest.replace(/^\//, "");
|
|
468
|
+
if (relativeDest === "") {
|
|
469
|
+
throw new FileSystemConfigError(`Refusing to write the virtual root: ${relativePath}`);
|
|
470
|
+
}
|
|
471
|
+
const fileText = typeof contents === "string"
|
|
472
|
+
? contents
|
|
473
|
+
: Buffer.from(contents.data, "base64").toString("utf8");
|
|
474
|
+
try {
|
|
475
|
+
await root.write(relativeDest, fileText);
|
|
476
|
+
}
|
|
477
|
+
catch (error) {
|
|
478
|
+
throw new FileSystemConfigError(`workspaceFiles failed to write ${relativePath}: ${error instanceof Error ? error.message : "write failed"}`);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function replaceLiteral(args) {
|
|
483
|
+
if (args.replaceAll) {
|
|
484
|
+
return args.existing.split(args.oldText).join(args.newText);
|
|
485
|
+
}
|
|
486
|
+
const index = args.existing.indexOf(args.oldText);
|
|
487
|
+
if (index === -1) {
|
|
488
|
+
return args.existing;
|
|
489
|
+
}
|
|
490
|
+
return (args.existing.slice(0, index) + args.newText + args.existing.slice(index + args.oldText.length));
|
|
491
|
+
}
|
|
492
|
+
function countNonOverlapping(haystack, needle) {
|
|
493
|
+
let count = 0;
|
|
494
|
+
let from = 0;
|
|
495
|
+
while (from <= haystack.length - needle.length) {
|
|
496
|
+
const index = haystack.indexOf(needle, from);
|
|
497
|
+
if (index === -1) {
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
count++;
|
|
501
|
+
from = index + needle.length;
|
|
502
|
+
}
|
|
503
|
+
return count;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Exact, non-overlapping str-replace. Uniqueness is the FileSystem
|
|
507
|
+
* contract: more than one match fails unless `replaceAll`.
|
|
508
|
+
*/
|
|
509
|
+
function applyExactEdit(args) {
|
|
510
|
+
if (args.oldText === "") {
|
|
511
|
+
throw new EditError(args.path, "oldText is empty");
|
|
512
|
+
}
|
|
513
|
+
if (args.oldText === args.newText) {
|
|
514
|
+
throw new EditError(args.path, "oldText and newText are exactly the same");
|
|
515
|
+
}
|
|
516
|
+
const occurrences = countNonOverlapping(args.existing, args.oldText);
|
|
517
|
+
if (occurrences === 0) {
|
|
518
|
+
throw new EditError(args.path, "The string to replace was not found in the file");
|
|
519
|
+
}
|
|
520
|
+
if (occurrences > 1 && !args.replaceAll) {
|
|
521
|
+
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.");
|
|
522
|
+
}
|
|
523
|
+
return {
|
|
524
|
+
contents: replaceLiteral({
|
|
525
|
+
existing: args.existing,
|
|
526
|
+
oldText: args.oldText,
|
|
527
|
+
newText: args.newText,
|
|
528
|
+
replaceAll: args.replaceAll,
|
|
529
|
+
}),
|
|
530
|
+
occurrencesModified: occurrences,
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Exact str-replace as `read` + apply + `write`. Uniqueness is
|
|
535
|
+
* this helper's contract; FileSystem implementations do not
|
|
536
|
+
* implement edit. Native StrReplace calls this.
|
|
537
|
+
*/
|
|
538
|
+
export async function strReplaceOnFileSystem(root, query) {
|
|
539
|
+
const existing = await root.read(query.path);
|
|
540
|
+
if (typeof existing !== "string") {
|
|
541
|
+
throw new EditError(query.path, `${query.path} is not text`);
|
|
542
|
+
}
|
|
543
|
+
const applied = applyExactEdit({
|
|
544
|
+
existing,
|
|
545
|
+
oldText: query.oldText,
|
|
546
|
+
newText: query.newText,
|
|
547
|
+
replaceAll: query.replaceAll === true,
|
|
548
|
+
path: query.path,
|
|
549
|
+
});
|
|
550
|
+
await root.write(query.path, applied.contents);
|
|
551
|
+
return { occurrencesModified: applied.occurrencesModified };
|
|
552
|
+
}
|
|
553
|
+
/** Native Read offset/limit: 1-indexed, negative offset counts from the end. */
|
|
554
|
+
export function sliceReadContent(content, offset, limit) {
|
|
555
|
+
if (offset === undefined && limit === undefined) {
|
|
556
|
+
return content;
|
|
557
|
+
}
|
|
558
|
+
const lines = content === "" ? [] : content.split("\n");
|
|
559
|
+
const total = lines.length;
|
|
560
|
+
const effectiveOffset = offset ?? 1;
|
|
561
|
+
const effectiveLimit = limit ?? (effectiveOffset < 0 ? Math.abs(effectiveOffset) : total);
|
|
562
|
+
const startIndex = effectiveOffset < 0 ? Math.max(0, total + effectiveOffset) : Math.max(0, effectiveOffset - 1);
|
|
563
|
+
const endIndex = Math.min(total, startIndex + effectiveLimit);
|
|
564
|
+
return lines.slice(startIndex, endIndex).join("\n");
|
|
565
|
+
}
|
|
566
|
+
async function* emptySearch(_query) { }
|
|
567
|
+
async function* emptyStream() { }
|
|
568
|
+
/**
|
|
569
|
+
* A FileSystem with no files. Use as an overlay leaf or a missing
|
|
570
|
+
* catalog so a miss stays {@link FileNotFoundError} instead of
|
|
571
|
+
* {@link NoMountError}. Writes and deletes throw
|
|
572
|
+
* {@link ReadOnlyMountError} — an empty tree is never a sink.
|
|
573
|
+
*/
|
|
574
|
+
export function emptyFs() {
|
|
575
|
+
return {
|
|
576
|
+
list: () => emptyStream(),
|
|
577
|
+
glob: () => emptyStream(),
|
|
578
|
+
async *grep(query) {
|
|
579
|
+
compileGrepPattern(query.pattern, query.caseInsensitive, query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path));
|
|
580
|
+
yield* emptyStream();
|
|
581
|
+
},
|
|
582
|
+
search: emptySearch,
|
|
583
|
+
async stat(path) {
|
|
584
|
+
return statFromFilePaths([], path);
|
|
585
|
+
},
|
|
586
|
+
async read(path) {
|
|
587
|
+
throw new FileNotFoundError(normalizeFsPath(path));
|
|
588
|
+
},
|
|
589
|
+
async write(path) {
|
|
590
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
591
|
+
},
|
|
592
|
+
async delete(path) {
|
|
593
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
594
|
+
},
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* In-memory FileSystem for tests and fixtures. Keys are absolute
|
|
599
|
+
* posix paths (`/a.txt`) and are normalized on ingest. Honors the
|
|
600
|
+
* {@link FileSystem} order and path contracts.
|
|
601
|
+
* `search` is empty. Creates `/agent-tools` on first scratch
|
|
602
|
+
* write the same way any other path is created.
|
|
603
|
+
*/
|
|
604
|
+
export function tempFs(files = {}) {
|
|
605
|
+
const store = new Map();
|
|
606
|
+
for (const [path, content] of Object.entries(files)) {
|
|
607
|
+
store.set(normalizeFsPath(path), content);
|
|
608
|
+
}
|
|
609
|
+
const listed = {
|
|
610
|
+
list(prefix, options) {
|
|
611
|
+
return listFilesFromPaths([...store.entries()].map(([filePath, content]) => ({
|
|
612
|
+
path: filePath,
|
|
613
|
+
size: typeof content === "string" ? content.length : content.byteLength,
|
|
614
|
+
})), prefix, options);
|
|
615
|
+
},
|
|
616
|
+
async stat(path) {
|
|
617
|
+
return statFromFilePaths(store.keys(), path);
|
|
618
|
+
},
|
|
619
|
+
};
|
|
620
|
+
return {
|
|
621
|
+
list(prefix, options) {
|
|
622
|
+
return listed.list(prefix, options);
|
|
623
|
+
},
|
|
624
|
+
async stat(path) {
|
|
625
|
+
return listed.stat(path);
|
|
626
|
+
},
|
|
627
|
+
async read(inputPath) {
|
|
628
|
+
const path = normalizeFsPath(inputPath);
|
|
629
|
+
const content = store.get(path);
|
|
630
|
+
if (content === undefined) {
|
|
631
|
+
throw new FileNotFoundError(path);
|
|
632
|
+
}
|
|
633
|
+
return content;
|
|
634
|
+
},
|
|
635
|
+
async *grep(query) {
|
|
636
|
+
yield* limitResults(uncapped(), query.maxResults);
|
|
637
|
+
async function* uncapped() {
|
|
638
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path));
|
|
639
|
+
const scope = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
640
|
+
const exact = store.get(scope);
|
|
641
|
+
if (scope !== "/" && exact !== undefined) {
|
|
642
|
+
if (query.glob !== undefined &&
|
|
643
|
+
!pathMatchesGlob(scope, scope, query.glob, {
|
|
644
|
+
matchBasename: true,
|
|
645
|
+
})) {
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
if (isExcludedPath(scope, query.excludes)) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
yield* grepFileContent({
|
|
652
|
+
path: scope,
|
|
653
|
+
content: fileSystemText(exact),
|
|
654
|
+
regex,
|
|
655
|
+
});
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
for await (const entry of listed.list(scope === "/" ? undefined : scope, query.excludes === undefined ? undefined : { excludes: query.excludes })) {
|
|
659
|
+
if (query.glob !== undefined &&
|
|
660
|
+
!pathMatchesGlob(entry.path, scope, query.glob, {
|
|
661
|
+
matchBasename: true,
|
|
662
|
+
})) {
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
const content = store.get(entry.path);
|
|
666
|
+
if (content === undefined) {
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
yield* grepFileContent({
|
|
670
|
+
path: entry.path,
|
|
671
|
+
content: fileSystemText(content),
|
|
672
|
+
regex,
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
async *glob(pattern, dir, options) {
|
|
678
|
+
const scope = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
679
|
+
yield* globFromList(listed.list(scope === "/" ? undefined : scope), {
|
|
680
|
+
pattern,
|
|
681
|
+
dir: scope,
|
|
682
|
+
...(options?.limit === undefined ? {} : { limit: options.limit }),
|
|
683
|
+
});
|
|
684
|
+
},
|
|
685
|
+
async write(inputPath, contents) {
|
|
686
|
+
store.set(normalizeFsPath(inputPath), contents);
|
|
687
|
+
},
|
|
688
|
+
async delete(inputPath) {
|
|
689
|
+
const path = normalizeFsPath(inputPath);
|
|
690
|
+
if (!store.has(path)) {
|
|
691
|
+
throw new FileNotFoundError(path);
|
|
692
|
+
}
|
|
693
|
+
store.delete(path);
|
|
694
|
+
},
|
|
695
|
+
search: emptySearch,
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function fsErrorMessage(error, fallback) {
|
|
699
|
+
return error instanceof Error ? error.message : fallback;
|
|
700
|
+
}
|
|
701
|
+
function throwLocalReadError(error, filePath) {
|
|
702
|
+
throw new FileNotFoundError(filePath, fsErrorMessage(error, `not found: ${filePath}`));
|
|
703
|
+
}
|
|
704
|
+
function skipWalkDir(name) {
|
|
705
|
+
return name === ".git" || name === "node_modules";
|
|
706
|
+
}
|
|
707
|
+
async function walkLocalFiles(rootDir) {
|
|
708
|
+
const found = [];
|
|
709
|
+
const stack = [rootDir];
|
|
710
|
+
while (stack.length > 0) {
|
|
711
|
+
const current = stack.pop();
|
|
712
|
+
if (current === undefined) {
|
|
713
|
+
break;
|
|
714
|
+
}
|
|
715
|
+
let entries;
|
|
716
|
+
try {
|
|
717
|
+
entries = await readdir(current, { withFileTypes: true });
|
|
718
|
+
}
|
|
719
|
+
catch {
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
for (const entry of entries) {
|
|
723
|
+
const full = path.join(current, entry.name);
|
|
724
|
+
// Same as the pre-root host walk and native LS/Glob/Grep: Dirent
|
|
725
|
+
// isDirectory/isFile do not follow links, so workspace `memory/`
|
|
726
|
+
// and other symlinks are not enumerated. Exact-path read/stat still
|
|
727
|
+
// follow.
|
|
728
|
+
if (entry.isDirectory()) {
|
|
729
|
+
if (!skipWalkDir(entry.name)) {
|
|
730
|
+
stack.push(full);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
else if (entry.isFile()) {
|
|
734
|
+
found.push(full);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
found.sort((left, right) => left.localeCompare(right));
|
|
739
|
+
return found;
|
|
740
|
+
}
|
|
741
|
+
async function* listLocalFiles(rootDir) {
|
|
742
|
+
for (const filePath of await walkLocalFiles(rootDir)) {
|
|
743
|
+
yield { path: filePath };
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Host-disk FileSystem. Relative paths resolve against `cwd`; absolute
|
|
748
|
+
* paths are used as-is — the same contract as Cursor SDK native file
|
|
749
|
+
* tools. `search` yields empty results (no host index).
|
|
750
|
+
*
|
|
751
|
+
* Internal. Not part of the public Agent SDK surface.
|
|
752
|
+
*/
|
|
753
|
+
export function localFileSystem(options) {
|
|
754
|
+
const cwd = path.resolve(options.cwd);
|
|
755
|
+
const resolvePath = (input) => path.isAbsolute(input) ? path.resolve(input) : path.resolve(cwd, input);
|
|
756
|
+
return {
|
|
757
|
+
async *list(prefix, options) {
|
|
758
|
+
yield* limitResults(uncapped(), options?.limit);
|
|
759
|
+
async function* uncapped() {
|
|
760
|
+
const dirPath = prefix === undefined || prefix === "" || prefix === "." ? cwd : resolvePath(prefix);
|
|
761
|
+
for await (const entry of listLocalFiles(dirPath)) {
|
|
762
|
+
if (!isExcludedPath(entry.path, options?.excludes)) {
|
|
763
|
+
yield entry;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
async stat(probePath) {
|
|
769
|
+
const filePath = resolvePath(probePath);
|
|
770
|
+
try {
|
|
771
|
+
const info = await stat(filePath);
|
|
772
|
+
return { kind: info.isDirectory() ? "directory" : "file" };
|
|
773
|
+
}
|
|
774
|
+
catch {
|
|
775
|
+
return { kind: "missing" };
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
async read(inputPath) {
|
|
779
|
+
const filePath = resolvePath(inputPath);
|
|
780
|
+
try {
|
|
781
|
+
const bytes = await readFile(filePath);
|
|
782
|
+
if (detectImageMimeType(bytes, filePath) !== undefined) {
|
|
783
|
+
return new Uint8Array(bytes);
|
|
784
|
+
}
|
|
785
|
+
return bytes.toString("utf8");
|
|
786
|
+
}
|
|
787
|
+
catch (error) {
|
|
788
|
+
throwLocalReadError(error, filePath);
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
async *grep(query) {
|
|
792
|
+
yield* limitResults(uncapped(), query.maxResults);
|
|
793
|
+
async function* uncapped() {
|
|
794
|
+
const searchRoot = resolvePath(query.path ?? cwd);
|
|
795
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, searchRoot);
|
|
796
|
+
let filesToSearch;
|
|
797
|
+
try {
|
|
798
|
+
const info = await stat(searchRoot);
|
|
799
|
+
filesToSearch = info.isFile() ? [searchRoot] : await walkLocalFiles(searchRoot);
|
|
800
|
+
}
|
|
801
|
+
catch (error) {
|
|
802
|
+
throwLocalReadError(error, searchRoot);
|
|
803
|
+
}
|
|
804
|
+
for (const filePath of filesToSearch) {
|
|
805
|
+
if (query.glob !== undefined &&
|
|
806
|
+
!pathMatchesGlob(filePath, searchRoot, query.glob, {
|
|
807
|
+
matchBasename: true,
|
|
808
|
+
})) {
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (isExcludedPath(filePath, query.excludes)) {
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
let content;
|
|
815
|
+
try {
|
|
816
|
+
content = await readFile(filePath, "utf8");
|
|
817
|
+
}
|
|
818
|
+
catch {
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
yield* grepFileContent({ path: filePath, content, regex });
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
async *glob(pattern, dir, options) {
|
|
826
|
+
const dirPath = dir === undefined || dir === "" || dir === "." ? cwd : resolvePath(dir);
|
|
827
|
+
yield* globFromList(listLocalFiles(dirPath), {
|
|
828
|
+
pattern,
|
|
829
|
+
dir: dirPath,
|
|
830
|
+
...(options?.limit === undefined ? {} : { limit: options.limit }),
|
|
831
|
+
});
|
|
832
|
+
},
|
|
833
|
+
async write(inputPath, contents) {
|
|
834
|
+
const filePath = resolvePath(inputPath);
|
|
835
|
+
try {
|
|
836
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
837
|
+
await writeFile(filePath, contents, "utf8");
|
|
838
|
+
}
|
|
839
|
+
catch (error) {
|
|
840
|
+
throw new WriteFailedError(filePath, fsErrorMessage(error, `write failed: ${filePath}`));
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
async delete(inputPath) {
|
|
844
|
+
const filePath = resolvePath(inputPath);
|
|
845
|
+
try {
|
|
846
|
+
await rm(filePath);
|
|
847
|
+
}
|
|
848
|
+
catch (error) {
|
|
849
|
+
throwLocalReadError(error, filePath);
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
search: emptySearch,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function longestMount(path, mounts) {
|
|
856
|
+
let best;
|
|
857
|
+
for (const mount of mounts) {
|
|
858
|
+
if (!pathHasSegmentPrefix({ path, prefix: mount.prefix })) {
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
if (best === undefined || mount.prefix.length > best.prefix.length) {
|
|
862
|
+
best = mount;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
return best;
|
|
866
|
+
}
|
|
867
|
+
/** Each mount strictly under `path`. */
|
|
868
|
+
function nestedMounts(path, mounts) {
|
|
869
|
+
return mounts.filter((mount) => mount.prefix !== path && pathHasSegmentPrefix({ path: mount.prefix, prefix: path }));
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* A glob from `scope` into a mount nested under it. The pattern is relative
|
|
873
|
+
* to `scope`, not to the mount, so the mount is listed and each path matched.
|
|
874
|
+
*/
|
|
875
|
+
async function* globNestedMount(mount, scope, pattern) {
|
|
876
|
+
for await (const entry of mapMountEntries(mount.fs.list(undefined), mount.prefix)) {
|
|
877
|
+
if (pathMatchesGlob(entry.path, scope, pattern)) {
|
|
878
|
+
yield entry;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
/** Namespace path → child path. `/host/a.md` on `/host` is `/a.md`. */
|
|
883
|
+
function toChildPath(path, prefix) {
|
|
884
|
+
if (prefix === "/") {
|
|
885
|
+
return path;
|
|
886
|
+
}
|
|
887
|
+
if (path === prefix) {
|
|
888
|
+
return "/";
|
|
889
|
+
}
|
|
890
|
+
if (path.startsWith(`${prefix}/`)) {
|
|
891
|
+
return path.slice(prefix.length);
|
|
892
|
+
}
|
|
893
|
+
return path;
|
|
894
|
+
}
|
|
895
|
+
/** Child path → namespace path. `/a.md` on `/host` is `/host/a.md`. */
|
|
896
|
+
function toParentPath(path, prefix) {
|
|
897
|
+
if (prefix === "/") {
|
|
898
|
+
return path;
|
|
899
|
+
}
|
|
900
|
+
if (path === "/" || path === "") {
|
|
901
|
+
return prefix;
|
|
902
|
+
}
|
|
903
|
+
return path.startsWith("/") ? `${prefix}${path}` : `${prefix}/${path}`;
|
|
904
|
+
}
|
|
905
|
+
async function* mapMountEntries(source, prefix) {
|
|
906
|
+
try {
|
|
907
|
+
for await (const entry of source) {
|
|
908
|
+
yield { ...entry, path: toParentPath(entry.path, prefix) };
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
catch (error) {
|
|
912
|
+
throw remapPathError(error, prefix);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
async function* mapMountGrep(source, prefix) {
|
|
916
|
+
try {
|
|
917
|
+
for await (const hit of source) {
|
|
918
|
+
yield { ...hit, path: toParentPath(hit.path, prefix) };
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
catch (error) {
|
|
922
|
+
throw remapPathError(error, prefix);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
async function* mapMountSearch(source, prefix) {
|
|
926
|
+
try {
|
|
927
|
+
for await (const hit of source) {
|
|
928
|
+
yield { ...hit, path: toParentPath(hit.path, prefix) };
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
catch (error) {
|
|
932
|
+
throw remapPathError(error, prefix);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
function childSearchQuery(query, prefix) {
|
|
936
|
+
if (query.targetDirectories === undefined || query.targetDirectories.length === 0) {
|
|
937
|
+
return query;
|
|
938
|
+
}
|
|
939
|
+
const dirs = [];
|
|
940
|
+
for (const dir of query.targetDirectories) {
|
|
941
|
+
const normalized = normalizeFsPath(dir);
|
|
942
|
+
// `/` is every mount, the same way grep at `/` fans out.
|
|
943
|
+
if (normalized === "/") {
|
|
944
|
+
return { ...query, targetDirectories: undefined };
|
|
945
|
+
}
|
|
946
|
+
if (!pathHasSegmentPrefix({ path: normalized, prefix })) {
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
const child = toChildPath(normalized, prefix);
|
|
950
|
+
if (child === "/") {
|
|
951
|
+
return { ...query, targetDirectories: undefined };
|
|
952
|
+
}
|
|
953
|
+
dirs.push(child);
|
|
954
|
+
}
|
|
955
|
+
if (dirs.length === 0) {
|
|
956
|
+
return undefined;
|
|
957
|
+
}
|
|
958
|
+
return { ...query, targetDirectories: dirs };
|
|
959
|
+
}
|
|
960
|
+
function omittedScan(path) {
|
|
961
|
+
return path === undefined || path === "";
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* The turn tree: authored files at `/`, scratch at `/tmp`, and an optional
|
|
965
|
+
* skills mount. An omitted `grep` or `glob` path searches the authored
|
|
966
|
+
* tree only, so a tree that narrows that call (for example to `/repo`)
|
|
967
|
+
* does not also scan skills or scratch. An explicit path searches every
|
|
968
|
+
* mount under it.
|
|
969
|
+
*/
|
|
970
|
+
export function sessionFileSystem(options) {
|
|
971
|
+
const mounts = {
|
|
972
|
+
"/": options.authored,
|
|
973
|
+
"/tmp": options.scratch ?? tempFs(),
|
|
974
|
+
};
|
|
975
|
+
if (options.skills !== undefined) {
|
|
976
|
+
mounts[options.skills.path] = options.skills.fs;
|
|
977
|
+
}
|
|
978
|
+
const union = unionFs(mounts);
|
|
979
|
+
return {
|
|
980
|
+
list: (prefix, listOptions) => union.list(prefix, listOptions),
|
|
981
|
+
stat: (path) => union.stat(path),
|
|
982
|
+
read: (path) => union.read(path),
|
|
983
|
+
write: (path, contents) => union.write(path, contents),
|
|
984
|
+
delete: (path) => union.delete(path),
|
|
985
|
+
search: (query) => union.search(query),
|
|
986
|
+
glob: (pattern, dir, globOptions) => omittedScan(dir)
|
|
987
|
+
? options.authored.glob(pattern, dir, globOptions)
|
|
988
|
+
: union.glob(pattern, dir, globOptions),
|
|
989
|
+
grep: (query) => (omittedScan(query.path) ? options.authored.grep(query) : union.grep(query)),
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
/** Forwards reads. `write` and `delete` throw `read-only mount`. */
|
|
993
|
+
export function readOnlyFs(inner) {
|
|
994
|
+
return {
|
|
995
|
+
list: (prefix, options) => inner.list(prefix, options),
|
|
996
|
+
stat: (path) => inner.stat(path),
|
|
997
|
+
glob: (pattern, dir, options) => inner.glob(pattern, dir, options),
|
|
998
|
+
read: (path) => inner.read(path),
|
|
999
|
+
grep: (query) => inner.grep(query),
|
|
1000
|
+
search: (query) => inner.search(query),
|
|
1001
|
+
async write(path) {
|
|
1002
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
1003
|
+
},
|
|
1004
|
+
async delete(path) {
|
|
1005
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
1006
|
+
},
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Longest-prefix compose, path-segment match. Every verb is
|
|
1011
|
+
* defined. Does not synthesize `shell`. `/agent` is not a
|
|
1012
|
+
* prefix of `/agent-tools`.
|
|
1013
|
+
*
|
|
1014
|
+
* The record keys are mount points. Each child is a FileSystem
|
|
1015
|
+
* rooted at `/`. `unionFs` strips the prefix on the way in and
|
|
1016
|
+
* re-prefixes yields (and error paths) on the way out:
|
|
1017
|
+
* `unionFs({ "/host": hostFs(...) })` — the child never sees
|
|
1018
|
+
* `/host`.
|
|
1019
|
+
*
|
|
1020
|
+
* A path with no mount:
|
|
1021
|
+
* - `read` / `write` / `delete`: throw
|
|
1022
|
+
* `no mount for path: ${path}`
|
|
1023
|
+
* - `list` / `glob` / `grep`: empty iterator
|
|
1024
|
+
* - `stat`: `{ kind: "missing" }` (`/`, exact mount prefixes, and
|
|
1025
|
+
* their parents are `{ kind: "directory" }`)
|
|
1026
|
+
*
|
|
1027
|
+
* `list` and `glob` below `/` also yield the files of each mount nested
|
|
1028
|
+
* under that directory, as `list` and `glob` of `/` do. A nested glob
|
|
1029
|
+
* lists that mount and matches each path against the pattern. `grep` and
|
|
1030
|
+
* `search` stay on the mount that covers the path.
|
|
1031
|
+
*
|
|
1032
|
+
* Sources are already sorted longest prefix first. List and glob use
|
|
1033
|
+
* `unique` so that earlier source wins a tie.
|
|
1034
|
+
*/
|
|
1035
|
+
export function unionFs(mounts) {
|
|
1036
|
+
const entries = Object.entries(mounts).map(([prefix, fs]) => ({
|
|
1037
|
+
prefix: normalizeFsPath(prefix),
|
|
1038
|
+
fs,
|
|
1039
|
+
}));
|
|
1040
|
+
entries.sort((a, b) => b.prefix.length - a.prefix.length);
|
|
1041
|
+
const noMount = (path) => {
|
|
1042
|
+
throw new NoMountError(path);
|
|
1043
|
+
};
|
|
1044
|
+
const forward = async (path, run) => {
|
|
1045
|
+
const mount = longestMount(path, entries);
|
|
1046
|
+
if (mount === undefined) {
|
|
1047
|
+
return noMount(path);
|
|
1048
|
+
}
|
|
1049
|
+
const childPath = toChildPath(path, mount.prefix);
|
|
1050
|
+
try {
|
|
1051
|
+
return await run(mount.fs, childPath);
|
|
1052
|
+
}
|
|
1053
|
+
catch (error) {
|
|
1054
|
+
throw remapPathError(error, mount.prefix);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
const isRootPath = (value) => value === undefined || value === "" || value === "/";
|
|
1058
|
+
return {
|
|
1059
|
+
async *list(prefix, options) {
|
|
1060
|
+
yield* limitResults(uncapped(), options?.limit);
|
|
1061
|
+
async function* uncapped() {
|
|
1062
|
+
if (isRootPath(prefix)) {
|
|
1063
|
+
yield* mergeSortedByPath(entries.map((mount) => mapMountEntries(mount.fs.list(undefined, options), mount.prefix)), { unique: true });
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
const path = normalizeFsPath(prefix ?? "/");
|
|
1067
|
+
const mount = longestMount(path, entries);
|
|
1068
|
+
const sources = nestedMounts(path, entries).map((nested) => mapMountEntries(nested.fs.list(undefined, options), nested.prefix));
|
|
1069
|
+
if (mount !== undefined) {
|
|
1070
|
+
const childPath = toChildPath(path, mount.prefix);
|
|
1071
|
+
sources.push(mapMountEntries(mount.fs.list(childPath === "/" ? undefined : childPath, options), mount.prefix));
|
|
1072
|
+
}
|
|
1073
|
+
yield* mergeSortedByPath(sources, { unique: true });
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
async stat(path) {
|
|
1077
|
+
const normalized = normalizeFsPath(path);
|
|
1078
|
+
if (normalized === "/") {
|
|
1079
|
+
return { kind: "directory" };
|
|
1080
|
+
}
|
|
1081
|
+
if (entries.some((entry) => entry.prefix === normalized)) {
|
|
1082
|
+
return { kind: "directory" };
|
|
1083
|
+
}
|
|
1084
|
+
const mount = longestMount(normalized, entries);
|
|
1085
|
+
const info = mount === undefined
|
|
1086
|
+
? { kind: "missing" }
|
|
1087
|
+
: await mount.fs.stat(toChildPath(normalized, mount.prefix));
|
|
1088
|
+
if (info.kind === "missing" && nestedMounts(normalized, entries).length > 0) {
|
|
1089
|
+
return { kind: "directory" };
|
|
1090
|
+
}
|
|
1091
|
+
return info;
|
|
1092
|
+
},
|
|
1093
|
+
async read(path) {
|
|
1094
|
+
const normalized = normalizeFsPath(path);
|
|
1095
|
+
return forward(normalized, (fs, childPath) => fs.read(childPath));
|
|
1096
|
+
},
|
|
1097
|
+
async write(path, contents) {
|
|
1098
|
+
const normalized = normalizeFsPath(path);
|
|
1099
|
+
return forward(normalized, (fs, childPath) => fs.write(childPath, contents));
|
|
1100
|
+
},
|
|
1101
|
+
async delete(path) {
|
|
1102
|
+
const normalized = normalizeFsPath(path);
|
|
1103
|
+
return forward(normalized, (fs, childPath) => fs.delete(childPath));
|
|
1104
|
+
},
|
|
1105
|
+
async *grep(query) {
|
|
1106
|
+
yield* limitResults(uncapped(), query.maxResults);
|
|
1107
|
+
async function* uncapped() {
|
|
1108
|
+
const scope = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
1109
|
+
if (scope === "/") {
|
|
1110
|
+
yield* mergeSorted(entries.map((mount) => mapMountGrep(mount.fs.grep({ ...query, path: undefined }), mount.prefix)), { compare: compareGrepResult });
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
const mount = longestMount(scope, entries);
|
|
1114
|
+
if (mount === undefined) {
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
const childPath = toChildPath(scope, mount.prefix);
|
|
1118
|
+
yield* mapMountGrep(mount.fs.grep({
|
|
1119
|
+
...query,
|
|
1120
|
+
path: childPath === "/" ? undefined : childPath,
|
|
1121
|
+
}), mount.prefix);
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
async *search(query) {
|
|
1125
|
+
yield* limitResults(uncapped(), query.maxResults);
|
|
1126
|
+
async function* uncapped() {
|
|
1127
|
+
const sources = [];
|
|
1128
|
+
for (const mount of entries) {
|
|
1129
|
+
const childQuery = childSearchQuery(query, mount.prefix);
|
|
1130
|
+
if (childQuery === undefined) {
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
sources.push(mapMountSearch(mount.fs.search(childQuery), mount.prefix));
|
|
1134
|
+
}
|
|
1135
|
+
yield* mergeSorted(sources, { compare: compareSearchResult });
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
async *glob(pattern, dir, options) {
|
|
1139
|
+
yield* limitResults(uncapped(), options?.limit);
|
|
1140
|
+
async function* uncapped() {
|
|
1141
|
+
const scope = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
1142
|
+
if (scope === "/") {
|
|
1143
|
+
yield* mergeSortedByPath(entries.map((mount) => mapMountEntries(mount.fs.glob(pattern, undefined, options), mount.prefix)), { unique: true });
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
const mount = longestMount(scope, entries);
|
|
1147
|
+
const sources = nestedMounts(scope, entries).map((nested) => globNestedMount(nested, scope, pattern));
|
|
1148
|
+
if (mount !== undefined) {
|
|
1149
|
+
const childPath = toChildPath(scope, mount.prefix);
|
|
1150
|
+
sources.push(mapMountEntries(mount.fs.glob(pattern, childPath === "/" ? undefined : childPath, options), mount.prefix));
|
|
1151
|
+
}
|
|
1152
|
+
yield* mergeSortedByPath(sources, { unique: true });
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
async function collectLayerPaths(layer) {
|
|
1158
|
+
const paths = [];
|
|
1159
|
+
try {
|
|
1160
|
+
for await (const entry of layer.list()) {
|
|
1161
|
+
paths.push(entry.path);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
catch {
|
|
1165
|
+
// A layer that cannot list also cannot own paths.
|
|
1166
|
+
}
|
|
1167
|
+
return paths;
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Same-root overlay: earlier layers win. Read-only.
|
|
1171
|
+
*
|
|
1172
|
+
* A downed layer costs its own files, not the overlay. Mutations
|
|
1173
|
+
* throw `read-only mount` / `read-only mount: ${path}`. Empty
|
|
1174
|
+
* `layers` throws `overlayFs needs at least one layer.`
|
|
1175
|
+
*/
|
|
1176
|
+
export function overlayFs(layers) {
|
|
1177
|
+
if (layers.length === 0) {
|
|
1178
|
+
throw new Error("overlayFs needs at least one layer.");
|
|
1179
|
+
}
|
|
1180
|
+
const walkLayers = async (collect) => {
|
|
1181
|
+
const streams = [];
|
|
1182
|
+
let failure;
|
|
1183
|
+
let served = false;
|
|
1184
|
+
for (const layer of layers) {
|
|
1185
|
+
const collected = [];
|
|
1186
|
+
try {
|
|
1187
|
+
for await (const entry of await collect(layer)) {
|
|
1188
|
+
collected.push(entry);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
catch (error) {
|
|
1192
|
+
failure ??= error;
|
|
1193
|
+
continue;
|
|
1194
|
+
}
|
|
1195
|
+
served = true;
|
|
1196
|
+
streams.push(collected);
|
|
1197
|
+
}
|
|
1198
|
+
return { streams, failure, served };
|
|
1199
|
+
};
|
|
1200
|
+
const collectOverlayHits = async (queryFn, rethrow) => {
|
|
1201
|
+
const streams = [];
|
|
1202
|
+
const shadowed = new Set();
|
|
1203
|
+
let failure;
|
|
1204
|
+
let served = false;
|
|
1205
|
+
for (const layer of layers) {
|
|
1206
|
+
const collected = [];
|
|
1207
|
+
try {
|
|
1208
|
+
for await (const hit of queryFn(layer)) {
|
|
1209
|
+
if (!shadowed.has(hit.path)) {
|
|
1210
|
+
collected.push(hit);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
served = true;
|
|
1214
|
+
}
|
|
1215
|
+
catch (error) {
|
|
1216
|
+
if (rethrow?.(error) === true) {
|
|
1217
|
+
throw error;
|
|
1218
|
+
}
|
|
1219
|
+
failure ??= error;
|
|
1220
|
+
continue;
|
|
1221
|
+
}
|
|
1222
|
+
streams.push(collected);
|
|
1223
|
+
for (const path of await collectLayerPaths(layer)) {
|
|
1224
|
+
shadowed.add(path);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
if (!served && failure !== undefined) {
|
|
1228
|
+
throw failure;
|
|
1229
|
+
}
|
|
1230
|
+
return streams;
|
|
1231
|
+
};
|
|
1232
|
+
return {
|
|
1233
|
+
async *list(prefix, options) {
|
|
1234
|
+
const { streams, failure, served } = await walkLayers((layer) => layer.list(prefix, options));
|
|
1235
|
+
if (!served && failure !== undefined) {
|
|
1236
|
+
throw failure;
|
|
1237
|
+
}
|
|
1238
|
+
yield* limitResults(mergeSortedByPath(streams, { unique: true }), options?.limit);
|
|
1239
|
+
},
|
|
1240
|
+
async stat(path) {
|
|
1241
|
+
let failure;
|
|
1242
|
+
let sawMissing = false;
|
|
1243
|
+
for (const layer of layers) {
|
|
1244
|
+
try {
|
|
1245
|
+
const info = await layer.stat(path);
|
|
1246
|
+
if (info.kind !== "missing") {
|
|
1247
|
+
return info;
|
|
1248
|
+
}
|
|
1249
|
+
sawMissing = true;
|
|
1250
|
+
}
|
|
1251
|
+
catch (error) {
|
|
1252
|
+
failure ??= error;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if (!sawMissing && failure !== undefined) {
|
|
1256
|
+
throw failure;
|
|
1257
|
+
}
|
|
1258
|
+
return { kind: "missing" };
|
|
1259
|
+
},
|
|
1260
|
+
async *glob(pattern, dir, options) {
|
|
1261
|
+
const { streams, failure, served } = await walkLayers((layer) => layer.glob(pattern, dir, options));
|
|
1262
|
+
if (!served && failure !== undefined) {
|
|
1263
|
+
throw failure;
|
|
1264
|
+
}
|
|
1265
|
+
yield* limitResults(mergeSortedByPath(streams, { unique: true }), options?.limit);
|
|
1266
|
+
},
|
|
1267
|
+
async read(path) {
|
|
1268
|
+
let failure;
|
|
1269
|
+
for (const layer of layers) {
|
|
1270
|
+
try {
|
|
1271
|
+
return await layer.read(path);
|
|
1272
|
+
}
|
|
1273
|
+
catch (error) {
|
|
1274
|
+
if (isFileNotFoundError(error)) {
|
|
1275
|
+
continue;
|
|
1276
|
+
}
|
|
1277
|
+
failure ??= error;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (failure !== undefined) {
|
|
1281
|
+
throw failure;
|
|
1282
|
+
}
|
|
1283
|
+
throw new FileNotFoundError(path);
|
|
1284
|
+
},
|
|
1285
|
+
async *grep(query) {
|
|
1286
|
+
const { maxResults, ...uncappedQuery } = query;
|
|
1287
|
+
yield* limitResults(mergeSorted(await collectOverlayHits((layer) => layer.grep(uncappedQuery), (error) => isInvalidGrepPatternError(error)), { compare: compareGrepResult }), maxResults);
|
|
1288
|
+
},
|
|
1289
|
+
async write(path) {
|
|
1290
|
+
throw new ReadOnlyMountError(path);
|
|
1291
|
+
},
|
|
1292
|
+
async delete(path) {
|
|
1293
|
+
throw new ReadOnlyMountError(path);
|
|
1294
|
+
},
|
|
1295
|
+
async *search(query) {
|
|
1296
|
+
const { maxResults, ...uncappedQuery } = query;
|
|
1297
|
+
yield* limitResults(mergeSorted(await collectOverlayHits((layer) => layer.search(uncappedQuery)), {
|
|
1298
|
+
compare: compareSearchResult,
|
|
1299
|
+
}), maxResults);
|
|
1300
|
+
},
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Hide `hidden` paths on `base` without mutating it. Used as the
|
|
1305
|
+
* lower layer of {@link childOverlayFs}. Deletes of parent files
|
|
1306
|
+
* are whiteouts in that set; writes never reach `base`.
|
|
1307
|
+
*/
|
|
1308
|
+
function hidePaths(base, hidden) {
|
|
1309
|
+
const visible = (filePath) => !hidden.has(normalizeFsPath(filePath));
|
|
1310
|
+
return {
|
|
1311
|
+
async *list(prefix, options) {
|
|
1312
|
+
for await (const entry of base.list(prefix, options)) {
|
|
1313
|
+
if (visible(entry.path)) {
|
|
1314
|
+
yield entry;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
async stat(path) {
|
|
1319
|
+
const normalized = normalizeFsPath(path);
|
|
1320
|
+
if (hidden.has(normalized)) {
|
|
1321
|
+
return { kind: "missing" };
|
|
1322
|
+
}
|
|
1323
|
+
return base.stat(path);
|
|
1324
|
+
},
|
|
1325
|
+
async *glob(pattern, dir, options) {
|
|
1326
|
+
for await (const entry of base.glob(pattern, dir, options)) {
|
|
1327
|
+
if (visible(entry.path)) {
|
|
1328
|
+
yield entry;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
async read(path) {
|
|
1333
|
+
const normalized = normalizeFsPath(path);
|
|
1334
|
+
if (hidden.has(normalized)) {
|
|
1335
|
+
throw new FileNotFoundError(normalized);
|
|
1336
|
+
}
|
|
1337
|
+
return base.read(path);
|
|
1338
|
+
},
|
|
1339
|
+
async *grep(query) {
|
|
1340
|
+
for await (const hit of base.grep(query)) {
|
|
1341
|
+
if (visible(hit.path)) {
|
|
1342
|
+
yield hit;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
async *search(query) {
|
|
1347
|
+
for await (const hit of base.search(query)) {
|
|
1348
|
+
if (visible(hit.path)) {
|
|
1349
|
+
yield hit;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
async write(path) {
|
|
1354
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
1355
|
+
},
|
|
1356
|
+
async delete(path) {
|
|
1357
|
+
throw new ReadOnlyMountError(normalizeFsPath(path));
|
|
1358
|
+
},
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* `stat` reports `{ kind: "missing" }` for both a hole in a mount and
|
|
1363
|
+
* a path no mount owns. `read` is the verb that throws
|
|
1364
|
+
* `no mount for path` — reuse that so a child write cannot invent
|
|
1365
|
+
* a file outside the parent's root.
|
|
1366
|
+
*/
|
|
1367
|
+
async function assertParentAddressable(parent, path) {
|
|
1368
|
+
const info = await parent.stat(path);
|
|
1369
|
+
if (info.kind !== "missing") {
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
try {
|
|
1373
|
+
await parent.read(path);
|
|
1374
|
+
}
|
|
1375
|
+
catch (error) {
|
|
1376
|
+
if (isFileNotFoundError(error)) {
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
throw error;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Writable child view over `parent`. Reads use `overlayFs` order:
|
|
1384
|
+
* a private `tempFs` scratch, then `parent`. Writes and deletes land
|
|
1385
|
+
* on that scratch. A delete of a parent file is a whiteout, so the
|
|
1386
|
+
* child stops seeing it. `parent` is never mutated.
|
|
1387
|
+
*
|
|
1388
|
+
* FileSystem has no shell. Callers that bind executors to this handle
|
|
1389
|
+
* omit shell.
|
|
1390
|
+
*/
|
|
1391
|
+
export function childOverlayFs(parent) {
|
|
1392
|
+
const scratch = tempFs();
|
|
1393
|
+
const hidden = new Set();
|
|
1394
|
+
const view = overlayFs([scratch, hidePaths(parent, hidden)]);
|
|
1395
|
+
return {
|
|
1396
|
+
list: (prefix, options) => view.list(prefix, options),
|
|
1397
|
+
stat: (path) => view.stat(path),
|
|
1398
|
+
glob: (pattern, dir, options) => view.glob(pattern, dir, options),
|
|
1399
|
+
read: (path) => view.read(path),
|
|
1400
|
+
grep: (query) => view.grep(query),
|
|
1401
|
+
search: (query) => view.search(query),
|
|
1402
|
+
async write(path, contents) {
|
|
1403
|
+
const normalized = normalizeFsPath(path);
|
|
1404
|
+
await assertParentAddressable(parent, normalized);
|
|
1405
|
+
const existing = await view.stat(normalized);
|
|
1406
|
+
if (existing.kind === "directory") {
|
|
1407
|
+
throw new WriteFailedError(normalized, `path is a directory: ${normalized}`);
|
|
1408
|
+
}
|
|
1409
|
+
hidden.delete(normalized);
|
|
1410
|
+
await scratch.write(normalized, contents);
|
|
1411
|
+
},
|
|
1412
|
+
async delete(path) {
|
|
1413
|
+
const normalized = normalizeFsPath(path);
|
|
1414
|
+
await assertParentAddressable(parent, normalized);
|
|
1415
|
+
const info = await view.stat(normalized);
|
|
1416
|
+
if (info.kind !== "file") {
|
|
1417
|
+
throw new FileNotFoundError(normalized);
|
|
1418
|
+
}
|
|
1419
|
+
hidden.add(normalized);
|
|
1420
|
+
try {
|
|
1421
|
+
await scratch.delete(normalized);
|
|
1422
|
+
}
|
|
1423
|
+
catch (error) {
|
|
1424
|
+
if (!isFileNotFoundError(error)) {
|
|
1425
|
+
throw error;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
function hostKey(path) {
|
|
1432
|
+
const normalized = normalizeFsPath(path);
|
|
1433
|
+
return normalized === "/" ? "" : normalized.slice(1);
|
|
1434
|
+
}
|
|
1435
|
+
function isHostConflict(error) {
|
|
1436
|
+
return (error instanceof FileConflictError ||
|
|
1437
|
+
(error instanceof Error &&
|
|
1438
|
+
(error.name === "FileConflictError" || error.message.includes("lost a race"))));
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* `HostFilesApi` as a FileSystem rooted at `/`.
|
|
1442
|
+
*
|
|
1443
|
+
* Mount it with `unionFs({ "/host": hostFs(files, scope) })`. The
|
|
1444
|
+
* child never sees `/host` — `unionFs` owns the prefix. `scope` is
|
|
1445
|
+
* the HostFiles partition, not a path prefix. `search` is empty
|
|
1446
|
+
* (HostFiles is not an index).
|
|
1447
|
+
*/
|
|
1448
|
+
export function hostFs(files, scope) {
|
|
1449
|
+
const callOptions = { scope };
|
|
1450
|
+
const readEtags = new Map();
|
|
1451
|
+
const listed = {
|
|
1452
|
+
async *list(prefix, options) {
|
|
1453
|
+
const entries = await files.list(undefined, callOptions);
|
|
1454
|
+
yield* listFilesFromPaths(entries.map((entry) => ({
|
|
1455
|
+
path: normalizeFsPath(entry.path),
|
|
1456
|
+
size: entry.size,
|
|
1457
|
+
})), prefix, options);
|
|
1458
|
+
},
|
|
1459
|
+
async stat(path) {
|
|
1460
|
+
const entries = await files.list(undefined, callOptions);
|
|
1461
|
+
return statFromFilePaths(entries.map((entry) => normalizeFsPath(entry.path)), path);
|
|
1462
|
+
},
|
|
1463
|
+
};
|
|
1464
|
+
const readText = async (inputPath) => {
|
|
1465
|
+
const path = normalizeFsPath(inputPath);
|
|
1466
|
+
const key = hostKey(path);
|
|
1467
|
+
if (key === "") {
|
|
1468
|
+
throw new FileNotFoundError(path);
|
|
1469
|
+
}
|
|
1470
|
+
const [content, stat] = await Promise.all([
|
|
1471
|
+
files.read(key, callOptions),
|
|
1472
|
+
files.stat(key, callOptions),
|
|
1473
|
+
]);
|
|
1474
|
+
if (content === undefined) {
|
|
1475
|
+
throw new FileNotFoundError(path);
|
|
1476
|
+
}
|
|
1477
|
+
if (stat?.etag !== undefined) {
|
|
1478
|
+
readEtags.set(key, stat.etag);
|
|
1479
|
+
}
|
|
1480
|
+
return content;
|
|
1481
|
+
};
|
|
1482
|
+
const writeHost = async (inputPath, contents) => {
|
|
1483
|
+
const path = normalizeFsPath(inputPath);
|
|
1484
|
+
const key = hostKey(path);
|
|
1485
|
+
if (key === "") {
|
|
1486
|
+
throw new FileNotFoundError(path);
|
|
1487
|
+
}
|
|
1488
|
+
try {
|
|
1489
|
+
if (files.capabilities.conflictDetection) {
|
|
1490
|
+
const etag = readEtags.get(key);
|
|
1491
|
+
await files.write(key, contents, {
|
|
1492
|
+
...callOptions,
|
|
1493
|
+
// No cached etag: unconditional create/overwrite. After a
|
|
1494
|
+
// successful read or write, CAS on that etag.
|
|
1495
|
+
...(etag === undefined ? {} : { ifMatch: etag }),
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
else {
|
|
1499
|
+
await files.write(key, contents, callOptions);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
catch (error) {
|
|
1503
|
+
if (isHostConflict(error)) {
|
|
1504
|
+
throw new PathError(path, `${path} changed since you read it — read it again and rewrite.`);
|
|
1505
|
+
}
|
|
1506
|
+
throw error;
|
|
1507
|
+
}
|
|
1508
|
+
const stat = await files.stat(key, callOptions);
|
|
1509
|
+
if (stat?.etag !== undefined) {
|
|
1510
|
+
readEtags.set(key, stat.etag);
|
|
1511
|
+
}
|
|
1512
|
+
else {
|
|
1513
|
+
readEtags.delete(key);
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
return {
|
|
1517
|
+
list(prefix, options) {
|
|
1518
|
+
return listed.list(prefix, options);
|
|
1519
|
+
},
|
|
1520
|
+
async stat(path) {
|
|
1521
|
+
return listed.stat(path);
|
|
1522
|
+
},
|
|
1523
|
+
async read(path) {
|
|
1524
|
+
return readText(path);
|
|
1525
|
+
},
|
|
1526
|
+
async *grep(query) {
|
|
1527
|
+
yield* limitResults(uncapped(), query.maxResults);
|
|
1528
|
+
async function* uncapped() {
|
|
1529
|
+
const scopePath = query.path === undefined || query.path === "" ? "/" : normalizeFsPath(query.path);
|
|
1530
|
+
const regex = compileGrepPattern(query.pattern, query.caseInsensitive, scopePath);
|
|
1531
|
+
const info = await listed.stat(scopePath);
|
|
1532
|
+
if (scopePath !== "/" && info.kind === "file") {
|
|
1533
|
+
if (query.glob !== undefined &&
|
|
1534
|
+
!pathMatchesGlob(scopePath, scopePath, query.glob, {
|
|
1535
|
+
matchBasename: true,
|
|
1536
|
+
})) {
|
|
1537
|
+
return;
|
|
1538
|
+
}
|
|
1539
|
+
if (isExcludedPath(scopePath, query.excludes)) {
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
yield* grepFileContent({
|
|
1543
|
+
path: scopePath,
|
|
1544
|
+
content: await readText(scopePath),
|
|
1545
|
+
regex,
|
|
1546
|
+
});
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
for await (const entry of listed.list(scopePath === "/" ? undefined : scopePath, query.excludes === undefined ? undefined : { excludes: query.excludes })) {
|
|
1550
|
+
if (query.glob !== undefined &&
|
|
1551
|
+
!pathMatchesGlob(entry.path, scopePath, query.glob, {
|
|
1552
|
+
matchBasename: true,
|
|
1553
|
+
})) {
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
yield* grepFileContent({
|
|
1557
|
+
path: entry.path,
|
|
1558
|
+
content: await readText(entry.path),
|
|
1559
|
+
regex,
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
},
|
|
1564
|
+
async *glob(pattern, dir, options) {
|
|
1565
|
+
const dirPath = dir === undefined || dir === "" ? "/" : normalizeFsPath(dir);
|
|
1566
|
+
yield* globFromList(listed.list(dirPath === "/" ? undefined : dirPath), {
|
|
1567
|
+
pattern,
|
|
1568
|
+
dir: dirPath,
|
|
1569
|
+
...(options?.limit === undefined ? {} : { limit: options.limit }),
|
|
1570
|
+
});
|
|
1571
|
+
},
|
|
1572
|
+
async write(inputPath, contents) {
|
|
1573
|
+
await writeHost(inputPath, contents);
|
|
1574
|
+
},
|
|
1575
|
+
async delete(inputPath) {
|
|
1576
|
+
const path = normalizeFsPath(inputPath);
|
|
1577
|
+
const key = hostKey(path);
|
|
1578
|
+
if (key === "" || !(await files.exists(key, callOptions))) {
|
|
1579
|
+
throw new FileNotFoundError(path);
|
|
1580
|
+
}
|
|
1581
|
+
await files.remove(key, callOptions);
|
|
1582
|
+
readEtags.delete(key);
|
|
1583
|
+
},
|
|
1584
|
+
search: emptySearch,
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
async function* globFromList(source, options) {
|
|
1588
|
+
yield* limitResults(uncapped(), options.limit);
|
|
1589
|
+
async function* uncapped() {
|
|
1590
|
+
for await (const entry of source) {
|
|
1591
|
+
if (pathMatchesGlob(entry.path, options.dir, options.pattern)) {
|
|
1592
|
+
yield entry;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|