@bastani/atomic 0.9.11-alpha.6 → 0.9.11-alpha.8
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/CHANGELOG.md +38 -0
- package/README.md +3 -5
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/mcp/sampling-handler.ts +1 -5
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +1 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +33 -129
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +11 -3
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +26 -0
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +35 -0
- package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/animate.md +72 -189
- package/dist/builtin/workflows/skills/impeccable/reference/audit.md +10 -9
- package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +19 -108
- package/dist/builtin/workflows/skills/impeccable/reference/clarify.md +59 -253
- package/dist/builtin/workflows/skills/impeccable/reference/colorize.md +51 -222
- package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +45 -0
- package/dist/builtin/workflows/skills/impeccable/reference/craft.md +3 -121
- package/dist/builtin/workflows/skills/impeccable/reference/critique.md +28 -20
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +97 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +23 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +32 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +92 -0
- package/dist/builtin/workflows/skills/impeccable/reference/delight.md +47 -279
- package/dist/builtin/workflows/skills/impeccable/reference/distill.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +53 -0
- package/dist/builtin/workflows/skills/impeccable/reference/document.md +60 -73
- package/dist/builtin/workflows/skills/impeccable/reference/harden.md +1 -12
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +17 -4
- package/dist/builtin/workflows/skills/impeccable/reference/init.md +64 -163
- package/dist/builtin/workflows/skills/impeccable/reference/ios.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/layout.md +52 -153
- package/dist/builtin/workflows/skills/impeccable/reference/live.md +44 -32
- package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +105 -0
- package/dist/builtin/workflows/skills/impeccable/reference/{product.md → operate.md} +6 -5
- package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -4
- package/dist/builtin/workflows/skills/impeccable/reference/polish.md +68 -212
- package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/reference/routing.md +18 -0
- package/dist/builtin/workflows/skills/impeccable/reference/shape.md +38 -144
- package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +48 -269
- package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +38 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +584 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +117 -9
- package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +486 -59
- package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +16 -45
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +96 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +143 -26
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +181 -12
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +3187 -182
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +102 -7
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +282 -70
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +183 -15
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +22 -7
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/findings.mjs +7 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +16 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +155 -42
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +2988 -155
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/constants.mjs +11 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +336 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +232 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +90 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +410 -78
- package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +25 -8
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/artifact-schema.mjs +93 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +165 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +329 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +20 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-paths.mjs +16 -8
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/provider.mjs +1 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +455 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-notice.mjs +169 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +457 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/surface-briefs.mjs +151 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-slug.mjs +33 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/template-extensions.mjs +146 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/completion.mjs +10 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +15 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/generation-preflight.mjs +149 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/poll-lanes.mjs +14 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +109 -32
- package/dist/builtin/workflows/skills/impeccable/scripts/live/source-lock.mjs +105 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/source-search.mjs +105 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +8 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +280 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +208 -68
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +563 -112
- package/dist/builtin/workflows/skills/impeccable/scripts/live-commit-manual-edits.mjs +3 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +198 -13
- package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +24 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +6 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +44 -14
- package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +398 -33
- package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +9 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +81 -67
- package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +7 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/palette.mjs +76 -81
- package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +2 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +890 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/surface-brief.mjs +74 -0
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +1 -24
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +232 -50
- package/dist/builtin/workflows/src/extension/workflow-model-catalog.ts +26 -0
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +3 -2
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +23 -9
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +1 -0
- package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +20 -5
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +10 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-delivery-activity.ts +86 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +6 -2
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +24 -18
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +8 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +3 -3
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session.ts +2 -2
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +16 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-delivery-activity.ts +121 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-live-events.ts +42 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +16 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +4 -0
- package/dist/cli/list-models.d.ts +2 -2
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +5 -5
- package/dist/cli/list-models.js.map +1 -1
- package/dist/core/agent-session-accessors.js +1 -1
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +2 -5
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-compaction.js +1 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +5 -5
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -4
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts +1 -1
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +18 -14
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +2 -4
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +3 -7
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.js +1 -1
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts +3 -3
- package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
- package/dist/core/agent-session-runtime-auth.js +4 -14
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +3 -8
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +16 -23
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +2 -1
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -2
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage-backends.d.ts +1 -0
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js +18 -4
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/auth-storage.d.ts +12 -139
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +68 -374
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/copilot-env-routing.d.ts +36 -0
- package/dist/core/copilot-env-routing.d.ts.map +1 -0
- package/dist/core/copilot-env-routing.js +94 -0
- package/dist/core/copilot-env-routing.js.map +1 -0
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +10 -2
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +0 -40
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/fallback-models.d.ts +4 -4
- package/dist/core/fallback-models.d.ts.map +1 -1
- package/dist/core/fallback-models.js +3 -3
- package/dist/core/fallback-models.js.map +1 -1
- package/dist/core/model-config.d.ts +542 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/{model-registry-schemas.js → model-config.js} +85 -34
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +25 -85
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +65 -388
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts +2 -2
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.js +2 -2
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +4 -4
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +17 -17
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +3 -3
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +4 -4
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-runtime-auth.d.ts +7 -0
- package/dist/core/model-runtime-auth.d.ts.map +1 -0
- package/dist/core/model-runtime-auth.js +14 -0
- package/dist/core/model-runtime-auth.js.map +1 -0
- package/dist/core/model-runtime-providers.d.ts +6 -0
- package/dist/core/model-runtime-providers.d.ts.map +1 -0
- package/dist/core/model-runtime-providers.js +22 -0
- package/dist/core/model-runtime-providers.js.map +1 -0
- package/dist/core/model-runtime-restoration.d.ts +6 -0
- package/dist/core/model-runtime-restoration.d.ts.map +1 -0
- package/dist/core/model-runtime-restoration.js +21 -0
- package/dist/core/model-runtime-restoration.js.map +1 -0
- package/dist/core/model-runtime-snapshot.d.ts +16 -0
- package/dist/core/model-runtime-snapshot.d.ts.map +1 -0
- package/dist/core/model-runtime-snapshot.js +52 -0
- package/dist/core/model-runtime-snapshot.js.map +1 -0
- package/dist/core/model-runtime-streaming.d.ts +17 -0
- package/dist/core/model-runtime-streaming.d.ts.map +1 -0
- package/dist/core/model-runtime-streaming.js +66 -0
- package/dist/core/model-runtime-streaming.js.map +1 -0
- package/dist/core/model-runtime-types.d.ts +21 -0
- package/dist/core/model-runtime-types.d.ts.map +1 -0
- package/dist/core/model-runtime-types.js +2 -0
- package/dist/core/model-runtime-types.js.map +1 -0
- package/dist/core/model-runtime.d.ts +50 -29
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +330 -90
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts +2 -10
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -29
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/oauth-login.d.ts +24 -0
- package/dist/core/oauth-login.d.ts.map +1 -0
- package/dist/core/oauth-login.js +87 -0
- package/dist/core/oauth-login.js.map +1 -0
- package/dist/core/oauth-provider-metadata.d.ts +5 -0
- package/dist/core/oauth-provider-metadata.d.ts.map +1 -0
- package/dist/core/oauth-provider-metadata.js +19 -0
- package/dist/core/oauth-provider-metadata.js.map +1 -0
- package/dist/core/provider-composer-internal.d.ts +53 -0
- package/dist/core/provider-composer-internal.d.ts.map +1 -0
- package/dist/core/provider-composer-internal.js +273 -0
- package/dist/core/provider-composer-internal.js.map +1 -0
- package/dist/core/provider-composer.d.ts +16 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +108 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +74 -122
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +8 -7
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +26 -23
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +16 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +42 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk-types.d.ts +1 -7
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +27 -28
- package/dist/core/sdk.js.map +1 -1
- package/dist/extensions/llama/index.js +1 -1
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +2 -4
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +25 -17
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/main-runtime-api-key.d.ts +6 -0
- package/dist/main-runtime-api-key.d.ts.map +1 -0
- package/dist/main-runtime-api-key.js +6 -0
- package/dist/main-runtime-api-key.js.map +1 -0
- package/dist/main-session-options.d.ts +2 -2
- package/dist/main-session-options.d.ts.map +1 -1
- package/dist/main-session-options.js +3 -3
- package/dist/main-session-options.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +9 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +2 -14
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +9 -0
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +25 -0
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.js +53 -0
- package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +13 -0
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +22 -1
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -3
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +4 -3
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +56 -73
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +4 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +15 -24
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +10 -4
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +20 -31
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.d.ts +1 -1
- package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +21 -47
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +3 -3
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +8 -8
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +2 -1
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.js +2 -2
- package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +11 -11
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +1 -1
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +2 -2
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +1 -1
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +2 -2
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +4 -3
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -3
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +0 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +11 -50
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -2
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +26 -19
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-oauth-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-oauth-client.js +1 -1
- package/dist/modes/rpc/rpc-oauth-client.js.map +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.d.ts +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.js +1 -1
- package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +4 -5
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +19 -66
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +1 -1
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +7 -4
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +5 -7
- package/dist/package-manager-cli.js.map +1 -1
- package/docs/changelog.mdx +1 -1
- package/docs/custom-provider.md +1 -1
- package/docs/models.md +4 -6
- package/docs/providers.md +13 -0
- package/docs/quickstart.md +2 -1
- package/docs/sdk.md +32 -49
- package/docs/tui.md +7 -2
- package/docs/workflows.md +4 -4
- package/examples/sdk/02-custom-model.ts +8 -10
- package/examples/sdk/09-api-keys-and-oauth.ts +17 -23
- package/examples/sdk/12-full-control.ts +9 -11
- package/examples/sdk/README.md +17 -21
- package/npm-shrinkwrap.json +23 -23
- package/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/brand.md +0 -108
- package/dist/builtin/workflows/skills/impeccable/reference/codex.md +0 -105
- package/dist/builtin/workflows/skills/impeccable/reference/interaction-design.md +0 -189
- package/dist/core/model-registry-auth.d.ts +0 -10
- package/dist/core/model-registry-auth.d.ts.map +0 -1
- package/dist/core/model-registry-auth.js +0 -98
- package/dist/core/model-registry-auth.js.map +0 -1
- package/dist/core/model-registry-builtins.d.ts +0 -8
- package/dist/core/model-registry-builtins.d.ts.map +0 -1
- package/dist/core/model-registry-builtins.js +0 -104
- package/dist/core/model-registry-builtins.js.map +0 -1
- package/dist/core/model-registry-custom-loader.d.ts +0 -3
- package/dist/core/model-registry-custom-loader.d.ts.map +0 -1
- package/dist/core/model-registry-custom-loader.js +0 -255
- package/dist/core/model-registry-custom-loader.js.map +0 -1
- package/dist/core/model-registry-dynamic.d.ts +0 -7
- package/dist/core/model-registry-dynamic.d.ts.map +0 -1
- package/dist/core/model-registry-dynamic.js +0 -189
- package/dist/core/model-registry-dynamic.js.map +0 -1
- package/dist/core/model-registry-extension-refresh.d.ts +0 -23
- package/dist/core/model-registry-extension-refresh.d.ts.map +0 -1
- package/dist/core/model-registry-extension-refresh.js +0 -32
- package/dist/core/model-registry-extension-refresh.js.map +0 -1
- package/dist/core/model-registry-loader.d.ts +0 -5
- package/dist/core/model-registry-loader.d.ts.map +0 -1
- package/dist/core/model-registry-loader.js +0 -29
- package/dist/core/model-registry-loader.js.map +0 -1
- package/dist/core/model-registry-schemas.d.ts +0 -1399
- package/dist/core/model-registry-schemas.d.ts.map +0 -1
- package/dist/core/model-registry-schemas.js.map +0 -1
- package/dist/core/model-registry-types.d.ts +0 -91
- package/dist/core/model-registry-types.d.ts.map +0 -1
- package/dist/core/model-registry-types.js +0 -2
- package/dist/core/model-registry-types.js.map +0 -1
- package/dist/core/model-registry-validation.d.ts +0 -7
- package/dist/core/model-registry-validation.d.ts.map +0 -1
- package/dist/core/model-registry-validation.js +0 -12
- package/dist/core/model-registry-validation.js.map +0 -1
- package/dist/core/oauth-compat.d.ts +0 -17
- package/dist/core/oauth-compat.d.ts.map +0 -1
- package/dist/core/oauth-compat.js +0 -2
- package/dist/core/oauth-compat.js.map +0 -1
- package/dist/core/oauth-provider-bridge.d.ts +0 -63
- package/dist/core/oauth-provider-bridge.d.ts.map +0 -1
- package/dist/core/oauth-provider-bridge.js +0 -232
- package/dist/core/oauth-provider-bridge.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-cli.js","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EACN,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mCAAmC,EACnC,YAAY,EAGZ,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAgB,qBAAqB,EAAE,MAA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AO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;QACzF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport chalk from \"chalk\";\nimport { selectConfig } from \"./cli/config-selector.ts\";\nimport { parseConfigCommand } from \"./config-command-parser.ts\";\nimport { createProjectTrustContext } from \"./cli/project-trust.ts\";\nimport {\n\tAPP_NAME,\n\tCONFIG_DIR_NAME,\n\tdetectInstallMethod,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetPackageDir,\n\tgetSelfUpdateCommand,\n\tgetSelfUpdateUnavailableInstruction,\n\tPACKAGE_NAME,\n\ttype SelfUpdateCommand,\n\ttype SelfUpdateTarget,\n\tVERSION,\n} from \"./config.ts\";\nimport { AuthStorage } from \"./core/auth-storage.ts\";\nimport type { InlineExtension } from \"./core/extensions/types.ts\";\nimport { DefaultPackageManager } from \"./core/package-manager.ts\";\nimport { type AppMode, resolveProjectTrusted } from \"./core/project-trust.ts\";\nimport { DefaultResourceLoader } from \"./core/resource-loader.ts\";\nimport { ModelRegistry } from \"./core/model-registry.ts\";\nimport { SettingsManager } from \"./core/settings-manager.ts\";\nimport { hasProjectTrustInputs, ProjectTrustStore } from \"./core/trust-manager.ts\";\nimport { spawnProcess } from \"./utils/child-process.ts\";\nimport { renderSelfUpdateNote, resolveSelfUpdatePlan } from \"./self-update-plan.ts\";\nimport {\n\tcleanupWindowsSelfUpdateQuarantine,\n\tquarantineWindowsNativeDependencies,\n} from \"./utils/windows-self-update.ts\";\n\nimport { getPackageCommandUsage, parsePackageCommand, printPackageCommandHelp, type UpdateTarget } from \"./package-manager-cli-parser.ts\";\nfunction reportSettingsErrors(settingsManager: SettingsManager, context: string): void {\n\tconst errors = settingsManager.drainErrors();\n\tfor (const { scope, error } of errors) {\n\t\tconsole.error(chalk.yellow(`Warning (${context}, ${scope} settings): ${error.message}`));\n\t\tif (error.stack) {\n\t\t\tconsole.error(chalk.dim(error.stack));\n\t\t}\n\t}\n}\n\nfunction updateTargetIncludesSelf(target: UpdateTarget): boolean {\n\treturn target.type === \"all\" || target.type === \"self\";\n}\n\nfunction updateTargetIncludesExtensions(target: UpdateTarget): boolean {\n\treturn target.type === \"all\" || target.type === \"extensions\";\n}\n\nexport async function refreshModelCatalogs(\n\tagentDir: string,\n\toptions: { cwd?: string; settingsManager?: SettingsManager; extensionFactories?: InlineExtension[] } = {},\n): Promise<void> {\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => controller.abort(), 15_000);\n\tconst aborted = new Promise<null>((resolve) => {\n\t\tcontroller.signal.addEventListener(\"abort\", () => resolve(null), { once: true });\n\t});\n\ttry {\n\t\tconst cwd = options.cwd ?? process.cwd();\n\t\tconst settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir, { projectTrusted: true });\n\t\tconst resourceLoader = new DefaultResourceLoader({\n\t\t\tcwd,\n\t\t\tagentDir,\n\t\t\tsettingsManager,\n\t\t\textensionFactories: options.extensionFactories,\n\t\t\tnoSkills: true,\n\t\t\tnoPromptTemplates: true,\n\t\t\tnoThemes: true,\n\t\t});\n\t\tconst loaded = await Promise.race([resourceLoader.reload().then(() => true), aborted]);\n\t\tif (!loaded) throw new Error(\"Model catalog refresh timed out.\");\n\t\tconst authPaths = [join(agentDir, \"auth.json\"), ...getAgentConfigPaths(\"auth.json\")]\n\t\t\t.filter((path, index, paths) => paths.indexOf(path) === index);\n\t\tconst modelPaths = [join(agentDir, \"models.json\"), ...getAgentConfigPaths(\"models.json\")]\n\t\t\t.filter((path, index, paths) => paths.indexOf(path) === index);\n\t\tconst modelRegistry = ModelRegistry.create(AuthStorage.create(authPaths), modelPaths);\n\t\tconst extensionsResult = resourceLoader.getExtensions();\n\t\tif (extensionsResult.errors.length > 0) {\n\t\t\tconst details = extensionsResult.errors.map(({ path, error }) => `${path}: ${error}`).join(\"; \");\n\t\t\tthrow new Error(`Could not load extensions for model catalog refresh: ${details}`);\n\t\t}\n\t\tfor (const registration of extensionsResult.runtime.pendingProviderRegistrations) {\n\t\t\tif (\"provider\" in registration) modelRegistry.registerProvider(registration.provider);\n\t\t\telse modelRegistry.registerProvider(registration.name, registration.config);\n\t\t}\n\t\tconst refresh = modelRegistry.refresh({ allowNetwork: true, force: true, signal: controller.signal });\n\t\tconst result = await Promise.race([refresh, aborted]);\n\t\tif (!result || result.aborted) throw new Error(\"Model catalog refresh timed out.\");\n\t\tif (result.errors.size > 0) {\n\t\t\tconst details = [...result.errors].map(([provider, error]) => `${provider}: ${error.message}`).join(\"; \");\n\t\t\tthrow new Error(`Could not refresh model catalogs: ${details}`);\n\t\t}\n\t} finally {\n\t\tclearTimeout(timeout);\n\t}\n}\n\nfunction printSelfUpdateUnavailable(npmCommand: string[] | undefined, updateTarget: SelfUpdateTarget): void {\n\tconsole.error(`error: ${APP_NAME} cannot self-update this installation.`);\n\tconsole.error(getSelfUpdateUnavailableInstruction(PACKAGE_NAME, npmCommand, updateTarget));\n\tconst entrypoint = process.argv[1];\n\tif (entrypoint) {\n\t\tconsole.error(\"\");\n\t\tconsole.error(`Location of ${APP_NAME} executable: ${entrypoint}`);\n\t}\n}\n\nfunction printSelfUpdateFallback(command: SelfUpdateCommand): void {\n\tconsole.error(chalk.dim(`If this keeps failing, run this command yourself: ${command.display}`));\n}\n\nfunction printSelfUpdateNote(note: string): void {\n\tconst rendered = renderSelfUpdateNote(note);\n\tif (!rendered) return;\n\tconsole.log(`\\n${chalk.bold(chalk.yellow(\"Update note\"))}`);\n\tconsole.log(rendered);\n\tconsole.log();\n}\n\nasync function runSelfUpdate(command: SelfUpdateCommand): Promise<void> {\n\tconsole.log(chalk.dim(`Updating ${APP_NAME} with ${command.display}...`));\n\tfor (const step of command.steps ?? [command]) {\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\tconst child = spawnProcess(step.command, step.args, {\n\t\t\t\tstdio: \"inherit\",\n\t\t\t});\n\t\t\tchild.on(\"error\", (error) => {\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tchild.on(\"close\", (code, signal) => {\n\t\t\t\tif (code === 0) {\n\t\t\t\t\tresolve();\n\t\t\t\t} else if (signal) {\n\t\t\t\t\treject(new Error(`${step.display} terminated by signal ${signal}`));\n\t\t\t\t} else {\n\t\t\t\t\treject(new Error(`${step.display} exited with code ${code ?? \"unknown\"}`));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\nfunction prepareWindowsNpmSelfUpdate(): void {\n\tif (process.platform !== \"win32\") {\n\t\treturn;\n\t}\n\n\tconst packageDir = getPackageDir();\n\tcleanupWindowsSelfUpdateQuarantine(packageDir);\n\tquarantineWindowsNativeDependencies(packageDir);\n}\n\n\nexport interface PackageCommandRuntimeOptions {\n\textensionFactories?: InlineExtension[];\n\trefreshModelCatalogs?: (agentDir: string) => Promise<void>;\n}\n\ninterface CommandSettingsResult {\n\tsettingsManager: SettingsManager;\n\tprojectTrustWarnings: string[];\n}\n\nfunction getCommandAppMode(): AppMode {\n\treturn process.stdin.isTTY && process.stdout.isTTY ? \"interactive\" : \"print\";\n}\n\nfunction reportProjectTrustWarnings(warnings: readonly string[]): void {\n\tfor (const warning of warnings) {\n\t\tconsole.error(chalk.yellow(`Warning: ${warning}`));\n\t}\n}\n\nasync function createCommandSettingsManager(options: {\n\tcwd: string;\n\tagentDir: string;\n\tprojectTrustOverride?: boolean;\n\textensionFactories?: InlineExtension[];\n}): Promise<CommandSettingsResult> {\n\tconst settingsManager = SettingsManager.create(options.cwd, options.agentDir, { projectTrusted: false });\n\tconst projectTrustWarnings: string[] = [];\n\tconst appMode = getCommandAppMode();\n\tconst extensionsResult =\n\t\toptions.projectTrustOverride === undefined && hasProjectTrustInputs(options.cwd)\n\t\t\t? await new DefaultResourceLoader({\n\t\t\t\t\tcwd: options.cwd,\n\t\t\t\t\tagentDir: options.agentDir,\n\t\t\t\t\tsettingsManager,\n\t\t\t\t\textensionFactories: options.extensionFactories,\n\t\t\t\t}).loadProjectTrustExtensions()\n\t\t\t: undefined;\n\tfor (const error of extensionsResult?.errors ?? []) {\n\t\tprojectTrustWarnings.push(`Failed to load extension \"${error.path}\": ${error.error}`);\n\t}\n\n\tconst projectTrusted = await resolveProjectTrusted({\n\t\tcwd: options.cwd,\n\t\ttrustStore: new ProjectTrustStore(options.agentDir),\n\t\ttrustOverride: options.projectTrustOverride,\n\t\tdefaultProjectTrust: settingsManager.getDefaultProjectTrust(),\n\t\textensionsResult,\n\t\tprojectTrustContext: createProjectTrustContext({\n\t\t\tcwd: options.cwd,\n\t\t\tmode: appMode,\n\t\t\tsettingsManager,\n\t\t\thasUI: appMode === \"interactive\",\n\t\t}),\n\t\tonExtensionError: (message) => projectTrustWarnings.push(message),\n\t});\n\tsettingsManager.setProjectTrusted(projectTrusted);\n\treturn { settingsManager, projectTrustWarnings };\n}\n\nexport async function handleConfigCommand(\n\targs: string[],\n\truntimeOptions: PackageCommandRuntimeOptions = {},\n): Promise<boolean> {\n\tconst options = parseConfigCommand(args);\n\tif (!options) return false;\n\tconst usage = `${APP_NAME} config [-l] [--approve|--no-approve]`;\n\tif (options.help) {\n\t\tconsole.log(`${chalk.bold(\"Usage:\")}\\n ${usage}\\n\\nOpen the resource configuration TUI. Without -l, starts in global settings (~/${CONFIG_DIR_NAME}/agent/settings.json).\\n\\n${chalk.bold(\"Options:\")}\\n -l, --local Start in project-local settings\\n -a, --approve Trust this project\\n -na, --no-approve Do not trust this project\\n -h, --help Show this help`);\n\t\treturn true;\n\t}\n\tif (options.invalidOption || options.invalidArgument) {\n\t\tconst message = options.invalidOption ? `Unknown option ${options.invalidOption} for \"config\".` : `Unexpected argument ${options.invalidArgument}.`;\n\t\tconsole.error(chalk.red(message));\n\t\tconsole.error(chalk.dim(`Usage: ${usage}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst { settingsManager, projectTrustWarnings } = await createCommandSettingsManager({\n\t\tcwd, agentDir, projectTrustOverride: options.projectTrustOverride, extensionFactories: runtimeOptions.extensionFactories,\n\t});\n\treportProjectTrustWarnings(projectTrustWarnings);\n\tif (options.local && !settingsManager.isProjectTrusted()) {\n\t\tconsole.error(chalk.red(\"Project is not trusted. Use --approve to modify local resource config.\"));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\treportSettingsErrors(settingsManager, \"config command\");\n\tconst globalManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });\n\tconst global = await new DefaultPackageManager({ cwd, agentDir, settingsManager: globalManager }).resolve();\n\tconst project = settingsManager.isProjectTrusted()\n\t\t? await new DefaultPackageManager({ cwd, agentDir, settingsManager }).resolve()\n\t\t: global;\n\tawait selectConfig({\n\t\tresolvedPaths: { global, project }, settingsManager, cwd, agentDir,\n\t\twriteScope: options.local ? \"project\" : \"global\", projectModeAvailable: settingsManager.isProjectTrusted(),\n\t});\n\tprocess.exit(0);\n}\n\nexport async function handlePackageCommand(\n\targs: string[],\n\truntimeOptions: PackageCommandRuntimeOptions = {},\n): Promise<boolean> {\n\tconst options = parsePackageCommand(args);\n\tif (!options) return false;\n\tif (options.help) {\n\t\tprintPackageCommandHelp(options.command);\n\t\treturn true;\n\t}\n\tif (options.invalidOption) {\n\t\tconsole.error(chalk.red(`Unknown option ${options.invalidOption} for \"${options.command}\".`));\n\t\tconsole.error(chalk.dim(`Use \"${APP_NAME} --help\" or \"${getPackageCommandUsage(options.command)}\".`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\tif (options.missingOptionValue) {\n\t\tconsole.error(chalk.red(`Missing value for ${options.missingOptionValue}.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tif (options.invalidArgument) {\n\t\tconsole.error(chalk.red(`Unexpected argument ${options.invalidArgument}.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tif (options.conflictingOptions) {\n\t\tconsole.error(chalk.red(options.conflictingOptions));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst source = options.source;\n\tif ((options.command === \"install\" || options.command === \"remove\") && !source) {\n\t\tconsole.error(chalk.red(`Missing ${options.command} source.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst writesProjectPackageConfig = (options.command === \"install\" || options.command === \"remove\") && options.local;\n\tconst { settingsManager, projectTrustWarnings } = await createCommandSettingsManager({\n\t\tcwd,\n\t\tagentDir,\n\t\tprojectTrustOverride: options.projectTrustOverride,\n\t\textensionFactories: runtimeOptions.extensionFactories,\n\t});\n\treportProjectTrustWarnings(projectTrustWarnings);\n\tif (!settingsManager.isProjectTrusted() && writesProjectPackageConfig) {\n\t\tconsole.error(chalk.red(\"Project is not trusted. Use --approve to modify local package config.\"));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\treportSettingsErrors(settingsManager, \"package command\");\n\tconst selfUpdateNpmCommand = settingsManager.getGlobalSettings().npmCommand;\n\n\tconst packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });\n\n\tpackageManager.setProgressCallback((event) => {\n\t\tif (event.type === \"start\") {\n\t\t\tprocess.stdout.write(chalk.dim(`${event.message}\\n`));\n\t\t}\n\t});\n\n\ttry {\n\t\tswitch (options.command) {\n\t\t\tcase \"install\":\n\t\t\t\tawait packageManager.installAndPersist(source!, { local: options.local });\n\t\t\t\tconsole.log(chalk.green(`Installed ${source}`));\n\t\t\t\treturn true;\n\n\t\t\tcase \"remove\": {\n\t\t\t\tconst removed = await packageManager.removeAndPersist(source!, { local: options.local });\n\t\t\t\tif (!removed) {\n\t\t\t\t\tconsole.error(chalk.red(`No matching package found for ${source}`));\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tconsole.log(chalk.green(`Removed ${source}`));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"list\": {\n\t\t\t\tconst configuredPackages = packageManager.listConfiguredPackages();\n\t\t\t\tconst userPackages = configuredPackages.filter((pkg) => pkg.scope === \"user\");\n\t\t\t\tconst projectPackages = configuredPackages.filter((pkg) => pkg.scope === \"project\");\n\n\t\t\t\tif (configuredPackages.length === 0) {\n\t\t\t\t\tconsole.log(chalk.dim(\"No packages installed.\"));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst formatPackage = (pkg: (typeof configuredPackages)[number]) => {\n\t\t\t\t\tconst display = pkg.filtered ? `${pkg.source} (filtered)` : pkg.source;\n\t\t\t\t\tconsole.log(` ${display}`);\n\t\t\t\t\tif (pkg.installedPath) {\n\t\t\t\t\t\tconsole.log(chalk.dim(` ${pkg.installedPath}`));\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (userPackages.length > 0) {\n\t\t\t\t\tconsole.log(chalk.bold(\"User packages:\"));\n\t\t\t\t\tfor (const pkg of userPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (projectPackages.length > 0) {\n\t\t\t\t\tif (userPackages.length > 0) console.log();\n\t\t\t\t\tconsole.log(chalk.bold(\"Project packages:\"));\n\t\t\t\t\tfor (const pkg of projectPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"update\": {\n\t\t\t\tconst target = options.updateTarget ?? { type: \"self\" };\n\t\t\t\tif (target.type === \"models\") {\n\t\t\t\t\tif (runtimeOptions.refreshModelCatalogs) {\n\t\t\t\t\t\tawait runtimeOptions.refreshModelCatalogs(agentDir);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait refreshModelCatalogs(agentDir, {\n\t\t\t\t\t\t\tcwd,\n\t\t\t\t\t\t\tsettingsManager,\n\t\t\t\t\t\t\textensionFactories: runtimeOptions.extensionFactories,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(chalk.green(\"Model catalogs refreshed\"));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (options.showExtensionsSkippedNote) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\tchalk.dim(`Extensions are skipped. Run ${APP_NAME} update --extensions to update extensions.`),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (updateTargetIncludesExtensions(target)) {\n\t\t\t\t\tconst updateSource = target.type === \"extensions\" ? target.source : undefined;\n\t\t\t\t\tawait packageManager.update(updateSource);\n\t\t\t\t\tif (updateSource) {\n\t\t\t\t\t\tconsole.log(chalk.green(`Updated ${updateSource}`));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(chalk.green(\"Updated packages\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (updateTargetIncludesSelf(target)) {\n\t\t\t\t\tconst selfUpdatePlan = await resolveSelfUpdatePlan(options.force);\n\t\t\t\t\tif (!selfUpdatePlan.shouldRun) {\n\t\t\t\t\t\tconsole.log(chalk.green(`${APP_NAME} is already up to date (v${VERSION})`));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconst installMethod = detectInstallMethod();\n\t\t\t\t\tif (process.platform === \"win32\" && installMethod !== \"npm\" && installMethod !== \"pnpm\") {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\tchalk.red(`${APP_NAME} self-update on Windows is only supported for npm and pnpm installs.`),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.error(chalk.dim(`Detected install method: ${installMethod}. Update ${APP_NAME} manually.`));\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconst selfUpdateTarget = {\n\t\t\t\t\t\tpackageName: selfUpdatePlan.packageName,\n\t\t\t\t\t\tinstallSpec: selfUpdatePlan.installSpec,\n\t\t\t\t\t};\n\t\t\t\t\tconst selfUpdateCommand = getSelfUpdateCommand(PACKAGE_NAME, selfUpdateNpmCommand, selfUpdateTarget);\n\t\t\t\t\tif (!selfUpdateCommand) {\n\t\t\t\t\t\tprintSelfUpdateUnavailable(selfUpdateNpmCommand, selfUpdateTarget);\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (selfUpdatePlan.note) printSelfUpdateNote(selfUpdatePlan.note);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (installMethod === \"npm\") {\n\t\t\t\t\t\t\tprepareWindowsNpmSelfUpdate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait runSelfUpdate(selfUpdateCommand);\n\t\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\t\tconst message = error instanceof Error ? error.message : \"Unknown package command error\";\n\t\t\t\t\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\t\t\t\t\tprintSelfUpdateFallback(selfUpdateCommand);\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(chalk.green(`Updated ${APP_NAME} from ${VERSION} to ${selfUpdatePlan.version}`));\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : \"Unknown package command error\";\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"package-manager-cli.js","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EACN,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mCAAmC,EACnC,YAAY,EAGZ,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAgB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EACN,kCAAkC,EAClC,mCAAmC,GACnC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,uBAAuB,EAAqB,MAAM,iCAAiC,CAAC;AAC1I,SAAS,o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AAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;wBACzF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC;wBAC9C,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;wBAC3C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;wBACrB,OAAO,IAAI,CAAC;oBACb,CAAC;oBACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,QAAQ,SAAS,OAAO,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAC9F,CAAC;gBACD,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;IACF,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;QACzF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport chalk from \"chalk\";\nimport { selectConfig } from \"./cli/config-selector.ts\";\nimport { parseConfigCommand } from \"./config-command-parser.ts\";\nimport { createProjectTrustContext } from \"./cli/project-trust.ts\";\nimport {\n\tAPP_NAME,\n\tCONFIG_DIR_NAME,\n\tdetectInstallMethod,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetPackageDir,\n\tgetSelfUpdateCommand,\n\tgetSelfUpdateUnavailableInstruction,\n\tPACKAGE_NAME,\n\ttype SelfUpdateCommand,\n\ttype SelfUpdateTarget,\n\tVERSION,\n} from \"./config.ts\";\nimport { AuthStorage } from \"./core/auth-storage.ts\";\nimport type { InlineExtension } from \"./core/extensions/types.ts\";\nimport { DefaultPackageManager } from \"./core/package-manager.ts\";\nimport { type AppMode, resolveProjectTrusted } from \"./core/project-trust.ts\";\nimport { DefaultResourceLoader } from \"./core/resource-loader.ts\";\nimport { ModelRuntime } from \"./core/model-runtime.ts\";\nimport { SettingsManager } from \"./core/settings-manager.ts\";\nimport { hasProjectTrustInputs, ProjectTrustStore } from \"./core/trust-manager.ts\";\nimport { spawnProcess } from \"./utils/child-process.ts\";\nimport { renderSelfUpdateNote, resolveSelfUpdatePlan } from \"./self-update-plan.ts\";\nimport {\n\tcleanupWindowsSelfUpdateQuarantine,\n\tquarantineWindowsNativeDependencies,\n} from \"./utils/windows-self-update.ts\";\n\nimport { getPackageCommandUsage, parsePackageCommand, printPackageCommandHelp, type UpdateTarget } from \"./package-manager-cli-parser.ts\";\nfunction reportSettingsErrors(settingsManager: SettingsManager, context: string): void {\n\tconst errors = settingsManager.drainErrors();\n\tfor (const { scope, error } of errors) {\n\t\tconsole.error(chalk.yellow(`Warning (${context}, ${scope} settings): ${error.message}`));\n\t\tif (error.stack) {\n\t\t\tconsole.error(chalk.dim(error.stack));\n\t\t}\n\t}\n}\n\nfunction updateTargetIncludesSelf(target: UpdateTarget): boolean {\n\treturn target.type === \"all\" || target.type === \"self\";\n}\n\nfunction updateTargetIncludesExtensions(target: UpdateTarget): boolean {\n\treturn target.type === \"all\" || target.type === \"extensions\";\n}\n\nexport async function refreshModelCatalogs(\n\tagentDir: string,\n\toptions: { cwd?: string; settingsManager?: SettingsManager; extensionFactories?: InlineExtension[] } = {},\n): Promise<void> {\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => controller.abort(), 15_000);\n\tconst aborted = new Promise<null>((resolve) => {\n\t\tcontroller.signal.addEventListener(\"abort\", () => resolve(null), { once: true });\n\t});\n\ttry {\n\t\tconst cwd = options.cwd ?? process.cwd();\n\t\tconst settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir, { projectTrusted: true });\n\t\tconst resourceLoader = new DefaultResourceLoader({\n\t\t\tcwd,\n\t\t\tagentDir,\n\t\t\tsettingsManager,\n\t\t\textensionFactories: options.extensionFactories,\n\t\t\tnoSkills: true,\n\t\t\tnoPromptTemplates: true,\n\t\t\tnoThemes: true,\n\t\t});\n\t\tconst loaded = await Promise.race([resourceLoader.reload().then(() => true), aborted]);\n\t\tif (!loaded) throw new Error(\"Model catalog refresh timed out.\");\n\t\tconst authPaths = [join(agentDir, \"auth.json\"), ...getAgentConfigPaths(\"auth.json\")]\n\t\t\t.filter((path, index, paths) => paths.indexOf(path) === index);\n\t\tconst modelRuntime = await ModelRuntime.create({ credentials: AuthStorage.create(authPaths), modelsPath: join(agentDir, \"models.json\") });\n\t\tconst extensionsResult = resourceLoader.getExtensions();\n\t\tif (extensionsResult.errors.length > 0) {\n\t\t\tconst details = extensionsResult.errors.map(({ path, error }) => `${path}: ${error}`).join(\"; \");\n\t\t\tthrow new Error(`Could not load extensions for model catalog refresh: ${details}`);\n\t\t}\n\t\tfor (const registration of extensionsResult.runtime.pendingProviderRegistrations) {\n\t\t\tif (\"provider\" in registration) modelRuntime.registerNativeProvider(registration.provider);\n\t\t\telse modelRuntime.registerProvider(registration.name, registration.config);\n\t\t}\n\t\tconst refresh = modelRuntime.refresh({ allowNetwork: true, force: true, signal: controller.signal });\n\t\tconst result = await Promise.race([refresh, aborted]);\n\t\tif (!result || result.aborted) throw new Error(\"Model catalog refresh timed out.\");\n\t\tif (result.errors.size > 0) {\n\t\t\tconst details = [...result.errors].map(([provider, error]) => `${provider}: ${error.message}`).join(\"; \");\n\t\t\tthrow new Error(`Could not refresh model catalogs: ${details}`);\n\t\t}\n\t} finally {\n\t\tclearTimeout(timeout);\n\t}\n}\n\nfunction printSelfUpdateUnavailable(npmCommand: string[] | undefined, updateTarget: SelfUpdateTarget): void {\n\tconsole.error(`error: ${APP_NAME} cannot self-update this installation.`);\n\tconsole.error(getSelfUpdateUnavailableInstruction(PACKAGE_NAME, npmCommand, updateTarget));\n\tconst entrypoint = process.argv[1];\n\tif (entrypoint) {\n\t\tconsole.error(\"\");\n\t\tconsole.error(`Location of ${APP_NAME} executable: ${entrypoint}`);\n\t}\n}\n\nfunction printSelfUpdateFallback(command: SelfUpdateCommand): void {\n\tconsole.error(chalk.dim(`If this keeps failing, run this command yourself: ${command.display}`));\n}\n\nfunction printSelfUpdateNote(note: string): void {\n\tconst rendered = renderSelfUpdateNote(note);\n\tif (!rendered) return;\n\tconsole.log(`\\n${chalk.bold(chalk.yellow(\"Update note\"))}`);\n\tconsole.log(rendered);\n\tconsole.log();\n}\n\nasync function runSelfUpdate(command: SelfUpdateCommand): Promise<void> {\n\tconsole.log(chalk.dim(`Updating ${APP_NAME} with ${command.display}...`));\n\tfor (const step of command.steps ?? [command]) {\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\tconst child = spawnProcess(step.command, step.args, {\n\t\t\t\tstdio: \"inherit\",\n\t\t\t});\n\t\t\tchild.on(\"error\", (error) => {\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tchild.on(\"close\", (code, signal) => {\n\t\t\t\tif (code === 0) {\n\t\t\t\t\tresolve();\n\t\t\t\t} else if (signal) {\n\t\t\t\t\treject(new Error(`${step.display} terminated by signal ${signal}`));\n\t\t\t\t} else {\n\t\t\t\t\treject(new Error(`${step.display} exited with code ${code ?? \"unknown\"}`));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\nfunction prepareWindowsNpmSelfUpdate(): void {\n\tif (process.platform !== \"win32\") {\n\t\treturn;\n\t}\n\n\tconst packageDir = getPackageDir();\n\tcleanupWindowsSelfUpdateQuarantine(packageDir);\n\tquarantineWindowsNativeDependencies(packageDir);\n}\n\n\nexport interface PackageCommandRuntimeOptions {\n\textensionFactories?: InlineExtension[];\n\trefreshModelCatalogs?: (agentDir: string) => Promise<void>;\n}\n\ninterface CommandSettingsResult {\n\tsettingsManager: SettingsManager;\n\tprojectTrustWarnings: string[];\n}\n\nfunction getCommandAppMode(): AppMode {\n\treturn process.stdin.isTTY && process.stdout.isTTY ? \"interactive\" : \"print\";\n}\n\nfunction reportProjectTrustWarnings(warnings: readonly string[]): void {\n\tfor (const warning of warnings) {\n\t\tconsole.error(chalk.yellow(`Warning: ${warning}`));\n\t}\n}\n\nasync function createCommandSettingsManager(options: {\n\tcwd: string;\n\tagentDir: string;\n\tprojectTrustOverride?: boolean;\n\textensionFactories?: InlineExtension[];\n}): Promise<CommandSettingsResult> {\n\tconst settingsManager = SettingsManager.create(options.cwd, options.agentDir, { projectTrusted: false });\n\tconst projectTrustWarnings: string[] = [];\n\tconst appMode = getCommandAppMode();\n\tconst extensionsResult =\n\t\toptions.projectTrustOverride === undefined && hasProjectTrustInputs(options.cwd)\n\t\t\t? await new DefaultResourceLoader({\n\t\t\t\t\tcwd: options.cwd,\n\t\t\t\t\tagentDir: options.agentDir,\n\t\t\t\t\tsettingsManager,\n\t\t\t\t\textensionFactories: options.extensionFactories,\n\t\t\t\t}).loadProjectTrustExtensions()\n\t\t\t: undefined;\n\tfor (const error of extensionsResult?.errors ?? []) {\n\t\tprojectTrustWarnings.push(`Failed to load extension \"${error.path}\": ${error.error}`);\n\t}\n\n\tconst projectTrusted = await resolveProjectTrusted({\n\t\tcwd: options.cwd,\n\t\ttrustStore: new ProjectTrustStore(options.agentDir),\n\t\ttrustOverride: options.projectTrustOverride,\n\t\tdefaultProjectTrust: settingsManager.getDefaultProjectTrust(),\n\t\textensionsResult,\n\t\tprojectTrustContext: createProjectTrustContext({\n\t\t\tcwd: options.cwd,\n\t\t\tmode: appMode,\n\t\t\tsettingsManager,\n\t\t\thasUI: appMode === \"interactive\",\n\t\t}),\n\t\tonExtensionError: (message) => projectTrustWarnings.push(message),\n\t});\n\tsettingsManager.setProjectTrusted(projectTrusted);\n\treturn { settingsManager, projectTrustWarnings };\n}\n\nexport async function handleConfigCommand(\n\targs: string[],\n\truntimeOptions: PackageCommandRuntimeOptions = {},\n): Promise<boolean> {\n\tconst options = parseConfigCommand(args);\n\tif (!options) return false;\n\tconst usage = `${APP_NAME} config [-l] [--approve|--no-approve]`;\n\tif (options.help) {\n\t\tconsole.log(`${chalk.bold(\"Usage:\")}\\n ${usage}\\n\\nOpen the resource configuration TUI. Without -l, starts in global settings (~/${CONFIG_DIR_NAME}/agent/settings.json).\\n\\n${chalk.bold(\"Options:\")}\\n -l, --local Start in project-local settings\\n -a, --approve Trust this project\\n -na, --no-approve Do not trust this project\\n -h, --help Show this help`);\n\t\treturn true;\n\t}\n\tif (options.invalidOption || options.invalidArgument) {\n\t\tconst message = options.invalidOption ? `Unknown option ${options.invalidOption} for \"config\".` : `Unexpected argument ${options.invalidArgument}.`;\n\t\tconsole.error(chalk.red(message));\n\t\tconsole.error(chalk.dim(`Usage: ${usage}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst { settingsManager, projectTrustWarnings } = await createCommandSettingsManager({\n\t\tcwd, agentDir, projectTrustOverride: options.projectTrustOverride, extensionFactories: runtimeOptions.extensionFactories,\n\t});\n\treportProjectTrustWarnings(projectTrustWarnings);\n\tif (options.local && !settingsManager.isProjectTrusted()) {\n\t\tconsole.error(chalk.red(\"Project is not trusted. Use --approve to modify local resource config.\"));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\treportSettingsErrors(settingsManager, \"config command\");\n\tconst globalManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });\n\tconst global = await new DefaultPackageManager({ cwd, agentDir, settingsManager: globalManager }).resolve();\n\tconst project = settingsManager.isProjectTrusted()\n\t\t? await new DefaultPackageManager({ cwd, agentDir, settingsManager }).resolve()\n\t\t: global;\n\tawait selectConfig({\n\t\tresolvedPaths: { global, project }, settingsManager, cwd, agentDir,\n\t\twriteScope: options.local ? \"project\" : \"global\", projectModeAvailable: settingsManager.isProjectTrusted(),\n\t});\n\tprocess.exit(0);\n}\n\nexport async function handlePackageCommand(\n\targs: string[],\n\truntimeOptions: PackageCommandRuntimeOptions = {},\n): Promise<boolean> {\n\tconst options = parsePackageCommand(args);\n\tif (!options) return false;\n\tif (options.help) {\n\t\tprintPackageCommandHelp(options.command);\n\t\treturn true;\n\t}\n\tif (options.invalidOption) {\n\t\tconsole.error(chalk.red(`Unknown option ${options.invalidOption} for \"${options.command}\".`));\n\t\tconsole.error(chalk.dim(`Use \"${APP_NAME} --help\" or \"${getPackageCommandUsage(options.command)}\".`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\tif (options.missingOptionValue) {\n\t\tconsole.error(chalk.red(`Missing value for ${options.missingOptionValue}.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tif (options.invalidArgument) {\n\t\tconsole.error(chalk.red(`Unexpected argument ${options.invalidArgument}.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tif (options.conflictingOptions) {\n\t\tconsole.error(chalk.red(options.conflictingOptions));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst source = options.source;\n\tif ((options.command === \"install\" || options.command === \"remove\") && !source) {\n\t\tconsole.error(chalk.red(`Missing ${options.command} source.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst writesProjectPackageConfig = (options.command === \"install\" || options.command === \"remove\") && options.local;\n\tconst { settingsManager, projectTrustWarnings } = await createCommandSettingsManager({\n\t\tcwd,\n\t\tagentDir,\n\t\tprojectTrustOverride: options.projectTrustOverride,\n\t\textensionFactories: runtimeOptions.extensionFactories,\n\t});\n\treportProjectTrustWarnings(projectTrustWarnings);\n\tif (!settingsManager.isProjectTrusted() && writesProjectPackageConfig) {\n\t\tconsole.error(chalk.red(\"Project is not trusted. Use --approve to modify local package config.\"));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\treportSettingsErrors(settingsManager, \"package command\");\n\tconst selfUpdateNpmCommand = settingsManager.getGlobalSettings().npmCommand;\n\n\tconst packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });\n\n\tpackageManager.setProgressCallback((event) => {\n\t\tif (event.type === \"start\") {\n\t\t\tprocess.stdout.write(chalk.dim(`${event.message}\\n`));\n\t\t}\n\t});\n\n\ttry {\n\t\tswitch (options.command) {\n\t\t\tcase \"install\":\n\t\t\t\tawait packageManager.installAndPersist(source!, { local: options.local });\n\t\t\t\tconsole.log(chalk.green(`Installed ${source}`));\n\t\t\t\treturn true;\n\n\t\t\tcase \"remove\": {\n\t\t\t\tconst removed = await packageManager.removeAndPersist(source!, { local: options.local });\n\t\t\t\tif (!removed) {\n\t\t\t\t\tconsole.error(chalk.red(`No matching package found for ${source}`));\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tconsole.log(chalk.green(`Removed ${source}`));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"list\": {\n\t\t\t\tconst configuredPackages = packageManager.listConfiguredPackages();\n\t\t\t\tconst userPackages = configuredPackages.filter((pkg) => pkg.scope === \"user\");\n\t\t\t\tconst projectPackages = configuredPackages.filter((pkg) => pkg.scope === \"project\");\n\n\t\t\t\tif (configuredPackages.length === 0) {\n\t\t\t\t\tconsole.log(chalk.dim(\"No packages installed.\"));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst formatPackage = (pkg: (typeof configuredPackages)[number]) => {\n\t\t\t\t\tconst display = pkg.filtered ? `${pkg.source} (filtered)` : pkg.source;\n\t\t\t\t\tconsole.log(` ${display}`);\n\t\t\t\t\tif (pkg.installedPath) {\n\t\t\t\t\t\tconsole.log(chalk.dim(` ${pkg.installedPath}`));\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (userPackages.length > 0) {\n\t\t\t\t\tconsole.log(chalk.bold(\"User packages:\"));\n\t\t\t\t\tfor (const pkg of userPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (projectPackages.length > 0) {\n\t\t\t\t\tif (userPackages.length > 0) console.log();\n\t\t\t\t\tconsole.log(chalk.bold(\"Project packages:\"));\n\t\t\t\t\tfor (const pkg of projectPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"update\": {\n\t\t\t\tconst target = options.updateTarget ?? { type: \"self\" };\n\t\t\t\tif (target.type === \"models\") {\n\t\t\t\t\tif (runtimeOptions.refreshModelCatalogs) {\n\t\t\t\t\t\tawait runtimeOptions.refreshModelCatalogs(agentDir);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait refreshModelCatalogs(agentDir, {\n\t\t\t\t\t\t\tcwd,\n\t\t\t\t\t\t\tsettingsManager,\n\t\t\t\t\t\t\textensionFactories: runtimeOptions.extensionFactories,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(chalk.green(\"Model catalogs refreshed\"));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (options.showExtensionsSkippedNote) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\tchalk.dim(`Extensions are skipped. Run ${APP_NAME} update --extensions to update extensions.`),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (updateTargetIncludesExtensions(target)) {\n\t\t\t\t\tconst updateSource = target.type === \"extensions\" ? target.source : undefined;\n\t\t\t\t\tawait packageManager.update(updateSource);\n\t\t\t\t\tif (updateSource) {\n\t\t\t\t\t\tconsole.log(chalk.green(`Updated ${updateSource}`));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(chalk.green(\"Updated packages\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (updateTargetIncludesSelf(target)) {\n\t\t\t\t\tconst selfUpdatePlan = await resolveSelfUpdatePlan(options.force);\n\t\t\t\t\tif (!selfUpdatePlan.shouldRun) {\n\t\t\t\t\t\tconsole.log(chalk.green(`${APP_NAME} is already up to date (v${VERSION})`));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconst installMethod = detectInstallMethod();\n\t\t\t\t\tif (process.platform === \"win32\" && installMethod !== \"npm\" && installMethod !== \"pnpm\") {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\tchalk.red(`${APP_NAME} self-update on Windows is only supported for npm and pnpm installs.`),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.error(chalk.dim(`Detected install method: ${installMethod}. Update ${APP_NAME} manually.`));\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconst selfUpdateTarget = {\n\t\t\t\t\t\tpackageName: selfUpdatePlan.packageName,\n\t\t\t\t\t\tinstallSpec: selfUpdatePlan.installSpec,\n\t\t\t\t\t};\n\t\t\t\t\tconst selfUpdateCommand = getSelfUpdateCommand(PACKAGE_NAME, selfUpdateNpmCommand, selfUpdateTarget);\n\t\t\t\t\tif (!selfUpdateCommand) {\n\t\t\t\t\t\tprintSelfUpdateUnavailable(selfUpdateNpmCommand, selfUpdateTarget);\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (selfUpdatePlan.note) printSelfUpdateNote(selfUpdatePlan.note);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (installMethod === \"npm\") {\n\t\t\t\t\t\t\tprepareWindowsNpmSelfUpdate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait runSelfUpdate(selfUpdateCommand);\n\t\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\t\tconst message = error instanceof Error ? error.message : \"Unknown package command error\";\n\t\t\t\t\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\t\t\t\t\tprintSelfUpdateFallback(selfUpdateCommand);\n\t\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(chalk.green(`Updated ${APP_NAME} from ${VERSION} to ${selfUpdatePlan.version}`));\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : \"Unknown package command error\";\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n}\n"]}
|
package/docs/changelog.mdx
CHANGED
|
@@ -30,7 +30,7 @@ See [SDK](/sdk) and [Custom providers](/custom-provider).
|
|
|
30
30
|
## Pi 0.80.6 compatibility
|
|
31
31
|
|
|
32
32
|
- **Synced through upstream Pi 0.80.6.** Atomic and its bundled extensions now use the 0.80.6 Pi runtime packages, including signed empty Anthropic thinking preservation, request-wide GPT-5.4/5.5 long-context pricing, and corrected GPT-5.6 catalog/backend metadata.
|
|
33
|
-
- **Model controls are current.** Atomic accepts `max` wherever the active model advertises it, applies `models.json` overrides to matching extension-registered models and built-ins, and
|
|
33
|
+
- **Model controls are current.** Atomic accepts `max` wherever the active model advertises it, applies the active agent directory's single `models.json` overrides to matching extension-registered models and built-ins, and falls back instead of synthesizing removed catalog IDs on resume. See [Models](/models).
|
|
34
34
|
- **Custom pricing tiers are preserved.** Custom `models.json` entries and extension providers can declare complete request-wide `cost.tiers`; matching `modelOverrides` can update scalar rates without losing inherited tiers or replace/clear the tier array explicitly. See [Models](/models#request-wide-cost-tiers) and [Custom Providers](/custom-provider#usage-and-cost).
|
|
35
35
|
- **Safer session and tool behavior.** Invalid explicit bash timeouts fail instead of being clamped; missing exact session IDs warn before creation; lax null or omitted message content is normalized; auth writes surface persistence failures; Windows context traversal terminates at drive roots; and duplicate fork selections are ignored. See [Tools](/tools) and [Usage](/usage).
|
|
36
36
|
- **More reliable streaming and binaries.** Visible custom messages stay before the live assistant row, standalone Linux clipboard reads can fall back to xclip with correctly packaged native bindings, caller-relative `TMPDIR` paths work from external directories, and `--skip-deps` tolerates a missing optional clipboard wrapper.
|
package/docs/custom-provider.md
CHANGED
|
@@ -312,7 +312,7 @@ After registration, users can authenticate via `/login corporate-ai`.
|
|
|
312
312
|
|
|
313
313
|
Existing extension OAuth definitions keep their `login`, `refreshToken`, `getApiKey`, and optional `modifyModels` methods. OAuth refresh is serialized so concurrent requests do not overwrite each other's credentials.
|
|
314
314
|
|
|
315
|
-
In isolated interactive mode, extension code and executable OAuth methods remain in the engine process. Atomic transports only the JSON-safe provider description (`id`, `name`, `loginLabel`, and `usesCallbackServer`) to the terminal process; it never serializes provider functions or acquired credentials and does not load the extension a second time in the frontend. The engine executes the provider's login closure and correlates browser URLs, device codes, progress/info messages, prompts, selections, and manual-code callbacks with the originating login.
|
|
315
|
+
In isolated interactive mode, extension code and executable OAuth methods remain in the engine process. Atomic transports only the JSON-safe provider description (`id`, `name`, `loginLabel`, and `usesCallbackServer`) to the terminal process; it never serializes provider functions or acquired credentials and does not load the extension a second time in the frontend. `loginLabel` replaces the login dialog title, while `usesCallbackServer: true` exposes a redirect-URL paste field that races the browser callback. The engine executes the provider's login closure and correlates browser URLs, device codes, progress/info messages, prompts, selections, and manual-code callbacks with the originating login.
|
|
316
316
|
|
|
317
317
|
After acquisition, the engine owns serialized credential persistence, model/current-model refresh, rollback on failure, and logout. The frontend applies the returned catalog only after the engine transaction succeeds. Escape or Ctrl+C cancels only the matching login and leaves the prior credential/catalog intact. Built-in OAuth and direct, non-isolated extension OAuth use the same persistence and cancellation semantics; later provider registrations continue to override earlier registrations by ID.
|
|
318
318
|
|
package/docs/models.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Custom Models
|
|
2
2
|
|
|
3
|
-
Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.atomic/agent/models.json`
|
|
4
|
-
|
|
5
|
-
When both files exist, Atomic reads the legacy `.pi` file first and the primary `.atomic` file second. For `modelOverrides`, entries are layered by provider and model ID: disjoint legacy entries remain available, while an exact primary provider/model entry replaces the complete legacy override entry. Atomic does not field-merge one override entry across files; use `{}` in the primary file to restore the built-in model values for that exact entry.
|
|
3
|
+
Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via the single `models.json` in the active Atomic agent directory, normally `~/.atomic/agent/models.json`, or the directory selected by `ATOMIC_CODING_AGENT_DIR`/`PI_CODING_AGENT_DIR`. Atomic reads only that file: it does not read project-scoped `.atomic/models.json`, fall back to `~/.pi/agent/models.json`, or merge `.pi` and `.atomic` model configuration files. The legacy `.pi` read fallback remains available for configuration surfaces that explicitly use layered config paths, such as `auth.json`; it does not apply to `models.json`.
|
|
6
4
|
|
|
7
5
|
A complete `defaultProvider`/`defaultModel` pair in `settings.json` is resolved after built-in, configured, and extension providers register. If the provider remains unsupported, interactive mode reports a generic saved-configuration warning and leaves model selection open instead of routing the session to a different provider. Print and JSON modes write that diagnostic to stderr and exit nonzero before prompting, keeping JSON stdout JSONL-clean. RPC rejects `prompt` with the same correlated diagnostic until an explicit successful `set_model` selects an available model or an explicit model cycle returns a different available model. A null or unchanged cycle result does not clear the condition. If the provider is supported but the model is unknown or lacks authentication, normal automatic selection of an available authenticated model continues. Valid custom- and extension-provider defaults resolve once their provider registration is available. See [Settings](/settings#model--thinking).
|
|
8
6
|
|
|
@@ -95,7 +93,7 @@ Override defaults when you need specific values:
|
|
|
95
93
|
}
|
|
96
94
|
```
|
|
97
95
|
|
|
98
|
-
Atomic reloads
|
|
96
|
+
Atomic reloads the active agent directory's single `models.json` each time you open `/model`. Provider definitions, per-model overrides, dynamic catalogs, and isolated-engine model state are rebuilt from that fresh configuration, so edits take effect without restarting. Invalid edits report an error.
|
|
99
97
|
|
|
100
98
|
## Google AI Studio Example
|
|
101
99
|
|
|
@@ -418,13 +416,13 @@ Use `modelOverrides` to customize specific models without replacing the provider
|
|
|
418
416
|
|
|
419
417
|
`modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost` (partial scalar rates plus optional full tier-array replacement), `contextWindow`, `maxTokens`, `headers`, `compat`.
|
|
420
418
|
|
|
421
|
-
|
|
419
|
+
Atomic reads one `models.json` from the active agent directory. It does not layer model overrides from `.pi` and `.atomic` files.
|
|
422
420
|
|
|
423
421
|
Within a single file, custom model definitions replace matching built-in entries after built-in overrides are applied. `modelOverrides` composes only with built-in and extension-registered models; it does not modify a same-ID custom model definition.
|
|
424
422
|
|
|
425
423
|
Behavior notes:
|
|
426
424
|
- Atomic retains the parsed override map even when an extension registers the matching provider/model after `models.json` is loaded.
|
|
427
|
-
-
|
|
425
|
+
- Model overrides come from the active agent directory's single `models.json`; no cross-file layering or merging is performed.
|
|
428
426
|
- For matching built-in and extension-registered models, the model definition is the base and `modelOverrides` wins configured fields. Extension-registered model headers are shallow-merged with override headers, with override headers winning duplicate names. A same-ID custom model replaces the built-in override result, including its complete header record.
|
|
429
427
|
- A scalar-only `cost` override preserves inherited tiers. Supplying `cost.tiers` replaces the complete tier array, including `[]` to clear it; omitted scalar cost fields remain inherited.
|
|
430
428
|
- Provider-level request headers remain a separate provider layer and are combined at request time.
|
package/docs/providers.md
CHANGED
|
@@ -58,6 +58,19 @@ Claude Opus 5 is available from the bundled/dynamic Anthropic and Amazon Bedrock
|
|
|
58
58
|
- Models come from the bundled `pi-ai` GitHub Copilot catalog; an OAuth credential narrows the list to the ids your account can actually use
|
|
59
59
|
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
|
|
60
60
|
|
|
61
|
+
#### Endpoint routing for `COPILOT_GITHUB_TOKEN`
|
|
62
|
+
|
|
63
|
+
OAuth logins get their Copilot host from the token GitHub issues during login. Environment-token auth has no such exchange, so Atomic resolves the host itself, highest precedence first:
|
|
64
|
+
|
|
65
|
+
1. `COPILOT_API_TARGET`, then `GITHUB_COPILOT_BASE_URL` — an explicit host or full URL
|
|
66
|
+
2. the `proxy-ep=` segment embedded in `COPILOT_GITHUB_TOKEN`
|
|
67
|
+
3. `GITHUB_SERVER_URL` — `<tenant>.ghe.com` routes to `copilot-api.<tenant>.ghe.com`; any other non-`github.com` host routes to `https://api.enterprise.githubcopilot.com`
|
|
68
|
+
4. `https://api.githubcopilot.com`, the public routing hub, which resolves your plan's host server-side
|
|
69
|
+
|
|
70
|
+
A `models.json` provider `baseUrl` for `github-copilot` overrides all of the above. Without `COPILOT_GITHUB_TOKEN` the provider is left exactly as upstream `pi-ai` defines it.
|
|
71
|
+
|
|
72
|
+
Business and enterprise tokens sent to the individual host return `421 Misdirected Request`; if you see that, set `COPILOT_API_TARGET` to the host your organization issues.
|
|
73
|
+
|
|
61
74
|
### xAI (Grok/X subscription)
|
|
62
75
|
|
|
63
76
|
Run `/login xai`, then select **Use a subscription**. `XAI_API_KEY` remains available through **Use an API key**.
|
package/docs/quickstart.md
CHANGED
|
@@ -181,7 +181,8 @@ Atomic will:
|
|
|
181
181
|
|
|
182
182
|
- ask clarifying questions if stage purpose, inputs, models, or handoffs are ambiguous,
|
|
183
183
|
- write a `.atomic/workflows/<name>.ts` definition that uses `workflow({ ... })` and imports `Type` from `typebox`,
|
|
184
|
-
-
|
|
184
|
+
- run `/workflow reload` so the generated workflow is rediscovered and can be launched with `/workflow <name>`,
|
|
185
|
+
- then report the generated workflow folder so you can inspect the code it wrote, using `Custom workflow created. You can inspect its code at: <workflow-folder-path>` (for example, `.atomic/workflows/`); Atomic does this only for newly created custom workflows, never builtin or pre-existing workflows.
|
|
185
186
|
|
|
186
187
|
The same plain-chat approach works for editing or hardening an existing workflow. For the full authoring reference, see [Workflows](/workflows), including composition with user-defined workflows and all nine builtins from `@bastani/workflows/builtin`.
|
|
187
188
|
|
package/docs/sdk.md
CHANGED
|
@@ -16,16 +16,13 @@ See [examples/sdk/](https://github.com/bastani-inc/atomic/tree/main/packages/cod
|
|
|
16
16
|
## Quick Start
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
|
-
import {
|
|
19
|
+
import { createAgentSession, ModelRuntime, SessionManager } from "@bastani/atomic";
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
const authStorage = AuthStorage.create();
|
|
23
|
-
const modelRegistry = ModelRegistry.create(authStorage);
|
|
21
|
+
const modelRuntime = await ModelRuntime.create();
|
|
24
22
|
|
|
25
23
|
const { session } = await createAgentSession({
|
|
26
24
|
sessionManager: SessionManager.inMemory(),
|
|
27
|
-
|
|
28
|
-
modelRegistry,
|
|
25
|
+
modelRuntime,
|
|
29
26
|
});
|
|
30
27
|
|
|
31
28
|
session.subscribe((event) => {
|
|
@@ -423,21 +420,19 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
|
|
|
423
420
|
|
|
424
421
|
```typescript
|
|
425
422
|
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
426
|
-
import {
|
|
423
|
+
import { ModelRuntime } from "@bastani/atomic";
|
|
427
424
|
|
|
428
|
-
const
|
|
429
|
-
const modelRegistry = ModelRegistry.create(authStorage);
|
|
425
|
+
const modelRuntime = await ModelRuntime.create();
|
|
430
426
|
|
|
431
|
-
// Find specific built-in model (doesn't check if
|
|
427
|
+
// Find specific built-in model (doesn't check if credentials exist)
|
|
432
428
|
const opus = getModel("anthropic", "claude-opus-4-5");
|
|
433
429
|
if (!opus) throw new Error("Model not found");
|
|
434
430
|
|
|
435
431
|
// Find any model by provider/id, including custom models from models.json
|
|
436
|
-
|
|
437
|
-
const customModel = modelRegistry.find("my-provider", "my-model");
|
|
432
|
+
const customModel = modelRuntime.getModel("my-provider", "my-model");
|
|
438
433
|
|
|
439
|
-
// Get only models
|
|
440
|
-
const available = await
|
|
434
|
+
// Get only models whose providers have configured authentication
|
|
435
|
+
const available = await modelRuntime.getAvailable();
|
|
441
436
|
|
|
442
437
|
const { session } = await createAgentSession({
|
|
443
438
|
model: opus,
|
|
@@ -449,12 +444,11 @@ const { session } = await createAgentSession({
|
|
|
449
444
|
{ model: haiku, thinkingLevel: "off" },
|
|
450
445
|
],
|
|
451
446
|
|
|
452
|
-
|
|
453
|
-
modelRegistry,
|
|
447
|
+
modelRuntime,
|
|
454
448
|
});
|
|
455
449
|
```
|
|
456
450
|
|
|
457
|
-
`ModelRegistry` keeps synchronous reads for
|
|
451
|
+
`ModelRegistry` keeps synchronous reads for extension compatibility, while catalog refresh is asynchronous. Extensions should await `modelRegistry.refresh()` before synchronous `getAll()`, `find()`, or `getAvailable()` reads when a provider may update its catalog. New SDK integrations use `ModelRuntime`; `await modelRuntime.refresh()` reports `aborted` and per-provider `errors`, and failed providers retain their last-known models.
|
|
458
452
|
|
|
459
453
|
If no model is provided:
|
|
460
454
|
1. Tries to restore from session (if continuing)
|
|
@@ -465,48 +459,40 @@ If no model is provided:
|
|
|
465
459
|
|
|
466
460
|
### API Keys and OAuth
|
|
467
461
|
|
|
468
|
-
`
|
|
462
|
+
`ModelRuntime` is the asynchronous SDK engine for provider composition, credentials, model catalogs, and requests. `ModelRegistry` remains a thin synchronous compatibility facade for extensions; new SDK integrations should pass `modelRuntime` to `createAgentSession`.
|
|
469
463
|
|
|
470
|
-
API
|
|
471
|
-
1. Runtime overrides (via `setRuntimeApiKey`, not persisted)
|
|
472
|
-
2. Stored credentials in `auth.json` (API keys or OAuth tokens)
|
|
473
|
-
3. Environment variables (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc.)
|
|
474
|
-
4. Fallback resolver (for custom provider keys from `models.json`)
|
|
475
|
-
|
|
476
|
-
OAuth credentials may provide an API key, request headers, and a credential-specific `baseUrl`. Atomic applies all three to the request. In particular, GitHub Copilot enterprise and token-specific endpoints replace the static model URL without dropping retries, attribution headers, fast mode, or extension request hooks.
|
|
464
|
+
Credential resolution combines runtime API-key overrides, stored `auth.json` credentials, environment variables, and the active `models.json` provider configuration. OAuth acquisition is provider-owned and runs through `ModelRuntime.login()`.
|
|
477
465
|
|
|
478
466
|
```typescript
|
|
479
|
-
import { AuthStorage,
|
|
467
|
+
import { AuthStorage, ModelRuntime } from "@bastani/atomic";
|
|
480
468
|
|
|
481
|
-
// Default: uses ~/.atomic/agent/auth.json and ~/.atomic/agent/models.json,
|
|
482
|
-
// with legacy ~/.pi/agent/* compatibility reads when available.
|
|
483
469
|
const authStorage = AuthStorage.create();
|
|
484
|
-
const
|
|
470
|
+
const modelRuntime = await ModelRuntime.create({ credentials: authStorage });
|
|
485
471
|
|
|
486
472
|
const { session } = await createAgentSession({
|
|
487
473
|
sessionManager: SessionManager.inMemory(),
|
|
488
|
-
|
|
489
|
-
modelRegistry,
|
|
474
|
+
modelRuntime,
|
|
490
475
|
});
|
|
491
476
|
|
|
492
477
|
// Runtime API key override (not persisted to disk)
|
|
493
|
-
|
|
478
|
+
await modelRuntime.setRuntimeApiKey("anthropic", "sk-my-temp-key");
|
|
494
479
|
|
|
495
|
-
// Custom
|
|
496
|
-
const
|
|
497
|
-
|
|
480
|
+
// Custom credential and model configuration locations
|
|
481
|
+
const customRuntime = await ModelRuntime.create({
|
|
482
|
+
authPath: "/my/app/auth.json",
|
|
483
|
+
modelsPath: "/my/app/models.json",
|
|
484
|
+
});
|
|
498
485
|
|
|
499
|
-
const
|
|
486
|
+
const customSession = await createAgentSession({
|
|
500
487
|
sessionManager: SessionManager.inMemory(),
|
|
501
|
-
|
|
502
|
-
modelRegistry: customRegistry,
|
|
488
|
+
modelRuntime: customRuntime,
|
|
503
489
|
});
|
|
504
490
|
|
|
505
|
-
//
|
|
506
|
-
const
|
|
491
|
+
// Disable models.json while retaining built-in providers
|
|
492
|
+
const builtinsOnly = await ModelRuntime.create({ modelsPath: null });
|
|
507
493
|
```
|
|
508
494
|
|
|
509
|
-
> See [
|
|
495
|
+
> See the complete [`ModelRuntime` credential and model configuration example](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/sdk/09-api-keys-and-oauth.ts).
|
|
510
496
|
|
|
511
497
|
### System Prompt
|
|
512
498
|
|
|
@@ -1014,22 +1000,20 @@ import {
|
|
|
1014
1000
|
createAgentSession,
|
|
1015
1001
|
DefaultResourceLoader,
|
|
1016
1002
|
defineTool,
|
|
1017
|
-
|
|
1003
|
+
ModelRuntime,
|
|
1018
1004
|
SessionManager,
|
|
1019
1005
|
SettingsManager,
|
|
1020
1006
|
} from "@bastani/atomic";
|
|
1021
1007
|
|
|
1022
|
-
//
|
|
1008
|
+
// Create a runtime with custom credential storage and no models.json.
|
|
1023
1009
|
const authStorage = AuthStorage.create("/custom/agent/auth.json");
|
|
1010
|
+
const modelRuntime = await ModelRuntime.create({ credentials: authStorage, modelsPath: null });
|
|
1024
1011
|
|
|
1025
1012
|
// Runtime API key override (not persisted)
|
|
1026
1013
|
if (process.env.MY_KEY) {
|
|
1027
|
-
|
|
1014
|
+
await modelRuntime.setRuntimeApiKey("anthropic", process.env.MY_KEY);
|
|
1028
1015
|
}
|
|
1029
1016
|
|
|
1030
|
-
// Model registry (no custom models.json)
|
|
1031
|
-
const modelRegistry = ModelRegistry.create(authStorage);
|
|
1032
|
-
|
|
1033
1017
|
// Inline tool
|
|
1034
1018
|
const statusTool = defineTool({
|
|
1035
1019
|
name: "status",
|
|
@@ -1065,8 +1049,7 @@ const { session } = await createAgentSession({
|
|
|
1065
1049
|
|
|
1066
1050
|
model,
|
|
1067
1051
|
thinkingLevel: "off",
|
|
1068
|
-
|
|
1069
|
-
modelRegistry,
|
|
1052
|
+
modelRuntime,
|
|
1070
1053
|
|
|
1071
1054
|
tools: ["read", "bash", "status"],
|
|
1072
1055
|
customTools: [statusTool],
|
package/docs/tui.md
CHANGED
|
@@ -501,10 +501,13 @@ interface MyTheme {
|
|
|
501
501
|
|
|
502
502
|
## Debug logging
|
|
503
503
|
|
|
504
|
-
Set `
|
|
504
|
+
Set `PI_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout. The
|
|
505
|
+
variable is read by the vendored `@earendil-works/pi-tui` terminal, so it keeps
|
|
506
|
+
its upstream name; a directory path writes one `tui-<timestamp>-<pid>.log` file
|
|
507
|
+
per process.
|
|
505
508
|
|
|
506
509
|
```bash
|
|
507
|
-
|
|
510
|
+
PI_TUI_WRITE_LOG=/tmp/tui-ansi.log atomic
|
|
508
511
|
```
|
|
509
512
|
|
|
510
513
|
Atomic vendors TUI components through the installed `@earendil-works/pi-tui` dependency.
|
|
@@ -821,6 +824,8 @@ ctx.ui.setWorkingIndicator();
|
|
|
821
824
|
|
|
822
825
|
This affects the normal Working indicator from accepted prompt submission through response streaming. Working appears immediately during attachment and other pre-stream startup, then continues without a visible gap when the agent turn begins. A no-turn result, prompt failure, or turn completion removes it. An accepted manual retry clears stale status from the prior prompt before showing new pre-stream activity. Factual automatic retry and fallback status takes precedence while that transition is active; ordinary Working resumes only when a later Working lifecycle actually starts. With no extension override, Atomic renders the exact one-cell `∀` immediately before one of its 453 original randomized whimsical working verbs, selected once per turn. Every agent and SDK turn starts at regular weight with a fresh lifecycle-relative 88ms cadence, then follows a ten-frame, theme-aware dark → accent → bright/bold → accent → dark luminance ramp without changing glyph or geometry. Optional theme tone overrides control any desired phases exactly, including terminal palette indices 0–255; Atomic derives omitted tones from selected-surface, `accent`, and `text` roles. Dark, light, custom, and dynamically reloaded themes therefore retain their own palette. Under `NO_COLOR`, the same cadence remains visible through regular/bold weight without foreground-color escapes. Turn completion and terminal cleanup stop the timer cleanly. Restoring Atomic's default after an extension override also restarts at the dark regular phase; custom extension frames and intervals remain unchanged and render verbatim. `ATOMIC_REDUCED_MOTION=1` shows a static regular accent `∀` without an animation timer. The icon and longest message fit standard and 64-column widths. Factual status copy takes precedence. Compaction and retry loaders keep their plain built-in styling. During successful post-tool autocompaction, Atomic temporarily replaces the Working indicator with the compaction loader and restores it before the same stream continues; no additional user input is required.
|
|
823
826
|
|
|
827
|
+
Post-tool autocompaction is more precisely delimited by its own event pair. Pi opens the follow-up turn while the compaction is still unmatched, so the compaction status — not a generic Working message — owns the status surface from `compaction_start` until `compaction_end`, and the interposed turn does not take it back early. The status paints as soon as the compaction starts rather than on the next animation frame, in the main chat and in an attached workflow-stage chat alike. Ordinary Working then resumes for the continuing stream on any successful mid-turn completion, including a compaction that found nothing to compact and therefore reports no result. A cancelled or failed compaction stops all activity instead. The main chat reports automatic cancellation; an attached workflow-stage chat clears the transient status because the abort event carries no error text. Failures retain their event-provided error text.
|
|
828
|
+
|
|
824
829
|
**Examples:** [working-indicator.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/working-indicator.ts)
|
|
825
830
|
|
|
826
831
|
### Pattern 5: Widgets Above/Below Editor
|
package/docs/workflows.md
CHANGED
|
@@ -99,7 +99,8 @@ Atomic will:
|
|
|
99
99
|
- write a `.atomic/workflows/<name>.ts` file using `workflow({...})`,
|
|
100
100
|
- pick `ctx.task` / `ctx.chain` / `ctx.parallel` / `ctx.ui` per the [WorkflowContext primitives](#workflowcontext) and [task options](#task-and-stage-options) reference,
|
|
101
101
|
- use `ctx.tool(name, args, fn)` for workflow-owned side effects so completed operations are durably checkpointed and do not run again after resume (see [`ctx.tool`](#ctxtool--durable-cached-tool-execution)),
|
|
102
|
-
- run `/workflow reload` so Atomic rediscovers the workflow resource and you can launch it immediately
|
|
102
|
+
- run `/workflow reload` so Atomic rediscovers the workflow resource and you can launch it immediately,
|
|
103
|
+
- then report the generated workflow folder so you can inspect the code it wrote, using `Custom workflow created. You can inspect its code at: <workflow-folder-path>` (for example, `.atomic/workflows/`); Atomic does this only for newly created custom workflows, never builtin or pre-existing workflows.
|
|
103
104
|
|
|
104
105
|
|
|
105
106
|
You can also edit or harden an existing workflow in plain chat — ask Atomic to add a stage, switch a model, save artifacts, or wire in a human approval gate.
|
|
@@ -2333,8 +2334,7 @@ Select the stage working directory and agent configuration directory. Worktree-e
|
|
|
2333
2334
|
```typescript
|
|
2334
2335
|
// Runtime StageOptions forwards non-workflow CreateAgentSessionOptions,
|
|
2335
2336
|
// including these advanced host integration fields:
|
|
2336
|
-
readonly
|
|
2337
|
-
readonly modelRegistry?: CreateAgentSessionOptions["modelRegistry"];
|
|
2337
|
+
readonly modelRuntime?: CreateAgentSessionOptions["modelRuntime"];
|
|
2338
2338
|
readonly resourceLoader?: CreateAgentSessionOptions["resourceLoader"];
|
|
2339
2339
|
readonly sessionManager?: SessionManager;
|
|
2340
2340
|
readonly settingsManager?: SettingsManager;
|
|
@@ -2819,7 +2819,7 @@ Surface behavior:
|
|
|
2819
2819
|
- **Wheel and trackpad** - While the workflow graph is active, vertical wheel/trackpad gestures pan it up and down, and horizontal gestures pan wide graphs left and right when the terminal exposes horizontal wheel events; these gestures remain scoped to the graph instead of leaking into the main chat or terminal scrollback. Attached stage chats capture mouse/trackpad wheel events by default so scrolling stays inside the active stage transcript or prompt instead of falling through to terminal/main-chat scrollback.
|
|
2820
2820
|
- **Tool and node detail** - Attached stage chats match main chat's tool-detail expansion behavior while keeping expansion state local to the workflow UI context. Press Ctrl+O (the configurable `app.tools.expand` binding) to expand every visible workflow node and tool card, including single, parallel, and chain subagent progress, current tool activity, and artifact paths; press it again to collapse them. The toggle works for active, completed, and archived stage views, including at the supported 40-column terminal minimum. A mounted prompt, custom question, or other input-owning overlay keeps the key instead of changing expansion.
|
|
2821
2821
|
- **Footer context** - An attached live stage chat carries the main chat's current-folder and Git-branch identity into its themed footer and mirrors live extension status lines such as the MCP server indicator. Branch changes trigger a repaint through the host's cached footer provider, and extension status changes are read from that same provider rather than recomputed by the workflow UI.
|
|
2822
|
-
- **Working animation lifecycle** - Ordinary attached-stage work keeps the same exact one-cell `∀` visible while following the active workflow theme's dark → accent → bright/bold → accent → dark luminance ramp every 88ms. Every agent and SDK turn resets to the dark regular phase with a fresh lifecycle-relative cadence; turn, terminal, error, replacement, and disposal cleanup stop the active timer without stale repaint. In an eligible retained
|
|
2822
|
+
- **Working animation lifecycle** - Ordinary attached-stage work keeps the same exact one-cell `∀` visible while following the active workflow theme's dark → accent → bright/bold → accent → dark luminance ramp every 88ms. Every agent and SDK turn resets to the dark regular phase with a fresh lifecycle-relative cadence; turn, terminal, error, replacement, and disposal cleanup stop the active timer without stale repaint. In an eligible retained-stage chat, every accepted idle follow-up — including a workflow-authored `stage.sendUserMessage(...)` after a prior turn ended — shows Working on admission or attach, including while Atomic restores a saved retained conversation, and keeps it through prompt startup, pre-turn compaction, and agent handoff. Attaching or remounting mid-delivery paints immediately rather than waiting for the turn's first event. A message queued into a live turn with `followUp`/`steer` uses that turn's existing status instead of starting a new one. A no-turn result, prompt or restore error, or terminal completion removes it; once the last accepted post-terminal delivery settles, a leftover start cannot bring it back. An accepted manual retry clears stale status from the prior prompt before showing new pre-stream activity. `NO_COLOR` retains regular/bold activity without foreground-color escapes. Reduced motion uses a static regular accent `∀` without an animation timer; factual automatic retry, fallback, compaction, cancellation, and error copy retains precedence.
|
|
2823
2823
|
- **Async statusline** - If an async/background subagent is running while the fullscreen workflow graph is open, the graph statusline mirrors the async summary so the background run remains visible; hide the graph with `h`, leave it with `ctrl+x`, or reconnect later to return to the full below-editor async widget.
|
|
2824
2824
|
- **Copy mode** - Press `ctrl+t` inside an attached stage chat to toggle **copy mode**: copy mode disables workflow-chat mouse reporting so normal terminal/tmux text selection can work; press `ctrl+t` again to leave copy mode and restore transcript or prompt scrolling. Archived read-only stage transcripts expose the same footer and copy-mode status, so their text can also be selected and copied; `esc` closes the transcript and `ctrl+x` returns to the graph. While copy mode is on, wheel/trackpad gestures are handled by the terminal/tmux and may scroll terminal scrollback, so leave copy mode before using the wheel again.
|
|
2825
2825
|
- **Run control** - Use `interrupt`, `pause`, and `resume` for resumable live work. Pause/interrupt holds a stage's queued steering and follow-up items in place without dequeuing them or starting continuation; `resume` releases those items once in their existing per-queue order, but queue release alone does not start a model turn. `resume` on a non-paused run reopens the saved snapshot or overlay. Use `quit` to pause a live run gracefully while preserving it for `/workflow resume`.
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
8
|
-
import {
|
|
8
|
+
import { createAgentSession, ModelRuntime } from "@bastani/atomic";
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
const modelRegistry = ModelRegistry.create(authStorage);
|
|
10
|
+
// ModelRuntime owns credential resolution and built-in/custom model discovery.
|
|
11
|
+
const modelRuntime = await ModelRuntime.create();
|
|
13
12
|
|
|
14
13
|
// Option 1: Find a specific built-in model by provider/id
|
|
15
14
|
const opus = getModel("anthropic", "claude-opus-4-5");
|
|
@@ -17,14 +16,14 @@ if (opus) {
|
|
|
17
16
|
console.log(`Found model: ${opus.provider}/${opus.id}`);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
// Option 2: Find model
|
|
21
|
-
const customModel =
|
|
19
|
+
// Option 2: Find a model from the runtime (includes custom models from models.json)
|
|
20
|
+
const customModel = modelRuntime.getModel("my-provider", "my-model");
|
|
22
21
|
if (customModel) {
|
|
23
22
|
console.log(`Found custom model: ${customModel.provider}/${customModel.id}`);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
// Option 3: Pick from available models (have valid
|
|
27
|
-
const available = await
|
|
25
|
+
// Option 3: Pick from available models (have valid credentials)
|
|
26
|
+
const available = await modelRuntime.getAvailable();
|
|
28
27
|
console.log(
|
|
29
28
|
"Available models:",
|
|
30
29
|
available.map((m) => `${m.provider}/${m.id}`),
|
|
@@ -34,8 +33,7 @@ if (available.length > 0) {
|
|
|
34
33
|
const { session } = await createAgentSession({
|
|
35
34
|
model: available[0],
|
|
36
35
|
thinkingLevel: "medium", // off, low, medium, high
|
|
37
|
-
|
|
38
|
-
modelRegistry,
|
|
36
|
+
modelRuntime,
|
|
39
37
|
});
|
|
40
38
|
|
|
41
39
|
try {
|