typeclaw 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/agent/attention-escalation.d.ts +18 -0
- package/dist/types/agent/auth.d.ts +7 -0
- package/dist/types/agent/compaction.d.ts +8 -0
- package/dist/types/agent/git-nudge.d.ts +6 -0
- package/dist/types/agent/guard-types.d.ts +25 -0
- package/dist/types/agent/guards.d.ts +7 -0
- package/dist/types/agent/idle-compaction.d.ts +7 -0
- package/dist/types/agent/index.d.ts +163 -0
- package/dist/types/agent/live-subagents.d.ts +113 -0
- package/dist/types/agent/llm-replay-sanitizer.d.ts +11 -0
- package/dist/types/agent/loop-guard.d.ts +67 -0
- package/dist/types/agent/model-fallback.d.ts +29 -0
- package/dist/types/agent/model-overrides.d.ts +8 -0
- package/dist/types/agent/multimodal/index.d.ts +2 -0
- package/dist/types/agent/multimodal/look-at.d.ts +60 -0
- package/dist/types/agent/multimodal/looker.d.ts +61 -0
- package/dist/types/agent/multimodal/read-redirect.d.ts +6 -0
- package/dist/types/agent/network/response-body.d.ts +1 -0
- package/dist/types/agent/network/safe-http.d.ts +46 -0
- package/dist/types/agent/plugin-tools.d.ts +129 -0
- package/dist/types/agent/proactive-next-step-nudge.d.ts +2 -0
- package/dist/types/agent/prompt-cache-key.d.ts +3 -0
- package/dist/types/agent/provider-error.d.ts +23 -0
- package/dist/types/agent/reload-tool.d.ts +10 -0
- package/dist/types/agent/restart/index.d.ts +31 -0
- package/dist/types/agent/restart-handoff/index.d.ts +32 -0
- package/dist/types/agent/restart-handoff/paths.d.ts +1 -0
- package/dist/types/agent/retry-same-ref.d.ts +41 -0
- package/dist/types/agent/reviewer-activity.d.ts +3 -0
- package/dist/types/agent/reviewer-bash-policy.d.ts +8 -0
- package/dist/types/agent/self.d.ts +1 -0
- package/dist/types/agent/session-meta.d.ts +28 -0
- package/dist/types/agent/session-origin.d.ts +65 -0
- package/dist/types/agent/subagent-cache-keepalive.d.ts +38 -0
- package/dist/types/agent/subagent-completion-reminder.d.ts +29 -0
- package/dist/types/agent/subagent-drain.d.ts +25 -0
- package/dist/types/agent/subagent-session.d.ts +3 -0
- package/dist/types/agent/subagents.d.ts +153 -0
- package/dist/types/agent/system-prompt.d.ts +7 -0
- package/dist/types/agent/throttle-circuit.d.ts +25 -0
- package/dist/types/agent/todo/continuation-policy.d.ts +54 -0
- package/dist/types/agent/todo/continuation-state.d.ts +11 -0
- package/dist/types/agent/todo/continuation-wiring.d.ts +32 -0
- package/dist/types/agent/todo/continuation.d.ts +21 -0
- package/dist/types/agent/todo/scope.d.ts +6 -0
- package/dist/types/agent/todo/store.d.ts +16 -0
- package/dist/types/agent/tool-error-remediation.d.ts +1 -0
- package/dist/types/agent/tool-file-safety.d.ts +78 -0
- package/dist/types/agent/tool-not-found-nudge.d.ts +9 -0
- package/dist/types/agent/tool-result-budget.d.ts +15 -0
- package/dist/types/agent/tools/channel-disengage.d.ts +18 -0
- package/dist/types/agent/tools/channel-edit.d.ts +19 -0
- package/dist/types/agent/tools/channel-fetch-attachment.d.ts +36 -0
- package/dist/types/agent/tools/channel-handoff.d.ts +13 -0
- package/dist/types/agent/tools/channel-history-render.d.ts +3 -0
- package/dist/types/agent/tools/channel-history.d.ts +25 -0
- package/dist/types/agent/tools/channel-log.d.ts +5 -0
- package/dist/types/agent/tools/channel-react.d.ts +23 -0
- package/dist/types/agent/tools/channel-read.d.ts +27 -0
- package/dist/types/agent/tools/channel-reply.d.ts +47 -0
- package/dist/types/agent/tools/channel-send.d.ts +42 -0
- package/dist/types/agent/tools/channel-session-search.d.ts +10 -0
- package/dist/types/agent/tools/curl-impersonate.d.ts +37 -0
- package/dist/types/agent/tools/ddg.d.ts +18 -0
- package/dist/types/agent/tools/grant-role.d.ts +25 -0
- package/dist/types/agent/tools/keyed-semaphore.d.ts +10 -0
- package/dist/types/agent/tools/post-github-review.d.ts +38 -0
- package/dist/types/agent/tools/restart.d.ts +25 -0
- package/dist/types/agent/tools/runtime-notice.d.ts +3 -0
- package/dist/types/agent/tools/search-retry.d.ts +16 -0
- package/dist/types/agent/tools/skip-response.d.ts +17 -0
- package/dist/types/agent/tools/spawn-subagent.d.ts +77 -0
- package/dist/types/agent/tools/stream-snapshot.d.ts +23 -0
- package/dist/types/agent/tools/subagent-access.d.ts +20 -0
- package/dist/types/agent/tools/subagent-cancel.d.ts +23 -0
- package/dist/types/agent/tools/subagent-output.d.ts +50 -0
- package/dist/types/agent/tools/todo/index.d.ts +14 -0
- package/dist/types/agent/tools/webfetch/adaptive-html.d.ts +29 -0
- package/dist/types/agent/tools/webfetch/fetch.d.ts +26 -0
- package/dist/types/agent/tools/webfetch/html-lexical.d.ts +27 -0
- package/dist/types/agent/tools/webfetch/index.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/inline-style-visibility.d.ts +3 -0
- package/dist/types/agent/tools/webfetch/strategies/grep.d.ts +11 -0
- package/dist/types/agent/tools/webfetch/strategies/jq.d.ts +4 -0
- package/dist/types/agent/tools/webfetch/strategies/raw.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/strategies/readability.d.ts +16 -0
- package/dist/types/agent/tools/webfetch/strategies/selector.d.ts +4 -0
- package/dist/types/agent/tools/webfetch/strategies/snapshot.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/tool.d.ts +15 -0
- package/dist/types/agent/tools/webfetch/types.d.ts +32 -0
- package/dist/types/agent/tools/websearch.d.ts +17 -0
- package/dist/types/agent/tools/wikipedia.d.ts +7 -0
- package/dist/types/agent/tools-without-local-file-operands.d.ts +1 -0
- package/dist/types/agent/turn-runner.d.ts +36 -0
- package/dist/types/agent-messenger/config-dir.d.ts +19 -0
- package/dist/types/browser/dockerfile.d.ts +2 -0
- package/dist/types/browser/registry.d.ts +49 -0
- package/dist/types/bundled-plugins/bun-hygiene/policy.d.ts +18 -0
- package/dist/types/bundled-plugins/github-cli-auth/git-askpass.d.ts +5 -0
- package/dist/types/bundled-plugins/guard/keys.d.ts +6 -0
- package/dist/types/bundled-plugins/guard/policies/managed-config.d.ts +7 -0
- package/dist/types/bundled-plugins/guard/policies/memory-topics-delete.d.ts +11 -0
- package/dist/types/bundled-plugins/guard/policies/memory-topics-write.d.ts +7 -0
- package/dist/types/bundled-plugins/guard/policies/non-workspace-write.d.ts +9 -0
- package/dist/types/bundled-plugins/guard/policies/skill-authoring.d.ts +20 -0
- package/dist/types/bundled-plugins/guard/policies/uncommitted-changes.d.ts +12 -0
- package/dist/types/bundled-plugins/guard/policy.d.ts +11 -0
- package/dist/types/bundled-plugins/memory/secret-detector.d.ts +11 -0
- package/dist/types/bundled-plugins/memory/slug.d.ts +4 -0
- package/dist/types/bundled-plugins/security/permissions.d.ts +20 -0
- package/dist/types/bundled-plugins/security/policies/private-surface-read.d.ts +34 -0
- package/dist/types/bundled-plugins/security/policies/ssrf.d.ts +18 -0
- package/dist/types/bundled-plugins/security/policy.d.ts +4 -0
- package/dist/types/channels/adapter-namespace.d.ts +2 -0
- package/dist/types/channels/adapters/mention-hints.d.ts +12 -0
- package/dist/types/channels/adapters/webex-id-ref.d.ts +5 -0
- package/dist/types/channels/background-handoff.d.ts +56 -0
- package/dist/types/channels/background-obligations.d.ts +135 -0
- package/dist/types/channels/catch-up.d.ts +26 -0
- package/dist/types/channels/commands.d.ts +2 -0
- package/dist/types/channels/completion-claim.d.ts +20 -0
- package/dist/types/channels/continuation-willingness.d.ts +1 -0
- package/dist/types/channels/continuity-types.d.ts +75 -0
- package/dist/types/channels/describe-error.d.ts +1 -0
- package/dist/types/channels/engagement.d.ts +34 -0
- package/dist/types/channels/github-false-receipt.d.ts +20 -0
- package/dist/types/channels/github-repo.d.ts +2 -0
- package/dist/types/channels/github-rereview-guard.d.ts +24 -0
- package/dist/types/channels/github-review-check.d.ts +135 -0
- package/dist/types/channels/github-review-claim.d.ts +3 -0
- package/dist/types/channels/github-review-turn-ledger.d.ts +71 -0
- package/dist/types/channels/github-review-verdict-coordinator.d.ts +117 -0
- package/dist/types/channels/github-token-bridge.d.ts +20 -0
- package/dist/types/channels/github-verdict-activity.d.ts +12 -0
- package/dist/types/channels/inbound-journal.d.ts +272 -0
- package/dist/types/channels/last-alive.d.ts +3 -0
- package/dist/types/channels/membership-cache.d.ts +27 -0
- package/dist/types/channels/membership.d.ts +21 -0
- package/dist/types/channels/outbound-flood-filter.d.ts +7 -0
- package/dist/types/channels/participants.d.ts +4 -0
- package/dist/types/channels/persistence.d.ts +32 -0
- package/dist/types/channels/recovery-notice.d.ts +26 -0
- package/dist/types/channels/recovery-outbox.d.ts +58 -0
- package/dist/types/channels/router.d.ts +798 -0
- package/dist/types/channels/schema.d.ts +501 -0
- package/dist/types/channels/session-handoff.d.ts +58 -0
- package/dist/types/channels/session-search.d.ts +29 -0
- package/dist/types/channels/types.d.ts +414 -0
- package/dist/types/channels/waiting-reactions.d.ts +25 -0
- package/dist/types/cli/builtins.d.ts +2 -0
- package/dist/types/cli/command-meta.d.ts +9 -0
- package/dist/types/coding-agent/broker-body.d.ts +7 -0
- package/dist/types/coding-agent/broker.d.ts +22 -0
- package/dist/types/coding-agent/claude.d.ts +22 -0
- package/dist/types/coding-agent/codex.d.ts +19 -0
- package/dist/types/coding-agent/index.d.ts +71 -0
- package/dist/types/coding-agent/omo-state.d.ts +2 -0
- package/dist/types/coding-agent/omo-stream.d.ts +22 -0
- package/dist/types/coding-agent/omo.d.ts +133 -0
- package/dist/types/coding-agent/runner.d.ts +35 -0
- package/dist/types/coding-agent/tool.d.ts +27 -0
- package/dist/types/coding-agent/worktree.d.ts +22 -0
- package/dist/types/commands/index.d.ts +45 -0
- package/dist/types/config/config.d.ts +814 -0
- package/dist/types/config/index.d.ts +3 -0
- package/dist/types/config/model-overrides.d.ts +3 -0
- package/dist/types/config/providers.d.ts +1456 -0
- package/dist/types/config/reloadable.d.ts +9 -0
- package/dist/types/container/agent-operation-lock.d.ts +31 -0
- package/dist/types/container/build-cache.d.ts +39 -0
- package/dist/types/container/compose-project.d.ts +1 -0
- package/dist/types/container/controller.d.ts +25 -0
- package/dist/types/container/docker-app.d.ts +23 -0
- package/dist/types/container/exit-reason.d.ts +10 -0
- package/dist/types/container/index.d.ts +14 -0
- package/dist/types/container/log-archive.d.ts +68 -0
- package/dist/types/container/log-colors.d.ts +3 -0
- package/dist/types/container/log-timestamps.d.ts +9 -0
- package/dist/types/container/logs.d.ts +37 -0
- package/dist/types/container/memory-limit.d.ts +13 -0
- package/dist/types/container/memory-oversubscription.d.ts +20 -0
- package/dist/types/container/oom-events.d.ts +18 -0
- package/dist/types/container/port.d.ts +18 -0
- package/dist/types/container/require-running.d.ts +16 -0
- package/dist/types/container/restart.d.ts +32 -0
- package/dist/types/container/shared.d.ts +93 -0
- package/dist/types/container/shell.d.ts +35 -0
- package/dist/types/container/start.d.ts +144 -0
- package/dist/types/container/stats.d.ts +31 -0
- package/dist/types/container/status.d.ts +25 -0
- package/dist/types/container/stop.d.ts +24 -0
- package/dist/types/container/tool-oom-priority.d.ts +4 -0
- package/dist/types/container/verify-running.d.ts +49 -0
- package/dist/types/cron/consumer.d.ts +42 -0
- package/dist/types/cron/count-state.d.ts +24 -0
- package/dist/types/cron/index.d.ts +21 -0
- package/dist/types/cron/list.d.ts +33 -0
- package/dist/types/cron/reloadable.d.ts +11 -0
- package/dist/types/cron/scheduler.d.ts +51 -0
- package/dist/types/cron/schema.d.ts +108 -0
- package/dist/types/dependencies/bin-resolver.d.ts +28 -0
- package/dist/types/dependencies/bins.d.ts +22 -0
- package/dist/types/dependencies/index.d.ts +2 -0
- package/dist/types/git/bound-gc-config.d.ts +4 -0
- package/dist/types/git/hookless.d.ts +1 -0
- package/dist/types/git/reconcile-ignored.d.ts +13 -0
- package/dist/types/git/resolve-agent-git.d.ts +8 -0
- package/dist/types/git/resolve-identity.d.ts +10 -0
- package/dist/types/git/run.d.ts +24 -0
- package/dist/types/git/system-commit.d.ts +2 -0
- package/dist/types/hostd/client.d.ts +13 -0
- package/dist/types/hostd/models.d.ts +1 -0
- package/dist/types/hostd/paths.d.ts +17 -0
- package/dist/types/hostd/protocol.d.ts +93 -0
- package/dist/types/hostd/spawn.d.ts +17 -0
- package/dist/types/hostd/version.d.ts +18 -0
- package/dist/types/init/auto-upgrade.d.ts +41 -0
- package/dist/types/init/cli-version.d.ts +7 -0
- package/dist/types/init/dockerfile.d.ts +34 -0
- package/dist/types/init/ensure-deps.d.ts +17 -0
- package/dist/types/init/env-file.d.ts +3 -0
- package/dist/types/init/gitignore.d.ts +5 -0
- package/dist/types/init/local-source-stamp.d.ts +3 -0
- package/dist/types/init/packagejson.d.ts +7 -0
- package/dist/types/init/paths.d.ts +3 -0
- package/dist/types/init/reconcile-plugin-deps.d.ts +13 -0
- package/dist/types/init/run-bun-install.d.ts +16 -0
- package/dist/types/init/windows-dev-link.d.ts +8 -0
- package/dist/types/mcp/catalog.d.ts +7 -0
- package/dist/types/mcp/client.d.ts +58 -0
- package/dist/types/mcp/manager.d.ts +56 -0
- package/dist/types/mcp/tools.d.ts +23 -0
- package/dist/types/models/embedding-model.d.ts +20 -0
- package/dist/types/models/transformers-version.d.ts +1 -0
- package/dist/types/network/internal-destinations.d.ts +29 -0
- package/dist/types/operations/classify-tool-outcome.d.ts +35 -0
- package/dist/types/operations/incidents.d.ts +47 -0
- package/dist/types/operations/index.d.ts +3 -0
- package/dist/types/operations/remediations.d.ts +25 -0
- package/dist/types/path-safety/real-intended-path.d.ts +9 -0
- package/dist/types/permissions/builtins.d.ts +25 -0
- package/dist/types/permissions/grant.d.ts +19 -0
- package/dist/types/permissions/index.d.ts +6 -0
- package/dist/types/permissions/match-rule.d.ts +28 -0
- package/dist/types/permissions/permissions.d.ts +42 -0
- package/dist/types/permissions/resolve.d.ts +25 -0
- package/dist/types/permissions/schema.d.ts +14 -0
- package/dist/types/plugin/context.d.ts +20 -0
- package/dist/types/plugin/core-tool-names.d.ts +4 -0
- package/dist/types/plugin/define.d.ts +46 -0
- package/dist/types/plugin/hooks.d.ts +52 -0
- package/dist/types/plugin/index.d.ts +11 -0
- package/dist/types/plugin/load-skill.d.ts +14 -0
- package/dist/types/plugin/loader.d.ts +25 -0
- package/dist/types/plugin/manager.d.ts +42 -0
- package/dist/types/plugin/registry.d.ts +73 -0
- package/dist/types/plugin/skills.d.ts +11 -0
- package/dist/types/plugin/types.d.ts +336 -0
- package/dist/types/plugin/zod-introspect.d.ts +11 -0
- package/dist/types/reload/client.d.ts +11 -0
- package/dist/types/reload/docker-exec-client.d.ts +11 -0
- package/dist/types/reload/format.d.ts +2 -0
- package/dist/types/reload/index.d.ts +6 -0
- package/dist/types/reload/recover.d.ts +22 -0
- package/dist/types/reload/registry.d.ts +10 -0
- package/dist/types/reload/types.d.ts +25 -0
- package/dist/types/role-claim/client.d.ts +20 -0
- package/dist/types/role-claim/code.d.ts +4 -0
- package/dist/types/role-claim/controller.d.ts +59 -0
- package/dist/types/role-claim/index.d.ts +6 -0
- package/dist/types/role-claim/match-rule.d.ts +9 -0
- package/dist/types/role-claim/pending.d.ts +35 -0
- package/dist/types/role-claim/reload-after-claim.d.ts +16 -0
- package/dist/types/run/llm-fetch-observer.d.ts +50 -0
- package/dist/types/sandbox/availability.d.ts +21 -0
- package/dist/types/sandbox/build.d.ts +7 -0
- package/dist/types/sandbox/canonical-secrets.d.ts +8 -0
- package/dist/types/sandbox/coding-agent.d.ts +20 -0
- package/dist/types/sandbox/dependency-bins.d.ts +19 -0
- package/dist/types/sandbox/dev-source.d.ts +4 -0
- package/dist/types/sandbox/env-exposure.d.ts +1 -0
- package/dist/types/sandbox/errors.d.ts +20 -0
- package/dist/types/sandbox/hidden-paths.d.ts +11 -0
- package/dist/types/sandbox/index.d.ts +14 -0
- package/dist/types/sandbox/package-install.d.ts +1 -0
- package/dist/types/sandbox/policy.d.ts +71 -0
- package/dist/types/sandbox/privileged-runtime.d.ts +13 -0
- package/dist/types/sandbox/quote.d.ts +2 -0
- package/dist/types/sandbox/runtime-private.d.ts +1 -0
- package/dist/types/sandbox/session-tmp.d.ts +6 -0
- package/dist/types/sandbox/symlinks.d.ts +6 -0
- package/dist/types/sandbox/writable-zones.d.ts +15 -0
- package/dist/types/secrets/coding-agent-auth.d.ts +25 -0
- package/dist/types/secrets/defaults.d.ts +21 -0
- package/dist/types/secrets/export-github-cli-store.d.ts +22 -0
- package/dist/types/secrets/hydrate.d.ts +7 -0
- package/dist/types/secrets/index.d.ts +7 -0
- package/dist/types/secrets/provision-github-cli-store.d.ts +45 -0
- package/dist/types/secrets/refresh-provider-oauth.d.ts +22 -0
- package/dist/types/secrets/resolve.d.ts +14 -0
- package/dist/types/secrets/schema.d.ts +840 -0
- package/dist/types/secrets/storage.d.ts +56 -0
- package/dist/types/shared/host-locale.d.ts +1 -0
- package/dist/types/shared/index.d.ts +5 -0
- package/dist/types/shared/local-time.d.ts +4 -0
- package/dist/types/shared/platform.d.ts +2 -0
- package/dist/types/shared/protocol.d.ts +424 -0
- package/dist/types/shared/style-text.d.ts +3 -0
- package/dist/types/shared/wsl.d.ts +17 -0
- package/dist/types/stream/broker.d.ts +2 -0
- package/dist/types/stream/index.d.ts +2 -0
- package/dist/types/stream/types.d.ts +71 -0
- package/package.json +9 -2
- package/scripts/build-plugin-types.ts +105 -0
- package/scripts/check-plugin-sdk.ts +111 -0
- package/scripts/require-parallel.ts +5 -32
- package/src/agent/guard-types.ts +3 -0
- package/src/agent/guards.ts +4 -0
- package/src/agent/idle-compaction.ts +174 -0
- package/src/agent/index.ts +74 -16
- package/src/agent/live-subagents.ts +19 -0
- package/src/agent/multimodal/look-at.ts +22 -9
- package/src/agent/plugin-tools.ts +13 -1
- package/src/agent/reviewer-bash-policy.ts +41 -1
- package/src/agent/session-origin.ts +26 -10
- package/src/agent/subagent-cache-keepalive.ts +198 -0
- package/src/agent/subagent-session.ts +6 -0
- package/src/agent/subagents.ts +46 -8
- package/src/agent/system-prompt.ts +1 -1
- package/src/agent/tool-file-safety.ts +6 -1
- package/src/agent/tools/channel-edit.ts +20 -10
- package/src/agent/tools/channel-fetch-attachment.ts +12 -5
- package/src/agent/tools/channel-handoff.ts +72 -0
- package/src/agent/tools/channel-read.ts +57 -10
- package/src/agent/tools/channel-reply.ts +33 -26
- package/src/agent/tools/channel-send.ts +21 -13
- package/src/agent/tools/channel-session-search.ts +35 -0
- package/src/agent/tools/curl-impersonate.ts +11 -4
- package/src/agent/tools/ddg.ts +13 -5
- package/src/agent/tools/spawn-subagent.ts +27 -11
- package/src/agent/tools/stream-snapshot.ts +15 -2
- package/src/agent/tools/subagent-access.ts +11 -4
- package/src/browser/bsk-shim.mjs +74 -0
- package/src/browser/dockerfile.ts +84 -0
- package/src/browser/egress.ts +104 -0
- package/src/browser/managed-browser.ts +205 -0
- package/src/browser/registry.ts +110 -0
- package/src/browser/relay.ts +231 -0
- package/src/browser/sandbox-entry.ts +167 -0
- package/src/bundled-plugins/agent-browser/index.ts +2 -0
- package/src/bundled-plugins/browser-agent/browser-agent.ts +89 -0
- package/src/bundled-plugins/browser-agent/index.ts +12 -0
- package/src/bundled-plugins/doc-render/index.ts +0 -10
- package/src/bundled-plugins/doc-render/render.ts +83 -111
- package/src/bundled-plugins/doc-render/skills/typeclaw-render-pdf/SKILL.md +152 -257
- package/src/bundled-plugins/github-cli-auth/gh-command.ts +4 -0
- package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
- package/src/bundled-plugins/github-cli-auth/index.ts +75 -59
- package/src/bundled-plugins/managed-browser/index.ts +74 -0
- package/src/bundled-plugins/managed-browser/skills/browser-use/browser-use/SKILL.md +27 -0
- package/src/bundled-plugins/managed-browser/skills/browserskill/browserskill/SKILL.md +28 -0
- package/src/bundled-plugins/managed-browser/skills/omowright/omowright/SKILL.md +40 -0
- package/src/bundled-plugins/operator/operator.ts +1 -1
- package/src/bundled-plugins/qa/index.ts +11 -0
- package/src/bundled-plugins/qa/qa.ts +160 -0
- package/src/bundled-plugins/qa/skills/qa-cli.ts +50 -0
- package/src/bundled-plugins/qa/skills/qa-general.ts +30 -0
- package/src/bundled-plugins/qa/skills/qa-http.ts +39 -0
- package/src/bundled-plugins/qa/skills/qa-pr.ts +51 -0
- package/src/bundled-plugins/qa/skills/qa-web.ts +49 -0
- package/src/bundled-plugins/security/index.ts +53 -34
- package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +1 -0
- package/src/channels/adapter-namespace.ts +13 -0
- package/src/channels/adapters/discord-bot.ts +97 -5
- package/src/channels/adapters/github/index.ts +16 -0
- package/src/channels/adapters/github/last-alive.ts +4 -16
- package/src/channels/adapters/slack-attachment-download.ts +14 -3
- package/src/channels/adapters/slack-bot-author-resolver.ts +4 -3
- package/src/channels/adapters/slack-bot-channel-resolver.ts +9 -6
- package/src/channels/adapters/slack-bot-classify.ts +1 -0
- package/src/channels/adapters/slack-bot-slash-commands.ts +3 -1
- package/src/channels/adapters/slack-bot.ts +299 -67
- package/src/channels/adapters/slack-classify.ts +1 -0
- package/src/channels/catch-up.ts +137 -0
- package/src/channels/continuation-willingness.ts +2 -2
- package/src/channels/continuity-types.ts +1 -0
- package/src/channels/engagement.ts +17 -1
- package/src/channels/github-false-receipt.ts +3 -3
- package/src/channels/github-rereview-guard.ts +9 -5
- package/src/channels/github-token-bridge.ts +24 -0
- package/src/channels/last-alive.ts +34 -0
- package/src/channels/manager.ts +8 -1
- package/src/channels/router.ts +427 -136
- package/src/channels/session-handoff.fixture.ts +144 -0
- package/src/channels/session-handoff.ts +175 -0
- package/src/channels/session-search.ts +71 -0
- package/src/channels/types.ts +12 -2
- package/src/cli/channel.ts +2 -3
- package/src/cli/init.ts +2 -3
- package/src/cli/model.ts +132 -3
- package/src/coding-agent/index.ts +7 -1
- package/src/coding-agent/omo-stream.ts +40 -0
- package/src/coding-agent/runner.ts +30 -8
- package/src/config/config.ts +111 -22
- package/src/config/model-overrides.ts +59 -0
- package/src/config/models-mutation.ts +185 -2
- package/src/config/providers-mutation.ts +12 -4
- package/src/config/providers.ts +59 -0
- package/src/container/start.ts +95 -4
- package/src/doctor/checks.ts +8 -6
- package/src/hostd/daemon.ts +13 -1
- package/src/init/auto-upgrade.ts +7 -1
- package/src/init/dockerfile.ts +57 -12
- package/src/init/index.ts +4 -3
- package/src/init/local-source-stamp.ts +68 -0
- package/src/init/models-dev.ts +4 -0
- package/src/init/validate-api-key.ts +3 -0
- package/src/permissions/builtins.ts +7 -0
- package/src/permissions/permissions.ts +18 -9
- package/src/permissions/resolve.ts +7 -1
- package/src/plugin/context.ts +2 -0
- package/src/plugin/hooks.ts +137 -0
- package/src/plugin/index.ts +6 -0
- package/src/plugin/manager.ts +4 -0
- package/src/plugin/types.ts +60 -0
- package/src/run/bundled-plugins.ts +6 -0
- package/src/run/index.ts +24 -14
- package/src/run/llm-fetch-observer.ts +12 -15
- package/src/sandbox/canonical-secrets.ts +4 -0
- package/src/sandbox/dev-source.ts +26 -0
- package/src/sandbox/hidden-paths.ts +16 -2
- package/src/secrets/storage.ts +13 -0
- package/src/skills/typeclaw-channel-github/SKILL.md +8 -8
- package/src/skills/typeclaw-config/SKILL.md +39 -5
- package/src/skills/typeclaw-config/references/dockerfile.md +2 -2
- package/src/skills/typeclaw-github-contributing/SKILL.md +1 -1
- package/src/skills/typeclaw-monorepo/SKILL.md +1 -1
- package/src/skills/typeclaw-permissions/SKILL.md +7 -7
- package/src/skills/typeclaw-troubleshooting/SKILL.md +12 -1
- package/typeclaw.schema.json +436 -5
- package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
- package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
|
@@ -4,7 +4,7 @@ import { SecretsBackend, type Secret } from '@/secrets'
|
|
|
4
4
|
import { providerKeyDefaultEnv } from '@/secrets/defaults'
|
|
5
5
|
import type { ProviderCredential, Providers } from '@/secrets/schema'
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type ProfileEntry, loadConfigSync } from './config'
|
|
8
8
|
import { KNOWN_PROVIDERS, type KnownProviderId, type ModelRef, providerForModelRef } from './providers'
|
|
9
9
|
|
|
10
10
|
// Where a configured credential resolves from at runtime. Reported by
|
|
@@ -209,7 +209,7 @@ function readEnvKey(env: NodeJS.ProcessEnv, key: string): string | undefined {
|
|
|
209
209
|
return value
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
function buildProviderReferenceMap(models:
|
|
212
|
+
function buildProviderReferenceMap(models: Record<string, ProfileEntry> | null): Map<string, string[]> {
|
|
213
213
|
const out = new Map<string, string[]>()
|
|
214
214
|
if (models === null) return out
|
|
215
215
|
for (const [profile, entry] of Object.entries(models)) {
|
|
@@ -238,9 +238,17 @@ function safeProviderForRef(ref: ModelRef): KnownProviderId | null {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
// Every profile that can put a provider in use: global `models` plus each
|
|
242
|
+
// `modelOverrides` entry's profiles, labelled `modelOverrides.<name>.<profile>`
|
|
243
|
+
// so removal guards and listings name the override that still needs the provider.
|
|
244
|
+
function readModelsOrNull(cwd: string): Record<string, ProfileEntry> | null {
|
|
242
245
|
try {
|
|
243
|
-
|
|
246
|
+
const config = loadConfigSync(cwd)
|
|
247
|
+
const out: Record<string, ProfileEntry> = { ...config.models }
|
|
248
|
+
for (const [name, override] of Object.entries(config.modelOverrides)) {
|
|
249
|
+
for (const [profile, entry] of Object.entries(override.models)) out[`modelOverrides.${name}.${profile}`] = entry
|
|
250
|
+
}
|
|
251
|
+
return out
|
|
244
252
|
} catch {
|
|
245
253
|
return null
|
|
246
254
|
}
|
package/src/config/providers.ts
CHANGED
|
@@ -1405,6 +1405,60 @@ export const KNOWN_PROVIDERS = {
|
|
|
1405
1405
|
},
|
|
1406
1406
|
},
|
|
1407
1407
|
},
|
|
1408
|
+
// Inception (Mercury diffusion LLMs) official API. OpenAI-compatible
|
|
1409
|
+
// /v1/chat/completions with Bearer auth, so it goes through pi-ai's
|
|
1410
|
+
// `openai-completions` adapter with a custom baseUrl. api-key only.
|
|
1411
|
+
//
|
|
1412
|
+
// Only Mercury 3 is listed: Mercury 2 / 2.5 are closed to new users as of
|
|
1413
|
+
// 2026-10-19 and shut down for existing ones on 2026-11-15. Mercury Voice is
|
|
1414
|
+
// enterprise-gated, Mercury Decide and Mercury Edit 2 don't serve chat.
|
|
1415
|
+
//
|
|
1416
|
+
// Cost is the standard rate from docs.inceptionlabs.ai/get-started/models
|
|
1417
|
+
// as of 2026-10-20, not the 50%-off launch price, so the record doesn't go
|
|
1418
|
+
// stale when the promotion ends. No cache-write surcharge is published.
|
|
1419
|
+
//
|
|
1420
|
+
// reasoning_effort accepts instant/low/medium/high and defaults to `low`
|
|
1421
|
+
// when omitted. `off` maps to `instant` so a non-reasoning turn really drops
|
|
1422
|
+
// to the fastest mode instead of silently reasoning at the default.
|
|
1423
|
+
//
|
|
1424
|
+
// The OpenAPI spec (api.inceptionlabs.ai/openapi.json) documents neither
|
|
1425
|
+
// `store` nor the `developer` role, and pi-ai doesn't auto-detect compat
|
|
1426
|
+
// for this baseUrl, so both are turned off.
|
|
1427
|
+
inception: {
|
|
1428
|
+
id: 'inception',
|
|
1429
|
+
name: 'Inception (Mercury)',
|
|
1430
|
+
baseUrl: 'https://api.inceptionlabs.ai/v1',
|
|
1431
|
+
auth: ['api-key'],
|
|
1432
|
+
apiKeyEnv: 'INCEPTION_API_KEY',
|
|
1433
|
+
oauthProviderId: null,
|
|
1434
|
+
models: {
|
|
1435
|
+
'mercury-3': {
|
|
1436
|
+
id: 'mercury-3',
|
|
1437
|
+
name: 'Mercury 3',
|
|
1438
|
+
api: 'openai-completions',
|
|
1439
|
+
provider: 'inception',
|
|
1440
|
+
baseUrl: 'https://api.inceptionlabs.ai/v1',
|
|
1441
|
+
reasoning: true,
|
|
1442
|
+
thinkingLevelMap: {
|
|
1443
|
+
off: 'instant',
|
|
1444
|
+
minimal: 'low',
|
|
1445
|
+
low: 'low',
|
|
1446
|
+
medium: 'medium',
|
|
1447
|
+
high: 'high',
|
|
1448
|
+
xhigh: 'high',
|
|
1449
|
+
},
|
|
1450
|
+
input: ['text'],
|
|
1451
|
+
cost: { input: 0.2, output: 0.7, cacheRead: 0.02, cacheWrite: 0 },
|
|
1452
|
+
contextWindow: 1000000,
|
|
1453
|
+
maxTokens: 131072,
|
|
1454
|
+
compat: {
|
|
1455
|
+
supportsStore: false,
|
|
1456
|
+
supportsDeveloperRole: false,
|
|
1457
|
+
supportsReasoningEffort: true,
|
|
1458
|
+
},
|
|
1459
|
+
},
|
|
1460
|
+
},
|
|
1461
|
+
},
|
|
1408
1462
|
} as const satisfies Record<string, KnownProvider>
|
|
1409
1463
|
|
|
1410
1464
|
export type KnownProviderId = keyof typeof KNOWN_PROVIDERS
|
|
@@ -1492,6 +1546,11 @@ export const KNOWN_PROVIDER_VENDORS = {
|
|
|
1492
1546
|
'moonshot-coding': { label: 'Coding Plan', hint: 'Kimi Code subscription' },
|
|
1493
1547
|
},
|
|
1494
1548
|
},
|
|
1549
|
+
inception: {
|
|
1550
|
+
id: 'inception',
|
|
1551
|
+
name: 'Inception (Mercury)',
|
|
1552
|
+
providers: ['inception'],
|
|
1553
|
+
},
|
|
1495
1554
|
// Listed last because it is a reseller, not a lab: a user who knows they want
|
|
1496
1555
|
// Anthropic should land on the Anthropic row, not the gateway that proxies it.
|
|
1497
1556
|
opengateway: {
|
package/src/container/start.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto'
|
|
2
2
|
import { accessSync, constants as fsConstants, existsSync, realpathSync } from 'node:fs'
|
|
3
3
|
import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
|
|
4
|
-
import { tmpdir } from 'node:os'
|
|
5
|
-
import { isAbsolute, join, relative, resolve } from 'node:path'
|
|
4
|
+
import { homedir, tmpdir } from 'node:os'
|
|
5
|
+
import { isAbsolute, join, posix, relative, resolve } from 'node:path'
|
|
6
6
|
|
|
7
7
|
import { migrateAgentMessengerConfigDir, resolveAgentMessengerConfigPolicy } from '@/agent-messenger/config-dir'
|
|
8
8
|
import { expandMountPath, loadConfigSync, withDefaultPlugins, type Config, type PortForward } from '@/config'
|
|
@@ -27,6 +27,7 @@ import { resolveBaseImageVersion, resolveTypeclawSpec, typeclawCheckoutRoot } fr
|
|
|
27
27
|
import { buildDockerfile, classifyDockerfileAppend, DOCKERFILE } from '@/init/dockerfile'
|
|
28
28
|
import { ensureDepsInstalled, type EnsureDepsResult } from '@/init/ensure-deps'
|
|
29
29
|
import { buildGitignore, GITIGNORE_FILE } from '@/init/gitignore'
|
|
30
|
+
import { localSourceFingerprint, readLocalSourceStamp, writeLocalSourceStamp } from '@/init/local-source-stamp'
|
|
30
31
|
import { refreshPackageJson } from '@/init/packagejson'
|
|
31
32
|
import { reconcilePluginDeps } from '@/init/reconcile-plugin-deps'
|
|
32
33
|
import { runBunUpdate, type UpdateRunner } from '@/init/run-bun-install'
|
|
@@ -86,6 +87,35 @@ const CONTAINER_HOSTD_HOST = 'host.docker.internal'
|
|
|
86
87
|
const HOST_GATEWAY_ALIAS = `${CONTAINER_HOSTD_HOST}:host-gateway`
|
|
87
88
|
|
|
88
89
|
const MOUNT_TARGET_PREFIX = '/agent/mounts'
|
|
90
|
+
const HOST_FONTS_TARGET_PREFIX = '/usr/share/fonts/host'
|
|
91
|
+
|
|
92
|
+
// Only user-installed folders: macOS `/System/Library/Fonts` is licensed for
|
|
93
|
+
// macOS only and mostly holds system UI fonts no document needs.
|
|
94
|
+
export function resolveHostFontMounts({
|
|
95
|
+
platform,
|
|
96
|
+
home,
|
|
97
|
+
exists = existsSync,
|
|
98
|
+
}: {
|
|
99
|
+
platform: NodeJS.Platform
|
|
100
|
+
home: string
|
|
101
|
+
exists?: (path: string) => boolean
|
|
102
|
+
}): Array<{ src: string; dst: string; readonly: true }> {
|
|
103
|
+
const sources: Array<[string, string]> =
|
|
104
|
+
platform === 'darwin'
|
|
105
|
+
? [
|
|
106
|
+
['user', posix.join(home, 'Library', 'Fonts')],
|
|
107
|
+
['system', '/Library/Fonts'],
|
|
108
|
+
]
|
|
109
|
+
: platform === 'linux'
|
|
110
|
+
? [
|
|
111
|
+
['user', posix.join(home, '.local', 'share', 'fonts')],
|
|
112
|
+
['system', '/usr/share/fonts'],
|
|
113
|
+
]
|
|
114
|
+
: []
|
|
115
|
+
return sources
|
|
116
|
+
.filter(([, src]) => exists(src))
|
|
117
|
+
.map(([name, src]) => ({ src, dst: `${HOST_FONTS_TARGET_PREFIX}-${name}`, readonly: true }))
|
|
118
|
+
}
|
|
89
119
|
|
|
90
120
|
export type StartPlan = {
|
|
91
121
|
containerName: string
|
|
@@ -120,6 +150,7 @@ export type PlanStartOptions = {
|
|
|
120
150
|
// rather than from os.totalmem(). Omitted by callers that have no exec (and
|
|
121
151
|
// by tests), in which case the default applies unclamped.
|
|
122
152
|
totalMemoryBytes?: number | undefined
|
|
153
|
+
hostHome?: string
|
|
123
154
|
}
|
|
124
155
|
|
|
125
156
|
export type HostDaemonControl = {
|
|
@@ -380,8 +411,18 @@ async function runStart({
|
|
|
380
411
|
}
|
|
381
412
|
}
|
|
382
413
|
|
|
383
|
-
const
|
|
384
|
-
|
|
414
|
+
const githubCliConfig = await loadTypeclawConfig(cwd)
|
|
415
|
+
if (!githubCliConfig.githubCli.importHostAuth) {
|
|
416
|
+
const removalFailure = removeGithubCliStore(cwd)
|
|
417
|
+
if (removalFailure !== null) return { ok: false, reason: removalFailure }
|
|
418
|
+
}
|
|
419
|
+
const githubCliWarning = githubCliConfig.githubCli.importHostAuth
|
|
420
|
+
? await refreshGithubCliStore(
|
|
421
|
+
cwd,
|
|
422
|
+
resolveGithubCliDeniedRoots(cwd, githubCliConfig),
|
|
423
|
+
provisionGithubCliStoreForAgent,
|
|
424
|
+
)
|
|
425
|
+
: null
|
|
385
426
|
if (githubCliWarning !== null) {
|
|
386
427
|
if (streamOutput) process.stderr.write(githubCliWarning)
|
|
387
428
|
else onWarning?.(githubCliWarning.trim())
|
|
@@ -520,7 +561,14 @@ async function runStart({
|
|
|
520
561
|
// version bump (dir already present) or a removal (stale dir left behind)
|
|
521
562
|
// would otherwise leave bun.lock/node_modules out of sync with the
|
|
522
563
|
// reconciled package.json.
|
|
564
|
+
//
|
|
565
|
+
// A `file:` dep is a snapshot copy taken at install time, so pulling or
|
|
566
|
+
// editing the checkout leaves the agent running old code until something
|
|
567
|
+
// re-copies it. Fingerprint the checkout and force a reinstall only when it
|
|
568
|
+
// moved since the last install, so routine restarts stay fast.
|
|
569
|
+
const staleLocalFingerprint = await staleLocalTypeclawCopyFingerprint(cwd)
|
|
523
570
|
const forceDepsReinstall =
|
|
571
|
+
staleLocalFingerprint !== null ||
|
|
524
572
|
(forceBuild && (await hasLocallyLinkedTypeclawDep(cwd))) ||
|
|
525
573
|
pluginReconcile.changed ||
|
|
526
574
|
outcomeRequiresForceInstall(upgrade) ||
|
|
@@ -529,6 +577,7 @@ async function runStart({
|
|
|
529
577
|
if (!deps.ok) {
|
|
530
578
|
return { ok: false, reason: `dependency install failed: ${deps.reason}` }
|
|
531
579
|
}
|
|
580
|
+
if (staleLocalFingerprint !== null) await writeLocalSourceStamp(cwd, staleLocalFingerprint)
|
|
532
581
|
await commitSystemFile(cwd, DEPENDENCY_FILES, upgradeCommitMessage ?? 'Update dependencies')
|
|
533
582
|
// Probe buildx up front so the Dockerfile we write matches the builder we
|
|
534
583
|
// will use. buildx present -> emit the BuildKit Dockerfile and build with
|
|
@@ -855,6 +904,22 @@ async function refreshGithubCliStore(
|
|
|
855
904
|
)
|
|
856
905
|
}
|
|
857
906
|
|
|
907
|
+
// Without opt-in, a store persisted by an earlier start (when copying was
|
|
908
|
+
// unconditional) still carries the operator's identity. The container exports
|
|
909
|
+
// whatever store secrets.json holds, so a failed removal must stop the launch
|
|
910
|
+
// rather than run the agent as the operator.
|
|
911
|
+
function removeGithubCliStore(agentDir: string): string | null {
|
|
912
|
+
try {
|
|
913
|
+
new SecretsBackend(join(agentDir, 'secrets.json')).removeGithubCliSync()
|
|
914
|
+
return null
|
|
915
|
+
} catch {
|
|
916
|
+
return (
|
|
917
|
+
'Could not remove the host GitHub CLI credential from secrets.json (githubCli.importHostAuth is off). ' +
|
|
918
|
+
'Delete the `githubCli` entry from secrets.json by hand, or fix the file if it is malformed, then run typeclaw start again.'
|
|
919
|
+
)
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
858
923
|
// An unreadable or malformed secrets.json cannot prove the store is absent, so
|
|
859
924
|
// it takes the warning — silence is reserved for a confirmed no-store agent.
|
|
860
925
|
function hasPersistedGithubCliStore(agentDir: string): boolean {
|
|
@@ -922,6 +987,7 @@ export async function planStart({
|
|
|
922
987
|
hostIdentity = currentHostIdentity(),
|
|
923
988
|
gitIdentity,
|
|
924
989
|
totalMemoryBytes,
|
|
990
|
+
hostHome = homedir(),
|
|
925
991
|
}: PlanStartOptions): Promise<StartPlan> {
|
|
926
992
|
const containerName = containerNameFromCwd(cwd)
|
|
927
993
|
const imageTag = imageTagFromCwd(cwd)
|
|
@@ -1162,6 +1228,12 @@ export async function planStart({
|
|
|
1162
1228
|
runArgs.push(...dockerBindMount({ src: hostPath, dst: target, readonly: mount.readOnly }))
|
|
1163
1229
|
}
|
|
1164
1230
|
|
|
1231
|
+
if (cfg.hostFonts) {
|
|
1232
|
+
for (const fontMount of resolveHostFontMounts({ platform, home: hostHome })) {
|
|
1233
|
+
runArgs.push(...dockerBindMount(fontMount))
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1165
1237
|
// Shared model cache mount for embeddings. Vector memory is always on, and
|
|
1166
1238
|
// the embedder runs with local_files_only inside the container.
|
|
1167
1239
|
runArgs.push(...dockerBindMount({ src: join(homeRoot(), 'models'), dst: '/opt/models', readonly: true }))
|
|
@@ -1234,6 +1306,7 @@ export async function refreshDockerfile(
|
|
|
1234
1306
|
// path. Mirrors the same gate in writeDockerAssets (src/init/index.ts).
|
|
1235
1307
|
const devMode = await hasLocallyLinkedTypeclawDep(cwd)
|
|
1236
1308
|
const next = buildDockerfile(cfg.docker.file, {
|
|
1309
|
+
browser: cfg.browser,
|
|
1237
1310
|
baseImageVersion: devMode ? null : resolveBaseImageVersion(cwd),
|
|
1238
1311
|
cjkFontsAuto: hostLocaleIsCjk(),
|
|
1239
1312
|
buildKit: opts.buildKit,
|
|
@@ -1698,6 +1771,24 @@ async function hasLocallyLinkedTypeclawDep(cwd: string): Promise<boolean> {
|
|
|
1698
1771
|
return spec !== null && (spec.startsWith('file:') || spec.startsWith('link:'))
|
|
1699
1772
|
}
|
|
1700
1773
|
|
|
1774
|
+
// Returns the checkout's current fingerprint when the agent's `file:` copy of
|
|
1775
|
+
// typeclaw no longer matches it, else null. An install that resolves to the
|
|
1776
|
+
// checkout itself is live and never stale. A symlink alone does not prove that:
|
|
1777
|
+
// bun's isolated linker symlinks into its own store, which is still a copy.
|
|
1778
|
+
async function staleLocalTypeclawCopyFingerprint(cwd: string): Promise<string | null> {
|
|
1779
|
+
if (!(await readTypeclawDepSpec(cwd))?.startsWith('file:')) return null
|
|
1780
|
+
const source = await detectDevSource(cwd)
|
|
1781
|
+
if (source === null) return null
|
|
1782
|
+
try {
|
|
1783
|
+
if (realpathSync(join(cwd, 'node_modules', TYPECLAW_PACKAGE)) === realpathSync(source)) return null
|
|
1784
|
+
} catch {
|
|
1785
|
+
// Not installed yet, or the checkout is missing: fall through to the fingerprint.
|
|
1786
|
+
}
|
|
1787
|
+
const fingerprint = await localSourceFingerprint(source)
|
|
1788
|
+
if (fingerprint === null || fingerprint === (await readLocalSourceStamp(cwd))) return null
|
|
1789
|
+
return fingerprint
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1701
1792
|
async function readTypeclawDepSpec(cwd: string): Promise<string | null> {
|
|
1702
1793
|
try {
|
|
1703
1794
|
const raw = await readFile(join(cwd, PACKAGE_FILE), 'utf8')
|
package/src/doctor/checks.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises'
|
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
4
|
import { join, relative } from 'node:path'
|
|
5
5
|
|
|
6
|
-
import { loadConfigSync, validateConfig } from '@/config'
|
|
6
|
+
import { type Config, loadConfigSync, validateConfig } from '@/config'
|
|
7
7
|
import {
|
|
8
8
|
checkDockerAvailable,
|
|
9
9
|
containerNameFromCwd,
|
|
@@ -535,7 +535,7 @@ function buildExpectedDockerfile(cwd: string): string | null {
|
|
|
535
535
|
try {
|
|
536
536
|
const cfg = loadConfigStrictForTemplate(cwd)
|
|
537
537
|
if (cfg === null) return null
|
|
538
|
-
return buildDockerfile(cfg.dockerfile, { baseImageVersion: resolveBaseImageVersion(cwd) })
|
|
538
|
+
return buildDockerfile(cfg.dockerfile, { browser: cfg.browser, baseImageVersion: resolveBaseImageVersion(cwd) })
|
|
539
539
|
} catch {
|
|
540
540
|
return null
|
|
541
541
|
}
|
|
@@ -551,13 +551,15 @@ function buildExpectedGitignore(cwd: string): string | null {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
function loadConfigStrictForTemplate(
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
function loadConfigStrictForTemplate(cwd: string): {
|
|
555
|
+
dockerfile: Parameters<typeof buildDockerfile>[0]
|
|
556
|
+
browser: Config['browser']
|
|
557
|
+
gitignore: Parameters<typeof buildGitignore>[0]
|
|
558
|
+
} | null {
|
|
557
559
|
const result = validateConfig(cwd)
|
|
558
560
|
if (!result.ok) return null
|
|
559
561
|
const cfg = loadConfigSync(cwd)
|
|
560
|
-
return { dockerfile: cfg.docker.file, gitignore: cfg.git.ignore }
|
|
562
|
+
return { dockerfile: cfg.docker.file, browser: cfg.browser, gitignore: cfg.git.ignore }
|
|
561
563
|
}
|
|
562
564
|
|
|
563
565
|
// Normalizes CRLF to LF: the managed templates are emitted with `\n`, but a
|
package/src/hostd/daemon.ts
CHANGED
|
@@ -238,7 +238,14 @@ async function restorePersistedRegistrations(
|
|
|
238
238
|
log({ kind: 'registration-skipped', containerName: expectedName, reason: 'container not running' })
|
|
239
239
|
continue
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
// One registration whose revival throws (e.g. portbroker.start) must not
|
|
242
|
+
// abort the loop: restoreComplete would reject and every gated RPC would
|
|
243
|
+
// fail until the daemon is respawned.
|
|
244
|
+
try {
|
|
245
|
+
await apply(parsed)
|
|
246
|
+
} catch (error) {
|
|
247
|
+
log({ kind: 'registration-skipped', containerName: expectedName, reason: stringifyError(error) })
|
|
248
|
+
}
|
|
242
249
|
}
|
|
243
250
|
}
|
|
244
251
|
|
|
@@ -443,6 +450,11 @@ export async function startDaemon(opts: DaemonOptions = {}): Promise<Daemon> {
|
|
|
443
450
|
void handleFatalAuthFailure(payload.containerName, brokerToken, reason)
|
|
444
451
|
},
|
|
445
452
|
})
|
|
453
|
+
} else if (opts.portbroker && brokerTokens.delete(payload.containerName)) {
|
|
454
|
+
// A re-register without broker fields must retire the previous broker;
|
|
455
|
+
// otherwise its stale token could later match a fatal-auth callback and
|
|
456
|
+
// tear down this live registration.
|
|
457
|
+
await withCleanupTimeout(opts.portbroker.stop(payload.containerName, 'deregistered'), cleanupStepTimeoutMs)
|
|
446
458
|
}
|
|
447
459
|
if (opts.kakaoRenewal) {
|
|
448
460
|
opts.kakaoRenewal.start({ containerName: payload.containerName, cwd: payload.cwd })
|
package/src/init/auto-upgrade.ts
CHANGED
|
@@ -141,8 +141,14 @@ export function outcomeForcesInstall(outcome: AutoUpgradeOutcome): boolean {
|
|
|
141
141
|
// (file deps don't "update"), NOT the `bun update --latest` path above — and it
|
|
142
142
|
// skips version verification, since a local install's version is whatever the
|
|
143
143
|
// checkout declares. start.ts ORs this into its ensureDeps force flag.
|
|
144
|
+
//
|
|
145
|
+
// Leaving a local spec for a registry range needs the same force: `bun update
|
|
146
|
+
// --latest` rewrites bun.lock but keeps the local copy in node_modules when its
|
|
147
|
+
// version already satisfies the range, so the agent would keep running the
|
|
148
|
+
// checkout's code.
|
|
144
149
|
export function outcomeRequiresForceInstall(outcome: AutoUpgradeOutcome): boolean {
|
|
145
|
-
|
|
150
|
+
if (outcome.kind === 'relinked-to-local') return true
|
|
151
|
+
return outcome.kind === 'spec-rewritten' && (outcome.from.startsWith('file:') || outcome.from.startsWith('link:'))
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
// The version we expect to find in node_modules/typeclaw after the
|
package/src/init/dockerfile.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CONTAINER_AGENT_MESSENGER_CONFIG_DIR } from '@/agent-messenger/config-dir'
|
|
2
|
+
import { renderBrowserLayers } from '@/browser/dockerfile'
|
|
3
|
+
import type { BrowserConfig } from '@/browser/registry'
|
|
2
4
|
import { ASKPASS_SCRIPT, TYPECLAW_GIT_ASKPASS_PATH } from '@/bundled-plugins/github-cli-auth/git-askpass'
|
|
3
5
|
import { CLAUDE_CODE_VERSION } from '@/coding-agent/claude'
|
|
4
6
|
import { CODEX_CLI_VERSION } from '@/coding-agent/codex'
|
|
@@ -12,6 +14,8 @@ import { GHCR_BASE_IMAGE_REPO } from './cli-version'
|
|
|
12
14
|
export const DOCKERFILE = 'Dockerfile'
|
|
13
15
|
|
|
14
16
|
export type BuildDockerfileOptions = {
|
|
17
|
+
// `typeclaw.json#browser`; omitted = the default agent-browser-only image.
|
|
18
|
+
browser?: BrowserConfig
|
|
15
19
|
// Null or omitted = emit the full inline heavy stack (dev mode, tests).
|
|
16
20
|
baseImageVersion?: string | null
|
|
17
21
|
// Host-locale decision for `cjkFonts: 'auto'`. Callers that have a host
|
|
@@ -784,6 +788,7 @@ export function buildDockerfile(
|
|
|
784
788
|
const claudeCodeLayer = renderClaudeCodeInstallLayer(config.claudeCode)
|
|
785
789
|
const codexCliLayer = renderCodexCliInstallLayer(config.codexCli, buildKit)
|
|
786
790
|
const omoCliLayer = renderOmoCliInstallLayer(config.omoCli)
|
|
791
|
+
const browserLayers = renderBrowserLayers(options.browser ?? { engines: ['agent-browser'], extensions: [] })
|
|
787
792
|
const fromAndHeavyLayers =
|
|
788
793
|
baseImageVersion !== null
|
|
789
794
|
? renderVersionedHead(
|
|
@@ -794,6 +799,7 @@ export function buildDockerfile(
|
|
|
794
799
|
claudeCodeLayer,
|
|
795
800
|
codexCliLayer,
|
|
796
801
|
omoCliLayer,
|
|
802
|
+
browserLayers,
|
|
797
803
|
buildKit,
|
|
798
804
|
)
|
|
799
805
|
: renderInlineHead(
|
|
@@ -803,6 +809,7 @@ export function buildDockerfile(
|
|
|
803
809
|
claudeCodeLayer,
|
|
804
810
|
codexCliLayer,
|
|
805
811
|
omoCliLayer,
|
|
812
|
+
browserLayers,
|
|
806
813
|
buildKit,
|
|
807
814
|
)
|
|
808
815
|
|
|
@@ -857,6 +864,7 @@ function renderVersionedHead(
|
|
|
857
864
|
claudeCodeLayer: string,
|
|
858
865
|
codexCliLayer: string,
|
|
859
866
|
omoCliLayer: string,
|
|
867
|
+
browserLayers: string,
|
|
860
868
|
buildKit: boolean,
|
|
861
869
|
): string {
|
|
862
870
|
const toggleAptLayer = toggleAptArgs.length === 0 ? '' : `${renderToggleAptInstallLayer(toggleAptArgs, buildKit)}\n\n`
|
|
@@ -870,7 +878,7 @@ WORKDIR /agent
|
|
|
870
878
|
|
|
871
879
|
ARG TARGETARCH
|
|
872
880
|
|
|
873
|
-
${ghKeyringLayer}${toggleAptLayer}${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${renderEntrypointShimLayer()}
|
|
881
|
+
${ghKeyringLayer}${toggleAptLayer}${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${browserLayers}${renderEntrypointShimLayer()}
|
|
874
882
|
${renderGitAskPassLayer()}
|
|
875
883
|
|
|
876
884
|
${LAYER_TRANSFORMERS_INSTALL}
|
|
@@ -889,6 +897,7 @@ function renderInlineHead(
|
|
|
889
897
|
claudeCodeLayer: string,
|
|
890
898
|
codexCliLayer: string,
|
|
891
899
|
omoCliLayer: string,
|
|
900
|
+
browserLayers: string,
|
|
892
901
|
buildKit: boolean,
|
|
893
902
|
): string {
|
|
894
903
|
const baselineAndToggleArgs = [...BASELINE_APT_PACKAGES, ...toggleAptArgs]
|
|
@@ -936,7 +945,7 @@ ${LAYER_4_5_AGENT_BROWSER_HEADED_WRAPPER}
|
|
|
936
945
|
|
|
937
946
|
${renderChromeForTestingLayer()}
|
|
938
947
|
|
|
939
|
-
${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${renderEntrypointShimLayer()}
|
|
948
|
+
${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${browserLayers}${renderEntrypointShimLayer()}
|
|
940
949
|
${renderGitAskPassLayer()}
|
|
941
950
|
|
|
942
951
|
${LAYER_TRANSFORMERS_INSTALL}
|
|
@@ -1085,18 +1094,50 @@ RUN ARCH_TARBALL="$(if [ "$TARGETARCH" = "arm64" ]; then echo aarch64-linux-gnu;
|
|
|
1085
1094
|
&& rm curl-impersonate.tar.gz \\
|
|
1086
1095
|
&& /usr/local/bin/curl_${CURL_IMPERSONATE_PROFILE} --version > /dev/null`
|
|
1087
1096
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1097
|
+
// Everything agent-browser needs at runtime lives under /usr: the model's
|
|
1098
|
+
// bwrap sandbox binds /usr but not /root, and its PATH has no `node`.
|
|
1099
|
+
const AGENT_BROWSER_ROOT = '/usr/local/lib/typeclaw-agent-browser'
|
|
1100
|
+
const AGENT_BROWSER_PACKAGE = `${AGENT_BROWSER_ROOT}/install/global/node_modules/agent-browser`
|
|
1101
|
+
// Stable browser path for both arches: a launcher that execs the real
|
|
1102
|
+
// browser, linked at AGENT_BROWSER_CHROME_BIN (apt chromium on arm64, Chrome
|
|
1103
|
+
// for Testing on amd64 in Layer 5).
|
|
1104
|
+
const AGENT_BROWSER_CHROME = `${AGENT_BROWSER_ROOT}/chrome`
|
|
1105
|
+
const AGENT_BROWSER_CHROME_BIN = `${AGENT_BROWSER_ROOT}/chrome-bin`
|
|
1106
|
+
|
|
1107
|
+
// The launcher adds --no-sandbox because Chromium's own sandbox cannot start
|
|
1108
|
+
// inside the model's bwrap sandbox: with the default proc-bind strategy /proc
|
|
1109
|
+
// is read-only, so Chromium's user-namespace sandbox cannot write
|
|
1110
|
+
// /proc/self/uid_map, and there is no setuid chrome-sandbox. agent-browser
|
|
1111
|
+
// only auto-adds --no-sandbox when it detects root or a container
|
|
1112
|
+
// (/.dockerenv, /proc/1/cgroup), and none of that is visible inside bwrap.
|
|
1113
|
+
// bwrap stays the isolation boundary for the browser. The flag lives in the
|
|
1114
|
+
// launcher, not AGENT_BROWSER_ARGS, because a CLI --args replaces that env
|
|
1115
|
+
// value wholesale and would silently drop it.
|
|
1116
|
+
const LAYER_3_AGENT_BROWSER_ARM64_CONFIG = `# Layer 3 (stable): point agent-browser at a browser launcher visible inside
|
|
1117
|
+
# the sandbox. arm64 links the apt chromium; amd64 links Chrome for Testing in
|
|
1118
|
+
# Layer 5. Independent of the npm install below so it stays cached across
|
|
1090
1119
|
# agent-browser version bumps.
|
|
1091
|
-
RUN
|
|
1092
|
-
|
|
1093
|
-
|
|
1120
|
+
RUN mkdir -p ${AGENT_BROWSER_ROOT} \\
|
|
1121
|
+
&& printf '%s\\n' '#!/bin/sh' 'exec ${AGENT_BROWSER_CHROME_BIN} --no-sandbox "$@"' > ${AGENT_BROWSER_CHROME} \\
|
|
1122
|
+
&& chmod 0755 ${AGENT_BROWSER_CHROME} \\
|
|
1123
|
+
&& if [ "$TARGETARCH" = "arm64" ]; then \\
|
|
1124
|
+
ln -sf /usr/bin/chromium ${AGENT_BROWSER_CHROME_BIN}; \\
|
|
1094
1125
|
fi`
|
|
1095
1126
|
|
|
1127
|
+
// Layer 4: the npm tarball ships the native binaries without the exec bit and
|
|
1128
|
+
// the JS launcher chmods them on first run, which fails on the read-only /usr
|
|
1129
|
+
// inside the sandbox, so set it at build time. The launcher runs under bun
|
|
1130
|
+
// because the image's `node` fallback is outside the sandbox PATH, and it
|
|
1131
|
+
// defaults the browser path itself because the sandbox clears image ENV.
|
|
1132
|
+
// An inherited AGENT_BROWSER_EXECUTABLE_PATH (operator .env) still wins.
|
|
1096
1133
|
const renderAgentBrowserInstallLayer = (buildKit: boolean): string =>
|
|
1097
|
-
`# Layer 4 (volatile): install agent-browser
|
|
1098
|
-
# runtime bind-mount over /agent/node_modules.
|
|
1099
|
-
RUN ${bunCacheMount(buildKit)}bun install -g agent-browser@^0.
|
|
1134
|
+
`# Layer 4 (volatile): install agent-browser under /usr so it survives the
|
|
1135
|
+
# runtime bind-mount over /agent/node_modules and stays visible in bwrap.
|
|
1136
|
+
RUN ${bunCacheMount(buildKit)}BUN_INSTALL=${AGENT_BROWSER_ROOT} BUN_INSTALL_BIN=${AGENT_BROWSER_ROOT}/bin BUN_INSTALL_CACHE_DIR=/root/.bun/install/cache bun install -g agent-browser@^0.39.1 \\
|
|
1137
|
+
&& chmod 0755 ${AGENT_BROWSER_PACKAGE}/bin/agent-browser-linux-* \\
|
|
1138
|
+
&& printf '%s\\n' '#!/bin/sh' ': "\${AGENT_BROWSER_EXECUTABLE_PATH:=${AGENT_BROWSER_CHROME}}"' 'export AGENT_BROWSER_EXECUTABLE_PATH' 'exec /usr/local/bin/bun ${AGENT_BROWSER_PACKAGE}/bin/agent-browser.js "$@"' > /usr/local/bin/agent-browser \\
|
|
1139
|
+
&& chmod 0755 /usr/local/bin/agent-browser \\
|
|
1140
|
+
&& agent-browser --version > /dev/null`
|
|
1100
1141
|
|
|
1101
1142
|
// Layer 4.5: shim the agent-browser binary with a wrapper that calls
|
|
1102
1143
|
// \`agent-browser close\` before \`open\`/\`goto\`/\`navigate\` when headed
|
|
@@ -1219,7 +1260,8 @@ exec env _TYPECLAW_AGENT_BROWSER_HEADED_HANDLED=1 "$real" "$@"
|
|
|
1219
1260
|
TYPECLAW_AGENT_BROWSER_WRAPPER_EOF`
|
|
1220
1261
|
|
|
1221
1262
|
// Layer 5: download the pinned Chrome for Testing build into
|
|
1222
|
-
//
|
|
1263
|
+
// $HOME/.agent-browser/browsers/, with HOME pointed under /usr so the
|
|
1264
|
+
// sandbox can see it, then link it to the stable path. NO cache mount on that path because the
|
|
1223
1265
|
// runtime needs the binary in the image, and no apt cache mount either
|
|
1224
1266
|
// because nothing in this layer runs apt.
|
|
1225
1267
|
//
|
|
@@ -1233,7 +1275,10 @@ TYPECLAW_AGENT_BROWSER_WRAPPER_EOF`
|
|
|
1233
1275
|
const renderChromeForTestingLayer = (): string =>
|
|
1234
1276
|
`# Layer 5 (heavy, amd64 only): Chrome for Testing download.
|
|
1235
1277
|
RUN if [ "$TARGETARCH" != "arm64" ]; then \\
|
|
1236
|
-
agent-browser install
|
|
1278
|
+
HOME=${AGENT_BROWSER_ROOT} agent-browser install \\
|
|
1279
|
+
&& chrome="$(find ${AGENT_BROWSER_ROOT}/.agent-browser/browsers -type f -name chrome -perm -u+x | head -n 1)" \\
|
|
1280
|
+
&& [ -n "$chrome" ] \\
|
|
1281
|
+
&& ln -sf "$chrome" ${AGENT_BROWSER_CHROME_BIN}; \\
|
|
1237
1282
|
fi`
|
|
1238
1283
|
|
|
1239
1284
|
function renderOmoCliInstallLayer(enabled: boolean): string {
|
package/src/init/index.ts
CHANGED
|
@@ -760,8 +760,8 @@ function addCustomModel(
|
|
|
760
760
|
customModels[ref] = meta ?? {}
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
-
// agent-browser ships in every agent: the bundled SKILL.md (src/
|
|
764
|
-
// agent-browser/SKILL.md) is a discovery stub that calls `agent-browser
|
|
763
|
+
// agent-browser ships in every agent: the bundled SKILL.md (src/bundled-plugins/
|
|
764
|
+
// agent-browser/skills/agent-browser/SKILL.md) is a discovery stub that calls `agent-browser
|
|
765
765
|
// skills get core` at runtime, so the CLI must be installed for the skill
|
|
766
766
|
// to function. The Dockerfile pre-downloads Chromium too, so the agent
|
|
767
767
|
// can drive a browser without any first-run setup.
|
|
@@ -769,7 +769,7 @@ function addCustomModel(
|
|
|
769
769
|
// Must match the Dockerfile Layer 4 global install (dockerfile.ts); they are
|
|
770
770
|
// two installs of the same CLI and a skew is silent. Enforced by a guard test
|
|
771
771
|
// in packagejson.test.ts.
|
|
772
|
-
export const AGENT_BROWSER_VERSION = '^0.
|
|
772
|
+
export const AGENT_BROWSER_VERSION = '^0.39.1'
|
|
773
773
|
function buildPackageJson(root: string, name: string, platform: NodeJS.Platform): Record<string, unknown> {
|
|
774
774
|
return {
|
|
775
775
|
name,
|
|
@@ -812,6 +812,7 @@ export async function writeDockerAssets(root: string): Promise<DockerAssetsResul
|
|
|
812
812
|
await writeFile(
|
|
813
813
|
join(root, DOCKERFILE),
|
|
814
814
|
buildDockerfile(typeclawConfig.docker.file, {
|
|
815
|
+
browser: typeclawConfig.browser,
|
|
815
816
|
// A local-spec dev install must inline the heavy stack: its unreleased
|
|
816
817
|
// version has no published `typeclaw-base` tag, so resolving a base
|
|
817
818
|
// image version would pin a nonexistent `FROM ghcr.io/...:<version>`.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import { createHash } from 'node:crypto'
|
|
3
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
|
4
|
+
import { dirname, join } from 'node:path'
|
|
5
|
+
import { promisify } from 'node:util'
|
|
6
|
+
|
|
7
|
+
const execFileAsync = promisify(execFile)
|
|
8
|
+
|
|
9
|
+
// Lives inside node_modules so a wiped or reinstalled node_modules also drops
|
|
10
|
+
// the stamp, which forces the next start to re-copy the checkout.
|
|
11
|
+
const STAMP_FILE = join('node_modules', '.typeclaw-local-source')
|
|
12
|
+
|
|
13
|
+
// Identifies the exact source a `file:` checkout would copy: committed HEAD plus
|
|
14
|
+
// uncommitted edits. Returns null when the checkout is not a Git repo, so the
|
|
15
|
+
// caller cannot tell whether the copy is stale and keeps its old behavior.
|
|
16
|
+
export async function localSourceFingerprint(sourceDir: string): Promise<string | null> {
|
|
17
|
+
try {
|
|
18
|
+
const git = async (...args: string[]) =>
|
|
19
|
+
(await execFileAsync('git', ['-C', sourceDir, ...args], { maxBuffer: 64 * 1024 * 1024 })).stdout
|
|
20
|
+
const [head, diff, untracked] = await Promise.all([
|
|
21
|
+
git('rev-parse', 'HEAD'),
|
|
22
|
+
git('diff', 'HEAD'),
|
|
23
|
+
git('ls-files', '--others', '--exclude-standard'),
|
|
24
|
+
])
|
|
25
|
+
// `git diff HEAD` skips untracked files, so hash their contents too: an edit
|
|
26
|
+
// to a new, not-yet-added file must still count as a source change.
|
|
27
|
+
const paths = untracked.split('\n').filter((path) => path !== '')
|
|
28
|
+
const untrackedHashes =
|
|
29
|
+
paths.length === 0
|
|
30
|
+
? ''
|
|
31
|
+
: (
|
|
32
|
+
await new Promise<string>((resolve, reject) => {
|
|
33
|
+
const child = execFile(
|
|
34
|
+
'git',
|
|
35
|
+
['-C', sourceDir, 'hash-object', '--stdin-paths'],
|
|
36
|
+
{ maxBuffer: 64 * 1024 * 1024 },
|
|
37
|
+
(error, stdout) => (error ? reject(error) : resolve(stdout)),
|
|
38
|
+
)
|
|
39
|
+
child.stdin?.end(paths.join('\n'))
|
|
40
|
+
})
|
|
41
|
+
).trim()
|
|
42
|
+
return createHash('sha256')
|
|
43
|
+
.update(head)
|
|
44
|
+
.update('\0')
|
|
45
|
+
.update(diff)
|
|
46
|
+
.update('\0')
|
|
47
|
+
.update(untracked)
|
|
48
|
+
.update('\0')
|
|
49
|
+
.update(untrackedHashes)
|
|
50
|
+
.digest('hex')
|
|
51
|
+
} catch {
|
|
52
|
+
return null
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function readLocalSourceStamp(cwd: string): Promise<string | null> {
|
|
57
|
+
try {
|
|
58
|
+
return (await readFile(join(cwd, STAMP_FILE), 'utf8')).trim()
|
|
59
|
+
} catch {
|
|
60
|
+
return null
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function writeLocalSourceStamp(cwd: string, fingerprint: string): Promise<void> {
|
|
65
|
+
const path = join(cwd, STAMP_FILE)
|
|
66
|
+
await mkdir(dirname(path), { recursive: true })
|
|
67
|
+
await writeFile(path, `${fingerprint}\n`)
|
|
68
|
+
}
|
package/src/init/models-dev.ts
CHANGED
|
@@ -52,6 +52,10 @@ const PROVIDER_TO_MODELS_DEV: Record<KnownProviderId, string | null> = {
|
|
|
52
52
|
// `kimi-for-coding` alias is surfaced regardless of upstream membership.
|
|
53
53
|
'moonshot-coding': 'moonshot',
|
|
54
54
|
opengateway: null,
|
|
55
|
+
// models.dev's `inception` catalog lists only Mercury 2 / 2.5 / Edit 2, which
|
|
56
|
+
// are retired for new users or don't serve chat. Surface the curated
|
|
57
|
+
// Mercury 3 record alone.
|
|
58
|
+
inception: null,
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
function upstreamProviderFor(
|
|
@@ -32,6 +32,8 @@ const PROVIDER_PROBE: Partial<Record<KnownProviderId, Probe>> = {
|
|
|
32
32
|
// validation, because init would vouch for a key that cannot complete a single
|
|
33
33
|
// request. /v1/me is the cheapest endpoint that actually 401s on a bad key.
|
|
34
34
|
opengateway: { url: 'https://apis.opengateway.ai/v1/me', authHeader: 'bearer', successShape: 'json-object' },
|
|
35
|
+
// inception has no probe: its /v1/models is public and returns 200 for any
|
|
36
|
+
// key, so probing it would vouch for garbage.
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
// When a base-URL override (ANTHROPIC_BASE_URL / OPENAI_BASE_URL) points at a
|
|
@@ -194,6 +196,7 @@ export const API_KEY_DASHBOARD_URL: Partial<Record<KnownProviderId, string>> = {
|
|
|
194
196
|
moonshot: 'https://platform.moonshot.ai/console/api-keys',
|
|
195
197
|
'moonshot-coding': 'https://www.kimi.com/code/console',
|
|
196
198
|
opengateway: 'https://opengateway.ai/docs/reference/guides/authentication',
|
|
199
|
+
inception: 'https://platform.inceptionlabs.ai',
|
|
197
200
|
}
|
|
198
201
|
|
|
199
202
|
// MiniMax sells the same `minimax` provider under two billing surfaces that
|