@cursor/bdk 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +341 -0
- package/LICENSE.md +3 -0
- package/README.md +1190 -0
- package/dist/artifacts.d.ts +34 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +51 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +19 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1578 -0
- package/dist/channels/bitbucket/api.d.ts +217 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +664 -0
- package/dist/channels/bitbucket/binding.d.ts +75 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +277 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +384 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +67 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +60 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +302 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +227 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +45 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +42 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/checks.d.ts +121 -0
- package/dist/channels/checks.d.ts.map +1 -0
- package/dist/channels/checks.js +86 -0
- package/dist/channels/deployments/deployments-channel.d.ts +95 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
- package/dist/channels/deployments/deployments-channel.js +196 -0
- package/dist/channels/deployments/index.d.ts +25 -0
- package/dist/channels/deployments/index.d.ts.map +1 -0
- package/dist/channels/deployments/index.js +24 -0
- package/dist/channels/deployments/types.d.ts +83 -0
- package/dist/channels/deployments/types.d.ts.map +1 -0
- package/dist/channels/deployments/types.js +7 -0
- package/dist/channels/github/api.d.ts +133 -0
- package/dist/channels/github/api.d.ts.map +1 -0
- package/dist/channels/github/api.js +320 -0
- package/dist/channels/github/auth.d.ts +67 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +233 -0
- package/dist/channels/github/binding.d.ts +86 -0
- package/dist/channels/github/binding.d.ts.map +1 -0
- package/dist/channels/github/binding.js +114 -0
- package/dist/channels/github/checks.d.ts +64 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +98 -0
- package/dist/channels/github/cursor-account.d.ts +102 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +194 -0
- package/dist/channels/github/defaults.d.ts +23 -0
- package/dist/channels/github/defaults.d.ts.map +1 -0
- package/dist/channels/github/defaults.js +157 -0
- package/dist/channels/github/events.d.ts +18 -0
- package/dist/channels/github/events.d.ts.map +1 -0
- package/dist/channels/github/events.js +56 -0
- package/dist/channels/github/forward.d.ts +139 -0
- package/dist/channels/github/forward.d.ts.map +1 -0
- package/dist/channels/github/forward.js +267 -0
- package/dist/channels/github/github-channel.d.ts +146 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +1804 -0
- package/dist/channels/github/index.d.ts +54 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +53 -0
- package/dist/channels/github/progress.d.ts +84 -0
- package/dist/channels/github/progress.d.ts.map +1 -0
- package/dist/channels/github/progress.js +236 -0
- package/dist/channels/github/replay.d.ts +115 -0
- package/dist/channels/github/replay.d.ts.map +1 -0
- package/dist/channels/github/replay.js +278 -0
- package/dist/channels/github/state.d.ts +47 -0
- package/dist/channels/github/state.d.ts.map +1 -0
- package/dist/channels/github/state.js +53 -0
- package/dist/channels/github/types.d.ts +491 -0
- package/dist/channels/github/types.d.ts.map +1 -0
- package/dist/channels/github/types.js +1 -0
- package/dist/channels/gitlab/api.d.ts +118 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +234 -0
- package/dist/channels/gitlab/binding.d.ts +63 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +147 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +122 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +64 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +55 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +26 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +388 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +199 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +211 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +35 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/types.js +1 -0
- package/dist/channels/origin/api.d.ts +157 -0
- package/dist/channels/origin/api.d.ts.map +1 -0
- package/dist/channels/origin/api.js +379 -0
- package/dist/channels/origin/binding.d.ts +57 -0
- package/dist/channels/origin/binding.d.ts.map +1 -0
- package/dist/channels/origin/binding.js +57 -0
- package/dist/channels/origin/checks.d.ts +119 -0
- package/dist/channels/origin/checks.d.ts.map +1 -0
- package/dist/channels/origin/checks.js +145 -0
- package/dist/channels/origin/cursor-account.d.ts +24 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -0
- package/dist/channels/origin/cursor-account.js +35 -0
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +109 -0
- package/dist/channels/origin/events.d.ts +10 -0
- package/dist/channels/origin/events.d.ts.map +1 -0
- package/dist/channels/origin/events.js +25 -0
- package/dist/channels/origin/index.d.ts +35 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +34 -0
- package/dist/channels/origin/origin-channel.d.ts +72 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -0
- package/dist/channels/origin/origin-channel.js +634 -0
- package/dist/channels/origin/origin-webhook.d.ts +69 -0
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
- package/dist/channels/origin/origin-webhook.js +231 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +58 -0
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +257 -0
- package/dist/channels/origin/types.d.ts.map +1 -0
- package/dist/channels/origin/types.js +1 -0
- package/dist/channels/slack/agentic-delivery.d.ts +23 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +566 -0
- package/dist/channels/slack/agentic-posted.d.ts +30 -0
- package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
- package/dist/channels/slack/agentic-posted.js +102 -0
- package/dist/channels/slack/agentic-signals.d.ts +48 -0
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
- package/dist/channels/slack/agentic-signals.js +199 -0
- package/dist/channels/slack/api.d.ts +171 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +613 -0
- package/dist/channels/slack/approvals.d.ts +48 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -0
- package/dist/channels/slack/approvals.js +233 -0
- package/dist/channels/slack/assistant.d.ts +23 -0
- package/dist/channels/slack/assistant.d.ts.map +1 -0
- package/dist/channels/slack/assistant.js +67 -0
- package/dist/channels/slack/attachments.d.ts +82 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +503 -0
- package/dist/channels/slack/auth.d.ts +46 -0
- package/dist/channels/slack/auth.d.ts.map +1 -0
- package/dist/channels/slack/auth.js +95 -0
- package/dist/channels/slack/blocks.d.ts +61 -0
- package/dist/channels/slack/blocks.d.ts.map +1 -0
- package/dist/channels/slack/blocks.js +90 -0
- package/dist/channels/slack/bot-mentions.d.ts +108 -0
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
- package/dist/channels/slack/bot-mentions.js +257 -0
- package/dist/channels/slack/channel-watch.d.ts +76 -0
- package/dist/channels/slack/channel-watch.d.ts.map +1 -0
- package/dist/channels/slack/channel-watch.js +264 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +228 -0
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +166 -0
- package/dist/channels/slack/constants.d.ts +25 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +35 -0
- package/dist/channels/slack/credentials.d.ts +35 -0
- package/dist/channels/slack/credentials.d.ts.map +1 -0
- package/dist/channels/slack/credentials.js +88 -0
- package/dist/channels/slack/defaults.d.ts +50 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -0
- package/dist/channels/slack/defaults.js +630 -0
- package/dist/channels/slack/dispatch.d.ts +141 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +730 -0
- package/dist/channels/slack/doctor.d.ts +40 -0
- package/dist/channels/slack/doctor.d.ts.map +1 -0
- package/dist/channels/slack/doctor.js +291 -0
- package/dist/channels/slack/eval-directive.d.ts +59 -0
- package/dist/channels/slack/eval-directive.d.ts.map +1 -0
- package/dist/channels/slack/eval-directive.js +269 -0
- package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
- package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
- package/dist/channels/slack/event-id-dedupe.js +23 -0
- package/dist/channels/slack/external-policy.d.ts +28 -0
- package/dist/channels/slack/external-policy.d.ts.map +1 -0
- package/dist/channels/slack/external-policy.js +64 -0
- package/dist/channels/slack/footer.d.ts +33 -0
- package/dist/channels/slack/footer.d.ts.map +1 -0
- package/dist/channels/slack/footer.js +85 -0
- package/dist/channels/slack/inbound.d.ts +98 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +314 -0
- package/dist/channels/slack/index.d.ts +53 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +52 -0
- package/dist/channels/slack/init.d.ts +45 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +126 -0
- package/dist/channels/slack/interactive.d.ts +65 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +310 -0
- package/dist/channels/slack/links.d.ts +10 -0
- package/dist/channels/slack/links.d.ts.map +1 -0
- package/dist/channels/slack/links.js +19 -0
- package/dist/channels/slack/live-delivery.d.ts +77 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +399 -0
- package/dist/channels/slack/log.d.ts +25 -0
- package/dist/channels/slack/log.d.ts.map +1 -0
- package/dist/channels/slack/log.js +44 -0
- package/dist/channels/slack/manifest.d.ts +80 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -0
- package/dist/channels/slack/manifest.js +159 -0
- package/dist/channels/slack/message-body.d.ts +13 -0
- package/dist/channels/slack/message-body.d.ts.map +1 -0
- package/dist/channels/slack/message-body.js +74 -0
- package/dist/channels/slack/nudge-carrier.d.ts +21 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +213 -0
- package/dist/channels/slack/nudge-store.d.ts +77 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +315 -0
- package/dist/channels/slack/paint-start.d.ts +22 -0
- package/dist/channels/slack/paint-start.d.ts.map +1 -0
- package/dist/channels/slack/paint-start.js +91 -0
- package/dist/channels/slack/placeholder.d.ts +62 -0
- package/dist/channels/slack/placeholder.d.ts.map +1 -0
- package/dist/channels/slack/placeholder.js +266 -0
- package/dist/channels/slack/pr-ref.d.ts +24 -0
- package/dist/channels/slack/pr-ref.d.ts.map +1 -0
- package/dist/channels/slack/pr-ref.js +55 -0
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +122 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +103 -0
- package/dist/channels/slack/reasoning-chip.d.ts +8 -0
- package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-chip.js +30 -0
- package/dist/channels/slack/recording-sink.d.ts +29 -0
- package/dist/channels/slack/recording-sink.d.ts.map +1 -0
- package/dist/channels/slack/recording-sink.js +140 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +47 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +193 -0
- package/dist/channels/slack/setup.d.ts +33 -0
- package/dist/channels/slack/setup.d.ts.map +1 -0
- package/dist/channels/slack/setup.js +101 -0
- package/dist/channels/slack/slack-channel.d.ts +43 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +534 -0
- package/dist/channels/slack/socket-mode.d.ts +26 -0
- package/dist/channels/slack/socket-mode.d.ts.map +1 -0
- package/dist/channels/slack/socket-mode.js +114 -0
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/stream.d.ts +38 -0
- package/dist/channels/slack/stream.d.ts.map +1 -0
- package/dist/channels/slack/stream.js +30 -0
- package/dist/channels/slack/thread-context.d.ts +79 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +396 -0
- package/dist/channels/slack/tool-approval-events.d.ts +38 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
- package/dist/channels/slack/tool-approval-events.js +224 -0
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +172 -0
- package/dist/channels/slack/tool-chip.d.ts +9 -0
- package/dist/channels/slack/tool-chip.d.ts.map +1 -0
- package/dist/channels/slack/tool-chip.js +23 -0
- package/dist/channels/slack/types.d.ts +751 -0
- package/dist/channels/slack/types.d.ts.map +1 -0
- package/dist/channels/slack/types.js +4 -0
- package/dist/channels/slack/upload.d.ts +13 -0
- package/dist/channels/slack/upload.d.ts.map +1 -0
- package/dist/channels/slack/upload.js +135 -0
- package/dist/channels.d.ts +175 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +417 -0
- package/dist/connections.d.ts +131 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +131 -0
- package/dist/dashboard-session-url.d.ts +15 -0
- package/dist/dashboard-session-url.d.ts.map +1 -0
- package/dist/dashboard-session-url.js +25 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.JVQvbRO-.js +309 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.js +9 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.BkhY63uW.js +9 -0
- package/dist/docs/assets/chunks/arc.Cc1unYd3.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.CAY_TPVz.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.my2VD3Xm.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.CQXAOmqd.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.D0AsQFSX.js +10 -0
- package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.DZjhgNls.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.qdcp_qbo.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BHXoZhJ-.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.Cds_Vwj3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.CSl0HknT.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.DJMvAt5N.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BYQzBK9D.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BAvw7N4o.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/clone.zl2qolPE.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.Buf3seya.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.DMGGa3uA.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.DDjnwRmY.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.RwyrIr8Q.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.DRvQV16Z.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.Dw8W9BTk.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.DQT1Hnwf.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.6_Aky-ut.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.DHIwqnqN.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CGd_eJbn.js +106 -0
- package/dist/docs/assets/chunks/graph.ChMEylkh.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.Cd4gMyAz.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.D1uw7MXq.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.AWLXtelc.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.CagPhAn5.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.ClTBBkE_.js +1 -0
- package/dist/docs/assets/chunks/linear.SwS2rOLA.js +1 -0
- package/dist/docs/assets/chunks/min.By_x-Btb.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.By_RAMaP.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.DfAl9sy4.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.CNuqFRBj.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.DJ5CmTCl.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.D-T_AKJj.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BRn9WcrR.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.F12urmm7.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +1 -0
- package/dist/docs/assets/chunks/theme.zK3OJa_C.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.B7GiQBeC.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.D0niwuY_.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.1zhHNRsx.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DKaqpT7K.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.e8BPicch.js +7 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.js +32 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.lean.js +1 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.js +72 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.js +41 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.js +10 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.js +156 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.js +16 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.js +50 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.js +22 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.js +151 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.js +50 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.js +35 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.js +70 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.js +92 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.lean.js +1 -0
- package/dist/docs/assets/index.md.CVc_oOA3.js +27 -0
- package/dist/docs/assets/index.md.CVc_oOA3.lean.js +1 -0
- package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/dist/docs/assets/quickstart.md.wG4shE1f.js +168 -0
- package/dist/docs/assets/quickstart.md.wG4shE1f.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.js +32 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.js +23 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +97 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.js +63 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.js +56 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.js +58 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.js +45 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.js +11 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.js +14 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.js +9 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.js +15 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.js +10 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.js +90 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.lean.js +1 -0
- package/dist/docs/assets/style.C130MVnH.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.js +14 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.js +2 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.js +9 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +135 -0
- package/dist/docs/deployment.html +91 -0
- package/dist/docs/deployment.md +211 -0
- package/dist/docs/evals.html +131 -0
- package/dist/docs/evals.md +257 -0
- package/dist/docs/guides/agent-to-agent.html +100 -0
- package/dist/docs/guides/agent-to-agent.md +152 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +288 -0
- package/dist/docs/guides/cloud-agents.html +69 -0
- package/dist/docs/guides/cloud-agents.md +90 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +183 -0
- package/dist/docs/guides/github.html +215 -0
- package/dist/docs/guides/github.md +326 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +294 -0
- package/dist/docs/guides/grokbot-agents.html +75 -0
- package/dist/docs/guides/grokbot-agents.md +142 -0
- package/dist/docs/guides/hooks.html +109 -0
- package/dist/docs/guides/hooks.md +114 -0
- package/dist/docs/guides/improve.html +81 -0
- package/dist/docs/guides/improve.md +134 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +294 -0
- package/dist/docs/guides/mcp-oauth.html +109 -0
- package/dist/docs/guides/mcp-oauth.md +162 -0
- package/dist/docs/guides/opentelemetry.html +94 -0
- package/dist/docs/guides/opentelemetry.md +153 -0
- package/dist/docs/guides/slack.html +129 -0
- package/dist/docs/guides/slack.md +273 -0
- package/dist/docs/guides/webhooks.html +151 -0
- package/dist/docs/guides/webhooks.md +236 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +137 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +114 -0
- package/dist/docs/llms-full.txt +8439 -0
- package/dist/docs/llms.txt +62 -0
- package/dist/docs/quickstart.html +227 -0
- package/dist/docs/quickstart.md +306 -0
- package/dist/docs/reference/agent-config.html +91 -0
- package/dist/docs/reference/agent-config.md +188 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +116 -0
- package/dist/docs/reference/channels.html +82 -0
- package/dist/docs/reference/channels.md +198 -0
- package/dist/docs/reference/cli.html +156 -0
- package/dist/docs/reference/cli.md +904 -0
- package/dist/docs/reference/connections.html +122 -0
- package/dist/docs/reference/connections.md +272 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +287 -0
- package/dist/docs/reference/extensions.html +117 -0
- package/dist/docs/reference/extensions.md +193 -0
- package/dist/docs/reference/hooks.html +104 -0
- package/dist/docs/reference/hooks.md +190 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +231 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +63 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +42 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +115 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +50 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +170 -0
- package/dist/docs/reference/sessions.html +60 -0
- package/dist/docs/reference/sessions.md +160 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +75 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +62 -0
- package/dist/docs/reference/tools.html +149 -0
- package/dist/docs/reference/tools.md +324 -0
- package/dist/docs/templates/agentic-owners.html +73 -0
- package/dist/docs/templates/agentic-owners.md +95 -0
- package/dist/docs/templates/security-reviewer.html +61 -0
- package/dist/docs/templates/security-reviewer.md +85 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +78 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +77 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +97 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +143 -0
- package/dist/docs/vp-icons.css +0 -0
- package/dist/evals/assertions.d.ts +199 -0
- package/dist/evals/assertions.d.ts.map +1 -0
- package/dist/evals/assertions.js +459 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +187 -0
- package/dist/evals/judge.d.ts +133 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +224 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +124 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +142 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +220 -0
- package/dist/evals/results.d.ts +103 -0
- package/dist/evals/results.d.ts.map +1 -0
- package/dist/evals/results.js +27 -0
- package/dist/evals/run-facts.d.ts +77 -0
- package/dist/evals/run-facts.d.ts.map +1 -0
- package/dist/evals/run-facts.js +214 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +292 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +280 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +81 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +53 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +35 -0
- package/dist/extensions/improve/extension.d.ts +48 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +43 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/extensions/jev/extension.d.ts +43 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +47 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +167 -0
- package/dist/extensions/jev/skills/gated-write.md +25 -0
- package/dist/extensions/jev/skills/questions.md +33 -0
- package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
- package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/tools/evaluate.js +83 -0
- package/dist/extensions/slack-communication/extension.d.ts +28 -0
- package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
- package/dist/extensions/slack-communication/extension.js +32 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
- package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/edit-message.js +37 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-card.js +25 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-file.js +75 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-update.js +36 -0
- package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/react.js +27 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/set-status.js +18 -0
- package/dist/extensions.d.ts +85 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +140 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
- package/dist/files-backends/agent-store-presigned-url.js +223 -0
- package/dist/files-backends/cursor-hosted.d.ts +126 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +978 -0
- package/dist/files-backends/local-fs.d.ts +33 -0
- package/dist/files-backends/local-fs.d.ts.map +1 -0
- package/dist/files-backends/local-fs.js +195 -0
- package/dist/files.d.ts +225 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +152 -0
- package/dist/filesystem.d.ts +484 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1698 -0
- package/dist/hooks.d.ts +25 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +25 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/internal/advertise-tools.d.ts +95 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +265 -0
- package/dist/internal/approval-gate.d.ts +33 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +80 -0
- package/dist/internal/artifacts-store.d.ts +125 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +737 -0
- package/dist/internal/as-of.d.ts +37 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +207 -0
- package/dist/internal/auth.d.ts +12 -0
- package/dist/internal/auth.d.ts.map +1 -0
- package/dist/internal/auth.js +34 -0
- package/dist/internal/authored-alias-hooks.d.ts +42 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +93 -0
- package/dist/internal/authored-loaders.d.ts +50 -0
- package/dist/internal/authored-loaders.d.ts.map +1 -0
- package/dist/internal/authored-loaders.js +182 -0
- package/dist/internal/bounded-int.d.ts +11 -0
- package/dist/internal/bounded-int.d.ts.map +1 -0
- package/dist/internal/bounded-int.js +13 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -0
- package/dist/internal/brand.d.ts +6 -0
- package/dist/internal/brand.d.ts.map +1 -0
- package/dist/internal/brand.js +17 -0
- package/dist/internal/browser-origin-guard.d.ts +19 -0
- package/dist/internal/browser-origin-guard.d.ts.map +1 -0
- package/dist/internal/browser-origin-guard.js +51 -0
- package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
- package/dist/internal/builtin-tools/artifacts.js +66 -0
- package/dist/internal/builtin-tools/index.d.ts +17 -0
- package/dist/internal/builtin-tools/index.d.ts.map +1 -0
- package/dist/internal/builtin-tools/index.js +40 -0
- package/dist/internal/builtin-tools/reminders.d.ts +9 -0
- package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
- package/dist/internal/builtin-tools/reminders.js +134 -0
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +75 -0
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +62 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +69 -0
- package/dist/internal/chat-client.d.ts +45 -0
- package/dist/internal/chat-client.d.ts.map +1 -0
- package/dist/internal/chat-client.js +478 -0
- package/dist/internal/cli-ax.d.ts +233 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1864 -0
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +360 -0
- package/dist/internal/cli-convert-automation.d.ts +39 -0
- package/dist/internal/cli-convert-automation.d.ts.map +1 -0
- package/dist/internal/cli-convert-automation.js +281 -0
- package/dist/internal/cli-cursor.d.ts +38 -0
- package/dist/internal/cli-cursor.d.ts.map +1 -0
- package/dist/internal/cli-cursor.js +226 -0
- package/dist/internal/cli-deploy.d.ts +164 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +1930 -0
- package/dist/internal/cli-docs.d.ts +34 -0
- package/dist/internal/cli-docs.d.ts.map +1 -0
- package/dist/internal/cli-docs.js +173 -0
- package/dist/internal/cli-github.d.ts +47 -0
- package/dist/internal/cli-github.d.ts.map +1 -0
- package/dist/internal/cli-github.js +639 -0
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +379 -0
- package/dist/internal/cli-images.d.ts +68 -0
- package/dist/internal/cli-images.d.ts.map +1 -0
- package/dist/internal/cli-images.js +604 -0
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +49 -0
- package/dist/internal/cli-mcp-oauth.d.ts +51 -0
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
- package/dist/internal/cli-mcp-oauth.js +318 -0
- package/dist/internal/cli-mcp.d.ts +75 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +684 -0
- package/dist/internal/cli-skills.d.ts +21 -0
- package/dist/internal/cli-skills.d.ts.map +1 -0
- package/dist/internal/cli-skills.js +77 -0
- package/dist/internal/cli-slack-manual.d.ts +42 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +325 -0
- package/dist/internal/cli-slack.d.ts +59 -0
- package/dist/internal/cli-slack.d.ts.map +1 -0
- package/dist/internal/cli-slack.js +695 -0
- package/dist/internal/cloud-merge.d.ts +25 -0
- package/dist/internal/cloud-merge.d.ts.map +1 -0
- package/dist/internal/cloud-merge.js +36 -0
- package/dist/internal/cloud-turn-cost.d.ts +42 -0
- package/dist/internal/cloud-turn-cost.d.ts.map +1 -0
- package/dist/internal/cloud-turn-cost.js +113 -0
- package/dist/internal/continuation-channel.d.ts +48 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -0
- package/dist/internal/continuation-channel.js +154 -0
- package/dist/internal/continuation-identity.d.ts +113 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +749 -0
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +342 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
- package/dist/internal/convert-automation/convert-workflow.js +998 -0
- package/dist/internal/convert-automation/slug.d.ts +9 -0
- package/dist/internal/convert-automation/slug.d.ts.map +1 -0
- package/dist/internal/convert-automation/slug.js +28 -0
- package/dist/internal/convert-automation/types.d.ts +202 -0
- package/dist/internal/convert-automation/types.d.ts.map +1 -0
- package/dist/internal/convert-automation/types.js +13 -0
- package/dist/internal/cron.d.ts +17 -0
- package/dist/internal/cron.d.ts.map +1 -0
- package/dist/internal/cron.js +60 -0
- package/dist/internal/cursor/account-mcp.d.ts +135 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
- package/dist/internal/cursor/account-mcp.js +510 -0
- package/dist/internal/cursor/backend-client.d.ts +224 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +720 -0
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +195 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +475 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +44 -0
- package/dist/internal/cursor/github-credentials.d.ts +44 -0
- package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
- package/dist/internal/cursor/github-credentials.js +191 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +81 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +63 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +112 -0
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +97 -0
- package/dist/internal/cursor/store-api-client.d.ts +82 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +226 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +66 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +241 -0
- package/dist/internal/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +43 -0
- package/dist/internal/cursor-deployment-relay.d.ts +95 -0
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
- package/dist/internal/cursor-deployment-relay.js +233 -0
- package/dist/internal/cursor-event-relay.d.ts +243 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -0
- package/dist/internal/cursor-event-relay.js +424 -0
- package/dist/internal/cursor-relay-core.d.ts +160 -0
- package/dist/internal/cursor-relay-core.d.ts.map +1 -0
- package/dist/internal/cursor-relay-core.js +470 -0
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +576 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +987 -0
- package/dist/internal/deploy-manifest.d.ts +135 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +231 -0
- package/dist/internal/deploy-source.d.ts +38 -0
- package/dist/internal/deploy-source.d.ts.map +1 -0
- package/dist/internal/deploy-source.js +136 -0
- package/dist/internal/describe-error.d.ts +4 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +29 -0
- package/dist/internal/dev-mode.d.ts +13 -0
- package/dist/internal/dev-mode.d.ts.map +1 -0
- package/dist/internal/dev-mode.js +17 -0
- package/dist/internal/discovery/agent-config.d.ts +48 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +224 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +326 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +429 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +549 -0
- package/dist/internal/discovery/extension-overlay.d.ts +31 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +173 -0
- package/dist/internal/discovery/extensions.d.ts +27 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +352 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +61 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +168 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +104 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +290 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +65 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +118 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +26 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +138 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +129 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +155 -0
- package/dist/internal/discovery.d.ts +15 -0
- package/dist/internal/discovery.d.ts.map +1 -0
- package/dist/internal/discovery.js +13 -0
- package/dist/internal/distribution.d.ts +65 -0
- package/dist/internal/distribution.d.ts.map +1 -0
- package/dist/internal/distribution.js +102 -0
- package/dist/internal/docs-site.d.ts +41 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +234 -0
- package/dist/internal/duration.d.ts +8 -0
- package/dist/internal/duration.d.ts.map +1 -0
- package/dist/internal/duration.js +35 -0
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/eval-judge-model.d.ts +59 -0
- package/dist/internal/eval-judge-model.d.ts.map +1 -0
- package/dist/internal/eval-judge-model.js +129 -0
- package/dist/internal/eval-run-store.d.ts +119 -0
- package/dist/internal/eval-run-store.d.ts.map +1 -0
- package/dist/internal/eval-run-store.js +468 -0
- package/dist/internal/eval-runner.d.ts +98 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +615 -0
- package/dist/internal/evals-client.d.ts +104 -0
- package/dist/internal/evals-client.d.ts.map +1 -0
- package/dist/internal/evals-client.js +303 -0
- package/dist/internal/event-log.d.ts +94 -0
- package/dist/internal/event-log.d.ts.map +1 -0
- package/dist/internal/event-log.js +347 -0
- package/dist/internal/event-mapper.d.ts +123 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +370 -0
- package/dist/internal/expected-delivery-failure.d.ts +3 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
- package/dist/internal/expected-delivery-failure.js +28 -0
- package/dist/internal/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +172 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +212 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/nearest.d.ts +14 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +101 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +204 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +631 -0
- package/dist/internal/filesystem/walk.d.ts +77 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +350 -0
- package/dist/internal/framework-file-storage.d.ts +75 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +338 -0
- package/dist/internal/framework-storage-selection.d.ts +66 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +123 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +87 -0
- package/dist/internal/github-fanout.d.ts +32 -0
- package/dist/internal/github-fanout.d.ts.map +1 -0
- package/dist/internal/github-fanout.js +120 -0
- package/dist/internal/guest-network.d.ts +98 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +326 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +91 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +199 -0
- package/dist/internal/host-files.d.ts +29 -0
- package/dist/internal/host-files.d.ts.map +1 -0
- package/dist/internal/host-files.js +274 -0
- package/dist/internal/host-kv.d.ts +21 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +77 -0
- package/dist/internal/host-otel.d.ts +25 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +162 -0
- package/dist/internal/host-platforms.d.ts +58 -0
- package/dist/internal/host-platforms.d.ts.map +1 -0
- package/dist/internal/host-platforms.js +126 -0
- package/dist/internal/hosted-admission-adapter.d.ts +36 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-catch-protocol.d.ts +51 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +87 -0
- package/dist/internal/hosted-catch.d.ts +40 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +146 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +199 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +516 -0
- package/dist/internal/hosted-delivery.d.ts +110 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +768 -0
- package/dist/internal/hosted-execution-diag.d.ts +75 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +220 -0
- package/dist/internal/hosted-execution-flush.d.ts +50 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +71 -0
- package/dist/internal/hosted-execution-latency.d.ts +80 -0
- package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
- package/dist/internal/hosted-execution-latency.js +218 -0
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +83 -0
- package/dist/internal/hosting.d.ts +53 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +93 -0
- package/dist/internal/http-channel-define.d.ts +11 -0
- package/dist/internal/http-channel-define.d.ts.map +1 -0
- package/dist/internal/http-channel-define.js +18 -0
- package/dist/internal/http-channel.d.ts +54 -0
- package/dist/internal/http-channel.d.ts.map +1 -0
- package/dist/internal/http-channel.js +534 -0
- package/dist/internal/http-control-plane-session.d.ts +34 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +93 -0
- package/dist/internal/ids.d.ts +19 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +34 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
- package/dist/internal/incoming-headers-to-fetch.js +41 -0
- package/dist/internal/init-interview.d.ts +67 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +295 -0
- package/dist/internal/init-project.d.ts +175 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +531 -0
- package/dist/internal/init-scaffold.d.ts +9 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +172 -0
- package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
- package/dist/internal/inline-stdio-define-stub.js +4 -0
- package/dist/internal/inline-stdio-mcp.d.ts +34 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
- package/dist/internal/inline-stdio-mcp.js +176 -0
- package/dist/internal/install-cursor-skills.d.ts +164 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +498 -0
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts +25 -0
- package/dist/internal/json-schema.d.ts.map +1 -0
- package/dist/internal/json-schema.js +76 -0
- package/dist/internal/legacy-command-guard.d.ts +22 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +51 -0
- package/dist/internal/listen-port.d.ts +22 -0
- package/dist/internal/listen-port.d.ts.map +1 -0
- package/dist/internal/listen-port.js +77 -0
- package/dist/internal/local-control-plane.d.ts +59 -0
- package/dist/internal/local-control-plane.d.ts.map +1 -0
- package/dist/internal/local-control-plane.js +351 -0
- package/dist/internal/local-env.d.ts +10 -0
- package/dist/internal/local-env.d.ts.map +1 -0
- package/dist/internal/local-env.js +55 -0
- package/dist/internal/local-ingress.d.ts +35 -0
- package/dist/internal/local-ingress.d.ts.map +1 -0
- package/dist/internal/local-ingress.js +44 -0
- package/dist/internal/log-ring.d.ts +23 -0
- package/dist/internal/log-ring.d.ts.map +1 -0
- package/dist/internal/log-ring.js +42 -0
- package/dist/internal/logs-client.d.ts +79 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +350 -0
- package/dist/internal/map-pool.d.ts +11 -0
- package/dist/internal/map-pool.d.ts.map +1 -0
- package/dist/internal/map-pool.js +48 -0
- package/dist/internal/mcp-endpoint.d.ts +72 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +530 -0
- package/dist/internal/mcp-host.d.ts +84 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +391 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +90 -0
- package/dist/internal/mcp-oauth.d.ts +118 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -0
- package/dist/internal/mcp-oauth.js +450 -0
- package/dist/internal/net.d.ts +5 -0
- package/dist/internal/net.d.ts.map +1 -0
- package/dist/internal/net.js +28 -0
- package/dist/internal/open-browser.d.ts +5 -0
- package/dist/internal/open-browser.d.ts.map +1 -0
- package/dist/internal/open-browser.js +34 -0
- package/dist/internal/otel/attrs.d.ts +7 -0
- package/dist/internal/otel/attrs.d.ts.map +1 -0
- package/dist/internal/otel/attrs.js +13 -0
- package/dist/internal/otel/collector.d.ts +43 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +650 -0
- package/dist/internal/otel/config.d.ts +40 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +231 -0
- package/dist/internal/otel/http.d.ts +13 -0
- package/dist/internal/otel/http.d.ts.map +1 -0
- package/dist/internal/otel/http.js +95 -0
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +55 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +46 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +333 -0
- package/dist/internal/package-inline-stdio.d.ts +12 -0
- package/dist/internal/package-inline-stdio.d.ts.map +1 -0
- package/dist/internal/package-inline-stdio.js +99 -0
- package/dist/internal/peer-connections.d.ts +44 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +67 -0
- package/dist/internal/platform-schedule-sync.d.ts +17 -0
- package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
- package/dist/internal/platform-schedule-sync.js +70 -0
- package/dist/internal/platform-timers.d.ts +35 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +277 -0
- package/dist/internal/playground/static.d.ts +52 -0
- package/dist/internal/playground/static.d.ts.map +1 -0
- package/dist/internal/playground/static.js +231 -0
- package/dist/internal/playground/toolchain.d.ts +57 -0
- package/dist/internal/playground/toolchain.d.ts.map +1 -0
- package/dist/internal/playground/toolchain.js +229 -0
- package/dist/internal/playground-proxy.d.ts +69 -0
- package/dist/internal/playground-proxy.d.ts.map +1 -0
- package/dist/internal/playground-proxy.js +474 -0
- package/dist/internal/process-memory-telemetry.d.ts +89 -0
- package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
- package/dist/internal/process-memory-telemetry.js +244 -0
- package/dist/internal/project-layout.d.ts +7 -0
- package/dist/internal/project-layout.d.ts.map +1 -0
- package/dist/internal/project-layout.js +24 -0
- package/dist/internal/prompt-context.d.ts +38 -0
- package/dist/internal/prompt-context.d.ts.map +1 -0
- package/dist/internal/prompt-context.js +89 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +246 -0
- package/dist/internal/reminder-runner.d.ts +208 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1231 -0
- package/dist/internal/reminder-schedule.d.ts +25 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +82 -0
- package/dist/internal/reminder-store.d.ts +78 -0
- package/dist/internal/reminder-store.d.ts.map +1 -0
- package/dist/internal/reminder-store.js +126 -0
- package/dist/internal/request-error-status.d.ts +14 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +76 -0
- package/dist/internal/request-headers.d.ts +11 -0
- package/dist/internal/request-headers.d.ts.map +1 -0
- package/dist/internal/request-headers.js +14 -0
- package/dist/internal/resolve-prod-target.d.ts +84 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +259 -0
- package/dist/internal/resolved-connections.d.ts +62 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +93 -0
- package/dist/internal/router.d.ts +33 -0
- package/dist/internal/router.d.ts.map +1 -0
- package/dist/internal/router.js +93 -0
- package/dist/internal/run-client.d.ts +68 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +239 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +24 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +54 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +28 -0
- package/dist/internal/schedule-runner.d.ts +31 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +127 -0
- package/dist/internal/scm/pr-url.d.ts +56 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +152 -0
- package/dist/internal/sdk-runner.d.ts +190 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +714 -0
- package/dist/internal/serve-restart.d.ts +42 -0
- package/dist/internal/serve-restart.d.ts.map +1 -0
- package/dist/internal/serve-restart.js +85 -0
- package/dist/internal/server.d.ts +34 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2464 -0
- package/dist/internal/session-cost.d.ts +50 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +157 -0
- package/dist/internal/session-engine.d.ts +912 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4493 -0
- package/dist/internal/session-links.d.ts +14 -0
- package/dist/internal/session-links.d.ts.map +1 -0
- package/dist/internal/session-links.js +67 -0
- package/dist/internal/session-run-log.d.ts +122 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +345 -0
- package/dist/internal/session-store.d.ts +73 -0
- package/dist/internal/session-store.d.ts.map +1 -0
- package/dist/internal/session-store.js +310 -0
- package/dist/internal/session-urls.d.ts +10 -0
- package/dist/internal/session-urls.d.ts.map +1 -0
- package/dist/internal/session-urls.js +25 -0
- package/dist/internal/sessions-client.d.ts +50 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +207 -0
- package/dist/internal/skill-catalog.d.ts +28 -0
- package/dist/internal/skill-catalog.d.ts.map +1 -0
- package/dist/internal/skill-catalog.js +41 -0
- package/dist/internal/skills-sync.d.ts +24 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +56 -0
- package/dist/internal/slack-provision-client.d.ts +198 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +346 -0
- package/dist/internal/slack-thread-key.d.ts +7 -0
- package/dist/internal/slack-thread-key.d.ts.map +1 -0
- package/dist/internal/slack-thread-key.js +10 -0
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/internal/storage-coordinator.d.ts +203 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +705 -0
- package/dist/internal/storage-roles.d.ts +78 -0
- package/dist/internal/storage-roles.d.ts.map +1 -0
- package/dist/internal/storage-roles.js +24 -0
- package/dist/internal/storage.d.ts +2 -0
- package/dist/internal/storage.d.ts.map +1 -0
- package/dist/internal/storage.js +1 -0
- package/dist/internal/store-api-protocol.d.ts +134 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +124 -0
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/stream-progress.d.ts +14 -0
- package/dist/internal/stream-progress.d.ts.map +1 -0
- package/dist/internal/stream-progress.js +229 -0
- package/dist/internal/terminal-style.d.ts +40 -0
- package/dist/internal/terminal-style.d.ts.map +1 -0
- package/dist/internal/terminal-style.js +94 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +70 -0
- package/dist/internal/tool-policy.d.ts +110 -0
- package/dist/internal/tool-policy.d.ts.map +1 -0
- package/dist/internal/tool-policy.js +138 -0
- package/dist/internal/tool-result.d.ts +20 -0
- package/dist/internal/tool-result.d.ts.map +1 -0
- package/dist/internal/tool-result.js +45 -0
- package/dist/internal/trajectory.d.ts +69 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +351 -0
- package/dist/internal/turn-cost.d.ts +41 -0
- package/dist/internal/turn-cost.d.ts.map +1 -0
- package/dist/internal/turn-cost.js +109 -0
- package/dist/internal/turn-governor.d.ts +54 -0
- package/dist/internal/turn-governor.d.ts.map +1 -0
- package/dist/internal/turn-governor.js +111 -0
- package/dist/internal/turn-lease-store.d.ts +44 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +139 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +427 -0
- package/dist/internal/v2-hosting.d.ts +31 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +33 -0
- package/dist/internal/workspace-sync.d.ts +47 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +104 -0
- package/dist/internal/workspace.d.ts +151 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +455 -0
- package/dist/kv/memory-kv.d.ts +24 -0
- package/dist/kv/memory-kv.d.ts.map +1 -0
- package/dist/kv/memory-kv.js +104 -0
- package/dist/kv.d.ts +18 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +16 -0
- package/dist/memory.d.ts +138 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +401 -0
- package/dist/otel-public.d.ts +7 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +131 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +186 -0
- package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
- package/dist/playground/assets/index-BMV_IcEE.css +1 -0
- package/dist/playground/assets/index-FFdUqTt_.js +71 -0
- package/dist/playground/index.html +17 -0
- package/dist/prompt.d.ts +39 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +70 -0
- package/dist/reminders.d.ts +42 -0
- package/dist/reminders.d.ts.map +1 -0
- package/dist/reminders.js +45 -0
- package/dist/schedules.d.ts +23 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/schedules.js +26 -0
- package/dist/skills.d.ts +22 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +22 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts +82 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +171 -0
- package/dist/storage-backends/cursor-hosted.d.ts +107 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +278 -0
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +254 -0
- package/dist/storage-protocol.d.ts +142 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +201 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +154 -0
- package/dist/tools.d.ts +132 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +77 -0
- package/dist/types.d.ts +3375 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +189 -0
- package/docs/README.md +119 -0
- package/docs/building-with-agents.md +140 -0
- package/docs/deployment.md +216 -0
- package/docs/evals.md +262 -0
- package/docs/guides/agent-to-agent.md +157 -0
- package/docs/guides/bitbucket.md +293 -0
- package/docs/guides/cloud-agents.md +95 -0
- package/docs/guides/convert-automation.md +188 -0
- package/docs/guides/github.md +331 -0
- package/docs/guides/gitlab.md +299 -0
- package/docs/guides/grokbot-agents.md +147 -0
- package/docs/guides/hooks.md +119 -0
- package/docs/guides/improve.md +139 -0
- package/docs/guides/jev.md +299 -0
- package/docs/guides/mcp-oauth.md +167 -0
- package/docs/guides/opentelemetry.md +158 -0
- package/docs/guides/slack.md +278 -0
- package/docs/guides/webhooks.md +241 -0
- package/docs/hillclimbing.md +142 -0
- package/docs/quickstart.md +311 -0
- package/docs/reference/agent-config.md +193 -0
- package/docs/reference/artifacts.md +121 -0
- package/docs/reference/channels.md +203 -0
- package/docs/reference/cli.md +909 -0
- package/docs/reference/connections.md +277 -0
- package/docs/reference/evals.md +292 -0
- package/docs/reference/extensions.md +198 -0
- package/docs/reference/hooks.md +195 -0
- package/docs/reference/http-api.md +236 -0
- package/docs/reference/instructions.md +68 -0
- package/docs/reference/playground.md +47 -0
- package/docs/reference/project-layout.md +120 -0
- package/docs/reference/prompt.md +55 -0
- package/docs/reference/schedules.md +175 -0
- package/docs/reference/sessions.md +165 -0
- package/docs/reference/skills.md +80 -0
- package/docs/reference/subagents.md +67 -0
- package/docs/reference/tools.md +329 -0
- package/docs/templates/agentic-owners.md +100 -0
- package/docs/templates/security-reviewer.md +90 -0
- package/docs/templates/thermo-quality-review.md +83 -0
- package/docs/templates/thermo-review.md +82 -0
- package/docs/templates/triage.md +102 -0
- package/docs/troubleshooting.md +148 -0
- package/package.json +384 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +170 -0
- package/skills/debug/SKILL.md +43 -0
- package/skills/deploy/SKILL.md +169 -0
- package/skills/evals/SKILL.md +145 -0
- package/skills/framework-map/SKILL.md +125 -0
- package/skills/github/SKILL.md +110 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +84 -0
- package/skills/otel/SKILL.md +50 -0
- package/skills/setup-slack/SKILL.md +149 -0
- package/src/artifacts.ts +65 -0
- package/src/bin/agent-serve.ts +1833 -0
- package/src/channels/bitbucket/api.ts +891 -0
- package/src/channels/bitbucket/binding.ts +417 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +162 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +519 -0
- package/src/channels/bitbucket/checks.ts +146 -0
- package/src/channels/bitbucket/cursor-account.ts +106 -0
- package/src/channels/bitbucket/defaults.ts +100 -0
- package/src/channels/bitbucket/events.ts +74 -0
- package/src/channels/bitbucket/index.ts +51 -0
- package/src/channels/bitbucket/replay.ts +421 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +261 -0
- package/src/channels/change-monitors/change-monitors-channel.ts +63 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +42 -0
- package/src/channels/checks.ts +185 -0
- package/src/channels/deployments/deployments-channel.ts +224 -0
- package/src/channels/deployments/index.ts +25 -0
- package/src/channels/deployments/types.ts +92 -0
- package/src/channels/github/api.ts +526 -0
- package/src/channels/github/auth.ts +254 -0
- package/src/channels/github/binding.ts +233 -0
- package/src/channels/github/checks.ts +145 -0
- package/src/channels/github/cursor-account.ts +303 -0
- package/src/channels/github/defaults.ts +168 -0
- package/src/channels/github/events.ts +67 -0
- package/src/channels/github/forward.ts +359 -0
- package/src/channels/github/github-channel.ts +2334 -0
- package/src/channels/github/index.ts +54 -0
- package/src/channels/github/progress.ts +365 -0
- package/src/channels/github/replay.ts +372 -0
- package/src/channels/github/state.ts +124 -0
- package/src/channels/github/types.ts +590 -0
- package/src/channels/gitlab/api.ts +329 -0
- package/src/channels/gitlab/binding.ts +231 -0
- package/src/channels/gitlab/checks.ts +228 -0
- package/src/channels/gitlab/cursor-account.ts +105 -0
- package/src/channels/gitlab/defaults.ts +80 -0
- package/src/channels/gitlab/events.ts +37 -0
- package/src/channels/gitlab/gitlab-channel.ts +160 -0
- package/src/channels/gitlab/gitlab-webhook.ts +509 -0
- package/src/channels/gitlab/index.ts +44 -0
- package/src/channels/gitlab/replay.ts +328 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +247 -0
- package/src/channels/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +45 -0
- package/src/channels/issues/types.ts +38 -0
- package/src/channels/origin/api.ts +507 -0
- package/src/channels/origin/binding.ts +114 -0
- package/src/channels/origin/checks.ts +250 -0
- package/src/channels/origin/cursor-account.ts +58 -0
- package/src/channels/origin/defaults.ts +140 -0
- package/src/channels/origin/events.ts +35 -0
- package/src/channels/origin/index.ts +35 -0
- package/src/channels/origin/origin-channel.ts +815 -0
- package/src/channels/origin/origin-webhook.ts +296 -0
- package/src/channels/origin/reactions.ts +72 -0
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +295 -0
- package/src/channels/slack/agentic-delivery.ts +634 -0
- package/src/channels/slack/agentic-posted.ts +135 -0
- package/src/channels/slack/agentic-signals.ts +231 -0
- package/src/channels/slack/api.ts +761 -0
- package/src/channels/slack/approvals.ts +279 -0
- package/src/channels/slack/assistant.ts +76 -0
- package/src/channels/slack/attachments.ts +596 -0
- package/src/channels/slack/auth.ts +127 -0
- package/src/channels/slack/blocks.ts +131 -0
- package/src/channels/slack/bot-mentions.ts +318 -0
- package/src/channels/slack/channel-watch.ts +314 -0
- package/src/channels/slack/cli-project.ts +249 -0
- package/src/channels/slack/code-fences.ts +171 -0
- package/src/channels/slack/constants.ts +38 -0
- package/src/channels/slack/credentials.ts +88 -0
- package/src/channels/slack/defaults.ts +714 -0
- package/src/channels/slack/dispatch.ts +1060 -0
- package/src/channels/slack/doctor.ts +338 -0
- package/src/channels/slack/eval-directive.ts +306 -0
- package/src/channels/slack/event-id-dedupe.ts +30 -0
- package/src/channels/slack/external-policy.ts +75 -0
- package/src/channels/slack/footer.ts +106 -0
- package/src/channels/slack/inbound.ts +416 -0
- package/src/channels/slack/index.ts +53 -0
- package/src/channels/slack/init.ts +169 -0
- package/src/channels/slack/interactive.ts +406 -0
- package/src/channels/slack/links.ts +23 -0
- package/src/channels/slack/live-delivery.ts +489 -0
- package/src/channels/slack/log.ts +70 -0
- package/src/channels/slack/manifest.ts +239 -0
- package/src/channels/slack/message-body.ts +82 -0
- package/src/channels/slack/nudge-carrier.ts +224 -0
- package/src/channels/slack/nudge-store.ts +334 -0
- package/src/channels/slack/paint-start.ts +93 -0
- package/src/channels/slack/placeholder.ts +358 -0
- package/src/channels/slack/pr-ref.ts +74 -0
- package/src/channels/slack/progress-delivery.ts +138 -0
- package/src/channels/slack/reasoning-card.ts +125 -0
- package/src/channels/slack/reasoning-chip.ts +41 -0
- package/src/channels/slack/recording-sink.ts +167 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +279 -0
- package/src/channels/slack/setup.ts +125 -0
- package/src/channels/slack/slack-channel.ts +744 -0
- package/src/channels/slack/socket-mode.ts +140 -0
- package/src/channels/slack/stop.ts +25 -0
- package/src/channels/slack/stream.ts +66 -0
- package/src/channels/slack/thread-context.ts +485 -0
- package/src/channels/slack/tool-approval-events.ts +233 -0
- package/src/channels/slack/tool-cards.ts +198 -0
- package/src/channels/slack/tool-chip.ts +34 -0
- package/src/channels/slack/types.ts +782 -0
- package/src/channels/slack/upload.ts +137 -0
- package/src/channels.ts +543 -0
- package/src/connections.ts +153 -0
- package/src/dashboard-session-url.ts +30 -0
- package/src/evals/assertions.ts +688 -0
- package/src/evals/expect.ts +250 -0
- package/src/evals/judge.ts +329 -0
- package/src/evals/loaders.ts +111 -0
- package/src/evals/matchers.ts +223 -0
- package/src/evals/reporters.ts +257 -0
- package/src/evals/results.ts +130 -0
- package/src/evals/run-facts.ts +306 -0
- package/src/evals.ts +709 -0
- package/src/extensions/cursor-cloud-agents/extension.ts +114 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +386 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +98 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +68 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +19 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +47 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +60 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions/improve/extension.ts +69 -0
- package/src/extensions/improve/skills/yourself.ts +50 -0
- package/src/extensions/jev/extension.ts +95 -0
- package/src/extensions/jev/lib/evaluate.ts +266 -0
- package/src/extensions/jev/skills/gated-write.md +25 -0
- package/src/extensions/jev/skills/questions.md +33 -0
- package/src/extensions/jev/tools/evaluate.ts +82 -0
- package/src/extensions/slack-communication/evals/harness.ts +705 -0
- package/src/extensions/slack-communication/evals/slack-communication.eval.ts +830 -0
- package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +172 -0
- package/src/extensions/slack-communication/extension.ts +44 -0
- package/src/extensions/slack-communication/skills/slack-voice.ts +56 -0
- package/src/extensions/slack-communication/tools/delete-message.ts +33 -0
- package/src/extensions/slack-communication/tools/edit-message.ts +42 -0
- package/src/extensions/slack-communication/tools/post-card.ts +28 -0
- package/src/extensions/slack-communication/tools/post-file.ts +82 -0
- package/src/extensions/slack-communication/tools/post-update.ts +40 -0
- package/src/extensions/slack-communication/tools/react.ts +30 -0
- package/src/extensions/slack-communication/tools/set-status.ts +21 -0
- package/src/extensions.ts +179 -0
- package/src/files-backends/agent-store-presigned-url.ts +11 -0
- package/src/files-backends/cursor-hosted.ts +1212 -0
- package/src/files-backends/local-fs.ts +163 -0
- package/src/files.ts +293 -0
- package/src/filesystem.ts +2005 -0
- package/src/hooks.ts +30 -0
- package/src/index.ts +259 -0
- package/src/internal/advertise-tools.ts +370 -0
- package/src/internal/approval-gate.ts +103 -0
- package/src/internal/artifacts-store.ts +825 -0
- package/src/internal/as-of.ts +257 -0
- package/src/internal/auth.ts +46 -0
- package/src/internal/authored-alias-hooks.ts +138 -0
- package/src/internal/authored-loaders.ts +188 -0
- package/src/internal/bounded-int.ts +24 -0
- package/src/internal/bounded.ts +25 -0
- package/src/internal/brand.ts +28 -0
- package/src/internal/browser-origin-guard.ts +67 -0
- package/src/internal/builtin-tools/artifacts.ts +62 -0
- package/src/internal/builtin-tools/index.ts +53 -0
- package/src/internal/builtin-tools/reminders.ts +145 -0
- package/src/internal/channel-dispatch.ts +129 -0
- package/src/internal/channel-route-dispatch.ts +58 -0
- package/src/internal/channel-state.ts +83 -0
- package/src/internal/chat-client.ts +594 -0
- package/src/internal/cli-ax.ts +2273 -0
- package/src/internal/cli-bitbucket.ts +438 -0
- package/src/internal/cli-convert-automation.ts +335 -0
- package/src/internal/cli-cursor.ts +282 -0
- package/src/internal/cli-deploy.ts +2486 -0
- package/src/internal/cli-docs.ts +192 -0
- package/src/internal/cli-github.ts +806 -0
- package/src/internal/cli-gitlab.ts +452 -0
- package/src/internal/cli-images.ts +672 -0
- package/src/internal/cli-manifest.ts +56 -0
- package/src/internal/cli-mcp-oauth.ts +395 -0
- package/src/internal/cli-mcp.ts +808 -0
- package/src/internal/cli-skills.ts +99 -0
- package/src/internal/cli-slack-manual.ts +418 -0
- package/src/internal/cli-slack.ts +874 -0
- package/src/internal/cloud-merge.ts +51 -0
- package/src/internal/cloud-turn-cost.ts +159 -0
- package/src/internal/continuation-channel.ts +233 -0
- package/src/internal/continuation-identity.ts +935 -0
- package/src/internal/conversation-mirror.ts +423 -0
- package/src/internal/convert-automation/convert-workflow.ts +1377 -0
- package/src/internal/convert-automation/slug.ts +29 -0
- package/src/internal/convert-automation/types.ts +212 -0
- package/src/internal/cron.ts +76 -0
- package/src/internal/cursor/account-mcp.ts +692 -0
- package/src/internal/cursor/backend-client.ts +978 -0
- package/src/internal/cursor/bound-secret-file.ts +101 -0
- package/src/internal/cursor/credentials.ts +560 -0
- package/src/internal/cursor/cursor-api-transport.ts +65 -0
- package/src/internal/cursor/github-credentials.ts +228 -0
- package/src/internal/cursor/hosted-bound-secrets.ts +71 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +100 -0
- package/src/internal/cursor/hosted-store-secrets.ts +152 -0
- package/src/internal/cursor/session-token.ts +111 -0
- package/src/internal/cursor/store-api-client.ts +323 -0
- package/src/internal/cursor-account-mcp-auth.ts +303 -0
- package/src/internal/cursor-agent-template.ts +50 -0
- package/src/internal/cursor-deployment-relay.ts +315 -0
- package/src/internal/cursor-event-relay.ts +675 -0
- package/src/internal/cursor-relay-core.ts +563 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +1504 -0
- package/src/internal/deploy-manifest.ts +361 -0
- package/src/internal/deploy-source.ts +144 -0
- package/src/internal/describe-error.ts +32 -0
- package/src/internal/dev-mode.ts +20 -0
- package/src/internal/discovery/agent-config.ts +288 -0
- package/src/internal/discovery/agent.ts +381 -0
- package/src/internal/discovery/channels.ts +100 -0
- package/src/internal/discovery/connections.ts +505 -0
- package/src/internal/discovery/context.ts +38 -0
- package/src/internal/discovery/cursor-plugin.ts +628 -0
- package/src/internal/discovery/extension-overlay.ts +247 -0
- package/src/internal/discovery/extensions.ts +490 -0
- package/src/internal/discovery/fs.ts +103 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +174 -0
- package/src/internal/discovery/instructions.ts +98 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +319 -0
- package/src/internal/discovery/reminders.ts +65 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +34 -0
- package/src/internal/discovery/services.ts +151 -0
- package/src/internal/discovery/skills.ts +174 -0
- package/src/internal/discovery/subagent.ts +138 -0
- package/src/internal/discovery/tools.ts +170 -0
- package/src/internal/discovery.ts +27 -0
- package/src/internal/distribution.ts +126 -0
- package/src/internal/docs-site.ts +248 -0
- package/src/internal/duration.ts +37 -0
- package/src/internal/env-file.ts +83 -0
- package/src/internal/eval-judge-model.ts +142 -0
- package/src/internal/eval-run-store.ts +585 -0
- package/src/internal/eval-runner.ts +823 -0
- package/src/internal/evals-client.ts +475 -0
- package/src/internal/event-log.ts +342 -0
- package/src/internal/event-mapper.ts +480 -0
- package/src/internal/expected-delivery-failure.ts +34 -0
- package/src/internal/factory-resource-channel.ts +103 -0
- package/src/internal/filesystem/errors.ts +207 -0
- package/src/internal/filesystem/format.ts +253 -0
- package/src/internal/filesystem/merge.ts +192 -0
- package/src/internal/filesystem/nearest.ts +112 -0
- package/src/internal/filesystem/scratch.ts +239 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +804 -0
- package/src/internal/filesystem/walk.ts +366 -0
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/framework-file-storage.ts +357 -0
- package/src/internal/framework-storage-selection.ts +156 -0
- package/src/internal/frontmatter.ts +108 -0
- package/src/internal/github-fanout.ts +144 -0
- package/src/internal/guest-network.ts +391 -0
- package/src/internal/handleAgentServeTrigger.ts +286 -0
- package/src/internal/host-files.ts +341 -0
- package/src/internal/host-kv.ts +81 -0
- package/src/internal/host-otel.ts +231 -0
- package/src/internal/host-platforms.ts +170 -0
- package/src/internal/hosted-admission-adapter.ts +47 -0
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-catch-protocol.ts +112 -0
- package/src/internal/hosted-catch.ts +179 -0
- package/src/internal/hosted-delivery-protocol.ts +787 -0
- package/src/internal/hosted-delivery.ts +1152 -0
- package/src/internal/hosted-execution-diag.ts +291 -0
- package/src/internal/hosted-execution-flush.ts +136 -0
- package/src/internal/hosted-execution-latency.ts +301 -0
- package/src/internal/hosted-managed-automation.ts +116 -0
- package/src/internal/hosting.ts +107 -0
- package/src/internal/http-channel-define.ts +25 -0
- package/src/internal/http-channel.ts +669 -0
- package/src/internal/http-control-plane-session.ts +110 -0
- package/src/internal/ids.ts +39 -0
- package/src/internal/incoming-headers-to-fetch.ts +45 -0
- package/src/internal/init-interview.ts +360 -0
- package/src/internal/init-project.ts +711 -0
- package/src/internal/init-scaffold.ts +182 -0
- package/src/internal/inline-stdio-define-stub.ts +4 -0
- package/src/internal/inline-stdio-mcp.ts +230 -0
- package/src/internal/install-cursor-skills.ts +601 -0
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +95 -0
- package/src/internal/legacy-command-guard.ts +54 -0
- package/src/internal/listen-port.ts +85 -0
- package/src/internal/local-control-plane.ts +442 -0
- package/src/internal/local-env.ts +59 -0
- package/src/internal/local-ingress.ts +90 -0
- package/src/internal/log-ring.ts +59 -0
- package/src/internal/logs-client.ts +477 -0
- package/src/internal/map-pool.ts +39 -0
- package/src/internal/mcp-endpoint.ts +747 -0
- package/src/internal/mcp-host.ts +481 -0
- package/src/internal/mcp-oauth-on-demand.ts +337 -0
- package/src/internal/mcp-oauth-persist.ts +118 -0
- package/src/internal/mcp-oauth.ts +549 -0
- package/src/internal/net.ts +29 -0
- package/src/internal/open-browser.ts +41 -0
- package/src/internal/otel/attrs.ts +16 -0
- package/src/internal/otel/collector.ts +937 -0
- package/src/internal/otel/config.ts +287 -0
- package/src/internal/otel/http.ts +122 -0
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +441 -0
- package/src/internal/package-inline-stdio.ts +114 -0
- package/src/internal/peer-connections.ts +96 -0
- package/src/internal/platform-schedule-sync.ts +75 -0
- package/src/internal/platform-timers.ts +365 -0
- package/src/internal/playground/static.ts +278 -0
- package/src/internal/playground/toolchain.ts +270 -0
- package/src/internal/playground-proxy.ts +564 -0
- package/src/internal/process-memory-telemetry.ts +334 -0
- package/src/internal/project-layout.ts +31 -0
- package/src/internal/prompt-context.ts +116 -0
- package/src/internal/reminder-control-plane-protocol.ts +482 -0
- package/src/internal/reminder-runner.ts +1559 -0
- package/src/internal/reminder-schedule.ts +104 -0
- package/src/internal/reminder-store.ts +176 -0
- package/src/internal/request-error-status.ts +95 -0
- package/src/internal/request-headers.ts +21 -0
- package/src/internal/resolve-prod-target.ts +334 -0
- package/src/internal/resolved-connections.ts +190 -0
- package/src/internal/router.ts +143 -0
- package/src/internal/run-client.ts +354 -0
- package/src/internal/runtime-dispatch-runner.ts +50 -0
- package/src/internal/sanitize-mcp-tool-name.ts +31 -0
- package/src/internal/schedule-runner.ts +154 -0
- package/src/internal/scm/pr-url.ts +245 -0
- package/src/internal/sdk-runner.ts +948 -0
- package/src/internal/serve-restart.ts +113 -0
- package/src/internal/server.ts +3135 -0
- package/src/internal/session-cost.ts +208 -0
- package/src/internal/session-engine.ts +5602 -0
- package/src/internal/session-links.ts +84 -0
- package/src/internal/session-run-log.ts +535 -0
- package/src/internal/session-store.ts +307 -0
- package/src/internal/session-urls.ts +32 -0
- package/src/internal/sessions-client.ts +239 -0
- package/src/internal/skill-catalog.ts +66 -0
- package/src/internal/skills-sync.ts +55 -0
- package/src/internal/slack-provision-client.ts +544 -0
- package/src/internal/slack-thread-key.ts +11 -0
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +164 -0
- package/src/internal/steering.ts +17 -0
- package/src/internal/storage-coordinator.ts +800 -0
- package/src/internal/storage-roles.ts +86 -0
- package/src/internal/storage.ts +1 -0
- package/src/internal/store-api-protocol.ts +205 -0
- package/src/internal/store-mirror.ts +73 -0
- package/src/internal/stream-progress.ts +294 -0
- package/src/internal/terminal-style.ts +133 -0
- package/src/internal/testing/factory-resource-fixtures.ts +84 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +285 -0
- package/src/internal/tool-catalog.ts +104 -0
- package/src/internal/tool-policy.ts +222 -0
- package/src/internal/tool-result.ts +50 -0
- package/src/internal/trajectory.ts +418 -0
- package/src/internal/turn-cost.ts +136 -0
- package/src/internal/turn-governor.ts +145 -0
- package/src/internal/turn-lease-store.ts +144 -0
- package/src/internal/turn-outbox.ts +77 -0
- package/src/internal/update-check.ts +517 -0
- package/src/internal/v2-hosting.ts +52 -0
- package/src/internal/workspace-sync.ts +114 -0
- package/src/internal/workspace.ts +505 -0
- package/src/kv/memory-kv.ts +94 -0
- package/src/kv.ts +18 -0
- package/src/memory.ts +487 -0
- package/src/otel-public.ts +24 -0
- package/src/otel.ts +320 -0
- package/src/prompt.ts +80 -0
- package/src/reminders.ts +65 -0
- package/src/schedules.ts +31 -0
- package/src/skills.ts +27 -0
- package/src/storage-backends/cursor-hosted-v2.ts +204 -0
- package/src/storage-backends/cursor-hosted.ts +388 -0
- package/src/storage-backends/file-kv.ts +276 -0
- package/src/storage-protocol.ts +261 -0
- package/src/storage.ts +408 -0
- package/src/tools.ts +166 -0
- package/src/types.ts +3725 -0
- package/templates/agentic-owners/README.md +76 -0
- package/templates/agentic-owners/bot/agent.ts +8 -0
- package/templates/agentic-owners/bot/channels/github.ts +63 -0
- package/templates/agentic-owners/bot/instructions.md +34 -0
- package/templates/agentic-owners/bot/lib/config.ts +5 -0
- package/templates/agentic-owners/bot/lib/github.ts +217 -0
- package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
- package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
- package/templates/agentic-owners/bot/lib/owners/decision.ts +454 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +219 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +78 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +565 -0
- package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
- package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
- package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
- package/templates/agentic-owners/bot/lib/owners/types.ts +50 -0
- package/templates/agentic-owners/bot/lib/review.ts +722 -0
- package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
- package/templates/agentic-owners/evals/evals.config.ts +5 -0
- package/templates/agentic-owners/evals/owners.eval.ts +111 -0
- package/templates/agentic-owners/package.json +20 -0
- package/templates/agentic-owners/tsconfig.json +12 -0
- package/templates/agents-md/README.md +42 -0
- package/templates/agents-md/bot/agent.ts +8 -0
- package/templates/agents-md/bot/channels/github.ts +10 -0
- package/templates/agents-md/bot/channels/queue.ts +28 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +39 -0
- package/templates/agents-md/bot/lib/collect.ts +415 -0
- package/templates/agents-md/bot/lib/config.ts +8 -0
- package/templates/agents-md/bot/lib/paths.ts +49 -0
- package/templates/agents-md/bot/schedules/weekly.ts +17 -0
- package/templates/agents-md/bot/tools/apply_agents.ts +218 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/templates/code-wiki/README.md +37 -0
- package/templates/code-wiki/bot/agent.ts +8 -0
- package/templates/code-wiki/bot/channels/github.ts +125 -0
- package/templates/code-wiki/bot/instructions.md +39 -0
- package/templates/code-wiki/bot/lib/repos.ts +5 -0
- package/templates/code-wiki/bot/lib/wiki.ts +22 -0
- package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +124 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/README.md +40 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +48 -0
- package/templates/demo/bot/channels/queue.ts +34 -0
- package/templates/demo/bot/instructions.md +8 -0
- package/templates/demo/bot/lib/collect.ts +66 -0
- package/templates/demo/bot/lib/repos.ts +5 -0
- package/templates/demo/bot/tools/record_demo.ts +37 -0
- package/templates/demo/evals/demo.eval.ts +29 -0
- package/templates/demo/evals/evals.config.ts +5 -0
- package/templates/demo/init.json +25 -0
- package/templates/demo/package.json +18 -0
- package/templates/demo/tsconfig.json +12 -0
- package/templates/grokbot-agents/README.md +29 -0
- package/templates/grokbot-agents/bot/agent.ts +6 -0
- package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
- package/templates/grokbot-agents/bot/instructions.md +7 -0
- package/templates/grokbot-agents/evals/evals.config.ts +5 -0
- package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
- package/templates/grokbot-agents/init.json +18 -0
- package/templates/grokbot-agents/package.json +17 -0
- package/templates/grokbot-agents/tsconfig.json +12 -0
- package/templates/pr-autofixer/bot/agent.ts +11 -0
- package/templates/pr-autofixer/bot/channels/drive.ts +37 -0
- package/templates/pr-autofixer/bot/channels/github.ts +155 -0
- package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
- package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
- package/templates/pr-autofixer/bot/instructions.md +83 -0
- package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
- package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
- package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
- package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
- package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
- package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
- package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
- package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
- package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
- package/templates/pr-autofixer/bot/tools/drive_pr.ts +22 -0
- package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
- package/templates/pr-autofixer/evals/evals.config.ts +5 -0
- package/templates/pr-autofixer/init.json +25 -0
- package/templates/pr-autofixer/package.json +18 -0
- package/templates/pr-autofixer/tsconfig.json +12 -0
- package/templates/security-help/README.md +40 -0
- package/templates/security-help/bot/agent.ts +17 -0
- package/templates/security-help/bot/channels/github.ts +13 -0
- package/templates/security-help/bot/channels/slack.ts +84 -0
- package/templates/security-help/bot/instructions.md +19 -0
- package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
- package/templates/security-help/bot/lib/repos.ts +5 -0
- package/templates/security-help/bot/skills/access-request.md +10 -0
- package/templates/security-help/bot/skills/faq.md +31 -0
- package/templates/security-help/bot/skills/security-playbooks.md +12 -0
- package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
- package/templates/security-help/evals/evals.config.ts +5 -0
- package/templates/security-help/evals/security-help.eval.ts +51 -0
- package/templates/security-help/init.json +31 -0
- package/templates/security-help/package.json +17 -0
- package/templates/security-help/tsconfig.json +12 -0
- package/templates/security-reviewer/README.md +34 -0
- package/templates/security-reviewer/bot/agent.ts +8 -0
- package/templates/security-reviewer/bot/channels/github.ts +43 -0
- package/templates/security-reviewer/bot/instructions.md +22 -0
- package/templates/security-reviewer/bot/lib/repos.ts +5 -0
- package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
- package/templates/security-reviewer/evals/evals.config.ts +5 -0
- package/templates/security-reviewer/evals/review.eval.ts +50 -0
- package/templates/security-reviewer/init.json +25 -0
- package/templates/security-reviewer/package.json +18 -0
- package/templates/security-reviewer/tsconfig.json +12 -0
- package/templates/thermo-quality-review/README.md +38 -0
- package/templates/thermo-quality-review/bot/agent.ts +8 -0
- package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
- package/templates/thermo-quality-review/bot/instructions.md +43 -0
- package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
- package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
- package/templates/thermo-quality-review/package.json +18 -0
- package/templates/thermo-quality-review/tsconfig.json +12 -0
- package/templates/thermo-review/README.md +38 -0
- package/templates/thermo-review/bot/agent.ts +8 -0
- package/templates/thermo-review/bot/channels/github.ts +39 -0
- package/templates/thermo-review/bot/instructions.md +40 -0
- package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-review/evals/evals.config.ts +5 -0
- package/templates/thermo-review/evals/review.eval.ts +50 -0
- package/templates/thermo-review/package.json +18 -0
- package/templates/thermo-review/tsconfig.json +12 -0
- package/templates/triage/README.md +50 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +40 -0
- package/templates/triage/bot/channels/webhook.ts +44 -0
- package/templates/triage/bot/hooks/memory.ts +3 -0
- package/templates/triage/bot/instructions.md +38 -0
- package/templates/triage/bot/lib/actuate.ts +703 -0
- package/templates/triage/bot/lib/parse-queue-event.ts +166 -0
- package/templates/triage/bot/lib/tracker.ts +5 -0
- package/templates/triage/bot/lib/types.ts +48 -0
- package/templates/triage/bot/lib/verify-webhook.ts +79 -0
- package/templates/triage/bot/skills/triage-rubric.md +44 -0
- package/templates/triage/bot/tools/record_triage.ts +29 -0
- package/templates/triage/evals/evals.config.ts +5 -0
- package/templates/triage/evals/triage.eval.ts +64 -0
- package/templates/triage/overlays/jira/README.md +24 -0
- package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/overlays/linear/README.md +24 -0
- package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/package.json +18 -0
- package/templates/triage/tsconfig.json +12 -0
|
@@ -0,0 +1,2273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-experience CLI commands:
|
|
3
|
+
* init / run / trajectory / eval
|
|
4
|
+
*
|
|
5
|
+
* Coding agents get JSON-first output, ephemeral local servers, and
|
|
6
|
+
* filesystem-first evals under evals/ (*.eval.ts).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { dirname, join, resolve } from "node:path";
|
|
12
|
+
import { Artifacts, JUnit } from "../evals/reporters.js";
|
|
13
|
+
import type { EvalAssertionResult, EvalReporter, EvalRunSnapshot, EvalVerdict } from "../evals.js";
|
|
14
|
+
import { serve } from "../index.js";
|
|
15
|
+
import type { AgentServeHandle } from "../types.js";
|
|
16
|
+
import { lookupSessionContinuation, runChat } from "./chat-client.js";
|
|
17
|
+
import { ensureCursorLogin } from "./cli-cursor.js";
|
|
18
|
+
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
19
|
+
import { resolveApiKey } from "./cursor/credentials.js";
|
|
20
|
+
import { type AgentkitSessionRuns, DeployApiError } from "./deploy-client.js";
|
|
21
|
+
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "./distribution.js";
|
|
22
|
+
import {
|
|
23
|
+
discoverEvals,
|
|
24
|
+
type EvalRunResult,
|
|
25
|
+
filterDiscoveredEvals,
|
|
26
|
+
runDiscoveredEvals,
|
|
27
|
+
} from "./eval-runner.js";
|
|
28
|
+
import {
|
|
29
|
+
cancelRemoteEvalRun,
|
|
30
|
+
getRemoteEvalRun,
|
|
31
|
+
listRemoteEvalRuns,
|
|
32
|
+
listRemoteEvals,
|
|
33
|
+
pollRemoteEvalRun,
|
|
34
|
+
RemoteEvalError,
|
|
35
|
+
snapshotToEvalRunResults,
|
|
36
|
+
startRemoteEvalRun,
|
|
37
|
+
} from "./evals-client.js";
|
|
38
|
+
import { runTemplateInit, type TemplateInitSpec } from "./init-interview.js";
|
|
39
|
+
import {
|
|
40
|
+
checkInitTarget,
|
|
41
|
+
formatInitNextSteps,
|
|
42
|
+
formatInitScaffoldSummary,
|
|
43
|
+
initNextCommands,
|
|
44
|
+
initProject,
|
|
45
|
+
installScaffoldDependencies,
|
|
46
|
+
linkCliOntoPath,
|
|
47
|
+
printInitGuide,
|
|
48
|
+
resolveTemplate,
|
|
49
|
+
} from "./init-project.js";
|
|
50
|
+
import { offerInstallCursorSkills } from "./install-cursor-skills.js";
|
|
51
|
+
import { rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
|
|
52
|
+
import { runLogsTail, sanitizeCustomerError } from "./logs-client.js";
|
|
53
|
+
import { mapPool } from "./map-pool.js";
|
|
54
|
+
import { openBrowser } from "./open-browser.js";
|
|
55
|
+
import { startPlaygroundProxy } from "./playground-proxy.js";
|
|
56
|
+
import {
|
|
57
|
+
ProdTargetError,
|
|
58
|
+
resolveProdAliasPlaygroundUrl,
|
|
59
|
+
resolveProdPlaygroundUrl,
|
|
60
|
+
resolveProdSlug,
|
|
61
|
+
resolveProdTarget,
|
|
62
|
+
} from "./resolve-prod-target.js";
|
|
63
|
+
import { runSession } from "./run-client.js";
|
|
64
|
+
import {
|
|
65
|
+
buildSessionCostReport,
|
|
66
|
+
formatSessionCostText,
|
|
67
|
+
formatSessionsCostText,
|
|
68
|
+
type SessionCostRow,
|
|
69
|
+
} from "./session-cost.js";
|
|
70
|
+
import {
|
|
71
|
+
fetchSessionEvents,
|
|
72
|
+
formatSessionsTable,
|
|
73
|
+
listSessionsWithSource,
|
|
74
|
+
resolvePreviousSessionId,
|
|
75
|
+
} from "./sessions-client.js";
|
|
76
|
+
import { createStreamProgress } from "./stream-progress.js";
|
|
77
|
+
import {
|
|
78
|
+
buildTrajectory,
|
|
79
|
+
formatTrajectoryText,
|
|
80
|
+
loadTrajectoryFromEventsFile,
|
|
81
|
+
} from "./trajectory.js";
|
|
82
|
+
|
|
83
|
+
export interface AxCliOptions {
|
|
84
|
+
cwd?: string;
|
|
85
|
+
dir: string;
|
|
86
|
+
/**
|
|
87
|
+
* Local multi-agent mount slug, or (with `--prod`) the hosted deployment
|
|
88
|
+
* slug. When `--prod` is set and this is omitted, the slug is derived from
|
|
89
|
+
* the directory name (same as `deploy`).
|
|
90
|
+
*/
|
|
91
|
+
slug?: string;
|
|
92
|
+
bearerToken?: string;
|
|
93
|
+
stateRoot?: string;
|
|
94
|
+
/** One or more user turns. */
|
|
95
|
+
messages?: string[];
|
|
96
|
+
sessionId?: string;
|
|
97
|
+
continuationToken?: string;
|
|
98
|
+
timeoutMs?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Write raw NDJSON session events (the visualizable trace).
|
|
101
|
+
* - `true` / omitted: auto path under `<dir>/.agent-serve/traces/`
|
|
102
|
+
* - string: explicit path
|
|
103
|
+
* - `false`: skip writing
|
|
104
|
+
*/
|
|
105
|
+
events?: string | true | false;
|
|
106
|
+
text?: boolean;
|
|
107
|
+
json?: boolean;
|
|
108
|
+
list?: boolean;
|
|
109
|
+
verbose?: boolean;
|
|
110
|
+
tags?: string[];
|
|
111
|
+
/** Eval ids / path prefixes. */
|
|
112
|
+
evalIds?: string[];
|
|
113
|
+
/** `eval`: a soft threshold miss (`scored`) also fails the exit code. */
|
|
114
|
+
strict?: boolean;
|
|
115
|
+
/** `eval`: write JUnit XML to this path. */
|
|
116
|
+
junit?: string;
|
|
117
|
+
/**
|
|
118
|
+
* `eval`: run-artifact directory. Defaults to a timestamped directory under
|
|
119
|
+
* `<dir>/.agent-serve/evals/`; `false` disables artifacts entirely.
|
|
120
|
+
*/
|
|
121
|
+
artifacts?: string | false;
|
|
122
|
+
/** `eval`: skip reporters declared in `evals.config.ts` and eval files. */
|
|
123
|
+
skipReport?: boolean;
|
|
124
|
+
/** `eval`: override `evals.config.ts` `maxConcurrency`. */
|
|
125
|
+
maxConcurrency?: number;
|
|
126
|
+
/**
|
|
127
|
+
* `eval` / `eval status <runId>`: also write the full results JSON to this
|
|
128
|
+
* path. `session`: write the raw NDJSON trace (same format as `run
|
|
129
|
+
* --events` and the playground download) to this path instead of printing.
|
|
130
|
+
*/
|
|
131
|
+
out?: string;
|
|
132
|
+
/** Scaffold target directory for `init`. */
|
|
133
|
+
initTarget?: string;
|
|
134
|
+
template?: string;
|
|
135
|
+
/** `init --var id=value` (repeatable). */
|
|
136
|
+
vars?: string[];
|
|
137
|
+
/** Tool name for `call`. */
|
|
138
|
+
toolName?: string;
|
|
139
|
+
/** JSON input for `call`. */
|
|
140
|
+
toolInput?: string;
|
|
141
|
+
/** Remote agent base URL (skip local host) for run/eval/chat. */
|
|
142
|
+
url?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Route chat/resume/run/call/eval/logs/sessions at the team's hosted
|
|
145
|
+
* deployment instead of a local ephemeral server. Mutually exclusive with
|
|
146
|
+
* `--url`. For `eval`, this runs a server-side batch via
|
|
147
|
+
* `/v1/dev/evals/runs` (persisted when `defineStorage` has an `evals` table);
|
|
148
|
+
* without `--prod`, eval defaults to an ephemeral local harness.
|
|
149
|
+
*/
|
|
150
|
+
prod?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* `eval` (`--prod` / `--url` only): start the batch via
|
|
153
|
+
* `POST /v1/dev/evals/runs` and return the `runId` without polling.
|
|
154
|
+
* Mutually exclusive with `--list`.
|
|
155
|
+
*/
|
|
156
|
+
noWait?: boolean;
|
|
157
|
+
/** Cursor team id for `--prod` (defaults to the account's team). */
|
|
158
|
+
team?: string;
|
|
159
|
+
/** Cursor API key override for `--prod` management calls. */
|
|
160
|
+
apiKey?: string;
|
|
161
|
+
/** Injected fetch for `--prod` tests. */
|
|
162
|
+
fetchImpl?: typeof fetch;
|
|
163
|
+
/**
|
|
164
|
+
* Stream live turn progress to stderr (default: stderr is a TTY).
|
|
165
|
+
* Final JSON/text still goes to stdout.
|
|
166
|
+
*/
|
|
167
|
+
stream?: boolean;
|
|
168
|
+
/** Force plain chat output even on a TTY. */
|
|
169
|
+
noColor?: boolean;
|
|
170
|
+
/** `logs`: dump current buffer / progress once and exit. */
|
|
171
|
+
once?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* `session`: print raw `{ sessionId, events }` JSON instead of a trajectory.
|
|
174
|
+
* (CLI flag `--events`; rewritten from colliding with run's `--events <file>`.)
|
|
175
|
+
*/
|
|
176
|
+
rawEvents?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* `playground`: print the URL only; do not open a browser.
|
|
179
|
+
* (CLI flag `--print`.)
|
|
180
|
+
*/
|
|
181
|
+
print?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* `chat --resume` / `resume` with no session id: reattach the most
|
|
184
|
+
* recently updated followable session from `/v1/sessions`.
|
|
185
|
+
*/
|
|
186
|
+
resume?: boolean;
|
|
187
|
+
/** Abort signal (tests / programmatic stop of `playground` proxy). */
|
|
188
|
+
signal?: AbortSignal;
|
|
189
|
+
/**
|
|
190
|
+
* `run --prod` / `session --prod --message`: hosted v2 session start on
|
|
191
|
+
* the agentsdk control plane. `--dry-run` marks the turn non-mutating;
|
|
192
|
+
* `--as-of` freezes the session clock at a timezone-bearing instant.
|
|
193
|
+
*/
|
|
194
|
+
dryRun?: boolean;
|
|
195
|
+
asOf?: string;
|
|
196
|
+
componentKey?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface ResolvedAgentTarget {
|
|
200
|
+
agentUrl: string;
|
|
201
|
+
headers?: Record<string, string>;
|
|
202
|
+
close?: () => Promise<void>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function shouldStreamProgress(options: AxCliOptions): boolean {
|
|
206
|
+
if (options.stream === false) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
if (options.stream === true) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return process.stderr.isTTY === true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function die(message: string): never {
|
|
216
|
+
process.stderr.write(`${message}\n`);
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function pickAgentUrl(handle: AgentServeHandle, slug?: string): string {
|
|
221
|
+
if (handle.agents.length === 0) {
|
|
222
|
+
die("No agents discovered.");
|
|
223
|
+
}
|
|
224
|
+
if (slug !== undefined && slug !== "") {
|
|
225
|
+
const match = handle.agents.find(a => a.slug === slug);
|
|
226
|
+
if (match === undefined) {
|
|
227
|
+
die(
|
|
228
|
+
`Unknown agent slug "${slug}". Available: ${handle.agents
|
|
229
|
+
.map(a => a.slug || "(root)")
|
|
230
|
+
.join(", ")}`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
return match.url;
|
|
234
|
+
}
|
|
235
|
+
const root = handle.agents.find(a => a.slug === "");
|
|
236
|
+
return (root ?? handle.agents[0]!).url;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
async function startEphemeral(
|
|
240
|
+
options: AxCliOptions,
|
|
241
|
+
): Promise<{ agentUrl: string; close: () => Promise<void> }> {
|
|
242
|
+
const dir = resolve(options.cwd ?? process.cwd(), options.dir);
|
|
243
|
+
const stateRoot = options.stateRoot ?? (await mkdtemp(join(tmpdir(), "agent-serve-ax-")));
|
|
244
|
+
|
|
245
|
+
const handle = await serve(dir, {
|
|
246
|
+
host: "127.0.0.1",
|
|
247
|
+
port: 0,
|
|
248
|
+
stateRoot,
|
|
249
|
+
playground: false,
|
|
250
|
+
schedules: false,
|
|
251
|
+
// Keep host/tool timing off stdout so `run`/`eval` JSON stays clean.
|
|
252
|
+
logger: (line: string) => {
|
|
253
|
+
process.stderr.write(`${line}\n`);
|
|
254
|
+
},
|
|
255
|
+
...(options.bearerToken === undefined ? {} : { authToken: options.bearerToken }),
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
return {
|
|
259
|
+
agentUrl: pickAgentUrl(handle, options.slug),
|
|
260
|
+
close: async () => {
|
|
261
|
+
// engine.close() can hang on open SDK streams; don't block the CLI.
|
|
262
|
+
await Promise.race([
|
|
263
|
+
handle.close(),
|
|
264
|
+
new Promise<void>(resolve => setTimeout(resolve, 2_000)),
|
|
265
|
+
]);
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export async function resolveTarget(options: AxCliOptions): Promise<ResolvedAgentTarget> {
|
|
271
|
+
if (options.prod === true && options.url !== undefined) {
|
|
272
|
+
die("--prod and --url are mutually exclusive");
|
|
273
|
+
}
|
|
274
|
+
if (options.url !== undefined) {
|
|
275
|
+
return { agentUrl: options.url.replace(/\/$/, "") };
|
|
276
|
+
}
|
|
277
|
+
if (options.prod === true) {
|
|
278
|
+
const prod = await resolveProdTarget({
|
|
279
|
+
dir: options.dir,
|
|
280
|
+
cwd: options.cwd,
|
|
281
|
+
slug: options.slug,
|
|
282
|
+
team: options.team,
|
|
283
|
+
apiKey: options.apiKey,
|
|
284
|
+
fetchImpl: options.fetchImpl,
|
|
285
|
+
});
|
|
286
|
+
return { agentUrl: prod.agentUrl, headers: prod.headers };
|
|
287
|
+
}
|
|
288
|
+
return startEphemeral(options);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export async function cmdInit(options: AxCliOptions): Promise<number> {
|
|
292
|
+
const target = options.initTarget;
|
|
293
|
+
if (target === undefined || target === "") {
|
|
294
|
+
printInitGuide();
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
297
|
+
let templateDir: string | undefined;
|
|
298
|
+
let overlayDir: string | undefined;
|
|
299
|
+
let templateName: string | undefined;
|
|
300
|
+
if (options.template !== undefined) {
|
|
301
|
+
const template = resolveTemplate(options.template);
|
|
302
|
+
if (!template.ok) {
|
|
303
|
+
process.stderr.write(`${template.message}\n`);
|
|
304
|
+
return 1;
|
|
305
|
+
}
|
|
306
|
+
templateDir = template.dir;
|
|
307
|
+
overlayDir = template.overlayDir;
|
|
308
|
+
templateName = template.name;
|
|
309
|
+
}
|
|
310
|
+
const cwd = options.cwd ?? process.cwd();
|
|
311
|
+
const dir = resolve(cwd, target);
|
|
312
|
+
const targetCheck = checkInitTarget(dir, options.template);
|
|
313
|
+
if (!targetCheck.ok) {
|
|
314
|
+
process.stderr.write(`${targetCheck.message}\n`);
|
|
315
|
+
return 1;
|
|
316
|
+
}
|
|
317
|
+
let answers: Record<string, string> | undefined;
|
|
318
|
+
let initSpec: TemplateInitSpec | undefined;
|
|
319
|
+
if (templateDir !== undefined) {
|
|
320
|
+
const interview = await runTemplateInit({
|
|
321
|
+
templateDir,
|
|
322
|
+
vars: options.vars,
|
|
323
|
+
interactive:
|
|
324
|
+
options.json !== true && process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
325
|
+
});
|
|
326
|
+
if (!interview.ok) {
|
|
327
|
+
process.stderr.write(`${interview.error}\n`);
|
|
328
|
+
return 1;
|
|
329
|
+
}
|
|
330
|
+
answers = interview.answers;
|
|
331
|
+
initSpec = interview.spec;
|
|
332
|
+
}
|
|
333
|
+
const result = await initProject({
|
|
334
|
+
dir,
|
|
335
|
+
templateDir,
|
|
336
|
+
overlayDir,
|
|
337
|
+
templateName,
|
|
338
|
+
answers,
|
|
339
|
+
initSpec,
|
|
340
|
+
});
|
|
341
|
+
let signedIn = (await resolveApiKey()) !== undefined;
|
|
342
|
+
|
|
343
|
+
// Machine-readable path: install deps (piped), never block on browser login.
|
|
344
|
+
if (options.json) {
|
|
345
|
+
const install = await installScaffoldDependencies(result.rootDir, {
|
|
346
|
+
stdio: "pipe",
|
|
347
|
+
});
|
|
348
|
+
const linked = install.ok
|
|
349
|
+
? await linkCliOntoPath(result.rootDir, { stdio: "pipe" })
|
|
350
|
+
: undefined;
|
|
351
|
+
const cliOnPath = linked?.ok === true;
|
|
352
|
+
process.stdout.write(
|
|
353
|
+
`${JSON.stringify(
|
|
354
|
+
{
|
|
355
|
+
ok: install.ok,
|
|
356
|
+
directory: result.rootDir,
|
|
357
|
+
template: options.template ?? null,
|
|
358
|
+
created: result.created,
|
|
359
|
+
skipped: result.skipped,
|
|
360
|
+
installed: install.ok,
|
|
361
|
+
installError: install.ok
|
|
362
|
+
? null
|
|
363
|
+
: install.stderr.trim() || `npm install exited ${install.exitCode}`,
|
|
364
|
+
cliOnPath,
|
|
365
|
+
cliLinkError:
|
|
366
|
+
install.ok && linked !== undefined && !linked.ok
|
|
367
|
+
? linked.stderr.trim() || `npm install -g exited ${linked.exitCode}`
|
|
368
|
+
: null,
|
|
369
|
+
next: initNextCommands({
|
|
370
|
+
rootDir: result.rootDir,
|
|
371
|
+
cwd,
|
|
372
|
+
signedIn,
|
|
373
|
+
cliOnPath,
|
|
374
|
+
}),
|
|
375
|
+
},
|
|
376
|
+
null,
|
|
377
|
+
2,
|
|
378
|
+
)}\n`,
|
|
379
|
+
);
|
|
380
|
+
return install.ok ? 0 : 1;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
process.stdout.write(
|
|
384
|
+
formatInitScaffoldSummary({
|
|
385
|
+
rootDir: result.rootDir,
|
|
386
|
+
files: result.files,
|
|
387
|
+
}),
|
|
388
|
+
);
|
|
389
|
+
process.stdout.write("Installing npm packages\n\n");
|
|
390
|
+
const install = await installScaffoldDependencies(result.rootDir, {
|
|
391
|
+
stdio: "inherit",
|
|
392
|
+
});
|
|
393
|
+
if (!install.ok) {
|
|
394
|
+
process.stderr.write(
|
|
395
|
+
`\nnpm install failed (exit ${install.exitCode}). Fix the install, then retry init.\n`,
|
|
396
|
+
);
|
|
397
|
+
return install.exitCode || 1;
|
|
398
|
+
}
|
|
399
|
+
process.stdout.write("\n");
|
|
400
|
+
|
|
401
|
+
process.stdout.write(`Installing ${CLI_COMMAND_NAME} on your PATH\n\n`);
|
|
402
|
+
const linked = await linkCliOntoPath(result.rootDir, { stdio: "inherit" });
|
|
403
|
+
const cliOnPath = linked.ok;
|
|
404
|
+
if (!cliOnPath) {
|
|
405
|
+
process.stderr.write(
|
|
406
|
+
`\nCould not put ${CLI_COMMAND_NAME} on PATH (${linked.stderr.trim() || `exit ${linked.exitCode}`}). Next steps use npx ${PACKAGE_NAME} instead.\n\n`,
|
|
407
|
+
);
|
|
408
|
+
} else {
|
|
409
|
+
process.stdout.write("\n");
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Personal Cursor skills so coding agents can pick up create-agent / debug / …
|
|
413
|
+
try {
|
|
414
|
+
await offerInstallCursorSkills();
|
|
415
|
+
} catch (err) {
|
|
416
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
417
|
+
process.stderr.write(`\nCould not install Cursor skills (${message}). Continuing init.\n\n`);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
let loginExit = 0;
|
|
421
|
+
if (!signedIn) {
|
|
422
|
+
// init always offers the browser flow (the --json path above skipped it).
|
|
423
|
+
loginExit = await ensureCursorLogin({ interactive: true });
|
|
424
|
+
signedIn = loginExit === 0 && (await resolveApiKey()) !== undefined;
|
|
425
|
+
process.stdout.write("\n");
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
process.stdout.write(
|
|
429
|
+
formatInitNextSteps({
|
|
430
|
+
rootDir: result.rootDir,
|
|
431
|
+
cwd,
|
|
432
|
+
signedIn,
|
|
433
|
+
cliOnPath,
|
|
434
|
+
}),
|
|
435
|
+
);
|
|
436
|
+
return loginExit;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* `resume [sessionId]` — reattach the interactive chat REPL to an existing
|
|
441
|
+
* session. When the id is omitted, picks the most recently updated
|
|
442
|
+
* followable session from `/v1/sessions` (same as `chat --resume`).
|
|
443
|
+
* Looks up the continuation token via `/v1/sessions` when
|
|
444
|
+
* `--continuation-token` is omitted. Same flags as `chat` (`--prod`,
|
|
445
|
+
* `--message`, `--json`, …). `--session` is accepted as a redundant
|
|
446
|
+
* alias for the positional id.
|
|
447
|
+
*/
|
|
448
|
+
export async function cmdResume(
|
|
449
|
+
sessionId: string | undefined,
|
|
450
|
+
options: AxCliOptions,
|
|
451
|
+
): Promise<number> {
|
|
452
|
+
const resolved = trimNonEmpty(sessionId) ?? trimNonEmpty(options.sessionId);
|
|
453
|
+
if (resolved !== undefined) {
|
|
454
|
+
return cmdChat({
|
|
455
|
+
...options,
|
|
456
|
+
sessionId: resolved,
|
|
457
|
+
resume: false,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
return cmdChat({
|
|
461
|
+
...options,
|
|
462
|
+
sessionId: undefined,
|
|
463
|
+
resume: true,
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function trimNonEmpty(value: string | undefined): string | undefined {
|
|
468
|
+
if (value === undefined) {
|
|
469
|
+
return undefined;
|
|
470
|
+
}
|
|
471
|
+
const trimmed = value.trim();
|
|
472
|
+
return trimmed === "" ? undefined : trimmed;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* `chat` — talk to a running (or `--prod` hosted) agent. With `--json`,
|
|
477
|
+
* prints a trajectory instead of the interactive UI.
|
|
478
|
+
*/
|
|
479
|
+
export async function cmdChat(options: AxCliOptions): Promise<number> {
|
|
480
|
+
const message = options.messages?.[0];
|
|
481
|
+
// chat never starts an ephemeral server — default to local serve URL.
|
|
482
|
+
const target = await resolveTarget({
|
|
483
|
+
...options,
|
|
484
|
+
url: options.prod === true ? undefined : (options.url ?? "http://127.0.0.1:3000"),
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
let sessionId = trimNonEmpty(options.sessionId);
|
|
488
|
+
// `--resume` without an id → most recently updated followable session.
|
|
489
|
+
// An explicit `--session` / positional id always wins.
|
|
490
|
+
if (options.resume === true && sessionId === undefined) {
|
|
491
|
+
try {
|
|
492
|
+
const previous = await resolvePreviousSessionId({
|
|
493
|
+
baseUrl: target.agentUrl,
|
|
494
|
+
auth: {
|
|
495
|
+
bearerToken: options.bearerToken,
|
|
496
|
+
headers: target.headers,
|
|
497
|
+
},
|
|
498
|
+
fetchImpl: options.fetchImpl,
|
|
499
|
+
});
|
|
500
|
+
if (previous === undefined) {
|
|
501
|
+
process.stderr.write(
|
|
502
|
+
"No previous followable session found. Start one with " +
|
|
503
|
+
`\`${CLI_COMMAND_NAME} chat\` or pass a session id.\n`,
|
|
504
|
+
);
|
|
505
|
+
return 1;
|
|
506
|
+
}
|
|
507
|
+
sessionId = previous;
|
|
508
|
+
} catch (error) {
|
|
509
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
510
|
+
return 1;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (options.json) {
|
|
515
|
+
if (message === undefined) {
|
|
516
|
+
process.stderr.write("chat --json requires --message\n");
|
|
517
|
+
return 2;
|
|
518
|
+
}
|
|
519
|
+
let continuationToken = options.continuationToken;
|
|
520
|
+
if (sessionId !== undefined && (continuationToken === undefined || continuationToken === "")) {
|
|
521
|
+
try {
|
|
522
|
+
continuationToken = await lookupSessionContinuation({
|
|
523
|
+
baseUrl: target.agentUrl,
|
|
524
|
+
sessionId,
|
|
525
|
+
auth: {
|
|
526
|
+
bearerToken: options.bearerToken,
|
|
527
|
+
headers: target.headers,
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
} catch (error) {
|
|
531
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
532
|
+
return 1;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
const result = await runSession({
|
|
536
|
+
baseUrl: target.agentUrl,
|
|
537
|
+
messages: [message],
|
|
538
|
+
sessionId,
|
|
539
|
+
continuationToken,
|
|
540
|
+
bearerToken: options.bearerToken,
|
|
541
|
+
headers: target.headers,
|
|
542
|
+
});
|
|
543
|
+
if (options.text) {
|
|
544
|
+
process.stdout.write(formatTrajectoryText(result.trajectory));
|
|
545
|
+
} else {
|
|
546
|
+
console.log(
|
|
547
|
+
JSON.stringify(
|
|
548
|
+
{
|
|
549
|
+
ok: result.ok,
|
|
550
|
+
sessionId: result.sessionId,
|
|
551
|
+
continuationToken: result.continuationToken ?? null,
|
|
552
|
+
trajectory: result.trajectory,
|
|
553
|
+
},
|
|
554
|
+
null,
|
|
555
|
+
2,
|
|
556
|
+
),
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
return result.ok ? 0 : 1;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
try {
|
|
563
|
+
await runChat({
|
|
564
|
+
baseUrl: target.agentUrl,
|
|
565
|
+
message,
|
|
566
|
+
sessionId,
|
|
567
|
+
continuationToken: options.continuationToken,
|
|
568
|
+
bearerToken: options.bearerToken,
|
|
569
|
+
headers: target.headers,
|
|
570
|
+
noColor: options.noColor,
|
|
571
|
+
});
|
|
572
|
+
return 0;
|
|
573
|
+
} catch (error) {
|
|
574
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
575
|
+
return 1;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export async function cmdRun(options: AxCliOptions): Promise<number> {
|
|
580
|
+
// Only a v2-shaped request tries the control plane; every v1 `run --prod`
|
|
581
|
+
// form (multi-turn, continuation token, local session id, --url) keeps its
|
|
582
|
+
// engine-alias path untouched.
|
|
583
|
+
if (options.prod === true && hostedSessionRejection(options) === undefined) {
|
|
584
|
+
const started = await cmdHostedSession(options);
|
|
585
|
+
if (started !== "fallback") {
|
|
586
|
+
return started;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
const messages = options.messages ?? [];
|
|
590
|
+
if (messages.length === 0) {
|
|
591
|
+
die("Provide --message (repeatable) or --messages-file");
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
const stream = shouldStreamProgress(options);
|
|
595
|
+
const progress = stream ? createStreamProgress() : undefined;
|
|
596
|
+
|
|
597
|
+
const target = await resolveTarget(options);
|
|
598
|
+
try {
|
|
599
|
+
if (stream) {
|
|
600
|
+
process.stderr.write(`→ ${target.agentUrl}\n`);
|
|
601
|
+
}
|
|
602
|
+
const result = await runSession({
|
|
603
|
+
baseUrl: target.agentUrl,
|
|
604
|
+
messages,
|
|
605
|
+
sessionId: options.sessionId,
|
|
606
|
+
continuationToken: options.continuationToken,
|
|
607
|
+
bearerToken: options.bearerToken,
|
|
608
|
+
headers: target.headers,
|
|
609
|
+
timeoutMs: options.timeoutMs,
|
|
610
|
+
onEvent: progress === undefined ? undefined : e => progress.onEvent(e),
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
let eventsPath: string | undefined;
|
|
614
|
+
const writeEvents = options.events !== false;
|
|
615
|
+
if (writeEvents) {
|
|
616
|
+
if (typeof options.events === "string") {
|
|
617
|
+
eventsPath = resolve(options.events);
|
|
618
|
+
} else {
|
|
619
|
+
const root = resolve(options.cwd ?? process.cwd(), options.dir);
|
|
620
|
+
const tracesDir = join(root, ".agent-serve", "traces");
|
|
621
|
+
await mkdir(tracesDir, { recursive: true });
|
|
622
|
+
eventsPath = join(tracesDir, `${result.sessionId}.ndjson`);
|
|
623
|
+
}
|
|
624
|
+
await writeFile(
|
|
625
|
+
eventsPath,
|
|
626
|
+
`${result.events.map(e => JSON.stringify(e)).join("\n")}\n`,
|
|
627
|
+
"utf8",
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const playgroundUrl =
|
|
632
|
+
options.prod === true
|
|
633
|
+
? null
|
|
634
|
+
: options.url !== undefined
|
|
635
|
+
? `${target.agentUrl.replace(/\/$/, "")}/playground?sessionId=${encodeURIComponent(result.sessionId)}`
|
|
636
|
+
: null;
|
|
637
|
+
const playgroundHint =
|
|
638
|
+
options.prod === true
|
|
639
|
+
? [
|
|
640
|
+
CLI_COMMAND_NAME,
|
|
641
|
+
"playground",
|
|
642
|
+
"--prod",
|
|
643
|
+
...(options.slug !== undefined && options.slug.trim() !== ""
|
|
644
|
+
? ["--slug", options.slug.trim()]
|
|
645
|
+
: []),
|
|
646
|
+
...(options.team !== undefined && options.team.trim() !== ""
|
|
647
|
+
? ["--team", options.team.trim()]
|
|
648
|
+
: []),
|
|
649
|
+
"--session",
|
|
650
|
+
result.sessionId,
|
|
651
|
+
].join(" ")
|
|
652
|
+
: null;
|
|
653
|
+
|
|
654
|
+
if (options.text) {
|
|
655
|
+
process.stdout.write(formatTrajectoryText(result.trajectory));
|
|
656
|
+
if (eventsPath !== undefined) {
|
|
657
|
+
process.stderr.write(`\ntrace: ${eventsPath}\n`);
|
|
658
|
+
}
|
|
659
|
+
if (playgroundUrl !== null) {
|
|
660
|
+
process.stderr.write(`playground: ${playgroundUrl}\n`);
|
|
661
|
+
} else if (playgroundHint !== null) {
|
|
662
|
+
process.stderr.write(`playground: ${playgroundHint}\n`);
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
console.log(
|
|
666
|
+
JSON.stringify(
|
|
667
|
+
{
|
|
668
|
+
ok: result.ok,
|
|
669
|
+
sessionId: result.sessionId,
|
|
670
|
+
continuationToken: result.continuationToken ?? null,
|
|
671
|
+
trace: eventsPath ?? null,
|
|
672
|
+
playgroundUrl,
|
|
673
|
+
playgroundHint,
|
|
674
|
+
visualize:
|
|
675
|
+
playgroundHint !== null
|
|
676
|
+
? `Run ${playgroundHint}`
|
|
677
|
+
: playgroundUrl !== null
|
|
678
|
+
? `Open ${playgroundUrl}`
|
|
679
|
+
: eventsPath !== undefined
|
|
680
|
+
? `${CLI_COMMAND_NAME} trajectory --events ${eventsPath}`
|
|
681
|
+
: null,
|
|
682
|
+
trajectory: result.trajectory,
|
|
683
|
+
},
|
|
684
|
+
null,
|
|
685
|
+
2,
|
|
686
|
+
),
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
return result.ok ? 0 : 1;
|
|
690
|
+
} finally {
|
|
691
|
+
progress?.close();
|
|
692
|
+
if (target.close !== undefined) {
|
|
693
|
+
await target.close();
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const HOSTED_SESSION_ID_RE = /^ses_[a-f0-9]{24}$/;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Hosted v2 session start: POST the agentsdk control plane, which hands the
|
|
702
|
+
* wake to Temporal (no resident engine, no `/engine/*` alias). `--session
|
|
703
|
+
* ses_…` resumes that exact session; there is no continuation token on
|
|
704
|
+
* this path. A 404 means the slug is not a v2 control-plane deployment, so
|
|
705
|
+
* `run --prod` falls back to the v1 engine alias.
|
|
706
|
+
*/
|
|
707
|
+
/** Why these options cannot be a hosted v2 session start, if they cannot. */
|
|
708
|
+
function hostedSessionRejection(options: AxCliOptions): string | undefined {
|
|
709
|
+
if (options.url !== undefined) {
|
|
710
|
+
return "--prod session start talks to the agentsdk control plane; do not pass --url";
|
|
711
|
+
}
|
|
712
|
+
const messages = options.messages ?? [];
|
|
713
|
+
if (messages.length !== 1 || messages[0]?.trim() === "") {
|
|
714
|
+
return "Provide exactly one --message (the wake). Multi-turn runs are local-only.";
|
|
715
|
+
}
|
|
716
|
+
if (trimNonEmpty(options.continuationToken) !== undefined) {
|
|
717
|
+
return "--continuation-token is not a hosted v2 identity; pass --session ses_… to resume a session";
|
|
718
|
+
}
|
|
719
|
+
const sessionId = trimNonEmpty(options.sessionId);
|
|
720
|
+
if (sessionId !== undefined && !HOSTED_SESSION_ID_RE.test(sessionId)) {
|
|
721
|
+
return `--session must be a hosted session id (ses_…), got ${sessionId}`;
|
|
722
|
+
}
|
|
723
|
+
return undefined;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
async function cmdHostedSession(options: AxCliOptions): Promise<number | "fallback"> {
|
|
727
|
+
const rejection = hostedSessionRejection(options);
|
|
728
|
+
if (rejection !== undefined) {
|
|
729
|
+
die(rejection);
|
|
730
|
+
}
|
|
731
|
+
const messages = options.messages ?? [];
|
|
732
|
+
const sessionId = trimNonEmpty(options.sessionId);
|
|
733
|
+
const auth = await resolveDeployAuth({
|
|
734
|
+
team: options.team,
|
|
735
|
+
apiKey: options.apiKey,
|
|
736
|
+
fetchImpl: options.fetchImpl,
|
|
737
|
+
});
|
|
738
|
+
if (typeof auth === "number") {
|
|
739
|
+
return auth;
|
|
740
|
+
}
|
|
741
|
+
const slug = resolveProdSlug(options);
|
|
742
|
+
try {
|
|
743
|
+
const accepted = await auth.client.startSession({
|
|
744
|
+
teamId: auth.teamId,
|
|
745
|
+
slug,
|
|
746
|
+
message: messages[0]!.trim(),
|
|
747
|
+
sessionId,
|
|
748
|
+
dryRun: options.dryRun,
|
|
749
|
+
asOf: options.asOf,
|
|
750
|
+
componentKey: trimNonEmpty(options.componentKey),
|
|
751
|
+
});
|
|
752
|
+
console.log(JSON.stringify(accepted, null, 2));
|
|
753
|
+
return 0;
|
|
754
|
+
} catch (error) {
|
|
755
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
756
|
+
return "fallback";
|
|
757
|
+
}
|
|
758
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
759
|
+
return 1;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Shared deterministic-route fetch (`call`, `skill`): engine headers,
|
|
765
|
+
* bearer auth, and JSON. The payload is `undefined` when the body does
|
|
766
|
+
* not decode; callers print `invalid_response` and fail.
|
|
767
|
+
*/
|
|
768
|
+
async function fetchAgentJson(
|
|
769
|
+
target: ResolvedAgentTarget,
|
|
770
|
+
path: string,
|
|
771
|
+
args: { method?: string; body?: string; bearerToken?: string } = {},
|
|
772
|
+
): Promise<{ response: Response; payload: unknown }> {
|
|
773
|
+
const headers: Record<string, string> = {};
|
|
774
|
+
if (target.headers !== undefined) {
|
|
775
|
+
Object.assign(headers, target.headers);
|
|
776
|
+
}
|
|
777
|
+
if (args.body !== undefined) {
|
|
778
|
+
headers["content-type"] = "application/json";
|
|
779
|
+
}
|
|
780
|
+
if (args.bearerToken !== undefined) {
|
|
781
|
+
headers.authorization = `Bearer ${args.bearerToken}`;
|
|
782
|
+
}
|
|
783
|
+
const response = await fetch(`${target.agentUrl}${path}`, {
|
|
784
|
+
method: args.method,
|
|
785
|
+
headers,
|
|
786
|
+
body: args.body,
|
|
787
|
+
});
|
|
788
|
+
const payload: unknown = await response.json().catch(() => undefined);
|
|
789
|
+
return { response, payload };
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function printInvalidResponse(): void {
|
|
793
|
+
console.log(JSON.stringify({ ok: false, error: "invalid_response" }, null, 2));
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* `agent-sdk call <tool>` — deterministic tool invocation over
|
|
798
|
+
* `POST /v1/tools/:toolName` (ephemeral local server unless --url).
|
|
799
|
+
*/
|
|
800
|
+
export async function cmdCall(options: AxCliOptions): Promise<number> {
|
|
801
|
+
const toolName = options.toolName;
|
|
802
|
+
if (toolName === undefined || toolName === "") {
|
|
803
|
+
die(`Provide a tool name: ${CLI_COMMAND_NAME} call <tool> [--input '{...}']`);
|
|
804
|
+
}
|
|
805
|
+
let input: unknown = {};
|
|
806
|
+
if (options.toolInput !== undefined) {
|
|
807
|
+
try {
|
|
808
|
+
input = JSON.parse(options.toolInput);
|
|
809
|
+
} catch (error) {
|
|
810
|
+
die(`--input must be valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
const target = await resolveTarget(options);
|
|
815
|
+
try {
|
|
816
|
+
const body: { input: unknown; sessionId?: string } = { input };
|
|
817
|
+
if (options.sessionId !== undefined) {
|
|
818
|
+
body.sessionId = options.sessionId;
|
|
819
|
+
}
|
|
820
|
+
const { response, payload } = await fetchAgentJson(
|
|
821
|
+
target,
|
|
822
|
+
`/v1/tools/${encodeURIComponent(toolName)}`,
|
|
823
|
+
{
|
|
824
|
+
method: "POST",
|
|
825
|
+
body: JSON.stringify(body),
|
|
826
|
+
bearerToken: options.bearerToken,
|
|
827
|
+
},
|
|
828
|
+
);
|
|
829
|
+
if (payload === undefined) {
|
|
830
|
+
printInvalidResponse();
|
|
831
|
+
return 1;
|
|
832
|
+
}
|
|
833
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
834
|
+
const ok =
|
|
835
|
+
response.ok &&
|
|
836
|
+
typeof payload === "object" &&
|
|
837
|
+
payload !== null &&
|
|
838
|
+
(payload as { ok?: unknown }).ok === true;
|
|
839
|
+
return ok ? 0 : 1;
|
|
840
|
+
} finally {
|
|
841
|
+
if (target.close !== undefined) {
|
|
842
|
+
await target.close();
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* `agent-sdk skill <name>` — deterministic skill read over
|
|
849
|
+
* `GET /v1/skills/:skillName` (ephemeral local server unless --url).
|
|
850
|
+
* `--text` prints the rendered SKILL.md instead of JSON.
|
|
851
|
+
*/
|
|
852
|
+
export async function cmdSkill(
|
|
853
|
+
skillName: string | undefined,
|
|
854
|
+
options: AxCliOptions,
|
|
855
|
+
): Promise<number> {
|
|
856
|
+
if (skillName === undefined || skillName === "") {
|
|
857
|
+
process.stderr.write(
|
|
858
|
+
`Usage: ${CLI_COMMAND_NAME} skill <name> [--dir <path> | --url <baseUrl> | --prod]\n`,
|
|
859
|
+
);
|
|
860
|
+
return 2;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
const target = await resolveTarget(options);
|
|
864
|
+
try {
|
|
865
|
+
const { response, payload } = await fetchAgentJson(
|
|
866
|
+
target,
|
|
867
|
+
`/v1/skills/${encodeURIComponent(skillName)}`,
|
|
868
|
+
{ bearerToken: options.bearerToken },
|
|
869
|
+
);
|
|
870
|
+
if (payload === undefined) {
|
|
871
|
+
printInvalidResponse();
|
|
872
|
+
return 1;
|
|
873
|
+
}
|
|
874
|
+
if (options.text === true && response.ok) {
|
|
875
|
+
const skillMd = (payload as { skillMd?: unknown }).skillMd;
|
|
876
|
+
if (typeof skillMd !== "string") {
|
|
877
|
+
printInvalidResponse();
|
|
878
|
+
return 1;
|
|
879
|
+
}
|
|
880
|
+
process.stdout.write(skillMd.endsWith("\n") ? skillMd : `${skillMd}\n`);
|
|
881
|
+
return 0;
|
|
882
|
+
}
|
|
883
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
884
|
+
return response.ok ? 0 : 1;
|
|
885
|
+
} finally {
|
|
886
|
+
if (target.close !== undefined) {
|
|
887
|
+
await target.close();
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export async function cmdTrajectory(options: AxCliOptions): Promise<number> {
|
|
893
|
+
if (typeof options.events !== "string") {
|
|
894
|
+
die(
|
|
895
|
+
`trajectory requires --events <file.ndjson> (write one with: ${CLI_COMMAND_NAME} run --events …)`,
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
const trajectory = await loadTrajectoryFromEventsFile(resolve(options.events));
|
|
899
|
+
if (options.text) {
|
|
900
|
+
process.stdout.write(formatTrajectoryText(trajectory));
|
|
901
|
+
} else {
|
|
902
|
+
console.log(JSON.stringify(trajectory, null, 2));
|
|
903
|
+
}
|
|
904
|
+
return trajectory.ok ? 0 : 1;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Which surface `eval` should target. Local (ephemeral) is the default;
|
|
909
|
+
* `--prod` uses the hosted deployment, `--url` a running server.
|
|
910
|
+
* Exported for tests.
|
|
911
|
+
*/
|
|
912
|
+
export function resolveEvalTargetMode(
|
|
913
|
+
options: Pick<AxCliOptions, "prod" | "url">,
|
|
914
|
+
): "local" | "url" | "deployment" | { error: string } {
|
|
915
|
+
const flags = [
|
|
916
|
+
options.prod === true ? "--prod" : undefined,
|
|
917
|
+
options.url !== undefined ? "--url" : undefined,
|
|
918
|
+
].filter(flag => flag !== undefined);
|
|
919
|
+
if (flags.length > 1) {
|
|
920
|
+
return { error: `${flags.join(" and ")} are mutually exclusive` };
|
|
921
|
+
}
|
|
922
|
+
if (options.url !== undefined) {
|
|
923
|
+
return "url";
|
|
924
|
+
}
|
|
925
|
+
if (options.prod === true) {
|
|
926
|
+
return "deployment";
|
|
927
|
+
}
|
|
928
|
+
return "local";
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/** Resolve the eval target; prints a CLI-ready error and returns an exit code on failure. */
|
|
932
|
+
async function resolveEvalTarget(options: AxCliOptions): Promise<ResolvedAgentTarget | number> {
|
|
933
|
+
const mode = resolveEvalTargetMode(options);
|
|
934
|
+
if (typeof mode === "object") {
|
|
935
|
+
process.stderr.write(`${mode.error}\n`);
|
|
936
|
+
return 2;
|
|
937
|
+
}
|
|
938
|
+
if (mode === "url") {
|
|
939
|
+
return { agentUrl: options.url!.replace(/\/$/, "") };
|
|
940
|
+
}
|
|
941
|
+
if (mode === "local") {
|
|
942
|
+
return startEphemeral(options);
|
|
943
|
+
}
|
|
944
|
+
try {
|
|
945
|
+
const prod = await resolveProdTarget({
|
|
946
|
+
dir: options.dir,
|
|
947
|
+
cwd: options.cwd,
|
|
948
|
+
slug: options.slug,
|
|
949
|
+
team: options.team,
|
|
950
|
+
apiKey: options.apiKey,
|
|
951
|
+
fetchImpl: options.fetchImpl,
|
|
952
|
+
});
|
|
953
|
+
return { agentUrl: prod.agentUrl, headers: prod.headers };
|
|
954
|
+
} catch (error) {
|
|
955
|
+
if (error instanceof ProdTargetError && error.notFound) {
|
|
956
|
+
// Keep the API error text: a 404 can also mean a wrong API host or a
|
|
957
|
+
// disabled feature gate, and the message distinguishes those from a
|
|
958
|
+
// genuinely missing deployment.
|
|
959
|
+
process.stderr.write(
|
|
960
|
+
`${sanitizeCustomerError(error.message)}\n` +
|
|
961
|
+
` deploy it first: ${CLI_COMMAND_NAME} deploy --slug ${error.slug}\n` +
|
|
962
|
+
` or omit --prod: ${CLI_COMMAND_NAME} eval --dir ${options.dir}\n`,
|
|
963
|
+
);
|
|
964
|
+
return 1;
|
|
965
|
+
}
|
|
966
|
+
process.stderr.write(
|
|
967
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n` +
|
|
968
|
+
`Pass --prod for the hosted deployment, or omit it to run on an ephemeral local server.\n`,
|
|
969
|
+
);
|
|
970
|
+
return 1;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export async function cmdEval(options: AxCliOptions): Promise<number> {
|
|
975
|
+
const projectRoot = resolve(options.cwd ?? process.cwd(), options.dir);
|
|
976
|
+
const mode = resolveEvalTargetMode(options);
|
|
977
|
+
if (typeof mode === "object") {
|
|
978
|
+
process.stderr.write(`${mode.error}\n`);
|
|
979
|
+
return 2;
|
|
980
|
+
}
|
|
981
|
+
if (options.noWait === true) {
|
|
982
|
+
if (options.list === true) {
|
|
983
|
+
process.stderr.write("--no-wait and --list are mutually exclusive\n");
|
|
984
|
+
return 2;
|
|
985
|
+
}
|
|
986
|
+
if (mode === "local") {
|
|
987
|
+
process.stderr.write("--no-wait requires --prod or --url (not the default local target)\n");
|
|
988
|
+
return 2;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
if (trimNonEmpty(options.out) !== undefined) {
|
|
992
|
+
if (options.list === true) {
|
|
993
|
+
process.stderr.write("--out and --list are mutually exclusive\n");
|
|
994
|
+
return 2;
|
|
995
|
+
}
|
|
996
|
+
if (options.noWait === true) {
|
|
997
|
+
process.stderr.write(
|
|
998
|
+
`--out needs the finished results; drop --no-wait, or poll later with ${CLI_COMMAND_NAME} eval status <evalId> --out <path>\n`,
|
|
999
|
+
);
|
|
1000
|
+
return 2;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const filterIds =
|
|
1005
|
+
options.evalIds === undefined || options.evalIds.length === 0 ? undefined : options.evalIds;
|
|
1006
|
+
const tags = options.tags === undefined || options.tags.length === 0 ? undefined : options.tags;
|
|
1007
|
+
|
|
1008
|
+
if (options.list) {
|
|
1009
|
+
// List the same surface a run will execute: local filesystem by default,
|
|
1010
|
+
// GET /v1/dev/evals on --prod / --url.
|
|
1011
|
+
if (mode === "local") {
|
|
1012
|
+
return listLocalEvals(projectRoot, options, filterIds, tags);
|
|
1013
|
+
}
|
|
1014
|
+
const target = await resolveEvalTarget(options);
|
|
1015
|
+
if (typeof target === "number") {
|
|
1016
|
+
return target;
|
|
1017
|
+
}
|
|
1018
|
+
try {
|
|
1019
|
+
const listed = await listRemoteEvals({
|
|
1020
|
+
baseUrl: target.agentUrl,
|
|
1021
|
+
auth: {
|
|
1022
|
+
bearerToken: options.bearerToken,
|
|
1023
|
+
headers: target.headers,
|
|
1024
|
+
},
|
|
1025
|
+
fetchImpl: options.fetchImpl,
|
|
1026
|
+
filterIds,
|
|
1027
|
+
tags,
|
|
1028
|
+
});
|
|
1029
|
+
return printListedEvals(
|
|
1030
|
+
listed.map(e => ({
|
|
1031
|
+
id: e.id,
|
|
1032
|
+
fileId: e.fileId,
|
|
1033
|
+
description: e.description,
|
|
1034
|
+
tags: e.tags ?? [],
|
|
1035
|
+
})),
|
|
1036
|
+
options,
|
|
1037
|
+
`No evals on ${target.agentUrl}`,
|
|
1038
|
+
);
|
|
1039
|
+
} catch (error) {
|
|
1040
|
+
process.stderr.write(
|
|
1041
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1042
|
+
);
|
|
1043
|
+
return 1;
|
|
1044
|
+
} finally {
|
|
1045
|
+
if (target.close !== undefined) {
|
|
1046
|
+
await target.close();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
const target = await resolveEvalTarget(options);
|
|
1052
|
+
if (typeof target === "number") {
|
|
1053
|
+
return target;
|
|
1054
|
+
}
|
|
1055
|
+
const stream = shouldStreamProgress(options);
|
|
1056
|
+
|
|
1057
|
+
try {
|
|
1058
|
+
if (options.verbose || stream) {
|
|
1059
|
+
process.stderr.write(`eval target: ${target.agentUrl}\n`);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
// Default local: ephemeral in-process harness against local eval sources.
|
|
1063
|
+
// --prod / --url: run on the serve process via /v1/dev/evals/runs so the
|
|
1064
|
+
// batch lands in playground history and defineStorage evals (when set).
|
|
1065
|
+
if (mode === "local") {
|
|
1066
|
+
const progress = stream ? createStreamProgress() : undefined;
|
|
1067
|
+
const artifactsDir = resolveEvalArtifactsDir(projectRoot, options);
|
|
1068
|
+
try {
|
|
1069
|
+
const results = await runDiscoveredEvals({
|
|
1070
|
+
projectRoot,
|
|
1071
|
+
baseUrl: target.agentUrl,
|
|
1072
|
+
filterIds,
|
|
1073
|
+
tags,
|
|
1074
|
+
timeoutMs: options.timeoutMs,
|
|
1075
|
+
maxConcurrency: options.maxConcurrency,
|
|
1076
|
+
strict: options.strict === true,
|
|
1077
|
+
skipReport: options.skipReport === true,
|
|
1078
|
+
reporters: buildCliEvalReporters(options, artifactsDir),
|
|
1079
|
+
target: { baseUrl: target.agentUrl, mode: "local" },
|
|
1080
|
+
bearerToken: options.bearerToken,
|
|
1081
|
+
headers: target.headers,
|
|
1082
|
+
verbose: Boolean(options.verbose) || stream,
|
|
1083
|
+
onEvent: progress === undefined ? undefined : e => progress.onEvent(e),
|
|
1084
|
+
});
|
|
1085
|
+
if (results.length === 0) {
|
|
1086
|
+
process.stderr.write("No matching evals found.\n");
|
|
1087
|
+
return 2;
|
|
1088
|
+
}
|
|
1089
|
+
return await printEvalResults(results, options, undefined, artifactsDir);
|
|
1090
|
+
} finally {
|
|
1091
|
+
progress?.close();
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
try {
|
|
1096
|
+
if (options.noWait === true) {
|
|
1097
|
+
const started = await startRemoteEvalRun({
|
|
1098
|
+
baseUrl: target.agentUrl,
|
|
1099
|
+
filterIds,
|
|
1100
|
+
tags,
|
|
1101
|
+
timeoutMs: options.timeoutMs,
|
|
1102
|
+
verbose: Boolean(options.verbose),
|
|
1103
|
+
auth: {
|
|
1104
|
+
bearerToken: options.bearerToken,
|
|
1105
|
+
headers: target.headers,
|
|
1106
|
+
},
|
|
1107
|
+
fetchImpl: options.fetchImpl,
|
|
1108
|
+
});
|
|
1109
|
+
return await printEvalAccepted(started, options, target.agentUrl);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
const progress = createRemoteEvalProgress(options.verbose === true || stream);
|
|
1113
|
+
// Start first so we can print the Eval ID before the (often long) wait.
|
|
1114
|
+
const started = await startRemoteEvalRun({
|
|
1115
|
+
baseUrl: target.agentUrl,
|
|
1116
|
+
filterIds,
|
|
1117
|
+
tags,
|
|
1118
|
+
timeoutMs: options.timeoutMs,
|
|
1119
|
+
verbose: Boolean(options.verbose) || stream,
|
|
1120
|
+
auth: {
|
|
1121
|
+
bearerToken: options.bearerToken,
|
|
1122
|
+
headers: target.headers,
|
|
1123
|
+
},
|
|
1124
|
+
fetchImpl: options.fetchImpl,
|
|
1125
|
+
});
|
|
1126
|
+
await printEvalIdBanner(started, options, target.agentUrl);
|
|
1127
|
+
progress?.onSnapshot?.(started);
|
|
1128
|
+
const snapshot = await pollRemoteEvalRun({
|
|
1129
|
+
baseUrl: target.agentUrl,
|
|
1130
|
+
runId: started.runId,
|
|
1131
|
+
auth: {
|
|
1132
|
+
bearerToken: options.bearerToken,
|
|
1133
|
+
headers: target.headers,
|
|
1134
|
+
},
|
|
1135
|
+
fetchImpl: options.fetchImpl,
|
|
1136
|
+
onSnapshot: progress === undefined ? undefined : progress.onSnapshot,
|
|
1137
|
+
});
|
|
1138
|
+
const results = snapshotToEvalRunResults(snapshot);
|
|
1139
|
+
if (results.length === 0 && snapshot.status !== "failed") {
|
|
1140
|
+
process.stderr.write("No matching evals found.\n");
|
|
1141
|
+
return 2;
|
|
1142
|
+
}
|
|
1143
|
+
return await printEvalResults(results, options, {
|
|
1144
|
+
runId: snapshot.runId,
|
|
1145
|
+
status: snapshot.status,
|
|
1146
|
+
error: snapshot.error,
|
|
1147
|
+
});
|
|
1148
|
+
} catch (error) {
|
|
1149
|
+
if (error instanceof RemoteEvalError && error.code === "no_matching_evals") {
|
|
1150
|
+
process.stderr.write(`${error.message}\n`);
|
|
1151
|
+
return 2;
|
|
1152
|
+
}
|
|
1153
|
+
process.stderr.write(
|
|
1154
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1155
|
+
);
|
|
1156
|
+
return 1;
|
|
1157
|
+
}
|
|
1158
|
+
} finally {
|
|
1159
|
+
if (target.close !== undefined) {
|
|
1160
|
+
await target.close();
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Flags to re-target the same surface from an `eval --no-wait` hint.
|
|
1167
|
+
* Exported for tests.
|
|
1168
|
+
*/
|
|
1169
|
+
export function formatEvalStatusFlags(
|
|
1170
|
+
options: Pick<AxCliOptions, "prod" | "url" | "slug" | "team">,
|
|
1171
|
+
): string {
|
|
1172
|
+
const parts: string[] = [];
|
|
1173
|
+
if (options.url !== undefined) {
|
|
1174
|
+
parts.push(`--url ${options.url.replace(/\/$/, "")}`);
|
|
1175
|
+
} else {
|
|
1176
|
+
parts.push("--prod");
|
|
1177
|
+
if (options.slug !== undefined && options.slug !== "") {
|
|
1178
|
+
parts.push(`--slug ${options.slug}`);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (options.team !== undefined && options.team !== "") {
|
|
1182
|
+
parts.push(`--team ${options.team}`);
|
|
1183
|
+
}
|
|
1184
|
+
return parts.length === 0 ? "" : ` ${parts.join(" ")}`;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/** Print Eval ID + cancel/status hints after a remote batch is accepted. */
|
|
1188
|
+
async function printEvalIdBanner(
|
|
1189
|
+
started: EvalRunSnapshot,
|
|
1190
|
+
options: AxCliOptions,
|
|
1191
|
+
agentUrl: string,
|
|
1192
|
+
): Promise<void> {
|
|
1193
|
+
const pollPath = `${agentUrl.replace(/\/$/, "")}/v1/dev/evals/runs/${started.runId}`;
|
|
1194
|
+
const statusFlags = formatEvalStatusFlags(options);
|
|
1195
|
+
const playgroundUrl = await resolveEvalPlaygroundDeepLink(options, started.runId, agentUrl);
|
|
1196
|
+
if (options.json) {
|
|
1197
|
+
// Waiters still want the id on stderr so progress text stays readable.
|
|
1198
|
+
process.stderr.write(
|
|
1199
|
+
`${JSON.stringify({
|
|
1200
|
+
evalId: started.runId,
|
|
1201
|
+
runId: started.runId,
|
|
1202
|
+
status: started.status,
|
|
1203
|
+
summary: started.summary,
|
|
1204
|
+
pollUrl: pollPath,
|
|
1205
|
+
...(playgroundUrl === undefined ? {} : { playgroundUrl }),
|
|
1206
|
+
})}\n`,
|
|
1207
|
+
);
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
const durable = started.config.durableRuns === true ? " (persisted)" : "";
|
|
1211
|
+
process.stderr.write(`Eval ID: ${started.runId}${durable} — ${started.summary.total} case(s)\n`);
|
|
1212
|
+
process.stderr.write(`Cancel: ${CLI_COMMAND_NAME} eval cancel ${started.runId}${statusFlags}\n`);
|
|
1213
|
+
process.stderr.write(`Status: ${CLI_COMMAND_NAME} eval status ${started.runId}${statusFlags}\n`);
|
|
1214
|
+
if (playgroundUrl !== undefined) {
|
|
1215
|
+
process.stderr.write(`Playground: ${playgroundUrl}\n`);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/** `--no-wait`: print the accepted batch id (and how to poll) then exit. */
|
|
1220
|
+
async function printEvalAccepted(
|
|
1221
|
+
started: EvalRunSnapshot,
|
|
1222
|
+
options: AxCliOptions,
|
|
1223
|
+
agentUrl: string,
|
|
1224
|
+
): Promise<number> {
|
|
1225
|
+
const pollPath = `${agentUrl.replace(/\/$/, "")}/v1/dev/evals/runs/${started.runId}`;
|
|
1226
|
+
const statusFlags = formatEvalStatusFlags(options);
|
|
1227
|
+
const playgroundUrl = await resolveEvalPlaygroundDeepLink(options, started.runId, agentUrl);
|
|
1228
|
+
if (options.json) {
|
|
1229
|
+
process.stdout.write(
|
|
1230
|
+
`${JSON.stringify(
|
|
1231
|
+
{
|
|
1232
|
+
ok: true,
|
|
1233
|
+
accepted: true,
|
|
1234
|
+
evalId: started.runId,
|
|
1235
|
+
runId: started.runId,
|
|
1236
|
+
status: started.status,
|
|
1237
|
+
summary: started.summary,
|
|
1238
|
+
pollUrl: pollPath,
|
|
1239
|
+
durableRuns: started.config.durableRuns === true,
|
|
1240
|
+
...(playgroundUrl === undefined ? {} : { playgroundUrl }),
|
|
1241
|
+
},
|
|
1242
|
+
null,
|
|
1243
|
+
2,
|
|
1244
|
+
)}\n`,
|
|
1245
|
+
);
|
|
1246
|
+
} else {
|
|
1247
|
+
const durable = started.config.durableRuns === true ? " (persisted)" : "";
|
|
1248
|
+
process.stdout.write(
|
|
1249
|
+
`Eval ID: ${started.runId}${durable} — ${started.summary.total} case(s)\n`,
|
|
1250
|
+
);
|
|
1251
|
+
process.stdout.write(
|
|
1252
|
+
`Cancel: ${CLI_COMMAND_NAME} eval cancel ${started.runId}${statusFlags}\n`,
|
|
1253
|
+
);
|
|
1254
|
+
process.stdout.write(
|
|
1255
|
+
`Status: ${CLI_COMMAND_NAME} eval status ${started.runId}${statusFlags}\n`,
|
|
1256
|
+
);
|
|
1257
|
+
if (playgroundUrl !== undefined) {
|
|
1258
|
+
process.stdout.write(`Playground: ${playgroundUrl}\n`);
|
|
1259
|
+
}
|
|
1260
|
+
process.stdout.write(`Poll: ${pollPath}\n`);
|
|
1261
|
+
}
|
|
1262
|
+
return 0;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Hosted alias playground URL with `view=evals` + `evalRunId` so the SPA
|
|
1267
|
+
* opens the batch that CLI / Slack started (not a stale sessionStorage id).
|
|
1268
|
+
*/
|
|
1269
|
+
async function resolveEvalPlaygroundDeepLink(
|
|
1270
|
+
options: AxCliOptions,
|
|
1271
|
+
runId: string,
|
|
1272
|
+
agentUrl: string,
|
|
1273
|
+
): Promise<string | undefined> {
|
|
1274
|
+
if (options.prod !== true) {
|
|
1275
|
+
const base = `${agentUrl.replace(/\/$/, "")}/playground`;
|
|
1276
|
+
try {
|
|
1277
|
+
const url = new URL(base);
|
|
1278
|
+
url.searchParams.set("view", "evals");
|
|
1279
|
+
url.searchParams.set("evalRunId", runId);
|
|
1280
|
+
return url.toString();
|
|
1281
|
+
} catch {
|
|
1282
|
+
return undefined;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
try {
|
|
1286
|
+
const resolved = await resolveProdAliasPlaygroundUrl({
|
|
1287
|
+
dir: options.dir,
|
|
1288
|
+
cwd: options.cwd,
|
|
1289
|
+
slug: options.slug,
|
|
1290
|
+
team: options.team,
|
|
1291
|
+
apiKey: options.apiKey,
|
|
1292
|
+
fetchImpl: options.fetchImpl,
|
|
1293
|
+
// Avoid a second "Using hosted deployment" line; banner already has context.
|
|
1294
|
+
err: () => {},
|
|
1295
|
+
});
|
|
1296
|
+
const url = new URL(resolved.playgroundUrl);
|
|
1297
|
+
url.searchParams.set("view", "evals");
|
|
1298
|
+
url.searchParams.set("evalRunId", runId);
|
|
1299
|
+
return url.toString();
|
|
1300
|
+
} catch {
|
|
1301
|
+
return undefined;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* `eval cancel <runId>` — cancel a running remote batch by Eval ID.
|
|
1307
|
+
*/
|
|
1308
|
+
export async function cmdEvalCancel(
|
|
1309
|
+
runId: string | undefined,
|
|
1310
|
+
options: AxCliOptions,
|
|
1311
|
+
): Promise<number> {
|
|
1312
|
+
const mode = resolveEvalTargetMode(options);
|
|
1313
|
+
if (typeof mode === "object") {
|
|
1314
|
+
process.stderr.write(`${mode.error}\n`);
|
|
1315
|
+
return 2;
|
|
1316
|
+
}
|
|
1317
|
+
if (mode === "local") {
|
|
1318
|
+
process.stderr.write("eval cancel requires --prod or --url (not the default local target)\n");
|
|
1319
|
+
return 2;
|
|
1320
|
+
}
|
|
1321
|
+
if (runId === undefined || runId === "") {
|
|
1322
|
+
process.stderr.write("usage: eval cancel <evalId> --prod|--url …\n");
|
|
1323
|
+
return 2;
|
|
1324
|
+
}
|
|
1325
|
+
if (options.list === true || options.noWait === true) {
|
|
1326
|
+
process.stderr.write("eval cancel does not accept --list or --no-wait\n");
|
|
1327
|
+
return 2;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
const target = await resolveEvalTarget(options);
|
|
1331
|
+
if (typeof target === "number") {
|
|
1332
|
+
return target;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
try {
|
|
1336
|
+
const snap = await cancelRemoteEvalRun({
|
|
1337
|
+
baseUrl: target.agentUrl,
|
|
1338
|
+
runId,
|
|
1339
|
+
auth: {
|
|
1340
|
+
bearerToken: options.bearerToken,
|
|
1341
|
+
headers: target.headers,
|
|
1342
|
+
},
|
|
1343
|
+
fetchImpl: options.fetchImpl,
|
|
1344
|
+
});
|
|
1345
|
+
if (options.json) {
|
|
1346
|
+
process.stdout.write(`${JSON.stringify(snap, null, 2)}\n`);
|
|
1347
|
+
} else {
|
|
1348
|
+
process.stdout.write(
|
|
1349
|
+
`Cancelled Eval ID ${snap.runId} (${snap.summary.done}/${snap.summary.total} cases finalized)\n`,
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
return 0;
|
|
1353
|
+
} catch (error) {
|
|
1354
|
+
process.stderr.write(
|
|
1355
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1356
|
+
);
|
|
1357
|
+
return 1;
|
|
1358
|
+
} finally {
|
|
1359
|
+
if (target.close !== undefined) {
|
|
1360
|
+
await target.close();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* `eval status [runId]` — fetch one batch (or list recent) on the deployment /
|
|
1367
|
+
* `--url` target. Exit `0` when the batch is completed with all cases passing,
|
|
1368
|
+
* `1` when failed / any case failed / unknown, `2` for usage errors, `3` when
|
|
1369
|
+
* the batch is still running (for poll loops after `--no-wait`).
|
|
1370
|
+
*/
|
|
1371
|
+
export async function cmdEvalStatus(
|
|
1372
|
+
runId: string | undefined,
|
|
1373
|
+
options: AxCliOptions,
|
|
1374
|
+
): Promise<number> {
|
|
1375
|
+
const mode = resolveEvalTargetMode(options);
|
|
1376
|
+
if (typeof mode === "object") {
|
|
1377
|
+
process.stderr.write(`${mode.error}\n`);
|
|
1378
|
+
return 2;
|
|
1379
|
+
}
|
|
1380
|
+
if (mode === "local") {
|
|
1381
|
+
process.stderr.write("eval status requires --prod or --url (not the default local target)\n");
|
|
1382
|
+
return 2;
|
|
1383
|
+
}
|
|
1384
|
+
if (options.list === true || options.noWait === true) {
|
|
1385
|
+
process.stderr.write("eval status does not accept --list or --no-wait\n");
|
|
1386
|
+
return 2;
|
|
1387
|
+
}
|
|
1388
|
+
if (trimNonEmpty(options.out) !== undefined && (runId === undefined || runId === "")) {
|
|
1389
|
+
process.stderr.write("eval status --out requires an eval id\n");
|
|
1390
|
+
return 2;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
const target = await resolveEvalTarget(options);
|
|
1394
|
+
if (typeof target === "number") {
|
|
1395
|
+
return target;
|
|
1396
|
+
}
|
|
1397
|
+
const auth = {
|
|
1398
|
+
bearerToken: options.bearerToken,
|
|
1399
|
+
headers: target.headers,
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
try {
|
|
1403
|
+
if (runId === undefined || runId === "") {
|
|
1404
|
+
const { runs, activeRunId } = await listRemoteEvalRuns({
|
|
1405
|
+
baseUrl: target.agentUrl,
|
|
1406
|
+
auth,
|
|
1407
|
+
fetchImpl: options.fetchImpl,
|
|
1408
|
+
});
|
|
1409
|
+
if (options.json) {
|
|
1410
|
+
process.stdout.write(`${JSON.stringify({ runs, activeRunId }, null, 2)}\n`);
|
|
1411
|
+
} else if (runs.length === 0) {
|
|
1412
|
+
process.stdout.write("No eval runs on this agent.\n");
|
|
1413
|
+
} else {
|
|
1414
|
+
if (activeRunId !== undefined) {
|
|
1415
|
+
process.stdout.write(`active: ${activeRunId}\n`);
|
|
1416
|
+
}
|
|
1417
|
+
for (const run of runs) {
|
|
1418
|
+
process.stdout.write(`${formatEvalRunSummaryLine(run)}\n`);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
return 0;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
const snap = await getRemoteEvalRun({
|
|
1425
|
+
baseUrl: target.agentUrl,
|
|
1426
|
+
runId,
|
|
1427
|
+
auth,
|
|
1428
|
+
fetchImpl: options.fetchImpl,
|
|
1429
|
+
});
|
|
1430
|
+
const outPath = await writeJsonOutFile(options.out, snap);
|
|
1431
|
+
if (options.json) {
|
|
1432
|
+
process.stdout.write(`${JSON.stringify(snap, null, 2)}\n`);
|
|
1433
|
+
if (outPath !== undefined) {
|
|
1434
|
+
process.stderr.write(`results: ${outPath}\n`);
|
|
1435
|
+
}
|
|
1436
|
+
} else {
|
|
1437
|
+
process.stdout.write(`${formatEvalRunSummaryLine(snap)}\n`);
|
|
1438
|
+
if (snap.error !== undefined && snap.error !== "") {
|
|
1439
|
+
process.stdout.write(`error: ${snap.error}\n`);
|
|
1440
|
+
}
|
|
1441
|
+
for (const c of snap.cases) {
|
|
1442
|
+
const mark = c.status !== "done" ? c.status : c.ok === true ? "PASS" : "FAIL";
|
|
1443
|
+
const dur = c.durationMs === undefined ? "" : ` (${(c.durationMs / 1000).toFixed(1)}s)`;
|
|
1444
|
+
process.stdout.write(` ${mark} ${c.id}${dur}\n`);
|
|
1445
|
+
if (c.error !== undefined && c.error !== "") {
|
|
1446
|
+
process.stdout.write(` error: ${c.error}\n`);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
if (outPath !== undefined) {
|
|
1450
|
+
process.stdout.write(`results: ${outPath}\n`);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
if (snap.status === "running") {
|
|
1454
|
+
return 3;
|
|
1455
|
+
}
|
|
1456
|
+
const failed =
|
|
1457
|
+
snap.status === "failed" ||
|
|
1458
|
+
snap.status === "cancelled" ||
|
|
1459
|
+
snap.cases.some(c => c.ok !== true);
|
|
1460
|
+
return failed ? 1 : 0;
|
|
1461
|
+
} catch (error) {
|
|
1462
|
+
process.stderr.write(
|
|
1463
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1464
|
+
);
|
|
1465
|
+
return 1;
|
|
1466
|
+
} finally {
|
|
1467
|
+
if (target.close !== undefined) {
|
|
1468
|
+
await target.close();
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
function formatEvalRunSummaryLine(run: EvalRunSnapshot): string {
|
|
1474
|
+
const { passed, failed, total, done } = run.summary;
|
|
1475
|
+
const durable = run.config.durableRuns === true ? " persisted" : "";
|
|
1476
|
+
return `${run.runId} ${run.status} ${done}/${total} done (${passed} passed, ${failed} failed)${durable}`;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
async function listLocalEvals(
|
|
1480
|
+
projectRoot: string,
|
|
1481
|
+
options: AxCliOptions,
|
|
1482
|
+
filterIds: string[] | undefined,
|
|
1483
|
+
tags: string[] | undefined,
|
|
1484
|
+
): Promise<number> {
|
|
1485
|
+
const { evals } = await discoverEvals(projectRoot);
|
|
1486
|
+
const listed = filterDiscoveredEvals(evals, { filterIds, tags });
|
|
1487
|
+
return printListedEvals(
|
|
1488
|
+
listed.map(e => ({
|
|
1489
|
+
id: e.id,
|
|
1490
|
+
fileId: e.fileId,
|
|
1491
|
+
path: e.path,
|
|
1492
|
+
description: e.definition.description,
|
|
1493
|
+
tags: e.definition.tags ?? [],
|
|
1494
|
+
})),
|
|
1495
|
+
options,
|
|
1496
|
+
`No evals under ${projectRoot}/evals`,
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
function printListedEvals(
|
|
1501
|
+
listed: Array<{
|
|
1502
|
+
id: string;
|
|
1503
|
+
fileId: string;
|
|
1504
|
+
path?: string;
|
|
1505
|
+
description?: string;
|
|
1506
|
+
tags: string[];
|
|
1507
|
+
}>,
|
|
1508
|
+
options: AxCliOptions,
|
|
1509
|
+
emptyMessage: string,
|
|
1510
|
+
): number {
|
|
1511
|
+
if (options.json) {
|
|
1512
|
+
process.stdout.write(`${JSON.stringify(listed, null, 2)}\n`);
|
|
1513
|
+
} else if (listed.length === 0) {
|
|
1514
|
+
process.stdout.write(`${emptyMessage}\n`);
|
|
1515
|
+
} else {
|
|
1516
|
+
for (const e of listed) {
|
|
1517
|
+
const tagSuffix = e.tags.length > 0 ? ` [${e.tags.join(", ")}]` : "";
|
|
1518
|
+
const desc = e.description !== undefined ? ` — ${e.description}` : "";
|
|
1519
|
+
process.stdout.write(`${e.id}${tagSuffix}${desc}\n`);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
return 0;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Remote batches don't stream turn events to the CLI; print run/case progress
|
|
1527
|
+
* (and case logs once they appear on the snapshot) instead.
|
|
1528
|
+
*/
|
|
1529
|
+
function createRemoteEvalProgress(
|
|
1530
|
+
enabled: boolean,
|
|
1531
|
+
): { onSnapshot: (snap: EvalRunSnapshot) => void } | undefined {
|
|
1532
|
+
if (!enabled) {
|
|
1533
|
+
return undefined;
|
|
1534
|
+
}
|
|
1535
|
+
let lastSummaryKey = "";
|
|
1536
|
+
const seenCaseKeys = new Set<string>();
|
|
1537
|
+
return {
|
|
1538
|
+
onSnapshot(snap) {
|
|
1539
|
+
// Eval ID is printed by printEvalIdBanner / printEvalAccepted.
|
|
1540
|
+
const summaryKey = `${snap.status}:${snap.summary.done}:${snap.summary.passed}:${snap.summary.failed}`;
|
|
1541
|
+
if (summaryKey !== lastSummaryKey) {
|
|
1542
|
+
lastSummaryKey = summaryKey;
|
|
1543
|
+
const { done, total, passed, failed } = snap.summary;
|
|
1544
|
+
process.stderr.write(
|
|
1545
|
+
`eval progress: ${done}/${total} done (${passed} passed, ${failed} failed) [${snap.status}]\n`,
|
|
1546
|
+
);
|
|
1547
|
+
}
|
|
1548
|
+
for (const c of snap.cases) {
|
|
1549
|
+
if (c.status !== "done") {
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1552
|
+
const caseKey = `${c.id}:${c.ok === true ? "pass" : "fail"}:${c.durationMs ?? 0}`;
|
|
1553
|
+
if (seenCaseKeys.has(caseKey)) {
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
seenCaseKeys.add(caseKey);
|
|
1557
|
+
process.stderr.write(
|
|
1558
|
+
` eval ${c.id}: ${c.ok === true ? "PASS" : "FAIL"}${
|
|
1559
|
+
c.error !== undefined ? ` — ${c.error}` : ""
|
|
1560
|
+
}\n`,
|
|
1561
|
+
);
|
|
1562
|
+
for (const line of c.logs ?? []) {
|
|
1563
|
+
process.stderr.write(` ${line}\n`);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Where a local run writes its artifacts.
|
|
1572
|
+
*
|
|
1573
|
+
* Defaults to a timestamped directory under the project's gitignored
|
|
1574
|
+
* `.agent-serve/evals/`, so the full story of a failure is always on disk
|
|
1575
|
+
* without the eval author opting in. `--no-artifacts` turns it off.
|
|
1576
|
+
*/
|
|
1577
|
+
export function resolveEvalArtifactsDir(
|
|
1578
|
+
projectRoot: string,
|
|
1579
|
+
options: Pick<AxCliOptions, "artifacts">,
|
|
1580
|
+
): string | undefined {
|
|
1581
|
+
if (options.artifacts === false) {
|
|
1582
|
+
return undefined;
|
|
1583
|
+
}
|
|
1584
|
+
if (typeof options.artifacts === "string" && options.artifacts !== "") {
|
|
1585
|
+
return resolve(options.artifacts);
|
|
1586
|
+
}
|
|
1587
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
1588
|
+
return join(projectRoot, ".agent-serve", "evals", stamp);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/** JUnit / artifacts reporters requested via CLI flags. */
|
|
1592
|
+
function buildCliEvalReporters(
|
|
1593
|
+
options: AxCliOptions,
|
|
1594
|
+
artifactsDir: string | undefined,
|
|
1595
|
+
): EvalReporter[] {
|
|
1596
|
+
const reporters: EvalReporter[] = [];
|
|
1597
|
+
if (artifactsDir !== undefined) {
|
|
1598
|
+
reporters.push(Artifacts({ dir: artifactsDir }));
|
|
1599
|
+
}
|
|
1600
|
+
if (options.junit !== undefined && options.junit !== "") {
|
|
1601
|
+
reporters.push(JUnit({ filePath: options.junit }));
|
|
1602
|
+
}
|
|
1603
|
+
return reporters;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
function evalVerdictOf(result: EvalRunResult): EvalVerdict {
|
|
1607
|
+
return result.verdict ?? (result.ok ? "passed" : "failed");
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
const EVAL_VERDICT_LABEL: Record<EvalVerdict, string> = {
|
|
1611
|
+
passed: "PASS",
|
|
1612
|
+
failed: "FAIL",
|
|
1613
|
+
scored: "SCORED",
|
|
1614
|
+
skipped: "SKIP",
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
async function printEvalResults(
|
|
1618
|
+
results: EvalRunResult[],
|
|
1619
|
+
options: AxCliOptions,
|
|
1620
|
+
batch?: {
|
|
1621
|
+
runId?: string;
|
|
1622
|
+
status?: EvalRunSnapshot["status"];
|
|
1623
|
+
error?: string;
|
|
1624
|
+
},
|
|
1625
|
+
artifactsDir?: string,
|
|
1626
|
+
): Promise<number> {
|
|
1627
|
+
const strict = options.strict === true;
|
|
1628
|
+
const counts = { passed: 0, failed: 0, scored: 0, skipped: 0 };
|
|
1629
|
+
for (const result of results) {
|
|
1630
|
+
counts[evalVerdictOf(result)]++;
|
|
1631
|
+
}
|
|
1632
|
+
const batchFailed = batch?.status === "failed";
|
|
1633
|
+
const ok = counts.failed === 0 && !(strict && counts.scored > 0) && !batchFailed;
|
|
1634
|
+
|
|
1635
|
+
if (batch?.error !== undefined && batch.error !== "" && !options.json) {
|
|
1636
|
+
// Always surface harness-level failures (not only --verbose).
|
|
1637
|
+
process.stderr.write(`eval run error: ${batch.error}\n`);
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
const payload = {
|
|
1641
|
+
ok,
|
|
1642
|
+
passed: counts.passed,
|
|
1643
|
+
failed: counts.failed,
|
|
1644
|
+
scored: counts.scored,
|
|
1645
|
+
skipped: counts.skipped,
|
|
1646
|
+
strict,
|
|
1647
|
+
results,
|
|
1648
|
+
...(artifactsDir === undefined ? {} : { artifactsDir }),
|
|
1649
|
+
...(batch?.runId === undefined ? {} : { runId: batch.runId }),
|
|
1650
|
+
...(batch?.status === undefined ? {} : { status: batch.status }),
|
|
1651
|
+
...(batch?.error === undefined || batch.error === "" ? {} : { error: batch.error }),
|
|
1652
|
+
};
|
|
1653
|
+
const outPath = await writeJsonOutFile(options.out, payload);
|
|
1654
|
+
|
|
1655
|
+
if (options.json) {
|
|
1656
|
+
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
1657
|
+
if (outPath !== undefined) {
|
|
1658
|
+
// stdout stays pure JSON; report the file on stderr.
|
|
1659
|
+
process.stderr.write(`results: ${outPath}\n`);
|
|
1660
|
+
}
|
|
1661
|
+
} else {
|
|
1662
|
+
for (const r of results) {
|
|
1663
|
+
const verdict = evalVerdictOf(r);
|
|
1664
|
+
process.stdout.write(
|
|
1665
|
+
`${EVAL_VERDICT_LABEL[verdict]} ${r.id} (${(r.durationMs / 1000).toFixed(1)}s)`,
|
|
1666
|
+
);
|
|
1667
|
+
if (r.description !== undefined) {
|
|
1668
|
+
process.stdout.write(` — ${r.description}`);
|
|
1669
|
+
}
|
|
1670
|
+
process.stdout.write("\n");
|
|
1671
|
+
if (r.skipReason !== undefined) {
|
|
1672
|
+
process.stdout.write(` skipped: ${r.skipReason}\n`);
|
|
1673
|
+
}
|
|
1674
|
+
for (const a of r.assertions) {
|
|
1675
|
+
process.stdout.write(` ${formatEvalAssertionLine(a)}\n`);
|
|
1676
|
+
}
|
|
1677
|
+
for (const [name, value] of Object.entries(r.metrics ?? {})) {
|
|
1678
|
+
process.stdout.write(` metric ${name}=${String(value)}\n`);
|
|
1679
|
+
}
|
|
1680
|
+
for (const line of r.logs ?? []) {
|
|
1681
|
+
process.stdout.write(` ${line}\n`);
|
|
1682
|
+
}
|
|
1683
|
+
if (r.error !== undefined) {
|
|
1684
|
+
process.stdout.write(` error: ${r.error}\n`);
|
|
1685
|
+
}
|
|
1686
|
+
if (options.verbose && r.finalText !== undefined) {
|
|
1687
|
+
process.stdout.write(` reply: ${r.finalText.slice(0, 200).replace(/\s+/g, " ")}\n`);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
const extra: string[] = [];
|
|
1691
|
+
if (counts.scored > 0) {
|
|
1692
|
+
extra.push(`${counts.scored} scored${strict ? " (fatal: --strict)" : ""}`);
|
|
1693
|
+
}
|
|
1694
|
+
if (counts.skipped > 0) {
|
|
1695
|
+
extra.push(`${counts.skipped} skipped`);
|
|
1696
|
+
}
|
|
1697
|
+
process.stdout.write(
|
|
1698
|
+
`\n${counts.passed} passed, ${counts.failed} failed${
|
|
1699
|
+
extra.length === 0 ? "" : `, ${extra.join(", ")}`
|
|
1700
|
+
}, ${results.length} total\n`,
|
|
1701
|
+
);
|
|
1702
|
+
if (artifactsDir !== undefined) {
|
|
1703
|
+
process.stdout.write(`artifacts: ${artifactsDir}\n`);
|
|
1704
|
+
}
|
|
1705
|
+
if (outPath !== undefined) {
|
|
1706
|
+
process.stdout.write(`results: ${outPath}\n`);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
return ok ? 0 : 1;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* `--out <path>`: write a JSON payload (results / run snapshot), creating
|
|
1714
|
+
* parent directories. Returns the resolved path, or undefined when unset.
|
|
1715
|
+
*/
|
|
1716
|
+
async function writeJsonOutFile(
|
|
1717
|
+
out: string | undefined,
|
|
1718
|
+
payload: unknown,
|
|
1719
|
+
): Promise<string | undefined> {
|
|
1720
|
+
const trimmed = trimNonEmpty(out);
|
|
1721
|
+
if (trimmed === undefined) {
|
|
1722
|
+
return undefined;
|
|
1723
|
+
}
|
|
1724
|
+
const target = resolve(trimmed);
|
|
1725
|
+
await mkdir(dirname(target), { recursive: true });
|
|
1726
|
+
await writeFile(target, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
|
|
1727
|
+
return target;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* One assertion line. Soft assertions read `~` rather than `✗` when they miss,
|
|
1732
|
+
* so a tracked score is visibly different from a failed gate.
|
|
1733
|
+
*/
|
|
1734
|
+
export function formatEvalAssertionLine(assertion: EvalAssertionResult): string {
|
|
1735
|
+
const soft = (assertion.severity ?? "gate") === "soft";
|
|
1736
|
+
const mark = assertion.passed ? "✓" : soft ? "~" : "✗";
|
|
1737
|
+
const parts: string[] = [];
|
|
1738
|
+
if (assertion.score !== undefined) {
|
|
1739
|
+
parts.push(
|
|
1740
|
+
`score=${assertion.score.toFixed(3)}${
|
|
1741
|
+
assertion.threshold === undefined ? "" : ` >= ${assertion.threshold}`
|
|
1742
|
+
}`,
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1745
|
+
if (assertion.detail !== undefined) {
|
|
1746
|
+
parts.push(assertion.detail);
|
|
1747
|
+
}
|
|
1748
|
+
const suffix = parts.length === 0 ? "" : ` (${parts.join(", ")})`;
|
|
1749
|
+
return `${mark} ${assertion.name}${soft ? " [soft]" : ""}${suffix}`;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* `logs` — follow deploy progress (`--prod`) then runtime agent logs.
|
|
1754
|
+
* Local / `--url` tails `/v1/logs` only.
|
|
1755
|
+
*/
|
|
1756
|
+
export async function cmdLogs(options: AxCliOptions): Promise<number> {
|
|
1757
|
+
if (options.prod === true && options.url !== undefined) {
|
|
1758
|
+
process.stderr.write("--prod and --url are mutually exclusive\n");
|
|
1759
|
+
return 2;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
const controller = new AbortController();
|
|
1763
|
+
const onSignal = (): void => {
|
|
1764
|
+
controller.abort();
|
|
1765
|
+
};
|
|
1766
|
+
process.on("SIGINT", onSignal);
|
|
1767
|
+
process.on("SIGTERM", onSignal);
|
|
1768
|
+
|
|
1769
|
+
try {
|
|
1770
|
+
if (options.prod === true) {
|
|
1771
|
+
const slug = resolveProdSlug({
|
|
1772
|
+
dir: options.dir,
|
|
1773
|
+
cwd: options.cwd,
|
|
1774
|
+
slug: options.slug,
|
|
1775
|
+
});
|
|
1776
|
+
const auth = await resolveDeployAuth({
|
|
1777
|
+
team: options.team,
|
|
1778
|
+
apiKey: options.apiKey,
|
|
1779
|
+
fetchImpl: options.fetchImpl,
|
|
1780
|
+
});
|
|
1781
|
+
if (typeof auth === "number") {
|
|
1782
|
+
return auth;
|
|
1783
|
+
}
|
|
1784
|
+
await rejectV2ForLegacyCommand({
|
|
1785
|
+
client: auth.client,
|
|
1786
|
+
teamId: auth.teamId,
|
|
1787
|
+
slug,
|
|
1788
|
+
});
|
|
1789
|
+
await runLogsTail({
|
|
1790
|
+
prod: true,
|
|
1791
|
+
dir: options.dir,
|
|
1792
|
+
cwd: options.cwd,
|
|
1793
|
+
slug,
|
|
1794
|
+
team: options.team,
|
|
1795
|
+
apiKey: options.apiKey,
|
|
1796
|
+
bearerToken: options.bearerToken,
|
|
1797
|
+
once: options.once,
|
|
1798
|
+
json: options.json,
|
|
1799
|
+
fetchImpl: options.fetchImpl,
|
|
1800
|
+
signal: controller.signal,
|
|
1801
|
+
getDeployment: () => auth.client.getDeployment({ teamId: auth.teamId, slug }),
|
|
1802
|
+
resolveRuntime: async () => {
|
|
1803
|
+
const target = await resolveProdTarget({
|
|
1804
|
+
dir: options.dir,
|
|
1805
|
+
cwd: options.cwd,
|
|
1806
|
+
slug,
|
|
1807
|
+
team: options.team,
|
|
1808
|
+
apiKey: options.apiKey,
|
|
1809
|
+
fetchImpl: options.fetchImpl,
|
|
1810
|
+
err: () => {},
|
|
1811
|
+
skipLegacyArchitectureCheck: true,
|
|
1812
|
+
});
|
|
1813
|
+
return { agentUrl: target.agentUrl, headers: target.headers };
|
|
1814
|
+
},
|
|
1815
|
+
});
|
|
1816
|
+
return 0;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
await runLogsTail({
|
|
1820
|
+
dir: options.dir,
|
|
1821
|
+
cwd: options.cwd,
|
|
1822
|
+
url: options.url ?? "http://127.0.0.1:3000",
|
|
1823
|
+
bearerToken: options.bearerToken,
|
|
1824
|
+
once: options.once,
|
|
1825
|
+
json: options.json,
|
|
1826
|
+
fetchImpl: options.fetchImpl,
|
|
1827
|
+
signal: controller.signal,
|
|
1828
|
+
});
|
|
1829
|
+
return 0;
|
|
1830
|
+
} catch (error) {
|
|
1831
|
+
if (controller.signal.aborted) {
|
|
1832
|
+
return 0;
|
|
1833
|
+
}
|
|
1834
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
1835
|
+
process.stderr.write(`${sanitizeCustomerError(raw)}\n`);
|
|
1836
|
+
return 1;
|
|
1837
|
+
} finally {
|
|
1838
|
+
process.off("SIGINT", onSignal);
|
|
1839
|
+
process.off("SIGTERM", onSignal);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/** Resolve local / `--url` / `--prod` agent base URL + request headers. */
|
|
1844
|
+
async function resolveSessionTarget(
|
|
1845
|
+
options: AxCliOptions,
|
|
1846
|
+
): Promise<{ agentUrl: string; headers?: Record<string, string> } | number> {
|
|
1847
|
+
if (options.prod === true && options.url !== undefined) {
|
|
1848
|
+
process.stderr.write("--prod and --url are mutually exclusive\n");
|
|
1849
|
+
return 2;
|
|
1850
|
+
}
|
|
1851
|
+
if (options.prod === true) {
|
|
1852
|
+
try {
|
|
1853
|
+
const target = await resolveProdTarget({
|
|
1854
|
+
dir: options.dir,
|
|
1855
|
+
cwd: options.cwd,
|
|
1856
|
+
slug: options.slug,
|
|
1857
|
+
team: options.team,
|
|
1858
|
+
apiKey: options.apiKey,
|
|
1859
|
+
fetchImpl: options.fetchImpl,
|
|
1860
|
+
});
|
|
1861
|
+
return { agentUrl: target.agentUrl, headers: target.headers };
|
|
1862
|
+
} catch (error) {
|
|
1863
|
+
process.stderr.write(
|
|
1864
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1865
|
+
);
|
|
1866
|
+
return 1;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
return {
|
|
1870
|
+
agentUrl: (options.url ?? "http://127.0.0.1:3000").replace(/\/$/, ""),
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* `sessions` — list sessions on a running (or `--prod` hosted) agent.
|
|
1876
|
+
*/
|
|
1877
|
+
export async function cmdSessions(options: AxCliOptions): Promise<number> {
|
|
1878
|
+
const target = await resolveSessionTarget(options);
|
|
1879
|
+
if (typeof target === "number") {
|
|
1880
|
+
return target;
|
|
1881
|
+
}
|
|
1882
|
+
try {
|
|
1883
|
+
const listed = await listSessionsWithSource({
|
|
1884
|
+
baseUrl: target.agentUrl,
|
|
1885
|
+
auth: {
|
|
1886
|
+
bearerToken: options.bearerToken,
|
|
1887
|
+
headers: target.headers,
|
|
1888
|
+
},
|
|
1889
|
+
fetchImpl: options.fetchImpl,
|
|
1890
|
+
});
|
|
1891
|
+
if (options.json === true) {
|
|
1892
|
+
const payload =
|
|
1893
|
+
listed.source === undefined
|
|
1894
|
+
? { sessions: listed.sessions }
|
|
1895
|
+
: { sessions: listed.sessions, source: listed.source };
|
|
1896
|
+
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
1897
|
+
return 0;
|
|
1898
|
+
}
|
|
1899
|
+
process.stdout.write(formatSessionsTable(listed.sessions, { source: listed.source }));
|
|
1900
|
+
return 0;
|
|
1901
|
+
} catch (error) {
|
|
1902
|
+
process.stderr.write(
|
|
1903
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1904
|
+
);
|
|
1905
|
+
return 1;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
function formatHostedSessionRuns(sessionId: string, runs: AgentkitSessionRuns): string {
|
|
1910
|
+
const lines = [`Session ${sessionId}`, `Hosted executions: ${runs.executions.length}`];
|
|
1911
|
+
for (const run of runs.executions) {
|
|
1912
|
+
const failure = run.error?.message ?? run.message ?? "";
|
|
1913
|
+
lines.push(
|
|
1914
|
+
"",
|
|
1915
|
+
`${run.executionId} ${run.turnStatus} ${run.durationMs}ms ${run.writtenAt} ${failure}`.trimEnd(),
|
|
1916
|
+
...run.logs.map(log => ` ${log.line}`),
|
|
1917
|
+
);
|
|
1918
|
+
}
|
|
1919
|
+
return `${lines.join("\n")}\n`;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
/** Read the v2 runs surface; only its 404 falls through to the v1 engine. */
|
|
1923
|
+
async function readHostedSessionRuns(
|
|
1924
|
+
sessionId: string,
|
|
1925
|
+
options: AxCliOptions,
|
|
1926
|
+
): Promise<number | "v1"> {
|
|
1927
|
+
const auth = await resolveDeployAuth({
|
|
1928
|
+
team: options.team,
|
|
1929
|
+
apiKey: options.apiKey,
|
|
1930
|
+
fetchImpl: options.fetchImpl,
|
|
1931
|
+
});
|
|
1932
|
+
if (typeof auth === "number") {
|
|
1933
|
+
return auth;
|
|
1934
|
+
}
|
|
1935
|
+
try {
|
|
1936
|
+
const runs = await auth.client.getAgentkitSessionRuns({
|
|
1937
|
+
teamId: auth.teamId,
|
|
1938
|
+
slug: resolveProdSlug(options),
|
|
1939
|
+
sessionId,
|
|
1940
|
+
});
|
|
1941
|
+
if (options.rawEvents === true || trimNonEmpty(options.out) !== undefined) {
|
|
1942
|
+
process.stderr.write("--events and --out need an engine trajectory.\n");
|
|
1943
|
+
return 2;
|
|
1944
|
+
}
|
|
1945
|
+
process.stdout.write(
|
|
1946
|
+
options.json === true
|
|
1947
|
+
? `${JSON.stringify({ sessionId, ...runs }, null, 2)}\n`
|
|
1948
|
+
: formatHostedSessionRuns(sessionId, runs),
|
|
1949
|
+
);
|
|
1950
|
+
return 0;
|
|
1951
|
+
} catch (error) {
|
|
1952
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
1953
|
+
return "v1";
|
|
1954
|
+
}
|
|
1955
|
+
process.stderr.write(
|
|
1956
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
1957
|
+
);
|
|
1958
|
+
return 1;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
/**
|
|
1963
|
+
* `session <id>` — view a full session (trajectory text by default).
|
|
1964
|
+
* `--json` → trajectory JSON; `--events` (`rawEvents`) → raw event list.
|
|
1965
|
+
* `--out <path>` → write the raw NDJSON trace to a file instead of printing
|
|
1966
|
+
* (same format as `run --events` and the playground download).
|
|
1967
|
+
* Interactive reattach: `resume [id]` / `chat --resume` (or `chat --session`).
|
|
1968
|
+
*/
|
|
1969
|
+
export async function cmdSession(
|
|
1970
|
+
sessionId: string | undefined,
|
|
1971
|
+
options: AxCliOptions,
|
|
1972
|
+
): Promise<number> {
|
|
1973
|
+
if (options.prod === true && (options.messages?.length ?? 0) > 0) {
|
|
1974
|
+
// `session --prod [ses_…] --message` is the same hosted start as
|
|
1975
|
+
// `run --prod`, with the positional id as the session to resume. Unlike
|
|
1976
|
+
// `run`, a 404 is an error here: this form is explicitly v2.
|
|
1977
|
+
const started = await cmdHostedSession({
|
|
1978
|
+
...options,
|
|
1979
|
+
sessionId: trimNonEmpty(sessionId) ?? options.sessionId,
|
|
1980
|
+
});
|
|
1981
|
+
if (started === "fallback") {
|
|
1982
|
+
process.stderr.write(
|
|
1983
|
+
`Hosted session start returned 404 for slug ${resolveProdSlug(options)}: deploy a running AgentSDK v2 agent, or use \`${CLI_COMMAND_NAME} run --prod\` (falls back to the v1 engine).\n`,
|
|
1984
|
+
);
|
|
1985
|
+
return 1;
|
|
1986
|
+
}
|
|
1987
|
+
return started;
|
|
1988
|
+
}
|
|
1989
|
+
if (sessionId === undefined || sessionId.trim() === "") {
|
|
1990
|
+
process.stderr.write(
|
|
1991
|
+
`Usage: ${CLI_COMMAND_NAME} session <sessionId> [--url | --prod] [--json | --text | --events] [--out <file.ndjson>]\n` +
|
|
1992
|
+
` or: ${CLI_COMMAND_NAME} session --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]\n`,
|
|
1993
|
+
);
|
|
1994
|
+
return 2;
|
|
1995
|
+
}
|
|
1996
|
+
if (options.rawEvents === true && options.json === true) {
|
|
1997
|
+
process.stderr.write("--events and --json are mutually exclusive\n");
|
|
1998
|
+
return 2;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
if (options.prod === true && options.url === undefined) {
|
|
2002
|
+
const hosted = await readHostedSessionRuns(sessionId, options);
|
|
2003
|
+
if (hosted !== "v1") {
|
|
2004
|
+
return hosted;
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
const target = await resolveSessionTarget(options);
|
|
2009
|
+
if (typeof target === "number") {
|
|
2010
|
+
return target;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
try {
|
|
2014
|
+
const events = await fetchSessionEvents({
|
|
2015
|
+
baseUrl: target.agentUrl,
|
|
2016
|
+
sessionId,
|
|
2017
|
+
auth: {
|
|
2018
|
+
bearerToken: options.bearerToken,
|
|
2019
|
+
headers: target.headers,
|
|
2020
|
+
},
|
|
2021
|
+
fetchImpl: options.fetchImpl,
|
|
2022
|
+
});
|
|
2023
|
+
|
|
2024
|
+
const outPath = trimNonEmpty(options.out);
|
|
2025
|
+
if (outPath !== undefined) {
|
|
2026
|
+
const targetPath = resolve(outPath);
|
|
2027
|
+
await mkdir(dirname(targetPath), { recursive: true });
|
|
2028
|
+
await writeFile(targetPath, `${events.map(e => JSON.stringify(e)).join("\n")}\n`, "utf8");
|
|
2029
|
+
process.stdout.write(`trace: ${targetPath} (${events.length} events)\n`);
|
|
2030
|
+
return 0;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
if (options.rawEvents === true) {
|
|
2034
|
+
process.stdout.write(`${JSON.stringify({ sessionId, events }, null, 2)}\n`);
|
|
2035
|
+
return 0;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
const trajectory = buildTrajectory(events);
|
|
2039
|
+
if (options.json === true) {
|
|
2040
|
+
process.stdout.write(`${JSON.stringify(trajectory, null, 2)}\n`);
|
|
2041
|
+
return 0;
|
|
2042
|
+
}
|
|
2043
|
+
process.stdout.write(formatTrajectoryText(trajectory));
|
|
2044
|
+
return 0;
|
|
2045
|
+
} catch (error) {
|
|
2046
|
+
process.stderr.write(
|
|
2047
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
2048
|
+
);
|
|
2049
|
+
return 1;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
/** Sessions fetched concurrently when `cost` aggregates every session. */
|
|
2054
|
+
const COST_FETCH_CONCURRENCY = 4;
|
|
2055
|
+
|
|
2056
|
+
/**
|
|
2057
|
+
* `cost [sessionId]` — pull per-session cost metrics.
|
|
2058
|
+
*
|
|
2059
|
+
* With a session id: per-turn token usage + estimated cost for that session.
|
|
2060
|
+
* Without one: one row per session (all sessions on the target) plus a
|
|
2061
|
+
* total row. `--json` prints the underlying report(s); text is the default.
|
|
2062
|
+
* Costs are recorded on `turn.completed` via `POST /v1/models/estimate-cost`
|
|
2063
|
+
* (billed usage when available). Turns persisted before cost tracking simply
|
|
2064
|
+
* count as unpriced.
|
|
2065
|
+
*/
|
|
2066
|
+
export async function cmdCost(
|
|
2067
|
+
sessionId: string | undefined,
|
|
2068
|
+
options: AxCliOptions,
|
|
2069
|
+
): Promise<number> {
|
|
2070
|
+
const target = await resolveSessionTarget(options);
|
|
2071
|
+
if (typeof target === "number") {
|
|
2072
|
+
return target;
|
|
2073
|
+
}
|
|
2074
|
+
const auth = {
|
|
2075
|
+
bearerToken: options.bearerToken,
|
|
2076
|
+
headers: target.headers,
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
try {
|
|
2080
|
+
const resolved = trimNonEmpty(sessionId);
|
|
2081
|
+
if (resolved !== undefined) {
|
|
2082
|
+
const events = await fetchSessionEvents({
|
|
2083
|
+
baseUrl: target.agentUrl,
|
|
2084
|
+
sessionId: resolved,
|
|
2085
|
+
auth,
|
|
2086
|
+
fetchImpl: options.fetchImpl,
|
|
2087
|
+
});
|
|
2088
|
+
const report = buildSessionCostReport(events);
|
|
2089
|
+
if (report.sessionId === "") {
|
|
2090
|
+
report.sessionId = resolved;
|
|
2091
|
+
}
|
|
2092
|
+
if (options.json === true) {
|
|
2093
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
2094
|
+
} else {
|
|
2095
|
+
process.stdout.write(formatSessionCostText(report));
|
|
2096
|
+
}
|
|
2097
|
+
return 0;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
const listed = await listSessionsWithSource({
|
|
2101
|
+
baseUrl: target.agentUrl,
|
|
2102
|
+
auth,
|
|
2103
|
+
fetchImpl: options.fetchImpl,
|
|
2104
|
+
});
|
|
2105
|
+
const rows = await mapPool(
|
|
2106
|
+
listed.sessions,
|
|
2107
|
+
COST_FETCH_CONCURRENCY,
|
|
2108
|
+
async (session): Promise<SessionCostRow> => {
|
|
2109
|
+
const events = await fetchSessionEvents({
|
|
2110
|
+
baseUrl: target.agentUrl,
|
|
2111
|
+
sessionId: session.sessionId,
|
|
2112
|
+
auth,
|
|
2113
|
+
fetchImpl: options.fetchImpl,
|
|
2114
|
+
});
|
|
2115
|
+
const report = buildSessionCostReport(events);
|
|
2116
|
+
return {
|
|
2117
|
+
sessionId: session.sessionId,
|
|
2118
|
+
channelId: session.channelId,
|
|
2119
|
+
title: session.title,
|
|
2120
|
+
updatedAt: session.updatedAt,
|
|
2121
|
+
totals: report.totals,
|
|
2122
|
+
};
|
|
2123
|
+
},
|
|
2124
|
+
);
|
|
2125
|
+
if (options.json === true) {
|
|
2126
|
+
process.stdout.write(`${JSON.stringify({ sessions: rows }, null, 2)}\n`);
|
|
2127
|
+
} else {
|
|
2128
|
+
process.stdout.write(formatSessionsCostText(rows));
|
|
2129
|
+
}
|
|
2130
|
+
return 0;
|
|
2131
|
+
} catch (error) {
|
|
2132
|
+
process.stderr.write(
|
|
2133
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
2134
|
+
);
|
|
2135
|
+
return 1;
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* `playground` — open the local web UI, v1 hosted alias, or v2 portal UI.
|
|
2141
|
+
*
|
|
2142
|
+
* `--prod` opens the stable v1 alias or the v2 portal URL. `--bearer-token`
|
|
2143
|
+
* (and other injected headers) on local targets still run a loopback reverse
|
|
2144
|
+
* proxy — Ctrl-C stops that proxy.
|
|
2145
|
+
*/
|
|
2146
|
+
export async function cmdPlayground(options: AxCliOptions): Promise<number> {
|
|
2147
|
+
if (options.prod === true && options.url !== undefined) {
|
|
2148
|
+
process.stderr.write("--prod and --url are mutually exclusive\n");
|
|
2149
|
+
return 2;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
const sessionId =
|
|
2153
|
+
options.sessionId !== undefined && options.sessionId.trim() !== ""
|
|
2154
|
+
? options.sessionId.trim()
|
|
2155
|
+
: undefined;
|
|
2156
|
+
|
|
2157
|
+
// Hosted v1 opens the alias playground; v2 opens the portal-hosted shell.
|
|
2158
|
+
if (options.prod === true) {
|
|
2159
|
+
let resolved: Awaited<ReturnType<typeof resolveProdPlaygroundUrl>>;
|
|
2160
|
+
try {
|
|
2161
|
+
resolved = await resolveProdPlaygroundUrl({
|
|
2162
|
+
dir: options.dir,
|
|
2163
|
+
cwd: options.cwd,
|
|
2164
|
+
slug: options.slug,
|
|
2165
|
+
team: options.team,
|
|
2166
|
+
apiKey: options.apiKey,
|
|
2167
|
+
fetchImpl: options.fetchImpl,
|
|
2168
|
+
sessionId,
|
|
2169
|
+
});
|
|
2170
|
+
} catch (error) {
|
|
2171
|
+
process.stderr.write(
|
|
2172
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
2173
|
+
);
|
|
2174
|
+
return 1;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
process.stdout.write(`${resolved.playgroundUrl}\n`);
|
|
2178
|
+
if (options.print !== true) {
|
|
2179
|
+
openBrowser(resolved.playgroundUrl);
|
|
2180
|
+
}
|
|
2181
|
+
return 0;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
const target = await resolveSessionTarget(options);
|
|
2185
|
+
if (typeof target === "number") {
|
|
2186
|
+
return target;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
const needsProxy =
|
|
2190
|
+
(target.headers !== undefined && Object.keys(target.headers).length > 0) ||
|
|
2191
|
+
(options.bearerToken !== undefined && options.bearerToken.trim() !== "");
|
|
2192
|
+
|
|
2193
|
+
if (!needsProxy) {
|
|
2194
|
+
const base = `${target.agentUrl.replace(/\/$/, "")}/playground`;
|
|
2195
|
+
const playgroundUrl =
|
|
2196
|
+
sessionId === undefined ? base : `${base}?sessionId=${encodeURIComponent(sessionId)}`;
|
|
2197
|
+
process.stdout.write(`${playgroundUrl}\n`);
|
|
2198
|
+
if (options.print !== true) {
|
|
2199
|
+
openBrowser(playgroundUrl);
|
|
2200
|
+
}
|
|
2201
|
+
return 0;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
let proxy: Awaited<ReturnType<typeof startPlaygroundProxy>>;
|
|
2205
|
+
try {
|
|
2206
|
+
proxy = await startPlaygroundProxy({
|
|
2207
|
+
upstreamUrl: target.agentUrl,
|
|
2208
|
+
headers: target.headers,
|
|
2209
|
+
bearerToken: options.bearerToken,
|
|
2210
|
+
});
|
|
2211
|
+
} catch (error) {
|
|
2212
|
+
process.stderr.write(
|
|
2213
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
2214
|
+
);
|
|
2215
|
+
return 1;
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
return await runPlaygroundProxySession({
|
|
2219
|
+
proxy,
|
|
2220
|
+
sessionId,
|
|
2221
|
+
print: options.print === true,
|
|
2222
|
+
signal: options.signal,
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
async function runPlaygroundProxySession(args: {
|
|
2227
|
+
proxy: Awaited<ReturnType<typeof startPlaygroundProxy>>;
|
|
2228
|
+
sessionId?: string;
|
|
2229
|
+
print: boolean;
|
|
2230
|
+
signal?: AbortSignal;
|
|
2231
|
+
}): Promise<number> {
|
|
2232
|
+
const { proxy } = args;
|
|
2233
|
+
|
|
2234
|
+
const playgroundUrl = proxy.playgroundUrl(args.sessionId);
|
|
2235
|
+
process.stdout.write(`${playgroundUrl}\n`);
|
|
2236
|
+
process.stderr.write(`Playground proxy on loopback (Ctrl-C to stop).\n`);
|
|
2237
|
+
if (args.print !== true) {
|
|
2238
|
+
openBrowser(playgroundUrl);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
const controller = new AbortController();
|
|
2242
|
+
const onSignal = (): void => {
|
|
2243
|
+
controller.abort();
|
|
2244
|
+
};
|
|
2245
|
+
process.on("SIGINT", onSignal);
|
|
2246
|
+
process.on("SIGTERM", onSignal);
|
|
2247
|
+
const external = args.signal;
|
|
2248
|
+
if (external !== undefined) {
|
|
2249
|
+
if (external.aborted) {
|
|
2250
|
+
controller.abort();
|
|
2251
|
+
} else {
|
|
2252
|
+
external.addEventListener("abort", onSignal, { once: true });
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
try {
|
|
2257
|
+
await new Promise<void>(resolve => {
|
|
2258
|
+
if (controller.signal.aborted) {
|
|
2259
|
+
resolve();
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
controller.signal.addEventListener("abort", () => resolve(), {
|
|
2263
|
+
once: true,
|
|
2264
|
+
});
|
|
2265
|
+
});
|
|
2266
|
+
return 0;
|
|
2267
|
+
} finally {
|
|
2268
|
+
process.off("SIGINT", onSignal);
|
|
2269
|
+
process.off("SIGTERM", onSignal);
|
|
2270
|
+
external?.removeEventListener("abort", onSignal);
|
|
2271
|
+
await proxy.close().catch(() => {});
|
|
2272
|
+
}
|
|
2273
|
+
}
|