typeclaw 0.49.0 → 0.51.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/bash-sandbox-env.d.ts +15 -0
- package/dist/types/agent/bash-sandbox-proc.d.ts +8 -0
- package/dist/types/agent/bash-sandbox.d.ts +94 -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 +8 -0
- package/dist/types/agent/index.d.ts +151 -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/output-allowance.d.ts +4 -0
- package/dist/types/agent/plugin-tools.d.ts +58 -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-composition.d.ts +17 -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 +27 -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 +760 -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 +827 -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 +1458 -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 +145 -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/eval/cell.d.ts +26 -0
- package/dist/types/eval/config.d.ts +19 -0
- package/dist/types/eval/dispatch.d.ts +7 -0
- package/dist/types/eval/kernel.d.ts +28 -0
- package/dist/types/eval/process.d.ts +23 -0
- package/dist/types/eval/protocol.d.ts +34 -0
- package/dist/types/eval/sandbox.d.ts +10 -0
- package/dist/types/eval/tool.d.ts +17 -0
- package/dist/types/eval/wire.d.ts +33 -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 +3 -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/require-parallel.ts +5 -32
- package/src/agent/bash-sandbox-env.ts +104 -0
- package/src/agent/bash-sandbox-proc.ts +70 -0
- package/src/agent/bash-sandbox.ts +225 -0
- package/src/agent/compaction.ts +22 -10
- package/src/agent/guard-types.ts +3 -0
- package/src/agent/guards.ts +4 -0
- package/src/agent/idle-compaction.ts +178 -0
- package/src/agent/index.ts +139 -172
- package/src/agent/live-subagents.ts +19 -0
- package/src/agent/multimodal/look-at.ts +22 -9
- package/src/agent/output-allowance.ts +7 -0
- package/src/agent/plugin-tools.ts +39 -377
- package/src/agent/reviewer-bash-policy.ts +41 -1
- package/src/agent/session-origin.ts +28 -11
- package/src/agent/subagent-cache-keepalive.ts +198 -0
- package/src/agent/subagent-completion-reminder.ts +2 -2
- package/src/agent/subagent-session.ts +6 -0
- package/src/agent/subagents.ts +46 -8
- package/src/agent/system-prompt-composition.ts +141 -0
- package/src/agent/system-prompt.ts +5 -5
- package/src/agent/todo/scope.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 +84 -16
- 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/agent/tools-without-local-file-operands.ts +4 -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/fill-secret.ts +307 -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/explorer/explorer.ts +1 -1
- package/src/bundled-plugins/github-cli-auth/gh-command.ts +4 -0
- package/src/bundled-plugins/github-cli-auth/gh-review-detect.ts +40 -16
- package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
- package/src/bundled-plugins/github-cli-auth/graphql-auth-nudge.ts +12 -7
- package/src/bundled-plugins/github-cli-auth/index.ts +85 -60
- package/src/bundled-plugins/managed-browser/index.ts +179 -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/memory/dreaming.ts +4 -1
- package/src/bundled-plugins/memory/load-memory.ts +2 -4
- package/src/bundled-plugins/memory/memory-logger.ts +74 -2
- package/src/bundled-plugins/memory/transcript-preload.ts +103 -0
- package/src/bundled-plugins/memory/vector/hybrid.ts +25 -14
- 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/bundled-plugins/security/policies/private-surface-read.ts +166 -201
- package/src/channels/adapter-namespace.ts +13 -0
- package/src/channels/adapters/discord-bot-reference.ts +5 -4
- package/src/channels/adapters/discord-bot.ts +98 -5
- package/src/channels/adapters/discord-classify.ts +8 -3
- package/src/channels/adapters/discord.ts +29 -0
- 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-review-check.ts +5 -1
- package/src/channels/github-review-verdict-coordinator.ts +68 -2
- 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 +515 -243
- 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 +3 -2
- package/src/channels/types.ts +12 -2
- package/src/cli/channel.ts +2 -3
- package/src/cli/hostd.ts +3 -0
- 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 +126 -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 +69 -4
- package/src/container/start.ts +132 -5
- package/src/doctor/checks.ts +33 -22
- package/src/doctor/index.ts +48 -12
- package/src/doctor/operational-incidents.ts +16 -1
- package/src/doctor/plugin-bridge.ts +14 -1
- package/src/doctor/stage.ts +14 -0
- package/src/doctor/types.ts +6 -0
- package/src/eval/cell.ts +93 -0
- package/src/eval/config.ts +32 -0
- package/src/eval/dispatch.ts +67 -0
- package/src/eval/entry.ts +261 -0
- package/src/eval/kernel.ts +154 -0
- package/src/eval/process.ts +113 -0
- package/src/eval/protocol.ts +26 -0
- package/src/eval/redeclare.ts +174 -0
- package/src/eval/sandbox.ts +114 -0
- package/src/eval/tool.ts +98 -0
- package/src/eval/wire.ts +93 -0
- 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/operations/classify-tool-outcome.ts +1 -1
- 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 +6 -1
- 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/env-exposure.ts +20 -0
- package/src/sandbox/hidden-paths.ts +16 -2
- package/src/secrets/storage.ts +13 -0
- package/src/server/index.ts +46 -11
- package/src/skills/typeclaw-channel-github/SKILL.md +8 -8
- package/src/skills/typeclaw-config/SKILL.md +57 -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 +488 -5
- package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
- package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
|
@@ -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
|
}
|
package/src/config/providers.ts
CHANGED
|
@@ -121,8 +121,12 @@ export const KNOWN_PROVIDERS = {
|
|
|
121
121
|
maxTokens: 128000,
|
|
122
122
|
},
|
|
123
123
|
// GPT-6 Sol and Luna use Responses because Chat Completions accepts tools
|
|
124
|
-
// only at effort `none`. The full map and compat are pi-ai
|
|
124
|
+
// only at effort `none`. The full map and compat are pi-ai 1.4.0's
|
|
125
125
|
// catalog values, preserving every documented effort through `max`.
|
|
126
|
+
// With `supportsMidConvoEffort` (pi-ai 1.3.0), API-key requests keep a
|
|
127
|
+
// fixed reasoning.effort and carry the thinking level in
|
|
128
|
+
// configuration_update input items, so a mid-session level change keeps
|
|
129
|
+
// the prompt cache. Sign in with ChatGPT still sends reasoning.effort.
|
|
126
130
|
'gpt-6-sol': {
|
|
127
131
|
id: 'gpt-6-sol',
|
|
128
132
|
name: 'GPT-6 Sol',
|
|
@@ -149,6 +153,7 @@ export const KNOWN_PROVIDERS = {
|
|
|
149
153
|
supportsAdditionalTools: true,
|
|
150
154
|
supportsToolSearch: true,
|
|
151
155
|
supportsMidConvoSystemMessages: true,
|
|
156
|
+
supportsMidConvoEffort: true,
|
|
152
157
|
supportsExplicitPromptCacheMode: true,
|
|
153
158
|
},
|
|
154
159
|
},
|
|
@@ -178,6 +183,7 @@ export const KNOWN_PROVIDERS = {
|
|
|
178
183
|
supportsAdditionalTools: true,
|
|
179
184
|
supportsToolSearch: true,
|
|
180
185
|
supportsMidConvoSystemMessages: true,
|
|
186
|
+
supportsMidConvoEffort: true,
|
|
181
187
|
supportsExplicitPromptCacheMode: true,
|
|
182
188
|
},
|
|
183
189
|
},
|
|
@@ -747,8 +753,8 @@ export const KNOWN_PROVIDERS = {
|
|
|
747
753
|
apiKeyEnv: 'XAI_API_KEY',
|
|
748
754
|
oauthProviderId: 'xai',
|
|
749
755
|
models: {
|
|
750
|
-
// pi-ai
|
|
751
|
-
// `minimal` is not an xAI effort, so it clamps to `low`. The current
|
|
756
|
+
// pi-ai 1.4.0's xAI catalog caps Grok 4.3 at 30K and maps its efforts,
|
|
757
|
+
// including `xhigh`; `minimal` is not an xAI effort, so it clamps to `low`. The current
|
|
752
758
|
// transport sends model.maxTokens by default, so keep that vendor-safe cap.
|
|
753
759
|
'grok-4.3': {
|
|
754
760
|
id: 'grok-4.3',
|
|
@@ -767,7 +773,7 @@ export const KNOWN_PROVIDERS = {
|
|
|
767
773
|
low: 'low',
|
|
768
774
|
medium: 'medium',
|
|
769
775
|
high: 'high',
|
|
770
|
-
xhigh:
|
|
776
|
+
xhigh: 'xhigh',
|
|
771
777
|
max: null,
|
|
772
778
|
},
|
|
773
779
|
compat: { supportsLongCacheRetention: false },
|
|
@@ -1405,6 +1411,60 @@ export const KNOWN_PROVIDERS = {
|
|
|
1405
1411
|
},
|
|
1406
1412
|
},
|
|
1407
1413
|
},
|
|
1414
|
+
// Inception (Mercury diffusion LLMs) official API. OpenAI-compatible
|
|
1415
|
+
// /v1/chat/completions with Bearer auth, so it goes through pi-ai's
|
|
1416
|
+
// `openai-completions` adapter with a custom baseUrl. api-key only.
|
|
1417
|
+
//
|
|
1418
|
+
// Only Mercury 3 is listed: Mercury 2 / 2.5 are closed to new users as of
|
|
1419
|
+
// 2026-10-19 and shut down for existing ones on 2026-11-15. Mercury Voice is
|
|
1420
|
+
// enterprise-gated, Mercury Decide and Mercury Edit 2 don't serve chat.
|
|
1421
|
+
//
|
|
1422
|
+
// Cost is the standard rate from docs.inceptionlabs.ai/get-started/models
|
|
1423
|
+
// as of 2026-10-20, not the 50%-off launch price, so the record doesn't go
|
|
1424
|
+
// stale when the promotion ends. No cache-write surcharge is published.
|
|
1425
|
+
//
|
|
1426
|
+
// reasoning_effort accepts instant/low/medium/high and defaults to `low`
|
|
1427
|
+
// when omitted. `off` maps to `instant` so a non-reasoning turn really drops
|
|
1428
|
+
// to the fastest mode instead of silently reasoning at the default.
|
|
1429
|
+
//
|
|
1430
|
+
// The OpenAPI spec (api.inceptionlabs.ai/openapi.json) documents neither
|
|
1431
|
+
// `store` nor the `developer` role, and pi-ai doesn't auto-detect compat
|
|
1432
|
+
// for this baseUrl, so both are turned off.
|
|
1433
|
+
inception: {
|
|
1434
|
+
id: 'inception',
|
|
1435
|
+
name: 'Inception (Mercury)',
|
|
1436
|
+
baseUrl: 'https://api.inceptionlabs.ai/v1',
|
|
1437
|
+
auth: ['api-key'],
|
|
1438
|
+
apiKeyEnv: 'INCEPTION_API_KEY',
|
|
1439
|
+
oauthProviderId: null,
|
|
1440
|
+
models: {
|
|
1441
|
+
'mercury-3': {
|
|
1442
|
+
id: 'mercury-3',
|
|
1443
|
+
name: 'Mercury 3',
|
|
1444
|
+
api: 'openai-completions',
|
|
1445
|
+
provider: 'inception',
|
|
1446
|
+
baseUrl: 'https://api.inceptionlabs.ai/v1',
|
|
1447
|
+
reasoning: true,
|
|
1448
|
+
thinkingLevelMap: {
|
|
1449
|
+
off: 'instant',
|
|
1450
|
+
minimal: 'low',
|
|
1451
|
+
low: 'low',
|
|
1452
|
+
medium: 'medium',
|
|
1453
|
+
high: 'high',
|
|
1454
|
+
xhigh: 'high',
|
|
1455
|
+
},
|
|
1456
|
+
input: ['text'],
|
|
1457
|
+
cost: { input: 0.2, output: 0.7, cacheRead: 0.02, cacheWrite: 0 },
|
|
1458
|
+
contextWindow: 1000000,
|
|
1459
|
+
maxTokens: 131072,
|
|
1460
|
+
compat: {
|
|
1461
|
+
supportsStore: false,
|
|
1462
|
+
supportsDeveloperRole: false,
|
|
1463
|
+
supportsReasoningEffort: true,
|
|
1464
|
+
},
|
|
1465
|
+
},
|
|
1466
|
+
},
|
|
1467
|
+
},
|
|
1408
1468
|
} as const satisfies Record<string, KnownProvider>
|
|
1409
1469
|
|
|
1410
1470
|
export type KnownProviderId = keyof typeof KNOWN_PROVIDERS
|
|
@@ -1492,6 +1552,11 @@ export const KNOWN_PROVIDER_VENDORS = {
|
|
|
1492
1552
|
'moonshot-coding': { label: 'Coding Plan', hint: 'Kimi Code subscription' },
|
|
1493
1553
|
},
|
|
1494
1554
|
},
|
|
1555
|
+
inception: {
|
|
1556
|
+
id: 'inception',
|
|
1557
|
+
name: 'Inception (Mercury)',
|
|
1558
|
+
providers: ['inception'],
|
|
1559
|
+
},
|
|
1495
1560
|
// Listed last because it is a reseller, not a lab: a user who knows they want
|
|
1496
1561
|
// Anthropic should land on the Anthropic row, not the gateway that proxies it.
|
|
1497
1562
|
opengateway: {
|
package/src/container/start.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto'
|
|
2
|
-
import { accessSync, constants as fsConstants, existsSync, realpathSync } from 'node:fs'
|
|
2
|
+
import { accessSync, constants as fsConstants, existsSync, realpathSync, statSync } 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
|
|
@@ -97,6 +127,7 @@ export type StartPlan = {
|
|
|
97
127
|
hostPort: number
|
|
98
128
|
tuiToken: string | null
|
|
99
129
|
memoryLimitBytes: number
|
|
130
|
+
mountWarnings: string[]
|
|
100
131
|
}
|
|
101
132
|
|
|
102
133
|
export type PlanStartOptions = {
|
|
@@ -120,6 +151,7 @@ export type PlanStartOptions = {
|
|
|
120
151
|
// rather than from os.totalmem(). Omitted by callers that have no exec (and
|
|
121
152
|
// by tests), in which case the default applies unclamped.
|
|
122
153
|
totalMemoryBytes?: number | undefined
|
|
154
|
+
hostHome?: string
|
|
123
155
|
}
|
|
124
156
|
|
|
125
157
|
export type HostDaemonControl = {
|
|
@@ -380,8 +412,18 @@ async function runStart({
|
|
|
380
412
|
}
|
|
381
413
|
}
|
|
382
414
|
|
|
383
|
-
const
|
|
384
|
-
|
|
415
|
+
const githubCliConfig = await loadTypeclawConfig(cwd)
|
|
416
|
+
if (!githubCliConfig.githubCli.importHostAuth) {
|
|
417
|
+
const removalFailure = removeGithubCliStore(cwd)
|
|
418
|
+
if (removalFailure !== null) return { ok: false, reason: removalFailure }
|
|
419
|
+
}
|
|
420
|
+
const githubCliWarning = githubCliConfig.githubCli.importHostAuth
|
|
421
|
+
? await refreshGithubCliStore(
|
|
422
|
+
cwd,
|
|
423
|
+
resolveGithubCliDeniedRoots(cwd, githubCliConfig),
|
|
424
|
+
provisionGithubCliStoreForAgent,
|
|
425
|
+
)
|
|
426
|
+
: null
|
|
385
427
|
if (githubCliWarning !== null) {
|
|
386
428
|
if (streamOutput) process.stderr.write(githubCliWarning)
|
|
387
429
|
else onWarning?.(githubCliWarning.trim())
|
|
@@ -520,7 +562,14 @@ async function runStart({
|
|
|
520
562
|
// version bump (dir already present) or a removal (stale dir left behind)
|
|
521
563
|
// would otherwise leave bun.lock/node_modules out of sync with the
|
|
522
564
|
// reconciled package.json.
|
|
565
|
+
//
|
|
566
|
+
// A `file:` dep is a snapshot copy taken at install time, so pulling or
|
|
567
|
+
// editing the checkout leaves the agent running old code until something
|
|
568
|
+
// re-copies it. Fingerprint the checkout and force a reinstall only when it
|
|
569
|
+
// moved since the last install, so routine restarts stay fast.
|
|
570
|
+
const staleLocalFingerprint = await staleLocalTypeclawCopyFingerprint(cwd)
|
|
523
571
|
const forceDepsReinstall =
|
|
572
|
+
staleLocalFingerprint !== null ||
|
|
524
573
|
(forceBuild && (await hasLocallyLinkedTypeclawDep(cwd))) ||
|
|
525
574
|
pluginReconcile.changed ||
|
|
526
575
|
outcomeRequiresForceInstall(upgrade) ||
|
|
@@ -529,6 +578,7 @@ async function runStart({
|
|
|
529
578
|
if (!deps.ok) {
|
|
530
579
|
return { ok: false, reason: `dependency install failed: ${deps.reason}` }
|
|
531
580
|
}
|
|
581
|
+
if (staleLocalFingerprint !== null) await writeLocalSourceStamp(cwd, staleLocalFingerprint)
|
|
532
582
|
await commitSystemFile(cwd, DEPENDENCY_FILES, upgradeCommitMessage ?? 'Update dependencies')
|
|
533
583
|
// Probe buildx up front so the Dockerfile we write matches the builder we
|
|
534
584
|
// will use. buildx present -> emit the BuildKit Dockerfile and build with
|
|
@@ -611,6 +661,11 @@ async function runStart({
|
|
|
611
661
|
totalMemoryBytes,
|
|
612
662
|
})
|
|
613
663
|
|
|
664
|
+
for (const warning of plan.mountWarnings) {
|
|
665
|
+
if (onWarning !== undefined) onWarning(warning)
|
|
666
|
+
else if (streamOutput) process.stderr.write(`typeclaw: warning: ${warning}\n`)
|
|
667
|
+
}
|
|
668
|
+
|
|
614
669
|
if (!skipMemoryOversubscriptionCheck) {
|
|
615
670
|
await warnOnMemoryOversubscription({
|
|
616
671
|
exec,
|
|
@@ -855,6 +910,22 @@ async function refreshGithubCliStore(
|
|
|
855
910
|
)
|
|
856
911
|
}
|
|
857
912
|
|
|
913
|
+
// Without opt-in, a store persisted by an earlier start (when copying was
|
|
914
|
+
// unconditional) still carries the operator's identity. The container exports
|
|
915
|
+
// whatever store secrets.json holds, so a failed removal must stop the launch
|
|
916
|
+
// rather than run the agent as the operator.
|
|
917
|
+
function removeGithubCliStore(agentDir: string): string | null {
|
|
918
|
+
try {
|
|
919
|
+
new SecretsBackend(join(agentDir, 'secrets.json')).removeGithubCliSync()
|
|
920
|
+
return null
|
|
921
|
+
} catch {
|
|
922
|
+
return (
|
|
923
|
+
'Could not remove the host GitHub CLI credential from secrets.json (githubCli.importHostAuth is off). ' +
|
|
924
|
+
'Delete the `githubCli` entry from secrets.json by hand, or fix the file if it is malformed, then run typeclaw start again.'
|
|
925
|
+
)
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
858
929
|
// An unreadable or malformed secrets.json cannot prove the store is absent, so
|
|
859
930
|
// it takes the warning — silence is reserved for a confirmed no-store agent.
|
|
860
931
|
function hasPersistedGithubCliStore(agentDir: string): boolean {
|
|
@@ -922,6 +993,7 @@ export async function planStart({
|
|
|
922
993
|
hostIdentity = currentHostIdentity(),
|
|
923
994
|
gitIdentity,
|
|
924
995
|
totalMemoryBytes,
|
|
996
|
+
hostHome = homedir(),
|
|
925
997
|
}: PlanStartOptions): Promise<StartPlan> {
|
|
926
998
|
const containerName = containerNameFromCwd(cwd)
|
|
927
999
|
const imageTag = imageTagFromCwd(cwd)
|
|
@@ -1156,12 +1228,24 @@ export async function planStart({
|
|
|
1156
1228
|
runArgs.push(...dockerBindMount({ src: devSourcePath, dst: DEV_SOURCE_CONTAINER_PATH, readonly: true }))
|
|
1157
1229
|
}
|
|
1158
1230
|
|
|
1231
|
+
const mountWarnings: string[] = []
|
|
1159
1232
|
for (const mount of mounts) {
|
|
1160
1233
|
const hostPath = expandMountPath(mount.path, cwd)
|
|
1234
|
+
const conflict = describeMountTargetConflict(cwd, mount.name, hostPath)
|
|
1235
|
+
if (conflict !== null) {
|
|
1236
|
+
mountWarnings.push(conflict)
|
|
1237
|
+
continue
|
|
1238
|
+
}
|
|
1161
1239
|
const target = `${MOUNT_TARGET_PREFIX}/${mount.name}`
|
|
1162
1240
|
runArgs.push(...dockerBindMount({ src: hostPath, dst: target, readonly: mount.readOnly }))
|
|
1163
1241
|
}
|
|
1164
1242
|
|
|
1243
|
+
if (cfg.hostFonts) {
|
|
1244
|
+
for (const fontMount of resolveHostFontMounts({ platform, home: hostHome })) {
|
|
1245
|
+
runArgs.push(...dockerBindMount(fontMount))
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1165
1249
|
// Shared model cache mount for embeddings. Vector memory is always on, and
|
|
1166
1250
|
// the embedder runs with local_files_only inside the container.
|
|
1167
1251
|
runArgs.push(...dockerBindMount({ src: join(homeRoot(), 'models'), dst: '/opt/models', readonly: true }))
|
|
@@ -1179,7 +1263,31 @@ export async function planStart({
|
|
|
1179
1263
|
hostPort,
|
|
1180
1264
|
tuiToken,
|
|
1181
1265
|
memoryLimitBytes: memoryLimit.bytes,
|
|
1266
|
+
mountWarnings,
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// Docker leaves the bind target it created under the agent folder after the
|
|
1271
|
+
// container is gone, so a mount whose source switched between file and directory
|
|
1272
|
+
// collides with that leftover and fails the whole `docker run` ("not a
|
|
1273
|
+
// directory"). Skip just that mount so the agent still boots; deleting the
|
|
1274
|
+
// target is left to the operator because it lives in their agent folder.
|
|
1275
|
+
function describeMountTargetConflict(cwd: string, name: string, hostPath: string): string | null {
|
|
1276
|
+
const target = join(cwd, 'mounts', name)
|
|
1277
|
+
let targetIsDirectory: boolean
|
|
1278
|
+
let sourceIsDirectory: boolean
|
|
1279
|
+
try {
|
|
1280
|
+
targetIsDirectory = statSync(target).isDirectory()
|
|
1281
|
+
sourceIsDirectory = statSync(hostPath).isDirectory()
|
|
1282
|
+
} catch {
|
|
1283
|
+
return null
|
|
1182
1284
|
}
|
|
1285
|
+
if (targetIsDirectory === sourceIsDirectory) return null
|
|
1286
|
+
const kind = (isDirectory: boolean): string => (isDirectory ? 'a directory' : 'a file')
|
|
1287
|
+
return (
|
|
1288
|
+
`mount "${name}" skipped: ${hostPath} is ${kind(sourceIsDirectory)} but its target ${target} is ` +
|
|
1289
|
+
`${kind(targetIsDirectory)}, so Docker cannot bind it. Remove ${target} and restart to restore the mount.`
|
|
1290
|
+
)
|
|
1183
1291
|
}
|
|
1184
1292
|
|
|
1185
1293
|
// Surfaces the arithmetic when every agent's cap together exceeds what Docker
|
|
@@ -1234,6 +1342,7 @@ export async function refreshDockerfile(
|
|
|
1234
1342
|
// path. Mirrors the same gate in writeDockerAssets (src/init/index.ts).
|
|
1235
1343
|
const devMode = await hasLocallyLinkedTypeclawDep(cwd)
|
|
1236
1344
|
const next = buildDockerfile(cfg.docker.file, {
|
|
1345
|
+
browser: cfg.browser,
|
|
1237
1346
|
baseImageVersion: devMode ? null : resolveBaseImageVersion(cwd),
|
|
1238
1347
|
cjkFontsAuto: hostLocaleIsCjk(),
|
|
1239
1348
|
buildKit: opts.buildKit,
|
|
@@ -1698,6 +1807,24 @@ async function hasLocallyLinkedTypeclawDep(cwd: string): Promise<boolean> {
|
|
|
1698
1807
|
return spec !== null && (spec.startsWith('file:') || spec.startsWith('link:'))
|
|
1699
1808
|
}
|
|
1700
1809
|
|
|
1810
|
+
// Returns the checkout's current fingerprint when the agent's `file:` copy of
|
|
1811
|
+
// typeclaw no longer matches it, else null. An install that resolves to the
|
|
1812
|
+
// checkout itself is live and never stale. A symlink alone does not prove that:
|
|
1813
|
+
// bun's isolated linker symlinks into its own store, which is still a copy.
|
|
1814
|
+
async function staleLocalTypeclawCopyFingerprint(cwd: string): Promise<string | null> {
|
|
1815
|
+
if (!(await readTypeclawDepSpec(cwd))?.startsWith('file:')) return null
|
|
1816
|
+
const source = await detectDevSource(cwd)
|
|
1817
|
+
if (source === null) return null
|
|
1818
|
+
try {
|
|
1819
|
+
if (realpathSync(join(cwd, 'node_modules', TYPECLAW_PACKAGE)) === realpathSync(source)) return null
|
|
1820
|
+
} catch {
|
|
1821
|
+
// Not installed yet, or the checkout is missing: fall through to the fingerprint.
|
|
1822
|
+
}
|
|
1823
|
+
const fingerprint = await localSourceFingerprint(source)
|
|
1824
|
+
if (fingerprint === null || fingerprint === (await readLocalSourceStamp(cwd))) return null
|
|
1825
|
+
return fingerprint
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1701
1828
|
async function readTypeclawDepSpec(cwd: string): Promise<string | null> {
|
|
1702
1829
|
try {
|
|
1703
1830
|
const raw = await readFile(join(cwd, PACKAGE_FILE), 'utf8')
|