typeclaw 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/agent/attention-escalation.d.ts +18 -0
- package/dist/types/agent/auth.d.ts +7 -0
- package/dist/types/agent/compaction.d.ts +8 -0
- package/dist/types/agent/git-nudge.d.ts +6 -0
- package/dist/types/agent/guard-types.d.ts +25 -0
- package/dist/types/agent/guards.d.ts +7 -0
- package/dist/types/agent/idle-compaction.d.ts +7 -0
- package/dist/types/agent/index.d.ts +163 -0
- package/dist/types/agent/live-subagents.d.ts +113 -0
- package/dist/types/agent/llm-replay-sanitizer.d.ts +11 -0
- package/dist/types/agent/loop-guard.d.ts +67 -0
- package/dist/types/agent/model-fallback.d.ts +29 -0
- package/dist/types/agent/model-overrides.d.ts +8 -0
- package/dist/types/agent/multimodal/index.d.ts +2 -0
- package/dist/types/agent/multimodal/look-at.d.ts +60 -0
- package/dist/types/agent/multimodal/looker.d.ts +61 -0
- package/dist/types/agent/multimodal/read-redirect.d.ts +6 -0
- package/dist/types/agent/network/response-body.d.ts +1 -0
- package/dist/types/agent/network/safe-http.d.ts +46 -0
- package/dist/types/agent/plugin-tools.d.ts +129 -0
- package/dist/types/agent/proactive-next-step-nudge.d.ts +2 -0
- package/dist/types/agent/prompt-cache-key.d.ts +3 -0
- package/dist/types/agent/provider-error.d.ts +23 -0
- package/dist/types/agent/reload-tool.d.ts +10 -0
- package/dist/types/agent/restart/index.d.ts +31 -0
- package/dist/types/agent/restart-handoff/index.d.ts +32 -0
- package/dist/types/agent/restart-handoff/paths.d.ts +1 -0
- package/dist/types/agent/retry-same-ref.d.ts +41 -0
- package/dist/types/agent/reviewer-activity.d.ts +3 -0
- package/dist/types/agent/reviewer-bash-policy.d.ts +8 -0
- package/dist/types/agent/self.d.ts +1 -0
- package/dist/types/agent/session-meta.d.ts +28 -0
- package/dist/types/agent/session-origin.d.ts +65 -0
- package/dist/types/agent/subagent-cache-keepalive.d.ts +38 -0
- package/dist/types/agent/subagent-completion-reminder.d.ts +29 -0
- package/dist/types/agent/subagent-drain.d.ts +25 -0
- package/dist/types/agent/subagent-session.d.ts +3 -0
- package/dist/types/agent/subagents.d.ts +153 -0
- package/dist/types/agent/system-prompt.d.ts +7 -0
- package/dist/types/agent/throttle-circuit.d.ts +25 -0
- package/dist/types/agent/todo/continuation-policy.d.ts +54 -0
- package/dist/types/agent/todo/continuation-state.d.ts +11 -0
- package/dist/types/agent/todo/continuation-wiring.d.ts +32 -0
- package/dist/types/agent/todo/continuation.d.ts +21 -0
- package/dist/types/agent/todo/scope.d.ts +6 -0
- package/dist/types/agent/todo/store.d.ts +16 -0
- package/dist/types/agent/tool-error-remediation.d.ts +1 -0
- package/dist/types/agent/tool-file-safety.d.ts +78 -0
- package/dist/types/agent/tool-not-found-nudge.d.ts +9 -0
- package/dist/types/agent/tool-result-budget.d.ts +15 -0
- package/dist/types/agent/tools/channel-disengage.d.ts +18 -0
- package/dist/types/agent/tools/channel-edit.d.ts +19 -0
- package/dist/types/agent/tools/channel-fetch-attachment.d.ts +36 -0
- package/dist/types/agent/tools/channel-handoff.d.ts +13 -0
- package/dist/types/agent/tools/channel-history-render.d.ts +3 -0
- package/dist/types/agent/tools/channel-history.d.ts +25 -0
- package/dist/types/agent/tools/channel-log.d.ts +5 -0
- package/dist/types/agent/tools/channel-react.d.ts +23 -0
- package/dist/types/agent/tools/channel-read.d.ts +27 -0
- package/dist/types/agent/tools/channel-reply.d.ts +47 -0
- package/dist/types/agent/tools/channel-send.d.ts +42 -0
- package/dist/types/agent/tools/channel-session-search.d.ts +10 -0
- package/dist/types/agent/tools/curl-impersonate.d.ts +37 -0
- package/dist/types/agent/tools/ddg.d.ts +18 -0
- package/dist/types/agent/tools/grant-role.d.ts +25 -0
- package/dist/types/agent/tools/keyed-semaphore.d.ts +10 -0
- package/dist/types/agent/tools/post-github-review.d.ts +38 -0
- package/dist/types/agent/tools/restart.d.ts +25 -0
- package/dist/types/agent/tools/runtime-notice.d.ts +3 -0
- package/dist/types/agent/tools/search-retry.d.ts +16 -0
- package/dist/types/agent/tools/skip-response.d.ts +17 -0
- package/dist/types/agent/tools/spawn-subagent.d.ts +77 -0
- package/dist/types/agent/tools/stream-snapshot.d.ts +23 -0
- package/dist/types/agent/tools/subagent-access.d.ts +20 -0
- package/dist/types/agent/tools/subagent-cancel.d.ts +23 -0
- package/dist/types/agent/tools/subagent-output.d.ts +50 -0
- package/dist/types/agent/tools/todo/index.d.ts +14 -0
- package/dist/types/agent/tools/webfetch/adaptive-html.d.ts +29 -0
- package/dist/types/agent/tools/webfetch/fetch.d.ts +26 -0
- package/dist/types/agent/tools/webfetch/html-lexical.d.ts +27 -0
- package/dist/types/agent/tools/webfetch/index.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/inline-style-visibility.d.ts +3 -0
- package/dist/types/agent/tools/webfetch/strategies/grep.d.ts +11 -0
- package/dist/types/agent/tools/webfetch/strategies/jq.d.ts +4 -0
- package/dist/types/agent/tools/webfetch/strategies/raw.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/strategies/readability.d.ts +16 -0
- package/dist/types/agent/tools/webfetch/strategies/selector.d.ts +4 -0
- package/dist/types/agent/tools/webfetch/strategies/snapshot.d.ts +1 -0
- package/dist/types/agent/tools/webfetch/tool.d.ts +15 -0
- package/dist/types/agent/tools/webfetch/types.d.ts +32 -0
- package/dist/types/agent/tools/websearch.d.ts +17 -0
- package/dist/types/agent/tools/wikipedia.d.ts +7 -0
- package/dist/types/agent/tools-without-local-file-operands.d.ts +1 -0
- package/dist/types/agent/turn-runner.d.ts +36 -0
- package/dist/types/agent-messenger/config-dir.d.ts +19 -0
- package/dist/types/browser/dockerfile.d.ts +2 -0
- package/dist/types/browser/registry.d.ts +49 -0
- package/dist/types/bundled-plugins/bun-hygiene/policy.d.ts +18 -0
- package/dist/types/bundled-plugins/github-cli-auth/git-askpass.d.ts +5 -0
- package/dist/types/bundled-plugins/guard/keys.d.ts +6 -0
- package/dist/types/bundled-plugins/guard/policies/managed-config.d.ts +7 -0
- package/dist/types/bundled-plugins/guard/policies/memory-topics-delete.d.ts +11 -0
- package/dist/types/bundled-plugins/guard/policies/memory-topics-write.d.ts +7 -0
- package/dist/types/bundled-plugins/guard/policies/non-workspace-write.d.ts +9 -0
- package/dist/types/bundled-plugins/guard/policies/skill-authoring.d.ts +20 -0
- package/dist/types/bundled-plugins/guard/policies/uncommitted-changes.d.ts +12 -0
- package/dist/types/bundled-plugins/guard/policy.d.ts +11 -0
- package/dist/types/bundled-plugins/memory/secret-detector.d.ts +11 -0
- package/dist/types/bundled-plugins/memory/slug.d.ts +4 -0
- package/dist/types/bundled-plugins/security/permissions.d.ts +20 -0
- package/dist/types/bundled-plugins/security/policies/private-surface-read.d.ts +34 -0
- package/dist/types/bundled-plugins/security/policies/ssrf.d.ts +18 -0
- package/dist/types/bundled-plugins/security/policy.d.ts +4 -0
- package/dist/types/channels/adapter-namespace.d.ts +2 -0
- package/dist/types/channels/adapters/mention-hints.d.ts +12 -0
- package/dist/types/channels/adapters/webex-id-ref.d.ts +5 -0
- package/dist/types/channels/background-handoff.d.ts +56 -0
- package/dist/types/channels/background-obligations.d.ts +135 -0
- package/dist/types/channels/catch-up.d.ts +26 -0
- package/dist/types/channels/commands.d.ts +2 -0
- package/dist/types/channels/completion-claim.d.ts +20 -0
- package/dist/types/channels/continuation-willingness.d.ts +1 -0
- package/dist/types/channels/continuity-types.d.ts +75 -0
- package/dist/types/channels/describe-error.d.ts +1 -0
- package/dist/types/channels/engagement.d.ts +34 -0
- package/dist/types/channels/github-false-receipt.d.ts +20 -0
- package/dist/types/channels/github-repo.d.ts +2 -0
- package/dist/types/channels/github-rereview-guard.d.ts +24 -0
- package/dist/types/channels/github-review-check.d.ts +135 -0
- package/dist/types/channels/github-review-claim.d.ts +3 -0
- package/dist/types/channels/github-review-turn-ledger.d.ts +71 -0
- package/dist/types/channels/github-review-verdict-coordinator.d.ts +117 -0
- package/dist/types/channels/github-token-bridge.d.ts +20 -0
- package/dist/types/channels/github-verdict-activity.d.ts +12 -0
- package/dist/types/channels/inbound-journal.d.ts +272 -0
- package/dist/types/channels/last-alive.d.ts +3 -0
- package/dist/types/channels/membership-cache.d.ts +27 -0
- package/dist/types/channels/membership.d.ts +21 -0
- package/dist/types/channels/outbound-flood-filter.d.ts +7 -0
- package/dist/types/channels/participants.d.ts +4 -0
- package/dist/types/channels/persistence.d.ts +32 -0
- package/dist/types/channels/recovery-notice.d.ts +26 -0
- package/dist/types/channels/recovery-outbox.d.ts +58 -0
- package/dist/types/channels/router.d.ts +798 -0
- package/dist/types/channels/schema.d.ts +501 -0
- package/dist/types/channels/session-handoff.d.ts +58 -0
- package/dist/types/channels/session-search.d.ts +29 -0
- package/dist/types/channels/types.d.ts +414 -0
- package/dist/types/channels/waiting-reactions.d.ts +25 -0
- package/dist/types/cli/builtins.d.ts +2 -0
- package/dist/types/cli/command-meta.d.ts +9 -0
- package/dist/types/coding-agent/broker-body.d.ts +7 -0
- package/dist/types/coding-agent/broker.d.ts +22 -0
- package/dist/types/coding-agent/claude.d.ts +22 -0
- package/dist/types/coding-agent/codex.d.ts +19 -0
- package/dist/types/coding-agent/index.d.ts +71 -0
- package/dist/types/coding-agent/omo-state.d.ts +2 -0
- package/dist/types/coding-agent/omo-stream.d.ts +22 -0
- package/dist/types/coding-agent/omo.d.ts +133 -0
- package/dist/types/coding-agent/runner.d.ts +35 -0
- package/dist/types/coding-agent/tool.d.ts +27 -0
- package/dist/types/coding-agent/worktree.d.ts +22 -0
- package/dist/types/commands/index.d.ts +45 -0
- package/dist/types/config/config.d.ts +814 -0
- package/dist/types/config/index.d.ts +3 -0
- package/dist/types/config/model-overrides.d.ts +3 -0
- package/dist/types/config/providers.d.ts +1456 -0
- package/dist/types/config/reloadable.d.ts +9 -0
- package/dist/types/container/agent-operation-lock.d.ts +31 -0
- package/dist/types/container/build-cache.d.ts +39 -0
- package/dist/types/container/compose-project.d.ts +1 -0
- package/dist/types/container/controller.d.ts +25 -0
- package/dist/types/container/docker-app.d.ts +23 -0
- package/dist/types/container/exit-reason.d.ts +10 -0
- package/dist/types/container/index.d.ts +14 -0
- package/dist/types/container/log-archive.d.ts +68 -0
- package/dist/types/container/log-colors.d.ts +3 -0
- package/dist/types/container/log-timestamps.d.ts +9 -0
- package/dist/types/container/logs.d.ts +37 -0
- package/dist/types/container/memory-limit.d.ts +13 -0
- package/dist/types/container/memory-oversubscription.d.ts +20 -0
- package/dist/types/container/oom-events.d.ts +18 -0
- package/dist/types/container/port.d.ts +18 -0
- package/dist/types/container/require-running.d.ts +16 -0
- package/dist/types/container/restart.d.ts +32 -0
- package/dist/types/container/shared.d.ts +93 -0
- package/dist/types/container/shell.d.ts +35 -0
- package/dist/types/container/start.d.ts +144 -0
- package/dist/types/container/stats.d.ts +31 -0
- package/dist/types/container/status.d.ts +25 -0
- package/dist/types/container/stop.d.ts +24 -0
- package/dist/types/container/tool-oom-priority.d.ts +4 -0
- package/dist/types/container/verify-running.d.ts +49 -0
- package/dist/types/cron/consumer.d.ts +42 -0
- package/dist/types/cron/count-state.d.ts +24 -0
- package/dist/types/cron/index.d.ts +21 -0
- package/dist/types/cron/list.d.ts +33 -0
- package/dist/types/cron/reloadable.d.ts +11 -0
- package/dist/types/cron/scheduler.d.ts +51 -0
- package/dist/types/cron/schema.d.ts +108 -0
- package/dist/types/dependencies/bin-resolver.d.ts +28 -0
- package/dist/types/dependencies/bins.d.ts +22 -0
- package/dist/types/dependencies/index.d.ts +2 -0
- package/dist/types/git/bound-gc-config.d.ts +4 -0
- package/dist/types/git/hookless.d.ts +1 -0
- package/dist/types/git/reconcile-ignored.d.ts +13 -0
- package/dist/types/git/resolve-agent-git.d.ts +8 -0
- package/dist/types/git/resolve-identity.d.ts +10 -0
- package/dist/types/git/run.d.ts +24 -0
- package/dist/types/git/system-commit.d.ts +2 -0
- package/dist/types/hostd/client.d.ts +13 -0
- package/dist/types/hostd/models.d.ts +1 -0
- package/dist/types/hostd/paths.d.ts +17 -0
- package/dist/types/hostd/protocol.d.ts +93 -0
- package/dist/types/hostd/spawn.d.ts +17 -0
- package/dist/types/hostd/version.d.ts +18 -0
- package/dist/types/init/auto-upgrade.d.ts +41 -0
- package/dist/types/init/cli-version.d.ts +7 -0
- package/dist/types/init/dockerfile.d.ts +34 -0
- package/dist/types/init/ensure-deps.d.ts +17 -0
- package/dist/types/init/env-file.d.ts +3 -0
- package/dist/types/init/gitignore.d.ts +5 -0
- package/dist/types/init/local-source-stamp.d.ts +3 -0
- package/dist/types/init/packagejson.d.ts +7 -0
- package/dist/types/init/paths.d.ts +3 -0
- package/dist/types/init/reconcile-plugin-deps.d.ts +13 -0
- package/dist/types/init/run-bun-install.d.ts +16 -0
- package/dist/types/init/windows-dev-link.d.ts +8 -0
- package/dist/types/mcp/catalog.d.ts +7 -0
- package/dist/types/mcp/client.d.ts +58 -0
- package/dist/types/mcp/manager.d.ts +56 -0
- package/dist/types/mcp/tools.d.ts +23 -0
- package/dist/types/models/embedding-model.d.ts +20 -0
- package/dist/types/models/transformers-version.d.ts +1 -0
- package/dist/types/network/internal-destinations.d.ts +29 -0
- package/dist/types/operations/classify-tool-outcome.d.ts +35 -0
- package/dist/types/operations/incidents.d.ts +47 -0
- package/dist/types/operations/index.d.ts +3 -0
- package/dist/types/operations/remediations.d.ts +25 -0
- package/dist/types/path-safety/real-intended-path.d.ts +9 -0
- package/dist/types/permissions/builtins.d.ts +25 -0
- package/dist/types/permissions/grant.d.ts +19 -0
- package/dist/types/permissions/index.d.ts +6 -0
- package/dist/types/permissions/match-rule.d.ts +28 -0
- package/dist/types/permissions/permissions.d.ts +42 -0
- package/dist/types/permissions/resolve.d.ts +25 -0
- package/dist/types/permissions/schema.d.ts +14 -0
- package/dist/types/plugin/context.d.ts +20 -0
- package/dist/types/plugin/core-tool-names.d.ts +4 -0
- package/dist/types/plugin/define.d.ts +46 -0
- package/dist/types/plugin/hooks.d.ts +52 -0
- package/dist/types/plugin/index.d.ts +11 -0
- package/dist/types/plugin/load-skill.d.ts +14 -0
- package/dist/types/plugin/loader.d.ts +25 -0
- package/dist/types/plugin/manager.d.ts +42 -0
- package/dist/types/plugin/registry.d.ts +73 -0
- package/dist/types/plugin/skills.d.ts +11 -0
- package/dist/types/plugin/types.d.ts +336 -0
- package/dist/types/plugin/zod-introspect.d.ts +11 -0
- package/dist/types/reload/client.d.ts +11 -0
- package/dist/types/reload/docker-exec-client.d.ts +11 -0
- package/dist/types/reload/format.d.ts +2 -0
- package/dist/types/reload/index.d.ts +6 -0
- package/dist/types/reload/recover.d.ts +22 -0
- package/dist/types/reload/registry.d.ts +10 -0
- package/dist/types/reload/types.d.ts +25 -0
- package/dist/types/role-claim/client.d.ts +20 -0
- package/dist/types/role-claim/code.d.ts +4 -0
- package/dist/types/role-claim/controller.d.ts +59 -0
- package/dist/types/role-claim/index.d.ts +6 -0
- package/dist/types/role-claim/match-rule.d.ts +9 -0
- package/dist/types/role-claim/pending.d.ts +35 -0
- package/dist/types/role-claim/reload-after-claim.d.ts +16 -0
- package/dist/types/run/llm-fetch-observer.d.ts +50 -0
- package/dist/types/sandbox/availability.d.ts +21 -0
- package/dist/types/sandbox/build.d.ts +7 -0
- package/dist/types/sandbox/canonical-secrets.d.ts +8 -0
- package/dist/types/sandbox/coding-agent.d.ts +20 -0
- package/dist/types/sandbox/dependency-bins.d.ts +19 -0
- package/dist/types/sandbox/dev-source.d.ts +4 -0
- package/dist/types/sandbox/env-exposure.d.ts +1 -0
- package/dist/types/sandbox/errors.d.ts +20 -0
- package/dist/types/sandbox/hidden-paths.d.ts +11 -0
- package/dist/types/sandbox/index.d.ts +14 -0
- package/dist/types/sandbox/package-install.d.ts +1 -0
- package/dist/types/sandbox/policy.d.ts +71 -0
- package/dist/types/sandbox/privileged-runtime.d.ts +13 -0
- package/dist/types/sandbox/quote.d.ts +2 -0
- package/dist/types/sandbox/runtime-private.d.ts +1 -0
- package/dist/types/sandbox/session-tmp.d.ts +6 -0
- package/dist/types/sandbox/symlinks.d.ts +6 -0
- package/dist/types/sandbox/writable-zones.d.ts +15 -0
- package/dist/types/secrets/coding-agent-auth.d.ts +25 -0
- package/dist/types/secrets/defaults.d.ts +21 -0
- package/dist/types/secrets/export-github-cli-store.d.ts +22 -0
- package/dist/types/secrets/hydrate.d.ts +7 -0
- package/dist/types/secrets/index.d.ts +7 -0
- package/dist/types/secrets/provision-github-cli-store.d.ts +45 -0
- package/dist/types/secrets/refresh-provider-oauth.d.ts +22 -0
- package/dist/types/secrets/resolve.d.ts +14 -0
- package/dist/types/secrets/schema.d.ts +840 -0
- package/dist/types/secrets/storage.d.ts +56 -0
- package/dist/types/shared/host-locale.d.ts +1 -0
- package/dist/types/shared/index.d.ts +5 -0
- package/dist/types/shared/local-time.d.ts +4 -0
- package/dist/types/shared/platform.d.ts +2 -0
- package/dist/types/shared/protocol.d.ts +424 -0
- package/dist/types/shared/style-text.d.ts +3 -0
- package/dist/types/shared/wsl.d.ts +17 -0
- package/dist/types/stream/broker.d.ts +2 -0
- package/dist/types/stream/index.d.ts +2 -0
- package/dist/types/stream/types.d.ts +71 -0
- package/package.json +9 -2
- package/scripts/build-plugin-types.ts +105 -0
- package/scripts/check-plugin-sdk.ts +111 -0
- package/scripts/require-parallel.ts +5 -32
- package/src/agent/guard-types.ts +3 -0
- package/src/agent/guards.ts +4 -0
- package/src/agent/idle-compaction.ts +174 -0
- package/src/agent/index.ts +74 -16
- package/src/agent/live-subagents.ts +19 -0
- package/src/agent/multimodal/look-at.ts +22 -9
- package/src/agent/plugin-tools.ts +13 -1
- package/src/agent/reviewer-bash-policy.ts +41 -1
- package/src/agent/session-origin.ts +26 -10
- package/src/agent/subagent-cache-keepalive.ts +198 -0
- package/src/agent/subagent-session.ts +6 -0
- package/src/agent/subagents.ts +46 -8
- package/src/agent/system-prompt.ts +1 -1
- package/src/agent/tool-file-safety.ts +6 -1
- package/src/agent/tools/channel-edit.ts +20 -10
- package/src/agent/tools/channel-fetch-attachment.ts +12 -5
- package/src/agent/tools/channel-handoff.ts +72 -0
- package/src/agent/tools/channel-read.ts +57 -10
- package/src/agent/tools/channel-reply.ts +33 -26
- package/src/agent/tools/channel-send.ts +21 -13
- package/src/agent/tools/channel-session-search.ts +35 -0
- package/src/agent/tools/curl-impersonate.ts +11 -4
- package/src/agent/tools/ddg.ts +13 -5
- package/src/agent/tools/spawn-subagent.ts +27 -11
- package/src/agent/tools/stream-snapshot.ts +15 -2
- package/src/agent/tools/subagent-access.ts +11 -4
- package/src/browser/bsk-shim.mjs +74 -0
- package/src/browser/dockerfile.ts +84 -0
- package/src/browser/egress.ts +104 -0
- package/src/browser/managed-browser.ts +205 -0
- package/src/browser/registry.ts +110 -0
- package/src/browser/relay.ts +231 -0
- package/src/browser/sandbox-entry.ts +167 -0
- package/src/bundled-plugins/agent-browser/index.ts +2 -0
- package/src/bundled-plugins/browser-agent/browser-agent.ts +89 -0
- package/src/bundled-plugins/browser-agent/index.ts +12 -0
- package/src/bundled-plugins/doc-render/index.ts +0 -10
- package/src/bundled-plugins/doc-render/render.ts +83 -111
- package/src/bundled-plugins/doc-render/skills/typeclaw-render-pdf/SKILL.md +152 -257
- package/src/bundled-plugins/github-cli-auth/gh-command.ts +4 -0
- package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
- package/src/bundled-plugins/github-cli-auth/index.ts +75 -59
- package/src/bundled-plugins/managed-browser/index.ts +74 -0
- package/src/bundled-plugins/managed-browser/skills/browser-use/browser-use/SKILL.md +27 -0
- package/src/bundled-plugins/managed-browser/skills/browserskill/browserskill/SKILL.md +28 -0
- package/src/bundled-plugins/managed-browser/skills/omowright/omowright/SKILL.md +40 -0
- package/src/bundled-plugins/operator/operator.ts +1 -1
- package/src/bundled-plugins/qa/index.ts +11 -0
- package/src/bundled-plugins/qa/qa.ts +160 -0
- package/src/bundled-plugins/qa/skills/qa-cli.ts +50 -0
- package/src/bundled-plugins/qa/skills/qa-general.ts +30 -0
- package/src/bundled-plugins/qa/skills/qa-http.ts +39 -0
- package/src/bundled-plugins/qa/skills/qa-pr.ts +51 -0
- package/src/bundled-plugins/qa/skills/qa-web.ts +49 -0
- package/src/bundled-plugins/security/index.ts +53 -34
- package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +1 -0
- package/src/channels/adapter-namespace.ts +13 -0
- package/src/channels/adapters/discord-bot.ts +97 -5
- package/src/channels/adapters/github/index.ts +16 -0
- package/src/channels/adapters/github/last-alive.ts +4 -16
- package/src/channels/adapters/slack-attachment-download.ts +14 -3
- package/src/channels/adapters/slack-bot-author-resolver.ts +4 -3
- package/src/channels/adapters/slack-bot-channel-resolver.ts +9 -6
- package/src/channels/adapters/slack-bot-classify.ts +1 -0
- package/src/channels/adapters/slack-bot-slash-commands.ts +3 -1
- package/src/channels/adapters/slack-bot.ts +299 -67
- package/src/channels/adapters/slack-classify.ts +1 -0
- package/src/channels/catch-up.ts +137 -0
- package/src/channels/continuation-willingness.ts +2 -2
- package/src/channels/continuity-types.ts +1 -0
- package/src/channels/engagement.ts +17 -1
- package/src/channels/github-false-receipt.ts +3 -3
- package/src/channels/github-rereview-guard.ts +9 -5
- package/src/channels/github-token-bridge.ts +24 -0
- package/src/channels/last-alive.ts +34 -0
- package/src/channels/manager.ts +8 -1
- package/src/channels/router.ts +427 -136
- package/src/channels/session-handoff.fixture.ts +144 -0
- package/src/channels/session-handoff.ts +175 -0
- package/src/channels/session-search.ts +71 -0
- package/src/channels/types.ts +12 -2
- package/src/cli/channel.ts +2 -3
- package/src/cli/init.ts +2 -3
- package/src/cli/model.ts +132 -3
- package/src/coding-agent/index.ts +7 -1
- package/src/coding-agent/omo-stream.ts +40 -0
- package/src/coding-agent/runner.ts +30 -8
- package/src/config/config.ts +111 -22
- package/src/config/model-overrides.ts +59 -0
- package/src/config/models-mutation.ts +185 -2
- package/src/config/providers-mutation.ts +12 -4
- package/src/config/providers.ts +59 -0
- package/src/container/start.ts +95 -4
- package/src/doctor/checks.ts +8 -6
- package/src/hostd/daemon.ts +13 -1
- package/src/init/auto-upgrade.ts +7 -1
- package/src/init/dockerfile.ts +57 -12
- package/src/init/index.ts +4 -3
- package/src/init/local-source-stamp.ts +68 -0
- package/src/init/models-dev.ts +4 -0
- package/src/init/validate-api-key.ts +3 -0
- package/src/permissions/builtins.ts +7 -0
- package/src/permissions/permissions.ts +18 -9
- package/src/permissions/resolve.ts +7 -1
- package/src/plugin/context.ts +2 -0
- package/src/plugin/hooks.ts +137 -0
- package/src/plugin/index.ts +6 -0
- package/src/plugin/manager.ts +4 -0
- package/src/plugin/types.ts +60 -0
- package/src/run/bundled-plugins.ts +6 -0
- package/src/run/index.ts +24 -14
- package/src/run/llm-fetch-observer.ts +12 -15
- package/src/sandbox/canonical-secrets.ts +4 -0
- package/src/sandbox/dev-source.ts +26 -0
- package/src/sandbox/hidden-paths.ts +16 -2
- package/src/secrets/storage.ts +13 -0
- package/src/skills/typeclaw-channel-github/SKILL.md +8 -8
- package/src/skills/typeclaw-config/SKILL.md +39 -5
- package/src/skills/typeclaw-config/references/dockerfile.md +2 -2
- package/src/skills/typeclaw-github-contributing/SKILL.md +1 -1
- package/src/skills/typeclaw-monorepo/SKILL.md +1 -1
- package/src/skills/typeclaw-permissions/SKILL.md +7 -7
- package/src/skills/typeclaw-troubleshooting/SKILL.md +12 -1
- package/typeclaw.schema.json +436 -5
- package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
- package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
|
@@ -1,242 +1,164 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typeclaw-render-pdf
|
|
3
|
-
description: "The ONLY supported way to
|
|
3
|
+
description: "The ONLY supported way to produce a polished, professionally designed PDF (and optionally attach it to a channel). Load this whenever you need to deliver a document as a PDF rather than raw markdown — reports, summaries, briefs, one-pagers, dashboards, meeting notes, docs, render report, export document, anything a human would want to download, print, or forward, including a researcher's report file shipped as a Slack/Discord attachment. Triggers: 'make a PDF', 'export to PDF', 'markdown to PDF', 'PDF report', 'render report', 'export document', 'the report', 'attach the report', 'send me a PDF', 'as a PDF', 'turn this into a document', 'make it look good', 'beautiful PDF', 'nicer PDF', a researcher/subagent result you want to ship as a file, 'PDF로', 'PDF로 만들어', 'PDF로 변환', 'PDF 첨부', '리포트', '보고서', '예쁘게'. Provided by the bundled `doc-render` plugin: you design the document yourself as self-contained HTML/CSS (cover, headline numbers, charts, tables — whatever fits), and a bundled script prints it to PDF with the Chrome already in the image via `playwright-core` (installed once per session with `bun add`; no browser download). Handles CJK/Korean/Japanese/Chinese: CJK fonts are opt-in, so if the output has tofu (□□□) boxes it tells you to enable `docker.file.cjkFonts` and restart, then regenerates — it never auto-downloads a font. Also load before saying you cannot produce PDFs — you can. NEVER build a PDF with jsPDF, pdfkit, a canvas text dump, or Python ReportLab — this skill is the only correct path. Covers the one-time install, writing the HTML, the render command, and how to attach the PDF to Slack/Discord/Telegram/KakaoTalk. For operating on EXISTING PDFs (merge, split, extract text, fill forms), this is not the skill — use pypdf/qpdf instead; doc-render produces documents, it does not read them."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# typeclaw-render-pdf
|
|
7
7
|
|
|
8
|
-
You
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
CommonMark to Typst; the theme makes it look designed. **Your only real choice is
|
|
26
|
-
which theme fits the document.**
|
|
27
|
-
|
|
28
|
-
> **This is the only supported way to make a PDF from Markdown in TypeClaw.**
|
|
29
|
-
> Do **not** reach for `jsPDF`, `pdfkit`, a `<canvas>` text dump, a
|
|
30
|
-
> headless-browser "print raw text" path, or Python `ReportLab`. Those skip
|
|
31
|
-
> Markdown rendering (you get literal `##` and `**` in the output) and ship no
|
|
32
|
-
> CJK font, so Korean/Japanese/Chinese come out as mojibake. The Typst path below
|
|
33
|
-
> renders the Markdown properly. If you catch yourself about to `bun add` a PDF
|
|
34
|
-
> library other than the Typst compiler named here, stop.
|
|
8
|
+
You produce PDFs by **designing the document in HTML** and printing it. The
|
|
9
|
+
bundled `doc-render` plugin ships a **render script** that prints your HTML
|
|
10
|
+
with the Chrome already in the image. There is no template and no injected
|
|
11
|
+
stylesheet: you write all the CSS, so each document is designed for its own
|
|
12
|
+
content.
|
|
13
|
+
|
|
14
|
+
The output should look like a designer made it — a cover, headline numbers,
|
|
15
|
+
charts, side-by-side panels — **not** like Markdown run through a converter.
|
|
16
|
+
That is the whole point of this path: you are the designer.
|
|
17
|
+
|
|
18
|
+
The flow: **(1)** install `playwright-core` once per session, **(2)** write the
|
|
19
|
+
document as `.html`, **(3)** run the render script, **(4)** attach the PDF if a
|
|
20
|
+
channel asked for it.
|
|
21
|
+
|
|
22
|
+
> Do **not** reach for `jsPDF`, `pdfkit`, a `<canvas>` text dump, or Python
|
|
23
|
+
> `ReportLab`. They produce unstyled text and broken CJK. If you catch yourself
|
|
24
|
+
> about to `bun add` a PDF library other than `playwright-core`, stop.
|
|
35
25
|
|
|
36
26
|
## When to use this
|
|
37
27
|
|
|
38
|
-
- A
|
|
39
|
-
- A subagent (e.g. the `researcher`) handed you a `research-<slug>.md` to ship
|
|
28
|
+
- A report, brief, one-pager, or dashboard the user wants as a downloadable file.
|
|
29
|
+
- A subagent (e.g. the `researcher`) handed you a `research-<slug>.md` to ship
|
|
30
|
+
as a PDF — read it, then **design** it as HTML (don't paste it into `<pre>`).
|
|
40
31
|
- Any channel message asking for "a PDF" / "the report attached" / "예쁘게 PDF로".
|
|
41
|
-
- Anyone complaining a previous PDF looked "plain" — switch theme and/or follow
|
|
42
|
-
the design tips below; do not hand-roll a new styling system.
|
|
43
32
|
|
|
44
33
|
When plain markdown in chat is fine, **don't** make a PDF. This is for when a
|
|
45
34
|
_file_ is the deliverable.
|
|
46
35
|
|
|
47
|
-
## Step 0 — install the
|
|
48
|
-
|
|
49
|
-
The PDF compiler is not baked into the image — install it on first use. It is a
|
|
50
|
-
single version-pinned npm package (npm pulls only this platform's prebuilt
|
|
51
|
-
binary — Linux x64/arm64, glibc or musl). Install it in the session's writable
|
|
52
|
-
`/tmp` runtime; the agent-root dependency tree is protected read-only:
|
|
36
|
+
## Step 0 — install the renderer (once per session)
|
|
53
37
|
|
|
54
38
|
```sh
|
|
55
39
|
mkdir -p /tmp/typeclaw-doc-render-runtime && cd /tmp/typeclaw-doc-render-runtime
|
|
56
|
-
bun add
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
The `@0.7.0` pin embeds Typst 0.14.2 and keeps the toolchain reproducible. If you
|
|
60
|
-
forget this step, the render script in Step 3 stops with the exact `bun add` line
|
|
61
|
-
to run, so you can also just try the render and follow its guidance.
|
|
62
|
-
|
|
63
|
-
> **Where it goes:** `/tmp/typeclaw-doc-render-runtime`, backed by TypeClaw's
|
|
64
|
-
> per-session scratch directory. It is writable to model-driven bash and reused
|
|
65
|
-
> across calls in the same session, but not promised across container restarts.
|
|
66
|
-
> Do **not** modify `/agent/node_modules` or create a dependency tree under
|
|
67
|
-
> `workspace/`.
|
|
68
|
-
|
|
69
|
-
## Step 1 — have the markdown ready
|
|
70
|
-
|
|
71
|
-
Use an existing markdown file (yours or a subagent's), or `write` your content to
|
|
72
|
-
a markdown file. Standard CommonMark plus tables and footnotes all work. Put the
|
|
73
|
-
`.md`, the copied `lib.typ`, and the `.typ` wrapper (Step 2) in the **same
|
|
74
|
-
directory** so the wrapper's relative `read("...")` and `#import "lib.typ"` both
|
|
75
|
-
resolve. Any agent-writable directory works (`workspace/`, `public/`, `mounts/`,
|
|
76
|
-
or wherever the source `.md` already lives, e.g. a researcher's report under
|
|
77
|
-
`public/`). There is no required directory; keep the three files together and run
|
|
78
|
-
the render from there.
|
|
79
|
-
|
|
80
|
-
## Step 2 — pick a theme and write the wrapper
|
|
81
|
-
|
|
82
|
-
First, **copy the bundled theme library** next to your markdown (Typst's
|
|
83
|
-
workspace sandbox only resolves imports under the render's working directory, so
|
|
84
|
-
the library must sit beside the wrapper — an absolute import from outside won't
|
|
85
|
-
resolve):
|
|
86
|
-
|
|
87
|
-
```sh
|
|
88
|
-
cd /agent/workspace # or wherever your .md lives (public/, mounts/, …)
|
|
89
|
-
cp /agent/node_modules/typeclaw/src/bundled-plugins/doc-render/templates/lib.typ .
|
|
40
|
+
bun add playwright-core@1.64.1
|
|
90
41
|
```
|
|
91
42
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
43
|
+
`playwright-core` downloads **no** browser; it drives the Chrome that already
|
|
44
|
+
ships in the image (`/usr/local/lib/typeclaw-agent-browser/chrome`). The
|
|
45
|
+
directory is TypeClaw's writable per-session scratch, reused across calls in the
|
|
46
|
+
same session but not promised across restarts. Do **not** modify
|
|
47
|
+
`/agent/node_modules` or create a dependency tree under `workspace/`. If you
|
|
48
|
+
forget this step, the render exits 3 and prints the exact `bun add` line.
|
|
49
|
+
|
|
50
|
+
## Step 1 — write the HTML
|
|
51
|
+
|
|
52
|
+
Write one self-contained `.html` file (CSS in a `<style>` block) in any
|
|
53
|
+
agent-writable directory (`workspace/`, `public/`, or next to the source
|
|
54
|
+
`.md`). Put local images beside it and reference them relatively. Charts are
|
|
55
|
+
inline `<svg>` or plain CSS (bars as sized `<div>`s); no JS chart libraries.
|
|
56
|
+
|
|
57
|
+
### Print essentials
|
|
58
|
+
|
|
59
|
+
Browsers print badly by default. Always include these:
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@page {
|
|
63
|
+
size: A4;
|
|
64
|
+
margin: 18mm 16mm;
|
|
65
|
+
@bottom-right {
|
|
66
|
+
content: counter(page) ' / ' counter(pages);
|
|
67
|
+
font: 8pt sans-serif;
|
|
68
|
+
color: #888;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
html {
|
|
72
|
+
-webkit-print-color-adjust: exact;
|
|
73
|
+
print-color-adjust: exact;
|
|
74
|
+
} /* keep backgrounds */
|
|
75
|
+
h1,
|
|
76
|
+
h2,
|
|
77
|
+
h3 {
|
|
78
|
+
break-after: avoid;
|
|
79
|
+
}
|
|
80
|
+
figure,
|
|
81
|
+
tr,
|
|
82
|
+
.card {
|
|
83
|
+
break-inside: avoid;
|
|
84
|
+
}
|
|
85
|
+
thead {
|
|
86
|
+
display: table-header-group;
|
|
87
|
+
} /* repeat table headers across pages */
|
|
112
88
|
```
|
|
113
89
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
the
|
|
154
|
-
|
|
155
|
-
|
|
90
|
+
- A full-bleed cover: give it its own named page (`@page cover { margin: 0 }`,
|
|
91
|
+
`.cover { page: cover; height: 297mm; break-after: page }`).
|
|
92
|
+
- Size with `mm`/`pt`, not `vh`; an A4 page is 210 × 297 mm.
|
|
93
|
+
- **Fonts:** nothing is bundled and remote fonts are not allowed. Use a stack
|
|
94
|
+
that degrades well, and include the CJK fallback:
|
|
95
|
+
`font-family: Inter, "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "DejaVu Sans", "Noto Sans CJK KR", "Noto Sans CJK JP", "Noto Sans CJK SC", sans-serif;`
|
|
96
|
+
Get hierarchy from size, weight, spacing, and color, not from a fancy face.
|
|
97
|
+
|
|
98
|
+
### Design like a designer
|
|
99
|
+
|
|
100
|
+
- **Lead with the conclusion.** The cover and first-page headline state the
|
|
101
|
+
finding ("Edge inference became the default"), not the topic ("Q2 Report").
|
|
102
|
+
- **Numbers up front.** Put the 3–4 headline figures in a row of cards.
|
|
103
|
+
- **Compare side by side** with CSS grid instead of stacking everything.
|
|
104
|
+
- **Tables over repeated bullets**, with status as small colored pills and
|
|
105
|
+
figures right-aligned (`font-variant-numeric: tabular-nums`).
|
|
106
|
+
- **One accent color** chosen for the subject (navy for finance, teal for
|
|
107
|
+
health, indigo for tech), plus neutrals. Callouts are rare.
|
|
108
|
+
- **Keep prose short.** Short paragraphs under clear sections; no walls of text.
|
|
109
|
+
- **Vary the design per document.** Don't reuse one layout for everything.
|
|
110
|
+
- **Everything local.** No CDN fonts, scripts, stylesheets, or remote images.
|
|
111
|
+
|
|
112
|
+
### Charts
|
|
113
|
+
|
|
114
|
+
A chart should make one point; let its title say it ("Churn halved after the
|
|
115
|
+
March price change"), not just name the data. If there's no point to make, a
|
|
116
|
+
table or a sentence may serve better.
|
|
117
|
+
|
|
118
|
+
Good defaults, not rules — break them when the content calls for it:
|
|
119
|
+
|
|
120
|
+
- Pick the form from the question: trends → lines; comparisons → sorted
|
|
121
|
+
horizontal bars; part-of-whole → a stacked bar (pies only for 2–3 parts);
|
|
122
|
+
progress → a bar against a target.
|
|
123
|
+
- Position and length read more precisely than angle, area, or color.
|
|
124
|
+
- Bars usually start at zero, because readers compare their length.
|
|
125
|
+
- Label lines and bars directly instead of using a legend; keep gridlines
|
|
126
|
+
faint and ticks round; put units where the reader looks.
|
|
127
|
+
- Gray by default, the accent for what the title is about; the chart should
|
|
128
|
+
still read in grayscale.
|
|
129
|
+
- Annotate the moment that explains the shape; note the source and date.
|
|
130
|
+
- Too many series? Small multiples with a shared scale often read better.
|
|
131
|
+
- Derive coordinates from the data (a small script that emits the `<svg>`
|
|
132
|
+
works well); shapes placed by eye drift from the numbers.
|
|
133
|
+
|
|
134
|
+
## Step 2 — render
|
|
156
135
|
|
|
157
136
|
```sh
|
|
158
|
-
cd /agent/workspace #
|
|
159
|
-
bun run /agent/node_modules/typeclaw/src/bundled-plugins/doc-render/render.ts
|
|
137
|
+
cd /agent/workspace # wherever your .html lives
|
|
138
|
+
bun run /agent/node_modules/typeclaw/src/bundled-plugins/doc-render/render.ts brief.html brief.pdf
|
|
160
139
|
```
|
|
161
140
|
|
|
162
|
-
On success it prints `wrote
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
not a font — retry once; if it persists, report it as a sandbox/environment
|
|
169
|
-
issue and do **not** switch to another PDF library (it won't help). Any other
|
|
170
|
-
error is a real Typst compile error (usually raw HTML or an unsupported markdown
|
|
171
|
-
extension) and names the offending line — simplify that part and re-run.
|
|
172
|
-
|
|
173
|
-
## Make it genuinely beautiful (design tips)
|
|
174
|
-
|
|
175
|
-
A theme gets you 90% of the way. The rest is content discipline — the same things
|
|
176
|
-
that separate a designed document from a markdown dump:
|
|
177
|
-
|
|
178
|
-
- **Front-load structure.** A short lead paragraph under the title, then clear
|
|
179
|
-
`##` sections. Don't open with a wall of text.
|
|
180
|
-
- **Tables over repeated bullet stanzas.** If you're repeating the same fields
|
|
181
|
-
per item (name, value, status…), a table reads far better than N bullet lists.
|
|
182
|
-
The theme styles tables with clean rules and a header row.
|
|
183
|
-
- **Caption your images** so they read as figures, not floating screenshots:
|
|
184
|
-
|
|
185
|
-
```markdown
|
|
186
|
-
<!--raw-typst
|
|
187
|
-
#figure(image("chart.png", width: 80%), caption: [Revenue trend, Q1–Q2 2026.])
|
|
188
|
-
-->
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Images default to a sensible max width; keep them to one strong figure per idea
|
|
192
|
-
rather than many raw dumps at random sizes.
|
|
193
|
-
|
|
194
|
-
- **Use callouts for what matters** — a risk, a key result, a caveat — instead of
|
|
195
|
-
bolding a whole paragraph. `callout` is exported by the library (pass it via
|
|
196
|
-
`scope:` as shown above), then used inside the markdown:
|
|
197
|
-
|
|
198
|
-
```markdown
|
|
199
|
-
<!--raw-typst
|
|
200
|
-
#callout(kind: "warning", title: "Risk")[A single supplier covers 40% of NPUs.]
|
|
201
|
-
#callout(kind: "success")[Revenue grew 31% YoY, ahead of plan.]
|
|
202
|
-
-->
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Kinds: `note`, `tip`, `success`, `warning`, `danger`. Keep them rare — two or
|
|
206
|
-
three in a document read as deliberate; a wall of colored boxes reads as noise.
|
|
207
|
-
|
|
208
|
-
- **Lead with the numbers (data reports).** For a metrics-heavy document, open a
|
|
209
|
-
section with a row of KPI cards instead of burying figures in prose. `kpi` and
|
|
210
|
-
`kpi-row` are exported by the library (pass them via `scope:` as shown above):
|
|
211
|
-
|
|
212
|
-
```markdown
|
|
213
|
-
<!--raw-typst
|
|
214
|
-
#kpi-row(
|
|
215
|
-
kpi("$5.5M", "Revenue", sub: "+31% YoY"),
|
|
216
|
-
kpi("124%", "Net retention", sub: "+6pt"),
|
|
217
|
-
kpi("63.4%", "Gross margin", sub: "+240bp"),
|
|
218
|
-
)
|
|
219
|
-
-->
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Use `pullquote("…", by: "…")` for a centered featured quote between sections.
|
|
141
|
+
On success it prints `wrote brief.pdf (<N> bytes)`. Exit **3** means
|
|
142
|
+
`playwright-core` is missing (run Step 0). A **`NotDir` / ENOTDIR** error is the
|
|
143
|
+
sandbox `/proc` degraded mode, not your markup — retry once; if it persists,
|
|
144
|
+
report it as an environment issue and do **not** switch to another PDF library.
|
|
145
|
+
`no Chrome at …` means the image has no browser at the default path; set
|
|
146
|
+
`AGENT_BROWSER_EXECUTABLE_PATH` to a Chrome/Chromium binary.
|
|
223
147
|
|
|
224
|
-
|
|
225
|
-
|
|
148
|
+
Check the result before sending: if layout matters, screenshot a page with a
|
|
149
|
+
browser engine (`agent-browser` is always installed) or re-read the HTML for overflowing tables or orphaned headings
|
|
150
|
+
and fix them with `break-inside: avoid` / `break-before: page`.
|
|
226
151
|
|
|
227
152
|
## Handling CJK content
|
|
228
153
|
|
|
229
|
-
CJK fonts are **opt-in** (the `docker.file.cjkFonts` toggle).
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this, and **do not** silently deliver a tofu PDF.
|
|
154
|
+
CJK fonts are **opt-in** (the `docker.file.cjkFonts` toggle). With `Noto Sans CJK`
|
|
155
|
+
in your font stack (see Print essentials), Korean/Japanese/Chinese render
|
|
156
|
+
automatically **when those fonts are present**. When the toggle is off, CJK
|
|
157
|
+
glyphs come out as tofu (□) boxes. **Do not** download, vendor, or `curl` a font
|
|
158
|
+
to work around this, and **do not** silently deliver a tofu PDF.
|
|
235
159
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
fonts aren't enabled on this container), tell the user honestly and offer the
|
|
239
|
-
fix:
|
|
160
|
+
If the document contains CJK and the PDF shows tofu (or you know CJK fonts
|
|
161
|
+
aren't enabled), tell the user and offer the fix:
|
|
240
162
|
|
|
241
163
|
> This report has Korean/Japanese/Chinese text but the container has no CJK font
|
|
242
164
|
> — they're opt-in, so the PDF comes out as tofu boxes. Want me to set
|
|
@@ -244,27 +166,21 @@ fix:
|
|
|
244
166
|
> I edit it you'll run `typeclaw restart` from the host project directory, and
|
|
245
167
|
> then I'll regenerate the PDF.
|
|
246
168
|
|
|
247
|
-
Only after the user agrees: edit `typeclaw.json`
|
|
248
|
-
|
|
249
|
-
regenerate the PDF after the restarted container comes back. If the markdown has
|
|
250
|
-
no CJK, this section doesn't apply.
|
|
169
|
+
Only after the user agrees: edit `typeclaw.json` (use the `typeclaw-config`
|
|
170
|
+
skill), ask them to `typeclaw restart`, and regenerate afterwards.
|
|
251
171
|
|
|
252
|
-
##
|
|
172
|
+
## Archiving an existing web page
|
|
253
173
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
`agent-browser
|
|
257
|
-
file:///agent/workspace/page.html` (or a URL), then `agent-browser pdf
|
|
258
|
-
/agent/workspace/out.pdf`. Its output is fixed US-Letter with default margins, so
|
|
259
|
-
it's the right tool for _archiving web content_, not for authoring styled
|
|
260
|
-
reports. For authored documents, stay on the Typst path above.
|
|
174
|
+
To capture a **live URL** as a PDF rather than author a document, drive a
|
|
175
|
+
browser engine; with the always-installed `agent-browser` that is
|
|
176
|
+
`agent-browser open <url>`, then `agent-browser pdf out.pdf`.
|
|
261
177
|
|
|
262
|
-
## Step
|
|
178
|
+
## Step 3 — deliver
|
|
263
179
|
|
|
264
180
|
- **Channel asked for the PDF** — attach it:
|
|
265
181
|
|
|
266
182
|
```
|
|
267
|
-
channel_send(text: "Here's the report.", attachments: [{ path: "/agent/workspace/
|
|
183
|
+
channel_send(text: "Here's the report.", attachments: [{ path: "/agent/workspace/brief.pdf", filename: "Edge-AI-Brief.pdf" }])
|
|
268
184
|
```
|
|
269
185
|
|
|
270
186
|
Use a human-friendly `filename` and an absolute path. Slack, Discord, Telegram,
|
|
@@ -273,48 +189,27 @@ reports. For authored documents, stay on the Typst path above.
|
|
|
273
189
|
|
|
274
190
|
- **Replying in a thread** — use `channel_reply` with the same `attachments` shape.
|
|
275
191
|
|
|
276
|
-
- **No channel** (TUI session) — just report the path
|
|
192
|
+
- **No channel** (TUI session) — just report the path.
|
|
277
193
|
|
|
278
194
|
## If you got the markdown from a subagent
|
|
279
195
|
|
|
280
196
|
The `researcher` subagent writes its report to `research-<slug>.md` and returns a
|
|
281
|
-
`<report>` block naming the file.
|
|
282
|
-
|
|
197
|
+
`<report>` block naming the file. Read it, design the HTML from its content
|
|
198
|
+
(cover, KPIs, charts from its numbers), render, and attach. You do the PDF
|
|
283
199
|
step — the researcher's `bash` is read-only and it only emits markdown by design.
|
|
284
200
|
|
|
285
|
-
## Customizing
|
|
286
|
-
|
|
287
|
-
This is a bundled default. Want a fifth theme, a cover page with a logo, or a
|
|
288
|
-
house style? Two options: (a) copy `lib.typ` into the document directory and edit
|
|
289
|
-
your local copy before rendering (one-off), or (b) for a durable change, copy this
|
|
290
|
-
file to `.agents/skills/<your-name>/SKILL.md` (use a **different** `name`; bundled
|
|
291
|
-
skills win name collisions) and point it at your own theme library.
|
|
292
|
-
|
|
293
|
-
## Known limitations
|
|
294
|
-
|
|
295
|
-
`cmarker` covers CommonMark well, but a few markdown features don't render as you
|
|
296
|
-
might expect:
|
|
201
|
+
## Customizing
|
|
297
202
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
`**로컬 우선(local-first)**`) may not be recognized as emphasis — CommonMark's
|
|
302
|
-
flanking rules treat that boundary as non-emphasis. Put a space inside, or bold a
|
|
303
|
-
pure run of text.
|
|
304
|
-
- **Raw HTML** in the markdown is mostly ignored. Express structure in markdown
|
|
305
|
-
(tables, lists) rather than HTML.
|
|
203
|
+
For a durable house style (brand colors, logo, layout), copy this file to
|
|
204
|
+
`.agents/skills/<your-name>/SKILL.md` (use a **different** `name`; bundled
|
|
205
|
+
skills win name collisions) and describe the style there.
|
|
306
206
|
|
|
307
207
|
## Don'ts
|
|
308
208
|
|
|
309
|
-
- **Don't**
|
|
310
|
-
the
|
|
311
|
-
|
|
312
|
-
- **Don't**
|
|
313
|
-
|
|
314
|
-
render
|
|
315
|
-
- **Don't** build a `package.json` / `node_modules` / a render script under
|
|
316
|
-
`workspace/` or modify the protected agent-root dependencies. The compiler
|
|
317
|
-
installs in `/tmp/typeclaw-doc-render-runtime`; the render script and theme library are bundled with the plugin (under
|
|
318
|
-
`/agent/node_modules/typeclaw/src/bundled-plugins/doc-render/`).
|
|
209
|
+
- **Don't** convert markdown mechanically into `<p>`/`<ul>` and call it done —
|
|
210
|
+
design the layout; that is what makes the document look designed.
|
|
211
|
+
- **Don't** link remote assets or add `<script>` that fetches anything.
|
|
212
|
+
- **Don't** build a `package.json` / `node_modules` under `workspace/` or modify
|
|
213
|
+
the protected agent-root dependencies. `playwright-core` installs in
|
|
214
|
+
`/tmp/typeclaw-doc-render-runtime`.
|
|
319
215
|
- **Don't** attach a PDF to a GitHub channel — that adapter rejects attachments.
|
|
320
|
-
Link or inline instead.
|
|
@@ -270,6 +270,10 @@ function isAuthStatusTokenDisplayFlag(arg: string): boolean {
|
|
|
270
270
|
return arg.slice(1).split('=', 1)[0]?.includes('t') === true
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
export function hasGhInvocation(command: string): boolean {
|
|
274
|
+
return findGhInvocations(tokenize(command)).length > 0
|
|
275
|
+
}
|
|
276
|
+
|
|
273
277
|
export function canInjectPatIntoPassThroughGh(command: string): boolean {
|
|
274
278
|
if (containsReviewGraphqlMutation(command)) return false
|
|
275
279
|
if (hasUnsafeGhStageBackslash(command)) return false
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
|
|
3
|
+
import { GITHUB_API_BASE, githubJsonHeaders } from '@/channels/adapters/github/auth-pat'
|
|
4
|
+
import type { ToolResult } from '@/plugin'
|
|
5
|
+
|
|
6
|
+
export type GitAuthCredential = { source: string; token: string }
|
|
7
|
+
export type GitAuthLoginResolver = (token: string) => Promise<string | null>
|
|
8
|
+
|
|
9
|
+
let loginResolverForTests: GitAuthLoginResolver | undefined
|
|
10
|
+
|
|
11
|
+
export function setGitAuthLoginResolverForTests(resolver: GitAuthLoginResolver | undefined): void {
|
|
12
|
+
loginResolverForTests = resolver
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createGitAuthLoginResolver(
|
|
16
|
+
lookup: GitAuthLoginResolver = async (token) => {
|
|
17
|
+
if (loginResolverForTests !== undefined) return await loginResolverForTests(token)
|
|
18
|
+
const response = await fetch(`${GITHUB_API_BASE}/user`, {
|
|
19
|
+
headers: githubJsonHeaders(token),
|
|
20
|
+
signal: AbortSignal.timeout(2_000),
|
|
21
|
+
redirect: 'error',
|
|
22
|
+
})
|
|
23
|
+
if (!response.ok) return null
|
|
24
|
+
const user: unknown = await response.json()
|
|
25
|
+
return user !== null && typeof user === 'object' && 'login' in user && typeof user.login === 'string'
|
|
26
|
+
? user.login
|
|
27
|
+
: null
|
|
28
|
+
},
|
|
29
|
+
): GitAuthLoginResolver {
|
|
30
|
+
const cache = new Map<string, Promise<string | null>>()
|
|
31
|
+
return (token) => {
|
|
32
|
+
const key = createHash('sha256').update(token).digest('hex')
|
|
33
|
+
let login = cache.get(key)
|
|
34
|
+
if (login === undefined) {
|
|
35
|
+
// Lookup is advisory: neither network errors nor response bodies may replace
|
|
36
|
+
// the git failure or expose a credential through an exception.
|
|
37
|
+
login = Promise.resolve()
|
|
38
|
+
.then(() => lookup(token))
|
|
39
|
+
.catch(() => null)
|
|
40
|
+
cache.set(key, login)
|
|
41
|
+
}
|
|
42
|
+
return login
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function appendGitAuthDiagnostic(options: {
|
|
47
|
+
result: ToolResult
|
|
48
|
+
credentials: readonly GitAuthCredential[]
|
|
49
|
+
ghCredential?: GitAuthCredential
|
|
50
|
+
push: boolean
|
|
51
|
+
resolveLogin: GitAuthLoginResolver
|
|
52
|
+
}): Promise<void> {
|
|
53
|
+
const { result } = options
|
|
54
|
+
const text = result.content
|
|
55
|
+
.filter((part) => part.type === 'text')
|
|
56
|
+
.map((part) => part.text)
|
|
57
|
+
.join('\n')
|
|
58
|
+
const details = result.details
|
|
59
|
+
const failed =
|
|
60
|
+
(details !== null &&
|
|
61
|
+
typeof details === 'object' &&
|
|
62
|
+
(('error' in details && typeof details.error === 'string') ||
|
|
63
|
+
('exitCode' in details && typeof details.exitCode === 'number' && details.exitCode !== 0))) ||
|
|
64
|
+
/Command (?:failed|exited) with (?:exit )?code [1-9]\d*/i.test(text)
|
|
65
|
+
if (!failed) return
|
|
66
|
+
// These are git/GitHub protocol errors, not natural-language intent matching.
|
|
67
|
+
if (
|
|
68
|
+
!/\b(?:401|403)\b|Permission to .+ denied to |Authentication failed|Invalid username or password|Resource not accessible/i.test(
|
|
69
|
+
text,
|
|
70
|
+
) &&
|
|
71
|
+
!(options.push && /Repository not found/i.test(text))
|
|
72
|
+
)
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
const used = await Promise.all(
|
|
76
|
+
options.credentials.map(async (credential) => ({
|
|
77
|
+
source: credential.source,
|
|
78
|
+
login: (await options.resolveLogin(credential.token)) ?? 'unknown',
|
|
79
|
+
})),
|
|
80
|
+
)
|
|
81
|
+
let advice = `[github-cli-auth:gitCredential] Git used ${used.map(({ source, login }) => `${source} (login: ${login})`).join('; ')}.`
|
|
82
|
+
if (options.ghCredential !== undefined) {
|
|
83
|
+
const ghLogin = (await options.resolveLogin(options.ghCredential.token)) ?? 'unknown'
|
|
84
|
+
if (used.some(({ login }) => login !== ghLogin)) {
|
|
85
|
+
advice += ` gh for this repo would use ${options.ghCredential.source} (login: ${ghLogin}).`
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
advice +=
|
|
89
|
+
' Operator: fix or remove the mismatched credential (github in secrets.json for the repo token, GH_TOKEN in the agent .env for the declared PAT), then run typeclaw restart. The host gh login never funds git push.'
|
|
90
|
+
// Do not trust lookup output to be secret-free, even when provided by /user.
|
|
91
|
+
for (const credential of [...options.credentials, ...(options.ghCredential ? [options.ghCredential] : [])]) {
|
|
92
|
+
advice = advice.replaceAll(credential.token, '[redacted]')
|
|
93
|
+
}
|
|
94
|
+
result.content.push({ type: 'text', text: advice })
|
|
95
|
+
}
|