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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LoadableSkill } from '@/plugin'
|
|
2
|
+
|
|
3
|
+
export const HTTP_QA_SKILL: LoadableSkill = {
|
|
4
|
+
name: 'qa-http',
|
|
5
|
+
description:
|
|
6
|
+
'QA an HTTP or JSON API: exercise endpoints with curl, capture status, headers, and bodies, chain requests through realistic workflows, and cover validation errors, auth failures, and idempotency.',
|
|
7
|
+
content: `# qa-http
|
|
8
|
+
|
|
9
|
+
You are QAing an HTTP API. Apply this on top of the QA loop and the \`<qa>\` output contract.
|
|
10
|
+
|
|
11
|
+
## Reach the API
|
|
12
|
+
|
|
13
|
+
- **A deployed endpoint** — use it as given. Never send destructive requests (DELETE, bulk updates) to production unless the caller explicitly asked and named a test resource.
|
|
14
|
+
- **A repo or PR** — write one script that starts the server from the documented command, waits for its health endpoint or port with a bounded retry loop, runs your requests, and stops the server; run it in a single \`bash\` call (a server backgrounded in one call does not survive to the next). Record the start command.
|
|
15
|
+
- Credentials come from the caller or from env vars the operator already exposed. Never print a token into evidence; redact it as \`<redacted>\`.
|
|
16
|
+
|
|
17
|
+
## Capture
|
|
18
|
+
|
|
19
|
+
Use \`curl -sS -i\` so the status line and headers are kept with the body. Save each response to \`/tmp/qa/<run-id>/<scenario>.http\`. If \`hurl\` is installed, a \`.hurl\` file with assertions is a fine way to make a flow repeatable; keep its report.
|
|
20
|
+
|
|
21
|
+
## What to cover
|
|
22
|
+
|
|
23
|
+
1. **Happy path** for each endpoint the request names: correct status, response shape, and the field values the contract promises.
|
|
24
|
+
2. **Workflow chain**: create → read back → update → read back → delete → confirm gone. Capture ids from earlier responses rather than hardcoding them.
|
|
25
|
+
3. **Validation**: missing field, wrong type, out-of-range value. Expect a 4xx with a message that names the field, never a 500.
|
|
26
|
+
4. **Auth**: no credentials and wrong credentials return 401/403, never data.
|
|
27
|
+
5. **Not found and method errors**: an unknown id returns 404; a wrong method returns 405 or the documented behavior.
|
|
28
|
+
6. **Idempotency and retries** where the API promises them: the same PUT twice leaves the same state; a retried create with an idempotency key does not duplicate.
|
|
29
|
+
7. **Non-ASCII payloads**: Korean or Japanese strings round-trip unchanged.
|
|
30
|
+
|
|
31
|
+
## Severity
|
|
32
|
+
|
|
33
|
+
- **blocker** — wrong data, a 5xx on valid input, auth bypass, a broken contract field.
|
|
34
|
+
- **concern** — a 5xx on invalid input, a vague error, an undocumented status code.
|
|
35
|
+
- **nit** — header or formatting inconsistencies.
|
|
36
|
+
|
|
37
|
+
Return everything inside the \`<qa>\` block.
|
|
38
|
+
`,
|
|
39
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { LoadableSkill } from '@/plugin'
|
|
2
|
+
|
|
3
|
+
export const PR_QA_SKILL: LoadableSkill = {
|
|
4
|
+
name: 'qa-pr',
|
|
5
|
+
description:
|
|
6
|
+
'QA a pull request, branch, commit, or whole repository: acquire it at an exact SHA, install and build from a clean scratch clone, run the project’s own checks, then exercise the changed behavior through its real interface and compare against the base when attribution matters.',
|
|
7
|
+
content: `# qa-pr
|
|
8
|
+
|
|
9
|
+
You are QAing code that lives in a repository: a pull request, a branch, a commit, or an open-source project as a whole. Apply this on top of the QA loop and the \`<qa>\` output contract.
|
|
10
|
+
|
|
11
|
+
## Acquire the target at an exact revision
|
|
12
|
+
|
|
13
|
+
- **GitHub PR** — \`gh pr view <n> --repo <owner>/<repo> --json title,body,headRefOid,baseRefOid,files\` gives intent, the head SHA, and the changed files. \`gh pr diff <n> --repo <owner>/<repo>\` gives the diff. Keep each \`gh\` call a single bare invocation (no pipes, \`&&\`, or redirects): the runtime injects a token into its environment.
|
|
14
|
+
- **Public repo** — \`git clone <url> /tmp/qa/<run-id>/head\`. A clone does not include pull-request refs, so for a PR (especially from a fork) also run \`git -C /tmp/qa/<run-id>/head fetch origin pull/<n>/head\`. Then \`git -C /tmp/qa/<run-id>/head checkout <headSha>\` and confirm \`git -C /tmp/qa/<run-id>/head rev-parse HEAD\` equals the head SHA.
|
|
15
|
+
- **Private GitHub repo** — call \`github_prepare_review_checkout\` with the repo slug, head SHA, and merge-base SHA. Its receipt is a read-only acquisition cache: make your writable tree with \`git clone <receipt-path> /tmp/qa/<run-id>/head\` and work only in the clone.
|
|
16
|
+
- **Base comparison** — when you must show the change caused (or fixed) a behavior, make a second clone at the merge base in \`/tmp/qa/<run-id>/base\` and run the same scenario on both.
|
|
17
|
+
|
|
18
|
+
Record the head SHA (and base SHA if used) in \`<target>\`.
|
|
19
|
+
|
|
20
|
+
## Derive the acceptance criteria
|
|
21
|
+
|
|
22
|
+
1. Read the PR title/body and linked issues: what does the author claim the change does? Each claim becomes a scenario.
|
|
23
|
+
2. Read the diff to find the user-facing surface it touches: a CLI flag, an endpoint, a page, a library export, a config key.
|
|
24
|
+
3. Read \`README\`, \`CONTRIBUTING\`, \`AGENTS.md\`, \`package.json\`/\`Makefile\`/\`pyproject.toml\`/\`Cargo.toml\` for the canonical install, build, test, and run commands. Use the project's commands, not ones you invent.
|
|
25
|
+
4. Add one regression scenario on adjacent behavior the diff could break, and one edge case on the changed path.
|
|
26
|
+
|
|
27
|
+
## Build and run the project's own checks
|
|
28
|
+
|
|
29
|
+
- Install with the lockfile the repo ships (\`bun install --frozen-lockfile\`, \`npm ci\`, \`pnpm install --frozen-lockfile\`, \`pip install -e .\`, \`cargo build\`, \`go build ./...\`).
|
|
30
|
+
- Run the documented typecheck, lint, and test commands. Record pass/fail counts and exit codes as scenarios.
|
|
31
|
+
- A check that also fails on the base revision is a **pre-existing failure**: report it in \`<coverage_gaps>\` or as a \`concern\`, never as a defect of this change. Only run the base when a failure needs attribution.
|
|
32
|
+
- If install or build cannot work in this environment (needs a GPU, a paid service, a platform you are not on), the run is \`inconclusive\` for those scenarios; say what is missing.
|
|
33
|
+
|
|
34
|
+
## Exercise the changed behavior for real
|
|
35
|
+
|
|
36
|
+
Green tests are not the finish line: tests can be too narrow, and the author wrote them. Drive the changed behavior through its real interface:
|
|
37
|
+
|
|
38
|
+
- CLI change → run the built binary with the new flag/subcommand (load \`qa-cli\`).
|
|
39
|
+
- Web change → start the dev server and drive the page (load \`qa-web\`).
|
|
40
|
+
- API change → start the server and hit the endpoint (load \`qa-http\`).
|
|
41
|
+
- Library change → write a small script in your scratch dir that imports the public API and exercises the new behavior; keep its transcript.
|
|
42
|
+
|
|
43
|
+
## Severity
|
|
44
|
+
|
|
45
|
+
- **blocker** — a stated claim of the PR does not hold, the build or the project's own tests break because of this change, or a regression on adjacent behavior.
|
|
46
|
+
- **concern** — an edge case on the changed path misbehaves, a missing error message, a docs claim that does not match behavior.
|
|
47
|
+
- **nit** — cosmetic output issues that do not affect correctness.
|
|
48
|
+
|
|
49
|
+
Return everything inside the \`<qa>\` block.
|
|
50
|
+
`,
|
|
51
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { LoadableSkill } from '@/plugin'
|
|
2
|
+
|
|
3
|
+
export const WEB_QA_SKILL: LoadableSkill = {
|
|
4
|
+
name: 'qa-web',
|
|
5
|
+
description:
|
|
6
|
+
'QA a web app or URL in a real browser: drive user flows with a browser engine (agent-browser by default), capture screenshots and console/network errors per step, and cover happy path, a negative path, and mobile plus desktop widths.',
|
|
7
|
+
content: `# qa-web
|
|
8
|
+
|
|
9
|
+
You are QAing something that renders in a browser. Apply this on top of the QA loop and the \`<qa>\` output contract.
|
|
10
|
+
|
|
11
|
+
## Get a page to test
|
|
12
|
+
|
|
13
|
+
- **A deployed URL** — use it directly. Do not log in to accounts, submit payments, or send messages on a production site unless the caller explicitly asked you to and provided a test account.
|
|
14
|
+
- **A repo or PR** — install, then write one script that starts the dev or preview server from the project's documented command, waits until the port answers (\`curl -sf http://localhost:<port>\` in a bounded retry loop), runs your browser steps, and stops the server. Run it in a single \`bash\` call: a server backgrounded in one call does not survive to the next. Record the start command.
|
|
15
|
+
|
|
16
|
+
## Drive the browser
|
|
17
|
+
|
|
18
|
+
The \`agent-browser\` CLI is always installed and is used below. If the operator enabled another engine (\`omowright\`, \`browser-use\`, \`browserskill\`), its skill is loaded and you may use it instead with the same loop. When TypeClaw's shared browser is running, agent-browser attaches to it automatically. The loop is observe → act → observe:
|
|
19
|
+
|
|
20
|
+
- \`agent-browser open <url>\` to load the page.
|
|
21
|
+
- \`agent-browser snapshot -i\` to get the interactive elements with \`@e\` refs; act on refs, not guessed selectors.
|
|
22
|
+
- \`agent-browser click @e3\`, \`agent-browser fill @e5 "text"\`, \`agent-browser press Enter\` to interact.
|
|
23
|
+
- \`agent-browser screenshot /tmp/qa/<run-id>/<scenario>-<step>.png\` after each meaningful step.
|
|
24
|
+
- Read console errors and failed requests after each flow; an uncaught exception or a 4xx/5xx on a load-bearing request is a finding even when the page looks fine.
|
|
25
|
+
- \`agent-browser close\` when done.
|
|
26
|
+
|
|
27
|
+
If the project already ships Playwright tests, running them is a check scenario, not a replacement for driving the flow yourself.
|
|
28
|
+
|
|
29
|
+
## What to cover
|
|
30
|
+
|
|
31
|
+
1. **Happy path** of every flow the request names, end to end, with the resulting state verified (the item appears in the list, the URL changes, the success message shows).
|
|
32
|
+
2. **A negative path**: empty or invalid form input, a missing resource, an unauthorized action. The UI must say what went wrong.
|
|
33
|
+
3. **Widths**: at least one desktop (about 1440 wide) and one phone-sized (about 390 wide) pass of the main screen. Clipped text, overlapping elements, or horizontal scroll of primary content are findings.
|
|
34
|
+
4. **Reload and back**: state that should persist survives a reload; the back button does not break the flow.
|
|
35
|
+
5. **Non-English text** when the product is used internationally: Korean or Japanese input renders and wraps without clipping.
|
|
36
|
+
|
|
37
|
+
## Evidence
|
|
38
|
+
|
|
39
|
+
Every scenario cites its screenshots and the console/network excerpt. Describe what each screenshot shows in \`<observed>\`; the parent may not be able to open images.
|
|
40
|
+
|
|
41
|
+
## Severity
|
|
42
|
+
|
|
43
|
+
- **blocker** — a named flow cannot complete, data is lost or wrong, an uncaught error breaks the page.
|
|
44
|
+
- **concern** — a negative path gives no feedback, layout breaks at one width, a console error that does not yet break the flow.
|
|
45
|
+
- **nit** — visual polish.
|
|
46
|
+
|
|
47
|
+
Return everything inside the \`<qa>\` block.
|
|
48
|
+
`,
|
|
49
|
+
}
|
|
@@ -35,7 +35,7 @@ gh api "/repos/<owner>/<repo>/contents/<path>?ref=<headSha>" -H "Accept: applica
|
|
|
35
35
|
|
|
36
36
|
That returns the file's raw bytes (no base64, no second stage). For the line numbers your \`location="path:line"\` anchors need, read them off the unified diff you already fetched (\`gh pr diff\` prints the new-side line numbers in its hunk headers, \`@@ -a,b +c,d @@\`), or escalate to Mode 2 where a real \`read\`/\`grep\` gives native line numbers. Fetch each file once and keep its output — do not re-fetch the same file to re-derive a line you already saw.
|
|
37
37
|
|
|
38
|
-
**Mode 2 — scratch checkout (escalate when navigation gets broad).** When navigation gets broad, call \`github_prepare_review_checkout({ repoSlug: "<owner>/<repo>", headSha: "<40-char headSha>" })\` once for initial acquisition. The runtime verifies that exact SHA in the one allowlisted repository and performs the authenticated fetch without exposing its token to model bash.
|
|
38
|
+
**Mode 2 — scratch checkout (escalate when navigation gets broad).** When navigation gets broad, call \`github_prepare_review_checkout({ repoSlug: "<owner>/<repo>", headSha: "<40-char headSha>", baseSha: "<40-char merge base>" })\` once for initial acquisition. Always pass \`baseSha\` so the checkout holds both commits and \`git -C <receipt-path> diff <baseSha> <headSha>\` gives the full untruncated PR diff; without it the base is missing and that diff fails with "bad object". Use the merge base GitHub diffs against (\`gh api /repos/<owner>/<repo>/compare/<baseRefOid>...<headSha> --jq .merge_base_commit.sha\`), not \`baseRefOid\` itself, which can include unrelated base-branch commits. The runtime verifies that exact head SHA in the one allowlisted repository and performs the authenticated fetch without exposing its token to model bash.
|
|
39
39
|
|
|
40
40
|
Then use the returned receipt path exactly with \`read\`, \`grep\`, \`find\`, and read-only \`git\` (\`git -C <receipt-path> log|diff|show|blame|grep|ls-files|cat-file\`) for correct line numbers and zero per-file round-trips. Trust the receipt: never guess, derive, or reconstruct a \`/tmp\` path. If and only if a read-only operation against that exact returned receipt path fails with \`ENOENT\` / \`No such file or directory\`, call the checkout tool one additional time with the same exact repo slug and 40-character head SHA, then use only the new returned receipt. This is a maximum two checkout tool calls; never retry generic command, tool, or provider failures, change coordinates, or recover by guessing a path. If recovery also fails, stop checkout attempts and fall back to remote reads where feasible or return an honest incomplete review. Do not use \`git clone\`, \`git fetch\`, \`git checkout\`, or \`gh pr checkout\` for acquisition.
|
|
41
41
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfig } from '@/config'
|
|
2
|
+
import { definePlugin, type PluginContext, type PluginLogger, type ToolBeforeEvent } from '@/plugin'
|
|
2
3
|
import { resolveHiddenPaths } from '@/sandbox'
|
|
3
4
|
|
|
5
|
+
import { analyzeGitCommand, createSessionTmpGitResolvers } from '../github-cli-auth/git-command'
|
|
6
|
+
import { recordGrantedPush, resolveGrantedPush } from '../github-cli-auth/granted-push'
|
|
4
7
|
import { HIGH_TIER_PER_GUARD_PERMISSIONS, SECURITY_PERMISSIONS, SEVERITY_PERMISSION } from './permissions'
|
|
5
8
|
import type { SecurityPermission, SecuritySeverity } from './permissions'
|
|
6
9
|
import { GUARD_CRON_PROMOTION_SEVERITY, checkCronPromotionGuard } from './policies/cron-promotion'
|
|
@@ -9,6 +12,7 @@ import {
|
|
|
9
12
|
GUARD_GIT_REMOTE_TAINTED_SEVERITY,
|
|
10
13
|
checkGitExfilGuard,
|
|
11
14
|
checkGitRemoteTaintedGuard,
|
|
15
|
+
isPushOnlyGitExfilMatch,
|
|
12
16
|
recordGitRemoteTaintIfAny,
|
|
13
17
|
} from './policies/git-exfil'
|
|
14
18
|
import { GUARD_OUTBOUND_SECRET_SEVERITY, checkOutboundSecretGuard } from './policies/outbound-secret-scan'
|
|
@@ -87,6 +91,47 @@ function withPermissionHint(
|
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
type PushGrantOutcome = { kind: 'allow' } | { kind: 'deny'; reason: string } | { kind: 'not-configured' }
|
|
95
|
+
|
|
96
|
+
// Only consulted for a command whose sole gitExfil finding is `git push`. The
|
|
97
|
+
// destination is decided from the broker's resolved remote identity, never
|
|
98
|
+
// from the command string or working-directory path; on allow, the resolved
|
|
99
|
+
// destination is handed to github-cli-auth, which refuses to fund any other.
|
|
100
|
+
async function evaluatePushGrant(
|
|
101
|
+
event: ToolBeforeEvent,
|
|
102
|
+
ctx: Pick<PluginContext, 'agentDir' | 'github'>,
|
|
103
|
+
): Promise<PushGrantOutcome> {
|
|
104
|
+
const command = event.args.command
|
|
105
|
+
if (typeof command !== 'string' || !isPushOnlyGitExfilMatch(command)) return { kind: 'not-configured' }
|
|
106
|
+
const github = getConfig().channels?.github
|
|
107
|
+
if (github === undefined || github.repos.length === 0) return { kind: 'not-configured' }
|
|
108
|
+
if (!ctx.github.hasAppTokenResolver()) {
|
|
109
|
+
return {
|
|
110
|
+
kind: 'deny',
|
|
111
|
+
reason: 'pushing to channels.github.repos without the bypass requires GitHub App auth for the github channel',
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const resolvers = createSessionTmpGitResolvers(ctx.agentDir, event.sessionId)
|
|
115
|
+
const decision = await analyzeGitCommand(command, { cwd: ctx.agentDir, resolvers })
|
|
116
|
+
const verdict = await resolveGrantedPush(decision, { repos: github.repos }, resolvers)
|
|
117
|
+
if (verdict.kind === 'deny') return verdict
|
|
118
|
+
recordGrantedPush(event.callId, verdict.push)
|
|
119
|
+
return { kind: 'allow' }
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function withPushGrantHint(result: SecurityBlock, outcome: PushGrantOutcome): SecurityBlock {
|
|
123
|
+
if (outcome.kind === 'deny') {
|
|
124
|
+
return {
|
|
125
|
+
block: true,
|
|
126
|
+
reason: `${result.reason} Pushing to a configured channels.github.repos repo did not apply: ${outcome.reason}.`,
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
block: true,
|
|
131
|
+
reason: `${result.reason} Branch pushes are allowed without the bypass to repos listed in channels.github.repos when the github channel uses App auth.`,
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
90
135
|
const INTERNAL_SECURITY_GUARD_REASON =
|
|
91
136
|
'The tool call was blocked because an internal security guard error prevented safe evaluation.'
|
|
92
137
|
|
|
@@ -96,6 +141,26 @@ function reportInternalGuardError(logger: PluginLogger, guard: string, error: un
|
|
|
96
141
|
logger.error(`internal security guard error guard=${guard}${code}: ${detail}`)
|
|
97
142
|
}
|
|
98
143
|
|
|
144
|
+
// The medium-tier heuristic guards (secretExfilBash/Read, ssrf,
|
|
145
|
+
// sessionSearchSecrets) cover non-canonical surfaces: canonical credential
|
|
146
|
+
// stores stay masked by the bash sandbox and privateSurfaceRead regardless.
|
|
147
|
+
// A bug in one of them must not deny every tool call it inspects, so its
|
|
148
|
+
// internal error is logged for the operator and only that check is skipped.
|
|
149
|
+
// Promotion, taint, private-surface, and high-tier checks keep failing closed
|
|
150
|
+
// through the hook-level catch.
|
|
151
|
+
function runHeuristicGuard(
|
|
152
|
+
logger: PluginLogger,
|
|
153
|
+
guard: string,
|
|
154
|
+
run: () => SecurityBlock | undefined,
|
|
155
|
+
): SecurityBlock | undefined {
|
|
156
|
+
try {
|
|
157
|
+
return run()
|
|
158
|
+
} catch (error) {
|
|
159
|
+
reportInternalGuardError(logger, guard, error)
|
|
160
|
+
return undefined
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
99
164
|
export default definePlugin({
|
|
100
165
|
permissions: Object.values(SECURITY_PERMISSIONS),
|
|
101
166
|
// No wildcard exclusions: owner bypasses every security tier by default
|
|
@@ -194,16 +259,15 @@ export default definePlugin({
|
|
|
194
259
|
)
|
|
195
260
|
if (gitRemoteTaintedResult) return gitRemoteTaintedResult
|
|
196
261
|
|
|
197
|
-
const secretExfilBashResult =
|
|
198
|
-
GUARD_SECRET_EXFIL_BASH_SEVERITY,
|
|
199
|
-
|
|
262
|
+
const secretExfilBashResult = runHeuristicGuard(ctx.logger, 'secretExfilBash', () =>
|
|
263
|
+
canBypass(GUARD_SECRET_EXFIL_BASH_SEVERITY, SECURITY_PERMISSIONS.bypassSecretExfilBash)
|
|
264
|
+
? undefined
|
|
265
|
+
: withPermissionHint(
|
|
266
|
+
checkSecretExfilBashGuard({ tool: event.tool, args: event.args }),
|
|
267
|
+
SECURITY_PERMISSIONS.bypassSecretExfilBash,
|
|
268
|
+
GUARD_SECRET_EXFIL_BASH_SEVERITY,
|
|
269
|
+
),
|
|
200
270
|
)
|
|
201
|
-
? undefined
|
|
202
|
-
: withPermissionHint(
|
|
203
|
-
checkSecretExfilBashGuard({ tool: event.tool, args: event.args }),
|
|
204
|
-
SECURITY_PERMISSIONS.bypassSecretExfilBash,
|
|
205
|
-
GUARD_SECRET_EXFIL_BASH_SEVERITY,
|
|
206
|
-
)
|
|
207
271
|
if (secretExfilBashResult) return secretExfilBashResult
|
|
208
272
|
|
|
209
273
|
const gitExfilResult = canBypass(GUARD_GIT_EXFIL_SEVERITY, SECURITY_PERMISSIONS.bypassGitExfil)
|
|
@@ -213,18 +277,20 @@ export default definePlugin({
|
|
|
213
277
|
SECURITY_PERMISSIONS.bypassGitExfil,
|
|
214
278
|
GUARD_GIT_EXFIL_SEVERITY,
|
|
215
279
|
)
|
|
216
|
-
if (gitExfilResult)
|
|
280
|
+
if (gitExfilResult) {
|
|
281
|
+
const pushGrant = await evaluatePushGrant(event, ctx)
|
|
282
|
+
if (pushGrant.kind !== 'allow') return withPushGrantHint(gitExfilResult, pushGrant)
|
|
283
|
+
}
|
|
217
284
|
|
|
218
|
-
const secretExfilReadResult =
|
|
219
|
-
GUARD_SECRET_EXFIL_READ_SEVERITY,
|
|
220
|
-
|
|
285
|
+
const secretExfilReadResult = runHeuristicGuard(ctx.logger, 'secretExfilRead', () =>
|
|
286
|
+
canBypass(GUARD_SECRET_EXFIL_READ_SEVERITY, SECURITY_PERMISSIONS.bypassSecretExfilRead)
|
|
287
|
+
? undefined
|
|
288
|
+
: withPermissionHint(
|
|
289
|
+
checkSecretExfilReadGuard({ tool: event.tool, args: event.args }),
|
|
290
|
+
SECURITY_PERMISSIONS.bypassSecretExfilRead,
|
|
291
|
+
GUARD_SECRET_EXFIL_READ_SEVERITY,
|
|
292
|
+
),
|
|
221
293
|
)
|
|
222
|
-
? undefined
|
|
223
|
-
: withPermissionHint(
|
|
224
|
-
checkSecretExfilReadGuard({ tool: event.tool, args: event.args }),
|
|
225
|
-
SECURITY_PERMISSIONS.bypassSecretExfilRead,
|
|
226
|
-
GUARD_SECRET_EXFIL_READ_SEVERITY,
|
|
227
|
-
)
|
|
228
294
|
if (secretExfilReadResult) return secretExfilReadResult
|
|
229
295
|
|
|
230
296
|
// Not severity-bypassed: private directories remain role-derived,
|
|
@@ -245,25 +311,26 @@ export default definePlugin({
|
|
|
245
311
|
)
|
|
246
312
|
if (privateSurfaceReadResult) return privateSurfaceReadResult
|
|
247
313
|
|
|
248
|
-
const ssrfResult =
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
314
|
+
const ssrfResult = runHeuristicGuard(ctx.logger, 'ssrf', () =>
|
|
315
|
+
canBypass(GUARD_SSRF_SEVERITY, SECURITY_PERMISSIONS.bypassSsrf)
|
|
316
|
+
? undefined
|
|
317
|
+
: withPermissionHint(
|
|
318
|
+
checkSsrfGuard({ tool: event.tool, args: event.args }),
|
|
319
|
+
SECURITY_PERMISSIONS.bypassSsrf,
|
|
320
|
+
GUARD_SSRF_SEVERITY,
|
|
321
|
+
),
|
|
322
|
+
)
|
|
255
323
|
if (ssrfResult) return ssrfResult
|
|
256
324
|
|
|
257
|
-
const sessionSearchSecretsResult =
|
|
258
|
-
GUARD_SESSION_SEARCH_SECRETS_SEVERITY,
|
|
259
|
-
|
|
325
|
+
const sessionSearchSecretsResult = runHeuristicGuard(ctx.logger, 'sessionSearchSecrets', () =>
|
|
326
|
+
canBypass(GUARD_SESSION_SEARCH_SECRETS_SEVERITY, SECURITY_PERMISSIONS.bypassSessionSearchSecrets)
|
|
327
|
+
? undefined
|
|
328
|
+
: withPermissionHint(
|
|
329
|
+
checkSessionSearchSecretsGuard({ tool: event.tool, args: event.args }),
|
|
330
|
+
SECURITY_PERMISSIONS.bypassSessionSearchSecrets,
|
|
331
|
+
GUARD_SESSION_SEARCH_SECRETS_SEVERITY,
|
|
332
|
+
),
|
|
260
333
|
)
|
|
261
|
-
? undefined
|
|
262
|
-
: withPermissionHint(
|
|
263
|
-
checkSessionSearchSecretsGuard({ tool: event.tool, args: event.args }),
|
|
264
|
-
SECURITY_PERMISSIONS.bypassSessionSearchSecrets,
|
|
265
|
-
GUARD_SESSION_SEARCH_SECRETS_SEVERITY,
|
|
266
|
-
)
|
|
267
334
|
if (sessionSearchSecretsResult) return sessionSearchSecretsResult
|
|
268
335
|
|
|
269
336
|
const systemPromptLeakResult = canBypass(
|
|
@@ -11,8 +11,10 @@ export const GUARD_GIT_EXFIL = 'gitExfil'
|
|
|
11
11
|
// copied identity files or secrets into it, and the effective repository is
|
|
12
12
|
// unknowable from the string alone (`git -C`, `--git-dir`, `GIT_DIR`, `cd`,
|
|
13
13
|
// subshells, aliases). Do NOT re-introduce cwd/path scoping here: it would be
|
|
14
|
-
// a bypass, not a fix (Oracle-reviewed). Member-tier publishing
|
|
15
|
-
//
|
|
14
|
+
// a bypass, not a fix (Oracle-reviewed). Member-tier publishing is the
|
|
15
|
+
// configured GitHub channel repos (`channels.github.repos`), decided on the
|
|
16
|
+
// broker's resolved remote identity (see github-cli-auth/granted-push.ts) and
|
|
17
|
+
// applied only to the push finding — never a path heuristic.
|
|
16
18
|
//
|
|
17
19
|
// Classified `medium` (silent-attack axis). Originally `high`; reclassified
|
|
18
20
|
// because the one narrow retarget-then-push audience-leak shape (re-point
|
|
@@ -55,17 +57,19 @@ const SHELL_BOUNDARY = String.raw`[\s;|&(\`$]`
|
|
|
55
57
|
const GIT_INTER = String.raw`(?:\s+-{1,2}[A-Za-z][^\s]*(?:\s+[^-\s][^\s]*)?)*\s+`
|
|
56
58
|
const GIT_PREFIX = String.raw`(?:^|${SHELL_BOUNDARY})git${GIT_INTER}`
|
|
57
59
|
|
|
60
|
+
// The breach: agent obeyed a Slack DM saying `git push origin main` to an
|
|
61
|
+
// attacker-controlled remote. Pushing a repo is the exfil moment - once
|
|
62
|
+
// the working tree reaches a remote, every tracked file is leaked. We
|
|
63
|
+
// block all push variants by default; only the permission service or an
|
|
64
|
+
// configured GitHub channel repo (`channels.github.repos`, resolved by the
|
|
65
|
+
// github-cli-auth broker) can authorize publication.
|
|
66
|
+
const GIT_PUSH_PATTERN = {
|
|
67
|
+
pattern: new RegExp(`${GIT_PREFIX}push\\b`),
|
|
68
|
+
label: 'git push (sends tracked files to a remote - the canonical exfil step)',
|
|
69
|
+
}
|
|
70
|
+
|
|
58
71
|
const DANGEROUS_COMMAND_PATTERNS: ReadonlyArray<{ pattern: RegExp; label: string }> = [
|
|
59
|
-
|
|
60
|
-
// The breach: agent obeyed a Slack DM saying `git push origin main` to an
|
|
61
|
-
// attacker-controlled remote. Pushing a repo is the exfil moment - once
|
|
62
|
-
// the working tree reaches a remote, every tracked file is leaked. We
|
|
63
|
-
// block all push variants by default; only the permission service can
|
|
64
|
-
// authorize publication.
|
|
65
|
-
{
|
|
66
|
-
pattern: new RegExp(`${GIT_PREFIX}push\\b`),
|
|
67
|
-
label: 'git push (sends tracked files to a remote - the canonical exfil step)',
|
|
68
|
-
},
|
|
72
|
+
GIT_PUSH_PATTERN,
|
|
69
73
|
// `git push --mirror` and `--force` are strictly worse: mirror copies every
|
|
70
74
|
// ref, force-push overwrites remote history. Caught by the generic match
|
|
71
75
|
// above but worth noting in the label so the user sees the severity.
|
|
@@ -172,6 +176,14 @@ export function recordGitRemoteTaintIfAny(options: {
|
|
|
172
176
|
}
|
|
173
177
|
}
|
|
174
178
|
|
|
179
|
+
// True when the only gitExfil finding in `command` is `git push`, so a
|
|
180
|
+
// destination grant may be considered. Any co-occurring finding (force-add,
|
|
181
|
+
// bulk staging, remote re-pointing, uploads) keeps the whole command blocked.
|
|
182
|
+
export function isPushOnlyGitExfilMatch(command: string): boolean {
|
|
183
|
+
const matched = DANGEROUS_COMMAND_PATTERNS.filter(({ pattern }) => pattern.test(command))
|
|
184
|
+
return matched.length === 1 && matched[0] === GIT_PUSH_PATTERN
|
|
185
|
+
}
|
|
186
|
+
|
|
175
187
|
export function checkGitExfilGuard(options: {
|
|
176
188
|
tool: string
|
|
177
189
|
args: Record<string, unknown>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AdapterId } from './schema'
|
|
2
|
+
|
|
3
|
+
// Only these account modes share platform user IDs. New/unlisted adapters
|
|
4
|
+
// retain their own namespace rather than accidentally linking identities.
|
|
5
|
+
const SHARED_NAMESPACES: Partial<Record<AdapterId, AdapterId>> = {
|
|
6
|
+
'discord-bot': 'discord',
|
|
7
|
+
'slack-bot': 'slack',
|
|
8
|
+
'webex-bot': 'webex',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function adapterNamespace(adapter: AdapterId): AdapterId {
|
|
12
|
+
return SHARED_NAMESPACES[adapter] ?? adapter
|
|
13
|
+
}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
} from '@/channels/types'
|
|
10
10
|
|
|
11
11
|
import { describeError } from '../describe-error'
|
|
12
|
+
import { createOwnReactionCallbacks } from './own-reactions'
|
|
12
13
|
|
|
13
14
|
// The reactable target on Discord: a message is addressed by its channel id
|
|
14
15
|
// plus the message id. The classifier stamps this because both values are on
|
|
@@ -79,6 +80,7 @@ const EMOJI_UNICODE: Record<string, string> = {
|
|
|
79
80
|
raised_hands: '🙌',
|
|
80
81
|
zipper_mouth_face: '🤐',
|
|
81
82
|
hourglass_flowing_sand: '⏳',
|
|
83
|
+
warning: '⚠️',
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
function resolveEmoji(emoji: string): string | null {
|
|
@@ -162,3 +164,19 @@ function parseRecord(value: string): Record<string, unknown> | null {
|
|
|
162
164
|
? (parsed as Record<string, unknown>)
|
|
163
165
|
: null
|
|
164
166
|
}
|
|
167
|
+
|
|
168
|
+
export function createDiscordOwnReactionCallbacks(deps: {
|
|
169
|
+
client: Pick<DiscordBotClient, 'removeReaction'>
|
|
170
|
+
identity: () => string | null | Promise<string | null>
|
|
171
|
+
}) {
|
|
172
|
+
return createOwnReactionCallbacks({
|
|
173
|
+
adapter: 'discord-bot',
|
|
174
|
+
identity: deps.identity,
|
|
175
|
+
decode: decodeDiscordReactionRef,
|
|
176
|
+
encode: encodeDiscordReactionRef,
|
|
177
|
+
emoji: (emoji) => resolveEmoji(emoji) ?? (Object.values(EMOJI_UNICODE).includes(emoji) ? emoji : null),
|
|
178
|
+
remove: (target, emoji) => deps.client.removeReaction(target.channel, target.message, emoji),
|
|
179
|
+
classify: classifyDiscordError,
|
|
180
|
+
absent: (error) => classifyDiscordError(error) === 'not-found',
|
|
181
|
+
})
|
|
182
|
+
}
|