e2e 0.15.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build.json +1 -1
- package/dist/agent/act-validation.d.ts +10 -1
- package/dist/agent/act-validation.js +48 -1
- package/dist/agent/act.d.ts +1 -2
- package/dist/agent/act.js +29 -9
- package/dist/agent/action-dispatcher.d.ts +0 -1
- package/dist/agent/action-dispatcher.js +4 -6
- package/dist/agent/action-names.d.ts +0 -1
- package/dist/agent/action-names.js +0 -1
- package/dist/agent/actions.d.ts +32 -24
- package/dist/agent/actions.js +38 -25
- package/dist/agent/agent-brand.d.ts +0 -1
- package/dist/agent/agent-brand.js +0 -1
- package/dist/agent/ai-sdk.d.ts +7 -1
- package/dist/agent/ai-sdk.js +11 -1
- package/dist/agent/call-options.d.ts +0 -1
- package/dist/agent/call-options.js +0 -1
- package/dist/agent/default-agent.d.ts +0 -1
- package/dist/agent/default-agent.js +0 -1
- package/dist/agent/derived.d.ts +0 -1
- package/dist/agent/derived.js +0 -1
- package/dist/agent/error.d.ts +0 -1
- package/dist/agent/error.js +0 -1
- package/dist/agent/executor.d.ts +0 -1
- package/dist/agent/executor.js +0 -1
- package/dist/agent/index.d.ts +0 -1
- package/dist/agent/index.js +0 -1
- package/dist/agent/interactive-step.d.ts +0 -1
- package/dist/agent/interactive-step.js +0 -1
- package/dist/agent/invocation.d.ts +0 -1
- package/dist/agent/invocation.js +10 -5
- package/dist/agent/ledger.d.ts +0 -1
- package/dist/agent/ledger.js +0 -1
- package/dist/agent/loop-guards.d.ts +0 -1
- package/dist/agent/loop-guards.js +0 -1
- package/dist/agent/model/adapter.d.ts +0 -1
- package/dist/agent/model/adapter.js +0 -1
- package/dist/agent/model/overflow.d.ts +0 -1
- package/dist/agent/model/overflow.js +0 -1
- package/dist/agent/model/provider-hints.d.ts +0 -1
- package/dist/agent/model/provider-hints.js +0 -1
- package/dist/agent/model/schema.d.ts +0 -1
- package/dist/agent/model/schema.js +0 -1
- package/dist/agent/model/sdk.d.ts +0 -1
- package/dist/agent/model/sdk.js +2 -1
- package/dist/agent/model/stall.d.ts +0 -1
- package/dist/agent/model/stall.js +0 -1
- package/dist/agent/model/tool-choice.d.ts +0 -1
- package/dist/agent/model/tool-choice.js +0 -1
- package/dist/agent/observation-budget.d.ts +0 -1
- package/dist/agent/observation-budget.js +0 -1
- package/dist/agent/observation-feed.d.ts +5 -7
- package/dist/agent/observation-feed.js +5 -8
- package/dist/agent/observation.d.ts +40 -12
- package/dist/agent/observation.js +109 -60
- package/dist/agent/operation-queue.d.ts +0 -1
- package/dist/agent/operation-queue.js +0 -1
- package/dist/agent/phases.d.ts +0 -1
- package/dist/agent/phases.js +0 -1
- package/dist/agent/pixels.d.ts +0 -1
- package/dist/agent/pixels.js +0 -1
- package/dist/agent/point-tap.d.ts +8 -9
- package/dist/agent/point-tap.js +1 -2
- package/dist/agent/primitives.d.ts +6 -1
- package/dist/agent/primitives.js +4 -2
- package/dist/agent/prompts.d.ts +0 -1
- package/dist/agent/prompts.js +0 -1
- package/dist/agent/protocol.d.ts +0 -1
- package/dist/agent/protocol.js +0 -1
- package/dist/agent/public.d.ts +0 -1
- package/dist/agent/public.js +0 -1
- package/dist/agent/reading.d.ts +0 -1
- package/dist/agent/reading.js +0 -1
- package/dist/agent/replay.d.ts +19 -9
- package/dist/agent/replay.js +11 -15
- package/dist/agent/screen-update.d.ts +0 -1
- package/dist/agent/screen-update.js +0 -1
- package/dist/agent/scroll-target.d.ts +2 -4
- package/dist/agent/scroll-target.js +0 -1
- package/dist/agent/secrets.d.ts +0 -1
- package/dist/agent/secrets.js +0 -1
- package/dist/agent/settle-policy.d.ts +0 -1
- package/dist/agent/settle-policy.js +0 -1
- package/dist/agent/step-accounting.d.ts +0 -1
- package/dist/agent/step-accounting.js +0 -1
- package/dist/agent/step-cache.d.ts +41 -15
- package/dist/agent/step-cache.js +147 -63
- package/dist/agent/tool-loop.d.ts +0 -1
- package/dist/agent/tool-loop.js +2 -1
- package/dist/agent/tool-output.d.ts +0 -1
- package/dist/agent/tool-output.js +0 -1
- package/dist/agent/tool.d.ts +0 -1
- package/dist/agent/tool.js +0 -1
- package/dist/agent/transcript-compaction.d.ts +0 -1
- package/dist/agent/transcript-compaction.js +0 -1
- package/dist/agent/upload-paths.d.ts +0 -1
- package/dist/agent/upload-paths.js +0 -1
- package/dist/agent/usage.d.ts +0 -1
- package/dist/agent/usage.js +0 -1
- package/dist/cache/anchors.d.ts +72 -24
- package/dist/cache/anchors.js +233 -61
- package/dist/cache/context.d.ts +25 -15
- package/dist/cache/context.js +50 -9
- package/dist/cache/decide.d.ts +2 -3
- package/dist/cache/decide.js +4 -7
- package/dist/cache/identity.d.ts +18 -5
- package/dist/cache/identity.js +9 -5
- package/dist/cache/recorder.d.ts +15 -2
- package/dist/cache/recorder.js +36 -24
- package/dist/cache/rekeyed.d.ts +46 -0
- package/dist/cache/rekeyed.js +89 -0
- package/dist/cache/relocate.d.ts +14 -15
- package/dist/cache/relocate.js +33 -26
- package/dist/cache/route.d.ts +32 -34
- package/dist/cache/route.js +94 -51
- package/dist/cache/store.d.ts +6 -1
- package/dist/cache/store.js +21 -2
- package/dist/cache/template.d.ts +0 -1
- package/dist/cache/template.js +0 -1
- package/dist/cache/trace.d.ts +53 -15
- package/dist/cache/trace.js +70 -29
- package/dist/cli/bin.d.ts +0 -1
- package/dist/cli/bin.js +0 -1
- package/dist/cli/cache.d.ts +0 -1
- package/dist/cli/cache.js +0 -1
- package/dist/cli/docs-url.d.ts +0 -1
- package/dist/cli/docs-url.js +0 -1
- package/dist/cli/feedback.d.ts +0 -1
- package/dist/cli/feedback.js +0 -1
- package/dist/cli/guide.d.ts +0 -1
- package/dist/cli/guide.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +10 -11
- package/dist/cli/init/agent-skill.d.ts +0 -1
- package/dist/cli/init/agent-skill.js +0 -1
- package/dist/cli/init/engines.d.ts +1 -4
- package/dist/cli/init/engines.js +2 -3
- package/dist/cli/init/gateways.d.ts +1 -2
- package/dist/cli/init/gateways.js +11 -2
- package/dist/cli/init/mcp-config.d.ts +0 -1
- package/dist/cli/init/mcp-config.js +0 -1
- package/dist/cli/init/package.d.ts +0 -1
- package/dist/cli/init/package.js +0 -1
- package/dist/cli/init/scaffold.d.ts +0 -1
- package/dist/cli/init/scaffold.js +0 -1
- package/dist/cli/init/sibling-versions.json +1 -1
- package/dist/cli/init/versions.d.ts +0 -9
- package/dist/cli/init/versions.js +1 -11
- package/dist/cli/init.d.ts +0 -1
- package/dist/cli/init.js +0 -1
- package/dist/cli/mcp.d.ts +9 -2
- package/dist/cli/mcp.js +14 -2
- package/dist/cli/signals.d.ts +0 -1
- package/dist/cli/signals.js +0 -1
- package/dist/cli/skill.d.ts +0 -1
- package/dist/cli/skill.js +0 -1
- package/dist/cli/telemetry.d.ts +0 -1
- package/dist/cli/telemetry.js +1 -2
- package/dist/cli/wordmark.d.ts +0 -1
- package/dist/cli/wordmark.js +0 -1
- package/dist/collect/collect.d.ts +0 -1
- package/dist/collect/collect.js +3 -2
- package/dist/collect/registry.d.ts +6 -3
- package/dist/collect/registry.js +31 -14
- package/dist/collect/select.d.ts +0 -1
- package/dist/collect/select.js +0 -1
- package/dist/config/agent.d.ts +0 -1
- package/dist/config/agent.js +0 -1
- package/dist/config/app.d.ts +0 -1
- package/dist/config/app.js +0 -1
- package/dist/config/command.d.ts +0 -1
- package/dist/config/command.js +0 -1
- package/dist/config/diagnose.d.ts +0 -1
- package/dist/config/diagnose.js +0 -1
- package/dist/config/esm-hooks.d.ts +0 -1
- package/dist/config/esm-hooks.js +0 -1
- package/dist/config/load.d.ts +0 -1
- package/dist/config/load.js +0 -1
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.js +33 -2
- package/dist/config/secrets.d.ts +0 -1
- package/dist/config/secrets.js +0 -1
- package/dist/config/targets.d.ts +0 -1
- package/dist/config/targets.js +0 -1
- package/dist/config/validate.d.ts +0 -1
- package/dist/config/validate.js +0 -1
- package/dist/engine/contract.d.ts +0 -1
- package/dist/engine/contract.js +0 -1
- package/dist/engine/index.d.ts +3 -4
- package/dist/engine/index.js +4 -4
- package/dist/engine/manifest.d.ts +0 -1
- package/dist/engine/manifest.js +0 -1
- package/dist/engine/recording.d.ts +0 -1
- package/dist/engine/recording.js +0 -1
- package/dist/engine/resolve.d.ts +0 -1
- package/dist/engine/resolve.js +0 -1
- package/dist/engine/session.d.ts +0 -1
- package/dist/engine/session.js +0 -1
- package/dist/engine/surface.d.ts +0 -1
- package/dist/engine/surface.js +0 -1
- package/dist/engine/timing.d.ts +0 -1
- package/dist/engine/timing.js +0 -1
- package/dist/expect/async.d.ts +0 -1
- package/dist/expect/async.js +101 -59
- package/dist/expect/attempt.d.ts +0 -1
- package/dist/expect/attempt.js +0 -1
- package/dist/expect/index.d.ts +0 -1
- package/dist/expect/index.js +0 -1
- package/dist/expect/poll-scope.d.ts +52 -0
- package/dist/expect/poll-scope.js +113 -0
- package/dist/expect/poll.d.ts +0 -1
- package/dist/expect/poll.js +31 -5
- package/dist/expect/soft.d.ts +0 -1
- package/dist/expect/soft.js +0 -1
- package/dist/expect/values.d.ts +0 -1
- package/dist/expect/values.js +11 -5
- package/dist/explore/body.d.ts +0 -1
- package/dist/explore/body.js +0 -1
- package/dist/explore/executor.d.ts +0 -1
- package/dist/explore/executor.js +0 -1
- package/dist/explore/index.d.ts +0 -1
- package/dist/explore/index.js +16 -2
- package/dist/explore/plan.d.ts +0 -1
- package/dist/explore/plan.js +0 -1
- package/dist/explore/progress.d.ts +0 -1
- package/dist/explore/progress.js +0 -1
- package/dist/explore/state.d.ts +0 -1
- package/dist/explore/state.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/internal/abandoned.d.ts +11 -0
- package/dist/internal/abandoned.js +23 -0
- package/dist/internal/ai-trace.d.ts +0 -1
- package/dist/internal/ai-trace.js +0 -1
- package/dist/internal/atomic-write.d.ts +0 -1
- package/dist/internal/atomic-write.js +0 -1
- package/dist/internal/brands.d.ts +2 -1
- package/dist/internal/brands.js +2 -1
- package/dist/internal/client-identity.d.ts +9 -0
- package/dist/internal/client-identity.js +14 -0
- package/dist/internal/debug.d.ts +0 -1
- package/dist/internal/debug.js +0 -1
- package/dist/internal/env.d.ts +0 -1
- package/dist/internal/env.js +0 -1
- package/dist/internal/errors.d.ts +0 -1
- package/dist/internal/errors.js +0 -1
- package/dist/internal/geometry.d.ts +0 -1
- package/dist/internal/geometry.js +0 -1
- package/dist/internal/git.d.ts +0 -1
- package/dist/internal/git.js +0 -1
- package/dist/internal/globs.d.ts +0 -1
- package/dist/internal/globs.js +0 -1
- package/dist/internal/ids.d.ts +0 -1
- package/dist/internal/ids.js +0 -1
- package/dist/internal/json-value.d.ts +0 -1
- package/dist/internal/json-value.js +0 -1
- package/dist/internal/keys.d.ts +0 -1
- package/dist/internal/keys.js +0 -1
- package/dist/internal/node-version.d.ts +0 -1
- package/dist/internal/node-version.js +0 -1
- package/dist/internal/objects.d.ts +0 -1
- package/dist/internal/objects.js +0 -1
- package/dist/internal/options.d.ts +0 -1
- package/dist/internal/options.js +0 -1
- package/dist/internal/package-manager.d.ts +0 -1
- package/dist/internal/package-manager.js +0 -1
- package/dist/internal/package-version.d.ts +0 -1
- package/dist/internal/package-version.js +0 -1
- package/dist/internal/paths.d.ts +0 -1
- package/dist/internal/paths.js +0 -1
- package/dist/internal/realm-slot.d.ts +0 -1
- package/dist/internal/realm-slot.js +0 -1
- package/dist/internal/recording-modes.d.ts +0 -1
- package/dist/internal/recording-modes.js +0 -1
- package/dist/internal/redact.d.ts +7 -5
- package/dist/internal/redact.js +116 -24
- package/dist/internal/regexp.d.ts +0 -1
- package/dist/internal/regexp.js +0 -1
- package/dist/internal/roles.d.ts +0 -1
- package/dist/internal/roles.js +0 -1
- package/dist/internal/skip.d.ts +0 -1
- package/dist/internal/skip.js +0 -1
- package/dist/internal/source.d.ts +0 -1
- package/dist/internal/source.js +0 -1
- package/dist/internal/standard-schema.d.ts +0 -1
- package/dist/internal/standard-schema.js +0 -1
- package/dist/internal/suggest.d.ts +0 -1
- package/dist/internal/suggest.js +0 -1
- package/dist/internal/text.d.ts +8 -1
- package/dist/internal/text.js +13 -2
- package/dist/internal/time.d.ts +6 -1
- package/dist/internal/time.js +25 -14
- package/dist/internal/urls.d.ts +9 -6
- package/dist/internal/urls.js +19 -11
- package/dist/internal/vcs.d.ts +0 -1
- package/dist/internal/vcs.js +0 -1
- package/dist/internal/zip.d.ts +0 -1
- package/dist/internal/zip.js +0 -1
- package/dist/locator/engine.d.ts +12 -3
- package/dist/locator/engine.js +8 -4
- package/dist/locator/expression.d.ts +0 -1
- package/dist/locator/expression.js +0 -1
- package/dist/locator/screen.d.ts +0 -1
- package/dist/locator/screen.js +28 -5
- package/dist/mcp/catalog.d.ts +7 -3
- package/dist/mcp/catalog.js +8 -9
- package/dist/mcp/config.d.ts +0 -1
- package/dist/mcp/config.js +0 -1
- package/dist/mcp/recording.d.ts +0 -1
- package/dist/mcp/recording.js +0 -1
- package/dist/mcp/server.d.ts +8 -1
- package/dist/mcp/server.js +8 -5
- package/dist/mcp/session.d.ts +4 -2
- package/dist/mcp/session.js +44 -22
- package/dist/mcp/sessions.d.ts +2 -1
- package/dist/mcp/sessions.js +5 -2
- package/dist/mcp/tools.d.ts +7 -6
- package/dist/mcp/tools.js +36 -11
- package/dist/mcp/usage.d.ts +61 -0
- package/dist/mcp/usage.js +73 -0
- package/dist/oauth/callback-server.d.ts +0 -1
- package/dist/oauth/callback-server.js +0 -1
- package/dist/oauth/chatgpt.d.ts +0 -1
- package/dist/oauth/chatgpt.js +3 -24
- package/dist/oauth/cli.d.ts +0 -1
- package/dist/oauth/cli.js +1 -1
- package/dist/oauth/copilot.d.ts +5 -5
- package/dist/oauth/copilot.js +80 -8
- package/dist/oauth/device-code.d.ts +0 -1
- package/dist/oauth/device-code.js +0 -1
- package/dist/oauth/errors.d.ts +0 -1
- package/dist/oauth/errors.js +0 -1
- package/dist/oauth/fetch.d.ts +0 -1
- package/dist/oauth/fetch.js +0 -1
- package/dist/oauth/grok.d.ts +0 -1
- package/dist/oauth/grok.js +2 -2
- package/dist/oauth/jwt.d.ts +0 -1
- package/dist/oauth/jwt.js +0 -1
- package/dist/oauth/login.d.ts +0 -1
- package/dist/oauth/login.js +0 -1
- package/dist/oauth/models.d.ts +0 -1
- package/dist/oauth/models.js +2 -2
- package/dist/oauth/opencode-console.d.ts +10 -0
- package/dist/oauth/opencode-console.js +133 -0
- package/dist/oauth/pkce.d.ts +0 -1
- package/dist/oauth/pkce.js +0 -1
- package/dist/oauth/providers/github-copilot.d.ts +12 -1
- package/dist/oauth/providers/github-copilot.js +80 -19
- package/dist/oauth/providers/openai.d.ts +0 -1
- package/dist/oauth/providers/openai.js +1 -2
- package/dist/oauth/providers/opencode-console.d.ts +31 -0
- package/dist/oauth/providers/opencode-console.js +148 -0
- package/dist/oauth/providers/xai.d.ts +0 -1
- package/dist/oauth/providers/xai.js +0 -1
- package/dist/oauth/providers.d.ts +2 -7
- package/dist/oauth/providers.js +3 -8
- package/dist/oauth/responses.d.ts +9 -0
- package/dist/oauth/responses.js +23 -0
- package/dist/oauth/sse.d.ts +0 -1
- package/dist/oauth/sse.js +0 -1
- package/dist/oauth/store.d.ts +0 -1
- package/dist/oauth/store.js +0 -1
- package/dist/oauth/token-endpoint.d.ts +0 -1
- package/dist/oauth/token-endpoint.js +0 -1
- package/dist/oauth/types.d.ts +0 -1
- package/dist/oauth/types.js +0 -1
- package/dist/params.d.ts +0 -1
- package/dist/params.js +0 -1
- package/dist/report/build.d.ts +26 -1
- package/dist/report/build.js +16 -9
- package/dist/report/builtin.d.ts +0 -1
- package/dist/report/builtin.js +0 -1
- package/dist/report/code-frame.d.ts +0 -1
- package/dist/report/code-frame.js +0 -1
- package/dist/report/debug-steps.d.ts +0 -1
- package/dist/report/debug-steps.js +0 -1
- package/dist/report/explore-text.d.ts +0 -1
- package/dist/report/explore-text.js +0 -1
- package/dist/report/failure-text.d.ts +6 -2
- package/dist/report/failure-text.js +14 -5
- package/dist/report/format.d.ts +10 -6
- package/dist/report/format.js +12 -6
- package/dist/report/json.d.ts +0 -1
- package/dist/report/json.js +0 -1
- package/dist/report/junit.d.ts +0 -1
- package/dist/report/junit.js +11 -13
- package/dist/report/list-explore.d.ts +0 -1
- package/dist/report/list-explore.js +0 -1
- package/dist/report/list-model.d.ts +0 -1
- package/dist/report/list-model.js +0 -1
- package/dist/report/list-steps.d.ts +0 -1
- package/dist/report/list-steps.js +0 -1
- package/dist/report/list.d.ts +1 -1
- package/dist/report/list.js +38 -19
- package/dist/report/live-window.d.ts +0 -1
- package/dist/report/live-window.js +0 -1
- package/dist/report/markdown-text.d.ts +0 -1
- package/dist/report/markdown-text.js +0 -1
- package/dist/report/markdown.d.ts +1 -2
- package/dist/report/markdown.js +37 -15
- package/dist/report/outcome.d.ts +0 -1
- package/dist/report/outcome.js +0 -1
- package/dist/report/repeats.d.ts +6 -2
- package/dist/report/repeats.js +12 -4
- package/dist/report/running-tree.d.ts +0 -1
- package/dist/report/running-tree.js +0 -1
- package/dist/report/write.d.ts +0 -1
- package/dist/report/write.js +0 -1
- package/dist/run/app-ports.d.ts +0 -1
- package/dist/run/app-ports.js +0 -1
- package/dist/run/artifacts.d.ts +18 -1
- package/dist/run/artifacts.js +68 -2
- package/dist/run/budget.d.ts +0 -1
- package/dist/run/budget.js +0 -1
- package/dist/run/declared-processes.d.ts +0 -1
- package/dist/run/declared-processes.js +0 -1
- package/dist/run/events.d.ts +0 -1
- package/dist/run/events.js +0 -1
- package/dist/run/execute.d.ts +9 -1
- package/dist/run/execute.js +55 -29
- package/dist/run/extended-fixtures.d.ts +0 -1
- package/dist/run/extended-fixtures.js +6 -3
- package/dist/run/failure-evidence.d.ts +0 -1
- package/dist/run/failure-evidence.js +4 -3
- package/dist/run/fixture-recording.d.ts +0 -1
- package/dist/run/fixture-recording.js +0 -1
- package/dist/run/fixtures.d.ts +0 -1
- package/dist/run/fixtures.js +6 -9
- package/dist/run/in-process.d.ts +2 -1
- package/dist/run/in-process.js +1 -1
- package/dist/run/last-run.d.ts +42 -9
- package/dist/run/last-run.js +121 -15
- package/dist/run/managed-process.d.ts +0 -1
- package/dist/run/managed-process.js +0 -1
- package/dist/run/output.d.ts +0 -1
- package/dist/run/output.js +0 -1
- package/dist/run/process-pool.d.ts +0 -1
- package/dist/run/process-pool.js +0 -1
- package/dist/run/provision.d.ts +0 -1
- package/dist/run/provision.js +0 -1
- package/dist/run/realm.d.ts +6 -2
- package/dist/run/realm.js +21 -8
- package/dist/run/records.d.ts +16 -1
- package/dist/run/records.js +26 -1
- package/dist/run/retry.d.ts +3 -2
- package/dist/run/retry.js +4 -3
- package/dist/run/runner.d.ts +3 -2
- package/dist/run/runner.js +70 -32
- package/dist/run/scheduler.d.ts +0 -1
- package/dist/run/scheduler.js +0 -1
- package/dist/run/secrecy.d.ts +15 -1
- package/dist/run/secrecy.js +27 -2
- package/dist/run/serial.d.ts +2 -1
- package/dist/run/serial.js +8 -6
- package/dist/run/sessions.d.ts +0 -1
- package/dist/run/sessions.js +0 -1
- package/dist/run/standalone.d.ts +0 -1
- package/dist/run/standalone.js +3 -3
- package/dist/run/steps.d.ts +2 -9
- package/dist/run/steps.js +7 -22
- package/dist/run/trace-redaction.d.ts +0 -1
- package/dist/run/trace-redaction.js +0 -1
- package/dist/run/unit-runner.d.ts +0 -1
- package/dist/run/unit-runner.js +0 -1
- package/dist/run/units.d.ts +0 -1
- package/dist/run/units.js +0 -1
- package/dist/run/worker/entry.d.ts +0 -1
- package/dist/run/worker/entry.js +7 -7
- package/dist/run/worker/handle.d.ts +0 -1
- package/dist/run/worker/handle.js +0 -1
- package/dist/run/worker/protocol.d.ts +2 -1
- package/dist/run/worker/protocol.js +0 -1
- package/dist/run/worker/session.d.ts +2 -1
- package/dist/run/worker/session.js +1 -1
- package/dist/run/worker-models.d.ts +0 -1
- package/dist/run/worker-models.js +0 -1
- package/dist/secrets.d.ts +0 -1
- package/dist/secrets.js +0 -1
- package/dist/telemetry/checkout.d.ts +0 -1
- package/dist/telemetry/checkout.js +0 -1
- package/dist/telemetry/environment.d.ts +0 -1
- package/dist/telemetry/environment.js +0 -1
- package/dist/telemetry/events.d.ts +26 -10
- package/dist/telemetry/events.js +108 -13
- package/dist/telemetry/failure-kind.d.ts +0 -1
- package/dist/telemetry/failure-kind.js +0 -1
- package/dist/telemetry/posthog.d.ts +0 -1
- package/dist/telemetry/posthog.js +0 -1
- package/dist/telemetry/project.d.ts +0 -1
- package/dist/telemetry/project.js +0 -1
- package/dist/telemetry/store.d.ts +0 -1
- package/dist/telemetry/store.js +0 -1
- package/dist/telemetry/telemetry.d.ts +19 -8
- package/dist/telemetry/telemetry.js +26 -9
- package/dist/telemetry/token.d.ts +0 -1
- package/dist/telemetry/token.js +0 -1
- package/dist/types.d.ts +34 -26
- package/dist/types.js +0 -1
- package/docs/agents.mdx +6 -3
- package/docs/assertions.mdx +94 -0
- package/docs/authentication.mdx +3 -1
- package/docs/browser.mdx +42 -6
- package/docs/cache.mdx +64 -18
- package/docs/ci.mdx +11 -7
- package/docs/debugging.mdx +6 -3
- package/docs/executors.mdx +5 -3
- package/docs/github.mdx +12 -4
- package/docs/{writing-tests.mdx → goals.mdx} +21 -101
- package/docs/index.mdx +4 -4
- package/docs/integrations/kernel.mdx +1 -1
- package/docs/locators.mdx +64 -0
- package/docs/migrate/cypress.mdx +2 -2
- package/docs/migrate/maestro.mdx +2 -2
- package/docs/migrate/playwright.mdx +22 -16
- package/docs/migrate/selenium.mdx +2 -2
- package/docs/mobile.mdx +61 -4
- package/docs/models.mdx +53 -7
- package/docs/physical-devices.mdx +76 -0
- package/docs/quickstart.mdx +4 -3
- package/docs/reference/app.mdx +1 -1
- package/docs/reference/cli.mdx +30 -11
- package/docs/reference/config.mdx +25 -7
- package/docs/reference/engine.mdx +4 -3
- package/docs/reference/environment.mdx +8 -1
- package/docs/reference/errors.mdx +5 -5
- package/docs/reference/expect.mdx +79 -24
- package/docs/reference/mcp.mdx +3 -0
- package/docs/reference/mobile.mdx +23 -13
- package/docs/reference/reporters.mdx +8 -2
- package/docs/reference/screen.mdx +30 -7
- package/docs/reference/test.mdx +11 -4
- package/docs/reference/web.mdx +131 -23
- package/docs/security.mdx +45 -19
- package/docs/subscriptions.mdx +97 -9
- package/docs/telemetry.mdx +48 -6
- package/package.json +18 -4
- package/schema/report-v1.schema.json +14 -1
- package/skills/e2e/SKILL.md +2 -2
- package/skills/e2e/references/agent.md +22 -11
- package/skills/e2e/references/debugging.md +4 -4
- package/skills/e2e/references/mcp.md +3 -0
- package/skills/e2e/references/running.md +13 -8
- package/skills/e2e/references/setup.md +42 -15
- package/skills/e2e/references/writing-tests.md +43 -15
- package/dist/agent/act-validation.d.ts.map +0 -1
- package/dist/agent/act-validation.js.map +0 -1
- package/dist/agent/act.d.ts.map +0 -1
- package/dist/agent/act.js.map +0 -1
- package/dist/agent/action-dispatcher.d.ts.map +0 -1
- package/dist/agent/action-dispatcher.js.map +0 -1
- package/dist/agent/action-names.d.ts.map +0 -1
- package/dist/agent/action-names.js.map +0 -1
- package/dist/agent/actions.d.ts.map +0 -1
- package/dist/agent/actions.js.map +0 -1
- package/dist/agent/agent-brand.d.ts.map +0 -1
- package/dist/agent/agent-brand.js.map +0 -1
- package/dist/agent/ai-sdk.d.ts.map +0 -1
- package/dist/agent/ai-sdk.js.map +0 -1
- package/dist/agent/call-options.d.ts.map +0 -1
- package/dist/agent/call-options.js.map +0 -1
- package/dist/agent/default-agent.d.ts.map +0 -1
- package/dist/agent/default-agent.js.map +0 -1
- package/dist/agent/derived.d.ts.map +0 -1
- package/dist/agent/derived.js.map +0 -1
- package/dist/agent/error.d.ts.map +0 -1
- package/dist/agent/error.js.map +0 -1
- package/dist/agent/executor.d.ts.map +0 -1
- package/dist/agent/executor.js.map +0 -1
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/interactive-step.d.ts.map +0 -1
- package/dist/agent/interactive-step.js.map +0 -1
- package/dist/agent/invocation.d.ts.map +0 -1
- package/dist/agent/invocation.js.map +0 -1
- package/dist/agent/ledger.d.ts.map +0 -1
- package/dist/agent/ledger.js.map +0 -1
- package/dist/agent/loop-guards.d.ts.map +0 -1
- package/dist/agent/loop-guards.js.map +0 -1
- package/dist/agent/model/adapter.d.ts.map +0 -1
- package/dist/agent/model/adapter.js.map +0 -1
- package/dist/agent/model/overflow.d.ts.map +0 -1
- package/dist/agent/model/overflow.js.map +0 -1
- package/dist/agent/model/provider-hints.d.ts.map +0 -1
- package/dist/agent/model/provider-hints.js.map +0 -1
- package/dist/agent/model/schema.d.ts.map +0 -1
- package/dist/agent/model/schema.js.map +0 -1
- package/dist/agent/model/sdk.d.ts.map +0 -1
- package/dist/agent/model/sdk.js.map +0 -1
- package/dist/agent/model/stall.d.ts.map +0 -1
- package/dist/agent/model/stall.js.map +0 -1
- package/dist/agent/model/tool-choice.d.ts.map +0 -1
- package/dist/agent/model/tool-choice.js.map +0 -1
- package/dist/agent/observation-budget.d.ts.map +0 -1
- package/dist/agent/observation-budget.js.map +0 -1
- package/dist/agent/observation-feed.d.ts.map +0 -1
- package/dist/agent/observation-feed.js.map +0 -1
- package/dist/agent/observation.d.ts.map +0 -1
- package/dist/agent/observation.js.map +0 -1
- package/dist/agent/operation-queue.d.ts.map +0 -1
- package/dist/agent/operation-queue.js.map +0 -1
- package/dist/agent/phases.d.ts.map +0 -1
- package/dist/agent/phases.js.map +0 -1
- package/dist/agent/pixels.d.ts.map +0 -1
- package/dist/agent/pixels.js.map +0 -1
- package/dist/agent/point-tap.d.ts.map +0 -1
- package/dist/agent/point-tap.js.map +0 -1
- package/dist/agent/primitives.d.ts.map +0 -1
- package/dist/agent/primitives.js.map +0 -1
- package/dist/agent/prompts.d.ts.map +0 -1
- package/dist/agent/prompts.js.map +0 -1
- package/dist/agent/protocol.d.ts.map +0 -1
- package/dist/agent/protocol.js.map +0 -1
- package/dist/agent/public.d.ts.map +0 -1
- package/dist/agent/public.js.map +0 -1
- package/dist/agent/reading.d.ts.map +0 -1
- package/dist/agent/reading.js.map +0 -1
- package/dist/agent/replay.d.ts.map +0 -1
- package/dist/agent/replay.js.map +0 -1
- package/dist/agent/screen-update.d.ts.map +0 -1
- package/dist/agent/screen-update.js.map +0 -1
- package/dist/agent/scroll-target.d.ts.map +0 -1
- package/dist/agent/scroll-target.js.map +0 -1
- package/dist/agent/secrets.d.ts.map +0 -1
- package/dist/agent/secrets.js.map +0 -1
- package/dist/agent/settle-policy.d.ts.map +0 -1
- package/dist/agent/settle-policy.js.map +0 -1
- package/dist/agent/step-accounting.d.ts.map +0 -1
- package/dist/agent/step-accounting.js.map +0 -1
- package/dist/agent/step-cache.d.ts.map +0 -1
- package/dist/agent/step-cache.js.map +0 -1
- package/dist/agent/tool-loop.d.ts.map +0 -1
- package/dist/agent/tool-loop.js.map +0 -1
- package/dist/agent/tool-output.d.ts.map +0 -1
- package/dist/agent/tool-output.js.map +0 -1
- package/dist/agent/tool.d.ts.map +0 -1
- package/dist/agent/tool.js.map +0 -1
- package/dist/agent/transcript-compaction.d.ts.map +0 -1
- package/dist/agent/transcript-compaction.js.map +0 -1
- package/dist/agent/upload-paths.d.ts.map +0 -1
- package/dist/agent/upload-paths.js.map +0 -1
- package/dist/agent/usage.d.ts.map +0 -1
- package/dist/agent/usage.js.map +0 -1
- package/dist/cache/anchors.d.ts.map +0 -1
- package/dist/cache/anchors.js.map +0 -1
- package/dist/cache/context.d.ts.map +0 -1
- package/dist/cache/context.js.map +0 -1
- package/dist/cache/decide.d.ts.map +0 -1
- package/dist/cache/decide.js.map +0 -1
- package/dist/cache/identity.d.ts.map +0 -1
- package/dist/cache/identity.js.map +0 -1
- package/dist/cache/recorder.d.ts.map +0 -1
- package/dist/cache/recorder.js.map +0 -1
- package/dist/cache/relocate.d.ts.map +0 -1
- package/dist/cache/relocate.js.map +0 -1
- package/dist/cache/route.d.ts.map +0 -1
- package/dist/cache/route.js.map +0 -1
- package/dist/cache/store.d.ts.map +0 -1
- package/dist/cache/store.js.map +0 -1
- package/dist/cache/template.d.ts.map +0 -1
- package/dist/cache/template.js.map +0 -1
- package/dist/cache/trace.d.ts.map +0 -1
- package/dist/cache/trace.js.map +0 -1
- package/dist/cli/bin.d.ts.map +0 -1
- package/dist/cli/bin.js.map +0 -1
- package/dist/cli/cache.d.ts.map +0 -1
- package/dist/cli/cache.js.map +0 -1
- package/dist/cli/docs-url.d.ts.map +0 -1
- package/dist/cli/docs-url.js.map +0 -1
- package/dist/cli/feedback.d.ts.map +0 -1
- package/dist/cli/feedback.js.map +0 -1
- package/dist/cli/guide.d.ts.map +0 -1
- package/dist/cli/guide.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/init/agent-skill.d.ts.map +0 -1
- package/dist/cli/init/agent-skill.js.map +0 -1
- package/dist/cli/init/engines.d.ts.map +0 -1
- package/dist/cli/init/engines.js.map +0 -1
- package/dist/cli/init/gateways.d.ts.map +0 -1
- package/dist/cli/init/gateways.js.map +0 -1
- package/dist/cli/init/mcp-config.d.ts.map +0 -1
- package/dist/cli/init/mcp-config.js.map +0 -1
- package/dist/cli/init/package.d.ts.map +0 -1
- package/dist/cli/init/package.js.map +0 -1
- package/dist/cli/init/scaffold.d.ts.map +0 -1
- package/dist/cli/init/scaffold.js.map +0 -1
- package/dist/cli/init/versions.d.ts.map +0 -1
- package/dist/cli/init/versions.js.map +0 -1
- package/dist/cli/init.d.ts.map +0 -1
- package/dist/cli/init.js.map +0 -1
- package/dist/cli/mcp.d.ts.map +0 -1
- package/dist/cli/mcp.js.map +0 -1
- package/dist/cli/signals.d.ts.map +0 -1
- package/dist/cli/signals.js.map +0 -1
- package/dist/cli/skill.d.ts.map +0 -1
- package/dist/cli/skill.js.map +0 -1
- package/dist/cli/telemetry.d.ts.map +0 -1
- package/dist/cli/telemetry.js.map +0 -1
- package/dist/cli/wordmark.d.ts.map +0 -1
- package/dist/cli/wordmark.js.map +0 -1
- package/dist/collect/collect.d.ts.map +0 -1
- package/dist/collect/collect.js.map +0 -1
- package/dist/collect/registry.d.ts.map +0 -1
- package/dist/collect/registry.js.map +0 -1
- package/dist/collect/select.d.ts.map +0 -1
- package/dist/collect/select.js.map +0 -1
- package/dist/config/agent.d.ts.map +0 -1
- package/dist/config/agent.js.map +0 -1
- package/dist/config/app.d.ts.map +0 -1
- package/dist/config/app.js.map +0 -1
- package/dist/config/command.d.ts.map +0 -1
- package/dist/config/command.js.map +0 -1
- package/dist/config/diagnose.d.ts.map +0 -1
- package/dist/config/diagnose.js.map +0 -1
- package/dist/config/esm-hooks.d.ts.map +0 -1
- package/dist/config/esm-hooks.js.map +0 -1
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js.map +0 -1
- package/dist/config/resolve.d.ts.map +0 -1
- package/dist/config/resolve.js.map +0 -1
- package/dist/config/secrets.d.ts.map +0 -1
- package/dist/config/secrets.js.map +0 -1
- package/dist/config/targets.d.ts.map +0 -1
- package/dist/config/targets.js.map +0 -1
- package/dist/config/validate.d.ts.map +0 -1
- package/dist/config/validate.js.map +0 -1
- package/dist/engine/contract.d.ts.map +0 -1
- package/dist/engine/contract.js.map +0 -1
- package/dist/engine/index.d.ts.map +0 -1
- package/dist/engine/index.js.map +0 -1
- package/dist/engine/manifest.d.ts.map +0 -1
- package/dist/engine/manifest.js.map +0 -1
- package/dist/engine/recording.d.ts.map +0 -1
- package/dist/engine/recording.js.map +0 -1
- package/dist/engine/resolve.d.ts.map +0 -1
- package/dist/engine/resolve.js.map +0 -1
- package/dist/engine/session.d.ts.map +0 -1
- package/dist/engine/session.js.map +0 -1
- package/dist/engine/surface.d.ts.map +0 -1
- package/dist/engine/surface.js.map +0 -1
- package/dist/engine/timing.d.ts.map +0 -1
- package/dist/engine/timing.js.map +0 -1
- package/dist/expect/async.d.ts.map +0 -1
- package/dist/expect/async.js.map +0 -1
- package/dist/expect/attempt.d.ts.map +0 -1
- package/dist/expect/attempt.js.map +0 -1
- package/dist/expect/index.d.ts.map +0 -1
- package/dist/expect/index.js.map +0 -1
- package/dist/expect/poll.d.ts.map +0 -1
- package/dist/expect/poll.js.map +0 -1
- package/dist/expect/soft.d.ts.map +0 -1
- package/dist/expect/soft.js.map +0 -1
- package/dist/expect/values.d.ts.map +0 -1
- package/dist/expect/values.js.map +0 -1
- package/dist/explore/body.d.ts.map +0 -1
- package/dist/explore/body.js.map +0 -1
- package/dist/explore/executor.d.ts.map +0 -1
- package/dist/explore/executor.js.map +0 -1
- package/dist/explore/index.d.ts.map +0 -1
- package/dist/explore/index.js.map +0 -1
- package/dist/explore/plan.d.ts.map +0 -1
- package/dist/explore/plan.js.map +0 -1
- package/dist/explore/progress.d.ts.map +0 -1
- package/dist/explore/progress.js.map +0 -1
- package/dist/explore/state.d.ts.map +0 -1
- package/dist/explore/state.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/ai-trace.d.ts.map +0 -1
- package/dist/internal/ai-trace.js.map +0 -1
- package/dist/internal/atomic-write.d.ts.map +0 -1
- package/dist/internal/atomic-write.js.map +0 -1
- package/dist/internal/brands.d.ts.map +0 -1
- package/dist/internal/brands.js.map +0 -1
- package/dist/internal/debug.d.ts.map +0 -1
- package/dist/internal/debug.js.map +0 -1
- package/dist/internal/env.d.ts.map +0 -1
- package/dist/internal/env.js.map +0 -1
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/errors.js.map +0 -1
- package/dist/internal/geometry.d.ts.map +0 -1
- package/dist/internal/geometry.js.map +0 -1
- package/dist/internal/git.d.ts.map +0 -1
- package/dist/internal/git.js.map +0 -1
- package/dist/internal/globs.d.ts.map +0 -1
- package/dist/internal/globs.js.map +0 -1
- package/dist/internal/ids.d.ts.map +0 -1
- package/dist/internal/ids.js.map +0 -1
- package/dist/internal/json-value.d.ts.map +0 -1
- package/dist/internal/json-value.js.map +0 -1
- package/dist/internal/keys.d.ts.map +0 -1
- package/dist/internal/keys.js.map +0 -1
- package/dist/internal/node-version.d.ts.map +0 -1
- package/dist/internal/node-version.js.map +0 -1
- package/dist/internal/objects.d.ts.map +0 -1
- package/dist/internal/objects.js.map +0 -1
- package/dist/internal/options.d.ts.map +0 -1
- package/dist/internal/options.js.map +0 -1
- package/dist/internal/package-manager.d.ts.map +0 -1
- package/dist/internal/package-manager.js.map +0 -1
- package/dist/internal/package-version.d.ts.map +0 -1
- package/dist/internal/package-version.js.map +0 -1
- package/dist/internal/paths.d.ts.map +0 -1
- package/dist/internal/paths.js.map +0 -1
- package/dist/internal/realm-slot.d.ts.map +0 -1
- package/dist/internal/realm-slot.js.map +0 -1
- package/dist/internal/recording-modes.d.ts.map +0 -1
- package/dist/internal/recording-modes.js.map +0 -1
- package/dist/internal/redact.d.ts.map +0 -1
- package/dist/internal/redact.js.map +0 -1
- package/dist/internal/regexp.d.ts.map +0 -1
- package/dist/internal/regexp.js.map +0 -1
- package/dist/internal/roles.d.ts.map +0 -1
- package/dist/internal/roles.js.map +0 -1
- package/dist/internal/skip.d.ts.map +0 -1
- package/dist/internal/skip.js.map +0 -1
- package/dist/internal/source.d.ts.map +0 -1
- package/dist/internal/source.js.map +0 -1
- package/dist/internal/standard-schema.d.ts.map +0 -1
- package/dist/internal/standard-schema.js.map +0 -1
- package/dist/internal/suggest.d.ts.map +0 -1
- package/dist/internal/suggest.js.map +0 -1
- package/dist/internal/text.d.ts.map +0 -1
- package/dist/internal/text.js.map +0 -1
- package/dist/internal/time.d.ts.map +0 -1
- package/dist/internal/time.js.map +0 -1
- package/dist/internal/urls.d.ts.map +0 -1
- package/dist/internal/urls.js.map +0 -1
- package/dist/internal/vcs.d.ts.map +0 -1
- package/dist/internal/vcs.js.map +0 -1
- package/dist/internal/zip.d.ts.map +0 -1
- package/dist/internal/zip.js.map +0 -1
- package/dist/locator/engine.d.ts.map +0 -1
- package/dist/locator/engine.js.map +0 -1
- package/dist/locator/expression.d.ts.map +0 -1
- package/dist/locator/expression.js.map +0 -1
- package/dist/locator/screen.d.ts.map +0 -1
- package/dist/locator/screen.js.map +0 -1
- package/dist/mcp/catalog.d.ts.map +0 -1
- package/dist/mcp/catalog.js.map +0 -1
- package/dist/mcp/config.d.ts.map +0 -1
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/recording.d.ts.map +0 -1
- package/dist/mcp/recording.js.map +0 -1
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/session.d.ts.map +0 -1
- package/dist/mcp/session.js.map +0 -1
- package/dist/mcp/sessions.d.ts.map +0 -1
- package/dist/mcp/sessions.js.map +0 -1
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js.map +0 -1
- package/dist/oauth/callback-server.d.ts.map +0 -1
- package/dist/oauth/callback-server.js.map +0 -1
- package/dist/oauth/chatgpt.d.ts.map +0 -1
- package/dist/oauth/chatgpt.js.map +0 -1
- package/dist/oauth/cli.d.ts.map +0 -1
- package/dist/oauth/cli.js.map +0 -1
- package/dist/oauth/copilot.d.ts.map +0 -1
- package/dist/oauth/copilot.js.map +0 -1
- package/dist/oauth/device-code.d.ts.map +0 -1
- package/dist/oauth/device-code.js.map +0 -1
- package/dist/oauth/errors.d.ts.map +0 -1
- package/dist/oauth/errors.js.map +0 -1
- package/dist/oauth/fetch.d.ts.map +0 -1
- package/dist/oauth/fetch.js.map +0 -1
- package/dist/oauth/grok.d.ts.map +0 -1
- package/dist/oauth/grok.js.map +0 -1
- package/dist/oauth/jwt.d.ts.map +0 -1
- package/dist/oauth/jwt.js.map +0 -1
- package/dist/oauth/login.d.ts.map +0 -1
- package/dist/oauth/login.js.map +0 -1
- package/dist/oauth/models.d.ts.map +0 -1
- package/dist/oauth/models.js.map +0 -1
- package/dist/oauth/pkce.d.ts.map +0 -1
- package/dist/oauth/pkce.js.map +0 -1
- package/dist/oauth/providers/github-copilot.d.ts.map +0 -1
- package/dist/oauth/providers/github-copilot.js.map +0 -1
- package/dist/oauth/providers/openai.d.ts.map +0 -1
- package/dist/oauth/providers/openai.js.map +0 -1
- package/dist/oauth/providers/xai.d.ts.map +0 -1
- package/dist/oauth/providers/xai.js.map +0 -1
- package/dist/oauth/providers.d.ts.map +0 -1
- package/dist/oauth/providers.js.map +0 -1
- package/dist/oauth/sse.d.ts.map +0 -1
- package/dist/oauth/sse.js.map +0 -1
- package/dist/oauth/store.d.ts.map +0 -1
- package/dist/oauth/store.js.map +0 -1
- package/dist/oauth/token-endpoint.d.ts.map +0 -1
- package/dist/oauth/token-endpoint.js.map +0 -1
- package/dist/oauth/types.d.ts.map +0 -1
- package/dist/oauth/types.js.map +0 -1
- package/dist/params.d.ts.map +0 -1
- package/dist/params.js.map +0 -1
- package/dist/report/build.d.ts.map +0 -1
- package/dist/report/build.js.map +0 -1
- package/dist/report/builtin.d.ts.map +0 -1
- package/dist/report/builtin.js.map +0 -1
- package/dist/report/code-frame.d.ts.map +0 -1
- package/dist/report/code-frame.js.map +0 -1
- package/dist/report/debug-steps.d.ts.map +0 -1
- package/dist/report/debug-steps.js.map +0 -1
- package/dist/report/explore-text.d.ts.map +0 -1
- package/dist/report/explore-text.js.map +0 -1
- package/dist/report/failure-text.d.ts.map +0 -1
- package/dist/report/failure-text.js.map +0 -1
- package/dist/report/format.d.ts.map +0 -1
- package/dist/report/format.js.map +0 -1
- package/dist/report/json.d.ts.map +0 -1
- package/dist/report/json.js.map +0 -1
- package/dist/report/junit.d.ts.map +0 -1
- package/dist/report/junit.js.map +0 -1
- package/dist/report/list-explore.d.ts.map +0 -1
- package/dist/report/list-explore.js.map +0 -1
- package/dist/report/list-model.d.ts.map +0 -1
- package/dist/report/list-model.js.map +0 -1
- package/dist/report/list-steps.d.ts.map +0 -1
- package/dist/report/list-steps.js.map +0 -1
- package/dist/report/list.d.ts.map +0 -1
- package/dist/report/list.js.map +0 -1
- package/dist/report/live-window.d.ts.map +0 -1
- package/dist/report/live-window.js.map +0 -1
- package/dist/report/markdown-text.d.ts.map +0 -1
- package/dist/report/markdown-text.js.map +0 -1
- package/dist/report/markdown.d.ts.map +0 -1
- package/dist/report/markdown.js.map +0 -1
- package/dist/report/outcome.d.ts.map +0 -1
- package/dist/report/outcome.js.map +0 -1
- package/dist/report/repeats.d.ts.map +0 -1
- package/dist/report/repeats.js.map +0 -1
- package/dist/report/running-tree.d.ts.map +0 -1
- package/dist/report/running-tree.js.map +0 -1
- package/dist/report/write.d.ts.map +0 -1
- package/dist/report/write.js.map +0 -1
- package/dist/run/app-ports.d.ts.map +0 -1
- package/dist/run/app-ports.js.map +0 -1
- package/dist/run/artifacts.d.ts.map +0 -1
- package/dist/run/artifacts.js.map +0 -1
- package/dist/run/budget.d.ts.map +0 -1
- package/dist/run/budget.js.map +0 -1
- package/dist/run/declared-processes.d.ts.map +0 -1
- package/dist/run/declared-processes.js.map +0 -1
- package/dist/run/events.d.ts.map +0 -1
- package/dist/run/events.js.map +0 -1
- package/dist/run/execute.d.ts.map +0 -1
- package/dist/run/execute.js.map +0 -1
- package/dist/run/extended-fixtures.d.ts.map +0 -1
- package/dist/run/extended-fixtures.js.map +0 -1
- package/dist/run/failure-evidence.d.ts.map +0 -1
- package/dist/run/failure-evidence.js.map +0 -1
- package/dist/run/fixture-recording.d.ts.map +0 -1
- package/dist/run/fixture-recording.js.map +0 -1
- package/dist/run/fixtures.d.ts.map +0 -1
- package/dist/run/fixtures.js.map +0 -1
- package/dist/run/in-process.d.ts.map +0 -1
- package/dist/run/in-process.js.map +0 -1
- package/dist/run/last-run.d.ts.map +0 -1
- package/dist/run/last-run.js.map +0 -1
- package/dist/run/managed-process.d.ts.map +0 -1
- package/dist/run/managed-process.js.map +0 -1
- package/dist/run/output.d.ts.map +0 -1
- package/dist/run/output.js.map +0 -1
- package/dist/run/process-pool.d.ts.map +0 -1
- package/dist/run/process-pool.js.map +0 -1
- package/dist/run/provision.d.ts.map +0 -1
- package/dist/run/provision.js.map +0 -1
- package/dist/run/realm.d.ts.map +0 -1
- package/dist/run/realm.js.map +0 -1
- package/dist/run/records.d.ts.map +0 -1
- package/dist/run/records.js.map +0 -1
- package/dist/run/retry.d.ts.map +0 -1
- package/dist/run/retry.js.map +0 -1
- package/dist/run/runner.d.ts.map +0 -1
- package/dist/run/runner.js.map +0 -1
- package/dist/run/scheduler.d.ts.map +0 -1
- package/dist/run/scheduler.js.map +0 -1
- package/dist/run/secrecy.d.ts.map +0 -1
- package/dist/run/secrecy.js.map +0 -1
- package/dist/run/serial.d.ts.map +0 -1
- package/dist/run/serial.js.map +0 -1
- package/dist/run/sessions.d.ts.map +0 -1
- package/dist/run/sessions.js.map +0 -1
- package/dist/run/standalone.d.ts.map +0 -1
- package/dist/run/standalone.js.map +0 -1
- package/dist/run/steps.d.ts.map +0 -1
- package/dist/run/steps.js.map +0 -1
- package/dist/run/trace-redaction.d.ts.map +0 -1
- package/dist/run/trace-redaction.js.map +0 -1
- package/dist/run/unit-runner.d.ts.map +0 -1
- package/dist/run/unit-runner.js.map +0 -1
- package/dist/run/units.d.ts.map +0 -1
- package/dist/run/units.js.map +0 -1
- package/dist/run/worker/entry.d.ts.map +0 -1
- package/dist/run/worker/entry.js.map +0 -1
- package/dist/run/worker/handle.d.ts.map +0 -1
- package/dist/run/worker/handle.js.map +0 -1
- package/dist/run/worker/protocol.d.ts.map +0 -1
- package/dist/run/worker/protocol.js.map +0 -1
- package/dist/run/worker/session.d.ts.map +0 -1
- package/dist/run/worker/session.js.map +0 -1
- package/dist/run/worker-models.d.ts.map +0 -1
- package/dist/run/worker-models.js.map +0 -1
- package/dist/secrets.d.ts.map +0 -1
- package/dist/secrets.js.map +0 -1
- package/dist/telemetry/checkout.d.ts.map +0 -1
- package/dist/telemetry/checkout.js.map +0 -1
- package/dist/telemetry/environment.d.ts.map +0 -1
- package/dist/telemetry/environment.js.map +0 -1
- package/dist/telemetry/events.d.ts.map +0 -1
- package/dist/telemetry/events.js.map +0 -1
- package/dist/telemetry/failure-kind.d.ts.map +0 -1
- package/dist/telemetry/failure-kind.js.map +0 -1
- package/dist/telemetry/posthog.d.ts.map +0 -1
- package/dist/telemetry/posthog.js.map +0 -1
- package/dist/telemetry/project.d.ts.map +0 -1
- package/dist/telemetry/project.js.map +0 -1
- package/dist/telemetry/store.d.ts.map +0 -1
- package/dist/telemetry/store.js.map +0 -1
- package/dist/telemetry/telemetry.d.ts.map +0 -1
- package/dist/telemetry/telemetry.js.map +0 -1
- package/dist/telemetry/token.d.ts.map +0 -1
- package/dist/telemetry/token.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `opencodeConsole('deepseek-v4.1-flash')`: an OpenCode Console workspace as
|
|
3
|
+
* an AI SDK model, Zen for a bare id and Go for a `go/` one. The first call
|
|
4
|
+
* reads the workspace config for the model's protocol and lazily loads the
|
|
5
|
+
* SDK for it. Requests get the prompt-cache hints the runner itself adds for
|
|
6
|
+
* OpenAI and Anthropic, which it cannot do here since the protocol is unknown
|
|
7
|
+
* until then. `OPENCODE_API_KEY` replaces the stored login when set.
|
|
8
|
+
*/
|
|
9
|
+
import { randomUUID } from 'node:crypto';
|
|
10
|
+
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
11
|
+
import { promptCacheKey } from '../agent/model/provider-hints.js';
|
|
12
|
+
import { OAuthError } from './errors.js';
|
|
13
|
+
import { createOAuthFetch } from './fetch.js';
|
|
14
|
+
import { USER_AGENT } from '../internal/client-identity.js';
|
|
15
|
+
import { loginHint } from './providers.js';
|
|
16
|
+
import { createOpencodeConsoleProvider, opencodeConsoleChatRoute, opencodeConsoleRouteFor } from './providers/opencode-console.js';
|
|
17
|
+
import { EnvCredentialStore, defaultCredentialStore } from './store.js';
|
|
18
|
+
const CONFIG_TIMEOUT_MS = 10_000;
|
|
19
|
+
const API_KEY_ENV = 'OPENCODE_API_KEY';
|
|
20
|
+
const BREAKPOINT = { cacheControl: { type: 'ephemeral' } };
|
|
21
|
+
export function opencodeConsole(modelId) {
|
|
22
|
+
const apiKey = process.env[API_KEY_ENV]?.trim();
|
|
23
|
+
const fetch = createOAuthFetch(createOpencodeConsoleProvider(), {
|
|
24
|
+
store: apiKey ? apiKeyStore(apiKey) : defaultCredentialStore(),
|
|
25
|
+
userAgent: USER_AGENT,
|
|
26
|
+
loginHint: apiKey ? `check ${API_KEY_ENV}` : loginHint('opencode-console'),
|
|
27
|
+
});
|
|
28
|
+
// One per model, so a worker's calls stay on one upstream and its cache.
|
|
29
|
+
const session = `e2e_${randomUUID()}`;
|
|
30
|
+
const chatRoute = opencodeConsoleChatRoute(modelId);
|
|
31
|
+
const chat = { npm: chatRoute.npm, model: chatModel(chatRoute, fetch, session) };
|
|
32
|
+
let resolved;
|
|
33
|
+
let pending;
|
|
34
|
+
// An unreadable config sends that call over chat and is asked again next time.
|
|
35
|
+
const served = () => {
|
|
36
|
+
if (resolved !== undefined)
|
|
37
|
+
return Promise.resolve(resolved);
|
|
38
|
+
pending ??= (async () => {
|
|
39
|
+
const route = await opencodeConsoleRouteFor(modelId, fetch, AbortSignal.timeout(CONFIG_TIMEOUT_MS));
|
|
40
|
+
if (route === undefined)
|
|
41
|
+
return chat;
|
|
42
|
+
resolved = { npm: route.npm, model: await sdkModel(route, fetch, session) };
|
|
43
|
+
return resolved;
|
|
44
|
+
})().finally(() => {
|
|
45
|
+
pending = undefined;
|
|
46
|
+
});
|
|
47
|
+
return pending;
|
|
48
|
+
};
|
|
49
|
+
// Fixed: the runner reads provider and modelId before and after the first call.
|
|
50
|
+
return {
|
|
51
|
+
specificationVersion: chat.model.specificationVersion,
|
|
52
|
+
provider: chatRoute.go ? 'opencode.go' : 'opencode',
|
|
53
|
+
modelId: chatRoute.modelId,
|
|
54
|
+
get supportedUrls() {
|
|
55
|
+
return (resolved ?? chat).model.supportedUrls;
|
|
56
|
+
},
|
|
57
|
+
async doGenerate(options) {
|
|
58
|
+
const { npm, model } = await served();
|
|
59
|
+
return model.doGenerate(requestFor(npm, options, session));
|
|
60
|
+
},
|
|
61
|
+
async doStream(options) {
|
|
62
|
+
const { npm, model } = await served();
|
|
63
|
+
return model.doStream(requestFor(npm, options, session));
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** A Console service API key as a login with nothing to refresh. */
|
|
68
|
+
function apiKeyStore(apiKey) {
|
|
69
|
+
return new EnvCredentialStore(JSON.stringify({ 'opencode-console': { access: apiKey, refresh: '', expires: 0 } }));
|
|
70
|
+
}
|
|
71
|
+
/** `opencode.go` keeps Go's provider options under `opencode`, the name up to the first dot; `apiKey` only satisfies the constructors. */
|
|
72
|
+
function settings(route, fetch, session) {
|
|
73
|
+
return { name: route.go ? 'opencode.go' : 'opencode', baseURL: route.baseURL, apiKey: 'oauth', fetch, headers: { 'x-opencode-session': session } };
|
|
74
|
+
}
|
|
75
|
+
function chatModel(route, fetch, session) {
|
|
76
|
+
return createOpenAICompatible({ ...settings(route, fetch, session), includeUsage: true }).chatModel(route.modelId);
|
|
77
|
+
}
|
|
78
|
+
async function sdkModel(route, fetch, session) {
|
|
79
|
+
switch (route.npm) {
|
|
80
|
+
case '@ai-sdk/openai': {
|
|
81
|
+
const { createOpenAI } = await load(() => import('@ai-sdk/openai'), route);
|
|
82
|
+
return createOpenAI(settings(route, fetch, session)).responses(route.modelId);
|
|
83
|
+
}
|
|
84
|
+
case '@ai-sdk/anthropic': {
|
|
85
|
+
const { createAnthropic } = await load(() => import('@ai-sdk/anthropic'), route);
|
|
86
|
+
return createAnthropic(settings(route, fetch, session))(route.modelId);
|
|
87
|
+
}
|
|
88
|
+
case '@ai-sdk/google': {
|
|
89
|
+
const { createGoogleGenerativeAI } = await load(() => import('@ai-sdk/google'), route);
|
|
90
|
+
return createGoogleGenerativeAI(settings(route, fetch, session))(route.modelId);
|
|
91
|
+
}
|
|
92
|
+
default:
|
|
93
|
+
return chatModel(route, fetch, session);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Responses: no server storage and the runner's prompt cache key. Anthropic: cache breakpoints. */
|
|
97
|
+
function requestFor(npm, options, session) {
|
|
98
|
+
switch (npm) {
|
|
99
|
+
case '@ai-sdk/openai': {
|
|
100
|
+
const system = options.prompt.flatMap((message) => (message.role === 'system' ? [message.content] : [])).join('\n');
|
|
101
|
+
const cacheKey = system === '' ? session : promptCacheKey(system);
|
|
102
|
+
return { ...options, providerOptions: { ...options.providerOptions, openai: { promptCacheKey: cacheKey, ...options.providerOptions?.['openai'], store: false } } };
|
|
103
|
+
}
|
|
104
|
+
case '@ai-sdk/anthropic':
|
|
105
|
+
return { ...options, prompt: withBreakpoints(options.prompt, (options.tools?.length ?? 0) > 0) };
|
|
106
|
+
default:
|
|
107
|
+
return options;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The system prompt, and in a tool loop the newest message, as the runner
|
|
112
|
+
* marks them; a call without tools is a one-off judgment. A prompt that already
|
|
113
|
+
* carries a breakpoint is left as the caller placed it.
|
|
114
|
+
*/
|
|
115
|
+
function withBreakpoints(prompt, loop) {
|
|
116
|
+
if (prompt.some(hasBreakpoint))
|
|
117
|
+
return prompt;
|
|
118
|
+
const marked = new Set([prompt.findLastIndex((message) => message.role === 'system'), loop ? prompt.length - 1 : -1]);
|
|
119
|
+
return prompt.map((message, index) => marked.has(index) ? { ...message, providerOptions: { ...message.providerOptions, anthropic: { ...message.providerOptions?.['anthropic'], ...BREAKPOINT } } } : message);
|
|
120
|
+
}
|
|
121
|
+
function hasBreakpoint(message) {
|
|
122
|
+
const marked = (providerOptions) => providerOptions?.['anthropic']?.['cacheControl'] !== undefined;
|
|
123
|
+
return marked(message.providerOptions) || (Array.isArray(message.content) && message.content.some((part) => marked(part.providerOptions)));
|
|
124
|
+
}
|
|
125
|
+
/** Names the missing package when an SDK is not installed. */
|
|
126
|
+
async function load(importer, route) {
|
|
127
|
+
try {
|
|
128
|
+
return await importer();
|
|
129
|
+
}
|
|
130
|
+
catch (cause) {
|
|
131
|
+
throw new OAuthError('MISCONFIGURED', `OpenCode Console serves ${route.modelId} through ${route.npm}, which opencodeConsole() loads on demand; install it beside @ai-sdk/openai-compatible`, { cause });
|
|
132
|
+
}
|
|
133
|
+
}
|
package/dist/oauth/pkce.d.ts
CHANGED
package/dist/oauth/pkce.js
CHANGED
|
@@ -36,4 +36,15 @@ export declare function copilotBaseUrl(enterpriseUrl?: string): string;
|
|
|
36
36
|
export declare function createCopilotProvider(options?: CopilotProviderOptions): OAuthProvider<CopilotCredentials, CopilotLoginOptions>;
|
|
37
37
|
/** Routes an enterprise login at its host and adds Copilot's headers: who initiated the turn, and that images are present. */
|
|
38
38
|
export declare function sendCopilotRequest(request: Request, credentials: CopilotCredentials, upstream: FetchFunction): Promise<Response>;
|
|
39
|
-
|
|
39
|
+
/** The endpoint `copilot()` reaches a Copilot chat model over: chat completions or the Responses API. */
|
|
40
|
+
export type CopilotProtocol = 'chat' | 'responses';
|
|
41
|
+
/**
|
|
42
|
+
* Which endpoint `copilot()` reaches `modelId` on, read from the Copilot
|
|
43
|
+
* API's `GET /models`, or `undefined` when the listing could not be read
|
|
44
|
+
* (an error status, a body that is not JSON, the network, the signal), so
|
|
45
|
+
* the caller can ask again instead of remembering a guess. A model the
|
|
46
|
+
* listing does not name, or names with no endpoint `copilot()` speaks, is
|
|
47
|
+
* chat: the vendor's own error then explains it. A rejected login is not a
|
|
48
|
+
* missing listing and rejects.
|
|
49
|
+
*/
|
|
50
|
+
export declare function copilotProtocolFor(modelId: string, fetch: FetchFunction, signal: AbortSignal): Promise<CopilotProtocol | undefined>;
|
|
@@ -92,30 +92,47 @@ export async function sendCopilotRequest(request, credentials, upstream) {
|
|
|
92
92
|
url.host = new URL(copilotBaseUrl(credentials.enterpriseUrl)).host;
|
|
93
93
|
const headers = new Headers(request.headers);
|
|
94
94
|
headers.set('openai-intent', 'conversation-edits');
|
|
95
|
-
let initiator = 'user';
|
|
96
|
-
let vision = false;
|
|
97
95
|
const text = request.method === 'POST' ? await request.text() : undefined;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const messages = Array.isArray(body.messages) ? body.messages : [];
|
|
102
|
-
if (messages.at(-1)?.role !== 'user')
|
|
103
|
-
initiator = 'agent';
|
|
104
|
-
vision = messages.some((message) => Array.isArray(message.content) && message.content.some((part) => part?.type === 'image_url'));
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
// Not JSON; the headers stay at their defaults.
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
headers.set('x-initiator', initiator);
|
|
111
|
-
if (vision)
|
|
96
|
+
const turn = copilotTurn(text);
|
|
97
|
+
headers.set('x-initiator', turn.initiator);
|
|
98
|
+
if (turn.vision)
|
|
112
99
|
headers.set('copilot-vision-request', 'true');
|
|
113
100
|
return upstream(new Request(url, { method: request.method, headers, signal: request.signal, ...(text === undefined ? {} : { body: text }) }));
|
|
114
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Reads who initiated the turn and whether images are present, whichever
|
|
104
|
+
* protocol carried the body. Chat completions put turns in `messages[]` and
|
|
105
|
+
* images in `image_url` parts; the Responses API puts them in `input[]` with
|
|
106
|
+
* `input_image`. A body shaped like neither keeps the defaults.
|
|
107
|
+
*/
|
|
108
|
+
function copilotTurn(text) {
|
|
109
|
+
if (text === undefined)
|
|
110
|
+
return { initiator: 'user', vision: false };
|
|
111
|
+
try {
|
|
112
|
+
const body = JSON.parse(text);
|
|
113
|
+
// A Responses body has `input` and no `messages`; anything else stays on the chat path.
|
|
114
|
+
if (!Array.isArray(body.messages) && Array.isArray(body.input)) {
|
|
115
|
+
const input = body.input;
|
|
116
|
+
return { initiator: input.at(-1)?.role === 'user' ? 'user' : 'agent', vision: input.some((item) => hasPart(item.content, 'input_image')) };
|
|
117
|
+
}
|
|
118
|
+
const messages = Array.isArray(body.messages) ? body.messages : [];
|
|
119
|
+
return { initiator: messages.at(-1)?.role === 'user' ? 'user' : 'agent', vision: messages.some((message) => hasPart(message.content, 'image_url')) };
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
// Not JSON; the headers stay at their defaults.
|
|
123
|
+
return { initiator: 'user', vision: false };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** Whether a turn's content carries a part of the given type (`image_url` for chat, `input_image` for Responses). */
|
|
127
|
+
function hasPart(content, type) {
|
|
128
|
+
return Array.isArray(content) && content.some((part) => part?.type === type);
|
|
129
|
+
}
|
|
115
130
|
/**
|
|
116
131
|
* The chat models the Copilot plan serves; embeddings and other kinds are
|
|
117
|
-
* left out because only chat models fit `copilot()`.
|
|
118
|
-
*
|
|
132
|
+
* left out because only chat models fit `copilot()`. A model it cannot call
|
|
133
|
+
* at all is listed but marked: one the plan has not enabled, or one Copilot
|
|
134
|
+
* serves only over APIs `copilot()` does not speak (such as Messages). The
|
|
135
|
+
* request goes through `send`, so an enterprise login lists its own host.
|
|
119
136
|
*/
|
|
120
137
|
async function listCopilotModels(fetch) {
|
|
121
138
|
const response = await fetch(`${COPILOT_API_URL}/models`);
|
|
@@ -132,6 +149,8 @@ async function listCopilotModels(fetch) {
|
|
|
132
149
|
supports?.tool_calls === true ? 'tools' : undefined,
|
|
133
150
|
supports?.vision === true ? 'vision' : undefined,
|
|
134
151
|
model.preview === true ? 'preview' : undefined,
|
|
152
|
+
typeof model.policy?.state === 'string' && model.policy.state !== 'enabled' ? 'not enabled' : undefined,
|
|
153
|
+
copilotProtocol(model) === undefined ? 'no chat or responses' : undefined,
|
|
135
154
|
].filter((part) => part !== undefined);
|
|
136
155
|
return {
|
|
137
156
|
id: model.id,
|
|
@@ -140,4 +159,46 @@ async function listCopilotModels(fetch) {
|
|
|
140
159
|
};
|
|
141
160
|
});
|
|
142
161
|
}
|
|
143
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Which endpoint `copilot()` reaches `modelId` on, read from the Copilot
|
|
164
|
+
* API's `GET /models`, or `undefined` when the listing could not be read
|
|
165
|
+
* (an error status, a body that is not JSON, the network, the signal), so
|
|
166
|
+
* the caller can ask again instead of remembering a guess. A model the
|
|
167
|
+
* listing does not name, or names with no endpoint `copilot()` speaks, is
|
|
168
|
+
* chat: the vendor's own error then explains it. A rejected login is not a
|
|
169
|
+
* missing listing and rejects.
|
|
170
|
+
*/
|
|
171
|
+
export async function copilotProtocolFor(modelId, fetch, signal) {
|
|
172
|
+
try {
|
|
173
|
+
const response = await fetch(new Request(`${COPILOT_API_URL}/models`, { signal }));
|
|
174
|
+
if (!response.ok)
|
|
175
|
+
return undefined;
|
|
176
|
+
const payload = (await response.json());
|
|
177
|
+
if (!Array.isArray(payload.data))
|
|
178
|
+
return undefined;
|
|
179
|
+
return copilotProtocol(payload.data.find((model) => model.id === modelId)) ?? 'chat';
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
if (error instanceof OAuthError)
|
|
183
|
+
throw error;
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The protocol one `/models` entry is served on, or `undefined` when
|
|
189
|
+
* `copilot()` cannot call it. An entry that names no endpoints is chat, as
|
|
190
|
+
* Copilot's older models are; chat completions wins when both are named, so
|
|
191
|
+
* a model that worked over chat keeps doing so. Whether the plan enabled the
|
|
192
|
+
* model is a separate question: Copilot rejects a disabled model the same
|
|
193
|
+
* way on either endpoint.
|
|
194
|
+
*/
|
|
195
|
+
function copilotProtocol(model) {
|
|
196
|
+
const endpoints = model?.supported_endpoints;
|
|
197
|
+
if (model === undefined || !Array.isArray(endpoints))
|
|
198
|
+
return 'chat';
|
|
199
|
+
if (endpoints.includes('/chat/completions'))
|
|
200
|
+
return 'chat';
|
|
201
|
+
if (endpoints.includes('/responses'))
|
|
202
|
+
return 'responses';
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
@@ -29,7 +29,7 @@ const REQUIRED_INSTRUCTIONS = 'Follow the user request.';
|
|
|
29
29
|
* client is too old for. This is the Codex CLI release current when the list
|
|
30
30
|
* was last checked; bump it when a model the ChatGPT app shows is missing.
|
|
31
31
|
*/
|
|
32
|
-
const CODEX_CLIENT_VERSION = '0.
|
|
32
|
+
const CODEX_CLIENT_VERSION = '0.160.0';
|
|
33
33
|
export function createCodexProvider(options = {}) {
|
|
34
34
|
const originator = options.originator ?? 'e2e';
|
|
35
35
|
const issuer = options.issuer ?? ISSUER;
|
|
@@ -286,4 +286,3 @@ async function listCodexModels(fetch, apiUrl) {
|
|
|
286
286
|
};
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
//# sourceMappingURL=openai.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Zen and Go through an OpenCode Console sign-in. Console speaks RFC
|
|
3
|
+
* 8628 device authorization; approving the code binds the login to one
|
|
4
|
+
* workspace, and its token is a bearer for both the Console API and inference.
|
|
5
|
+
* Refresh tokens rotate. The workspace config says which models are served and
|
|
6
|
+
* over which protocol: Zen is its `opencode` provider, Go `opencode-go`, present
|
|
7
|
+
* only for the Go subscriber. Go ids take a `go/` prefix here.
|
|
8
|
+
*/
|
|
9
|
+
import type { FetchFunction, OAuthCredentials, OAuthProvider } from '../types.ts';
|
|
10
|
+
export interface OpencodeConsoleCredentials extends OAuthCredentials {
|
|
11
|
+
/** The workspace the login is bound to; absent for a service API key. */
|
|
12
|
+
readonly orgId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface OpencodeConsoleProviderOptions {
|
|
15
|
+
/** Test seam. */
|
|
16
|
+
readonly consoleUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createOpencodeConsoleProvider(options?: OpencodeConsoleProviderOptions): OAuthProvider<OpencodeConsoleCredentials, Record<string, never>>;
|
|
19
|
+
export interface OpencodeConsoleRoute {
|
|
20
|
+
readonly go: boolean;
|
|
21
|
+
readonly npm: string;
|
|
22
|
+
readonly baseURL: string;
|
|
23
|
+
readonly modelId: string;
|
|
24
|
+
}
|
|
25
|
+
/** The plan's chat completions route, used until the config is read. */
|
|
26
|
+
export declare function opencodeConsoleChatRoute(modelId: string): OpencodeConsoleRoute;
|
|
27
|
+
/**
|
|
28
|
+
* The model's route from the workspace config, or `undefined` when the config
|
|
29
|
+
* could not be read, so the caller asks again rather than remembering a guess.
|
|
30
|
+
*/
|
|
31
|
+
export declare function opencodeConsoleRouteFor(modelId: string, fetch: FetchFunction, signal: AbortSignal): Promise<OpencodeConsoleRoute | undefined>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Zen and Go through an OpenCode Console sign-in. Console speaks RFC
|
|
3
|
+
* 8628 device authorization; approving the code binds the login to one
|
|
4
|
+
* workspace, and its token is a bearer for both the Console API and inference.
|
|
5
|
+
* Refresh tokens rotate. The workspace config says which models are served and
|
|
6
|
+
* over which protocol: Zen is its `opencode` provider, Go `opencode-go`, present
|
|
7
|
+
* only for the Go subscriber. Go ids take a `go/` prefix here.
|
|
8
|
+
*/
|
|
9
|
+
import { rfc8628Flow } from '../device-code.js';
|
|
10
|
+
import { OAuthError, describeResponse } from '../errors.js';
|
|
11
|
+
import { expiryFrom, requestTokens } from '../token-endpoint.js';
|
|
12
|
+
/** Console accepts any client id. */
|
|
13
|
+
const CLIENT_ID = 'e2e';
|
|
14
|
+
const CONSOLE_URL = 'https://opencode.ai/console';
|
|
15
|
+
const INFERENCE_URL = 'https://opencode.ai/inference';
|
|
16
|
+
const GO_PREFIX = 'go/';
|
|
17
|
+
const ZEN_PROVIDER = 'opencode';
|
|
18
|
+
const GO_PROVIDER = 'opencode-go';
|
|
19
|
+
export function createOpencodeConsoleProvider(options = {}) {
|
|
20
|
+
const consoleUrl = options.consoleUrl ?? CONSOLE_URL;
|
|
21
|
+
const tokenUrl = `${consoleUrl}/auth/device/token`;
|
|
22
|
+
return {
|
|
23
|
+
id: 'opencode-console',
|
|
24
|
+
name: 'OpenCode Console',
|
|
25
|
+
async login(callbacks) {
|
|
26
|
+
const deviceCodeUrl = `${consoleUrl}/auth/device/code`;
|
|
27
|
+
const tokens = await rfc8628Flow({
|
|
28
|
+
vendor: 'OpenCode Console',
|
|
29
|
+
deviceCodeUrl,
|
|
30
|
+
tokenUrl,
|
|
31
|
+
clientId: CLIENT_ID,
|
|
32
|
+
request: { supports_org_scope: 'true' },
|
|
33
|
+
// Console answers with a relative verification URL.
|
|
34
|
+
callbacks: {
|
|
35
|
+
...callbacks,
|
|
36
|
+
onAuth: (info) => {
|
|
37
|
+
const url = new URL(info.url, deviceCodeUrl).href;
|
|
38
|
+
callbacks.onAuth({
|
|
39
|
+
...info,
|
|
40
|
+
url,
|
|
41
|
+
instructions: `Open ${url} on any device, pick the workspace to sign in to${info.userCode === undefined ? '' : `, and confirm the code ${info.userCode}`}.`,
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return toCredentials(tokens);
|
|
47
|
+
},
|
|
48
|
+
async refresh(credentials) {
|
|
49
|
+
if (credentials.refresh === '')
|
|
50
|
+
throw new OAuthError('LOGIN_REQUIRED', 'OpenCode Console has no refresh token for this login');
|
|
51
|
+
const tokens = await requestTokens('OpenCode Console', tokenUrl, { grant_type: 'refresh_token', refresh_token: credentials.refresh, client_id: CLIENT_ID }, 'LOGIN_REQUIRED');
|
|
52
|
+
return toCredentials(tokens, credentials);
|
|
53
|
+
},
|
|
54
|
+
send(request, credentials, upstream) {
|
|
55
|
+
return sendOpencodeConsoleRequest(request, credentials, upstream, consoleUrl);
|
|
56
|
+
},
|
|
57
|
+
models(fetch) {
|
|
58
|
+
return listOpencodeConsoleModels(fetch, consoleUrl);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Names the workspace as each API expects, and drops the Google SDK's placeholder key header. */
|
|
63
|
+
async function sendOpencodeConsoleRequest(request, credentials, upstream, consoleUrl) {
|
|
64
|
+
const headers = new Headers(request.headers);
|
|
65
|
+
headers.delete('x-goog-api-key');
|
|
66
|
+
if (credentials.orgId !== undefined)
|
|
67
|
+
headers.set(request.url.startsWith(`${consoleUrl}/`) ? 'x-org-id' : 'x-opencode-org-id', credentials.orgId);
|
|
68
|
+
const body = request.method === 'GET' || request.method === 'HEAD' ? undefined : await request.arrayBuffer();
|
|
69
|
+
return upstream(new Request(request.url, { method: request.method, headers, signal: request.signal, ...(body === undefined ? {} : { body }) }));
|
|
70
|
+
}
|
|
71
|
+
async function readConfig(fetch, consoleUrl, signal) {
|
|
72
|
+
const response = await fetch(new Request(`${consoleUrl}/api/config`, signal === undefined ? {} : { signal }));
|
|
73
|
+
if (!response.ok)
|
|
74
|
+
throw new OAuthError('FLOW_FAILED', `OpenCode Console did not return the workspace config: ${await describeResponse(response)}`);
|
|
75
|
+
const payload = (await response.json());
|
|
76
|
+
const providers = payload.config?.provider;
|
|
77
|
+
return typeof providers === 'object' && providers !== null ? providers : {};
|
|
78
|
+
}
|
|
79
|
+
/** Leaves out disabled models and Zen's free ones, which only OpenCode's own clients may use. */
|
|
80
|
+
async function listOpencodeConsoleModels(fetch, consoleUrl) {
|
|
81
|
+
const providers = await readConfig(fetch, consoleUrl);
|
|
82
|
+
const listed = (key, prefix, plan) => Object.entries(providers[key]?.models ?? {})
|
|
83
|
+
.filter(([, model]) => model.disabled !== true && (key === GO_PROVIDER || !isFree(model)))
|
|
84
|
+
.map(([id, model]) => {
|
|
85
|
+
const detail = [
|
|
86
|
+
plan,
|
|
87
|
+
typeof model.cost?.input === 'number' && typeof model.cost.output === 'number' && key === ZEN_PROVIDER ? `$${model.cost.input} in, $${model.cost.output} out per 1M` : undefined,
|
|
88
|
+
Array.isArray(model.modalities?.input) && model.modalities.input.includes('image') ? 'vision' : undefined,
|
|
89
|
+
].filter((part) => part !== undefined);
|
|
90
|
+
return { id: `${prefix}${id}`, ...(typeof model.name === 'string' && model.name !== '' ? { name: model.name } : {}), detail: detail.join(', ') };
|
|
91
|
+
});
|
|
92
|
+
return [...listed(ZEN_PROVIDER, '', 'Zen'), ...listed(GO_PROVIDER, GO_PREFIX, 'Go')];
|
|
93
|
+
}
|
|
94
|
+
function isFree(model) {
|
|
95
|
+
return model.cost?.input === 0 && model.cost.output === 0;
|
|
96
|
+
}
|
|
97
|
+
const CHAT_NPM = '@ai-sdk/openai-compatible';
|
|
98
|
+
function splitModelId(modelId) {
|
|
99
|
+
const go = modelId.startsWith(GO_PREFIX);
|
|
100
|
+
return { go, id: go ? modelId.slice(GO_PREFIX.length) : modelId };
|
|
101
|
+
}
|
|
102
|
+
/** The plan's chat completions route, used until the config is read. */
|
|
103
|
+
export function opencodeConsoleChatRoute(modelId) {
|
|
104
|
+
const { go, id } = splitModelId(modelId);
|
|
105
|
+
return { go, npm: CHAT_NPM, baseURL: `${INFERENCE_URL}${go ? '/go' : ''}/openai/v1`, modelId: id };
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The model's route from the workspace config, or `undefined` when the config
|
|
109
|
+
* could not be read, so the caller asks again rather than remembering a guess.
|
|
110
|
+
*/
|
|
111
|
+
export async function opencodeConsoleRouteFor(modelId, fetch, signal) {
|
|
112
|
+
let providers;
|
|
113
|
+
try {
|
|
114
|
+
providers = await readConfig(fetch, CONSOLE_URL, signal);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (error instanceof OAuthError && error.code !== 'FLOW_FAILED')
|
|
118
|
+
throw error;
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
const { go, id } = splitModelId(modelId);
|
|
122
|
+
const provider = providers[go ? GO_PROVIDER : ZEN_PROVIDER];
|
|
123
|
+
if (provider === undefined) {
|
|
124
|
+
throw new OAuthError('MISCONFIGURED', go
|
|
125
|
+
? 'OpenCode Go is not available to this login: the workspace has no Go subscription, or the signed-in user is not its subscriber; sign in to the Go workspace with `npx e2e login opencode-console`'
|
|
126
|
+
: 'OpenCode Zen is turned off for this OpenCode Console workspace');
|
|
127
|
+
}
|
|
128
|
+
const model = provider.models?.[id];
|
|
129
|
+
if (model === undefined || model.disabled === true) {
|
|
130
|
+
throw new OAuthError('MISCONFIGURED', `the OpenCode Console workspace does not serve ${modelId}; \`npx e2e models opencode-console\` lists the ids`);
|
|
131
|
+
}
|
|
132
|
+
const npm = typeof model.provider?.npm === 'string' ? model.provider.npm : provider.npm;
|
|
133
|
+
const baseURL = typeof model.provider?.api === 'string' ? model.provider.api : provider.api;
|
|
134
|
+
if (typeof npm !== 'string' || typeof baseURL !== 'string')
|
|
135
|
+
return undefined;
|
|
136
|
+
return { go, npm, baseURL, modelId: typeof model.id === 'string' && model.id !== '' ? model.id : id };
|
|
137
|
+
}
|
|
138
|
+
/** A refresh keeps the workspace and the refresh token when the grant omits them. */
|
|
139
|
+
function toCredentials(tokens, previous) {
|
|
140
|
+
const orgId = tokens.org_id;
|
|
141
|
+
const workspace = typeof orgId === 'string' && orgId !== '' ? orgId : previous?.orgId;
|
|
142
|
+
return {
|
|
143
|
+
access: tokens.access_token,
|
|
144
|
+
refresh: tokens.refresh_token ?? previous?.refresh ?? '',
|
|
145
|
+
expires: expiryFrom(tokens.expires_in),
|
|
146
|
+
...(workspace === undefined ? {} : { orgId: workspace }),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
@@ -65,4 +65,3 @@ function toCredentials(tokens, previousRefresh) {
|
|
|
65
65
|
const expires = typeof exp === 'number' && exp > 0 ? exp * 1000 : expiryFrom(tokens.expires_in);
|
|
66
66
|
return { access: tokens.access_token, refresh: tokens.refresh_token ?? previousRefresh, expires };
|
|
67
67
|
}
|
|
68
|
-
//# sourceMappingURL=xai.js.map
|
|
@@ -5,17 +5,12 @@ import type { OAuthProvider } from './types.ts';
|
|
|
5
5
|
export interface LoginOptionsById {
|
|
6
6
|
readonly openai: CodexLoginOptions;
|
|
7
7
|
readonly 'github-copilot': CopilotLoginOptions;
|
|
8
|
+
readonly 'opencode-console': Record<string, never>;
|
|
8
9
|
readonly spacexai: Record<string, never>;
|
|
9
10
|
}
|
|
10
11
|
export type ProviderId = keyof LoginOptionsById;
|
|
11
|
-
export declare const PROVIDER_IDS: readonly ["openai", "github-copilot", "spacexai"];
|
|
12
|
+
export declare const PROVIDER_IDS: readonly ["openai", "github-copilot", "opencode-console", "spacexai"];
|
|
12
13
|
export declare function isProviderId(id: string): id is ProviderId;
|
|
13
14
|
export declare function getProvider(id: ProviderId): OAuthProvider;
|
|
14
|
-
/**
|
|
15
|
-
* How requests identify this harness to a vendor: `e2e/<version> (<platform>; <arch>)`,
|
|
16
|
-
* alongside the `originator` (ChatGPT) and `referrer` (SpaceXAI) the flows send. Never another client's name.
|
|
17
|
-
*/
|
|
18
|
-
export declare const USER_AGENT: string;
|
|
19
15
|
/** How a missing login is described to the user: the CLI command that fixes it. */
|
|
20
16
|
export declare function loginHint(id: ProviderId): string;
|
|
21
|
-
//# sourceMappingURL=providers.d.ts.map
|
package/dist/oauth/providers.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** The built-in providers by id, and the login options each one takes. */
|
|
2
|
-
import { packageVersion } from '../internal/package-version.js';
|
|
3
2
|
import { createCodexProvider } from './providers/openai.js';
|
|
4
3
|
import { createCopilotProvider } from './providers/github-copilot.js';
|
|
4
|
+
import { createOpencodeConsoleProvider } from './providers/opencode-console.js';
|
|
5
5
|
import { createXaiProvider } from './providers/xai.js';
|
|
6
|
-
export const PROVIDER_IDS = ['openai', 'github-copilot', 'spacexai'];
|
|
6
|
+
export const PROVIDER_IDS = ['openai', 'github-copilot', 'opencode-console', 'spacexai'];
|
|
7
7
|
// Method shorthand is bivariant, so each specialised provider fits the base interface without a cast.
|
|
8
8
|
const PROVIDERS = {
|
|
9
9
|
openai: createCodexProvider(),
|
|
10
10
|
'github-copilot': createCopilotProvider(),
|
|
11
|
+
'opencode-console': createOpencodeConsoleProvider(),
|
|
11
12
|
spacexai: createXaiProvider(),
|
|
12
13
|
};
|
|
13
14
|
export function isProviderId(id) {
|
|
@@ -16,13 +17,7 @@ export function isProviderId(id) {
|
|
|
16
17
|
export function getProvider(id) {
|
|
17
18
|
return PROVIDERS[id];
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
-
* How requests identify this harness to a vendor: `e2e/<version> (<platform>; <arch>)`,
|
|
21
|
-
* alongside the `originator` (ChatGPT) and `referrer` (SpaceXAI) the flows send. Never another client's name.
|
|
22
|
-
*/
|
|
23
|
-
export const USER_AGENT = `e2e/${packageVersion(import.meta.url, '../../package.json', '0.0.0')} (${process.platform}; ${process.arch})`;
|
|
24
20
|
/** How a missing login is described to the user: the CLI command that fixes it. */
|
|
25
21
|
export function loginHint(id) {
|
|
26
22
|
return `run \`npx e2e login ${id}\``;
|
|
27
23
|
}
|
|
28
|
-
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Helpers shared by the subscription models that ride the Responses API. */
|
|
2
|
+
import type { LanguageModelV4 } from '@ai-sdk/provider';
|
|
3
|
+
/**
|
|
4
|
+
* Tells the SDK what a subscription backend enforces: nothing is stored
|
|
5
|
+
* server side. Believing storage is on, the SDK refers back to an earlier
|
|
6
|
+
* turn's reasoning by id (`item_reference`), which the backend then cannot
|
|
7
|
+
* find; told it is off, the SDK carries the encrypted reasoning itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function withoutServerStorage(model: LanguageModelV4): LanguageModelV4;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Helpers shared by the subscription models that ride the Responses API. */
|
|
2
|
+
/**
|
|
3
|
+
* Tells the SDK what a subscription backend enforces: nothing is stored
|
|
4
|
+
* server side. Believing storage is on, the SDK refers back to an earlier
|
|
5
|
+
* turn's reasoning by id (`item_reference`), which the backend then cannot
|
|
6
|
+
* find; told it is off, the SDK carries the encrypted reasoning itself.
|
|
7
|
+
*/
|
|
8
|
+
export function withoutServerStorage(model) {
|
|
9
|
+
const storeOff = (options) => ({
|
|
10
|
+
...options,
|
|
11
|
+
providerOptions: { ...options.providerOptions, openai: { ...options.providerOptions?.['openai'], store: false } },
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
specificationVersion: model.specificationVersion,
|
|
15
|
+
provider: model.provider,
|
|
16
|
+
modelId: model.modelId,
|
|
17
|
+
get supportedUrls() {
|
|
18
|
+
return model.supportedUrls;
|
|
19
|
+
},
|
|
20
|
+
doGenerate: (options) => model.doGenerate(storeOff(options)),
|
|
21
|
+
doStream: (options) => model.doStream(storeOff(options)),
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/oauth/sse.d.ts
CHANGED
|
@@ -19,4 +19,3 @@ export interface SseEvent {
|
|
|
19
19
|
/** Splits a text/event-stream body into events, tolerating either newline convention. */
|
|
20
20
|
export declare function parseSse(text: string): SseEvent[];
|
|
21
21
|
export declare function foldResponsesStream(response: Response): Promise<Response>;
|
|
22
|
-
//# sourceMappingURL=sse.d.ts.map
|
package/dist/oauth/sse.js
CHANGED
package/dist/oauth/store.d.ts
CHANGED
package/dist/oauth/store.js
CHANGED
|
@@ -23,4 +23,3 @@ export declare function requestTokens(vendor: string, url: string, params: Recor
|
|
|
23
23
|
export declare function positiveSeconds(value: unknown, fallback: number): number;
|
|
24
24
|
/** When a token expires, from `expires_in`; one hour when the server names nothing usable. */
|
|
25
25
|
export declare function expiryFrom(expiresIn: unknown, now?: number): number;
|
|
26
|
-
//# sourceMappingURL=token-endpoint.d.ts.map
|
package/dist/oauth/types.d.ts
CHANGED
package/dist/oauth/types.js
CHANGED
package/dist/params.d.ts
CHANGED
package/dist/params.js
CHANGED