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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DefinedPlugin } from "./types.js";
|
|
2
|
+
export type ResolvedPlugin = {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string | undefined;
|
|
5
|
+
source: string;
|
|
6
|
+
defined: DefinedPlugin<any>;
|
|
7
|
+
};
|
|
8
|
+
export type LoadPluginEntryFn = (entry: string, agentDir: string) => Promise<ResolvedPlugin>;
|
|
9
|
+
export declare class PluginNotFoundError extends Error {
|
|
10
|
+
readonly entry: string;
|
|
11
|
+
constructor(entry: string, message: string, options?: {
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export declare class PluginSecurityError extends Error {
|
|
16
|
+
readonly entry: string;
|
|
17
|
+
constructor(entry: string, message: string);
|
|
18
|
+
}
|
|
19
|
+
export declare function loadPluginEntry(entry: string, agentDir: string): Promise<ResolvedPlugin>;
|
|
20
|
+
export type PluginEntrySpec = {
|
|
21
|
+
name: string;
|
|
22
|
+
versionSpec: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare function splitPluginEntrySpec(entry: string): PluginEntrySpec;
|
|
25
|
+
export declare function derivePluginNameFromPackage(packageName: string): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ResolveGithubTokenForRepo } from "../channels/github-token-bridge.js";
|
|
2
|
+
import type { CronJob } from "../cron/index.js";
|
|
3
|
+
import { type PermissionService, type RolesConfig } from "../permissions/index.js";
|
|
4
|
+
import { type SpawnSubagentFn } from "./context.js";
|
|
5
|
+
import { type HookBus } from "./hooks.js";
|
|
6
|
+
import { type LoadPluginEntryFn, type ResolvedPlugin } from "./loader.js";
|
|
7
|
+
import { type PluginRegistry } from "./registry.js";
|
|
8
|
+
export type FailedPlugin = {
|
|
9
|
+
entry: string;
|
|
10
|
+
phase: 'resolve' | 'config' | 'factory' | 'register';
|
|
11
|
+
error: string;
|
|
12
|
+
};
|
|
13
|
+
export type LoadPluginsOptions = {
|
|
14
|
+
entries: string[];
|
|
15
|
+
agentDir: string;
|
|
16
|
+
configsByName: Record<string, unknown>;
|
|
17
|
+
loadEntry?: LoadPluginEntryFn;
|
|
18
|
+
roles?: RolesConfig;
|
|
19
|
+
resolveGithubTokenForRepo?: ResolveGithubTokenForRepo;
|
|
20
|
+
hasGithubAppTokenResolver?: () => boolean;
|
|
21
|
+
getGithubAppSelfLogin?: () => string | null;
|
|
22
|
+
resolveGithubPatForRepo?: ResolveGithubTokenForRepo;
|
|
23
|
+
bundled?: ResolvedPlugin[];
|
|
24
|
+
};
|
|
25
|
+
export type LoadPluginsResult = {
|
|
26
|
+
registry: PluginRegistry;
|
|
27
|
+
hooks: HookBus;
|
|
28
|
+
permissions: PermissionService;
|
|
29
|
+
declaredPermissions: readonly string[];
|
|
30
|
+
loadedPlugins: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string | undefined;
|
|
33
|
+
source: string;
|
|
34
|
+
}[];
|
|
35
|
+
failedPlugins: FailedPlugin[];
|
|
36
|
+
markBooted: () => void;
|
|
37
|
+
setSpawnSubagent: (fn: SpawnSubagentFn) => void;
|
|
38
|
+
disposePlugins: () => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
export declare function loadPlugins(opts: LoadPluginsOptions): Promise<LoadPluginsResult>;
|
|
41
|
+
export declare function summarizeLoaded(loaded: LoadPluginsResult['loadedPlugins'], registry: PluginRegistry): string;
|
|
42
|
+
export declare function pluginCronJobs(registry: PluginRegistry): CronJob[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { CronJob } from "../cron/index.js";
|
|
2
|
+
import type { HookBus } from "./hooks.js";
|
|
3
|
+
import type { PluginCommand, PluginDoctorCheck, PluginExports, PluginLogger, PluginSkill, Subagent, Tool } from "./types.js";
|
|
4
|
+
export type RegisteredTool = {
|
|
5
|
+
pluginName: string;
|
|
6
|
+
toolName: string;
|
|
7
|
+
tool: Tool<any>;
|
|
8
|
+
logger: PluginLogger;
|
|
9
|
+
};
|
|
10
|
+
export type RegisteredSubagent = {
|
|
11
|
+
pluginName: string;
|
|
12
|
+
subagentName: string;
|
|
13
|
+
subagent: Subagent<any>;
|
|
14
|
+
};
|
|
15
|
+
export type RegisteredCronJob = {
|
|
16
|
+
pluginName: string;
|
|
17
|
+
localId: string;
|
|
18
|
+
globalId: string;
|
|
19
|
+
job: CronJob;
|
|
20
|
+
};
|
|
21
|
+
export type RegisteredSkillEntry = {
|
|
22
|
+
pluginName: string;
|
|
23
|
+
localName: string;
|
|
24
|
+
skill: PluginSkill;
|
|
25
|
+
};
|
|
26
|
+
export type RegisteredSkillDir = {
|
|
27
|
+
pluginName: string;
|
|
28
|
+
path: string;
|
|
29
|
+
};
|
|
30
|
+
export type RegisteredDoctorCheck = {
|
|
31
|
+
pluginName: string;
|
|
32
|
+
checkName: string;
|
|
33
|
+
pluginConfig: unknown;
|
|
34
|
+
logger: PluginLogger;
|
|
35
|
+
check: PluginDoctorCheck;
|
|
36
|
+
};
|
|
37
|
+
export type RegisteredCommand = {
|
|
38
|
+
pluginName: string;
|
|
39
|
+
commandName: string;
|
|
40
|
+
command: PluginCommand;
|
|
41
|
+
logger: PluginLogger;
|
|
42
|
+
};
|
|
43
|
+
export type RegisteredPluginDisposer = {
|
|
44
|
+
pluginName: string;
|
|
45
|
+
logger: PluginLogger;
|
|
46
|
+
dispose: () => void | Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
export type PluginRegistry = {
|
|
49
|
+
tools: RegisteredTool[];
|
|
50
|
+
subagents: RegisteredSubagent[];
|
|
51
|
+
cronJobs: RegisteredCronJob[];
|
|
52
|
+
skills: RegisteredSkillEntry[];
|
|
53
|
+
skillsDirs: RegisteredSkillDir[];
|
|
54
|
+
doctorChecks: RegisteredDoctorCheck[];
|
|
55
|
+
commands: RegisteredCommand[];
|
|
56
|
+
disposers: RegisteredPluginDisposer[];
|
|
57
|
+
};
|
|
58
|
+
export type RegisterContributionsOptions = {
|
|
59
|
+
pluginName: string;
|
|
60
|
+
logger: PluginLogger;
|
|
61
|
+
exports: PluginExports;
|
|
62
|
+
commands?: Record<string, PluginCommand>;
|
|
63
|
+
registry: PluginRegistry;
|
|
64
|
+
hooks: HookBus;
|
|
65
|
+
agentDir: string;
|
|
66
|
+
pluginConfig: unknown;
|
|
67
|
+
};
|
|
68
|
+
export declare const RESERVED_COMMAND_NAMES: ReadonlySet<string>;
|
|
69
|
+
export declare function buildPluginCronGlobalId(pluginName: string, localId: string): string;
|
|
70
|
+
export declare function registerContributions(opts: RegisterContributionsOptions): void;
|
|
71
|
+
export declare function discardRegistrationsBy(pluginName: string, registry: PluginRegistry, hooks: HookBus): void;
|
|
72
|
+
export declare function emptyRegistry(): PluginRegistry;
|
|
73
|
+
export declare function validateCommandDeclaration(pluginName: string, commandName: string, command: PluginCommand): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PluginSkill } from "./types.js";
|
|
2
|
+
export type SkillEntry = {
|
|
3
|
+
pluginName: string;
|
|
4
|
+
localName: string;
|
|
5
|
+
skill: PluginSkill;
|
|
6
|
+
};
|
|
7
|
+
export type MaterializedSkills = {
|
|
8
|
+
dir: string;
|
|
9
|
+
dispose: () => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare function materializeSkills(skills: SkillEntry[]): Promise<MaterializedSkills>;
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { SessionOrigin } from "../agent/session-origin.js";
|
|
3
|
+
import type { SubagentShared } from "../agent/subagents.js";
|
|
4
|
+
import type { ResolveGithubTokenForRepo } from "../channels/github-token-bridge.js";
|
|
5
|
+
import type { PermissionService } from "../permissions/index.js";
|
|
6
|
+
export type ContentPart = {
|
|
7
|
+
type: 'text';
|
|
8
|
+
text: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'image';
|
|
11
|
+
mimeType: string;
|
|
12
|
+
data: string;
|
|
13
|
+
};
|
|
14
|
+
export type ToolResult = {
|
|
15
|
+
content: ContentPart[];
|
|
16
|
+
details?: unknown;
|
|
17
|
+
};
|
|
18
|
+
export type ToolLogger = {
|
|
19
|
+
info: (msg: string) => void;
|
|
20
|
+
warn: (msg: string) => void;
|
|
21
|
+
error: (msg: string) => void;
|
|
22
|
+
};
|
|
23
|
+
export type ToolContext = {
|
|
24
|
+
signal: AbortSignal | undefined;
|
|
25
|
+
sessionId: string;
|
|
26
|
+
agentDir: string;
|
|
27
|
+
logger: ToolLogger;
|
|
28
|
+
};
|
|
29
|
+
export type ToolFileOperands = {
|
|
30
|
+
input?: readonly string[];
|
|
31
|
+
output?: readonly string[];
|
|
32
|
+
create?: readonly string[];
|
|
33
|
+
destructive?: readonly string[];
|
|
34
|
+
nonFile?: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
export type Tool<P = unknown> = {
|
|
37
|
+
description: string;
|
|
38
|
+
parameters: z.ZodType<P>;
|
|
39
|
+
fileOperands?: ToolFileOperands;
|
|
40
|
+
execute: (args: P, ctx: ToolContext) => Promise<ToolResult>;
|
|
41
|
+
};
|
|
42
|
+
export type BuiltinToolRef = {
|
|
43
|
+
readonly __builtinTool: string;
|
|
44
|
+
};
|
|
45
|
+
export type SubagentContext<P = unknown> = {
|
|
46
|
+
userPrompt: string;
|
|
47
|
+
agentDir: string;
|
|
48
|
+
payload: P;
|
|
49
|
+
};
|
|
50
|
+
export type RunSession = (override?: {
|
|
51
|
+
userPrompt?: string;
|
|
52
|
+
onFinalMessage?: (message: string | null) => void;
|
|
53
|
+
}) => Promise<void>;
|
|
54
|
+
export type Subagent<P = unknown> = SubagentShared<P> & {
|
|
55
|
+
tools?: BuiltinToolRef[];
|
|
56
|
+
customTools?: Tool<any>[];
|
|
57
|
+
ephemeral?: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type PluginPromptCronJob = {
|
|
60
|
+
schedule: string;
|
|
61
|
+
kind: 'prompt';
|
|
62
|
+
prompt: string;
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
timezone?: string;
|
|
65
|
+
subagent?: string;
|
|
66
|
+
payload?: unknown;
|
|
67
|
+
};
|
|
68
|
+
export type PluginExecCronJob = {
|
|
69
|
+
schedule: string;
|
|
70
|
+
kind: 'exec';
|
|
71
|
+
command: string[];
|
|
72
|
+
enabled?: boolean;
|
|
73
|
+
timezone?: string;
|
|
74
|
+
};
|
|
75
|
+
export type PluginHandlerCronJob = {
|
|
76
|
+
schedule: string;
|
|
77
|
+
kind: 'handler';
|
|
78
|
+
handler: (ctx: CronHandlerContext) => Promise<void>;
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
timezone?: string;
|
|
81
|
+
};
|
|
82
|
+
export type PluginCronJob = PluginPromptCronJob | PluginExecCronJob | PluginHandlerCronJob;
|
|
83
|
+
export type CronHandlerContext = {
|
|
84
|
+
readonly jobId: string;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly agentDir: string;
|
|
87
|
+
readonly logger: PluginLogger;
|
|
88
|
+
readonly signal: AbortSignal;
|
|
89
|
+
readonly permissions: PermissionService;
|
|
90
|
+
readonly origin: SessionOrigin;
|
|
91
|
+
readonly prompt: (text: string) => Promise<string>;
|
|
92
|
+
readonly subagent: (name: string, payload?: unknown) => Promise<void>;
|
|
93
|
+
readonly exec: (cmd: TemplateStringsArray, ...values: unknown[]) => Promise<CommandExecResult>;
|
|
94
|
+
};
|
|
95
|
+
export type PluginSkill = {
|
|
96
|
+
description: string;
|
|
97
|
+
content: string;
|
|
98
|
+
frontmatter?: Record<string, unknown>;
|
|
99
|
+
};
|
|
100
|
+
export type SessionStartEvent = {
|
|
101
|
+
sessionId: string;
|
|
102
|
+
agentDir: string;
|
|
103
|
+
};
|
|
104
|
+
export type SessionEndEvent = {
|
|
105
|
+
sessionId: string;
|
|
106
|
+
origin?: SessionOrigin;
|
|
107
|
+
};
|
|
108
|
+
export type SessionIdleEvent = {
|
|
109
|
+
sessionId: string;
|
|
110
|
+
parentTranscriptPath: string | undefined;
|
|
111
|
+
idleMs: number;
|
|
112
|
+
origin?: SessionOrigin;
|
|
113
|
+
};
|
|
114
|
+
export type SessionTurnStartEvent = {
|
|
115
|
+
sessionId: string;
|
|
116
|
+
agentDir: string;
|
|
117
|
+
userPrompt: string;
|
|
118
|
+
origin?: SessionOrigin;
|
|
119
|
+
retrievalContext?: {
|
|
120
|
+
results: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export type SessionTurnEndEvent = {
|
|
124
|
+
sessionId: string;
|
|
125
|
+
agentDir: string;
|
|
126
|
+
origin?: SessionOrigin;
|
|
127
|
+
};
|
|
128
|
+
export type SessionPromptEvent = {
|
|
129
|
+
prompt: string;
|
|
130
|
+
sessionId: string;
|
|
131
|
+
agentDir: string;
|
|
132
|
+
origin?: SessionOrigin;
|
|
133
|
+
};
|
|
134
|
+
export type ToolProvenance = 'first-party' | 'plugin';
|
|
135
|
+
export type ToolBeforeEvent = {
|
|
136
|
+
tool: string;
|
|
137
|
+
sessionId: string;
|
|
138
|
+
callId: string;
|
|
139
|
+
args: Record<string, unknown>;
|
|
140
|
+
origin?: SessionOrigin;
|
|
141
|
+
toolProvenance?: ToolProvenance;
|
|
142
|
+
fileOperands?: ToolFileOperands;
|
|
143
|
+
};
|
|
144
|
+
export type ToolBeforeResult = void | undefined | {
|
|
145
|
+
block: true;
|
|
146
|
+
reason: string;
|
|
147
|
+
};
|
|
148
|
+
export type ToolAfterEvent = {
|
|
149
|
+
tool: string;
|
|
150
|
+
sessionId: string;
|
|
151
|
+
callId: string;
|
|
152
|
+
result: ToolResult;
|
|
153
|
+
};
|
|
154
|
+
export type HookContext = {
|
|
155
|
+
agentDir: string;
|
|
156
|
+
pluginName: string;
|
|
157
|
+
logger: PluginLogger;
|
|
158
|
+
};
|
|
159
|
+
export type SlackObservedMessage = {
|
|
160
|
+
readonly type: 'message';
|
|
161
|
+
readonly channel: string;
|
|
162
|
+
readonly ts?: string;
|
|
163
|
+
readonly subtype?: string;
|
|
164
|
+
readonly text?: string;
|
|
165
|
+
readonly user?: string;
|
|
166
|
+
readonly thread_ts?: string;
|
|
167
|
+
readonly event_ts?: string;
|
|
168
|
+
readonly deleted_ts?: string;
|
|
169
|
+
readonly message?: Readonly<Record<string, unknown>>;
|
|
170
|
+
readonly previous_message?: Readonly<Record<string, unknown>>;
|
|
171
|
+
readonly [key: string]: unknown;
|
|
172
|
+
};
|
|
173
|
+
export type ChannelMessageObservedEvent = {
|
|
174
|
+
readonly adapter: 'slack-bot';
|
|
175
|
+
readonly workspace: string | null;
|
|
176
|
+
readonly selfUserId: string | null;
|
|
177
|
+
readonly receivedAt: number;
|
|
178
|
+
readonly event: SlackObservedMessage;
|
|
179
|
+
};
|
|
180
|
+
export type ChannelOutboundOrigin = {
|
|
181
|
+
readonly kind: SessionOrigin['kind'];
|
|
182
|
+
readonly jobId?: string;
|
|
183
|
+
};
|
|
184
|
+
export type ChannelOutboundBeforeEvent = {
|
|
185
|
+
readonly adapter: string;
|
|
186
|
+
readonly workspace: string;
|
|
187
|
+
readonly chat: string;
|
|
188
|
+
readonly thread?: string;
|
|
189
|
+
readonly text: string;
|
|
190
|
+
readonly op: 'send' | 'edit';
|
|
191
|
+
readonly messageId?: string;
|
|
192
|
+
readonly source: 'tool' | 'system';
|
|
193
|
+
readonly outputKind?: 'substantive' | 'status' | 'meta';
|
|
194
|
+
readonly origin?: ChannelOutboundOrigin;
|
|
195
|
+
};
|
|
196
|
+
export type ChannelOutboundBeforeResult = {
|
|
197
|
+
text: string;
|
|
198
|
+
} | undefined;
|
|
199
|
+
export type Hooks = {
|
|
200
|
+
'session.start'?: (event: SessionStartEvent, ctx: HookContext) => Promise<void> | void;
|
|
201
|
+
'session.end'?: (event: SessionEndEvent, ctx: HookContext) => Promise<void> | void;
|
|
202
|
+
'session.idle'?: (event: SessionIdleEvent, ctx: HookContext) => Promise<void> | void;
|
|
203
|
+
'session.prompt'?: (event: SessionPromptEvent, ctx: HookContext) => Promise<void> | void;
|
|
204
|
+
'session.turn.start'?: (event: SessionTurnStartEvent, ctx: HookContext) => Promise<void> | void;
|
|
205
|
+
'session.turn.end'?: (event: SessionTurnEndEvent, ctx: HookContext) => Promise<void> | void;
|
|
206
|
+
'tool.before'?: (event: ToolBeforeEvent, ctx: HookContext) => Promise<ToolBeforeResult> | ToolBeforeResult;
|
|
207
|
+
'tool.after'?: (event: ToolAfterEvent, ctx: HookContext) => Promise<void> | void;
|
|
208
|
+
'channel.message.observed'?: (event: ChannelMessageObservedEvent, ctx: HookContext) => Promise<void> | void;
|
|
209
|
+
'channel.outbound.before'?: (event: ChannelOutboundBeforeEvent, ctx: HookContext) => Promise<ChannelOutboundBeforeResult> | ChannelOutboundBeforeResult;
|
|
210
|
+
};
|
|
211
|
+
export type HookName = keyof Hooks;
|
|
212
|
+
export type PluginLogger = {
|
|
213
|
+
info: (msg: string) => void;
|
|
214
|
+
warn: (msg: string) => void;
|
|
215
|
+
error: (msg: string) => void;
|
|
216
|
+
};
|
|
217
|
+
export type SpawnSubagentOptions = {
|
|
218
|
+
parentSessionId?: string;
|
|
219
|
+
spawnedByOrigin?: SessionOrigin;
|
|
220
|
+
};
|
|
221
|
+
export type PluginContext<TConfig = never> = {
|
|
222
|
+
readonly name: string;
|
|
223
|
+
readonly version: string | undefined;
|
|
224
|
+
readonly agentDir: string;
|
|
225
|
+
readonly config: TConfig;
|
|
226
|
+
readonly logger: PluginLogger;
|
|
227
|
+
readonly permissions: PermissionService;
|
|
228
|
+
readonly github: PluginGithubServices;
|
|
229
|
+
spawnSubagent: (name: string, payload?: unknown, options?: SpawnSubagentOptions) => Promise<void>;
|
|
230
|
+
};
|
|
231
|
+
export type PluginGithubServices = {
|
|
232
|
+
resolveTokenForRepo: ResolveGithubTokenForRepo;
|
|
233
|
+
hasAppTokenResolver: () => boolean;
|
|
234
|
+
getAppSelfLogin?: () => string | null;
|
|
235
|
+
resolvePatForRepo?: ResolveGithubTokenForRepo;
|
|
236
|
+
};
|
|
237
|
+
export type PluginExports = {
|
|
238
|
+
tools?: Record<string, Tool<any>>;
|
|
239
|
+
subagents?: Record<string, Subagent<any>>;
|
|
240
|
+
cronJobs?: Record<string, PluginCronJob>;
|
|
241
|
+
skills?: Record<string, PluginSkill>;
|
|
242
|
+
skillsDirs?: string[];
|
|
243
|
+
hooks?: Hooks;
|
|
244
|
+
doctorChecks?: Record<string, PluginDoctorCheck>;
|
|
245
|
+
onDispose?: () => void | Promise<void>;
|
|
246
|
+
};
|
|
247
|
+
export type PluginDoctorCheck = {
|
|
248
|
+
description: string;
|
|
249
|
+
category?: string;
|
|
250
|
+
run: (ctx: PluginDoctorContext) => Promise<PluginCheckResult>;
|
|
251
|
+
};
|
|
252
|
+
export type PluginDoctorContext = {
|
|
253
|
+
readonly pluginName: string;
|
|
254
|
+
readonly agentDir: string;
|
|
255
|
+
readonly config: unknown;
|
|
256
|
+
readonly logger: PluginLogger;
|
|
257
|
+
};
|
|
258
|
+
export type PluginCheckStatus = 'ok' | 'warning' | 'error';
|
|
259
|
+
export type PluginCheckResult = {
|
|
260
|
+
status: PluginCheckStatus;
|
|
261
|
+
message: string;
|
|
262
|
+
details?: string[];
|
|
263
|
+
fix?: PluginFixSuggestion;
|
|
264
|
+
};
|
|
265
|
+
export type PluginFixSuggestion = {
|
|
266
|
+
description: string;
|
|
267
|
+
apply?: (ctx: PluginDoctorContext) => Promise<PluginFixResult>;
|
|
268
|
+
};
|
|
269
|
+
export type PluginFixResult = {
|
|
270
|
+
summary: string;
|
|
271
|
+
changedPaths: string[];
|
|
272
|
+
};
|
|
273
|
+
export type DefinedPlugin<TConfig = never> = {
|
|
274
|
+
readonly configSchema?: z.ZodType<TConfig>;
|
|
275
|
+
readonly permissions?: readonly string[];
|
|
276
|
+
readonly ownerWildcardExclusions?: readonly string[];
|
|
277
|
+
readonly commands?: Record<string, PluginCommand>;
|
|
278
|
+
readonly plugin: (ctx: PluginContext<TConfig>) => Promise<PluginExports>;
|
|
279
|
+
};
|
|
280
|
+
export type PluginCommand = ContainerCommand | HostCommand | EitherCommand;
|
|
281
|
+
export type ContainerCommand<A = unknown> = {
|
|
282
|
+
readonly surface: 'container';
|
|
283
|
+
readonly description: string;
|
|
284
|
+
readonly args?: z.ZodObject<z.ZodRawShape>;
|
|
285
|
+
readonly permissions?: readonly string[];
|
|
286
|
+
readonly isolated?: boolean;
|
|
287
|
+
readonly run: (ctx: ContainerCommandContext, args: A) => Promise<number>;
|
|
288
|
+
};
|
|
289
|
+
export type HostCommand<A = unknown> = {
|
|
290
|
+
readonly surface: 'host';
|
|
291
|
+
readonly description: string;
|
|
292
|
+
readonly args?: z.ZodObject<z.ZodRawShape>;
|
|
293
|
+
readonly run: (ctx: HostCommandContext, args: A) => Promise<number>;
|
|
294
|
+
};
|
|
295
|
+
export type EitherCommand<A = unknown> = {
|
|
296
|
+
readonly surface: 'either';
|
|
297
|
+
readonly description: string;
|
|
298
|
+
readonly args?: z.ZodObject<z.ZodRawShape>;
|
|
299
|
+
readonly run: (ctx: EitherCommandContext, args: A) => Promise<number>;
|
|
300
|
+
};
|
|
301
|
+
export type CommandStreams = {
|
|
302
|
+
readonly stdin: ReadableStream<Uint8Array>;
|
|
303
|
+
readonly stdout: WritableStream<Uint8Array>;
|
|
304
|
+
readonly stderr: WritableStream<Uint8Array>;
|
|
305
|
+
};
|
|
306
|
+
export type CommandExecResult = {
|
|
307
|
+
readonly stdout: string;
|
|
308
|
+
readonly stderr: string;
|
|
309
|
+
readonly exitCode: number;
|
|
310
|
+
};
|
|
311
|
+
export type ContainerCommandContext = CommandStreams & {
|
|
312
|
+
readonly name: string;
|
|
313
|
+
readonly version: string | undefined;
|
|
314
|
+
readonly agentDir: string;
|
|
315
|
+
readonly logger: PluginLogger;
|
|
316
|
+
readonly permissions: PermissionService;
|
|
317
|
+
readonly origin: SessionOrigin;
|
|
318
|
+
readonly signal: AbortSignal;
|
|
319
|
+
readonly prompt: (text: string) => Promise<string>;
|
|
320
|
+
readonly subagent: (name: string, payload?: unknown) => Promise<void>;
|
|
321
|
+
readonly exec: (cmd: TemplateStringsArray, ...values: unknown[]) => Promise<CommandExecResult>;
|
|
322
|
+
};
|
|
323
|
+
export type HostCommandContext = CommandStreams & {
|
|
324
|
+
readonly name: string;
|
|
325
|
+
readonly version: string | undefined;
|
|
326
|
+
readonly agentDir: string;
|
|
327
|
+
readonly logger: PluginLogger;
|
|
328
|
+
readonly signal: AbortSignal;
|
|
329
|
+
};
|
|
330
|
+
export type EitherCommandContext = CommandStreams & {
|
|
331
|
+
readonly name: string;
|
|
332
|
+
readonly version: string | undefined;
|
|
333
|
+
readonly agentDir: string;
|
|
334
|
+
readonly logger: PluginLogger;
|
|
335
|
+
readonly signal: AbortSignal;
|
|
336
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type LeafKind = 'string' | 'number' | 'boolean' | 'unknown';
|
|
3
|
+
export type LeafDescription = {
|
|
4
|
+
kind: LeafKind;
|
|
5
|
+
required: boolean;
|
|
6
|
+
defaultValue: string | undefined;
|
|
7
|
+
description: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare function describeLeaf(leaf: unknown): LeafDescription;
|
|
10
|
+
export declare function coerceFlag(leaf: unknown, raw: string | true, key: string): unknown;
|
|
11
|
+
export declare function isPrimitiveZodObject(schema: unknown): schema is z.ZodObject<z.ZodRawShape>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReloadCause, ReloadResult } from "./types.js";
|
|
2
|
+
export type RequestReloadOptions = {
|
|
3
|
+
url: string;
|
|
4
|
+
scope?: string;
|
|
5
|
+
cause?: ReloadCause;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class ReloadConnectionError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare function requestReload({ url, scope, cause, timeoutMs, }: RequestReloadOptions): Promise<ReloadResult[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DockerExec } from "../container/index.js";
|
|
2
|
+
import type { ReloadCause, ReloadResult } from "./types.js";
|
|
3
|
+
export type RequestReloadViaDockerExecOptions = {
|
|
4
|
+
cwd: string;
|
|
5
|
+
token: string | null;
|
|
6
|
+
scope?: string;
|
|
7
|
+
cause?: ReloadCause;
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
exec?: DockerExec;
|
|
10
|
+
};
|
|
11
|
+
export declare function requestReloadViaDockerExec({ cwd, token, scope, cause, timeoutMs, exec, }: RequestReloadViaDockerExecOptions): Promise<ReloadResult[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ReloadConnectionError, requestReload, type RequestReloadOptions } from "./client.js";
|
|
2
|
+
export { requestReloadViaDockerExec, type RequestReloadViaDockerExecOptions } from "./docker-exec-client.js";
|
|
3
|
+
export { formatChannelReloadSummary } from "./format.js";
|
|
4
|
+
export { ReloadRegistry } from "./registry.js";
|
|
5
|
+
export { requestReloadWithFallback, type RequestReloadWithFallbackOptions, type RequestReloadWithFallbackResult, } from "./recover.js";
|
|
6
|
+
export type { Reloadable, ReloadAllResult, ReloadCause, ReloadContext, ReloadResult } from "./types.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { requestReload } from "./client.js";
|
|
2
|
+
import { requestReloadViaDockerExec } from "./docker-exec-client.js";
|
|
3
|
+
import type { ReloadCause, ReloadResult } from "./types.js";
|
|
4
|
+
export type RequestReloadWithFallbackOptions = {
|
|
5
|
+
url: string;
|
|
6
|
+
cwd?: string;
|
|
7
|
+
token?: string | null;
|
|
8
|
+
scope?: string;
|
|
9
|
+
cause?: ReloadCause;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
reload?: typeof requestReload;
|
|
12
|
+
reloadViaDockerExec?: typeof requestReloadViaDockerExec;
|
|
13
|
+
};
|
|
14
|
+
export type RequestReloadWithFallbackResult = {
|
|
15
|
+
transport: 'host';
|
|
16
|
+
results: ReloadResult[];
|
|
17
|
+
} | {
|
|
18
|
+
transport: 'container-local';
|
|
19
|
+
results: ReloadResult[];
|
|
20
|
+
hostError: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function requestReloadWithFallback({ url, cwd, token, scope, cause, timeoutMs, reload, reloadViaDockerExec, }: RequestReloadWithFallbackOptions): Promise<RequestReloadWithFallbackResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Reloadable, ReloadAllResult, ReloadContext, ReloadResult } from "./types.js";
|
|
2
|
+
export declare class ReloadRegistry {
|
|
3
|
+
private items;
|
|
4
|
+
register(item: Reloadable): void;
|
|
5
|
+
has(scope: string): boolean;
|
|
6
|
+
get(scope: string): Reloadable | undefined;
|
|
7
|
+
list(): Reloadable[];
|
|
8
|
+
reloadAll(context?: ReloadContext): Promise<ReloadAllResult>;
|
|
9
|
+
reloadOne(scope: string, context?: ReloadContext): Promise<ReloadResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ReloadResult = {
|
|
2
|
+
scope: string;
|
|
3
|
+
ok: true;
|
|
4
|
+
summary: string;
|
|
5
|
+
details?: unknown;
|
|
6
|
+
} | {
|
|
7
|
+
scope: string;
|
|
8
|
+
ok: false;
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export type ReloadCause = {
|
|
12
|
+
kind: 'credential-rotation';
|
|
13
|
+
adapter: string;
|
|
14
|
+
};
|
|
15
|
+
export type ReloadContext = {
|
|
16
|
+
cause?: ReloadCause;
|
|
17
|
+
};
|
|
18
|
+
export type Reloadable = {
|
|
19
|
+
scope: string;
|
|
20
|
+
description: string;
|
|
21
|
+
reload: (context?: ReloadContext) => Promise<ReloadResult>;
|
|
22
|
+
};
|
|
23
|
+
export type ReloadAllResult = {
|
|
24
|
+
results: ReloadResult[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClaimCompletedPayload, ClaimErrorPayload, ClaimStartedPayload } from "../shared/index.js";
|
|
2
|
+
export type ClaimSessionOptions = {
|
|
3
|
+
url: string;
|
|
4
|
+
role: string;
|
|
5
|
+
channel?: string;
|
|
6
|
+
ttlMs?: number;
|
|
7
|
+
openTimeoutMs?: number;
|
|
8
|
+
connectTimeoutMs?: number;
|
|
9
|
+
onStarted?: (payload: ClaimStartedPayload) => void;
|
|
10
|
+
};
|
|
11
|
+
export type ClaimSessionResult = {
|
|
12
|
+
kind: 'completed';
|
|
13
|
+
payload: ClaimCompletedPayload;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'error';
|
|
16
|
+
payload: ClaimErrorPayload;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'timeout';
|
|
19
|
+
};
|
|
20
|
+
export declare function runClaimSession(opts: ClaimSessionOptions): Promise<ClaimSessionResult>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ClaimHandler } from "../channels/router.js";
|
|
2
|
+
import { type PermissionService } from "../permissions/index.js";
|
|
3
|
+
import { type PendingClaim, type PendingClaimRegistry } from "./pending.js";
|
|
4
|
+
export type ClaimCompletedEvent = {
|
|
5
|
+
kind: 'completed';
|
|
6
|
+
code: string;
|
|
7
|
+
role: string;
|
|
8
|
+
matchRule: string;
|
|
9
|
+
adapter: string;
|
|
10
|
+
authorId: string;
|
|
11
|
+
};
|
|
12
|
+
export type ClaimErrorEvent = {
|
|
13
|
+
kind: 'error';
|
|
14
|
+
code: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
export type ClaimCancelledEvent = {
|
|
18
|
+
kind: 'cancelled';
|
|
19
|
+
code: string;
|
|
20
|
+
};
|
|
21
|
+
export type ClaimResultEvent = ClaimCompletedEvent | ClaimErrorEvent | ClaimCancelledEvent;
|
|
22
|
+
export type ClaimController = {
|
|
23
|
+
startClaim: (input: {
|
|
24
|
+
code: string;
|
|
25
|
+
role: string;
|
|
26
|
+
channel?: string;
|
|
27
|
+
ttlMs: number;
|
|
28
|
+
}) => {
|
|
29
|
+
ok: true;
|
|
30
|
+
expiresAt: number;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
reason: string;
|
|
34
|
+
};
|
|
35
|
+
cancelClaim: (code: string) => boolean;
|
|
36
|
+
current: () => PendingClaim | null;
|
|
37
|
+
onResult: (subscriber: (event: ClaimResultEvent) => void) => () => void;
|
|
38
|
+
claimHandler: ClaimHandler;
|
|
39
|
+
};
|
|
40
|
+
export type CreateClaimControllerOptions = {
|
|
41
|
+
cwd: string;
|
|
42
|
+
permissions: PermissionService;
|
|
43
|
+
rolesProvider: () => import("../permissions/index.js").RolesConfig | undefined;
|
|
44
|
+
now?: () => number;
|
|
45
|
+
registry?: PendingClaimRegistry;
|
|
46
|
+
grant?: (roleName: string, matchRule: string) => {
|
|
47
|
+
ok: true;
|
|
48
|
+
added: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
reason: string;
|
|
52
|
+
};
|
|
53
|
+
logger?: {
|
|
54
|
+
info: (m: string) => void;
|
|
55
|
+
warn: (m: string) => void;
|
|
56
|
+
error: (m: string) => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare function createClaimController(opts: CreateClaimControllerOptions): ClaimController;
|