typeclaw 0.48.13 → 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 +13 -6
- package/scripts/build-plugin-types.ts +105 -0
- package/scripts/check-plugin-sdk.ts +111 -0
- package/scripts/dump-system-prompt.ts +52 -110
- 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 +210 -80
- package/src/agent/live-sessions.ts +2 -2
- package/src/agent/live-subagents.ts +20 -0
- package/src/agent/multimodal/look-at.ts +22 -9
- package/src/agent/plugin-tools.ts +66 -12
- package/src/agent/prompt-cache-key.ts +42 -0
- package/src/agent/provider-error.ts +179 -10
- package/src/agent/restart-handoff/index.ts +7 -14
- package/src/agent/reviewer-activity.ts +68 -0
- package/src/agent/reviewer-bash-policy.ts +41 -1
- package/src/agent/session-origin.ts +58 -9
- package/src/agent/subagent-cache-keepalive.ts +198 -0
- package/src/agent/subagent-session.ts +6 -0
- package/src/agent/subagents.ts +59 -9
- package/src/agent/system-prompt.ts +68 -202
- package/src/agent/todo/continuation-policy.ts +12 -4
- package/src/agent/tool-file-safety.ts +119 -15
- package/src/agent/tool-not-found-nudge.ts +1 -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-history-render.ts +2 -1
- package/src/agent/tools/channel-read.ts +57 -10
- package/src/agent/tools/channel-reply.ts +55 -30
- package/src/agent/tools/channel-send.ts +69 -19
- package/src/agent/tools/channel-session-search.ts +35 -0
- package/src/agent/tools/curl-impersonate.ts +22 -6
- package/src/agent/tools/ddg.ts +13 -5
- package/src/agent/tools/post-github-review.ts +77 -15
- package/src/agent/tools/skip-response.ts +2 -2
- package/src/agent/tools/spawn-subagent.ts +190 -23
- package/src/agent/tools/stream-snapshot.ts +15 -2
- package/src/agent/tools/subagent-access.ts +11 -4
- package/src/agent/tools/subagent-output.ts +8 -0
- 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/backup/README.md +10 -9
- package/src/bundled-plugins/backup/runner.ts +140 -58
- package/src/bundled-plugins/backup/subagents.ts +58 -26
- 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 +38 -2
- package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
- package/src/bundled-plugins/github-cli-auth/granted-push.ts +135 -0
- package/src/bundled-plugins/github-cli-auth/index.ts +158 -70
- package/src/bundled-plugins/github-cli-auth/review-account.ts +23 -0
- package/src/bundled-plugins/github-cli-auth/review-checkout.ts +9 -2
- package/src/bundled-plugins/github-cli-auth/review-recorder.ts +45 -7
- 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 +15 -4
- 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/reviewer/skills/code-review.ts +1 -1
- package/src/bundled-plugins/security/index.ts +103 -36
- package/src/bundled-plugins/security/policies/git-exfil.ts +24 -12
- 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-reactions.ts +18 -0
- package/src/channels/adapters/discord-bot.ts +219 -72
- package/src/channels/adapters/discord-reactions.ts +18 -0
- package/src/channels/adapters/discord.ts +114 -8
- package/src/channels/adapters/github/inbound.ts +103 -8
- package/src/channels/adapters/github/index.ts +267 -19
- package/src/channels/adapters/github/last-alive.ts +15 -0
- package/src/channels/adapters/github/outbound.ts +54 -18
- package/src/channels/adapters/github/pending-review-store.ts +141 -0
- package/src/channels/adapters/github/permission-guidance.ts +1 -0
- package/src/channels/adapters/github/reactions.ts +100 -0
- package/src/channels/adapters/github/reconcile-cooldown-store.ts +197 -67
- package/src/channels/adapters/github/reconcile-open-prs.ts +418 -33
- package/src/channels/adapters/github/recovery.ts +106 -0
- package/src/channels/adapters/github/review-check.ts +510 -0
- package/src/channels/adapters/github/review-submitter.ts +34 -2
- package/src/channels/adapters/instagram.ts +32 -14
- package/src/channels/adapters/kakaotalk.ts +22 -7
- package/src/channels/adapters/line.ts +18 -3
- package/src/channels/adapters/outbound-account.ts +20 -0
- package/src/channels/adapters/own-reactions.ts +66 -0
- package/src/channels/adapters/recovery-correlation.ts +214 -0
- 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 +19 -11
- package/src/channels/adapters/slack-bot-dedupe.ts +111 -28
- package/src/channels/adapters/slack-bot-reactions.ts +18 -0
- package/src/channels/adapters/slack-bot-slash-commands.ts +3 -1
- package/src/channels/adapters/slack-bot.ts +424 -124
- package/src/channels/adapters/slack-classify.ts +26 -4
- package/src/channels/adapters/slack-inbound-revision.ts +96 -0
- package/src/channels/adapters/slack-reactions.ts +18 -0
- package/src/channels/adapters/slack-thread-ts.ts +6 -0
- package/src/channels/adapters/slack.ts +48 -3
- package/src/channels/adapters/teams.ts +14 -4
- package/src/channels/adapters/telegram-bot.ts +56 -10
- package/src/channels/adapters/webex-bot.ts +12 -2
- package/src/channels/adapters/webex.ts +12 -2
- package/src/channels/background-handoff.ts +434 -0
- package/src/channels/background-obligations.ts +893 -0
- package/src/channels/catch-up.ts +137 -0
- package/src/channels/continuation-willingness.ts +2 -2
- package/src/channels/continuity-types.ts +272 -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-review-check.ts +598 -0
- package/src/channels/github-review-turn-ledger.ts +102 -28
- package/src/channels/github-review-verdict-coordinator.ts +72 -12
- package/src/channels/github-token-bridge.ts +35 -5
- package/src/channels/inbound-journal.ts +1738 -0
- package/src/channels/index.ts +6 -1
- package/src/channels/last-alive.ts +34 -0
- package/src/channels/manager.ts +25 -8
- package/src/channels/recovery-dispatcher.ts +264 -0
- package/src/channels/recovery-notice.ts +94 -0
- package/src/channels/recovery-outbox.ts +459 -0
- package/src/channels/router.ts +2951 -736
- package/src/channels/schema.ts +8 -1
- 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/subagent-completion-bridge.ts +17 -14
- package/src/channels/types.ts +133 -18
- package/src/channels/waiting-reactions.ts +664 -0
- package/src/cli/channel.ts +2 -3
- package/src/cli/compose.ts +7 -4
- package/src/cli/hostd.ts +49 -3
- package/src/cli/init.ts +2 -3
- package/src/cli/inspect.ts +11 -14
- package/src/cli/model.ts +132 -3
- package/src/coding-agent/broker-body.ts +38 -0
- package/src/coding-agent/broker.ts +290 -0
- package/src/coding-agent/claude.ts +95 -0
- package/src/coding-agent/codex.ts +104 -0
- package/src/coding-agent/index.ts +512 -0
- package/src/coding-agent/omo-state.ts +69 -0
- package/src/coding-agent/omo-stream.ts +138 -0
- package/src/coding-agent/omo.ts +192 -0
- package/src/coding-agent/runner.ts +285 -0
- package/src/coding-agent/tool.ts +62 -0
- package/src/coding-agent/worktree.ts +355 -0
- package/src/compose/restart.ts +10 -3
- package/src/compose/start.ts +20 -3
- package/src/config/config.ts +121 -25
- 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 +71 -9
- package/src/container/exit-reason.ts +44 -0
- package/src/container/index.ts +5 -0
- package/src/container/log-archive.ts +51 -13
- package/src/container/memory-limit.ts +1 -1
- package/src/container/memory-oversubscription.ts +36 -6
- package/src/container/oom-events.ts +86 -0
- package/src/container/restart.ts +2 -0
- package/src/container/shared.ts +8 -1
- package/src/container/start.ts +120 -17
- package/src/container/stop.ts +6 -2
- package/src/container/tool-oom-priority.ts +32 -0
- package/src/cron/consumer.ts +10 -4
- package/src/cron/reloadable.ts +23 -2
- package/src/doctor/checks.ts +22 -8
- package/src/hostd/daemon.ts +33 -11
- package/src/hostd/spawn.ts +106 -5
- package/src/hostd/version.ts +20 -0
- package/src/hostd/watchdog.ts +241 -0
- package/src/init/auto-upgrade.ts +7 -1
- package/src/init/dockerfile.ts +112 -602
- package/src/init/index.ts +6 -6
- 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/mcp/client.ts +3 -1
- package/src/operations/classify-tool-outcome.ts +45 -1
- package/src/operations/incidents.ts +10 -5
- 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/core-tool-names.ts +1 -1
- package/src/plugin/define.ts +1 -0
- package/src/plugin/hooks.ts +137 -0
- package/src/plugin/index.ts +7 -0
- package/src/plugin/manager.ts +4 -0
- package/src/plugin/types.ts +66 -1
- package/src/run/background-handoff-boot.ts +86 -0
- package/src/run/bundled-plugins.ts +6 -0
- package/src/run/index.ts +107 -97
- package/src/run/llm-fetch-observer.ts +12 -15
- package/src/run/resource-sample.ts +19 -0
- package/src/sandbox/build.ts +4 -0
- package/src/sandbox/canonical-secrets.ts +4 -0
- package/src/sandbox/coding-agent.ts +214 -0
- package/src/sandbox/dev-source.ts +26 -0
- package/src/sandbox/hidden-paths.ts +16 -2
- package/src/sandbox/policy.ts +1 -0
- package/src/sandbox/runtime-private.ts +4 -1
- package/src/secrets/coding-agent-auth.ts +97 -0
- package/src/secrets/index.ts +0 -16
- package/src/secrets/storage.ts +13 -0
- package/src/server/command-runner.ts +6 -2
- package/src/server/index.ts +101 -40
- package/src/skills/typeclaw-channel-github/SKILL.md +15 -13
- package/src/skills/typeclaw-claude-code/SKILL.md +25 -260
- package/src/skills/typeclaw-claude-code/references/auth-flow.md +7 -23
- package/src/skills/typeclaw-claude-code/references/headless-sessions.md +11 -0
- package/src/skills/typeclaw-claude-code/references/results-and-worktrees.md +13 -0
- package/src/skills/typeclaw-codex-cli/SKILL.md +35 -270
- package/src/skills/typeclaw-codex-cli/references/auth-flow.md +13 -20
- package/src/skills/typeclaw-codex-cli/references/headless-sessions.md +26 -0
- package/src/skills/typeclaw-codex-cli/references/results-and-worktrees.md +28 -0
- package/src/skills/typeclaw-config/SKILL.md +60 -26
- package/src/skills/typeclaw-config/references/dockerfile.md +14 -13
- package/src/skills/typeclaw-cron/SKILL.md +1 -1
- package/src/skills/typeclaw-github-contributing/SKILL.md +3 -3
- package/src/skills/typeclaw-memory/SKILL.md +3 -3
- package/src/skills/typeclaw-monorepo/SKILL.md +1 -1
- package/src/skills/typeclaw-omo-cli/SKILL.md +52 -0
- package/src/skills/typeclaw-omo-cli/references/auth-flow.md +11 -0
- package/src/skills/typeclaw-omo-cli/references/headless-sessions.md +11 -0
- package/src/skills/typeclaw-omo-cli/references/results-and-worktrees.md +23 -0
- package/src/skills/typeclaw-permissions/SKILL.md +7 -7
- package/src/skills/typeclaw-plugins/SKILL.md +15 -15
- package/src/skills/typeclaw-skills/SKILL.md +19 -2
- package/src/skills/typeclaw-troubleshooting/SKILL.md +26 -2
- package/typeclaw.schema.json +448 -6
- package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
- package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
- package/src/secrets/claude-credentials-json.ts +0 -129
- package/src/secrets/codex-auth-json.ts +0 -102
- package/src/secrets/export-claude-credentials-file.ts +0 -270
- package/src/secrets/export-codex-auth-file.ts +0 -250
- package/src/skills/typeclaw-claude-code/references/stop-hook.md +0 -101
- package/src/skills/typeclaw-claude-code/references/tmux-driving.md +0 -243
- package/src/skills/typeclaw-codex-cli/references/stop-hook.md +0 -92
- package/src/skills/typeclaw-codex-cli/references/tmux-driving.md +0 -239
package/src/config/config.ts
CHANGED
|
@@ -6,8 +6,10 @@ import type { KnownApi, Model } from '@earendil-works/pi-ai'
|
|
|
6
6
|
import { getBuiltinModel } from '@earendil-works/pi-ai/providers/all'
|
|
7
7
|
import { z } from 'zod'
|
|
8
8
|
|
|
9
|
+
import { BROWSER_ENGINE_IDS, BROWSER_EXTENSION_IDS } from '@/browser/registry'
|
|
9
10
|
import { channelsSchema, SEEDED_GITHUB_EVENT_ALLOWLISTS } from '@/channels/schema'
|
|
10
11
|
import { commitSystemFileSync } from '@/git/system-commit'
|
|
12
|
+
import { parseMatchRule } from '@/permissions/match-rule'
|
|
11
13
|
import { rolesConfigSchema } from '@/permissions/schema'
|
|
12
14
|
import { secretFieldSchema } from '@/secrets/resolve'
|
|
13
15
|
|
|
@@ -197,7 +199,7 @@ const dockerfileObjectSchema = z.object({
|
|
|
197
199
|
tmux: dockerfileFeatureSchema.default(true),
|
|
198
200
|
// `fonts-noto-cjk` is an ~89MB metapackage that makes Chromium render
|
|
199
201
|
// Korean/Japanese/Chinese glyphs correctly in screenshots, `page.pdf()`,
|
|
200
|
-
// and any other raster output
|
|
202
|
+
// and any other raster output a browser engine produces. Without
|
|
201
203
|
// it CJK text renders as silent tofu boxes (□□□) — a confusing failure an
|
|
202
204
|
// agent cannot self-diagnose from a screenshot it took itself.
|
|
203
205
|
//
|
|
@@ -220,7 +222,7 @@ const dockerfileObjectSchema = z.object({
|
|
|
220
222
|
cloudflared: z.boolean().default(false),
|
|
221
223
|
// Install xvfb so the entrypoint shim can spawn an Xvfb virtual X
|
|
222
224
|
// server and export DISPLAY, giving headed Chrome (agent-browser
|
|
223
|
-
// --headed, Playwright headful) a real X11 display to connect to.
|
|
225
|
+
// --headed, the managed shared browser, Playwright headful) a real X11 display to connect to.
|
|
224
226
|
// Default `true` because modern bot detection (Akamai/Cloudflare Bot
|
|
225
227
|
// Manager) fingerprints `--headless` and `--headless=new` regardless
|
|
226
228
|
// of UA spoof, and headed-via-Xvfb is the cheapest path to a passing
|
|
@@ -244,11 +246,30 @@ const dockerfileObjectSchema = z.object({
|
|
|
244
246
|
// restart-required semantics, separate hook scripts (Codex uses
|
|
245
247
|
// hooks.json with a different event matcher than Claude Code).
|
|
246
248
|
codexCli: z.boolean().default(false),
|
|
249
|
+
// Pinned native OmO executable; its task-local config is generated by the
|
|
250
|
+
// brokered runner, never provisioned with operator credentials.
|
|
251
|
+
omoCli: z.boolean().default(false),
|
|
247
252
|
append: z.array(dockerfileLineSchema).default([]),
|
|
248
253
|
})
|
|
249
254
|
|
|
250
255
|
export const dockerfileSchema = dockerfileObjectSchema.default(() => dockerfileObjectSchema.parse({}))
|
|
251
256
|
|
|
257
|
+
// Which browser drivers the agent gets and which extensions load into the
|
|
258
|
+
// TypeClaw-managed Chrome. Restart-required: engines and extensions install
|
|
259
|
+
// image layers and the managed browser is spawned at boot.
|
|
260
|
+
const browserObjectSchema = z.object({
|
|
261
|
+
engines: z
|
|
262
|
+
.array(z.enum(BROWSER_ENGINE_IDS))
|
|
263
|
+
.default(['agent-browser'])
|
|
264
|
+
.refine((ids) => new Set(ids).size === ids.length, { message: 'browser.engines must not repeat an engine' }),
|
|
265
|
+
extensions: z
|
|
266
|
+
.array(z.enum(BROWSER_EXTENSION_IDS))
|
|
267
|
+
.default([])
|
|
268
|
+
.refine((ids) => new Set(ids).size === ids.length, { message: 'browser.extensions must not repeat an extension' }),
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
export const browserSchema = browserObjectSchema.default(() => browserObjectSchema.parse({}))
|
|
272
|
+
|
|
252
273
|
export type DockerfileConfig = z.infer<typeof dockerfileSchema>
|
|
253
274
|
export type DockerfileFeatureToggle = z.infer<typeof dockerfileFeatureSchema>
|
|
254
275
|
|
|
@@ -288,6 +309,17 @@ export const gitSchema = z
|
|
|
288
309
|
|
|
289
310
|
export type GitConfig = z.infer<typeof gitSchema>
|
|
290
311
|
|
|
312
|
+
// Off by default: the host operator's `gh` login is the operator's identity, not
|
|
313
|
+
// the agent's. Copying it unconditionally handed every agent on a shared host the
|
|
314
|
+
// operator's personal GitHub token, so an agent only receives it on explicit opt-in.
|
|
315
|
+
const githubCliObjectSchema = z.object({
|
|
316
|
+
importHostAuth: z.boolean().default(false),
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
export const githubCliSchema = githubCliObjectSchema.default(() => githubCliObjectSchema.parse({}))
|
|
320
|
+
|
|
321
|
+
export type GithubCliConfig = z.infer<typeof githubCliSchema>
|
|
322
|
+
|
|
291
323
|
export const DEFAULT_LOG_RETENTION_DAYS = 14
|
|
292
324
|
export const MAX_LOG_RETENTION_DAYS = 3650
|
|
293
325
|
|
|
@@ -715,17 +747,19 @@ const richProfileSchema = z
|
|
|
715
747
|
}
|
|
716
748
|
})
|
|
717
749
|
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
750
|
+
const profileEntryInputSchema = z.union([singleModelRef, modelChainInputSchema, richProfileSchema])
|
|
751
|
+
const profileEntrySchema: z.ZodType<
|
|
752
|
+
ProfileEntry,
|
|
753
|
+
z.input<typeof profileEntryInputSchema>
|
|
754
|
+
> = profileEntryInputSchema.transform((value): ProfileEntry => {
|
|
755
|
+
if (typeof value === 'string' || Array.isArray(value)) {
|
|
756
|
+
const refs = (Array.isArray(value) ? value : [value]).map((ref) => asModelRef(ref))
|
|
757
|
+
return { refs }
|
|
758
|
+
}
|
|
759
|
+
const refsInput = value.models ?? value.model!
|
|
760
|
+
const refs = (Array.isArray(refsInput) ? refsInput : [refsInput]).map((ref) => asModelRef(ref))
|
|
761
|
+
return value.thinkingLevel === undefined ? { refs } : { refs, thinkingLevel: value.thinkingLevel }
|
|
762
|
+
})
|
|
729
763
|
|
|
730
764
|
// Built-in per-profile `thinkingLevel` defaults, materialized at parse time so
|
|
731
765
|
// resolved config / `typeclaw model list` / prompt dumps show the effective level
|
|
@@ -744,17 +778,60 @@ export const modelsSchema = z
|
|
|
744
778
|
.record(z.string().min(1), profileEntrySchema)
|
|
745
779
|
.refine((m) => 'default' in m, { message: 'models.default is required' })
|
|
746
780
|
// Fill only when unset, so an explicit level (including `off`) always wins.
|
|
747
|
-
.transform((models): Models =>
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
}
|
|
781
|
+
.transform((models): Models => withProfileThinkingDefaults(models) as Models)
|
|
782
|
+
|
|
783
|
+
function withProfileThinkingDefaults(models: Record<string, ProfileEntry>): Record<string, ProfileEntry> {
|
|
784
|
+
let next: Record<string, ProfileEntry> | undefined
|
|
785
|
+
for (const [profile, thinkingLevel] of Object.entries(PROFILE_THINKING_LEVEL_DEFAULTS)) {
|
|
786
|
+
const entry = models[profile]
|
|
787
|
+
if (entry !== undefined && entry.thinkingLevel === undefined) {
|
|
788
|
+
next ??= { ...models }
|
|
789
|
+
next[profile] = { ...entry, thinkingLevel }
|
|
755
790
|
}
|
|
756
|
-
|
|
791
|
+
}
|
|
792
|
+
return next ?? models
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// Why `rule` can't scope a `modelOverrides` entry, or undefined when it can.
|
|
796
|
+
// Rules use the roles match-rule DSL, limited to channel scopes: `author:` is
|
|
797
|
+
// rejected because a session keeps one model for every author of a shared chat.
|
|
798
|
+
export function modelOverrideRuleError(rule: string): string | undefined {
|
|
799
|
+
const parsed = parseMatchRule(rule)
|
|
800
|
+
if (!parsed.ok) return parsed.error
|
|
801
|
+
if (parsed.value.kind === 'wildcard') return undefined
|
|
802
|
+
if (parsed.value.kind !== 'channel') {
|
|
803
|
+
return 'only channel rules (e.g. `slack:*`, `slack:T0123/C0123`, `*`) are allowed'
|
|
804
|
+
}
|
|
805
|
+
if (parsed.value.author !== undefined) return '`author:` is not supported; a session keeps one model for every author'
|
|
806
|
+
return undefined
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// `modelOverrides` layers partial `models` blocks over the global one for the
|
|
810
|
+
// chats each entry's `match` covers, mirroring `roles.<name> = { match, ... }`.
|
|
811
|
+
// Per profile, the most specific matching rule wins (see `effectiveModels`);
|
|
812
|
+
// profiles an entry doesn't define fall through to `models`.
|
|
813
|
+
const modelOverrideSchema = z
|
|
814
|
+
.object({
|
|
815
|
+
match: z
|
|
816
|
+
.array(z.string())
|
|
817
|
+
.min(1, { message: 'match must list at least one rule (use "*" for every channel)' })
|
|
818
|
+
.superRefine((rules, ctx) => {
|
|
819
|
+
rules.forEach((rule, index) => {
|
|
820
|
+
const error = modelOverrideRuleError(rule)
|
|
821
|
+
if (error !== undefined)
|
|
822
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: [index], message: `"${rule}": ${error}` })
|
|
823
|
+
})
|
|
824
|
+
}),
|
|
825
|
+
models: z
|
|
826
|
+
.record(z.string().min(1), profileEntrySchema)
|
|
827
|
+
.refine((m) => Object.keys(m).length > 0, { message: 'models must define at least one profile' })
|
|
828
|
+
.transform(withProfileThinkingDefaults),
|
|
757
829
|
})
|
|
830
|
+
.strict()
|
|
831
|
+
|
|
832
|
+
export type ModelOverride = z.infer<typeof modelOverrideSchema>
|
|
833
|
+
|
|
834
|
+
export const modelOverridesSchema = z.record(z.string().min(1), modelOverrideSchema).default({})
|
|
758
835
|
|
|
759
836
|
// A model profile after normalisation: its fallback chain (always non-empty)
|
|
760
837
|
// plus an optional reasoning effort. `thinkingLevel` resolution is layered at
|
|
@@ -783,10 +860,15 @@ export const configSchema = z
|
|
|
783
860
|
default: { refs: [asModelRef(DEFAULT_MODEL_REF)] },
|
|
784
861
|
})) as unknown as z.ZodType<Models>,
|
|
785
862
|
customModels: customModelsSchema,
|
|
863
|
+
modelOverrides: modelOverridesSchema,
|
|
786
864
|
// Defaults to `[]` so the field can be omitted from `typeclaw.json` (no
|
|
787
865
|
// host paths exposed) without failing the whole config load. `typeclaw
|
|
788
866
|
// init` omits this field so users don't see noise for the empty case.
|
|
789
867
|
mounts: z.array(mountSchema).default([]),
|
|
868
|
+
// Read-only bind mounts of the host's user-installed font folders under
|
|
869
|
+
// the container's `/usr/share/fonts`, so fontconfig (and Chromium-rendered
|
|
870
|
+
// PDFs) picks them up with no setup. Off by default.
|
|
871
|
+
hostFonts: z.boolean().default(false),
|
|
790
872
|
mcpServers: mcpServersArraySchema,
|
|
791
873
|
plugins: z.array(z.string().min(1)).default([]),
|
|
792
874
|
// Additional names the agent answers to in channel engagement, on top
|
|
@@ -803,7 +885,9 @@ export const configSchema = z
|
|
|
803
885
|
network: networkSchema,
|
|
804
886
|
sandbox: sandboxSchema,
|
|
805
887
|
docker: dockerSchema,
|
|
888
|
+
browser: browserSchema,
|
|
806
889
|
git: gitSchema,
|
|
890
|
+
githubCli: githubCliSchema,
|
|
807
891
|
logs: logsSchema,
|
|
808
892
|
roles: rolesConfigSchema.optional(),
|
|
809
893
|
tunnels: tunnelsArraySchema,
|
|
@@ -860,7 +944,8 @@ export function resolveModel(ref: KnownModelRef | ModelRef | string): Model<Know
|
|
|
860
944
|
// Anthropic's streamSimple gates adaptive thinking on the resolved model's
|
|
861
945
|
// `reasoning` capability, so a dated Sonnet 5 alias must inherit that too.
|
|
862
946
|
// That entry's compat and thinkingLevelMap are used, minus
|
|
863
|
-
// `allowedFallbackModels` (see the Fable 5 record)
|
|
947
|
+
// `allowedFallbackModels` (see the Fable 5 record) and `supportsStrictTools`
|
|
948
|
+
// (see the Anthropic records in providers.ts). Without a catalog match
|
|
864
949
|
// `thinkingLevelMap` is deliberately not carried: it varies per model even
|
|
865
950
|
// within one provider, so copying the template's would be a guess.
|
|
866
951
|
const builtin = findBuiltinModel(providerId, modelId)
|
|
@@ -869,7 +954,10 @@ export function resolveModel(ref: KnownModelRef | ModelRef | string): Model<Know
|
|
|
869
954
|
if (catalogMetadata !== undefined) {
|
|
870
955
|
const catalogCompat: Record<string, unknown> | undefined =
|
|
871
956
|
catalogMetadata.compat === undefined ? undefined : { ...catalogMetadata.compat }
|
|
872
|
-
if (catalogCompat !== undefined)
|
|
957
|
+
if (catalogCompat !== undefined) {
|
|
958
|
+
delete catalogCompat.allowedFallbackModels
|
|
959
|
+
delete catalogCompat.supportsStrictTools
|
|
960
|
+
}
|
|
873
961
|
compat = catalogCompat as Model<KnownApi>['compat']
|
|
874
962
|
}
|
|
875
963
|
return {
|
|
@@ -1062,9 +1150,11 @@ export type FieldEffect = 'applied' | 'restart-required' | 'ignored'
|
|
|
1062
1150
|
export const FIELD_EFFECTS: Record<string, FieldEffect> = {
|
|
1063
1151
|
$schema: 'ignored',
|
|
1064
1152
|
models: 'applied',
|
|
1153
|
+
modelOverrides: 'applied',
|
|
1065
1154
|
customModels: 'applied',
|
|
1066
1155
|
port: 'restart-required',
|
|
1067
1156
|
mounts: 'restart-required',
|
|
1157
|
+
hostFonts: 'restart-required',
|
|
1068
1158
|
mcpServers: 'restart-required',
|
|
1069
1159
|
plugins: 'restart-required',
|
|
1070
1160
|
alias: 'applied',
|
|
@@ -1075,8 +1165,10 @@ export const FIELD_EFFECTS: Record<string, FieldEffect> = {
|
|
|
1075
1165
|
network: 'restart-required',
|
|
1076
1166
|
sandbox: 'restart-required',
|
|
1077
1167
|
tunnels: 'restart-required',
|
|
1078
|
-
'docker.file': 'restart-required',
|
|
1168
|
+
'docker.file': 'restart-required', // Includes omoCli; installation changes rebuild the image.
|
|
1169
|
+
browser: 'restart-required',
|
|
1079
1170
|
'git.ignore': 'restart-required',
|
|
1171
|
+
githubCli: 'restart-required',
|
|
1080
1172
|
logs: 'ignored',
|
|
1081
1173
|
// Split: `match` lists are reload-safe (typeclaw role claim, hand-edits
|
|
1082
1174
|
// adding/removing match rules apply without a container restart);
|
|
@@ -1159,10 +1251,13 @@ export function extractPluginConfigs(raw: unknown): Record<string, unknown> {
|
|
|
1159
1251
|
if (typeof raw !== 'object' || raw === null) return {}
|
|
1160
1252
|
const known = new Set([
|
|
1161
1253
|
'$schema',
|
|
1254
|
+
'browser',
|
|
1162
1255
|
'port',
|
|
1163
1256
|
'models',
|
|
1257
|
+
'modelOverrides',
|
|
1164
1258
|
'customModels',
|
|
1165
1259
|
'mounts',
|
|
1260
|
+
'hostFonts',
|
|
1166
1261
|
'plugins',
|
|
1167
1262
|
'alias',
|
|
1168
1263
|
'compose',
|
|
@@ -1172,6 +1267,7 @@ export function extractPluginConfigs(raw: unknown): Record<string, unknown> {
|
|
|
1172
1267
|
'network',
|
|
1173
1268
|
'docker',
|
|
1174
1269
|
'git',
|
|
1270
|
+
'githubCli',
|
|
1175
1271
|
'logs',
|
|
1176
1272
|
'roles',
|
|
1177
1273
|
'permissions',
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { SessionOrigin } from '@/agent/session-origin'
|
|
2
|
+
import { parseMatchRule, type MatchRule } from '@/permissions/match-rule'
|
|
3
|
+
import { matchesOrigin } from '@/permissions/resolve'
|
|
4
|
+
|
|
5
|
+
import type { Config, Models, ProfileEntry } from './config'
|
|
6
|
+
|
|
7
|
+
type ChannelOrigin = Extract<SessionOrigin, { kind: 'channel' }>
|
|
8
|
+
|
|
9
|
+
// The `models` map a session resolves profiles against: the global block with
|
|
10
|
+
// every matching `modelOverrides` entry layered on top. Per profile, the most
|
|
11
|
+
// specific matching rule wins (chat > workspace/bucket > platform > `*`), the
|
|
12
|
+
// later-declared entry on a tie; profiles no matching entry defines keep their
|
|
13
|
+
// global value. Subagents use the channel that (transitively) spawned them, so a
|
|
14
|
+
// chat's `fast`/`deep` also apply to its workers. TUI and cron stay global.
|
|
15
|
+
export function effectiveModels(
|
|
16
|
+
cfg: Pick<Config, 'models' | 'modelOverrides'>,
|
|
17
|
+
origin: SessionOrigin | undefined,
|
|
18
|
+
): Models {
|
|
19
|
+
const channel = channelOf(origin)
|
|
20
|
+
if (channel === undefined) return cfg.models
|
|
21
|
+
const winners = new Map<string, { entry: ProfileEntry; specificity: number }>()
|
|
22
|
+
for (const override of Object.values(cfg.modelOverrides)) {
|
|
23
|
+
const specificity = matchSpecificity(override.match, channel)
|
|
24
|
+
if (specificity === undefined) continue
|
|
25
|
+
for (const [profile, entry] of Object.entries(override.models)) {
|
|
26
|
+
const current = winners.get(profile)
|
|
27
|
+
if (current === undefined || specificity >= current.specificity) winners.set(profile, { entry, specificity })
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (winners.size === 0) return cfg.models
|
|
31
|
+
const merged: Record<string, ProfileEntry> = { ...cfg.models }
|
|
32
|
+
for (const [profile, { entry }] of winners) merged[profile] = entry
|
|
33
|
+
return merged as Models
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function channelOf(origin: SessionOrigin | undefined): ChannelOrigin | undefined {
|
|
37
|
+
let current = origin
|
|
38
|
+
while (current?.kind === 'subagent') current = current.spawnedByOrigin
|
|
39
|
+
return current?.kind === 'channel' ? current : undefined
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Highest specificity among the rules that match, or undefined when none do.
|
|
43
|
+
function matchSpecificity(rules: readonly string[], channel: ChannelOrigin): number | undefined {
|
|
44
|
+
let best: number | undefined
|
|
45
|
+
for (const raw of rules) {
|
|
46
|
+
const parsed = parseMatchRule(raw)
|
|
47
|
+
if (!parsed.ok || !matchesOrigin(parsed.value, channel)) continue
|
|
48
|
+
const specificity = ruleSpecificity(parsed.value)
|
|
49
|
+
if (best === undefined || specificity > best) best = specificity
|
|
50
|
+
}
|
|
51
|
+
return best
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ruleSpecificity(rule: MatchRule): number {
|
|
55
|
+
if (rule.kind !== 'channel') return 0
|
|
56
|
+
if (rule.chat !== undefined) return 3
|
|
57
|
+
if (rule.workspace !== undefined || rule.bucket !== undefined) return 2
|
|
58
|
+
return 1
|
|
59
|
+
}
|
|
@@ -6,6 +6,7 @@ import { commitSystemFileSync } from '@/git/system-commit'
|
|
|
6
6
|
import {
|
|
7
7
|
configSchema,
|
|
8
8
|
loadConfigSyncOrDefaults,
|
|
9
|
+
modelOverrideRuleError,
|
|
9
10
|
validateConfig,
|
|
10
11
|
type CustomModelMeta,
|
|
11
12
|
type ThinkingLevel,
|
|
@@ -280,6 +281,22 @@ function writeModels(
|
|
|
280
281
|
models: RawModels,
|
|
281
282
|
commitMessage: string,
|
|
282
283
|
customModel?: { ref: ModelRef; meta: CustomModelMeta },
|
|
284
|
+
): ModelMutationResult {
|
|
285
|
+
return writeConfig(
|
|
286
|
+
cwd,
|
|
287
|
+
(parsed) => {
|
|
288
|
+
parsed.models = models
|
|
289
|
+
},
|
|
290
|
+
commitMessage,
|
|
291
|
+
customModel,
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function writeConfig(
|
|
296
|
+
cwd: string,
|
|
297
|
+
mutate: (parsed: Record<string, unknown>) => void,
|
|
298
|
+
commitMessage: string,
|
|
299
|
+
customModel?: { ref: ModelRef; meta: CustomModelMeta },
|
|
283
300
|
): ModelMutationResult {
|
|
284
301
|
const path = join(cwd, CONFIG_FILE)
|
|
285
302
|
let parsed: Record<string, unknown>
|
|
@@ -292,7 +309,7 @@ function writeModels(
|
|
|
292
309
|
}
|
|
293
310
|
return { ok: false, reason: `Failed to read ${CONFIG_FILE}: ${(error as Error).message}` }
|
|
294
311
|
}
|
|
295
|
-
parsed
|
|
312
|
+
mutate(parsed)
|
|
296
313
|
if (customModel !== undefined) {
|
|
297
314
|
const existingCustomModels = isObjectRecord(parsed.customModels) ? parsed.customModels : {}
|
|
298
315
|
parsed.customModels = { ...existingCustomModels, [customModel.ref]: customModel.meta }
|
|
@@ -301,7 +318,7 @@ function writeModels(
|
|
|
301
318
|
if (!check.success) {
|
|
302
319
|
return {
|
|
303
320
|
ok: false,
|
|
304
|
-
reason: `
|
|
321
|
+
reason: `config would be invalid: ${check.error.issues.map((i) => i.message).join('; ')}`,
|
|
305
322
|
}
|
|
306
323
|
}
|
|
307
324
|
try {
|
|
@@ -338,6 +355,172 @@ function writeModels(
|
|
|
338
355
|
return { ok: true }
|
|
339
356
|
}
|
|
340
357
|
|
|
358
|
+
export type ModelOverrideListing = {
|
|
359
|
+
name: string
|
|
360
|
+
match: string[]
|
|
361
|
+
profiles: { profile: string; refs: ModelRef[]; thinkingLevel?: ThinkingLevel }[]
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function listModelOverrides(cwd: string): ModelOverrideListing[] {
|
|
365
|
+
const overrides = loadConfigSyncOrDefaults(cwd).modelOverrides
|
|
366
|
+
return Object.entries(overrides).map(([name, override]) => ({
|
|
367
|
+
name,
|
|
368
|
+
match: override.match,
|
|
369
|
+
profiles: Object.entries(override.models).map(([profile, entry]) => ({
|
|
370
|
+
profile,
|
|
371
|
+
refs: entry.refs,
|
|
372
|
+
...(entry.thinkingLevel !== undefined ? { thinkingLevel: entry.thinkingLevel } : {}),
|
|
373
|
+
})),
|
|
374
|
+
}))
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export type SetOverrideProfileOptions = SetProfileOptions & {
|
|
378
|
+
// Rule added to the override's `match` (creating the override when it doesn't
|
|
379
|
+
// exist yet). Required to create one; optional when it already exists.
|
|
380
|
+
match?: string
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export function setOverrideProfile(
|
|
384
|
+
cwd: string,
|
|
385
|
+
name: string,
|
|
386
|
+
profile: string,
|
|
387
|
+
ref: string,
|
|
388
|
+
options: SetOverrideProfileOptions = {},
|
|
389
|
+
): ModelMutationResult {
|
|
390
|
+
const trimmed = profile.trim()
|
|
391
|
+
if (trimmed.length === 0) return { ok: false, reason: 'Profile name cannot be empty.' }
|
|
392
|
+
if (!isModelRef(ref)) {
|
|
393
|
+
return {
|
|
394
|
+
ok: false,
|
|
395
|
+
reason: `Unknown model "${ref}". Run \`typeclaw model list --available\` to see valid options.`,
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (options.match !== undefined) {
|
|
399
|
+
const ruleError = modelOverrideRuleError(options.match)
|
|
400
|
+
if (ruleError !== undefined) return { ok: false, reason: `Invalid match rule "${options.match}": ${ruleError}` }
|
|
401
|
+
}
|
|
402
|
+
const existing = readOverridesRaw(cwd)[name]
|
|
403
|
+
if (existing === undefined && options.match === undefined) {
|
|
404
|
+
return {
|
|
405
|
+
ok: false,
|
|
406
|
+
reason: `Override "${name}" does not exist. Pass --match <rule> to create it, e.g. --match 'slack:*'.`,
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const providerId = providerForModelRef(ref)
|
|
410
|
+
if (options.force !== true && !hasUsableCredential(cwd, providerId, options.env ?? process.env)) {
|
|
411
|
+
return {
|
|
412
|
+
ok: false,
|
|
413
|
+
reason: `Provider "${providerId}" has no credentials. Run \`typeclaw provider add ${providerId}\` first, or pass --force to write anyway.`,
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
const match = existing?.match ?? []
|
|
417
|
+
const models = existing?.models ?? {}
|
|
418
|
+
const level = Object.hasOwn(options, 'thinkingLevel')
|
|
419
|
+
? options.thinkingLevel
|
|
420
|
+
: rawProfileThinkingLevel(models[trimmed])
|
|
421
|
+
const next: RawOverride = {
|
|
422
|
+
match: options.match !== undefined && !match.includes(options.match) ? [...match, options.match] : match,
|
|
423
|
+
models: { ...models, [trimmed]: withRawProfileThinkingLevel(ref, level) },
|
|
424
|
+
}
|
|
425
|
+
const customModel = !isKnownModelRef(ref) && options.meta !== undefined ? { ref, meta: options.meta } : undefined
|
|
426
|
+
return writeOverride(cwd, name, next, `model: set ${trimmed} → ${ref} in override ${name}`, customModel)
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Removing an override's last profile removes the override itself, since an
|
|
430
|
+
// entry with no profiles would be schema-invalid and has nothing to apply.
|
|
431
|
+
export function removeOverrideProfile(cwd: string, name: string, profile: string): ModelMutationResult {
|
|
432
|
+
const existing = readOverridesRaw(cwd)[name]
|
|
433
|
+
if (existing === undefined) return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
|
|
434
|
+
if (!(profile in existing.models)) {
|
|
435
|
+
return { ok: false, reason: `Profile "${profile}" not found in override "${name}".` }
|
|
436
|
+
}
|
|
437
|
+
const models = { ...existing.models }
|
|
438
|
+
delete models[profile]
|
|
439
|
+
if (Object.keys(models).length === 0) return removeOverride(cwd, name)
|
|
440
|
+
return writeOverride(cwd, name, { ...existing, models }, `model: remove ${profile} from override ${name}`)
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export function addOverrideMatch(cwd: string, name: string, rule: string): ModelMutationResult {
|
|
444
|
+
const ruleError = modelOverrideRuleError(rule)
|
|
445
|
+
if (ruleError !== undefined) return { ok: false, reason: `Invalid match rule "${rule}": ${ruleError}` }
|
|
446
|
+
const existing = readOverridesRaw(cwd)[name]
|
|
447
|
+
if (existing === undefined) {
|
|
448
|
+
return {
|
|
449
|
+
ok: false,
|
|
450
|
+
reason: `Override "${name}" not found. Create it with \`typeclaw model set <profile> <ref> --override ${name} --match '${rule}'\`.`,
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (existing.match.includes(rule)) return { ok: true }
|
|
454
|
+
return writeOverride(
|
|
455
|
+
cwd,
|
|
456
|
+
name,
|
|
457
|
+
{ ...existing, match: [...existing.match, rule] },
|
|
458
|
+
`model: match ${rule} in override ${name}`,
|
|
459
|
+
)
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export function removeOverrideMatch(cwd: string, name: string, rule: string): ModelMutationResult {
|
|
463
|
+
const existing = readOverridesRaw(cwd)[name]
|
|
464
|
+
if (existing === undefined) return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
|
|
465
|
+
if (!existing.match.includes(rule)) return { ok: false, reason: `Rule "${rule}" not found in override "${name}".` }
|
|
466
|
+
if (existing.match.length === 1) {
|
|
467
|
+
return {
|
|
468
|
+
ok: false,
|
|
469
|
+
reason: `"${rule}" is the last rule of override "${name}". Run \`typeclaw model override remove ${name}\` to delete the override.`,
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const match = existing.match.filter((r) => r !== rule)
|
|
473
|
+
return writeOverride(cwd, name, { ...existing, match }, `model: unmatch ${rule} in override ${name}`)
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export function removeOverride(cwd: string, name: string): ModelMutationResult {
|
|
477
|
+
if (readOverridesRaw(cwd)[name] === undefined) {
|
|
478
|
+
return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
|
|
479
|
+
}
|
|
480
|
+
return writeConfig(
|
|
481
|
+
cwd,
|
|
482
|
+
(parsed) => {
|
|
483
|
+
const overrides = { ...(isObjectRecord(parsed.modelOverrides) ? parsed.modelOverrides : {}) }
|
|
484
|
+
delete overrides[name]
|
|
485
|
+
parsed.modelOverrides = overrides
|
|
486
|
+
},
|
|
487
|
+
`model: remove override ${name}`,
|
|
488
|
+
)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
type RawOverride = { match: string[]; models: RawModels }
|
|
492
|
+
|
|
493
|
+
function writeOverride(
|
|
494
|
+
cwd: string,
|
|
495
|
+
name: string,
|
|
496
|
+
override: RawOverride,
|
|
497
|
+
commitMessage: string,
|
|
498
|
+
customModel?: { ref: ModelRef; meta: CustomModelMeta },
|
|
499
|
+
): ModelMutationResult {
|
|
500
|
+
return writeConfig(
|
|
501
|
+
cwd,
|
|
502
|
+
(parsed) => {
|
|
503
|
+
const overrides = isObjectRecord(parsed.modelOverrides) ? parsed.modelOverrides : {}
|
|
504
|
+
parsed.modelOverrides = { ...overrides, [name]: override }
|
|
505
|
+
},
|
|
506
|
+
commitMessage,
|
|
507
|
+
customModel,
|
|
508
|
+
)
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// On-disk `modelOverrides` so writers preserve hand-authored profile shapes.
|
|
512
|
+
function readOverridesRaw(cwd: string): Record<string, RawOverride> {
|
|
513
|
+
try {
|
|
514
|
+
const parsed = JSON.parse(readFileSync(join(cwd, CONFIG_FILE), 'utf8')) as {
|
|
515
|
+
modelOverrides?: Record<string, RawOverride>
|
|
516
|
+
}
|
|
517
|
+
return parsed.modelOverrides ?? {}
|
|
518
|
+
} catch (error) {
|
|
519
|
+
if ((error as NodeJS.ErrnoException).code === 'ENOENT') return {}
|
|
520
|
+
throw error
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
341
524
|
function isObjectRecord(value: unknown): value is Record<string, unknown> {
|
|
342
525
|
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
343
526
|
}
|
|
@@ -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
|
}
|