pi-improve-interation 0.0.1
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/LICENSE +21 -0
- package/README.en.md +57 -0
- package/README.md +57 -0
- package/extensions/plus.ts +93 -0
- package/node_modules/acorn/CHANGELOG.md +998 -0
- package/node_modules/acorn/LICENSE +21 -0
- package/node_modules/acorn/README.md +309 -0
- package/node_modules/acorn/bin/acorn +4 -0
- package/node_modules/acorn/dist/acorn.d.mts +897 -0
- package/node_modules/acorn/dist/acorn.d.ts +897 -0
- package/node_modules/acorn/dist/acorn.js +6342 -0
- package/node_modules/acorn/dist/acorn.mjs +6313 -0
- package/node_modules/acorn/dist/bin.js +90 -0
- package/node_modules/acorn/package.json +50 -0
- package/node_modules/jiti/LICENSE +21 -0
- package/node_modules/jiti/README.md +258 -0
- package/node_modules/jiti/dist/babel.cjs +257 -0
- package/node_modules/jiti/dist/jiti.cjs +1 -0
- package/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/node_modules/jiti/lib/jiti.cjs +30 -0
- package/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/node_modules/jiti/lib/jiti.mjs +29 -0
- package/node_modules/jiti/lib/types.d.ts +420 -0
- package/node_modules/jiti/package.json +146 -0
- package/node_modules/pi-subagents/CHANGELOG.md +2282 -0
- package/node_modules/pi-subagents/LICENSE +21 -0
- package/node_modules/pi-subagents/README.md +126 -0
- package/node_modules/pi-subagents/agents/claude-code-writer.md +15 -0
- package/node_modules/pi-subagents/agents/claude-code.md +15 -0
- package/node_modules/pi-subagents/agents/codex-exec-writer.md +15 -0
- package/node_modules/pi-subagents/agents/codex-exec.md +15 -0
- package/node_modules/pi-subagents/agents/cursor-agent-writer.md +14 -0
- package/node_modules/pi-subagents/agents/cursor-agent.md +14 -0
- package/node_modules/pi-subagents/agents/delegate.md +14 -0
- package/node_modules/pi-subagents/agents/oracle.md +78 -0
- package/node_modules/pi-subagents/agents/researcher.md +52 -0
- package/node_modules/pi-subagents/agents/reviewer.md +89 -0
- package/node_modules/pi-subagents/agents/scout.md +50 -0
- package/node_modules/pi-subagents/agents/worker.md +59 -0
- package/node_modules/pi-subagents/async-retention-discovery-worker.mjs +180 -0
- package/node_modules/pi-subagents/docs/agents.md +492 -0
- package/node_modules/pi-subagents/docs/configuration.md +508 -0
- package/node_modules/pi-subagents/docs/extension-api.md +443 -0
- package/node_modules/pi-subagents/docs/missions.md +121 -0
- package/node_modules/pi-subagents/docs/models.md +258 -0
- package/node_modules/pi-subagents/docs/observability.md +262 -0
- package/node_modules/pi-subagents/docs/tool-reference.md +482 -0
- package/node_modules/pi-subagents/docs/watchdog.md +176 -0
- package/node_modules/pi-subagents/docs/workflows.md +475 -0
- package/node_modules/pi-subagents/index.ts +10 -0
- package/node_modules/pi-subagents/inspector-runner.mjs +11 -0
- package/node_modules/pi-subagents/install.mjs +93 -0
- package/node_modules/pi-subagents/package.json +109 -0
- package/node_modules/pi-subagents/prompts/council.md +60 -0
- package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +13 -0
- package/node_modules/pi-subagents/prompts/parallel-cleanup.md +59 -0
- package/node_modules/pi-subagents/prompts/parallel-research.md +50 -0
- package/node_modules/pi-subagents/prompts/parallel-review.md +58 -0
- package/node_modules/pi-subagents/prompts/review-loop.md +47 -0
- package/node_modules/pi-subagents/skills/council-mode/SKILL.md +59 -0
- package/node_modules/pi-subagents/skills/council-mode/references/pass-contracts.md +150 -0
- package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +103 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +70 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +538 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +161 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +51 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +295 -0
- package/node_modules/pi-subagents/skills/pi-subagents/references/review-and-validation.md +73 -0
- package/node_modules/pi-subagents/src/agents/agent-management.ts +1355 -0
- package/node_modules/pi-subagents/src/agents/agent-memory.ts +254 -0
- package/node_modules/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/node_modules/pi-subagents/src/agents/agent-scope.ts +6 -0
- package/node_modules/pi-subagents/src/agents/agent-selection.ts +25 -0
- package/node_modules/pi-subagents/src/agents/agent-serializer.ts +179 -0
- package/node_modules/pi-subagents/src/agents/agents.ts +2808 -0
- package/node_modules/pi-subagents/src/agents/builtin-names.ts +15 -0
- package/node_modules/pi-subagents/src/agents/chain-serializer.ts +280 -0
- package/node_modules/pi-subagents/src/agents/frontmatter.ts +153 -0
- package/node_modules/pi-subagents/src/agents/identity.ts +30 -0
- package/node_modules/pi-subagents/src/agents/proactive-skills.ts +194 -0
- package/node_modules/pi-subagents/src/agents/runtime-agent-events.ts +70 -0
- package/node_modules/pi-subagents/src/agents/runtime-agent-registry.ts +429 -0
- package/node_modules/pi-subagents/src/agents/skills.ts +754 -0
- package/node_modules/pi-subagents/src/api/agents.ts +12 -0
- package/node_modules/pi-subagents/src/api/background-work.ts +206 -0
- package/node_modules/pi-subagents/src/api/capability-ceiling.ts +17 -0
- package/node_modules/pi-subagents/src/api/control-channel.ts +4 -0
- package/node_modules/pi-subagents/src/api/delegation.ts +112 -0
- package/node_modules/pi-subagents/src/api/external-job-provider.ts +195 -0
- package/node_modules/pi-subagents/src/api/external-runs.ts +282 -0
- package/node_modules/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/node_modules/pi-subagents/src/api/pi-args.ts +5 -0
- package/node_modules/pi-subagents/src/api/preflight.ts +501 -0
- package/node_modules/pi-subagents/src/api/project-panes.ts +32 -0
- package/node_modules/pi-subagents/src/api/shared-types.ts +24 -0
- package/node_modules/pi-subagents/src/extension/config.ts +235 -0
- package/node_modules/pi-subagents/src/extension/control-notices.ts +58 -0
- package/node_modules/pi-subagents/src/extension/doctor.ts +278 -0
- package/node_modules/pi-subagents/src/extension/fanout-child.ts +205 -0
- package/node_modules/pi-subagents/src/extension/index.ts +1093 -0
- package/node_modules/pi-subagents/src/extension/public-execution.ts +210 -0
- package/node_modules/pi-subagents/src/extension/rpc.ts +860 -0
- package/node_modules/pi-subagents/src/extension/schemas.ts +419 -0
- package/node_modules/pi-subagents/src/extension/steering-notices.ts +35 -0
- package/node_modules/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/node_modules/pi-subagents/src/extension/tool-description.ts +221 -0
- package/node_modules/pi-subagents/src/extension/tool-result.ts +19 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/actions.ts +235 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/inspector-runner.ts +147 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.ts +730 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/node_modules/pi-subagents/src/inspectors/herdr/shell-command.ts +16 -0
- package/node_modules/pi-subagents/src/integrations/herdr-status.ts +400 -0
- package/node_modules/pi-subagents/src/intercom/intercom-bridge.ts +191 -0
- package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.ts +812 -0
- package/node_modules/pi-subagents/src/intercom/result-intercom.ts +423 -0
- package/node_modules/pi-subagents/src/missions/actions.ts +433 -0
- package/node_modules/pi-subagents/src/missions/goal-driver.ts +164 -0
- package/node_modules/pi-subagents/src/missions/lifecycle.ts +367 -0
- package/node_modules/pi-subagents/src/missions/store.ts +584 -0
- package/node_modules/pi-subagents/src/missions/types.ts +190 -0
- package/node_modules/pi-subagents/src/missions/workflow-state.ts +260 -0
- package/node_modules/pi-subagents/src/policy/authority.ts +46 -0
- package/node_modules/pi-subagents/src/profiles/profiles.ts +662 -0
- package/node_modules/pi-subagents/src/runs/background/active-async-capacity.ts +517 -0
- package/node_modules/pi-subagents/src/runs/background/active-run-index.ts +139 -0
- package/node_modules/pi-subagents/src/runs/background/async-execution.ts +2031 -0
- package/node_modules/pi-subagents/src/runs/background/async-job-tracker.ts +781 -0
- package/node_modules/pi-subagents/src/runs/background/async-resume.ts +628 -0
- package/node_modules/pi-subagents/src/runs/background/async-retention.ts +903 -0
- package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.ts +48 -0
- package/node_modules/pi-subagents/src/runs/background/async-status.ts +736 -0
- package/node_modules/pi-subagents/src/runs/background/auto-drain.ts +68 -0
- package/node_modules/pi-subagents/src/runs/background/chain-append.ts +321 -0
- package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.ts +270 -0
- package/node_modules/pi-subagents/src/runs/background/completion-batcher.ts +168 -0
- package/node_modules/pi-subagents/src/runs/background/completion-dedupe.ts +58 -0
- package/node_modules/pi-subagents/src/runs/background/completion-replay.ts +287 -0
- package/node_modules/pi-subagents/src/runs/background/control-channel.ts +768 -0
- package/node_modules/pi-subagents/src/runs/background/fleet-view.ts +620 -0
- package/node_modules/pi-subagents/src/runs/background/index-segment.ts +59 -0
- package/node_modules/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
- package/node_modules/pi-subagents/src/runs/background/notify.ts +594 -0
- package/node_modules/pi-subagents/src/runs/background/owned-process-tree.ts +104 -0
- package/node_modules/pi-subagents/src/runs/background/parallel-groups.ts +45 -0
- package/node_modules/pi-subagents/src/runs/background/process-terminal.ts +310 -0
- package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.ts +45 -0
- package/node_modules/pi-subagents/src/runs/background/result-files.ts +519 -0
- package/node_modules/pi-subagents/src/runs/background/result-watcher.ts +792 -0
- package/node_modules/pi-subagents/src/runs/background/resume-guidance.ts +56 -0
- package/node_modules/pi-subagents/src/runs/background/retained-children.ts +135 -0
- package/node_modules/pi-subagents/src/runs/background/run-id-query.ts +7 -0
- package/node_modules/pi-subagents/src/runs/background/run-id-resolver.ts +175 -0
- package/node_modules/pi-subagents/src/runs/background/run-status.ts +694 -0
- package/node_modules/pi-subagents/src/runs/background/scheduled-runs.ts +965 -0
- package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.ts +410 -0
- package/node_modules/pi-subagents/src/runs/background/steering.ts +242 -0
- package/node_modules/pi-subagents/src/runs/background/subagent-runner.ts +5649 -0
- package/node_modules/pi-subagents/src/runs/background/subagent-wait.ts +725 -0
- package/node_modules/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
- package/node_modules/pi-subagents/src/runs/background/top-level-async.ts +14 -0
- package/node_modules/pi-subagents/src/runs/background/wait-completions.ts +196 -0
- package/node_modules/pi-subagents/src/runs/background/wait-config.ts +50 -0
- package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.ts +348 -0
- package/node_modules/pi-subagents/src/runs/background/wait-tool.ts +43 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.ts +86 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.ts +262 -0
- package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.ts +86 -0
- package/node_modules/pi-subagents/src/runs/foreground/execution.ts +2437 -0
- package/node_modules/pi-subagents/src/runs/foreground/foreground-control.ts +153 -0
- package/node_modules/pi-subagents/src/runs/foreground/foreground-history.ts +160 -0
- package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.ts +172 -0
- package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.ts +6916 -0
- package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +299 -0
- package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +188 -0
- package/node_modules/pi-subagents/src/runs/shared/abort-recovery.ts +119 -0
- package/node_modules/pi-subagents/src/runs/shared/acceptance.ts +1509 -0
- package/node_modules/pi-subagents/src/runs/shared/agent-contract.ts +38 -0
- package/node_modules/pi-subagents/src/runs/shared/async-status-projection.ts +597 -0
- package/node_modules/pi-subagents/src/runs/shared/background-process-options.ts +9 -0
- package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.ts +210 -0
- package/node_modules/pi-subagents/src/runs/shared/chain-outputs.ts +116 -0
- package/node_modules/pi-subagents/src/runs/shared/child-identity.ts +51 -0
- package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.ts +151 -0
- package/node_modules/pi-subagents/src/runs/shared/child-protocol.ts +415 -0
- package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.ts +129 -0
- package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/node_modules/pi-subagents/src/runs/shared/completion-evidence.ts +89 -0
- package/node_modules/pi-subagents/src/runs/shared/completion-guard.ts +252 -0
- package/node_modules/pi-subagents/src/runs/shared/context-mode.ts +44 -0
- package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.ts +114 -0
- package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.ts +297 -0
- package/node_modules/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
- package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.ts +167 -0
- package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.ts +122 -0
- package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.ts +429 -0
- package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
- package/node_modules/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
- package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
- package/node_modules/pi-subagents/src/runs/shared/host-step-status.ts +231 -0
- package/node_modules/pi-subagents/src/runs/shared/lane-metadata.ts +105 -0
- package/node_modules/pi-subagents/src/runs/shared/launch-cwd.ts +16 -0
- package/node_modules/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +302 -0
- package/node_modules/pi-subagents/src/runs/shared/long-running-guard.ts +221 -0
- package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.ts +422 -0
- package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +483 -0
- package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +194 -0
- package/node_modules/pi-subagents/src/runs/shared/model-exclusions.ts +305 -0
- package/node_modules/pi-subagents/src/runs/shared/model-fallback.ts +578 -0
- package/node_modules/pi-subagents/src/runs/shared/model-scope.ts +205 -0
- package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.ts +199 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-events.ts +1086 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-path.ts +52 -0
- package/node_modules/pi-subagents/src/runs/shared/nested-render.ts +127 -0
- package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.ts +499 -0
- package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.ts +692 -0
- package/node_modules/pi-subagents/src/runs/shared/parallel-utils.ts +275 -0
- package/node_modules/pi-subagents/src/runs/shared/permissions.ts +99 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-args.ts +1056 -0
- package/node_modules/pi-subagents/src/runs/shared/pi-spawn.ts +197 -0
- package/node_modules/pi-subagents/src/runs/shared/process-signal.ts +32 -0
- package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.ts +280 -0
- package/node_modules/pi-subagents/src/runs/shared/run-history.ts +201 -0
- package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +71 -0
- package/node_modules/pi-subagents/src/runs/shared/session-lease.ts +293 -0
- package/node_modules/pi-subagents/src/runs/shared/single-output.ts +304 -0
- package/node_modules/pi-subagents/src/runs/shared/spawn-budget.ts +128 -0
- package/node_modules/pi-subagents/src/runs/shared/structured-output.ts +223 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-control.ts +290 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +824 -0
- package/node_modules/pi-subagents/src/runs/shared/subagent-startup-retry.ts +116 -0
- package/node_modules/pi-subagents/src/runs/shared/task-intent.ts +208 -0
- package/node_modules/pi-subagents/src/runs/shared/tool-availability.ts +81 -0
- package/node_modules/pi-subagents/src/runs/shared/tool-budget.ts +80 -0
- package/node_modules/pi-subagents/src/runs/shared/tool-timeout.ts +93 -0
- package/node_modules/pi-subagents/src/runs/shared/usage-budget.ts +65 -0
- package/node_modules/pi-subagents/src/runs/shared/workflow-graph.ts +225 -0
- package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +847 -0
- package/node_modules/pi-subagents/src/runs/shared/worktree.ts +802 -0
- package/node_modules/pi-subagents/src/shared/accessible-dir.ts +47 -0
- package/node_modules/pi-subagents/src/shared/agent-stream-options.ts +5 -0
- package/node_modules/pi-subagents/src/shared/artifacts.ts +281 -0
- package/node_modules/pi-subagents/src/shared/atomic-json.ts +83 -0
- package/node_modules/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
- package/node_modules/pi-subagents/src/shared/child-session-name.ts +46 -0
- package/node_modules/pi-subagents/src/shared/child-transcript.ts +264 -0
- package/node_modules/pi-subagents/src/shared/completion-owner.ts +14 -0
- package/node_modules/pi-subagents/src/shared/display-text.ts +150 -0
- package/node_modules/pi-subagents/src/shared/extension-context.ts +24 -0
- package/node_modules/pi-subagents/src/shared/file-coalescer.ts +49 -0
- package/node_modules/pi-subagents/src/shared/file-system-retry.ts +95 -0
- package/node_modules/pi-subagents/src/shared/fork-context.ts +293 -0
- package/node_modules/pi-subagents/src/shared/fork-session-cwd.ts +27 -0
- package/node_modules/pi-subagents/src/shared/formatters.ts +146 -0
- package/node_modules/pi-subagents/src/shared/jsonl-writer.ts +81 -0
- package/node_modules/pi-subagents/src/shared/launch-contract.ts +138 -0
- package/node_modules/pi-subagents/src/shared/model-info.ts +101 -0
- package/node_modules/pi-subagents/src/shared/node-executable.ts +21 -0
- package/node_modules/pi-subagents/src/shared/post-exit-stdio-guard.ts +85 -0
- package/node_modules/pi-subagents/src/shared/prompt-resources.ts +11 -0
- package/node_modules/pi-subagents/src/shared/pruned-fork.ts +450 -0
- package/node_modules/pi-subagents/src/shared/session-file-trust.ts +19 -0
- package/node_modules/pi-subagents/src/shared/session-identity.ts +10 -0
- package/node_modules/pi-subagents/src/shared/session-tokens.ts +55 -0
- package/node_modules/pi-subagents/src/shared/settings.ts +409 -0
- package/node_modules/pi-subagents/src/shared/shortcuts.ts +17 -0
- package/node_modules/pi-subagents/src/shared/status-format.ts +55 -0
- package/node_modules/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
- package/node_modules/pi-subagents/src/shared/types.ts +2836 -0
- package/node_modules/pi-subagents/src/shared/utf8.ts +11 -0
- package/node_modules/pi-subagents/src/shared/utils.ts +590 -0
- package/node_modules/pi-subagents/src/shared/watch-strategy.ts +10 -0
- package/node_modules/pi-subagents/src/shared/workflow-child-permit.ts +207 -0
- package/node_modules/pi-subagents/src/slash/delegation-adapters.ts +426 -0
- package/node_modules/pi-subagents/src/slash/delegation-json.ts +108 -0
- package/node_modules/pi-subagents/src/slash/delegation-request.ts +162 -0
- package/node_modules/pi-subagents/src/slash/prompt-template-bridge.ts +419 -0
- package/node_modules/pi-subagents/src/slash/prompt-workflows.ts +287 -0
- package/node_modules/pi-subagents/src/slash/selector.ts +147 -0
- package/node_modules/pi-subagents/src/slash/slash-bridge.ts +192 -0
- package/node_modules/pi-subagents/src/slash/slash-commands.ts +1336 -0
- package/node_modules/pi-subagents/src/slash/slash-live-state.ts +310 -0
- package/node_modules/pi-subagents/src/slash/subagents-admin.ts +437 -0
- package/node_modules/pi-subagents/src/tui/fleet-status.ts +905 -0
- package/node_modules/pi-subagents/src/tui/fleet-transcript.ts +536 -0
- package/node_modules/pi-subagents/src/tui/fleet.ts +1436 -0
- package/node_modules/pi-subagents/src/tui/render-helpers.ts +111 -0
- package/node_modules/pi-subagents/src/tui/render.ts +3146 -0
- package/node_modules/pi-subagents/src/types/pi-runtime-compat.d.ts +8 -0
- package/node_modules/pi-subagents/src/watchdog/change-signature.ts +260 -0
- package/node_modules/pi-subagents/src/watchdog/child-status.ts +205 -0
- package/node_modules/pi-subagents/src/watchdog/emission-guard.ts +123 -0
- package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.ts +538 -0
- package/node_modules/pi-subagents/src/watchdog/model-selection.ts +167 -0
- package/node_modules/pi-subagents/src/watchdog/permission-arbiter.ts +154 -0
- package/node_modules/pi-subagents/src/watchdog/register-child.ts +117 -0
- package/node_modules/pi-subagents/src/watchdog/register-main.ts +440 -0
- package/node_modules/pi-subagents/src/watchdog/render.ts +54 -0
- package/node_modules/pi-subagents/src/watchdog/review.ts +303 -0
- package/node_modules/pi-subagents/src/watchdog/runtime.ts +868 -0
- package/node_modules/pi-subagents/src/watchdog/scope.ts +62 -0
- package/node_modules/pi-subagents/src/watchdog/settings.ts +568 -0
- package/node_modules/pi-subagents/src/watchdog/tool-actions.ts +155 -0
- package/node_modules/pi-subagents/src/watchdog/turn-delta.ts +161 -0
- package/node_modules/pi-subagents/src/watchdog/types.ts +198 -0
- package/node_modules/pi-subagents/src/watchdog/warning-format.ts +73 -0
- package/node_modules/pi-subagents/src/workflows/chat-progress.ts +151 -0
- package/node_modules/pi-subagents/src/workflows/host-command.ts +235 -0
- package/node_modules/pi-subagents/src/workflows/scripted-workflow.ts +2183 -0
- package/node_modules/pi-subagents/src/workflows/workflow-child-summary.ts +121 -0
- package/node_modules/pi-subagents/src/workflows/workflow-preflight.ts +270 -0
- package/node_modules/pi-subagents/src/workflows/workflow-receipt.ts +366 -0
- package/node_modules/pi-subagents/src/workflows/workflow-resources.ts +150 -0
- package/node_modules/pi-subagents/src/workflows/workflow-settlement.ts +246 -0
- package/node_modules/typebox/build/compile/code.d.mts +12 -0
- package/node_modules/typebox/build/compile/code.mjs +65 -0
- package/node_modules/typebox/build/compile/compile.d.mts +6 -0
- package/node_modules/typebox/build/compile/compile.mjs +12 -0
- package/node_modules/typebox/build/compile/index.d.mts +8 -0
- package/node_modules/typebox/build/compile/index.mjs +14 -0
- package/node_modules/typebox/build/compile/validator.d.mts +43 -0
- package/node_modules/typebox/build/compile/validator.mjs +121 -0
- package/node_modules/typebox/build/error/errors.d.mts +214 -0
- package/node_modules/typebox/build/error/errors.mjs +18 -0
- package/node_modules/typebox/build/error/index.d.mts +1 -0
- package/node_modules/typebox/build/error/index.mjs +1 -0
- package/node_modules/typebox/build/format/_idna.d.mts +2 -0
- package/node_modules/typebox/build/format/_idna.mjs +216 -0
- package/node_modules/typebox/build/format/_puny.d.mts +1 -0
- package/node_modules/typebox/build/format/_puny.mjs +74 -0
- package/node_modules/typebox/build/format/_registry.d.mts +15 -0
- package/node_modules/typebox/build/format/_registry.mjs +96 -0
- package/node_modules/typebox/build/format/date.d.mts +6 -0
- package/node_modules/typebox/build/format/date.mjs +19 -0
- package/node_modules/typebox/build/format/date_time.d.mts +6 -0
- package/node_modules/typebox/build/format/date_time.mjs +11 -0
- package/node_modules/typebox/build/format/duration.d.mts +5 -0
- package/node_modules/typebox/build/format/duration.mjs +8 -0
- package/node_modules/typebox/build/format/email.d.mts +5 -0
- package/node_modules/typebox/build/format/email.mjs +8 -0
- package/node_modules/typebox/build/format/format.d.mts +22 -0
- package/node_modules/typebox/build/format/format.mjs +22 -0
- package/node_modules/typebox/build/format/hostname.d.mts +7 -0
- package/node_modules/typebox/build/format/hostname.mjs +18 -0
- package/node_modules/typebox/build/format/idn_email.d.mts +5 -0
- package/node_modules/typebox/build/format/idn_email.mjs +8 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +7 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +19 -0
- package/node_modules/typebox/build/format/index.d.mts +4 -0
- package/node_modules/typebox/build/format/index.mjs +4 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +6 -0
- package/node_modules/typebox/build/format/ipv4.mjs +38 -0
- package/node_modules/typebox/build/format/ipv6.d.mts +5 -0
- package/node_modules/typebox/build/format/ipv6.mjs +67 -0
- package/node_modules/typebox/build/format/iri.d.mts +5 -0
- package/node_modules/typebox/build/format/iri.mjs +13 -0
- package/node_modules/typebox/build/format/iri_reference.d.mts +5 -0
- package/node_modules/typebox/build/format/iri_reference.mjs +60 -0
- package/node_modules/typebox/build/format/json_pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/json_pointer.mjs +9 -0
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +6 -0
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +9 -0
- package/node_modules/typebox/build/format/regex.d.mts +6 -0
- package/node_modules/typebox/build/format/regex.mjs +17 -0
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +9 -0
- package/node_modules/typebox/build/format/time.d.mts +5 -0
- package/node_modules/typebox/build/format/time.mjs +27 -0
- package/node_modules/typebox/build/format/uri.d.mts +5 -0
- package/node_modules/typebox/build/format/uri.mjs +135 -0
- package/node_modules/typebox/build/format/uri_reference.d.mts +5 -0
- package/node_modules/typebox/build/format/uri_reference.mjs +9 -0
- package/node_modules/typebox/build/format/uri_template.d.mts +6 -0
- package/node_modules/typebox/build/format/uri_template.mjs +10 -0
- package/node_modules/typebox/build/format/url.d.mts +6 -0
- package/node_modules/typebox/build/format/url.mjs +9 -0
- package/node_modules/typebox/build/format/uuid.d.mts +6 -0
- package/node_modules/typebox/build/format/uuid.mjs +9 -0
- package/node_modules/typebox/build/guard/emit.d.mts +58 -0
- package/node_modules/typebox/build/guard/emit.mjs +194 -0
- package/node_modules/typebox/build/guard/globals.d.mts +35 -0
- package/node_modules/typebox/build/guard/globals.mjs +90 -0
- package/node_modules/typebox/build/guard/guard.d.mts +69 -0
- package/node_modules/typebox/build/guard/guard.mjs +217 -0
- package/node_modules/typebox/build/guard/index.d.mts +6 -0
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/native.d.mts +20 -0
- package/node_modules/typebox/build/guard/native.mjs +60 -0
- package/node_modules/typebox/build/guard/string.d.mts +6 -0
- package/node_modules/typebox/build/guard/string.mjs +164 -0
- package/node_modules/typebox/build/index.d.mts +8 -0
- package/node_modules/typebox/build/index.mjs +14 -0
- package/node_modules/typebox/build/schema/build.d.mts +39 -0
- package/node_modules/typebox/build/schema/build.mjs +118 -0
- package/node_modules/typebox/build/schema/check.d.mts +6 -0
- package/node_modules/typebox/build/schema/check.mjs +14 -0
- package/node_modules/typebox/build/schema/compile.d.mts +22 -0
- package/node_modules/typebox/build/schema/compile.mjs +46 -0
- package/node_modules/typebox/build/schema/engine/_context.d.mts +35 -0
- package/node_modules/typebox/build/schema/engine/_context.mjs +129 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.mjs +20 -0
- package/node_modules/typebox/build/schema/engine/_externals.d.mts +7 -0
- package/node_modules/typebox/build/schema/engine/_externals.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_functions.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_guard.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +4 -0
- package/node_modules/typebox/build/schema/engine/_reducer.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +18 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +107 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_unique.mjs +5 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +50 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +110 -0
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/allOf.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +52 -0
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/node_modules/typebox/build/schema/engine/boolean.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/const.mjs +30 -0
- package/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/contains.mjs +42 -0
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +40 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +38 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/enum.mjs +33 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/format.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/if.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/index.d.mts +49 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +55 -0
- package/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +68 -0
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +42 -0
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minContains.mjs +41 -0
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/not.mjs +37 -0
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +58 -0
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/pattern.mjs +28 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +44 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +35 -0
- package/node_modules/typebox/build/schema/engine/properties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/properties.mjs +75 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +39 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/ref.mjs +58 -0
- package/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/required.mjs +32 -0
- package/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/schema.mjs +352 -0
- package/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/type.mjs +74 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +51 -0
- package/node_modules/typebox/build/schema/errors.d.mts +6 -0
- package/node_modules/typebox/build/schema/errors.mjs +24 -0
- package/node_modules/typebox/build/schema/index.d.mts +3 -0
- package/node_modules/typebox/build/schema/index.mjs +9 -0
- package/node_modules/typebox/build/schema/parse.d.mts +13 -0
- package/node_modules/typebox/build/schema/parse.mjs +27 -0
- package/node_modules/typebox/build/schema/pointer/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/pointer/index.mjs +2 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +10 -0
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +106 -0
- package/node_modules/typebox/build/schema/pointer/pointer_get.d.mts +9 -0
- package/node_modules/typebox/build/schema/pointer/pointer_get.mjs +2 -0
- package/node_modules/typebox/build/schema/resolve/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/resolve/index.mjs +1 -0
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +3 -0
- package/node_modules/typebox/build/schema/resolve/ref.mjs +146 -0
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +1 -0
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +1 -0
- package/node_modules/typebox/build/schema/schema.d.mts +10 -0
- package/node_modules/typebox/build/schema/schema.mjs +10 -0
- package/node_modules/typebox/build/schema/static/_canonical.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/_canonical.mjs +2 -0
- package/node_modules/typebox/build/schema/static/_comparer.d.mts +6 -0
- package/node_modules/typebox/build/schema/static/_comparer.mjs +2 -0
- package/node_modules/typebox/build/schema/static/_elements.d.mts +18 -0
- package/node_modules/typebox/build/schema/static/_elements.mjs +2 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/static/allOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/allOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/anyOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/anyOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/const.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/const.mjs +2 -0
- package/node_modules/typebox/build/schema/static/enum.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/enum.mjs +2 -0
- package/node_modules/typebox/build/schema/static/if.d.mts +15 -0
- package/node_modules/typebox/build/schema/static/if.mjs +2 -0
- package/node_modules/typebox/build/schema/static/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/index.mjs +1 -0
- package/node_modules/typebox/build/schema/static/items.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/items.mjs +2 -0
- package/node_modules/typebox/build/schema/static/oneOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/oneOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/patternProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/patternProperties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/prefixItems.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/prefixItems.mjs +2 -0
- package/node_modules/typebox/build/schema/static/properties.d.mts +32 -0
- package/node_modules/typebox/build/schema/static/properties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/ref.d.mts +8 -0
- package/node_modules/typebox/build/schema/static/ref.mjs +3 -0
- package/node_modules/typebox/build/schema/static/required.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/required.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +56 -0
- package/node_modules/typebox/build/schema/static/schema.mjs +2 -0
- package/node_modules/typebox/build/schema/static/static.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/static.mjs +3 -0
- package/node_modules/typebox/build/schema/static/type.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/type.mjs +3 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/types/_guard.d.mts +10 -0
- package/node_modules/typebox/build/schema/types/_guard.mjs +16 -0
- package/node_modules/typebox/build/schema/types/_refine.d.mts +13 -0
- package/node_modules/typebox/build/schema/types/_refine.mjs +18 -0
- package/node_modules/typebox/build/schema/types/additionalItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/allOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/allOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/anchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/anchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/anyOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/anyOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/const.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/const.mjs +12 -0
- package/node_modules/typebox/build/schema/types/contains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contains.mjs +14 -0
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +13 -0
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +13 -0
- package/node_modules/typebox/build/schema/types/default.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/default.mjs +12 -0
- package/node_modules/typebox/build/schema/types/defs.d.mts +6 -0
- package/node_modules/typebox/build/schema/types/defs.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dependencies.d.mts +11 -0
- package/node_modules/typebox/build/schema/types/dependencies.mjs +16 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/else.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/else.mjs +14 -0
- package/node_modules/typebox/build/schema/types/enum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/enum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/format.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/format.mjs +13 -0
- package/node_modules/typebox/build/schema/types/id.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/id.mjs +13 -0
- package/node_modules/typebox/build/schema/types/if.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/if.mjs +14 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +54 -0
- package/node_modules/typebox/build/schema/types/index.mjs +60 -0
- package/node_modules/typebox/build/schema/types/items.d.mts +19 -0
- package/node_modules/typebox/build/schema/types/items.mjs +26 -0
- package/node_modules/typebox/build/schema/types/maxContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/multipleOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/multipleOf.mjs +13 -0
- package/node_modules/typebox/build/schema/types/not.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/not.mjs +14 -0
- package/node_modules/typebox/build/schema/types/oneOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/oneOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/pattern.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/pattern.mjs +14 -0
- package/node_modules/typebox/build/schema/types/patternProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/patternProperties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/prefixItems.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/prefixItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/properties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/properties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/propertyNames.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/propertyNames.mjs +15 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +19 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/ref.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/ref.mjs +13 -0
- package/node_modules/typebox/build/schema/types/required.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/required.mjs +14 -0
- package/node_modules/typebox/build/schema/types/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/schema.mjs +14 -0
- package/node_modules/typebox/build/schema/types/then.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/then.mjs +14 -0
- package/node_modules/typebox/build/schema/types/type.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/type.mjs +15 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.mjs +13 -0
- package/node_modules/typebox/build/system/arguments/arguments.d.mts +5 -0
- package/node_modules/typebox/build/system/arguments/arguments.mjs +9 -0
- package/node_modules/typebox/build/system/arguments/index.d.mts +1 -0
- package/node_modules/typebox/build/system/arguments/index.mjs +1 -0
- package/node_modules/typebox/build/system/environment/environment.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/environment.mjs +1 -0
- package/node_modules/typebox/build/system/environment/evaluate.d.mts +9 -0
- package/node_modules/typebox/build/system/environment/evaluate.mjs +37 -0
- package/node_modules/typebox/build/system/environment/index.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/index.mjs +1 -0
- package/node_modules/typebox/build/system/hashing/hash.d.mts +4 -0
- package/node_modules/typebox/build/system/hashing/hash.mjs +232 -0
- package/node_modules/typebox/build/system/hashing/index.d.mts +1 -0
- package/node_modules/typebox/build/system/hashing/index.mjs +1 -0
- package/node_modules/typebox/build/system/index.d.mts +4 -0
- package/node_modules/typebox/build/system/index.mjs +4 -0
- package/node_modules/typebox/build/system/locale/_config.d.mts +7 -0
- package/node_modules/typebox/build/system/locale/_config.mjs +15 -0
- package/node_modules/typebox/build/system/locale/_locale.d.mts +40 -0
- package/node_modules/typebox/build/system/locale/_locale.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ar_001.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ar_001.mjs +41 -0
- package/node_modules/typebox/build/system/locale/bn_BD.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +41 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +41 -0
- package/node_modules/typebox/build/system/locale/de_DE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/de_DE.mjs +41 -0
- package/node_modules/typebox/build/system/locale/el_GR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/el_GR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/en_US.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/en_US.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_419.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_419.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_AR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_AR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_ES.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_ES.mjs +41 -0
- package/node_modules/typebox/build/system/locale/es_MX.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_MX.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fa_IR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fil_PH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fr_CA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +41 -0
- package/node_modules/typebox/build/system/locale/fr_FR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ha_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +41 -0
- package/node_modules/typebox/build/system/locale/hi_IN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +41 -0
- package/node_modules/typebox/build/system/locale/hu_HU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +41 -0
- package/node_modules/typebox/build/system/locale/id_ID.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/id_ID.mjs +41 -0
- package/node_modules/typebox/build/system/locale/index.d.mts +1 -0
- package/node_modules/typebox/build/system/locale/index.mjs +1 -0
- package/node_modules/typebox/build/system/locale/it_IT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/it_IT.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ja_JP.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ko_KR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ms_MY.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +41 -0
- package/node_modules/typebox/build/system/locale/nl_NL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pl_PL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pt_BR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/pt_PT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ro_RO.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ru_RU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +41 -0
- package/node_modules/typebox/build/system/locale/sv_SE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +41 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +41 -0
- package/node_modules/typebox/build/system/locale/th_TH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/th_TH.mjs +41 -0
- package/node_modules/typebox/build/system/locale/tr_TR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +41 -0
- package/node_modules/typebox/build/system/locale/uk_UA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +41 -0
- package/node_modules/typebox/build/system/locale/ur_PK.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +41 -0
- package/node_modules/typebox/build/system/locale/vi_VN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +41 -0
- package/node_modules/typebox/build/system/locale/yo_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +41 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +41 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +41 -0
- package/node_modules/typebox/build/system/memory/assign.d.mts +14 -0
- package/node_modules/typebox/build/system/memory/assign.mjs +11 -0
- package/node_modules/typebox/build/system/memory/clone.d.mts +6 -0
- package/node_modules/typebox/build/system/memory/clone.mjs +63 -0
- package/node_modules/typebox/build/system/memory/create.d.mts +8 -0
- package/node_modules/typebox/build/system/memory/create.mjs +30 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/discard.mjs +17 -0
- package/node_modules/typebox/build/system/memory/index.d.mts +1 -0
- package/node_modules/typebox/build/system/memory/index.mjs +1 -0
- package/node_modules/typebox/build/system/memory/memory.d.mts +6 -0
- package/node_modules/typebox/build/system/memory/memory.mjs +7 -0
- package/node_modules/typebox/build/system/memory/metrics.d.mts +14 -0
- package/node_modules/typebox/build/system/memory/metrics.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +7 -0
- package/node_modules/typebox/build/system/memory/update.mjs +32 -0
- package/node_modules/typebox/build/system/settings/index.d.mts +1 -0
- package/node_modules/typebox/build/system/settings/index.mjs +1 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +56 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +32 -0
- package/node_modules/typebox/build/system/system.d.mts +6 -0
- package/node_modules/typebox/build/system/system.mjs +6 -0
- package/node_modules/typebox/build/system/unreachable/index.d.mts +1 -0
- package/node_modules/typebox/build/system/unreachable/index.mjs +1 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.d.mts +3 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.mjs +6 -0
- package/node_modules/typebox/build/type/action/_optional.d.mts +19 -0
- package/node_modules/typebox/build/type/action/_optional.mjs +40 -0
- package/node_modules/typebox/build/type/action/_readonly.d.mts +19 -0
- package/node_modules/typebox/build/type/action/_readonly.mjs +40 -0
- package/node_modules/typebox/build/type/action/awaited.d.mts +15 -0
- package/node_modules/typebox/build/type/action/awaited.mjs +15 -0
- package/node_modules/typebox/build/type/action/capitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/capitalize.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +13 -0
- package/node_modules/typebox/build/type/action/conditional.mjs +12 -0
- package/node_modules/typebox/build/type/action/constructor_parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/constructor_parameters.mjs +11 -0
- package/node_modules/typebox/build/type/action/evaluate.d.mts +11 -0
- package/node_modules/typebox/build/type/action/evaluate.mjs +11 -0
- package/node_modules/typebox/build/type/action/exclude.d.mts +11 -0
- package/node_modules/typebox/build/type/action/exclude.mjs +11 -0
- package/node_modules/typebox/build/type/action/extract.d.mts +11 -0
- package/node_modules/typebox/build/type/action/extract.mjs +11 -0
- package/node_modules/typebox/build/type/action/index.d.mts +27 -0
- package/node_modules/typebox/build/type/action/index.mjs +27 -0
- package/node_modules/typebox/build/type/action/indexed.d.mts +14 -0
- package/node_modules/typebox/build/type/action/indexed.mjs +14 -0
- package/node_modules/typebox/build/type/action/instance_type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/instance_type.mjs +11 -0
- package/node_modules/typebox/build/type/action/interface.d.mts +14 -0
- package/node_modules/typebox/build/type/action/interface.mjs +22 -0
- package/node_modules/typebox/build/type/action/keyof.d.mts +11 -0
- package/node_modules/typebox/build/type/action/keyof.mjs +11 -0
- package/node_modules/typebox/build/type/action/lowercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/lowercase.mjs +11 -0
- package/node_modules/typebox/build/type/action/mapped.d.mts +14 -0
- package/node_modules/typebox/build/type/action/mapped.mjs +12 -0
- package/node_modules/typebox/build/type/action/module.d.mts +12 -0
- package/node_modules/typebox/build/type/action/module.mjs +12 -0
- package/node_modules/typebox/build/type/action/non_nullable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/non_nullable.mjs +11 -0
- package/node_modules/typebox/build/type/action/omit.d.mts +14 -0
- package/node_modules/typebox/build/type/action/omit.mjs +14 -0
- package/node_modules/typebox/build/type/action/options.d.mts +11 -0
- package/node_modules/typebox/build/type/action/options.mjs +11 -0
- package/node_modules/typebox/build/type/action/parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/parameters.mjs +11 -0
- package/node_modules/typebox/build/type/action/partial.d.mts +11 -0
- package/node_modules/typebox/build/type/action/partial.mjs +11 -0
- package/node_modules/typebox/build/type/action/pick.d.mts +14 -0
- package/node_modules/typebox/build/type/action/pick.mjs +14 -0
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +16 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +16 -0
- package/node_modules/typebox/build/type/action/required.d.mts +11 -0
- package/node_modules/typebox/build/type/action/required.mjs +11 -0
- package/node_modules/typebox/build/type/action/return_type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/return_type.mjs +11 -0
- package/node_modules/typebox/build/type/action/uncapitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uncapitalize.mjs +11 -0
- package/node_modules/typebox/build/type/action/uppercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uppercase.mjs +11 -0
- package/node_modules/typebox/build/type/engine/awaited/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/awaited/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +20 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +53 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +23 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +48 -0
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +33 -0
- package/node_modules/typebox/build/type/engine/call/resolve_target.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/call/resolve_target.mjs +27 -0
- package/node_modules/typebox/build/type/engine/conditional/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/conditional/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +23 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +24 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +19 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +51 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +53 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +31 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +53 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +30 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.mjs +16 -0
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +24 -0
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +2 -0
- package/node_modules/typebox/build/type/engine/enum/index.mjs +2 -0
- package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs +9 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +47 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +22 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +63 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +27 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +45 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +27 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +11 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +12 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +11 -0
- package/node_modules/typebox/build/type/engine/exclude/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/exclude/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +24 -0
- package/node_modules/typebox/build/type/engine/extract/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/extract/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +24 -0
- package/node_modules/typebox/build/type/engine/helpers/index.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/index.mjs +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.mjs +8 -0
- package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs +15 -0
- package/node_modules/typebox/build/type/engine/helpers/union.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/union.mjs +3 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +31 -0
- package/node_modules/typebox/build/type/engine/index.mjs +37 -0
- package/node_modules/typebox/build/type/engine/indexable/from_cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_literal.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/indexable/from_literal.mjs +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +22 -0
- package/node_modules/typebox/build/type/engine/indexable/from_union.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/indexable/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs +14 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs +12 -0
- package/node_modules/typebox/build/type/engine/indexed/array_indexer.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs +18 -0
- package/node_modules/typebox/build/type/engine/indexed/from_array.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/indexed/from_array.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/from_object.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/indexed/from_object.mjs +40 -0
- package/node_modules/typebox/build/type/engine/indexed/from_tuple.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/from_type.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/indexed/from_type.mjs +14 -0
- package/node_modules/typebox/build/type/engine/indexed/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/indexed/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +25 -0
- package/node_modules/typebox/build/type/engine/instance_type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/instance_type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/instance_type/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs +21 -0
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +165 -0
- package/node_modules/typebox/build/type/engine/instantiate.mjs +159 -0
- package/node_modules/typebox/build/type/engine/interface/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/interface/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +18 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.mjs +23 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_type.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs +13 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_union.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +38 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +52 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_any.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/keyof/from_any.mjs +8 -0
- package/node_modules/typebox/build/type/engine/keyof/from_array.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_array.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_object.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/keyof/from_object.mjs +20 -0
- package/node_modules/typebox/build/type/engine/keyof/from_record.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_record.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/keyof/from_type.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/keyof/from_type.mjs +23 -0
- package/node_modules/typebox/build/type/engine/keyof/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/keyof/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +25 -0
- package/node_modules/typebox/build/type/engine/mapped/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/mapped/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +22 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +42 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +34 -0
- package/node_modules/typebox/build/type/engine/module/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/module/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +21 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +34 -0
- package/node_modules/typebox/build/type/engine/non_nullable/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/non_nullable/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/non_nullable/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/collapse.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/collapse.mjs +14 -0
- package/node_modules/typebox/build/type/engine/object/from_cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from_cyclic.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/from_object.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/object/from_object.mjs +4 -0
- package/node_modules/typebox/build/type/engine/object/from_tuple.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from_tuple.mjs +9 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +19 -0
- package/node_modules/typebox/build/type/engine/object/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/object/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/from_type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/omit/from_type.mjs +18 -0
- package/node_modules/typebox/build/type/engine/omit/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/omit/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/options/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/options/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/options/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +24 -0
- package/node_modules/typebox/build/type/engine/partial/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +17 -0
- package/node_modules/typebox/build/type/engine/partial/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/partial/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/partial/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/patterns/index.d.mts +2 -0
- package/node_modules/typebox/build/type/engine/patterns/index.mjs +2 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.mjs +11 -0
- package/node_modules/typebox/build/type/engine/patterns/template.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/patterns/template.mjs +20 -0
- package/node_modules/typebox/build/type/engine/pick/from_type.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/pick/from_type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/pick/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/pick/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +22 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/readonly_object/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/readonly_object/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/record/from_key.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/record/from_key.mjs +40 -0
- package/node_modules/typebox/build/type/engine/record/from_key_any.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/record/from_key_any.mjs +6 -0
- package/node_modules/typebox/build/type/engine/record/from_key_boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_integer.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_integer.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_literal.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/record/from_key_literal.mjs +10 -0
- package/node_modules/typebox/build/type/engine/record/from_key_number.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_number.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_string.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_string.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from_key_union.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/record/from_key_union.mjs +39 -0
- package/node_modules/typebox/build/type/engine/record/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/record/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.mjs +17 -0
- package/node_modules/typebox/build/type/engine/record/record_create.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/record/record_create.mjs +7 -0
- package/node_modules/typebox/build/type/engine/ref/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/ref/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +10 -0
- package/node_modules/typebox/build/type/engine/required/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/required/from_cyclic.mjs +11 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +7 -0
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +17 -0
- package/node_modules/typebox/build/type/engine/required/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/required/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/required/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/rest/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/rest/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/rest/spread.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/rest/spread.mjs +19 -0
- package/node_modules/typebox/build/type/engine/return_type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/return_type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/return_type/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/return_type/instantiate.mjs +21 -0
- package/node_modules/typebox/build/type/engine/template_literal/create.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/template_literal/create.mjs +5 -0
- package/node_modules/typebox/build/type/engine/template_literal/decode.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +81 -0
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +33 -0
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +81 -0
- package/node_modules/typebox/build/type/engine/template_literal/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +26 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +9 -0
- package/node_modules/typebox/build/type/engine/template_literal/static.d.mts +18 -0
- package/node_modules/typebox/build/type/engine/template_literal/static.mjs +2 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +19 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +32 -0
- package/node_modules/typebox/build/type/engine/tuple/to_object.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/tuple/to_object.mjs +14 -0
- package/node_modules/typebox/build/type/extends/any.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/any.mjs +12 -0
- package/node_modules/typebox/build/type/extends/array.d.mts +20 -0
- package/node_modules/typebox/build/type/extends/array.mjs +21 -0
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +9 -0
- package/node_modules/typebox/build/type/extends/bigint.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/bigint.mjs +9 -0
- package/node_modules/typebox/build/type/extends/boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/boolean.mjs +9 -0
- package/node_modules/typebox/build/type/extends/constructor.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/constructor.mjs +17 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/enum.mjs +6 -0
- package/node_modules/typebox/build/type/extends/extends.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/extends.mjs +17 -0
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +55 -0
- package/node_modules/typebox/build/type/extends/extends_left.mjs +83 -0
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/extends_right.mjs +44 -0
- package/node_modules/typebox/build/type/extends/function.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/function.mjs +17 -0
- package/node_modules/typebox/build/type/extends/index.d.mts +2 -0
- package/node_modules/typebox/build/type/extends/index.mjs +2 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +34 -0
- package/node_modules/typebox/build/type/extends/inference.mjs +62 -0
- package/node_modules/typebox/build/type/extends/integer.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/integer.mjs +10 -0
- package/node_modules/typebox/build/type/extends/intersect.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/intersect.mjs +15 -0
- package/node_modules/typebox/build/type/extends/iterator.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/iterator.mjs +9 -0
- package/node_modules/typebox/build/type/extends/literal.d.mts +18 -0
- package/node_modules/typebox/build/type/extends/literal.mjs +44 -0
- package/node_modules/typebox/build/type/extends/never.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/never.mjs +9 -0
- package/node_modules/typebox/build/type/extends/null.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/null.mjs +9 -0
- package/node_modules/typebox/build/type/extends/number.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/number.mjs +9 -0
- package/node_modules/typebox/build/type/extends/object.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/object.mjs +87 -0
- package/node_modules/typebox/build/type/extends/parameters.d.mts +15 -0
- package/node_modules/typebox/build/type/extends/parameters.mjs +28 -0
- package/node_modules/typebox/build/type/extends/promise.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/promise.mjs +9 -0
- package/node_modules/typebox/build/type/extends/result.d.mts +24 -0
- package/node_modules/typebox/build/type/extends/result.mjs +36 -0
- package/node_modules/typebox/build/type/extends/return_type.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/return_type.mjs +9 -0
- package/node_modules/typebox/build/type/extends/string.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/string.mjs +9 -0
- package/node_modules/typebox/build/type/extends/symbol.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/symbol.mjs +9 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/template_literal.mjs +7 -0
- package/node_modules/typebox/build/type/extends/tuple.d.mts +25 -0
- package/node_modules/typebox/build/type/extends/tuple.mjs +60 -0
- package/node_modules/typebox/build/type/extends/undefined.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/undefined.mjs +10 -0
- package/node_modules/typebox/build/type/extends/union.d.mts +11 -0
- package/node_modules/typebox/build/type/extends/union.mjs +24 -0
- package/node_modules/typebox/build/type/extends/unknown.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/unknown.mjs +12 -0
- package/node_modules/typebox/build/type/extends/void.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/void.mjs +9 -0
- package/node_modules/typebox/build/type/index.d.mts +5 -0
- package/node_modules/typebox/build/type/index.mjs +5 -0
- package/node_modules/typebox/build/type/script/index.d.mts +1 -0
- package/node_modules/typebox/build/type/script/index.mjs +1 -0
- package/node_modules/typebox/build/type/script/mapping.d.mts +365 -0
- package/node_modules/typebox/build/type/script/mapping.mjs +532 -0
- package/node_modules/typebox/build/type/script/parser.d.mts +260 -0
- package/node_modules/typebox/build/type/script/parser.mjs +135 -0
- package/node_modules/typebox/build/type/script/script.d.mts +17 -0
- package/node_modules/typebox/build/type/script/script.mjs +21 -0
- package/node_modules/typebox/build/type/script/token/bigint.d.mts +8 -0
- package/node_modules/typebox/build/type/script/token/bigint.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/const.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/const.mjs +18 -0
- package/node_modules/typebox/build/type/script/token/ident.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/ident.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/index.d.mts +12 -0
- package/node_modules/typebox/build/type/script/token/index.mjs +12 -0
- package/node_modules/typebox/build/type/script/token/integer.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/integer.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/internal/char.d.mts +75 -0
- package/node_modules/typebox/build/type/script/token/internal/char.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +15 -0
- package/node_modules/typebox/build/type/script/token/internal/many.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/internal/many.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/internal/match.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/match.mjs +11 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/internal/take.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +30 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.d.mts +19 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.mjs +34 -0
- package/node_modules/typebox/build/type/script/token/number.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/number.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/rest.d.mts +4 -0
- package/node_modules/typebox/build/type/script/token/rest.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/span.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/span.mjs +24 -0
- package/node_modules/typebox/build/type/script/token/string.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/string.mjs +20 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.mjs +38 -0
- package/node_modules/typebox/build/type/script/token/until.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/until.mjs +21 -0
- package/node_modules/typebox/build/type/script/token/until_1.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/until_1.mjs +12 -0
- package/node_modules/typebox/build/type/types/_codec.d.mts +30 -0
- package/node_modules/typebox/build/type/types/_codec.mjs +61 -0
- package/node_modules/typebox/build/type/types/_immutable.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_immutable.mjs +26 -0
- package/node_modules/typebox/build/type/types/_optional.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_optional.mjs +27 -0
- package/node_modules/typebox/build/type/types/_readonly.d.mts +16 -0
- package/node_modules/typebox/build/type/types/_readonly.mjs +26 -0
- package/node_modules/typebox/build/type/types/_refine.d.mts +26 -0
- package/node_modules/typebox/build/type/types/_refine.mjs +37 -0
- package/node_modules/typebox/build/type/types/any.d.mts +10 -0
- package/node_modules/typebox/build/type/types/any.mjs +18 -0
- package/node_modules/typebox/build/type/types/array.d.mts +18 -0
- package/node_modules/typebox/build/type/types/array.mjs +25 -0
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +20 -0
- package/node_modules/typebox/build/type/types/async_iterator.mjs +28 -0
- package/node_modules/typebox/build/type/types/base.d.mts +50 -0
- package/node_modules/typebox/build/type/types/base.mjs +84 -0
- package/node_modules/typebox/build/type/types/bigint.d.mts +12 -0
- package/node_modules/typebox/build/type/types/bigint.mjs +21 -0
- package/node_modules/typebox/build/type/types/boolean.d.mts +11 -0
- package/node_modules/typebox/build/type/types/boolean.mjs +17 -0
- package/node_modules/typebox/build/type/types/call.d.mts +16 -0
- package/node_modules/typebox/build/type/types/call.mjs +22 -0
- package/node_modules/typebox/build/type/types/constructor.d.mts +18 -0
- package/node_modules/typebox/build/type/types/constructor.mjs +24 -0
- package/node_modules/typebox/build/type/types/cyclic.d.mts +16 -0
- package/node_modules/typebox/build/type/types/cyclic.mjs +29 -0
- package/node_modules/typebox/build/type/types/deferred.d.mts +12 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +16 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +16 -0
- package/node_modules/typebox/build/type/types/enum.mjs +17 -0
- package/node_modules/typebox/build/type/types/function.d.mts +21 -0
- package/node_modules/typebox/build/type/types/function.mjs +25 -0
- package/node_modules/typebox/build/type/types/generic.d.mts +13 -0
- package/node_modules/typebox/build/type/types/generic.mjs +17 -0
- package/node_modules/typebox/build/type/types/identifier.d.mts +11 -0
- package/node_modules/typebox/build/type/types/identifier.mjs +17 -0
- package/node_modules/typebox/build/type/types/index.d.mts +48 -0
- package/node_modules/typebox/build/type/types/index.mjs +54 -0
- package/node_modules/typebox/build/type/types/infer.d.mts +15 -0
- package/node_modules/typebox/build/type/types/infer.mjs +20 -0
- package/node_modules/typebox/build/type/types/integer.d.mts +12 -0
- package/node_modules/typebox/build/type/types/integer.mjs +21 -0
- package/node_modules/typebox/build/type/types/intersect.d.mts +15 -0
- package/node_modules/typebox/build/type/types/intersect.mjs +24 -0
- package/node_modules/typebox/build/type/types/iterator.d.mts +20 -0
- package/node_modules/typebox/build/type/types/iterator.mjs +28 -0
- package/node_modules/typebox/build/type/types/literal.d.mts +31 -0
- package/node_modules/typebox/build/type/types/literal.mjs +62 -0
- package/node_modules/typebox/build/type/types/never.d.mts +12 -0
- package/node_modules/typebox/build/type/types/never.mjs +22 -0
- package/node_modules/typebox/build/type/types/null.d.mts +11 -0
- package/node_modules/typebox/build/type/types/null.mjs +17 -0
- package/node_modules/typebox/build/type/types/number.d.mts +12 -0
- package/node_modules/typebox/build/type/types/number.mjs +21 -0
- package/node_modules/typebox/build/type/types/object.d.mts +18 -0
- package/node_modules/typebox/build/type/types/object.mjs +28 -0
- package/node_modules/typebox/build/type/types/parameter.d.mts +17 -0
- package/node_modules/typebox/build/type/types/parameter.mjs +21 -0
- package/node_modules/typebox/build/type/types/promise.d.mts +21 -0
- package/node_modules/typebox/build/type/types/promise.mjs +29 -0
- package/node_modules/typebox/build/type/types/properties.d.mts +43 -0
- package/node_modules/typebox/build/type/types/properties.mjs +15 -0
- package/node_modules/typebox/build/type/types/record.d.mts +46 -0
- package/node_modules/typebox/build/type/types/record.mjs +60 -0
- package/node_modules/typebox/build/type/types/ref.d.mts +19 -0
- package/node_modules/typebox/build/type/types/ref.mjs +18 -0
- package/node_modules/typebox/build/type/types/rest.d.mts +11 -0
- package/node_modules/typebox/build/type/types/rest.mjs +17 -0
- package/node_modules/typebox/build/type/types/schema.d.mts +176 -0
- package/node_modules/typebox/build/type/types/schema.mjs +15 -0
- package/node_modules/typebox/build/type/types/static.d.mts +48 -0
- package/node_modules/typebox/build/type/types/static.mjs +3 -0
- package/node_modules/typebox/build/type/types/string.d.mts +12 -0
- package/node_modules/typebox/build/type/types/string.mjs +22 -0
- package/node_modules/typebox/build/type/types/symbol.d.mts +11 -0
- package/node_modules/typebox/build/type/types/symbol.mjs +17 -0
- package/node_modules/typebox/build/type/types/template_literal.d.mts +28 -0
- package/node_modules/typebox/build/type/types/template_literal.mjs +37 -0
- package/node_modules/typebox/build/type/types/this.d.mts +14 -0
- package/node_modules/typebox/build/type/types/this.mjs +17 -0
- package/node_modules/typebox/build/type/types/tuple.d.mts +38 -0
- package/node_modules/typebox/build/type/types/tuple.mjs +25 -0
- package/node_modules/typebox/build/type/types/undefined.d.mts +11 -0
- package/node_modules/typebox/build/type/types/undefined.mjs +17 -0
- package/node_modules/typebox/build/type/types/union.d.mts +15 -0
- package/node_modules/typebox/build/type/types/union.mjs +24 -0
- package/node_modules/typebox/build/type/types/unknown.d.mts +10 -0
- package/node_modules/typebox/build/type/types/unknown.mjs +17 -0
- package/node_modules/typebox/build/type/types/unsafe.d.mts +10 -0
- package/node_modules/typebox/build/type/types/unsafe.mjs +20 -0
- package/node_modules/typebox/build/type/types/void.d.mts +11 -0
- package/node_modules/typebox/build/type/types/void.mjs +17 -0
- package/node_modules/typebox/build/typebox.d.mts +73 -0
- package/node_modules/typebox/build/typebox.mjs +89 -0
- package/node_modules/typebox/build/value/assert/assert.d.mts +14 -0
- package/node_modules/typebox/build/value/assert/assert.mjs +28 -0
- package/node_modules/typebox/build/value/assert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/assert/index.mjs +1 -0
- package/node_modules/typebox/build/value/check/check.d.mts +5 -0
- package/node_modules/typebox/build/value/check/check.mjs +11 -0
- package/node_modules/typebox/build/value/check/index.d.mts +1 -0
- package/node_modules/typebox/build/value/check/index.mjs +1 -0
- package/node_modules/typebox/build/value/clean/additional.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/additional.mjs +6 -0
- package/node_modules/typebox/build/value/clean/clean.d.mts +15 -0
- package/node_modules/typebox/build/value/clean/clean.mjs +15 -0
- package/node_modules/typebox/build/value/clean/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_array.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from_base.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_base.mjs +4 -0
- package/node_modules/typebox/build/value/clean/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/clean/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +26 -0
- package/node_modules/typebox/build/value/clean/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_object.mjs +31 -0
- package/node_modules/typebox/build/value/clean/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_record.mjs +32 -0
- package/node_modules/typebox/build/value/clean/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_ref.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_tuple.mjs +14 -0
- package/node_modules/typebox/build/value/clean/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_type.mjs +23 -0
- package/node_modules/typebox/build/value/clean/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_union.mjs +13 -0
- package/node_modules/typebox/build/value/clean/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clean/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +5 -0
- package/node_modules/typebox/build/value/clone/clone.mjs +83 -0
- package/node_modules/typebox/build/value/clone/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clone/index.mjs +1 -0
- package/node_modules/typebox/build/value/codec/callback.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/callback.mjs +25 -0
- package/node_modules/typebox/build/value/codec/decode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/decode.mjs +50 -0
- package/node_modules/typebox/build/value/codec/encode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/encode.mjs +50 -0
- package/node_modules/typebox/build/value/codec/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_array.mjs +38 -0
- package/node_modules/typebox/build/value/codec/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_cyclic.mjs +8 -0
- package/node_modules/typebox/build/value/codec/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_intersect.mjs +58 -0
- package/node_modules/typebox/build/value/codec/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_object.mjs +45 -0
- package/node_modules/typebox/build/value/codec/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_record.mjs +44 -0
- package/node_modules/typebox/build/value/codec/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_ref.mjs +31 -0
- package/node_modules/typebox/build/value/codec/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +35 -0
- package/node_modules/typebox/build/value/codec/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_type.mjs +22 -0
- package/node_modules/typebox/build/value/codec/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_union.mjs +40 -0
- package/node_modules/typebox/build/value/codec/has.d.mts +5 -0
- package/node_modules/typebox/build/value/codec/has.mjs +93 -0
- package/node_modules/typebox/build/value/codec/index.d.mts +3 -0
- package/node_modules/typebox/build/value/codec/index.mjs +3 -0
- package/node_modules/typebox/build/value/convert/convert.d.mts +13 -0
- package/node_modules/typebox/build/value/convert/convert.mjs +15 -0
- package/node_modules/typebox/build/value/convert/from_additional.d.mts +6 -0
- package/node_modules/typebox/build/value/convert/from_additional.mjs +18 -0
- package/node_modules/typebox/build/value/convert/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_array.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from_base.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_base.mjs +4 -0
- package/node_modules/typebox/build/value/convert/from_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_bigint.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_boolean.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_enum.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from_integer.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_integer.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_literal.mjs +44 -0
- package/node_modules/typebox/build/value/convert/from_null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_null.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_number.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_object.mjs +28 -0
- package/node_modules/typebox/build/value/convert/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_record.mjs +23 -0
- package/node_modules/typebox/build/value/convert/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_ref.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from_string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_string.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_tuple.mjs +11 -0
- package/node_modules/typebox/build/value/convert/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_type.mjs +45 -0
- package/node_modules/typebox/build/value/convert/from_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_undefined.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_union.mjs +13 -0
- package/node_modules/typebox/build/value/convert/from_void.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_void.mjs +6 -0
- package/node_modules/typebox/build/value/convert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/try/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/try.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try.mjs +8 -0
- package/node_modules/typebox/build/value/convert/try/try_array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_array.mjs +6 -0
- package/node_modules/typebox/build/value/convert/try/try_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_bigint.mjs +45 -0
- package/node_modules/typebox/build/value/convert/try/try_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_boolean.mjs +41 -0
- package/node_modules/typebox/build/value/convert/try/try_null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_null.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try_number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_number.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try_result.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try_result.mjs +17 -0
- package/node_modules/typebox/build/value/convert/try/try_string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_string.mjs +12 -0
- package/node_modules/typebox/build/value/convert/try/try_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_undefined.mjs +44 -0
- package/node_modules/typebox/build/value/create/create.d.mts +5 -0
- package/node_modules/typebox/build/value/create/create.mjs +11 -0
- package/node_modules/typebox/build/value/create/error.d.mts +5 -0
- package/node_modules/typebox/build/value/create/error.mjs +7 -0
- package/node_modules/typebox/build/value/create/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_array.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_base.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_base.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_bigint.mjs +7 -0
- package/node_modules/typebox/build/value/create/from_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_boolean.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_constructor.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_constructor.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_default.d.mts +3 -0
- package/node_modules/typebox/build/value/create/from_default.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_enum.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_function.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_function.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_integer.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_integer.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_iterator.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_literal.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_never.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_never.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_null.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_null.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_number.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_number.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_object.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_promise.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_promise.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_record.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_string.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_string.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_symbol.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_symbol.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_template_literal.mjs +11 -0
- package/node_modules/typebox/build/value/create/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_tuple.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_type.mjs +69 -0
- package/node_modules/typebox/build/value/create/from_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_undefined.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_union.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_void.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_void.mjs +4 -0
- package/node_modules/typebox/build/value/create/index.d.mts +2 -0
- package/node_modules/typebox/build/value/create/index.mjs +2 -0
- package/node_modules/typebox/build/value/default/default.d.mts +13 -0
- package/node_modules/typebox/build/value/default/default.mjs +15 -0
- package/node_modules/typebox/build/value/default/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_array.mjs +12 -0
- package/node_modules/typebox/build/value/default/from_base.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_base.mjs +5 -0
- package/node_modules/typebox/build/value/default/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_cyclic.mjs +7 -0
- package/node_modules/typebox/build/value/default/from_default.d.mts +3 -0
- package/node_modules/typebox/build/value/default/from_default.mjs +13 -0
- package/node_modules/typebox/build/value/default/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_intersect.mjs +9 -0
- package/node_modules/typebox/build/value/default/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_object.mjs +32 -0
- package/node_modules/typebox/build/value/default/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_record.mjs +26 -0
- package/node_modules/typebox/build/value/default/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/default/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_tuple.mjs +14 -0
- package/node_modules/typebox/build/value/default/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_type.mjs +27 -0
- package/node_modules/typebox/build/value/default/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_union.mjs +14 -0
- package/node_modules/typebox/build/value/default/index.d.mts +1 -0
- package/node_modules/typebox/build/value/default/index.mjs +1 -0
- package/node_modules/typebox/build/value/delta/diff.d.mts +10 -0
- package/node_modules/typebox/build/value/delta/diff.mjs +135 -0
- package/node_modules/typebox/build/value/delta/edit.d.mts +24 -0
- package/node_modules/typebox/build/value/delta/edit.mjs +17 -0
- package/node_modules/typebox/build/value/delta/index.d.mts +3 -0
- package/node_modules/typebox/build/value/delta/index.mjs +3 -0
- package/node_modules/typebox/build/value/delta/patch.d.mts +8 -0
- package/node_modules/typebox/build/value/delta/patch.mjs +42 -0
- package/node_modules/typebox/build/value/equal/equal.d.mts +2 -0
- package/node_modules/typebox/build/value/equal/equal.mjs +6 -0
- package/node_modules/typebox/build/value/equal/index.d.mts +1 -0
- package/node_modules/typebox/build/value/equal/index.mjs +1 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +16 -0
- package/node_modules/typebox/build/value/errors/errors.mjs +17 -0
- package/node_modules/typebox/build/value/errors/index.d.mts +1 -0
- package/node_modules/typebox/build/value/errors/index.mjs +1 -0
- package/node_modules/typebox/build/value/hash/hash.d.mts +6 -0
- package/node_modules/typebox/build/value/hash/hash.mjs +10 -0
- package/node_modules/typebox/build/value/hash/index.d.mts +1 -0
- package/node_modules/typebox/build/value/hash/index.mjs +1 -0
- package/node_modules/typebox/build/value/index.d.mts +21 -0
- package/node_modules/typebox/build/value/index.mjs +30 -0
- package/node_modules/typebox/build/value/mutate/error.d.mts +3 -0
- package/node_modules/typebox/build/value/mutate/error.mjs +6 -0
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from_array.mjs +16 -0
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from_object.mjs +40 -0
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +7 -0
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +2 -0
- package/node_modules/typebox/build/value/mutate/from_value.mjs +12 -0
- package/node_modules/typebox/build/value/mutate/index.d.mts +1 -0
- package/node_modules/typebox/build/value/mutate/index.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +11 -0
- package/node_modules/typebox/build/value/mutate/mutate.mjs +41 -0
- package/node_modules/typebox/build/value/parse/index.d.mts +1 -0
- package/node_modules/typebox/build/value/parse/index.mjs +1 -0
- package/node_modules/typebox/build/value/parse/parse.d.mts +11 -0
- package/node_modules/typebox/build/value/parse/parse.mjs +47 -0
- package/node_modules/typebox/build/value/pipeline/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pipeline/index.mjs +1 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.d.mts +10 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.mjs +15 -0
- package/node_modules/typebox/build/value/pointer/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pointer/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/error.d.mts +7 -0
- package/node_modules/typebox/build/value/repair/error.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_array.mjs +39 -0
- package/node_modules/typebox/build/value/repair/from_base.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_base.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_enum.mjs +7 -0
- package/node_modules/typebox/build/value/repair/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_object.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_record.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/repair/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_template_literal.mjs +7 -0
- package/node_modules/typebox/build/value/repair/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_tuple.mjs +12 -0
- package/node_modules/typebox/build/value/repair/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_type.mjs +86 -0
- package/node_modules/typebox/build/value/repair/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_union.mjs +24 -0
- package/node_modules/typebox/build/value/repair/from_unknown.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_unknown.mjs +12 -0
- package/node_modules/typebox/build/value/repair/index.d.mts +1 -0
- package/node_modules/typebox/build/value/repair/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/repair.d.mts +17 -0
- package/node_modules/typebox/build/value/repair/repair.mjs +20 -0
- package/node_modules/typebox/build/value/shared/index.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/index.mjs +4 -0
- package/node_modules/typebox/build/value/shared/optional_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/shared/optional_undefined.mjs +15 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +36 -0
- package/node_modules/typebox/build/value/shared/union_score_select.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/union_score_select.mjs +51 -0
- package/node_modules/typebox/build/value/value.d.mts +16 -0
- package/node_modules/typebox/build/value/value.mjs +16 -0
- package/node_modules/typebox/license +23 -0
- package/node_modules/typebox/package.json +87 -0
- package/node_modules/typebox/readme.md +356 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +217 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +114 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +967 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +222 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +43 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +719 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +972 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +60 -0
- package/src/adapters/index.ts +13 -0
- package/src/adapters/pi-subagents/agents.ts +136 -0
- package/src/adapters/pi-subagents/autocomplete.ts +46 -0
- package/src/adapters/pi-subagents/index.ts +48 -0
- package/src/adapters/types.ts +25 -0
- package/src/commands/delegation.ts +32 -0
- package/src/commands/doctor.ts +36 -0
- package/test/agent-palette.test.ts +215 -0
- package/test/wiring.test.ts +15 -0
|
@@ -0,0 +1,3146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering functions for subagent results
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
8
|
+
import { getMarkdownTheme, keyText, type ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import { Container, Markdown, Spacer, Text, visibleWidth, type Component } from "@earendil-works/pi-tui";
|
|
10
|
+
import {
|
|
11
|
+
type AgentProgress,
|
|
12
|
+
type AsyncJobState,
|
|
13
|
+
type AsyncJobStep,
|
|
14
|
+
type AsyncParallelGroupStatus,
|
|
15
|
+
type Details,
|
|
16
|
+
type HostStepState,
|
|
17
|
+
type HostStepVerdict,
|
|
18
|
+
type NestedRunSummary,
|
|
19
|
+
type NestedStepSummary,
|
|
20
|
+
type WorkflowGraphNode,
|
|
21
|
+
type WorkflowNodeStatus,
|
|
22
|
+
type MainWindowRendererConfig,
|
|
23
|
+
MAX_WIDGET_JOBS,
|
|
24
|
+
WIDGET_ANIMATION_INTERVAL_MS,
|
|
25
|
+
WIDGET_KEY,
|
|
26
|
+
} from "../shared/types.ts";
|
|
27
|
+
import { previewDisplayText, sanitizeDisplayText, truncateDisplayText } from "../shared/display-text.ts";
|
|
28
|
+
import { FLEET_OPEN_SHORTCUT, formatShortcutLabel } from "../shared/shortcuts.ts";
|
|
29
|
+
import { formatContextUsage, formatTokens, formatUsage, formatDuration, formatModelThinking, formatToolCall, formatTokenUsage, shortenPath } from "../shared/formatters.ts";
|
|
30
|
+
import { getDisplayItems, getSingleResultOutput, PROMPT_REDACTED } from "../shared/utils.ts";
|
|
31
|
+
import { flatToLogicalStepIndex } from "../runs/background/parallel-groups.ts";
|
|
32
|
+
import { formatNestedAggregate } from "../runs/shared/nested-render.ts";
|
|
33
|
+
import { aggregateStepStatus, formatActivityLabel, formatAgentRunningLabel, formatParallelOutcome } from "../shared/status-format.ts";
|
|
34
|
+
import { contextModeBadge, contextModePrefix } from "../runs/shared/context-mode.ts";
|
|
35
|
+
import { shouldSuppressSingleStep, stripRepeatedAgentPrefix, withDuplicateLabelDiscriminators } from "./render-helpers.ts";
|
|
36
|
+
import { buildWorkflowChatProgressRows, type WorkflowChatProgressRow } from "../workflows/chat-progress.ts";
|
|
37
|
+
import { formatWorkflowPreflight, formatWorkflowPreflightPlanSummary, formatWorkflowPreflightWarningSummary, formatWorkflowPreflightWarnings } from "../workflows/workflow-preflight.ts";
|
|
38
|
+
import { encodeAsyncStatusSnapshotWidget } from "../runs/background/async-status-snapshot.ts";
|
|
39
|
+
import { projectAsyncWorkflowRows, type AsyncStatusWorkflowRow } from "../runs/shared/async-status-projection.ts";
|
|
40
|
+
import { hostStepReportName, hostStepVerdictLabel } from "../runs/shared/host-step-status.ts";
|
|
41
|
+
import { workflowGraphStageNodes } from "../runs/shared/workflow-graph.ts";
|
|
42
|
+
|
|
43
|
+
type Theme = ExtensionContext["ui"]["theme"];
|
|
44
|
+
|
|
45
|
+
interface WorkflowWidgetProjection {
|
|
46
|
+
stages: WorkflowGraphNode[];
|
|
47
|
+
steps: AsyncJobStep[];
|
|
48
|
+
stageProgress?: { total: number; current?: number };
|
|
49
|
+
plannedKeys?: Set<string>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type WorkflowWidgetProjectionLookup = (job: AsyncJobState) => WorkflowWidgetProjection;
|
|
53
|
+
|
|
54
|
+
interface MainWindowRenderLayout {
|
|
55
|
+
horizontalSpacing: number;
|
|
56
|
+
compactResultMaxLines?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function resolveMainWindowRenderLayout(config?: MainWindowRendererConfig): MainWindowRenderLayout {
|
|
60
|
+
return {
|
|
61
|
+
horizontalSpacing: config?.horizontalSpacing ?? 2,
|
|
62
|
+
...(config?.compactResultMaxLines !== undefined ? { compactResultMaxLines: config.compactResultMaxLines } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function mainWindowIndent(layout: MainWindowRenderLayout, level: number): string {
|
|
67
|
+
return " ".repeat(Math.max(0, layout.horizontalSpacing * level));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function capCompactMainWindowResult(component: Component, layout: MainWindowRenderLayout, theme: Theme, enabled: boolean): Component {
|
|
71
|
+
const maxLines = layout.compactResultMaxLines;
|
|
72
|
+
if (!enabled || maxLines === undefined) return component;
|
|
73
|
+
const capped = new Container();
|
|
74
|
+
capped.render = (width: number): string[] => {
|
|
75
|
+
const lines = component.render(width);
|
|
76
|
+
if (lines.length <= maxLines) return lines;
|
|
77
|
+
const visibleRows = maxLines === 1 ? 1 : maxLines - 1;
|
|
78
|
+
const hiddenCount = lines.length - visibleRows;
|
|
79
|
+
const hint = theme.fg("accent", `… ${hiddenCount} rows hidden · ${liveDetailKeyText()} expands`);
|
|
80
|
+
if (maxLines === 1) return [truncLine(`${lines[0] ?? ""} ${hint}`, width)];
|
|
81
|
+
return [...lines.slice(0, visibleRows), truncLine(hint, width)];
|
|
82
|
+
};
|
|
83
|
+
return capped;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function liveDetailKeyText(): string {
|
|
87
|
+
return keyText("app.tools.expand");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function liveDetailHintText(): string {
|
|
91
|
+
return `Press ${liveDetailKeyText()} for live detail · ${formatShortcutLabel(FLEET_OPEN_SHORTCUT)} Fleet`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function foregroundSingleHintText(shortcut?: string): string {
|
|
95
|
+
if (!shortcut) return liveDetailHintText();
|
|
96
|
+
const label = formatShortcutLabel(shortcut);
|
|
97
|
+
return `${liveDetailHintText()} · ${label} to run in background`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getTermWidth(): number {
|
|
101
|
+
return process.stdout.columns || 120;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
105
|
+
const ansiStylePattern = /\x1b\[[0-9;]*m/y;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Truncate a line to maxWidth, preserving ANSI styling through the ellipsis.
|
|
109
|
+
*
|
|
110
|
+
* pi-tui's truncateToWidth adds \x1b[0m before ellipsis which resets all styling,
|
|
111
|
+
* causing background color bleed in the TUI. This implementation tracks active
|
|
112
|
+
* ANSI styles and re-applies them before the ellipsis.
|
|
113
|
+
*
|
|
114
|
+
* Uses Intl.Segmenter for proper Unicode/emoji handling (not char-by-char).
|
|
115
|
+
*/
|
|
116
|
+
export function truncLine(text: string, maxWidth: number): string {
|
|
117
|
+
if (maxWidth <= 0) return "";
|
|
118
|
+
if (visibleWidth(text) <= maxWidth) return text;
|
|
119
|
+
|
|
120
|
+
const targetWidth = maxWidth - 1;
|
|
121
|
+
let result = "";
|
|
122
|
+
let currentWidth = 0;
|
|
123
|
+
let activeStyles: string[] = [];
|
|
124
|
+
let i = 0;
|
|
125
|
+
|
|
126
|
+
while (i < text.length) {
|
|
127
|
+
ansiStylePattern.lastIndex = i;
|
|
128
|
+
const ansiMatch = ansiStylePattern.exec(text);
|
|
129
|
+
if (ansiMatch) {
|
|
130
|
+
const code = ansiMatch[0];
|
|
131
|
+
result += code;
|
|
132
|
+
|
|
133
|
+
if (code === "\x1b[0m" || code === "\x1b[m") {
|
|
134
|
+
activeStyles = [];
|
|
135
|
+
} else {
|
|
136
|
+
activeStyles.push(code);
|
|
137
|
+
}
|
|
138
|
+
i += code.length;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let end = text.indexOf("\x1b[", i);
|
|
143
|
+
if (end === i) end = text.indexOf("\x1b[", i + 2);
|
|
144
|
+
if (end === -1) end = text.length;
|
|
145
|
+
const textPortion = text.slice(i, end);
|
|
146
|
+
for (const seg of segmenter.segment(textPortion)) {
|
|
147
|
+
const grapheme = seg.segment;
|
|
148
|
+
const graphemeWidth = grapheme === "\x1b" ? 0 : visibleWidth(grapheme);
|
|
149
|
+
|
|
150
|
+
if (currentWidth + graphemeWidth > targetWidth) {
|
|
151
|
+
return result + activeStyles.join("") + "…";
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
result += grapheme;
|
|
155
|
+
currentWidth += graphemeWidth;
|
|
156
|
+
}
|
|
157
|
+
i = end;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return result + activeStyles.join("") + "…";
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function wrapPlainText(text: string, maxWidth: number): string[] {
|
|
164
|
+
if (maxWidth <= 0) return [""];
|
|
165
|
+
const lines: string[] = [];
|
|
166
|
+
for (const rawLine of text.split("\n")) {
|
|
167
|
+
if (rawLine.length === 0) {
|
|
168
|
+
lines.push("");
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
let current = "";
|
|
172
|
+
let currentWidth = 0;
|
|
173
|
+
for (const seg of segmenter.segment(rawLine)) {
|
|
174
|
+
const grapheme = seg.segment;
|
|
175
|
+
const graphemeWidth = visibleWidth(grapheme);
|
|
176
|
+
if (graphemeWidth > maxWidth) continue;
|
|
177
|
+
if (currentWidth > 0 && currentWidth + graphemeWidth > maxWidth) {
|
|
178
|
+
lines.push(current);
|
|
179
|
+
current = grapheme;
|
|
180
|
+
currentWidth = graphemeWidth;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
current += grapheme;
|
|
184
|
+
currentWidth += graphemeWidth;
|
|
185
|
+
}
|
|
186
|
+
lines.push(current);
|
|
187
|
+
}
|
|
188
|
+
return lines;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const RUNNING_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
192
|
+
const STATIC_RUNNING_GLYPH = "●";
|
|
193
|
+
|
|
194
|
+
type ProgressSeedSource = Partial<Pick<AgentProgress, "index" | "toolCount" | "tokens" | "durationMs" | "lastActivityAt" | "currentToolStartedAt" | "turnCount">>;
|
|
195
|
+
|
|
196
|
+
function runningSeed(...values: Array<number | undefined>): number | undefined {
|
|
197
|
+
let seed: number | undefined;
|
|
198
|
+
for (const value of values) {
|
|
199
|
+
if (value === undefined || !Number.isFinite(value)) continue;
|
|
200
|
+
seed = (seed ?? 0) + Math.trunc(value);
|
|
201
|
+
}
|
|
202
|
+
return seed;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function runningGlyph(seed?: number): string {
|
|
206
|
+
if (seed === undefined) return STATIC_RUNNING_GLYPH;
|
|
207
|
+
return RUNNING_FRAMES[Math.abs(seed) % RUNNING_FRAMES.length]!;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function animatedSeed(seed: number | undefined, frame: number | undefined): number | undefined {
|
|
211
|
+
if (frame === undefined) return seed;
|
|
212
|
+
return (seed ?? 0) + frame;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function progressRunningSeed(progress: ProgressSeedSource | undefined): number | undefined {
|
|
216
|
+
if (!progress) return undefined;
|
|
217
|
+
return runningSeed(
|
|
218
|
+
progress.index,
|
|
219
|
+
progress.toolCount,
|
|
220
|
+
progress.tokens,
|
|
221
|
+
progress.durationMs,
|
|
222
|
+
progress.lastActivityAt,
|
|
223
|
+
progress.currentToolStartedAt,
|
|
224
|
+
progress.turnCount,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
interface LegacyResultAnimationContext {
|
|
229
|
+
state: { subagentResultAnimationTimer?: ReturnType<typeof setInterval> };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function clearLegacyResultAnimationTimer(context: LegacyResultAnimationContext): void {
|
|
233
|
+
const timer = context.state.subagentResultAnimationTimer;
|
|
234
|
+
if (!timer) return;
|
|
235
|
+
clearInterval(timer);
|
|
236
|
+
context.state.subagentResultAnimationTimer = undefined;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function extractOutputTarget(task: string): string | undefined {
|
|
240
|
+
const writeToMatch = task.match(/\[Write to:\s*([^\]\n]+)\]/i);
|
|
241
|
+
if (writeToMatch?.[1]?.trim()) return writeToMatch[1].trim();
|
|
242
|
+
const findingsMatch = task.match(/Write your findings to(?: exactly this path)?:\s*([^\r\n]+)/i);
|
|
243
|
+
if (findingsMatch?.[1]?.trim()) return findingsMatch[1].trim();
|
|
244
|
+
const outputMatch = task.match(/[Oo]utput(?:\s+to)?\s*:\s*(\S+)/i);
|
|
245
|
+
if (outputMatch?.[1]?.trim()) return outputMatch[1].trim();
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function hasEmptyTextOutputWithoutOutputTarget(task: string, output: string): boolean {
|
|
250
|
+
if (output.trim()) return false;
|
|
251
|
+
return !extractOutputTarget(task);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function getToolCallLines(
|
|
255
|
+
result: Pick<Details["results"][number], "messages" | "toolCalls">,
|
|
256
|
+
expanded: boolean,
|
|
257
|
+
): string[] {
|
|
258
|
+
if (result.messages) {
|
|
259
|
+
return getDisplayItems(result.messages)
|
|
260
|
+
.filter((item): item is { type: "tool"; name: string; args: Record<string, unknown> } => item.type === "tool")
|
|
261
|
+
.map((item) => formatToolCall(item.name, item.args, expanded));
|
|
262
|
+
}
|
|
263
|
+
return result.toolCalls?.map((toolCall) => expanded ? toolCall.expandedText : toolCall.text) ?? [];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const ansiEscapePattern = /\x1b\[[0-9;]*m/g;
|
|
267
|
+
const noisyStatusPatterns = [
|
|
268
|
+
/^(?:i|we)\s+(?:will|need|can|should|am|are)\b/i,
|
|
269
|
+
/^i(?:'m|’m| am)\b/i,
|
|
270
|
+
/\bso i (?:will|need|can)\b/i,
|
|
271
|
+
/^(?:checking|fetching|reading|inspecting|verifying|collecting|confirming|polling)\b/i,
|
|
272
|
+
/^(?:async\s+subagent\s+)?[\w.-]+\s*·\s*(?:step|agent)\s+\d+\/\d+\s*·/i,
|
|
273
|
+
/^(?:Step|Agent)\s+\d+\/\d+:\s+[\w.-]+\s*·\s*(?:running|queued|pending|complete|completed)\b/i,
|
|
274
|
+
/^(?:async\s+subagent\s+)?[\w.-]+(?:\s+\[(?:fresh|fork|mixed)\])?\s*·\s*(?:running|queued|pending|complete|completed|done)\b/i,
|
|
275
|
+
/^Press\s+\S+\s+for\s+live\s+detail$/i,
|
|
276
|
+
/^output:\s+.+\/async-subagent-runs\//i,
|
|
277
|
+
];
|
|
278
|
+
const liveOutputWordSignalPattern = /\b(?:access denied|denied|error|exception|fail(?:ed|ure)?|fatal|panic|rejected|timeout|timed out|unable|warning)\b/i;
|
|
279
|
+
const liveOutputCodeSignalPattern = /\bE[A-Z0-9_]{2,}\b/;
|
|
280
|
+
|
|
281
|
+
function oneLine(text: string): string {
|
|
282
|
+
return text.replace(ansiEscapePattern, "").replace(/\s+/g, " ").trim();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const COMPACT_TASK_MAX_CHARS = 96;
|
|
286
|
+
|
|
287
|
+
/** Display label for a child run: the derived session name (agent + task
|
|
288
|
+
* excerpt) when the launcher provided one, else the bare agent name. */
|
|
289
|
+
function childDisplayName(result: { agent?: string; sessionName?: string } | undefined, fallback = "subagent"): string {
|
|
290
|
+
return result?.sessionName?.trim() || result?.agent || fallback;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function compactTaskText(task: string | undefined, label?: string): string | undefined {
|
|
294
|
+
const taskText = task?.trim();
|
|
295
|
+
const labelText = label?.trim();
|
|
296
|
+
const normalizedTask = taskText && taskText !== PROMPT_REDACTED ? oneLine(taskText) : "";
|
|
297
|
+
const normalizedLabel = labelText && labelText !== PROMPT_REDACTED ? oneLine(labelText) : "";
|
|
298
|
+
const normalized = normalizedLabel && normalizedTask && normalizedLabel !== normalizedTask
|
|
299
|
+
? `${normalizedLabel} — ${normalizedTask}`
|
|
300
|
+
: normalizedLabel || normalizedTask;
|
|
301
|
+
if (!normalized) return undefined;
|
|
302
|
+
return previewDisplayText(normalized, COMPACT_TASK_MAX_CHARS);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface AsyncLaneProjection {
|
|
306
|
+
label?: string;
|
|
307
|
+
role: string;
|
|
308
|
+
phase?: string;
|
|
309
|
+
state: AsyncJobState["status"] | AsyncJobStep["status"];
|
|
310
|
+
gate?: string;
|
|
311
|
+
next?: string;
|
|
312
|
+
output?: string;
|
|
313
|
+
workspace?: string;
|
|
314
|
+
ref: string;
|
|
315
|
+
chips: string[];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const LANE_VALUE_MAX_CHARS = 48;
|
|
319
|
+
|
|
320
|
+
function boundedLaneValue(value: string | undefined, maxChars = LANE_VALUE_MAX_CHARS): string | undefined {
|
|
321
|
+
if (!value?.trim() || value.trim() === PROMPT_REDACTED) return undefined;
|
|
322
|
+
return previewDisplayText(oneLine(value), maxChars);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function workflowNodeStepStatus(status: WorkflowNodeStatus): AsyncJobStep["status"] {
|
|
326
|
+
switch (status) {
|
|
327
|
+
case "completed":
|
|
328
|
+
return "completed";
|
|
329
|
+
case "detached":
|
|
330
|
+
return "paused";
|
|
331
|
+
default:
|
|
332
|
+
return status;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function workflowNodeStatusLabel(status: WorkflowNodeStatus): string {
|
|
337
|
+
switch (status) {
|
|
338
|
+
case "completed":
|
|
339
|
+
return "complete";
|
|
340
|
+
case "detached":
|
|
341
|
+
return "paused";
|
|
342
|
+
default:
|
|
343
|
+
return status;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function workflowStepPriority(step: AsyncJobStep, currentNodeId?: string): number {
|
|
348
|
+
const isCurrent = step.workflowKey === currentNodeId;
|
|
349
|
+
if (step.status === "running" || (isCurrent && step.status !== "complete" && step.status !== "completed")) return 0;
|
|
350
|
+
const gate = laneGate(step);
|
|
351
|
+
if (
|
|
352
|
+
step.status === "failed"
|
|
353
|
+
|| step.status === "partial"
|
|
354
|
+
|| step.status === "paused"
|
|
355
|
+
|| step.status === "stopped"
|
|
356
|
+
|| step.status === "rejected"
|
|
357
|
+
|| step.toolBudgetBlocked === true
|
|
358
|
+
|| step.turnBudgetExceeded === true
|
|
359
|
+
|| step.activityState === "needs_attention"
|
|
360
|
+
|| step.watchdog?.phase === "stale"
|
|
361
|
+
|| gate !== undefined
|
|
362
|
+
) return 1;
|
|
363
|
+
if (step.status === "pending") return 2;
|
|
364
|
+
return 3;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** Merge materialized child rows with the planned workflow stages for rendering. */
|
|
368
|
+
function workflowWidgetSteps(job: AsyncJobState, planned = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []): AsyncJobStep[] {
|
|
369
|
+
const loaded = job.steps ?? [];
|
|
370
|
+
if (planned.length === 0) return loaded;
|
|
371
|
+
|
|
372
|
+
const loadedIndexesByKey = new Map<string, number[]>();
|
|
373
|
+
for (const [index, step] of loaded.entries()) {
|
|
374
|
+
if (!step.workflowKey) continue;
|
|
375
|
+
const indexes = loadedIndexesByKey.get(step.workflowKey) ?? [];
|
|
376
|
+
indexes.push(index);
|
|
377
|
+
loadedIndexesByKey.set(step.workflowKey, indexes);
|
|
378
|
+
}
|
|
379
|
+
const consumed = new Set<number>();
|
|
380
|
+
const entries: Array<{ step: AsyncJobStep; order: number }> = [];
|
|
381
|
+
for (const [order, node] of planned.entries()) {
|
|
382
|
+
const loadedIndex = loadedIndexesByKey.get(node.id)?.find((index) => !consumed.has(index));
|
|
383
|
+
if (loadedIndex !== undefined) {
|
|
384
|
+
consumed.add(loadedIndex);
|
|
385
|
+
const loadedStep = loaded[loadedIndex]!;
|
|
386
|
+
entries.push({
|
|
387
|
+
step: {
|
|
388
|
+
...loadedStep,
|
|
389
|
+
index: node.flatIndex ?? loadedStep.index ?? order,
|
|
390
|
+
agent: loadedStep.agent || node.agent || job.agents?.[0] || "workflow",
|
|
391
|
+
phase: loadedStep.phase ?? node.phase,
|
|
392
|
+
label: loadedStep.label ?? node.label,
|
|
393
|
+
workflowKey: loadedStep.workflowKey ?? node.id,
|
|
394
|
+
...(loadedStep.outputName === undefined && node.outputName !== undefined ? { outputName: node.outputName } : {}),
|
|
395
|
+
...(loadedStep.structured === undefined && node.structured !== undefined ? { structured: node.structured } : {}),
|
|
396
|
+
...(loadedStep.error === undefined && node.error !== undefined ? { error: node.error } : {}),
|
|
397
|
+
},
|
|
398
|
+
order,
|
|
399
|
+
});
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
entries.push({
|
|
403
|
+
step: {
|
|
404
|
+
index: node.flatIndex ?? order,
|
|
405
|
+
agent: node.agent ?? job.agents?.[0] ?? "workflow",
|
|
406
|
+
status: workflowNodeStepStatus(node.status),
|
|
407
|
+
workflowKey: node.id,
|
|
408
|
+
label: node.label,
|
|
409
|
+
...(node.phase ? { phase: node.phase } : {}),
|
|
410
|
+
...(node.outputName ? { outputName: node.outputName } : {}),
|
|
411
|
+
...(node.structured !== undefined ? { structured: node.structured } : {}),
|
|
412
|
+
...(node.error ? { error: node.error } : {}),
|
|
413
|
+
},
|
|
414
|
+
order,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
for (const [index, step] of loaded.entries()) {
|
|
418
|
+
if (!consumed.has(index)) entries.push({ step, order: planned.length + index });
|
|
419
|
+
}
|
|
420
|
+
entries.sort((left, right) => workflowStepPriority(left.step, job.workflowGraph?.currentNodeId) - workflowStepPriority(right.step, job.workflowGraph?.currentNodeId) || left.order - right.order);
|
|
421
|
+
return entries.map(({ step }) => step);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function workflowStageProgress(job: AsyncJobState, stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []): { total: number; current?: number } | undefined {
|
|
425
|
+
if (job.mode !== "workflow") return undefined;
|
|
426
|
+
if (stages.length === 0) return undefined;
|
|
427
|
+
const currentId = job.workflowGraph?.currentNodeId;
|
|
428
|
+
const currentIndex = currentId ? stages.findIndex((stage) => stage.id === currentId) : -1;
|
|
429
|
+
if (currentIndex >= 0 && stages[currentIndex]?.status !== "completed") return { total: stages.length, current: currentIndex };
|
|
430
|
+
const runningIndex = stages.findIndex((stage) => stage.status === "running");
|
|
431
|
+
if (runningIndex >= 0) return { total: stages.length, current: runningIndex };
|
|
432
|
+
const indexedStage = job.currentStep !== undefined && job.currentStep >= 0 ? stages[job.currentStep] : undefined;
|
|
433
|
+
if (indexedStage && indexedStage.status !== "completed") return { total: stages.length, current: job.currentStep };
|
|
434
|
+
if (stages.every((stage) => stage.status === "completed")) return { total: stages.length, current: stages.length - 1 };
|
|
435
|
+
return { total: stages.length };
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function buildWorkflowWidgetProjection(job: AsyncJobState): WorkflowWidgetProjection {
|
|
439
|
+
const stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : [];
|
|
440
|
+
const stageProgress = workflowStageProgress(job, stages);
|
|
441
|
+
const steps = workflowWidgetSteps(job, stages);
|
|
442
|
+
const projection: WorkflowWidgetProjection = { stages, steps };
|
|
443
|
+
if (stageProgress) projection.stageProgress = stageProgress;
|
|
444
|
+
if (stages.length) projection.plannedKeys = new Set(stages.map((node) => node.id));
|
|
445
|
+
return projection;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function workflowWidgetProjectionLookup(): WorkflowWidgetProjectionLookup {
|
|
449
|
+
const projections = new WeakMap<AsyncJobState, WorkflowWidgetProjection>();
|
|
450
|
+
return (job: AsyncJobState) => {
|
|
451
|
+
const cached = projections.get(job);
|
|
452
|
+
if (cached) return cached;
|
|
453
|
+
const projection = buildWorkflowWidgetProjection(job);
|
|
454
|
+
projections.set(job, projection);
|
|
455
|
+
return projection;
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function laneStepForJob(job: AsyncJobState, steps = workflowWidgetSteps(job)): AsyncJobStep | undefined {
|
|
460
|
+
if (steps.length === 0) return undefined;
|
|
461
|
+
const graphCurrent = job.workflowGraph?.currentNodeId;
|
|
462
|
+
if (graphCurrent) {
|
|
463
|
+
const current = steps.find((step) => step.workflowKey === graphCurrent);
|
|
464
|
+
if (current) return current;
|
|
465
|
+
}
|
|
466
|
+
if (job.currentStep !== undefined) {
|
|
467
|
+
const current = steps[job.currentStep];
|
|
468
|
+
if (current && (current.index === undefined || current.index === job.currentStep)) return current;
|
|
469
|
+
// Active parallel groups retain flat indices while exposing only the group slice.
|
|
470
|
+
const indexedCurrent = steps.find((step) => step.index === job.currentStep);
|
|
471
|
+
if (indexedCurrent) return indexedCurrent;
|
|
472
|
+
return steps[0];
|
|
473
|
+
}
|
|
474
|
+
return steps.find((step) => step.status === "running")
|
|
475
|
+
?? steps.find((step) => step.status === "pending")
|
|
476
|
+
?? steps.at(-1);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function laneTraceForJob(job: AsyncJobState): NonNullable<AsyncJobState["workflow"]>["trace"][number] | undefined {
|
|
480
|
+
return Array.isArray(job.workflow?.trace) ? job.workflow.trace.at(-1) : undefined;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function laneGate(step: AsyncJobStep | undefined): string | undefined {
|
|
484
|
+
const review = step?.review?.status ?? step?.acceptance?.reviewResult?.status;
|
|
485
|
+
if (review === "blockers") return "review blockers";
|
|
486
|
+
if (review === "review-required") return "review required";
|
|
487
|
+
if (review === "reviewed") return "reviewed";
|
|
488
|
+
const acceptance = step?.acceptance?.status;
|
|
489
|
+
if (acceptance === "review-required") return "acceptance review";
|
|
490
|
+
if (acceptance === "checked" || acceptance === "verified" || acceptance === "accepted") return "acceptance";
|
|
491
|
+
return undefined;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function laneNextAction(state: AsyncLaneProjection["state"], step: AsyncJobStep | undefined, output: string | undefined, gate: string | undefined): string | undefined {
|
|
495
|
+
if (step?.watchdog?.phase === "stale") return "inspect stale state";
|
|
496
|
+
if (step?.toolBudgetBlocked === true || step?.turnBudgetExceeded === true) return "inspect blocked state";
|
|
497
|
+
if (gate === "review blockers") return "resolve review blockers";
|
|
498
|
+
if (gate === "review required" || gate === "acceptance review") return "review output";
|
|
499
|
+
if (step?.activityState === "needs_attention") return "inspect attention";
|
|
500
|
+
if (state === "queued" || state === "pending") return "await launch";
|
|
501
|
+
if (state === "failed" || state === "rejected") return "inspect failure";
|
|
502
|
+
if (state === "partial") return "inspect partial state";
|
|
503
|
+
if (state === "paused") return "inspect paused state";
|
|
504
|
+
if (state === "stopped") return "inspect stopped state";
|
|
505
|
+
if ((state === "complete" || state === "completed") && gate === "reviewed") return "ready";
|
|
506
|
+
if ((state === "complete" || state === "completed") && output) return "inspect output";
|
|
507
|
+
return undefined;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function isTerminalLaneState(state: AsyncJobState["status"]): boolean {
|
|
511
|
+
return state !== "queued" && state !== "running";
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/** Project already-loaded async status facts into one bounded, render-only lane row. */
|
|
515
|
+
export function projectAsyncLane(job: AsyncJobState, ...args: [selectedStep?: AsyncJobStep]): AsyncLaneProjection | undefined {
|
|
516
|
+
const selectedStep = args.length === 0 ? laneStepForJob(job) : args[0];
|
|
517
|
+
const trace = laneTraceForJob(job);
|
|
518
|
+
const workspace = job.cwd ? boundedLaneValue(shortenPath(job.cwd)) : undefined;
|
|
519
|
+
const label = compactTaskText(selectedStep?.description, selectedStep?.label)
|
|
520
|
+
?? boundedLaneValue(trace?.label)
|
|
521
|
+
?? (workspace ? undefined : boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey));
|
|
522
|
+
const role = boundedLaneValue(selectedStep?.agent ?? trace?.agent ?? job.agents?.[0] ?? widgetJobName(job), 32) ?? "subagent";
|
|
523
|
+
const phase = boundedLaneValue(selectedStep?.phase ?? trace?.phase);
|
|
524
|
+
const gate = laneGate(selectedStep);
|
|
525
|
+
const output = boundedLaneValue(selectedStep?.outputName);
|
|
526
|
+
const ref = boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey ?? job.asyncId.slice(0, 8), 24) ?? job.asyncId.slice(0, 8);
|
|
527
|
+
const chips = [
|
|
528
|
+
selectedStep?.context,
|
|
529
|
+
selectedStep?.structured ? "structured" : undefined,
|
|
530
|
+
selectedStep?.activityState === "active_long_running" ? "long-running" : undefined,
|
|
531
|
+
selectedStep?.activityState === "needs_attention" ? "attention" : undefined,
|
|
532
|
+
selectedStep?.watchdog?.phase === "stale" ? "stale" : undefined,
|
|
533
|
+
selectedStep?.toolBudgetBlocked === true || selectedStep?.turnBudgetExceeded === true ? "blocked" : undefined,
|
|
534
|
+
].filter((chip): chip is string => Boolean(chip));
|
|
535
|
+
const state = isTerminalLaneState(job.status) ? job.status : selectedStep?.status ?? job.status;
|
|
536
|
+
const next = laneNextAction(state, selectedStep, output, gate);
|
|
537
|
+
if (!label && !phase && !gate && !output && !selectedStep?.workflowKey && !job.workflowKey && !trace?.label && !trace?.phase) return undefined;
|
|
538
|
+
return { ...(label ? { label } : {}), role, ...(phase ? { phase } : {}), state, ...(gate ? { gate } : {}), ...(next ? { next } : {}), ...(output ? { output } : {}), ...(workspace ? { workspace } : {}), ref, chips };
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
function laneStateLabel(state: AsyncLaneProjection["state"], theme: Theme): string {
|
|
542
|
+
if (state === "running") return theme.fg("accent", "running");
|
|
543
|
+
if (state === "queued" || state === "pending") return theme.fg("muted", state);
|
|
544
|
+
if (state === "complete" || state === "completed") return theme.fg("success", "complete");
|
|
545
|
+
if (state === "failed" || state === "rejected") return theme.fg("error", state === "rejected" ? "rejected" : "failed");
|
|
546
|
+
return theme.fg("warning", state);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
function formatLaneProjection(lane: AsyncLaneProjection, theme: Theme): string {
|
|
550
|
+
const label = boundedLaneValue(lane.label, 56);
|
|
551
|
+
const identity = [label, lane.role ? `role:${lane.role}` : undefined].filter(Boolean).join(" · ");
|
|
552
|
+
return `${identity ? theme.bold(identity) : theme.bold(lane.role)} · ${laneStateLabel(lane.state, theme)}`;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function formatLaneChip(chip: string, theme: Theme): string {
|
|
556
|
+
const text = `[${chip}]`;
|
|
557
|
+
if (chip === "blocked") return theme.fg("error", text);
|
|
558
|
+
if (chip === "stale") return theme.fg("warning", text);
|
|
559
|
+
return text;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function formatLaneProjectionDetails(lane: AsyncLaneProjection, theme: Theme): string | undefined {
|
|
563
|
+
const details = [
|
|
564
|
+
lane.phase ? `phase:${lane.phase}` : undefined,
|
|
565
|
+
lane.gate ? `gate:${lane.gate}` : undefined,
|
|
566
|
+
lane.next ? `next:${lane.next}` : undefined,
|
|
567
|
+
lane.output ? `out:${lane.output}` : undefined,
|
|
568
|
+
lane.workspace ? `workspace:${lane.workspace}` : lane.ref ? `ref:${lane.ref}` : undefined,
|
|
569
|
+
].filter(Boolean);
|
|
570
|
+
const chips = lane.chips.map((chip) => formatLaneChip(chip, theme));
|
|
571
|
+
return [...(details.length ? [theme.fg("dim", details.join(" · "))] : []), ...chips].join(" · ") || undefined;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function formatLaneProjectionLines(lane: AsyncLaneProjection, theme: Theme, indent: string): string[] {
|
|
575
|
+
const details = formatLaneProjectionDetails(lane, theme);
|
|
576
|
+
return [
|
|
577
|
+
`${indent}${formatLaneProjection(lane, theme)}`,
|
|
578
|
+
...(details ? [`${indent} ${details}`] : []),
|
|
579
|
+
];
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
function laneRenderKey(job: AsyncJobState, projection?: WorkflowWidgetProjection): unknown {
|
|
583
|
+
const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
|
|
584
|
+
const lane = projectAsyncLane(job, selectedStep);
|
|
585
|
+
return lane ? [lane.label, lane.role, lane.phase, lane.state, lane.gate, lane.next, lane.output, lane.workspace, lane.ref, lane.chips] : undefined;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function widgetLaneDetailLines(job: AsyncJobState, theme: Theme, projection?: WorkflowWidgetProjection): string[] {
|
|
589
|
+
if (job.steps?.length && (job.mode === "parallel" || job.mode === "chain")) return [];
|
|
590
|
+
const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
|
|
591
|
+
const lane = projectAsyncLane(job, selectedStep);
|
|
592
|
+
return lane ? formatLaneProjectionLines(lane, theme, " ") : [];
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function workflowPreflightLines(job: AsyncJobState, expanded = false): string[] {
|
|
596
|
+
if (job.mode !== "workflow" || !job.preflight) return [];
|
|
597
|
+
if (!expanded) {
|
|
598
|
+
const warning = formatWorkflowPreflightWarningSummary(job.workflow?.preflightWarnings, { indent: " ", hint: "expand for debug" });
|
|
599
|
+
return [
|
|
600
|
+
formatWorkflowPreflightPlanSummary(job.preflight, { indent: " " }),
|
|
601
|
+
...(warning ? [warning] : []),
|
|
602
|
+
];
|
|
603
|
+
}
|
|
604
|
+
return [
|
|
605
|
+
...formatWorkflowPreflight(job.preflight, { indent: " " }).split("\n"),
|
|
606
|
+
...(job.workflow?.preflightWarnings ? formatWorkflowPreflightWarnings(job.workflow.preflightWarnings, { indent: " " }).split("\n") : []),
|
|
607
|
+
];
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function workflowLabelForResult(details: Details, resultIndex: number): string | undefined {
|
|
611
|
+
const flatIndex = foregroundResultIndex(details, resultIndex);
|
|
612
|
+
const visit = (nodes: NonNullable<Details["workflowGraph"]>["nodes"]): string | undefined => {
|
|
613
|
+
for (const node of nodes) {
|
|
614
|
+
if (node.flatIndex === flatIndex && node.label.trim()) return node.label;
|
|
615
|
+
const nested = node.children ? visit(node.children) : undefined;
|
|
616
|
+
if (nested) return nested;
|
|
617
|
+
}
|
|
618
|
+
return undefined;
|
|
619
|
+
};
|
|
620
|
+
return details.workflowGraph ? visit(details.workflowGraph.nodes) : undefined;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function foregroundProgressForResult(details: Details, resultIndex: number): AgentProgress | undefined {
|
|
624
|
+
const result = details.results[resultIndex];
|
|
625
|
+
if (result?.progress) return result.progress;
|
|
626
|
+
const index = result?.index ?? resultIndex;
|
|
627
|
+
const indexed = details.progress?.find((progress) => progress.index === index);
|
|
628
|
+
if (indexed) return indexed;
|
|
629
|
+
return result?.agent
|
|
630
|
+
? details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running")
|
|
631
|
+
: undefined;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function foregroundResultIndex(details: Details, resultIndex: number): number {
|
|
635
|
+
const result = details.results[resultIndex];
|
|
636
|
+
if (typeof result?.index === "number") return result.index;
|
|
637
|
+
return foregroundProgressForResult(details, resultIndex)?.index ?? resultIndex;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function foregroundResultDisplayName(
|
|
641
|
+
details: Details,
|
|
642
|
+
resultIndex: number,
|
|
643
|
+
result: Details["results"][number] | undefined,
|
|
644
|
+
fallback: string,
|
|
645
|
+
): string {
|
|
646
|
+
const progress = foregroundProgressForResult(details, resultIndex);
|
|
647
|
+
const agent = normalizedParallelDisplayText(result?.agent) ?? normalizedParallelDisplayText(progress?.agent);
|
|
648
|
+
const workflowLabel = normalizedParallelDisplayText(workflowLabelForResult(details, resultIndex));
|
|
649
|
+
if (workflowLabel) return compactTaskText(undefined, workflowLabel) ?? workflowLabel;
|
|
650
|
+
|
|
651
|
+
const sessionName = normalizedParallelDisplayText(result?.sessionName) ?? normalizedParallelDisplayText(progress?.sessionName);
|
|
652
|
+
if (sessionName) {
|
|
653
|
+
const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
|
|
654
|
+
if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase()) {
|
|
655
|
+
return compactTaskText(sessionTask) ?? sessionTask;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return compactTaskText(result?.task) ?? compactTaskText(progress?.task) ?? agent ?? fallback;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
function foregroundSingleDisplayName(result: Details["results"][number] | undefined): string {
|
|
663
|
+
return normalizedParallelDisplayText(result?.agent)
|
|
664
|
+
?? normalizedParallelDisplayText(result?.sessionName)
|
|
665
|
+
?? compactTaskText(result?.task)
|
|
666
|
+
?? "subagent";
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
function hasLiveOutputSignal(line: string): boolean {
|
|
670
|
+
const clean = oneLine(line);
|
|
671
|
+
return liveOutputWordSignalPattern.test(clean) || liveOutputCodeSignalPattern.test(clean);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function isNoisyStatusLine(line: string): boolean {
|
|
675
|
+
const clean = oneLine(line);
|
|
676
|
+
return clean.length > 0
|
|
677
|
+
&& clean.length <= 240
|
|
678
|
+
&& !hasLiveOutputSignal(clean)
|
|
679
|
+
&& noisyStatusPatterns.some((pattern) => pattern.test(clean));
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function latestActivityText(line: string): string {
|
|
683
|
+
return oneLine(line)
|
|
684
|
+
.replace(/^i (?:will|can|need to|am going to)\s+/i, "")
|
|
685
|
+
.replace(/^i(?:'m|’m| am)\s+/i, "");
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function progressUpdateSummary(lines: string[]): string {
|
|
689
|
+
const counts = new Map<string, number>();
|
|
690
|
+
for (const line of lines) counts.set(line.toLowerCase(), (counts.get(line.toLowerCase()) ?? 0) + 1);
|
|
691
|
+
const exactRepeatCount = Math.max(...counts.values());
|
|
692
|
+
const latest = latestActivityText(lines[lines.length - 1]!);
|
|
693
|
+
const repeat = exactRepeatCount > 1 ? ` · repeated ${exactRepeatCount}×` : "";
|
|
694
|
+
return `↻ ${lines.length} progress updates${repeat} · latest: ${latest}`;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
function compactRecentOutputLines(recentOutput: string[] | undefined): string[] {
|
|
698
|
+
const lines: string[] = [];
|
|
699
|
+
const noisyLines: string[] = [];
|
|
700
|
+
const otherLines: string[] = [];
|
|
701
|
+
for (const rawLine of recentOutput ?? []) {
|
|
702
|
+
const line = oneLine(rawLine);
|
|
703
|
+
if (!line || line === "(running...)") continue;
|
|
704
|
+
lines.push(line);
|
|
705
|
+
(isNoisyStatusLine(line) ? noisyLines : otherLines).push(line);
|
|
706
|
+
}
|
|
707
|
+
if (noisyLines.length >= 4 && !otherLines.some(hasLiveOutputSignal)) {
|
|
708
|
+
if (otherLines.length === 0) {
|
|
709
|
+
return [
|
|
710
|
+
progressUpdateSummary(noisyLines),
|
|
711
|
+
"pattern: repeated short status lines",
|
|
712
|
+
];
|
|
713
|
+
}
|
|
714
|
+
const visibleTail = otherLines.slice(-3);
|
|
715
|
+
const hiddenSignals = otherLines.slice(0, -3).filter(hasLiveOutputSignal);
|
|
716
|
+
return [
|
|
717
|
+
progressUpdateSummary(noisyLines),
|
|
718
|
+
...(hiddenSignals.length > 0 ? [`… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`] : []),
|
|
719
|
+
...visibleTail,
|
|
720
|
+
].slice(0, 5);
|
|
721
|
+
}
|
|
722
|
+
if (lines.length <= 5) return lines;
|
|
723
|
+
|
|
724
|
+
const tail = lines.slice(-5);
|
|
725
|
+
const hiddenSignals = lines.slice(0, -5).filter(hasLiveOutputSignal);
|
|
726
|
+
if (hiddenSignals.length === 0) return tail;
|
|
727
|
+
return [
|
|
728
|
+
`… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`,
|
|
729
|
+
...lines.slice(-4),
|
|
730
|
+
];
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function compactWorkflowError(error: string): string {
|
|
734
|
+
const outputMatch = error.match(/(?:^|\n)Output:\s*([\s\S]+)/);
|
|
735
|
+
if (!outputMatch) return oneLine(error);
|
|
736
|
+
const prefix = oneLine(error.slice(0, outputMatch.index)).replace(/:$/, "") || "Failed";
|
|
737
|
+
const outputLines = outputMatch[1]!.split(/\r?\n/).map(oneLine).filter(Boolean);
|
|
738
|
+
const allOutputLinesAreNoisy = outputLines.length > 0 && outputLines.every(isNoisyStatusLine);
|
|
739
|
+
const latest = outputLines.at(-1);
|
|
740
|
+
return allOutputLinesAreNoisy && latest
|
|
741
|
+
? `${prefix} · latest: ${latestActivityText(latest)}`
|
|
742
|
+
: `${prefix} · ${oneLine(outputMatch[1] ?? "")}`;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
const WORKFLOW_LIVE_ROW_LIMIT = 8;
|
|
746
|
+
|
|
747
|
+
function visibleWorkflowRows(rows: WorkflowChatProgressRow[]): { rows: WorkflowChatProgressRow[]; hiddenRows: number } {
|
|
748
|
+
if (rows.length <= WORKFLOW_LIVE_ROW_LIMIT) return { rows, hiddenRows: 0 };
|
|
749
|
+
const selected = new Set<string>();
|
|
750
|
+
const add = (row: WorkflowChatProgressRow): void => {
|
|
751
|
+
if (selected.size >= WORKFLOW_LIVE_ROW_LIMIT || selected.has(row.key)) return;
|
|
752
|
+
selected.add(row.key);
|
|
753
|
+
};
|
|
754
|
+
for (const row of [...rows].reverse()) {
|
|
755
|
+
if (row.state === "failed" || row.state === "detached") add(row);
|
|
756
|
+
}
|
|
757
|
+
for (const row of [...rows].reverse()) add(row);
|
|
758
|
+
return {
|
|
759
|
+
rows: rows.filter((row) => selected.has(row.key)),
|
|
760
|
+
hiddenRows: rows.length - selected.size,
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function snapshotNowForProgress(progress: Pick<AgentProgress, "currentToolStartedAt" | "durationMs" | "lastActivityAt">): number | undefined {
|
|
765
|
+
if (progress.currentToolStartedAt !== undefined && progress.durationMs !== undefined) return progress.currentToolStartedAt + progress.durationMs;
|
|
766
|
+
return progress.lastActivityAt;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function renderToolArgsPreview(value: string, maxLength: number, expanded: boolean): string {
|
|
770
|
+
const normalized = sanitizeDisplayText(value);
|
|
771
|
+
if (expanded || normalized.length <= maxLength) return normalized;
|
|
772
|
+
return `${truncateDisplayText(normalized, maxLength)}...`;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function formatCurrentToolLine(
|
|
776
|
+
progress: Pick<AgentProgress, "currentTool" | "currentToolArgs" | "currentToolStartedAt">,
|
|
777
|
+
availableWidth: number,
|
|
778
|
+
expanded: boolean,
|
|
779
|
+
snapshotNow?: number,
|
|
780
|
+
): string | undefined {
|
|
781
|
+
if (!progress.currentTool) return undefined;
|
|
782
|
+
const maxToolArgsLen = Math.max(50, availableWidth - 20);
|
|
783
|
+
const toolArgsPreview = progress.currentToolArgs
|
|
784
|
+
? renderToolArgsPreview(progress.currentToolArgs, maxToolArgsLen, expanded)
|
|
785
|
+
: "";
|
|
786
|
+
const durationSuffix = progress.currentToolStartedAt !== undefined && snapshotNow !== undefined
|
|
787
|
+
? ` | ${formatDuration(Math.max(0, snapshotNow - progress.currentToolStartedAt))}`
|
|
788
|
+
: "";
|
|
789
|
+
return toolArgsPreview
|
|
790
|
+
? `${progress.currentTool}: ${toolArgsPreview}${durationSuffix}`
|
|
791
|
+
: `${progress.currentTool}${durationSuffix}`;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
function buildLiveStatusLine(progress: Pick<AgentProgress, "activityState" | "lastActivityAt">, snapshotNow?: number): string | undefined {
|
|
795
|
+
if (progress.lastActivityAt !== undefined && snapshotNow !== undefined) return formatActivityLabel(progress.lastActivityAt, progress.activityState, snapshotNow);
|
|
796
|
+
if (progress.activityState === "needs_attention") return "needs attention";
|
|
797
|
+
if (progress.activityState === "active_long_running") return "active but long-running";
|
|
798
|
+
if (progress.lastActivityAt !== undefined) return "active";
|
|
799
|
+
return undefined;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function themeBold(theme: Theme, text: string): string {
|
|
803
|
+
return ((theme as { bold?: (value: string) => string }).bold?.(text)) ?? text;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
function statJoin(theme: Theme, parts: string[]): string {
|
|
807
|
+
return parts.filter(Boolean).map((part) => theme.fg("dim", part)).join(` ${theme.fg("dim", "·")} `);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
function formatTokenStat(tokens: number): string {
|
|
811
|
+
return `${formatTokens(tokens)} token`;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
function formatToolUseStat(count: number): string {
|
|
815
|
+
return `${count} tool use${count === 1 ? "" : "s"}`;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
function formatTotalCostStat(totalCost: Details["totalCost"] | undefined): string {
|
|
819
|
+
if (!totalCost || (totalCost.inputTokens === 0 && totalCost.outputTokens === 0 && totalCost.costUsd === 0)) return "";
|
|
820
|
+
const parts: string[] = [];
|
|
821
|
+
if (totalCost.inputTokens) parts.push(`in:${formatTokens(totalCost.inputTokens)}`);
|
|
822
|
+
if (totalCost.outputTokens) parts.push(`out:${formatTokens(totalCost.outputTokens)}`);
|
|
823
|
+
if (totalCost.costUsd) parts.push(`$${totalCost.costUsd.toFixed(4)}`);
|
|
824
|
+
return parts.join(" ");
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function formatProgressStats(theme: Theme, progress: Pick<AgentProgress, "toolCount" | "tokens" | "durationMs"> | undefined, includeDuration = true): string {
|
|
828
|
+
if (!progress) return "";
|
|
829
|
+
const parts: string[] = [];
|
|
830
|
+
if (progress.toolCount > 0) parts.push(formatToolUseStat(progress.toolCount));
|
|
831
|
+
if (progress.tokens > 0) parts.push(formatTokenStat(progress.tokens));
|
|
832
|
+
if (includeDuration && progress.durationMs > 0) parts.push(formatDuration(progress.durationMs));
|
|
833
|
+
return statJoin(theme, parts);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function firstOutputLine(text: string): string {
|
|
837
|
+
return text.split("\n").find((line) => line.trim())?.trim() ?? "";
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function resultStatusLine(result: Details["results"][number], output: string): string {
|
|
841
|
+
if (result.detached) return result.detachedReason ? `Detached: ${result.detachedReason}` : "Detached";
|
|
842
|
+
if (result.stopped) return "Stopped";
|
|
843
|
+
if (result.interrupted) return "Paused";
|
|
844
|
+
if (result.exitCode !== 0) return `Error: ${result.error ?? (firstOutputLine(output) || `exit ${result.exitCode}`)}`;
|
|
845
|
+
if (result.acceptance?.status && result.acceptance.status !== "not-required") return `Done · acceptance: ${result.acceptance.status}`;
|
|
846
|
+
if (hasEmptyTextOutputWithoutOutputTarget(result.task, output)) return "Done (no text output)";
|
|
847
|
+
return "Done";
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
type ResultPresentation = {
|
|
851
|
+
glyph: string;
|
|
852
|
+
label: "running" | "detached" | "stopped" | "paused" | "failed" | "partial" | "completed";
|
|
853
|
+
tone: "accent" | "warning" | "error" | "success";
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
function semanticResultPresentation(input: {
|
|
857
|
+
running?: boolean;
|
|
858
|
+
detached?: boolean;
|
|
859
|
+
stopped?: boolean;
|
|
860
|
+
interrupted?: boolean;
|
|
861
|
+
failed?: boolean;
|
|
862
|
+
partial?: boolean;
|
|
863
|
+
completedWithoutOutput?: boolean;
|
|
864
|
+
seed?: number;
|
|
865
|
+
frame?: number;
|
|
866
|
+
}): ResultPresentation {
|
|
867
|
+
if (input.running) {
|
|
868
|
+
const glyph = input.frame !== undefined ? runningGlyph((input.seed ?? 0) + input.frame) : runningGlyph(input.seed);
|
|
869
|
+
return { glyph, label: "running", tone: "accent" };
|
|
870
|
+
}
|
|
871
|
+
if (input.detached) return { glyph: "■", label: "detached", tone: "warning" };
|
|
872
|
+
if (input.stopped) return { glyph: "■", label: "stopped", tone: "warning" };
|
|
873
|
+
if (input.interrupted) return { glyph: "■", label: "paused", tone: "warning" };
|
|
874
|
+
if (input.failed) return { glyph: "✗", label: "failed", tone: "error" };
|
|
875
|
+
if (input.partial) return { glyph: "■", label: "partial", tone: "warning" };
|
|
876
|
+
return { glyph: "✓", label: "completed", tone: input.completedWithoutOutput ? "warning" : "success" };
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
function hasTerminalResultFlag(result: Details["results"][number]): boolean {
|
|
880
|
+
return Boolean(result.detached || result.stopped || result.interrupted);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function hasTerminalResult(result: Details["results"][number]): boolean {
|
|
884
|
+
if (hasTerminalResultFlag(result)) return true;
|
|
885
|
+
const status = result.progress?.status;
|
|
886
|
+
if (status === "running" || status === "pending") return false;
|
|
887
|
+
return result.exitCode !== undefined;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function isResultRunning(result: Details["results"][number], status = result.progress?.status): boolean {
|
|
891
|
+
return status === "running" && !hasTerminalResultFlag(result);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
function detailsHaveRunningResult(details: Details): boolean {
|
|
895
|
+
return details.progress?.some((progress) => {
|
|
896
|
+
if (progress.status !== "running") return false;
|
|
897
|
+
const result = details.results.find((entry) => entry.progress?.index === progress.index) ?? details.results[progress.index];
|
|
898
|
+
return !result || !hasTerminalResultFlag(result);
|
|
899
|
+
})
|
|
900
|
+
|| details.results.some((result) => isResultRunning(result))
|
|
901
|
+
|| workflowGraphHasStatus(details, ["running"]);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function resultPresentation(result: Details["results"][number], output: string, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame?: number): ResultPresentation {
|
|
905
|
+
return semanticResultPresentation({
|
|
906
|
+
running,
|
|
907
|
+
detached: result.detached,
|
|
908
|
+
stopped: result.stopped,
|
|
909
|
+
interrupted: result.interrupted,
|
|
910
|
+
failed: result.exitCode !== 0,
|
|
911
|
+
completedWithoutOutput: hasEmptyTextOutputWithoutOutputTarget(result.task, output),
|
|
912
|
+
seed,
|
|
913
|
+
frame,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function resultGlyph(result: Details["results"][number], output: string, theme: Theme, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame?: number): string {
|
|
918
|
+
const presentation = resultPresentation(result, output, running, seed, frame);
|
|
919
|
+
return theme.fg(presentation.tone, presentation.glyph);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
function styledResultPresentation(presentation: ResultPresentation, theme: Theme): { glyph: string; label: string } {
|
|
923
|
+
return {
|
|
924
|
+
glyph: theme.fg(presentation.tone, presentation.glyph),
|
|
925
|
+
label: theme.fg(presentation.tone, presentation.label),
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
function compactCurrentActivity(progress: AgentProgress): string {
|
|
930
|
+
const snapshotNow = snapshotNowForProgress(progress);
|
|
931
|
+
return formatCurrentToolLine(progress, getTermWidth() - 4, false, snapshotNow) ?? buildLiveStatusLine(progress, snapshotNow) ?? "thinking…";
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
function textDigest(text: string): string {
|
|
935
|
+
return createHash("sha256").update(text).digest("hex").slice(0, 16);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
function displayTextRenderKey(text: string): unknown[] {
|
|
939
|
+
const normalized = sanitizeDisplayText(text);
|
|
940
|
+
return [normalized.length, textDigest(normalized)];
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
function expandedStepActivityRenderKey(step: AsyncJobStep): unknown[] {
|
|
944
|
+
return [
|
|
945
|
+
step.recentTools?.slice(-3).map((tool) => [tool.tool, displayTextRenderKey(tool.args), tool.endMs]),
|
|
946
|
+
compactRecentOutputLines(step.recentOutput).map(displayTextRenderKey),
|
|
947
|
+
];
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function widgetStepRenderKey(step: AsyncJobStep, index: number, expanded = false): unknown[] {
|
|
951
|
+
return [
|
|
952
|
+
step.index ?? index,
|
|
953
|
+
step.agent,
|
|
954
|
+
step.sessionName,
|
|
955
|
+
step.workflowKey,
|
|
956
|
+
step.phase,
|
|
957
|
+
step.label,
|
|
958
|
+
step.status,
|
|
959
|
+
step.activityState,
|
|
960
|
+
step.lastActivityAt,
|
|
961
|
+
step.currentTool,
|
|
962
|
+
step.currentToolArgs,
|
|
963
|
+
step.currentToolStartedAt,
|
|
964
|
+
step.currentPath,
|
|
965
|
+
step.turnCount,
|
|
966
|
+
step.toolCount,
|
|
967
|
+
step.startedAt,
|
|
968
|
+
step.endedAt,
|
|
969
|
+
step.durationMs,
|
|
970
|
+
step.tokens?.total,
|
|
971
|
+
step.model,
|
|
972
|
+
step.thinking,
|
|
973
|
+
step.context,
|
|
974
|
+
step.description,
|
|
975
|
+
step.outputName,
|
|
976
|
+
step.structured,
|
|
977
|
+
step.acceptance?.status,
|
|
978
|
+
step.acceptance?.reviewResult?.status,
|
|
979
|
+
step.review?.status,
|
|
980
|
+
step.toolBudgetBlocked,
|
|
981
|
+
step.turnBudgetExceeded,
|
|
982
|
+
step.timedOut,
|
|
983
|
+
step.stopped,
|
|
984
|
+
step.execution?.status,
|
|
985
|
+
step.execution?.error,
|
|
986
|
+
step.execution?.timedOut,
|
|
987
|
+
step.execution?.interrupted,
|
|
988
|
+
step.execution?.stopped,
|
|
989
|
+
step.execution?.detached,
|
|
990
|
+
step.watchdog?.phase,
|
|
991
|
+
step.error,
|
|
992
|
+
expanded ? expandedStepActivityRenderKey(step) : undefined,
|
|
993
|
+
nestedRenderKey(step.children, expanded),
|
|
994
|
+
];
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
function nestedRenderKey(children: NestedRunSummary[] | undefined, expanded = false): unknown[] {
|
|
998
|
+
return (children ?? []).map((child) => [
|
|
999
|
+
child.id,
|
|
1000
|
+
child.state,
|
|
1001
|
+
child.agent,
|
|
1002
|
+
child.sessionName,
|
|
1003
|
+
child.model,
|
|
1004
|
+
child.thinking,
|
|
1005
|
+
child.activityState,
|
|
1006
|
+
child.lastActivityAt,
|
|
1007
|
+
child.currentTool,
|
|
1008
|
+
child.currentToolStartedAt,
|
|
1009
|
+
child.currentPath,
|
|
1010
|
+
child.turnCount,
|
|
1011
|
+
child.toolCount,
|
|
1012
|
+
child.startedAt,
|
|
1013
|
+
child.endedAt,
|
|
1014
|
+
child.lastUpdate,
|
|
1015
|
+
child.error,
|
|
1016
|
+
child.totalTokens?.total,
|
|
1017
|
+
child.steps?.map((step, index) => widgetStepRenderKey({ ...step, agent: step.agent, status: step.status }, index, expanded)),
|
|
1018
|
+
nestedRenderKey(child.children, expanded),
|
|
1019
|
+
]);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
function hostStepRenderKey(row: AsyncStatusWorkflowRow): unknown[] {
|
|
1023
|
+
return [
|
|
1024
|
+
row.kind,
|
|
1025
|
+
row.name,
|
|
1026
|
+
row.state,
|
|
1027
|
+
row.provider,
|
|
1028
|
+
row.role,
|
|
1029
|
+
row.verdict,
|
|
1030
|
+
row.reasonCode,
|
|
1031
|
+
row.detail,
|
|
1032
|
+
row.target,
|
|
1033
|
+
row.freshness,
|
|
1034
|
+
row.reportPath,
|
|
1035
|
+
];
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
export function widgetRenderKey(job: AsyncJobState, expanded = false): string {
|
|
1039
|
+
const projection = buildWorkflowWidgetProjection(job);
|
|
1040
|
+
return JSON.stringify({
|
|
1041
|
+
asyncDir: job.asyncDir,
|
|
1042
|
+
status: job.status,
|
|
1043
|
+
activityState: job.activityState,
|
|
1044
|
+
lastActivityAt: job.lastActivityAt,
|
|
1045
|
+
currentTool: job.currentTool,
|
|
1046
|
+
currentToolStartedAt: job.currentToolStartedAt,
|
|
1047
|
+
currentPath: job.currentPath,
|
|
1048
|
+
turnCount: job.turnCount,
|
|
1049
|
+
toolCount: job.toolCount,
|
|
1050
|
+
mode: job.mode,
|
|
1051
|
+
agents: job.agents,
|
|
1052
|
+
currentStep: job.currentStep,
|
|
1053
|
+
chainStepCount: job.chainStepCount,
|
|
1054
|
+
parallelGroups: job.parallelGroups,
|
|
1055
|
+
workflowHostSteps: projectAsyncWorkflowRows([], job.hostSteps).map(hostStepRenderKey),
|
|
1056
|
+
workflowGraph: job.mode === "workflow" && job.workflowGraph ? {
|
|
1057
|
+
currentNodeId: job.workflowGraph.currentNodeId,
|
|
1058
|
+
stages: projection.stages.map((node) => [node.id, node.status, node.agent, node.phase, node.label, node.flatIndex, node.outputName, node.structured, node.error]),
|
|
1059
|
+
} : undefined,
|
|
1060
|
+
preflight: expanded ? job.preflight : job.preflight ? formatWorkflowPreflightPlanSummary(job.preflight) : undefined,
|
|
1061
|
+
preflightWarnings: expanded ? job.workflow?.preflightWarnings : job.workflow?.preflightWarnings?.length || undefined,
|
|
1062
|
+
steps: job.steps?.map((step, index) => widgetStepRenderKey(step, index, expanded)),
|
|
1063
|
+
nestedChildren: nestedRenderKey(job.nestedChildren, expanded),
|
|
1064
|
+
lane: laneRenderKey(job, projection),
|
|
1065
|
+
stepsTotal: job.stepsTotal,
|
|
1066
|
+
runningSteps: job.runningSteps,
|
|
1067
|
+
completedSteps: job.completedSteps,
|
|
1068
|
+
activeParallelGroup: job.activeParallelGroup,
|
|
1069
|
+
startedAt: job.startedAt,
|
|
1070
|
+
updatedAt: job.updatedAt,
|
|
1071
|
+
timedOut: job.timedOut,
|
|
1072
|
+
stopped: job.stopped,
|
|
1073
|
+
totalTokens: job.totalTokens,
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
function formatWidgetAgents(agents: string[]): string {
|
|
1078
|
+
const distinct = [...new Set(agents)];
|
|
1079
|
+
if (distinct.length === 1 && agents.length > 1) return `${distinct[0]} ×${agents.length}`;
|
|
1080
|
+
if (agents.length > 3) return `${agents.slice(0, 2).join(", ")} +${agents.length - 2} more`;
|
|
1081
|
+
return agents.join(", ");
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
function widgetJobName(job: AsyncJobState): string {
|
|
1085
|
+
if (job.mode === "parallel") return "parallel";
|
|
1086
|
+
if (job.mode === "chain") return "chain";
|
|
1087
|
+
if (job.mode === "single" && job.agents?.length === 1) return job.agents[0]!;
|
|
1088
|
+
if (job.agents?.length) return formatWidgetAgents(job.agents);
|
|
1089
|
+
return job.mode ?? "subagent";
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
function isSingleChildAsyncJob(job: AsyncJobState): boolean {
|
|
1093
|
+
return job.mode === "single"
|
|
1094
|
+
&& job.steps?.length === 1
|
|
1095
|
+
&& shouldSuppressSingleStep(job.chainStepCount, job.stepsTotal);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
function isCompletedWidgetStepStatus(status: AsyncJobStep["status"]): boolean {
|
|
1099
|
+
return status === "complete" || status === "completed";
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
function singleChildAgentName(job: AsyncJobState, step: AsyncJobStep): string {
|
|
1103
|
+
return job.agents?.length === 1 ? job.agents[0]! : step.agent || widgetJobName(job);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
function hasSingleChildDetailEvidence(job: AsyncJobState, step: AsyncJobStep): boolean {
|
|
1107
|
+
return Boolean(
|
|
1108
|
+
step.error?.trim()
|
|
1109
|
+
|| step.execution?.error?.trim()
|
|
1110
|
+
|| step.phase?.trim()
|
|
1111
|
+
|| step.label?.trim()
|
|
1112
|
+
|| step.workflowKey?.trim()
|
|
1113
|
+
|| step.outputName?.trim()
|
|
1114
|
+
|| step.lane
|
|
1115
|
+
|| job.workflowKey?.trim()
|
|
1116
|
+
|| job.lane
|
|
1117
|
+
|| laneTraceForJob(job)?.phase?.trim()
|
|
1118
|
+
|| laneTraceForJob(job)?.label?.trim()
|
|
1119
|
+
|| step.timedOut
|
|
1120
|
+
|| step.stopped
|
|
1121
|
+
|| step.execution?.timedOut
|
|
1122
|
+
|| step.execution?.interrupted
|
|
1123
|
+
|| step.execution?.stopped
|
|
1124
|
+
|| step.execution?.detached
|
|
1125
|
+
|| job.timedOut
|
|
1126
|
+
|| job.stopped
|
|
1127
|
+
|| ["failed", "partial", "paused", "stopped", "detached"].includes(step.execution?.status ?? "")
|
|
1128
|
+
|| step.acceptance?.status === "rejected"
|
|
1129
|
+
|| step.acceptance?.reviewResult?.status === "blockers"
|
|
1130
|
+
|| step.review?.status === "blockers",
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
function shouldCollapseSingleChildDetails(job: AsyncJobState, step: AsyncJobStep): boolean {
|
|
1135
|
+
if (!isSingleChildAsyncJob(job) || hasSingleChildDetailEvidence(job, step)) return false;
|
|
1136
|
+
if (job.status === "running") return step.status === "running";
|
|
1137
|
+
if (job.status === "complete") return isCompletedWidgetStepStatus(step.status);
|
|
1138
|
+
return false;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
function singleChildTask(job: AsyncJobState, step: AsyncJobStep): string | undefined {
|
|
1142
|
+
const task = compactTaskText(step.description, step.label);
|
|
1143
|
+
if (task) return task;
|
|
1144
|
+
const sessionName = step.sessionName?.trim();
|
|
1145
|
+
if (!sessionName) return undefined;
|
|
1146
|
+
const agentName = singleChildAgentName(job, step);
|
|
1147
|
+
const sessionTask = stripRepeatedAgentPrefix(sessionName, agentName);
|
|
1148
|
+
return sessionTask === agentName ? undefined : compactTaskText(sessionTask);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
function widgetActivity(job: AsyncJobState): string {
|
|
1152
|
+
const facts: string[] = [];
|
|
1153
|
+
if (job.currentTool && job.currentToolStartedAt !== undefined && job.updatedAt !== undefined) facts.push(`${job.currentTool} ${formatDuration(Math.max(0, job.updatedAt - job.currentToolStartedAt))}`);
|
|
1154
|
+
else if (job.currentTool) facts.push(job.currentTool);
|
|
1155
|
+
if (job.currentPath) facts.push(shortenPath(job.currentPath));
|
|
1156
|
+
if (job.turnCount !== undefined) facts.push(`${job.turnCount} turns`);
|
|
1157
|
+
if (job.toolCount !== undefined) facts.push(`${job.toolCount} tools`);
|
|
1158
|
+
const activity = buildLiveStatusLine(job, job.updatedAt);
|
|
1159
|
+
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1160
|
+
if (activity) return activity;
|
|
1161
|
+
if (facts.length) return facts.join(" · ");
|
|
1162
|
+
if (job.status === "running") return "thinking…";
|
|
1163
|
+
if (job.status === "queued") return "queued…";
|
|
1164
|
+
if (job.status === "paused") return "Paused";
|
|
1165
|
+
if (job.status === "stopped") return "Stopped";
|
|
1166
|
+
if (job.status === "partial") return "Partial";
|
|
1167
|
+
if (job.status === "failed") return "Failed";
|
|
1168
|
+
return "Done";
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
function widgetStepRunningSeed(step: NonNullable<AsyncJobState["steps"]>[number], fallbackIndex?: number): number | undefined {
|
|
1172
|
+
return runningSeed(
|
|
1173
|
+
fallbackIndex,
|
|
1174
|
+
step.index,
|
|
1175
|
+
step.toolCount,
|
|
1176
|
+
step.turnCount,
|
|
1177
|
+
step.tokens?.total,
|
|
1178
|
+
step.lastActivityAt,
|
|
1179
|
+
step.currentToolStartedAt,
|
|
1180
|
+
step.durationMs,
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
function widgetStepsRunningSeed(steps: Array<NonNullable<AsyncJobState["steps"]>[number]> | undefined): number | undefined {
|
|
1185
|
+
let seed: number | undefined;
|
|
1186
|
+
for (const [index, step] of (steps ?? []).entries()) seed = runningSeed(seed, widgetStepRunningSeed(step, index));
|
|
1187
|
+
return seed;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
function widgetJobRunningSeed(job: AsyncJobState): number | undefined {
|
|
1191
|
+
return runningSeed(
|
|
1192
|
+
job.updatedAt,
|
|
1193
|
+
job.lastActivityAt,
|
|
1194
|
+
job.toolCount,
|
|
1195
|
+
job.turnCount,
|
|
1196
|
+
job.totalTokens?.total,
|
|
1197
|
+
job.currentStep,
|
|
1198
|
+
job.runningSteps,
|
|
1199
|
+
job.completedSteps,
|
|
1200
|
+
widgetStepsRunningSeed(job.steps),
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function widgetJobsRunningSeed(jobs: AsyncJobState[]): number | undefined {
|
|
1205
|
+
let seed: number | undefined;
|
|
1206
|
+
for (const job of jobs) seed = runningSeed(seed, widgetJobRunningSeed(job));
|
|
1207
|
+
return seed;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
function widgetStatusGlyph(job: AsyncJobState, theme: Theme, frame?: number): string {
|
|
1211
|
+
if (job.status === "running") return theme.fg("accent", runningGlyph(animatedSeed(widgetJobRunningSeed(job), frame)));
|
|
1212
|
+
if (job.status === "queued") return theme.fg("muted", "◦");
|
|
1213
|
+
if (job.status === "complete") return theme.fg("success", "✓");
|
|
1214
|
+
if (job.status === "paused") return theme.fg("warning", "■");
|
|
1215
|
+
if (job.status === "stopped") return theme.fg("warning", "■");
|
|
1216
|
+
return theme.fg("error", "✗");
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
function widgetStepGlyph(status: AsyncJobStep["status"], theme: Theme, seed?: number, frame?: number): string {
|
|
1220
|
+
if (status === "running") return theme.fg("accent", runningGlyph(animatedSeed(seed, frame)));
|
|
1221
|
+
if (status === "complete" || status === "completed") return theme.fg("success", "✓");
|
|
1222
|
+
if (status === "failed") return theme.fg("error", "✗");
|
|
1223
|
+
if (status === "paused") return theme.fg("warning", "■");
|
|
1224
|
+
if (status === "stopped") return theme.fg("warning", "■");
|
|
1225
|
+
return theme.fg("muted", "◦");
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
function widgetStepStatus(status: AsyncJobStep["status"], theme: Theme): string {
|
|
1229
|
+
if (status === "running") return theme.fg("accent", "running");
|
|
1230
|
+
if (status === "complete" || status === "completed") return theme.fg("success", "complete");
|
|
1231
|
+
if (status === "failed") return theme.fg("error", "failed");
|
|
1232
|
+
if (status === "paused") return theme.fg("warning", "paused");
|
|
1233
|
+
if (status === "stopped") return theme.fg("warning", "stopped");
|
|
1234
|
+
return theme.fg("dim", status);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
function widgetStepActivity(step: NonNullable<AsyncJobState["steps"]>[number], snapshotNow?: number): string {
|
|
1238
|
+
const facts: string[] = [];
|
|
1239
|
+
if (step.currentTool && step.currentToolStartedAt !== undefined && snapshotNow !== undefined) facts.push(`${step.currentTool} ${formatDuration(Math.max(0, snapshotNow - step.currentToolStartedAt))}`);
|
|
1240
|
+
else if (step.currentTool) facts.push(step.currentTool);
|
|
1241
|
+
if (step.currentPath) facts.push(shortenPath(step.currentPath));
|
|
1242
|
+
if (step.turnCount !== undefined) facts.push(`${step.turnCount} turns`);
|
|
1243
|
+
if (step.toolCount !== undefined) facts.push(`${step.toolCount} tools`);
|
|
1244
|
+
if (step.tokens?.total) facts.push(formatTokenUsage(step.tokens, "token"));
|
|
1245
|
+
const activity = buildLiveStatusLine(step, snapshotNow);
|
|
1246
|
+
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1247
|
+
if (activity) return activity;
|
|
1248
|
+
return facts.join(" · ");
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
function widgetChainDetails(job: AsyncJobState, theme: Theme, expanded = false, width = getTermWidth(), frame?: number): string[] {
|
|
1253
|
+
if (!job.steps?.length) return [];
|
|
1254
|
+
const total = job.chainStepCount ?? job.steps.length;
|
|
1255
|
+
const lines: string[] = [];
|
|
1256
|
+
for (const span of buildAsyncChainStepSpans(total, job.steps.length, job.parallelGroups)) {
|
|
1257
|
+
const steps = job.steps.slice(span.start, span.start + span.count);
|
|
1258
|
+
if (span.isParallel) {
|
|
1259
|
+
lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false));
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
const step = steps[0];
|
|
1263
|
+
if (!step) {
|
|
1264
|
+
lines.push(` ${theme.fg("dim", `◦ Step ${span.stepIndex + 1}/${total}: pending`)}`);
|
|
1265
|
+
continue;
|
|
1266
|
+
}
|
|
1267
|
+
lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame));
|
|
1268
|
+
}
|
|
1269
|
+
return lines;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
function widgetParallelAgentDetails(job: AsyncJobState, theme: Theme, expanded = false, width = getTermWidth(), frame?: number): string[] {
|
|
1273
|
+
if (!job.steps?.length) return [];
|
|
1274
|
+
if (job.mode !== "parallel" && job.mode !== "chain") return [];
|
|
1275
|
+
if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
|
|
1276
|
+
const group = activeParallelWidgetGroup(job);
|
|
1277
|
+
if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup));
|
|
1278
|
+
const total = job.stepsTotal ?? job.steps.length;
|
|
1279
|
+
const lines: string[] = [];
|
|
1280
|
+
for (const [index, step] of job.steps.entries()) {
|
|
1281
|
+
const marker = index === job.steps.length - 1 ? "└" : "├";
|
|
1282
|
+
const activity = widgetStepActivity(step, job.updatedAt);
|
|
1283
|
+
const itemTitle = job.mode === "parallel" || job.activeParallelGroup ? "Agent" : "Step";
|
|
1284
|
+
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
1285
|
+
const label = compactTaskText(step.description, step.label);
|
|
1286
|
+
const display = step.sessionName?.trim() || (label ? `${label} (${step.agent})` : step.agent);
|
|
1287
|
+
lines.push(` ${theme.fg("dim", `${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index), frame)} ${itemTitle} ${index + 1}/${total}: ${display} · ${widgetStepStatus(step.status, theme)}${modelDisplay}${activity ? ` · ${activity}` : ""}`)}`);
|
|
1288
|
+
const lane = projectAsyncLane(job, step);
|
|
1289
|
+
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
|
|
1290
|
+
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 8 : 6)) lines.push(` ${nestedLine}`);
|
|
1291
|
+
}
|
|
1292
|
+
return lines;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
function parseParallelGroupAgentCount(label: string | undefined): number | undefined {
|
|
1296
|
+
if (!label || !label.startsWith("[") || !label.endsWith("]")) return undefined;
|
|
1297
|
+
const inner = label.slice(1, -1).trim();
|
|
1298
|
+
if (!inner) return 0;
|
|
1299
|
+
return inner.split("+").map((part) => part.trim()).filter(Boolean).length;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
interface ChainStepSpan {
|
|
1303
|
+
stepIndex: number;
|
|
1304
|
+
start: number;
|
|
1305
|
+
count: number;
|
|
1306
|
+
isParallel: boolean;
|
|
1307
|
+
status?: WorkflowNodeStatus;
|
|
1308
|
+
label?: string;
|
|
1309
|
+
error?: string;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
function buildChainStepSpans(details: Pick<Details, "chainAgents" | "workflowGraph">): ChainStepSpan[] {
|
|
1313
|
+
if (details.workflowGraph?.nodes?.length) {
|
|
1314
|
+
const spans: ChainStepSpan[] = [];
|
|
1315
|
+
let flatCursor = 0;
|
|
1316
|
+
for (const node of details.workflowGraph.nodes) {
|
|
1317
|
+
if (node.stepIndex === undefined) continue;
|
|
1318
|
+
if (node.kind === "parallel-group" || node.kind === "dynamic-parallel-group") {
|
|
1319
|
+
const childFlatIndexes = (node.children ?? [])
|
|
1320
|
+
.map((child) => child.flatIndex)
|
|
1321
|
+
.filter((value): value is number => typeof value === "number");
|
|
1322
|
+
const start = childFlatIndexes.length ? Math.min(...childFlatIndexes) : flatCursor;
|
|
1323
|
+
const count = node.children?.length ?? 0;
|
|
1324
|
+
spans.push({ stepIndex: node.stepIndex, start, count, isParallel: true, status: node.status, label: node.label, error: node.error });
|
|
1325
|
+
flatCursor = Math.max(flatCursor, start + count);
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
const start = node.flatIndex ?? flatCursor;
|
|
1329
|
+
spans.push({ stepIndex: node.stepIndex, start, count: 1, isParallel: false, status: node.status, label: node.label, error: node.error });
|
|
1330
|
+
flatCursor = Math.max(flatCursor, start + 1);
|
|
1331
|
+
}
|
|
1332
|
+
if (spans.length) return spans.sort((left, right) => left.stepIndex - right.stepIndex);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
if (!details.chainAgents?.length) return [];
|
|
1336
|
+
const spans: ChainStepSpan[] = [];
|
|
1337
|
+
let start = 0;
|
|
1338
|
+
for (let stepIndex = 0; stepIndex < details.chainAgents.length; stepIndex++) {
|
|
1339
|
+
const label = details.chainAgents[stepIndex]!;
|
|
1340
|
+
const parsedCount = parseParallelGroupAgentCount(label);
|
|
1341
|
+
const count = parsedCount ?? 1;
|
|
1342
|
+
spans.push({ stepIndex, start, count, isParallel: parsedCount !== undefined });
|
|
1343
|
+
start += count;
|
|
1344
|
+
}
|
|
1345
|
+
return spans;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
function buildAsyncChainStepSpans(total: number, stepCount: number, parallelGroups: AsyncParallelGroupStatus[] = []): ChainStepSpan[] {
|
|
1349
|
+
const groupsByStep = new Map<number, AsyncParallelGroupStatus>();
|
|
1350
|
+
for (const group of parallelGroups) {
|
|
1351
|
+
if (!groupsByStep.has(group.stepIndex)) groupsByStep.set(group.stepIndex, group);
|
|
1352
|
+
}
|
|
1353
|
+
const spans: ChainStepSpan[] = [];
|
|
1354
|
+
let flatIndex = 0;
|
|
1355
|
+
for (let stepIndex = 0; stepIndex < total; stepIndex++) {
|
|
1356
|
+
const group = groupsByStep.get(stepIndex);
|
|
1357
|
+
if (group) {
|
|
1358
|
+
spans.push({ stepIndex, start: group.start, count: group.count, isParallel: true });
|
|
1359
|
+
flatIndex = Math.max(flatIndex, group.start + group.count);
|
|
1360
|
+
continue;
|
|
1361
|
+
}
|
|
1362
|
+
spans.push({ stepIndex, start: flatIndex, count: flatIndex < stepCount ? 1 : 0, isParallel: false });
|
|
1363
|
+
flatIndex++;
|
|
1364
|
+
}
|
|
1365
|
+
return spans;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
interface ParallelWidgetGroup {
|
|
1369
|
+
steps: AsyncJobStep[];
|
|
1370
|
+
total: number;
|
|
1371
|
+
stepIndex?: number;
|
|
1372
|
+
chainTotal?: number;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
interface ParallelWidgetStepRow {
|
|
1376
|
+
step: AsyncJobStep;
|
|
1377
|
+
index: number;
|
|
1378
|
+
rowLabel: string;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
function normalizedParallelDisplayText(value: string | undefined): string | undefined {
|
|
1382
|
+
if (!value?.trim()) return undefined;
|
|
1383
|
+
const normalized = oneLine(value);
|
|
1384
|
+
return normalized && normalized !== PROMPT_REDACTED ? normalized : undefined;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function parallelWidgetStepDisplayName(step: AsyncJobStep): string {
|
|
1388
|
+
const agent = normalizedParallelDisplayText(step.agent);
|
|
1389
|
+
const explicitLabel = normalizedParallelDisplayText(step.label);
|
|
1390
|
+
if (explicitLabel) {
|
|
1391
|
+
const label = compactTaskText(step.description, explicitLabel) ?? explicitLabel;
|
|
1392
|
+
return agent ? `${label} (${agent})` : label;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
const sessionName = normalizedParallelDisplayText(step.sessionName);
|
|
1396
|
+
if (sessionName) {
|
|
1397
|
+
const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
|
|
1398
|
+
if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase()) return sessionTask;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
return compactTaskText(step.description) ?? agent ?? "subagent";
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
function parallelWidgetStepPriority(step: AsyncJobStep): number {
|
|
1405
|
+
if (step.status === "running" || step.activityState === "needs_attention") return 0;
|
|
1406
|
+
switch (step.status) {
|
|
1407
|
+
case "failed":
|
|
1408
|
+
case "rejected":
|
|
1409
|
+
case "partial":
|
|
1410
|
+
case "stopped":
|
|
1411
|
+
case "paused":
|
|
1412
|
+
return 1;
|
|
1413
|
+
case "complete":
|
|
1414
|
+
case "completed":
|
|
1415
|
+
return 2;
|
|
1416
|
+
default:
|
|
1417
|
+
return 3;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
function parallelWidgetStepRows(steps: AsyncJobStep[], total: number, prioritizeActive: boolean): ParallelWidgetStepRow[] {
|
|
1422
|
+
const indexed = steps.map((step, index) => ({ step, index, displayName: parallelWidgetStepDisplayName(step) }));
|
|
1423
|
+
if (prioritizeActive) indexed.sort((left, right) => parallelWidgetStepPriority(left.step) - parallelWidgetStepPriority(right.step) || left.index - right.index);
|
|
1424
|
+
return withDuplicateLabelDiscriminators(indexed, total).map(({ displayName, ...row }) => row);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
function activeParallelWidgetGroup(job: AsyncJobState): ParallelWidgetGroup | undefined {
|
|
1428
|
+
const steps = job.steps ?? [];
|
|
1429
|
+
if (!steps.length) return undefined;
|
|
1430
|
+
if (job.mode === "parallel") return { steps, total: job.stepsTotal ?? steps.length };
|
|
1431
|
+
if (job.mode !== "chain" || !job.activeParallelGroup) return undefined;
|
|
1432
|
+
|
|
1433
|
+
const chainTotal = job.chainStepCount ?? job.stepsTotal ?? steps.length;
|
|
1434
|
+
const spans = buildAsyncChainStepSpans(chainTotal, steps.length, job.parallelGroups);
|
|
1435
|
+
const currentStep = job.currentStep;
|
|
1436
|
+
const activeSpan = currentStep === undefined
|
|
1437
|
+
? spans.find((span) => span.isParallel)
|
|
1438
|
+
: spans.find((span) => span.isParallel
|
|
1439
|
+
&& currentStep >= span.start
|
|
1440
|
+
&& currentStep < span.start + span.count);
|
|
1441
|
+
return {
|
|
1442
|
+
steps,
|
|
1443
|
+
total: activeSpan?.count ?? job.stepsTotal ?? steps.length,
|
|
1444
|
+
stepIndex: activeSpan?.stepIndex,
|
|
1445
|
+
chainTotal,
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
function parallelWidgetGroupHeader(
|
|
1450
|
+
group: ParallelWidgetGroup,
|
|
1451
|
+
theme: Theme,
|
|
1452
|
+
frame?: number,
|
|
1453
|
+
): string {
|
|
1454
|
+
const status = aggregateStepStatus(group.steps);
|
|
1455
|
+
const label = group.stepIndex !== undefined && group.chainTotal !== undefined
|
|
1456
|
+
? `Step ${group.stepIndex + 1}/${group.chainTotal}: parallel group`
|
|
1457
|
+
: "parallel group";
|
|
1458
|
+
return ` ${widgetStepGlyph(status, theme, widgetStepsRunningSeed(group.steps), frame)} ${themeBold(theme, label)} ${theme.fg("dim", "·")} ${theme.fg("dim", formatParallelOutcome(group.steps, group.total))}`;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
function parallelWidgetGroupDetails(
|
|
1462
|
+
job: AsyncJobState,
|
|
1463
|
+
theme: Theme,
|
|
1464
|
+
group: ParallelWidgetGroup,
|
|
1465
|
+
expanded: boolean,
|
|
1466
|
+
width: number,
|
|
1467
|
+
frame: number | undefined,
|
|
1468
|
+
prioritizeActive: boolean,
|
|
1469
|
+
): string[] {
|
|
1470
|
+
const lines = [parallelWidgetGroupHeader(group, theme, frame)];
|
|
1471
|
+
const rows = parallelWidgetStepRows(group.steps, group.total, prioritizeActive);
|
|
1472
|
+
for (const [rowIndex, row] of rows.entries()) {
|
|
1473
|
+
const marker = rowIndex === rows.length - 1 && rows.length >= group.total ? "└─" : "├─";
|
|
1474
|
+
lines.push(...foregroundStyleWidgetStepLines(job, theme, row.step, "Agent", row.index + 1, group.total, expanded, width, frame, {
|
|
1475
|
+
rowLabel: row.rowLabel,
|
|
1476
|
+
rowIndent: " ",
|
|
1477
|
+
detailIndent: " ",
|
|
1478
|
+
rowMarker: marker,
|
|
1479
|
+
includeCurrentPath: true,
|
|
1480
|
+
}));
|
|
1481
|
+
}
|
|
1482
|
+
for (let index = rows.length; index < group.total; index++) {
|
|
1483
|
+
const marker = index === group.total - 1 ? "└─" : "├─";
|
|
1484
|
+
lines.push(` ${marker} ${theme.fg("muted", "◦")} ${theme.fg("dim", "pending")}`);
|
|
1485
|
+
}
|
|
1486
|
+
return lines;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
function isDoneResult(result: Details["results"][number]): boolean {
|
|
1490
|
+
const status = result.progress?.status;
|
|
1491
|
+
if (status === "completed") return true;
|
|
1492
|
+
if (status === "running" || status === "pending") return false;
|
|
1493
|
+
if (result.interrupted || result.detached) return false;
|
|
1494
|
+
return result.exitCode === 0;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
function workflowGraphHasStatus(details: Pick<Details, "workflowGraph">, statuses: WorkflowNodeStatus[]): boolean {
|
|
1498
|
+
return details.workflowGraph?.nodes.some((node) => statuses.includes(node.status)) ?? false;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
interface ChainRenderResultEntry {
|
|
1502
|
+
kind: "result";
|
|
1503
|
+
resultIndex: number;
|
|
1504
|
+
rowNumber: number;
|
|
1505
|
+
rowLabel?: string;
|
|
1506
|
+
agentName: string;
|
|
1507
|
+
displayIndex: number;
|
|
1508
|
+
isParallel?: boolean;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
interface ChainRenderGroupEntry {
|
|
1512
|
+
kind: "group";
|
|
1513
|
+
stepLabel: string;
|
|
1514
|
+
groupLabel?: string;
|
|
1515
|
+
status: WorkflowNodeStatus;
|
|
1516
|
+
error?: string;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
type ChainRenderEntry = ChainRenderResultEntry | ChainRenderGroupEntry;
|
|
1520
|
+
|
|
1521
|
+
function chainSpanStatus(details: Details, span: ChainStepSpan): WorkflowNodeStatus {
|
|
1522
|
+
if (span.status) return span.status;
|
|
1523
|
+
const results = details.results.slice(span.start, span.start + span.count);
|
|
1524
|
+
if (results.some((result) => isResultRunning(result))) return "running";
|
|
1525
|
+
if (results.some((result) => !hasTerminalResultFlag(result) && (result.progress?.status === "failed" || result.exitCode !== 0) && !isResultRunning(result))) return "failed";
|
|
1526
|
+
if (results.some((result) => result.stopped)) return "stopped";
|
|
1527
|
+
if (results.some((result) => result.interrupted)) return "paused";
|
|
1528
|
+
if (results.some((result) => result.detached || result.progress?.status === "detached")) return "detached";
|
|
1529
|
+
if (results.length < span.count) return "pending";
|
|
1530
|
+
if (results.length > 0 && results.every(isDoneResult)) return "completed";
|
|
1531
|
+
return "pending";
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
function withDuplicateForegroundLabels(entries: ChainRenderResultEntry[], total: number): ChainRenderResultEntry[] {
|
|
1535
|
+
return withDuplicateLabelDiscriminators(
|
|
1536
|
+
entries.map((entry) => ({ ...entry, index: entry.displayIndex, displayName: entry.agentName })),
|
|
1537
|
+
total,
|
|
1538
|
+
).map(({ displayName, rowLabel, ...entry }) => ({
|
|
1539
|
+
...entry,
|
|
1540
|
+
rowLabel: rowLabel === displayName ? undefined : rowLabel.slice(0, -(displayName.length + 2)),
|
|
1541
|
+
}));
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
function buildChainRenderEntries(details: Details, label: MultiProgressLabel): ChainRenderEntry[] | undefined {
|
|
1545
|
+
if (details.mode !== "chain" || !label.hasParallelInChain || label.showActiveGroupOnly) return undefined;
|
|
1546
|
+
const entries: ChainRenderEntry[] = [];
|
|
1547
|
+
for (const span of buildChainStepSpans(details)) {
|
|
1548
|
+
if (span.isParallel) {
|
|
1549
|
+
entries.push({
|
|
1550
|
+
kind: "group",
|
|
1551
|
+
stepLabel: `Step ${span.stepIndex + 1}/${label.logicalStepCount}: parallel group`,
|
|
1552
|
+
groupLabel: span.label?.trim() || undefined,
|
|
1553
|
+
status: chainSpanStatus(details, span),
|
|
1554
|
+
error: span.error,
|
|
1555
|
+
});
|
|
1556
|
+
const groupEntries: ChainRenderResultEntry[] = [];
|
|
1557
|
+
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1558
|
+
const result = details.results[index];
|
|
1559
|
+
const localIndex = foregroundResultIndex(details, index);
|
|
1560
|
+
const displayIndex = localIndex >= span.start && localIndex < span.start + span.count
|
|
1561
|
+
? localIndex - span.start
|
|
1562
|
+
: index - span.start;
|
|
1563
|
+
groupEntries.push({
|
|
1564
|
+
kind: "result",
|
|
1565
|
+
resultIndex: index,
|
|
1566
|
+
rowNumber: index - span.start + 1,
|
|
1567
|
+
agentName: foregroundResultDisplayName(details, index, result, `agent-${displayIndex + 1}`),
|
|
1568
|
+
displayIndex,
|
|
1569
|
+
isParallel: true,
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
entries.push(...withDuplicateForegroundLabels(groupEntries, span.count));
|
|
1573
|
+
continue;
|
|
1574
|
+
}
|
|
1575
|
+
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1576
|
+
const result = details.results[index];
|
|
1577
|
+
entries.push({
|
|
1578
|
+
kind: "result",
|
|
1579
|
+
resultIndex: index,
|
|
1580
|
+
rowNumber: span.stepIndex + 1,
|
|
1581
|
+
rowLabel: resultRowLabel(label, span.stepIndex + 1),
|
|
1582
|
+
agentName: foregroundResultDisplayName(details, index, result, details.chainAgents?.[span.stepIndex] ?? `step-${span.stepIndex + 1}`),
|
|
1583
|
+
displayIndex: foregroundResultIndex(details, index),
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return entries;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
interface MultiProgressLabel {
|
|
1591
|
+
headerLabel: string;
|
|
1592
|
+
itemTitle: "Step" | "Agent";
|
|
1593
|
+
totalCount: number;
|
|
1594
|
+
hasParallelInChain: boolean;
|
|
1595
|
+
activeParallelGroup: boolean;
|
|
1596
|
+
groupStartIndex: number;
|
|
1597
|
+
groupEndIndex: number;
|
|
1598
|
+
showActiveGroupOnly: boolean;
|
|
1599
|
+
logicalStepCount: number;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
function buildMultiProgressLabel(details: Pick<Details, "mode" | "results" | "progress" | "totalSteps" | "currentStepIndex" | "chainAgents" | "workflowGraph">, hasRunning: boolean): MultiProgressLabel {
|
|
1603
|
+
const stepSpans = buildChainStepSpans(details);
|
|
1604
|
+
const hasParallelInChain = details.mode === "chain" && stepSpans.some((span) => span.isParallel);
|
|
1605
|
+
const activeParallelGroup = details.mode === "chain"
|
|
1606
|
+
&& details.currentStepIndex !== undefined
|
|
1607
|
+
&& stepSpans.some((span) => span.stepIndex === details.currentStepIndex && span.isParallel);
|
|
1608
|
+
const itemTitle: "Step" | "Agent" = details.mode === "parallel" || activeParallelGroup ? "Agent" : "Step";
|
|
1609
|
+
|
|
1610
|
+
if (details.mode === "parallel") {
|
|
1611
|
+
const totalCount = details.totalSteps ?? details.results.length;
|
|
1612
|
+
const statuses = new Array(totalCount).fill("pending") as Array<"pending" | "running" | "completed" | "failed" | "stopped" | "detached">;
|
|
1613
|
+
for (const progress of details.progress ?? []) {
|
|
1614
|
+
if (progress.index >= 0 && progress.index < totalCount) statuses[progress.index] = progress.status;
|
|
1615
|
+
}
|
|
1616
|
+
for (let i = 0; i < details.results.length; i++) {
|
|
1617
|
+
const result = details.results[i]!;
|
|
1618
|
+
const progressFromArray = details.progress?.find((progress) => progress.index === i)
|
|
1619
|
+
|| details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running");
|
|
1620
|
+
const index = result.progress?.index ?? progressFromArray?.index ?? i;
|
|
1621
|
+
if (index < 0 || index >= totalCount) continue;
|
|
1622
|
+
const status = result.stopped
|
|
1623
|
+
? "stopped"
|
|
1624
|
+
: result.interrupted || result.detached
|
|
1625
|
+
? "detached"
|
|
1626
|
+
: result.progress?.status
|
|
1627
|
+
?? (result.exitCode === 0 ? "completed" : "failed");
|
|
1628
|
+
statuses[index] = status;
|
|
1629
|
+
}
|
|
1630
|
+
const running = statuses.filter((status) => status === "running").length;
|
|
1631
|
+
const done = statuses.filter((status) => status === "completed").length;
|
|
1632
|
+
const headerLabel = hasRunning
|
|
1633
|
+
? `${formatAgentRunningLabel(running)} · ${done}/${totalCount} done`
|
|
1634
|
+
: `${done}/${totalCount} done`;
|
|
1635
|
+
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: totalCount, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
if (activeParallelGroup) {
|
|
1639
|
+
const currentStepIndex = details.currentStepIndex!;
|
|
1640
|
+
const span = stepSpans[currentStepIndex];
|
|
1641
|
+
const groupSize = span?.count ?? 1;
|
|
1642
|
+
const groupStart = span?.start ?? 0;
|
|
1643
|
+
const groupEnd = groupStart + groupSize;
|
|
1644
|
+
let running = 0;
|
|
1645
|
+
let done = 0;
|
|
1646
|
+
for (let index = groupStart; index < groupEnd; index++) {
|
|
1647
|
+
const progressEntry = details.progress?.find((progress) => progress.index === index);
|
|
1648
|
+
const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
|
|
1649
|
+
if (progressEntry?.status === "running" && (!resultEntry || !hasTerminalResultFlag(resultEntry))) {
|
|
1650
|
+
running++;
|
|
1651
|
+
continue;
|
|
1652
|
+
}
|
|
1653
|
+
if (progressEntry?.status === "completed") {
|
|
1654
|
+
done++;
|
|
1655
|
+
continue;
|
|
1656
|
+
}
|
|
1657
|
+
if (resultEntry && isDoneResult(resultEntry)) done++;
|
|
1658
|
+
}
|
|
1659
|
+
const totalSteps = details.totalSteps ?? details.chainAgents?.length ?? 1;
|
|
1660
|
+
const headerLabel = hasRunning
|
|
1661
|
+
? `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${formatAgentRunningLabel(running)} · ${done}/${groupSize} done`
|
|
1662
|
+
: `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${done}/${groupSize} done`;
|
|
1663
|
+
return { headerLabel, itemTitle, totalCount: groupSize, hasParallelInChain, activeParallelGroup, groupStartIndex: groupStart, groupEndIndex: groupEnd, showActiveGroupOnly: true, logicalStepCount: totalSteps };
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
if (details.mode === "chain" && details.chainAgents?.length) {
|
|
1667
|
+
const totalCount = details.totalSteps ?? details.chainAgents.length;
|
|
1668
|
+
const doneLogical = stepSpans.filter((span) => {
|
|
1669
|
+
if (span.status && span.status !== "completed") return false;
|
|
1670
|
+
if (span.count === 0) return span.status === "completed";
|
|
1671
|
+
for (let index = span.start; index < span.start + span.count; index++) {
|
|
1672
|
+
const progressEntry = details.progress?.find((progress) => progress.index === index);
|
|
1673
|
+
const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
|
|
1674
|
+
if (progressEntry?.status === "running" || progressEntry?.status === "pending" || progressEntry?.status === "failed") return false;
|
|
1675
|
+
if (!resultEntry || !isDoneResult(resultEntry)) return false;
|
|
1676
|
+
}
|
|
1677
|
+
return true;
|
|
1678
|
+
}).length;
|
|
1679
|
+
const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, doneLogical + (hasRunning ? 1 : 0));
|
|
1680
|
+
const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${doneLogical}/${totalCount}`;
|
|
1681
|
+
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
const totalCount = details.totalSteps ?? details.results.length;
|
|
1685
|
+
const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, details.results.filter(isDoneResult).length + (hasRunning ? 1 : 0));
|
|
1686
|
+
const done = details.results.filter(isDoneResult).length;
|
|
1687
|
+
const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${done}/${totalCount}`;
|
|
1688
|
+
return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
function resultRowLabel(label: MultiProgressLabel, stepNumber: number): string | undefined {
|
|
1692
|
+
if (label.itemTitle === "Agent") return undefined;
|
|
1693
|
+
if (shouldSuppressSingleStep(label.logicalStepCount)) return undefined;
|
|
1694
|
+
return `Step ${stepNumber}/${label.logicalStepCount}`;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
function buildForegroundResultEntries(
|
|
1698
|
+
details: Details,
|
|
1699
|
+
label: MultiProgressLabel,
|
|
1700
|
+
displayStart: number,
|
|
1701
|
+
displayEnd: number,
|
|
1702
|
+
useResultsDirectly: boolean,
|
|
1703
|
+
): ChainRenderResultEntry[] {
|
|
1704
|
+
const fallbackLabel = label.itemTitle.toLowerCase();
|
|
1705
|
+
const entries = Array.from({ length: displayEnd - displayStart }, (_, offset): ChainRenderResultEntry => {
|
|
1706
|
+
const index = displayStart + offset;
|
|
1707
|
+
const result = details.results[index];
|
|
1708
|
+
const stableIndex = foregroundResultIndex(details, index);
|
|
1709
|
+
const rowNumber = label.showActiveGroupOnly ? index - label.groupStartIndex + 1 : stableIndex + 1;
|
|
1710
|
+
const fallbackAgent = useResultsDirectly
|
|
1711
|
+
? (result?.agent || `${fallbackLabel}-${rowNumber}`)
|
|
1712
|
+
: (details.chainAgents![index] || result?.agent || `${fallbackLabel}-${rowNumber}`);
|
|
1713
|
+
const displayIndex = label.activeParallelGroup && stableIndex >= label.groupStartIndex && stableIndex < label.groupEndIndex
|
|
1714
|
+
? stableIndex - label.groupStartIndex
|
|
1715
|
+
: label.activeParallelGroup ? index - label.groupStartIndex : stableIndex;
|
|
1716
|
+
return {
|
|
1717
|
+
kind: "result",
|
|
1718
|
+
resultIndex: index,
|
|
1719
|
+
rowNumber,
|
|
1720
|
+
rowLabel: resultRowLabel(label, rowNumber),
|
|
1721
|
+
agentName: foregroundResultDisplayName(details, index, result, fallbackAgent),
|
|
1722
|
+
displayIndex,
|
|
1723
|
+
};
|
|
1724
|
+
});
|
|
1725
|
+
return label.itemTitle === "Agent" ? withDuplicateForegroundLabels(entries, label.totalCount) : entries;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
function widgetStats(job: AsyncJobState, theme: Theme, projection = buildWorkflowWidgetProjection(job)): string {
|
|
1729
|
+
const parts: string[] = [];
|
|
1730
|
+
const { stageProgress } = projection;
|
|
1731
|
+
const stepsTotal = stageProgress?.total ?? job.stepsTotal ?? (job.agents?.length ?? 1);
|
|
1732
|
+
const isSingleChild = isSingleChildAsyncJob(job);
|
|
1733
|
+
if (stageProgress) {
|
|
1734
|
+
const currentStage = stageProgress.current !== undefined ? projection.stages[stageProgress.current] : undefined;
|
|
1735
|
+
const focus = currentStage
|
|
1736
|
+
? [compactTaskText(undefined, currentStage.label) ?? boundedLaneValue(currentStage.id), currentStage.agent ? boundedLaneValue(currentStage.agent) : "", workflowNodeStatusLabel(currentStage.status)].filter(Boolean)
|
|
1737
|
+
: [];
|
|
1738
|
+
parts.push(["staged lane", stageProgress.current !== undefined ? `stage ${stageProgress.current + 1}/${stageProgress.total}` : `${stageProgress.total} stages`, ...focus].join(" · "));
|
|
1739
|
+
} else if (job.activeParallelGroup) {
|
|
1740
|
+
const running = job.runningSteps ?? (job.status === "running" ? 1 : 0);
|
|
1741
|
+
const done = job.completedSteps ?? (job.status === "complete" ? stepsTotal : 0);
|
|
1742
|
+
if (job.mode === "parallel") {
|
|
1743
|
+
if (job.status === "running" && running > 0) parts.push(formatAgentRunningLabel(running));
|
|
1744
|
+
if (stepsTotal > 0) parts.push(`${done}/${stepsTotal} done`);
|
|
1745
|
+
} else {
|
|
1746
|
+
const activeGroup = job.currentStep !== undefined
|
|
1747
|
+
? job.parallelGroups?.find((group) => job.currentStep! >= group.start && job.currentStep! < group.start + group.count)
|
|
1748
|
+
: job.parallelGroups?.find((group) => group.start === 0);
|
|
1749
|
+
const logicalStep = activeGroup?.stepIndex ?? job.currentStep ?? 0;
|
|
1750
|
+
const total = job.chainStepCount ?? stepsTotal;
|
|
1751
|
+
const groupParts = [`${done}/${stepsTotal} done`];
|
|
1752
|
+
if (job.status === "running" && running > 0) groupParts.unshift(formatAgentRunningLabel(running));
|
|
1753
|
+
parts.push(`step ${logicalStep + 1}/${total} · parallel group: ${groupParts.join(" · ")}`);
|
|
1754
|
+
}
|
|
1755
|
+
} else if (job.currentStep !== undefined) {
|
|
1756
|
+
if (job.mode === "chain") {
|
|
1757
|
+
const total = job.chainStepCount ?? stepsTotal;
|
|
1758
|
+
parts.push(`step ${flatToLogicalStepIndex(job.currentStep, total, job.parallelGroups ?? []) + 1}/${total}`);
|
|
1759
|
+
} else if (!isSingleChild) {
|
|
1760
|
+
parts.push(`step ${job.currentStep + 1}/${stepsTotal}`);
|
|
1761
|
+
}
|
|
1762
|
+
} else if (stepsTotal > 1) {
|
|
1763
|
+
parts.push(`steps ${stepsTotal}`);
|
|
1764
|
+
}
|
|
1765
|
+
if (job.toolCount !== undefined) parts.push(formatToolUseStat(job.toolCount));
|
|
1766
|
+
if (job.totalTokens?.total) parts.push(formatTokenUsage(job.totalTokens, "token"));
|
|
1767
|
+
if (job.startedAt !== undefined && job.updatedAt !== undefined) parts.push(formatDuration(Math.max(0, job.updatedAt - job.startedAt)));
|
|
1768
|
+
return statJoin(theme, parts);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
function widgetStepStats(theme: Theme, step: NonNullable<AsyncJobState["steps"]>[number]): string {
|
|
1772
|
+
return statJoin(theme, [
|
|
1773
|
+
step.turnCount !== undefined ? `${step.turnCount} turns` : "",
|
|
1774
|
+
step.toolCount !== undefined ? formatToolUseStat(step.toolCount) : "",
|
|
1775
|
+
step.tokens
|
|
1776
|
+
? step.contextLimit !== undefined
|
|
1777
|
+
? formatContextUsage(step.tokens, step.contextLimit) ?? formatTokenUsage(step.tokens, "token")
|
|
1778
|
+
: step.tokens.total ? formatTokenUsage(step.tokens, "token") : ""
|
|
1779
|
+
: "",
|
|
1780
|
+
step.durationMs !== undefined ? formatDuration(step.durationMs) : "",
|
|
1781
|
+
]);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
function modelThinkingBadge(theme: Theme, model?: string, thinking?: string): string {
|
|
1785
|
+
const label = formatModelThinking(model, thinking);
|
|
1786
|
+
return label ? theme.fg("dim", ` (${label})`) : "";
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
function widgetStepActivityLine(step: NonNullable<AsyncJobState["steps"]>[number], width: number, expanded: boolean, snapshotNow?: number): string {
|
|
1790
|
+
const toolLine = formatCurrentToolLine(step, width, expanded, snapshotNow);
|
|
1791
|
+
if (toolLine) return toolLine;
|
|
1792
|
+
const activity = buildLiveStatusLine(step, snapshotNow);
|
|
1793
|
+
if (activity) return activity;
|
|
1794
|
+
if (step.status === "running") return "thinking…";
|
|
1795
|
+
return "";
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
function widgetOutputPath(job: AsyncJobState, step: NonNullable<AsyncJobState["steps"]>[number]): string | undefined {
|
|
1799
|
+
if (typeof step.index !== "number") return undefined;
|
|
1800
|
+
return path.join(job.asyncDir, `output-${step.index}.log`);
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
function nestedRunName(run: NestedRunSummary): string {
|
|
1804
|
+
if (run.sessionName?.trim()) return run.sessionName.trim();
|
|
1805
|
+
if (run.agent) return run.agent;
|
|
1806
|
+
if (run.agents?.length) return formatWidgetAgents(run.agents);
|
|
1807
|
+
return run.id;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
function nestedStatusGlyph(state: NestedRunSummary["state"] | NestedStepSummary["status"], theme: Theme, seed?: number): string {
|
|
1811
|
+
if (state === "running") return theme.fg("accent", runningGlyph(seed));
|
|
1812
|
+
if (state === "complete" || state === "completed") return theme.fg("success", "✓");
|
|
1813
|
+
if (state === "failed") return theme.fg("error", "✗");
|
|
1814
|
+
if (state === "partial") return theme.fg("warning", "■");
|
|
1815
|
+
if (state === "paused") return theme.fg("warning", "■");
|
|
1816
|
+
if (state === "stopped") return theme.fg("warning", "■");
|
|
1817
|
+
return theme.fg("muted", "◦");
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
function nestedRunSeed(run: NestedRunSummary): number | undefined {
|
|
1821
|
+
return runningSeed(run.lastUpdate, run.lastActivityAt, run.currentStep, run.toolCount, run.turnCount, run.totalTokens?.total, run.currentToolStartedAt);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
function formatClockTime(ms: number | undefined): string | undefined {
|
|
1825
|
+
if (ms === undefined || !Number.isFinite(ms)) return undefined;
|
|
1826
|
+
const date = new Date(ms);
|
|
1827
|
+
const pad = (value: number) => value.toString().padStart(2, "0");
|
|
1828
|
+
return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
function nestedRunEventTime(run: NestedRunSummary): number | undefined {
|
|
1832
|
+
return run.state === "running"
|
|
1833
|
+
? (run.lastActivityAt ?? run.currentToolStartedAt ?? run.lastUpdate ?? run.startedAt)
|
|
1834
|
+
: (run.endedAt ?? run.lastUpdate ?? run.lastActivityAt ?? run.startedAt);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
function nestedStepTimestamp(step: NestedStepSummary, fallback?: number): string | undefined {
|
|
1838
|
+
return formatClockTime(step.status === "running"
|
|
1839
|
+
? (step.lastActivityAt ?? step.currentToolStartedAt ?? fallback ?? step.startedAt)
|
|
1840
|
+
: (step.endedAt ?? step.lastActivityAt ?? fallback ?? step.startedAt));
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
function nestedTimestampPrefix(timestamp: string | undefined): string {
|
|
1844
|
+
return timestamp ? `[${timestamp}] ` : "";
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
function nestedActivity(input: Pick<NestedRunSummary | NestedStepSummary, "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount">, state: NestedRunSummary["state"] | NestedStepSummary["status"], snapshotNow?: number): string {
|
|
1848
|
+
const facts: string[] = [];
|
|
1849
|
+
if (input.currentTool && input.currentToolStartedAt !== undefined && snapshotNow !== undefined) facts.push(`${input.currentTool} ${formatDuration(Math.max(0, snapshotNow - input.currentToolStartedAt))}`);
|
|
1850
|
+
else if (input.currentTool) facts.push(input.currentTool);
|
|
1851
|
+
if (input.currentPath) facts.push(shortenPath(input.currentPath));
|
|
1852
|
+
if (input.turnCount !== undefined) facts.push(`${input.turnCount} turns`);
|
|
1853
|
+
if (input.toolCount !== undefined) facts.push(`${input.toolCount} tools`);
|
|
1854
|
+
const activity = buildLiveStatusLine(input, snapshotNow);
|
|
1855
|
+
if (activity && facts.length) return `${activity} · ${facts.join(" · ")}`;
|
|
1856
|
+
if (activity) return activity;
|
|
1857
|
+
if (facts.length) return facts.join(" · ");
|
|
1858
|
+
if (state === "running") return "thinking…";
|
|
1859
|
+
if (state === "queued" || state === "pending") return "queued…";
|
|
1860
|
+
if (state === "paused") return "Paused";
|
|
1861
|
+
if (state === "stopped") return "Stopped";
|
|
1862
|
+
if (state === "partial") return "Partial";
|
|
1863
|
+
if (state === "failed") return "Failed";
|
|
1864
|
+
return "Done";
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
function formatNestedWidgetLines(children: NestedRunSummary[] | undefined, theme: Theme, width: number, expanded: boolean, snapshotNow?: number, lineBudget = expanded ? 12 : 1): string[] {
|
|
1868
|
+
if (!children?.length || lineBudget <= 0) return [];
|
|
1869
|
+
if (!expanded) {
|
|
1870
|
+
type CollapsedRow = { text: string; prefix: string };
|
|
1871
|
+
const rows: CollapsedRow[] = [];
|
|
1872
|
+
const maxLeaves = 4;
|
|
1873
|
+
const maxLines = Math.min(6, lineBudget);
|
|
1874
|
+
let leaves = 0;
|
|
1875
|
+
let overflow = 0;
|
|
1876
|
+
const appendLeaf = (step: NestedStepSummary | NestedRunSummary, prefix: string, fallback?: number): void => {
|
|
1877
|
+
if (leaves >= maxLeaves) {
|
|
1878
|
+
overflow++;
|
|
1879
|
+
return;
|
|
1880
|
+
}
|
|
1881
|
+
leaves++;
|
|
1882
|
+
const state = "status" in step ? step.status : step.state;
|
|
1883
|
+
const modelThinking = formatModelThinking(step.model, step.thinking);
|
|
1884
|
+
const activity = nestedActivity(step, state, snapshotNow ?? fallback);
|
|
1885
|
+
const timestamp = "status" in step ? nestedStepTimestamp(step, fallback) : formatClockTime(nestedRunEventTime(step));
|
|
1886
|
+
const error = step.error ? ` · ${step.error}` : "";
|
|
1887
|
+
const name = "status" in step ? childDisplayName(step) : nestedRunName(step);
|
|
1888
|
+
rows.push({
|
|
1889
|
+
prefix,
|
|
1890
|
+
text: `${nestedTimestampPrefix(timestamp)}${nestedStatusGlyph(state, theme)} ${name} · ${state}${modelThinking ? ` · ${modelThinking}` : ""}${activity ? ` · ${activity}` : ""}${error}`,
|
|
1891
|
+
});
|
|
1892
|
+
};
|
|
1893
|
+
for (const child of children) {
|
|
1894
|
+
const steps = (child.mode === "parallel" || child.mode === "chain") ? child.steps ?? [] : [];
|
|
1895
|
+
if (steps.length > 0) {
|
|
1896
|
+
const ownerModelThinking = formatModelThinking(child.model, child.thinking);
|
|
1897
|
+
const ownerActivity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
|
|
1898
|
+
const ownerError = child.error ? ` · ${child.error}` : "";
|
|
1899
|
+
rows.push({
|
|
1900
|
+
prefix: "↳ ",
|
|
1901
|
+
text: `OWNER ${nestedStatusGlyph(child.state, theme, nestedRunSeed(child))} ${nestedRunName(child)} · ${child.state}${ownerModelThinking ? ` · ${ownerModelThinking}` : ""}${ownerActivity ? ` · ${ownerActivity}` : ""}${ownerError}`,
|
|
1902
|
+
});
|
|
1903
|
+
for (const step of steps) appendLeaf(step, "↳ │ ", child.lastUpdate);
|
|
1904
|
+
} else {
|
|
1905
|
+
appendLeaf(child, "↳ ", child.lastUpdate);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (overflow > 0) rows.push({ prefix: "↳ ", text: `… +${overflow} more nested leaves` });
|
|
1909
|
+
const visibleRows = rows.length <= maxLines
|
|
1910
|
+
? rows
|
|
1911
|
+
: overflow > 0
|
|
1912
|
+
? [...rows.slice(0, Math.max(0, maxLines - 1)), rows.at(-1)!]
|
|
1913
|
+
: rows.slice(0, maxLines);
|
|
1914
|
+
return visibleRows.map((row, index) => {
|
|
1915
|
+
const marker = index === visibleRows.length - 1 ? "└─" : "├─";
|
|
1916
|
+
const prefix = row.prefix;
|
|
1917
|
+
const text = row.text.startsWith("OWNER ") ? row.text.slice("OWNER ".length) : row.text;
|
|
1918
|
+
return truncLine(theme.fg("dim", `${prefix}${marker} ${text}`), width);
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
const lines: string[] = [];
|
|
1922
|
+
const maxDepth = 2;
|
|
1923
|
+
const append = (items: NestedRunSummary[] | undefined, depth: number, prefix: string): void => {
|
|
1924
|
+
if (!items?.length || lines.length >= lineBudget) return;
|
|
1925
|
+
if (depth > maxDepth) {
|
|
1926
|
+
const aggregate = formatNestedAggregate(items);
|
|
1927
|
+
if (aggregate && lines.length < lineBudget) lines.push(theme.fg("dim", `${prefix}↳ ${aggregate}`));
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
for (let index = 0; index < items.length; index++) {
|
|
1931
|
+
const child = items[index]!;
|
|
1932
|
+
if (lines.length >= lineBudget) {
|
|
1933
|
+
const aggregate = formatNestedAggregate(items.slice(index));
|
|
1934
|
+
if (aggregate) lines[lines.length - 1] = theme.fg("dim", `${prefix}↳ ${aggregate}`);
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
const activity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
|
|
1938
|
+
const error = child.error ? ` · ${child.error}` : "";
|
|
1939
|
+
const modelThinking = formatModelThinking(child.model, child.thinking);
|
|
1940
|
+
lines.push(theme.fg("dim", `${prefix}↳ ${nestedTimestampPrefix(formatClockTime(nestedRunEventTime(child)))}${nestedStatusGlyph(child.state, theme, nestedRunSeed(child))} ${nestedRunName(child)} · ${child.state}${modelThinking ? ` · ${modelThinking}` : ""} · ${activity}${error}`));
|
|
1941
|
+
if (depth === maxDepth) {
|
|
1942
|
+
const aggregate = formatNestedAggregate([...(child.steps?.flatMap((step) => step.children ?? []) ?? []), ...(child.children ?? [])]);
|
|
1943
|
+
if (aggregate && lines.length < lineBudget) lines.push(theme.fg("dim", `${prefix} ↳ ${aggregate}`));
|
|
1944
|
+
continue;
|
|
1945
|
+
}
|
|
1946
|
+
for (const step of child.steps ?? []) {
|
|
1947
|
+
if (lines.length >= lineBudget) return;
|
|
1948
|
+
const modelThinking = formatModelThinking(step.model, step.thinking);
|
|
1949
|
+
lines.push(theme.fg("dim", `${prefix} ↳ ${nestedTimestampPrefix(nestedStepTimestamp(step, child.lastUpdate))}${nestedStatusGlyph(step.status, theme)} ${childDisplayName(step)} · ${step.status}${modelThinking ? ` · ${modelThinking}` : ""} · ${nestedActivity(step, step.status, snapshotNow ?? child.lastUpdate)}`));
|
|
1950
|
+
append(step.children, depth + 1, `${prefix} `);
|
|
1951
|
+
}
|
|
1952
|
+
append(child.children, depth + 1, `${prefix} `);
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
append(children, 0, "");
|
|
1956
|
+
return lines.map((line) => truncLine(line, width));
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
function foregroundStyleWidgetStepLines(
|
|
1960
|
+
job: AsyncJobState,
|
|
1961
|
+
theme: Theme,
|
|
1962
|
+
step: NonNullable<AsyncJobState["steps"]>[number],
|
|
1963
|
+
itemTitle: "Agent" | "Stage" | "Step",
|
|
1964
|
+
index: number,
|
|
1965
|
+
total: number,
|
|
1966
|
+
expanded: boolean,
|
|
1967
|
+
width: number,
|
|
1968
|
+
frame?: number,
|
|
1969
|
+
options?: { rowLabel?: string; rowIndent?: string; detailIndent?: string; rowMarker?: string; includeCurrentPath?: boolean },
|
|
1970
|
+
): string[] {
|
|
1971
|
+
const rowIndent = options?.rowIndent ?? " ";
|
|
1972
|
+
const detailIndent = options?.detailIndent ?? " ";
|
|
1973
|
+
const status = widgetStepStatus(step.status, theme);
|
|
1974
|
+
const stats = widgetStepStats(theme, step);
|
|
1975
|
+
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
1976
|
+
const collapseDetails = shouldCollapseSingleChildDetails(job, step);
|
|
1977
|
+
const displayName = collapseDetails ? singleChildAgentName(job, step) : childDisplayName(step);
|
|
1978
|
+
const stageName = itemTitle === "Stage"
|
|
1979
|
+
? compactTaskText(undefined, step.label) ?? boundedLaneValue(step.workflowKey) ?? displayName
|
|
1980
|
+
: undefined;
|
|
1981
|
+
const stageIdentity = stageName && stageName !== displayName ? `${stageName} (${displayName})` : stageName ?? displayName;
|
|
1982
|
+
const rowLabel = collapseDetails ? displayName : (options?.rowLabel ?? `${itemTitle} ${index}/${total}: ${itemTitle === "Stage" ? stageIdentity : displayName}`);
|
|
1983
|
+
const rowMarker = options?.rowMarker ? `${options.rowMarker} ` : "";
|
|
1984
|
+
const lines = [`${rowIndent}${rowMarker}${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index - 1), frame)} ${themeBold(theme, rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`];
|
|
1985
|
+
const lane = projectAsyncLane(job, step);
|
|
1986
|
+
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, detailIndent));
|
|
1987
|
+
const task = collapseDetails ? singleChildTask(job, step) : compactTaskText(step.description, step.label);
|
|
1988
|
+
if (task) lines.push(`${detailIndent}${theme.fg("dim", `task: ${task}`)}`);
|
|
1989
|
+
const activity = widgetStepActivityLine(step, width, expanded, job.updatedAt);
|
|
1990
|
+
const currentPath = options?.includeCurrentPath && step.currentPath ? shortenPath(step.currentPath) : undefined;
|
|
1991
|
+
const activityWithPath = currentPath && activity && !activity.includes(currentPath)
|
|
1992
|
+
? `${activity} · ${currentPath}`
|
|
1993
|
+
: activity ?? currentPath;
|
|
1994
|
+
if (activityWithPath) lines.push(`${detailIndent}${theme.fg("dim", `⎿ ${activityWithPath}`)}`);
|
|
1995
|
+
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
|
|
1996
|
+
lines.push(`${detailIndent}${nestedLine}`);
|
|
1997
|
+
}
|
|
1998
|
+
const error = step.error?.trim() || step.execution?.error?.trim();
|
|
1999
|
+
if (error) lines.push(`${detailIndent}${theme.fg("error", `error: ${oneLine(error)}`)}`);
|
|
2000
|
+
if (step.status === "running") {
|
|
2001
|
+
if (!expanded) lines.push(`${detailIndent}${theme.fg("accent", liveDetailHintText())}`);
|
|
2002
|
+
const output = widgetOutputPath(job, step);
|
|
2003
|
+
if (output) lines.push(`${detailIndent}${theme.fg("dim", `output: ${shortenPath(output)}`)}`);
|
|
2004
|
+
if (expanded) {
|
|
2005
|
+
const liveStatus = buildLiveStatusLine(step, job.updatedAt);
|
|
2006
|
+
if (liveStatus && liveStatus !== activity) lines.push(`${detailIndent}${theme.fg("accent", liveStatus)}`);
|
|
2007
|
+
for (const tool of step.recentTools?.slice(-3) ?? []) {
|
|
2008
|
+
const maxArgsLen = Math.max(40, width - 30);
|
|
2009
|
+
const argsPreview = renderToolArgsPreview(tool.args, maxArgsLen, expanded);
|
|
2010
|
+
lines.push(`${detailIndent} ${theme.fg("dim", `${tool.tool}${argsPreview ? `: ${argsPreview}` : ""}`)}`);
|
|
2011
|
+
}
|
|
2012
|
+
for (const line of compactRecentOutputLines(step.recentOutput)) {
|
|
2013
|
+
lines.push(`${detailIndent} ${theme.fg("dim", line)}`);
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
return lines;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
function hostStepWidgetLines(job: AsyncJobState, theme: Theme, indent: string): string[] {
|
|
2021
|
+
const rows = projectAsyncWorkflowRows([], job.hostSteps).filter((row) => row.kind);
|
|
2022
|
+
const visible = rows.slice(0, 8);
|
|
2023
|
+
const lines = visible.map((row) => {
|
|
2024
|
+
const state = hostStepVerdictLabel(row.state as HostStepState, row.verdict as HostStepVerdict | undefined);
|
|
2025
|
+
const glyph = state === "running" ? theme.fg("accent", "●")
|
|
2026
|
+
: state === "pending" ? theme.fg("muted", "◦")
|
|
2027
|
+
: state === "pass" ? theme.fg("success", "✓")
|
|
2028
|
+
: state === "fail" || state === "error" ? theme.fg("error", "✗")
|
|
2029
|
+
: theme.fg("warning", "■");
|
|
2030
|
+
const details = [
|
|
2031
|
+
row.provider ? `provider:${row.provider}` : undefined,
|
|
2032
|
+
row.role ? `role:${row.role}` : undefined,
|
|
2033
|
+
row.target,
|
|
2034
|
+
row.detail,
|
|
2035
|
+
row.reasonCode ? `reason:${row.reasonCode}` : undefined,
|
|
2036
|
+
row.freshness?.stale ? "stale" : row.freshness?.observedRef ? `ref:${row.freshness.observedRef}` : undefined,
|
|
2037
|
+
row.reportPath ? `out:${hostStepReportName(row.reportPath)}` : undefined,
|
|
2038
|
+
].filter(Boolean).join(" · ");
|
|
2039
|
+
return `${indent}${glyph} ${row.kind}: ${row.name} · ${state}${details ? ` · ${details}` : ""}`;
|
|
2040
|
+
});
|
|
2041
|
+
if (rows.length > visible.length) lines.push(`${indent}${theme.fg("dim", `… +${rows.length - visible.length} host steps hidden`)}`);
|
|
2042
|
+
return lines;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
function foregroundStyleWidgetDetails(job: AsyncJobState, theme: Theme, expanded: boolean, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2046
|
+
const { steps } = projection;
|
|
2047
|
+
if (!steps.length) {
|
|
2048
|
+
const lane = projectAsyncLane(job, laneStepForJob(job, steps));
|
|
2049
|
+
return [
|
|
2050
|
+
...workflowPreflightLines(job, expanded),
|
|
2051
|
+
...(lane ? formatLaneProjectionLines(lane, theme, " ") : []),
|
|
2052
|
+
...hostStepWidgetLines(job, theme, " "),
|
|
2053
|
+
` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
|
|
2054
|
+
...formatNestedWidgetLines(job.nestedChildren, theme, width, expanded, job.updatedAt, expanded ? 12 : 6).map((line) => ` ${line}`),
|
|
2055
|
+
];
|
|
2056
|
+
}
|
|
2057
|
+
if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
|
|
2058
|
+
const lines: string[] = workflowPreflightLines(job, expanded);
|
|
2059
|
+
const group = activeParallelWidgetGroup(job);
|
|
2060
|
+
if (group) {
|
|
2061
|
+
lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup)));
|
|
2062
|
+
} else {
|
|
2063
|
+
const { stageProgress, plannedKeys } = projection;
|
|
2064
|
+
const total = job.mode === "chain"
|
|
2065
|
+
? job.chainStepCount ?? job.stepsTotal ?? steps.length
|
|
2066
|
+
: stageProgress?.total ?? job.stepsTotal ?? steps.length;
|
|
2067
|
+
const stageTotal = stageProgress?.total ?? total;
|
|
2068
|
+
const extraStepCount = plannedKeys
|
|
2069
|
+
? steps.filter((step) => step.workflowKey === undefined || !plannedKeys.has(step.workflowKey)).length
|
|
2070
|
+
: total;
|
|
2071
|
+
let extraStepIndex = 0;
|
|
2072
|
+
for (const [index, step] of steps.entries()) {
|
|
2073
|
+
const isPlannedStage = plannedKeys !== undefined && step.workflowKey !== undefined && plannedKeys.has(step.workflowKey);
|
|
2074
|
+
const itemTitle = isPlannedStage ? "Stage" : "Step";
|
|
2075
|
+
const displayIndex = isPlannedStage ? (step.index ?? index) + 1 : plannedKeys ? ++extraStepIndex : index + 1;
|
|
2076
|
+
const displayTotal = isPlannedStage ? stageTotal : extraStepCount;
|
|
2077
|
+
lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame));
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
lines.push(...hostStepWidgetLines(job, theme, " "));
|
|
2081
|
+
const attached = new Set(steps.flatMap((step) => step.children?.map((child) => child.id) ?? []));
|
|
2082
|
+
const unattached = job.nestedChildren?.filter((child) => !attached.has(child.id)) ?? [];
|
|
2083
|
+
for (const nestedLine of formatNestedWidgetLines(unattached, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
|
|
2084
|
+
lines.push(` ${nestedLine}`);
|
|
2085
|
+
}
|
|
2086
|
+
return lines;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
function buildSingleWidgetLines(job: AsyncJobState, theme: Theme, width: number, expanded: boolean, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2090
|
+
const stats = widgetStats(job, theme, projection);
|
|
2091
|
+
const count = job.mode === "chain" ? job.chainStepCount : projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length;
|
|
2092
|
+
const mode = widgetJobName(job);
|
|
2093
|
+
const title = isSingleChildAsyncJob(job)
|
|
2094
|
+
? "async subagent"
|
|
2095
|
+
: `async subagent ${mode}${count && count > 1 ? ` (${count})` : ""}`;
|
|
2096
|
+
const collapseDetails = job.steps?.length === 1 && shouldCollapseSingleChildDetails(job, job.steps[0]!);
|
|
2097
|
+
const summary = `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, mode)}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`;
|
|
2098
|
+
return [
|
|
2099
|
+
`${theme.fg("toolTitle", themeBold(theme, title))} ${theme.fg("dim", "· background")}`,
|
|
2100
|
+
...(collapseDetails ? [] : [summary]),
|
|
2101
|
+
...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection),
|
|
2102
|
+
].map((line) => truncLine(line, width));
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
function compactSingleWidgetLines(job: AsyncJobState, theme: Theme, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string[] {
|
|
2106
|
+
const fullLines = buildSingleWidgetLines(job, theme, width, false, frame, projection);
|
|
2107
|
+
if (fullLines.length <= 10 || !job.steps?.length || (job.mode !== "parallel" && !job.activeParallelGroup)) return fullLines;
|
|
2108
|
+
|
|
2109
|
+
const group = activeParallelWidgetGroup(job);
|
|
2110
|
+
if (!group) return fullLines;
|
|
2111
|
+
const rows = parallelWidgetStepRows(group.steps, group.total, Boolean(job.activeParallelGroup));
|
|
2112
|
+
const lines = fullLines.slice(0, 2);
|
|
2113
|
+
lines.push(parallelWidgetGroupHeader(group, theme, frame));
|
|
2114
|
+
for (const [rowIndex, row] of rows.entries()) {
|
|
2115
|
+
const step = row.step;
|
|
2116
|
+
const status = widgetStepStatus(step.status, theme);
|
|
2117
|
+
const activity = widgetStepActivityLine(step, width, false, job.updatedAt);
|
|
2118
|
+
const stepStats = widgetStepStats(theme, step);
|
|
2119
|
+
const activitySuffix = activity ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", activity)}` : "";
|
|
2120
|
+
const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
|
|
2121
|
+
const task = compactTaskText(step.description, step.label);
|
|
2122
|
+
const taskSuffix = task ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", `task: ${task}`)}` : "";
|
|
2123
|
+
const marker = rowIndex === rows.length - 1 && rowIndex >= group.total - 1 ? "└─" : "├─";
|
|
2124
|
+
lines.push(` ${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, row.index), frame)} ${themeBold(theme, row.rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${taskSuffix}${activitySuffix}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}`);
|
|
2125
|
+
const lane = projectAsyncLane(job, step);
|
|
2126
|
+
if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
|
|
2127
|
+
for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, false, job.updatedAt, 6)) lines.push(` ${nestedLine}`);
|
|
2128
|
+
}
|
|
2129
|
+
lines.push(...hostStepWidgetLines(job, theme, " "));
|
|
2130
|
+
if (job.steps.some((step) => step.status === "running")) lines.push(theme.fg("accent", ` ${liveDetailHintText()}`));
|
|
2131
|
+
return lines.map((line) => truncLine(line, width));
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
type WidgetRenderTier = "full" | "single-line" | "progressive";
|
|
2135
|
+
|
|
2136
|
+
interface WidgetLayoutSession {
|
|
2137
|
+
expanded: boolean;
|
|
2138
|
+
rows: number;
|
|
2139
|
+
columns: number;
|
|
2140
|
+
tier: WidgetRenderTier;
|
|
2141
|
+
lockedRows?: number;
|
|
2142
|
+
visibleJobKeys: string[];
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
const RESERVED_NON_WIDGET_ROWS = 19;
|
|
2146
|
+
|
|
2147
|
+
let widgetLayoutSession: WidgetLayoutSession | undefined;
|
|
2148
|
+
|
|
2149
|
+
function resetWidgetLayoutSession(): void {
|
|
2150
|
+
widgetLayoutSession = undefined;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
function estimateAvailableWidgetRows(): number {
|
|
2154
|
+
const rows = process.stdout.rows || 30;
|
|
2155
|
+
return Math.max(1, rows - RESERVED_NON_WIDGET_ROWS);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
function currentTerminalRows(): number {
|
|
2159
|
+
return process.stdout.rows || 30;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
function currentTerminalColumns(): number {
|
|
2163
|
+
return process.stdout.columns || 120;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
function widgetSessionMatches(expanded: boolean): boolean {
|
|
2167
|
+
return widgetLayoutSession?.expanded === expanded
|
|
2168
|
+
&& widgetLayoutSession.rows === currentTerminalRows()
|
|
2169
|
+
&& widgetLayoutSession.columns === currentTerminalColumns();
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
function widgetHeaderCounts(jobs: AsyncJobState[]): { running: AsyncJobState[]; queued: AsyncJobState[]; complete: AsyncJobState[]; failed: AsyncJobState[]; paused: AsyncJobState[]; stopped: AsyncJobState[] } {
|
|
2173
|
+
return {
|
|
2174
|
+
running: jobs.filter((job) => job.status === "running"),
|
|
2175
|
+
queued: jobs.filter((job) => job.status === "queued"),
|
|
2176
|
+
complete: jobs.filter((job) => job.status === "complete"),
|
|
2177
|
+
failed: jobs.filter((job) => job.status === "failed"),
|
|
2178
|
+
paused: jobs.filter((job) => job.status === "paused"),
|
|
2179
|
+
stopped: jobs.filter((job) => job.status === "stopped"),
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
function buildSingleLineWidgetLines(jobs: AsyncJobState[], theme: Theme, width: number, frame?: number): string[] {
|
|
2184
|
+
const counts = widgetHeaderCounts(jobs);
|
|
2185
|
+
const hasActive = counts.running.length > 0 || counts.queued.length > 0;
|
|
2186
|
+
const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
|
|
2187
|
+
const parts: string[] = [];
|
|
2188
|
+
if (counts.running.length > 0) parts.push(`${counts.running.length}/${jobs.length} running`);
|
|
2189
|
+
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2190
|
+
if (counts.failed.length > 0) parts.push(`${counts.failed.length} failed`);
|
|
2191
|
+
if (counts.stopped.length > 0) parts.push(`${counts.stopped.length} stopped`);
|
|
2192
|
+
if (counts.paused.length > 0) parts.push(`${counts.paused.length} paused`);
|
|
2193
|
+
if (!hasActive && counts.complete.length > 0) parts.push(`${counts.complete.length}/${jobs.length} done`);
|
|
2194
|
+
return [truncLine(`${theme.fg(hasActive ? "accent" : "dim", glyph)} ${theme.fg(hasActive ? "accent" : "dim", "subagents")} (${parts.join(", ") || `${jobs.length} total`})`, width)];
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
function orderedWidgetJobs(jobs: AsyncJobState[]): AsyncJobState[] {
|
|
2198
|
+
return [
|
|
2199
|
+
...jobs.filter((job) => job.status === "running"),
|
|
2200
|
+
...jobs.filter((job) => job.status === "queued"),
|
|
2201
|
+
...jobs.filter((job) => job.status !== "running" && job.status !== "queued"),
|
|
2202
|
+
];
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
function progressiveJobKey(job: AsyncJobState): string {
|
|
2206
|
+
return job.asyncId;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
function isProgressiveActiveJob(job: AsyncJobState | undefined): boolean {
|
|
2210
|
+
return job?.status === "running" || job?.status === "queued";
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
function selectProgressiveJobKeys(jobs: AsyncJobState[], previousKeys: string[], bodyRows: number): string[] {
|
|
2214
|
+
if (bodyRows <= 0) return [];
|
|
2215
|
+
const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
|
|
2216
|
+
const selected: string[] = [];
|
|
2217
|
+
const append = (key: string): void => {
|
|
2218
|
+
if (selected.includes(key) || !jobsByKey.has(key)) return;
|
|
2219
|
+
selected.push(key);
|
|
2220
|
+
};
|
|
2221
|
+
for (const key of previousKeys) {
|
|
2222
|
+
if (!isProgressiveActiveJob(jobsByKey.get(key))) continue;
|
|
2223
|
+
append(key);
|
|
2224
|
+
if (selected.length >= bodyRows) return selected;
|
|
2225
|
+
}
|
|
2226
|
+
for (const job of orderedWidgetJobs(jobs)) {
|
|
2227
|
+
if (!isProgressiveActiveJob(job)) continue;
|
|
2228
|
+
const key = progressiveJobKey(job);
|
|
2229
|
+
append(key);
|
|
2230
|
+
if (selected.length >= bodyRows) break;
|
|
2231
|
+
}
|
|
2232
|
+
if (selected.length >= bodyRows) return selected;
|
|
2233
|
+
for (const key of previousKeys) {
|
|
2234
|
+
if (isProgressiveActiveJob(jobsByKey.get(key))) continue;
|
|
2235
|
+
append(key);
|
|
2236
|
+
if (selected.length >= bodyRows) return selected;
|
|
2237
|
+
}
|
|
2238
|
+
for (const job of orderedWidgetJobs(jobs)) {
|
|
2239
|
+
const key = progressiveJobKey(job);
|
|
2240
|
+
append(key);
|
|
2241
|
+
if (selected.length >= bodyRows) break;
|
|
2242
|
+
}
|
|
2243
|
+
return selected;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
function progressiveHeaderLine(jobs: AsyncJobState[], theme: Theme, width: number, frame?: number): string {
|
|
2247
|
+
const counts = widgetHeaderCounts(jobs);
|
|
2248
|
+
const hasActive = counts.running.length > 0 || counts.queued.length > 0;
|
|
2249
|
+
const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
|
|
2250
|
+
const parts: string[] = [];
|
|
2251
|
+
if (counts.running.length > 0) parts.push(formatAgentRunningLabel(counts.running.length));
|
|
2252
|
+
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2253
|
+
if (!hasActive) {
|
|
2254
|
+
if (counts.failed.length > 0) parts.push(`${counts.failed.length} failed`);
|
|
2255
|
+
if (counts.stopped.length > 0) parts.push(`${counts.stopped.length} stopped`);
|
|
2256
|
+
if (counts.paused.length > 0) parts.push(`${counts.paused.length} paused`);
|
|
2257
|
+
if (counts.complete.length > 0) parts.push(`${counts.complete.length}/${jobs.length} done`);
|
|
2258
|
+
}
|
|
2259
|
+
return truncLine(`${theme.fg(hasActive ? "accent" : "dim", glyph)} ${theme.fg(hasActive ? "accent" : "dim", "Async agents")} ${theme.fg("dim", "·")} ${theme.fg("dim", parts.join(", ") || `${jobs.length} total`)}`, width);
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
function progressiveJobLine(job: AsyncJobState, theme: Theme, width: number, frame?: number, projection = buildWorkflowWidgetProjection(job)): string {
|
|
2263
|
+
const stats = widgetStats(job, theme, projection);
|
|
2264
|
+
const activity = widgetActivity(job);
|
|
2265
|
+
const status = job.status === "complete" ? "done" : job.status;
|
|
2266
|
+
const lane = projectAsyncLane(job, laneStepForJob(job, projection.steps));
|
|
2267
|
+
const laneSummary = lane
|
|
2268
|
+
? [lane.label ?? lane.role, lane.phase ? `phase:${lane.phase}` : undefined, lane.output ? `out:${lane.output}` : undefined, lane.workspace ? `workspace:${lane.workspace}` : `ref:${lane.ref}`].filter(Boolean).join(" · ")
|
|
2269
|
+
: "";
|
|
2270
|
+
const laneSignals = lane
|
|
2271
|
+
? [lane.next ? `next:${lane.next}` : undefined, ...lane.chips.map((chip) => formatLaneChip(chip, theme))].filter(Boolean).join(" · ")
|
|
2272
|
+
: "";
|
|
2273
|
+
const parts = [
|
|
2274
|
+
`${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}`,
|
|
2275
|
+
theme.fg("dim", status),
|
|
2276
|
+
laneSignals ? laneSignals : "",
|
|
2277
|
+
laneSummary ? theme.fg("dim", laneSummary) : "",
|
|
2278
|
+
stats,
|
|
2279
|
+
activity && activity.toLowerCase() !== status ? theme.fg("dim", activity) : "",
|
|
2280
|
+
].filter(Boolean);
|
|
2281
|
+
return truncLine(` ${widgetStatusGlyph(job, theme, frame)} ${parts.join(` ${theme.fg("dim", "·")} `)}`, width);
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
function progressiveHiddenLine(hiddenJobs: AsyncJobState[], theme: Theme, width: number): string {
|
|
2285
|
+
const counts = widgetHeaderCounts(hiddenJobs);
|
|
2286
|
+
const parts: string[] = [];
|
|
2287
|
+
if (counts.running.length > 0) parts.push(`${counts.running.length} running`);
|
|
2288
|
+
if (counts.queued.length > 0) parts.push(`${counts.queued.length} queued`);
|
|
2289
|
+
const finished = counts.complete.length + counts.failed.length + counts.paused.length + counts.stopped.length;
|
|
2290
|
+
if (finished > 0) parts.push(`${finished} finished`);
|
|
2291
|
+
return truncLine(theme.fg("dim", ` +${hiddenJobs.length} more${parts.length ? ` (${parts.join(", ")})` : ""}`), width);
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
function buildProgressiveWidgetLines(jobs: AsyncJobState[], theme: Theme, width: number, lockedRows: number, previousKeys: string[], frame?: number, projectionFor: WorkflowWidgetProjectionLookup = workflowWidgetProjectionLookup()): { lines: string[]; visibleJobKeys: string[] } {
|
|
2295
|
+
const rowCount = Math.max(1, lockedRows);
|
|
2296
|
+
if (rowCount === 1) return { lines: buildSingleLineWidgetLines(jobs, theme, width, frame), visibleJobKeys: [] };
|
|
2297
|
+
|
|
2298
|
+
const bodyRows = rowCount - 1;
|
|
2299
|
+
let visibleJobKeys = selectProgressiveJobKeys(jobs, previousKeys, bodyRows);
|
|
2300
|
+
const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
|
|
2301
|
+
let visibleJobs = visibleJobKeys.map((key) => jobsByKey.get(key)).filter((job): job is AsyncJobState => Boolean(job));
|
|
2302
|
+
let hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
|
|
2303
|
+
const needsHiddenLine = hiddenJobs.length > 0;
|
|
2304
|
+
|
|
2305
|
+
if (needsHiddenLine && visibleJobs.length >= bodyRows && bodyRows > 0) {
|
|
2306
|
+
visibleJobs = visibleJobs.slice(0, bodyRows - 1);
|
|
2307
|
+
visibleJobKeys = visibleJobs.map(progressiveJobKey);
|
|
2308
|
+
hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
const lines = [
|
|
2312
|
+
progressiveHeaderLine(jobs, theme, width, frame),
|
|
2313
|
+
...visibleJobs.map((job) => progressiveJobLine(job, theme, width, frame, projectionFor(job))),
|
|
2314
|
+
];
|
|
2315
|
+
if (hiddenJobs.length > 0 && lines.length < rowCount) lines.push(progressiveHiddenLine(hiddenJobs, theme, width));
|
|
2316
|
+
while (lines.length < rowCount) lines.push(" ");
|
|
2317
|
+
return { lines: lines.slice(0, rowCount), visibleJobKeys };
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
function collapsedWidgetLineBudget(rows: number): number {
|
|
2321
|
+
return Math.max(10, Math.min(14, Math.floor(rows * 0.35)));
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
function paddedWidgetLine(line: string, width: number): string {
|
|
2325
|
+
if (width <= 2) return " ".repeat(Math.max(0, width));
|
|
2326
|
+
const text = ` ${truncLine(line, width - 2)} `;
|
|
2327
|
+
return `${text}${" ".repeat(Math.max(0, width - visibleWidth(text)))}`;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
function fitWidgetLineBudget(lines: string[], theme: Theme, width: number, expanded: boolean): string[] {
|
|
2331
|
+
const rows = process.stdout.rows || 30;
|
|
2332
|
+
const budget = expanded
|
|
2333
|
+
? Math.max(12, Math.min(24, Math.floor(rows * 0.55)))
|
|
2334
|
+
: collapsedWidgetLineBudget(rows);
|
|
2335
|
+
if (lines.length <= budget) return lines;
|
|
2336
|
+
const visibleLines = Math.max(1, budget - 1);
|
|
2337
|
+
const hiddenCount = lines.length - visibleLines;
|
|
2338
|
+
const hint = expanded
|
|
2339
|
+
? `… ${hiddenCount} live-detail lines hidden`
|
|
2340
|
+
: `… ${hiddenCount} lines hidden · ${liveDetailKeyText()} expands`;
|
|
2341
|
+
return [...lines.slice(0, visibleLines), truncLine(theme.fg("dim", hint), width)];
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
function fitAdaptiveWidgetLines(jobs: AsyncJobState[], buildLines: () => string[], theme: Theme, width: number, expanded: boolean, frame?: number, projectionFor?: WorkflowWidgetProjectionLookup): string[] {
|
|
2345
|
+
if (expanded) {
|
|
2346
|
+
resetWidgetLayoutSession();
|
|
2347
|
+
return fitWidgetLineBudget(buildLines(), theme, width, true);
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
const hasMatchingSession = widgetSessionMatches(expanded);
|
|
2351
|
+
const rows = currentTerminalRows();
|
|
2352
|
+
const columns = currentTerminalColumns();
|
|
2353
|
+
const availableRows = estimateAvailableWidgetRows();
|
|
2354
|
+
|
|
2355
|
+
if (hasMatchingSession && widgetLayoutSession?.tier === "single-line") {
|
|
2356
|
+
return buildSingleLineWidgetLines(jobs, theme, width, frame);
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
if (hasMatchingSession && widgetLayoutSession?.tier === "progressive" && widgetLayoutSession.lockedRows !== undefined) {
|
|
2360
|
+
const rendered = buildProgressiveWidgetLines(jobs, theme, width, widgetLayoutSession.lockedRows, widgetLayoutSession.visibleJobKeys, frame, projectionFor);
|
|
2361
|
+
widgetLayoutSession.visibleJobKeys = rendered.visibleJobKeys;
|
|
2362
|
+
return rendered.lines;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
const lines = buildLines();
|
|
2366
|
+
if (lines.length <= availableRows) {
|
|
2367
|
+
widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
|
|
2368
|
+
return fitWidgetLineBudget(lines, theme, width, false);
|
|
2369
|
+
}
|
|
2370
|
+
if (availableRows > 2 && jobs.length === 1 && projectionFor?.(jobs[0]!).stageProgress) {
|
|
2371
|
+
widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
|
|
2372
|
+
return fitWidgetLineBudget(lines, theme, width, false);
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
if (availableRows <= 2) {
|
|
2376
|
+
widgetLayoutSession = { expanded, rows, columns, tier: "single-line", visibleJobKeys: [] };
|
|
2377
|
+
return buildSingleLineWidgetLines(jobs, theme, width, frame);
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
const lockedRows = Math.min(availableRows, collapsedWidgetLineBudget(rows));
|
|
2381
|
+
const rendered = buildProgressiveWidgetLines(jobs, theme, width, lockedRows, [], frame, projectionFor);
|
|
2382
|
+
widgetLayoutSession = { expanded, rows, columns, tier: "progressive", lockedRows, visibleJobKeys: rendered.visibleJobKeys };
|
|
2383
|
+
return rendered.lines;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
function buildWidgetComponent(jobs: AsyncJobState[], isExpanded: () => boolean): (_tui: unknown, theme: Theme) => Component {
|
|
2387
|
+
return (_tui, theme) => {
|
|
2388
|
+
const container = new Container();
|
|
2389
|
+
let cachedRenderWidth: number | undefined;
|
|
2390
|
+
let cachedFrame: number | undefined;
|
|
2391
|
+
let cachedExpanded: boolean | undefined;
|
|
2392
|
+
let cachedLines: string[] | undefined;
|
|
2393
|
+
container.render = (renderWidth: number): string[] => {
|
|
2394
|
+
const frame = Math.floor(Date.now() / WIDGET_ANIMATION_INTERVAL_MS);
|
|
2395
|
+
const expanded = isExpanded();
|
|
2396
|
+
if (cachedLines && cachedRenderWidth === renderWidth && cachedFrame === frame && cachedExpanded === expanded) return cachedLines;
|
|
2397
|
+
const width = Math.max(0, renderWidth - 2);
|
|
2398
|
+
const projectionFor = workflowWidgetProjectionLookup();
|
|
2399
|
+
const buildLines = (): string[] => expanded
|
|
2400
|
+
? buildWidgetLinesWithProjection(jobs, theme, width, true, frame, projectionFor)
|
|
2401
|
+
: jobs.length === 1
|
|
2402
|
+
? compactSingleWidgetLines(jobs[0]!, theme, width, frame, projectionFor(jobs[0]!))
|
|
2403
|
+
: buildWidgetLinesWithProjection(jobs, theme, width, false, frame, projectionFor);
|
|
2404
|
+
cachedRenderWidth = renderWidth;
|
|
2405
|
+
cachedFrame = frame;
|
|
2406
|
+
cachedExpanded = expanded;
|
|
2407
|
+
cachedLines = fitAdaptiveWidgetLines(jobs, buildLines, theme, width, expanded, frame, projectionFor).map((line) => paddedWidgetLine(line, renderWidth));
|
|
2408
|
+
return cachedLines;
|
|
2409
|
+
};
|
|
2410
|
+
return container;
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
function buildWidgetLinesWithProjection(jobs: AsyncJobState[], theme: Theme, width = getTermWidth(), expanded = false, frame?: number, projectionFor: WorkflowWidgetProjectionLookup = workflowWidgetProjectionLookup()): string[] {
|
|
2415
|
+
if (jobs.length === 0) return [];
|
|
2416
|
+
if (jobs.length === 1) return buildSingleWidgetLines(jobs[0]!, theme, width, expanded, frame, projectionFor(jobs[0]!));
|
|
2417
|
+
const running = jobs.filter((job) => job.status === "running");
|
|
2418
|
+
const queued = jobs.filter((job) => job.status === "queued");
|
|
2419
|
+
const finished = jobs.filter((job) => job.status !== "running" && job.status !== "queued");
|
|
2420
|
+
|
|
2421
|
+
const lines: string[] = [];
|
|
2422
|
+
const hasActive = running.length > 0 || queued.length > 0;
|
|
2423
|
+
const headerGlyph = running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(running), frame)) : hasActive ? "●" : "○";
|
|
2424
|
+
lines.push(truncLine(`${theme.fg(hasActive ? "accent" : "dim", headerGlyph)} ${theme.fg(hasActive ? "accent" : "dim", "Async agents")} ${theme.fg("dim", "· background")}`, width));
|
|
2425
|
+
|
|
2426
|
+
const items: string[][] = [];
|
|
2427
|
+
let hiddenRunning = 0;
|
|
2428
|
+
let hiddenFinished = 0;
|
|
2429
|
+
let queuedSummaryShown = false;
|
|
2430
|
+
let slots = MAX_WIDGET_JOBS;
|
|
2431
|
+
const appendJob = (job: AsyncJobState): void => {
|
|
2432
|
+
const projection = projectionFor(job);
|
|
2433
|
+
const stats = widgetStats(job, theme, projection);
|
|
2434
|
+
items.push([
|
|
2435
|
+
`${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`,
|
|
2436
|
+
` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
|
|
2437
|
+
...widgetLaneDetailLines(job, theme, projection),
|
|
2438
|
+
...widgetParallelAgentDetails(job, theme, expanded, width, frame),
|
|
2439
|
+
]);
|
|
2440
|
+
};
|
|
2441
|
+
|
|
2442
|
+
for (const job of running) {
|
|
2443
|
+
if (slots <= 0) { hiddenRunning++; continue; }
|
|
2444
|
+
appendJob(job);
|
|
2445
|
+
slots--;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
if (queued.length > 0 && slots > 0) {
|
|
2449
|
+
items.push([`${theme.fg("muted", "◦")} ${theme.fg("dim", `${queued.length} queued`)}`]);
|
|
2450
|
+
queuedSummaryShown = true;
|
|
2451
|
+
slots--;
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
for (const job of finished) {
|
|
2455
|
+
if (slots <= 0) { hiddenFinished++; continue; }
|
|
2456
|
+
appendJob(job);
|
|
2457
|
+
slots--;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
const hiddenQueued = queued.length > 0 && !queuedSummaryShown ? queued.length : 0;
|
|
2461
|
+
const hiddenTotal = hiddenRunning + hiddenFinished + hiddenQueued;
|
|
2462
|
+
if (hiddenTotal > 0) {
|
|
2463
|
+
const parts: string[] = [];
|
|
2464
|
+
if (hiddenRunning > 0) parts.push(`${hiddenRunning} running`);
|
|
2465
|
+
if (hiddenQueued > 0) parts.push(`${hiddenQueued} queued`);
|
|
2466
|
+
if (hiddenFinished > 0) parts.push(`${hiddenFinished} finished`);
|
|
2467
|
+
items.push([theme.fg("dim", `+${hiddenTotal} more (${parts.join(", ")})`)]);
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
for (let i = 0; i < items.length; i++) {
|
|
2471
|
+
const item = items[i]!;
|
|
2472
|
+
const last = i === items.length - 1;
|
|
2473
|
+
const branch = last ? "└─" : "├─";
|
|
2474
|
+
const continuation = last ? " " : "│ ";
|
|
2475
|
+
lines.push(truncLine(`${theme.fg("dim", branch)} ${item[0]}`, width));
|
|
2476
|
+
for (const detail of item.slice(1)) {
|
|
2477
|
+
lines.push(truncLine(`${theme.fg("dim", continuation)} ${detail}`, width));
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
return lines;
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
export function buildWidgetLines(jobs: AsyncJobState[], theme: Theme, width = getTermWidth(), expanded = false, frame?: number): string[] {
|
|
2485
|
+
return buildWidgetLinesWithProjection(jobs, theme, width, expanded, frame);
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Render the async jobs widget
|
|
2490
|
+
*/
|
|
2491
|
+
export function renderWidget(ctx: ExtensionContext, jobs: AsyncJobState[]): void {
|
|
2492
|
+
if (jobs.length === 0) {
|
|
2493
|
+
resetWidgetLayoutSession();
|
|
2494
|
+
if (ctx.hasUI) ctx.ui.setWidget(WIDGET_KEY, undefined);
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
if (!ctx.hasUI) return;
|
|
2498
|
+
if ((ctx as { mode?: string }).mode === "rpc") {
|
|
2499
|
+
ctx.ui.setWidget(WIDGET_KEY, encodeAsyncStatusSnapshotWidget(jobs));
|
|
2500
|
+
return;
|
|
2501
|
+
}
|
|
2502
|
+
ctx.ui.setWidget(WIDGET_KEY, buildWidgetComponent(jobs, () => ctx.ui.getToolsExpanded?.() ?? false));
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
function renderSingleCompact(
|
|
2506
|
+
d: Details,
|
|
2507
|
+
r: Details["results"][number],
|
|
2508
|
+
theme: Theme,
|
|
2509
|
+
layout: MainWindowRenderLayout,
|
|
2510
|
+
frame?: number,
|
|
2511
|
+
foregroundDetachShortcut?: string,
|
|
2512
|
+
): Component {
|
|
2513
|
+
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
2514
|
+
const progress = r.progress || r.progressSummary;
|
|
2515
|
+
const isRunning = isResultRunning(r);
|
|
2516
|
+
const contextBadge = contextModeBadge(theme, r.context ?? d.context);
|
|
2517
|
+
const stats = statJoin(theme, [
|
|
2518
|
+
r.usage?.turns ? `⟳ ${r.usage.turns}` : "",
|
|
2519
|
+
formatProgressStats(theme, progress),
|
|
2520
|
+
]);
|
|
2521
|
+
const c = new Container();
|
|
2522
|
+
const width = getTermWidth() - 4;
|
|
2523
|
+
const detailIndent = mainWindowIndent(layout, 1);
|
|
2524
|
+
const continuationIndent = mainWindowIndent(layout, 2) + (layout.horizontalSpacing > 0 ? " " : "");
|
|
2525
|
+
const modelDisplay = modelThinkingBadge(theme, r.model ?? r.progress?.model, r.thinking ?? r.progress?.thinking);
|
|
2526
|
+
c.addChild(new Text(truncLine(`${resultGlyph(r, output, theme, isRunning, undefined, frame)} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${modelDisplay}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
2527
|
+
|
|
2528
|
+
if (isRunning && r.progress) {
|
|
2529
|
+
const task = compactTaskText(r.task);
|
|
2530
|
+
if (task) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
|
|
2531
|
+
const progressSnapshotNow = snapshotNowForProgress(r.progress);
|
|
2532
|
+
const activity = compactCurrentActivity(r.progress);
|
|
2533
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
|
|
2534
|
+
const liveStatus = buildLiveStatusLine(r.progress, progressSnapshotNow);
|
|
2535
|
+
if (liveStatus && liveStatus !== activity) c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${liveStatus}`), width), 0, 0));
|
|
2536
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, progressSnapshotNow)) {
|
|
2537
|
+
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2538
|
+
}
|
|
2539
|
+
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${foregroundSingleHintText(foregroundDetachShortcut)}`), width), 0, 0));
|
|
2540
|
+
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2541
|
+
return c;
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
|
|
2545
|
+
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2546
|
+
}
|
|
2547
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
|
|
2548
|
+
const preview = firstOutputLine(output);
|
|
2549
|
+
if (preview && r.exitCode === 0 && !hasEmptyTextOutputWithoutOutputTarget(r.task, output)) {
|
|
2550
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${preview}`), width), 0, 0));
|
|
2551
|
+
}
|
|
2552
|
+
if (r.sessionFile) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}session: ${shortenPath(r.sessionFile)}`), width), 0, 0));
|
|
2553
|
+
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2554
|
+
if (r.truncation?.artifactPath) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}full output: ${shortenPath(r.truncation.artifactPath)}`), width), 0, 0));
|
|
2555
|
+
return c;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
function workflowRowGlyph(row: WorkflowChatProgressRow, theme: Theme, frame?: number): string {
|
|
2559
|
+
if (row.state === "planned") return theme.fg("muted", "◦");
|
|
2560
|
+
if (row.state === "running") return theme.fg("accent", runningGlyph(frame));
|
|
2561
|
+
if (row.state === "complete") return theme.fg("success", "✓");
|
|
2562
|
+
if (row.state === "detached" || row.state === "stopped") return theme.fg("warning", "■");
|
|
2563
|
+
return theme.fg("error", "✗");
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
function workflowRowStateLabel(row: WorkflowChatProgressRow, theme: Theme): string {
|
|
2567
|
+
const label = (row.state === "complete" ? "complete" : row.state).padEnd(8);
|
|
2568
|
+
if (row.state === "planned") return theme.fg("dim", label);
|
|
2569
|
+
if (row.state === "running") return theme.fg("accent", label);
|
|
2570
|
+
if (row.state === "complete") return theme.fg("success", label);
|
|
2571
|
+
if (row.state === "detached" || row.state === "stopped") return theme.fg("warning", label);
|
|
2572
|
+
return theme.fg("error", label);
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
function workflowOverallState(rows: WorkflowChatProgressRow[], hasTerminalValue: boolean, isError?: boolean): "running" | "complete" | "failed" | "paused" {
|
|
2576
|
+
if (rows.some((row) => row.state === "failed")) return "failed";
|
|
2577
|
+
if (rows.some((row) => row.state === "detached")) return "paused";
|
|
2578
|
+
if (isError) return "failed";
|
|
2579
|
+
if ((rows.length > 0 && rows.every((row) => row.state === "complete")) || hasTerminalValue) return "complete";
|
|
2580
|
+
return "running";
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
function renderWorkflowChatProgress(d: Details, result: AgentToolResult<Details>, theme: Theme, layout: MainWindowRenderLayout, frame?: number, expanded = false): Component {
|
|
2584
|
+
const workflow = d.workflow;
|
|
2585
|
+
const rows = workflow ? buildWorkflowChatProgressRows(workflow.trace, d.preflight) : d.preflight ? buildWorkflowChatProgressRows([], d.preflight) : [];
|
|
2586
|
+
const state = workflowOverallState(rows, workflow?.value !== undefined, result.isError);
|
|
2587
|
+
const glyph = state === "running" ? theme.fg("accent", runningGlyph(frame)) : state === "complete" ? theme.fg("success", "✓") : state === "paused" ? theme.fg("warning", "■") : theme.fg("error", "✗");
|
|
2588
|
+
const width = getTermWidth() - 4;
|
|
2589
|
+
const runId = d.runId ? d.runId.slice(0, 12) : "workflow";
|
|
2590
|
+
const repoLabel = d.chatProgress?.repoLabel ?? (d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo");
|
|
2591
|
+
const phase = rows.find((row) => row.state === "running" && row.phase)?.phase ?? [...rows].reverse().find((row) => row.phase)?.phase;
|
|
2592
|
+
const c = new Container();
|
|
2593
|
+
const rowIndent = mainWindowIndent(layout, 1);
|
|
2594
|
+
c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold("workflow"))} ${runId} ${theme.fg("dim", "·")} ${d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo"} ${theme.fg("dim", "·")} ${state}`, width), 0, 0));
|
|
2595
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Repo ${repoLabel}`), width), 0, 0));
|
|
2596
|
+
if (d.preflight) c.addChild(new Text(truncLine(theme.fg("dim", formatWorkflowPreflightPlanSummary(d.preflight, { indent: rowIndent })), width), 0, 0));
|
|
2597
|
+
if (phase) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Phase ${phase}`), width), 0, 0));
|
|
2598
|
+
if (rows.length === 0) {
|
|
2599
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ waiting for workflow child launches`), width), 0, 0));
|
|
2600
|
+
return c;
|
|
2601
|
+
}
|
|
2602
|
+
const visible = visibleWorkflowRows(rows);
|
|
2603
|
+
if (visible.hiddenRows > 0) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}… ${visible.hiddenRows} older workflow rows hidden`), width), 0, 0));
|
|
2604
|
+
for (const row of visible.rows) {
|
|
2605
|
+
const status = workflowRowStateLabel(row, theme);
|
|
2606
|
+
const label = row.label && row.label !== row.key ? ` ${oneLine(row.label)}` : "";
|
|
2607
|
+
const duration = row.durationMs !== undefined ? ` ${theme.fg("dim", `· ${formatDuration(row.durationMs)}`)}` : "";
|
|
2608
|
+
const run = row.runId ? ` ${theme.fg("dim", `[${row.runId.slice(0, 8)}]`)}` : "";
|
|
2609
|
+
const error = row.error ? ` ${theme.fg(row.state === "detached" ? "warning" : "error", `· ${compactWorkflowError(row.error)}`)}` : "";
|
|
2610
|
+
const hints = expanded && row.preflight ? [
|
|
2611
|
+
row.preflight.mode ? `mode:${row.preflight.mode}` : undefined,
|
|
2612
|
+
row.preflight.decision ? `decision:${row.preflight.decision}` : undefined,
|
|
2613
|
+
row.preflight.claims?.length ? `claims:${row.preflight.claims.join(",")}` : undefined,
|
|
2614
|
+
row.preflight.expectedOutput ? `expected:${row.preflight.expectedOutput}` : undefined,
|
|
2615
|
+
row.preflight.independence ? `independence:${row.preflight.independence}` : undefined,
|
|
2616
|
+
].filter((value): value is string => Boolean(value)).join(" · ") : "";
|
|
2617
|
+
c.addChild(new Text(truncLine(`${rowIndent}${workflowRowGlyph(row, theme, frame)} ${status} ${theme.bold(row.key)}${label}${run}${duration}${error}${hints ? ` ${theme.fg("dim", `· ${hints}`)}` : ""}`, width), 0, 0));
|
|
2618
|
+
}
|
|
2619
|
+
if (workflow?.preflightWarnings?.length) {
|
|
2620
|
+
const warningLines = expanded
|
|
2621
|
+
? formatWorkflowPreflightWarnings(workflow.preflightWarnings, { indent: rowIndent }).split("\n")
|
|
2622
|
+
: [formatWorkflowPreflightWarningSummary(workflow.preflightWarnings, { indent: rowIndent, hint: "expand for debug" })];
|
|
2623
|
+
for (const warningLine of warningLines) c.addChild(new Text(truncLine(theme.fg("warning", warningLine), width), 0, 0));
|
|
2624
|
+
}
|
|
2625
|
+
if (workflow?.emits.length) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Emits ${workflow.emits.length}`), width), 0, 0));
|
|
2626
|
+
return c;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
function renderMultiCompact(d: Details, theme: Theme, layout: MainWindowRenderLayout, frame?: number): Component {
|
|
2630
|
+
const hasRunning = detailsHaveRunningResult(d);
|
|
2631
|
+
const detached = d.results.some((r) => r.detached)
|
|
2632
|
+
|| workflowGraphHasStatus(d, ["detached"]);
|
|
2633
|
+
const stopped = d.results.some((r) => r.stopped)
|
|
2634
|
+
|| workflowGraphHasStatus(d, ["stopped"]);
|
|
2635
|
+
const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
|
|
2636
|
+
|| workflowGraphHasStatus(d, ["failed"]);
|
|
2637
|
+
const paused = d.results.some((r) => r.interrupted)
|
|
2638
|
+
|| workflowGraphHasStatus(d, ["paused"]);
|
|
2639
|
+
const partial = workflowGraphHasStatus(d, ["partial"]);
|
|
2640
|
+
let totalSummary = d.progressSummary;
|
|
2641
|
+
if (!totalSummary) {
|
|
2642
|
+
let sawProgress = false;
|
|
2643
|
+
const summary = { toolCount: 0, tokens: 0, durationMs: 0 };
|
|
2644
|
+
for (const r of d.results) {
|
|
2645
|
+
const prog = r.progress || r.progressSummary;
|
|
2646
|
+
if (!prog) continue;
|
|
2647
|
+
sawProgress = true;
|
|
2648
|
+
summary.toolCount += prog.toolCount;
|
|
2649
|
+
summary.tokens += prog.tokens;
|
|
2650
|
+
summary.durationMs = d.mode === "chain" ? summary.durationMs + prog.durationMs : Math.max(summary.durationMs, prog.durationMs);
|
|
2651
|
+
}
|
|
2652
|
+
if (sawProgress) totalSummary = summary;
|
|
2653
|
+
}
|
|
2654
|
+
const multiLabel = buildMultiProgressLabel(d, hasRunning);
|
|
2655
|
+
const itemTitle = multiLabel.itemTitle;
|
|
2656
|
+
const stats = statJoin(theme, [multiLabel.headerLabel, formatProgressStats(theme, totalSummary), formatTotalCostStat(d.totalCost)]);
|
|
2657
|
+
const aggregatePresentation = semanticResultPresentation({
|
|
2658
|
+
running: hasRunning,
|
|
2659
|
+
detached,
|
|
2660
|
+
stopped,
|
|
2661
|
+
interrupted: paused,
|
|
2662
|
+
failed,
|
|
2663
|
+
partial,
|
|
2664
|
+
seed: runningSeed(progressRunningSeed(totalSummary), d.currentStepIndex),
|
|
2665
|
+
frame,
|
|
2666
|
+
});
|
|
2667
|
+
const glyph = theme.fg(aggregatePresentation.tone, aggregatePresentation.glyph);
|
|
2668
|
+
const contextBadge = contextModeBadge(theme, d.context);
|
|
2669
|
+
const c = new Container();
|
|
2670
|
+
const width = getTermWidth() - 4;
|
|
2671
|
+
const rowIndent = mainWindowIndent(layout, 1);
|
|
2672
|
+
const detailIndent = mainWindowIndent(layout, 2);
|
|
2673
|
+
c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(d.mode))}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
|
|
2674
|
+
|
|
2675
|
+
const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
|
|
2676
|
+
const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
|
|
2677
|
+
const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents!.length);
|
|
2678
|
+
const chainEntries = buildChainRenderEntries(d, multiLabel);
|
|
2679
|
+
const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
|
|
2680
|
+
for (const entry of renderEntries) {
|
|
2681
|
+
if (entry.kind === "group") {
|
|
2682
|
+
const glyph = widgetStepGlyph(entry.status as AsyncJobStep["status"], theme);
|
|
2683
|
+
const statusLabel = widgetStepStatus(entry.status as AsyncJobStep["status"], theme);
|
|
2684
|
+
const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
|
|
2685
|
+
c.addChild(new Text(truncLine(`${rowIndent}${glyph} ${entry.stepLabel}${groupLabel} ${theme.fg("dim", "·")} ${statusLabel}`, width), 0, 0));
|
|
2686
|
+
if (entry.error) c.addChild(new Text(truncLine(theme.fg("error", `${detailIndent}⎿ Error: ${entry.error}`), width), 0, 0));
|
|
2687
|
+
continue;
|
|
2688
|
+
}
|
|
2689
|
+
const i = entry.resultIndex;
|
|
2690
|
+
const r = d.results[i];
|
|
2691
|
+
const rowNumber = entry.rowNumber;
|
|
2692
|
+
const agentName = entry.agentName;
|
|
2693
|
+
if (!r) {
|
|
2694
|
+
const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
|
|
2695
|
+
const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
|
|
2696
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ ${labelPrefix}${agentName} · pending`), width), 0, 0));
|
|
2697
|
+
continue;
|
|
2698
|
+
}
|
|
2699
|
+
const output = getSingleResultOutput(r);
|
|
2700
|
+
const progressFromArray = foregroundProgressForResult(d, i);
|
|
2701
|
+
const rProg = r.progress || progressFromArray || r.progressSummary;
|
|
2702
|
+
const rRunning = rProg && "status" in rProg && isResultRunning(r, rProg.status);
|
|
2703
|
+
const rPending = rProg && "status" in rProg && rProg.status === "pending";
|
|
2704
|
+
const stepStats = formatProgressStats(theme, rProg);
|
|
2705
|
+
const glyph = rPending ? theme.fg("dim", "◦") : resultGlyph(r, output, theme, rRunning, progressRunningSeed(rProg), frame);
|
|
2706
|
+
const pendingLabel = rPending ? ` ${theme.fg("dim", "· pending")}` : "";
|
|
2707
|
+
const stepLabel = entry.rowLabel;
|
|
2708
|
+
const rowProgressModel = rProg && "status" in rProg ? rProg : undefined;
|
|
2709
|
+
const rowModelDisplay = modelThinkingBadge(theme, r.model ?? rowProgressModel?.model, r.thinking ?? rowProgressModel?.thinking);
|
|
2710
|
+
const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
|
|
2711
|
+
const line = `${glyph} ${labelPrefix}${themeBold(theme, agentName)}${contextModeBadge(theme, r.context)}${rowModelDisplay}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}${pendingLabel}`;
|
|
2712
|
+
c.addChild(new Text(truncLine(`${rowIndent}${line}`, width), 0, 0));
|
|
2713
|
+
if (rRunning || rPending) {
|
|
2714
|
+
const task = compactTaskText(r.task, workflowLabelForResult(d, i));
|
|
2715
|
+
if (task) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
|
|
2716
|
+
}
|
|
2717
|
+
if (rRunning && rProg && "status" in rProg) {
|
|
2718
|
+
const liveProgress = rProg as AgentProgress;
|
|
2719
|
+
const activity = compactCurrentActivity(liveProgress);
|
|
2720
|
+
c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
|
|
2721
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, snapshotNowForProgress(liveProgress))) {
|
|
2722
|
+
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2723
|
+
}
|
|
2724
|
+
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${liveDetailHintText()}`), width), 0, 0));
|
|
2725
|
+
} else if (!rPending && (r.exitCode !== 0 || r.interrupted || r.detached || hasEmptyTextOutputWithoutOutputTarget(r.task, output))) {
|
|
2726
|
+
c.addChild(new Text(truncLine(theme.fg(r.exitCode !== 0 ? "error" : "dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
|
|
2727
|
+
}
|
|
2728
|
+
if (!rRunning && !rPending) {
|
|
2729
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
|
|
2730
|
+
c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
const outputTarget = extractOutputTarget(r.task);
|
|
2734
|
+
if (outputTarget) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${outputTarget}`), width), 0, 0));
|
|
2735
|
+
if (r.artifactPaths) c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
|
|
2736
|
+
}
|
|
2737
|
+
if (d.artifacts) c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}artifacts: ${shortenPath(d.artifacts.dir)}`), width), 0, 0));
|
|
2738
|
+
return c;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
export function renderSubagentSummary(
|
|
2742
|
+
result: AgentToolResult<Details>,
|
|
2743
|
+
options: { isPartial?: boolean },
|
|
2744
|
+
theme: Theme,
|
|
2745
|
+
): Component {
|
|
2746
|
+
const details = result.details;
|
|
2747
|
+
const results = details?.results ?? [];
|
|
2748
|
+
const hasSingleTerminalResult = results.length === 1 && hasTerminalResult(results[0]!);
|
|
2749
|
+
const hasOnlyTerminalResults = results.length > 0 && results.every(hasTerminalResult);
|
|
2750
|
+
const running = !hasSingleTerminalResult && !hasOnlyTerminalResults && (
|
|
2751
|
+
options.isPartial === true
|
|
2752
|
+
|| Boolean(details?.asyncId && details.mode !== "management")
|
|
2753
|
+
|| Boolean(details && detailsHaveRunningResult(details))
|
|
2754
|
+
);
|
|
2755
|
+
const stopped = results.some((entry) => entry.stopped)
|
|
2756
|
+
|| Boolean(details && workflowGraphHasStatus(details, ["stopped"]));
|
|
2757
|
+
const paused = results.some((entry) => entry.interrupted || entry.detached)
|
|
2758
|
+
|| Boolean(details && workflowGraphHasStatus(details, ["paused", "detached"]));
|
|
2759
|
+
const failed = result.isError === true
|
|
2760
|
+
|| results.some((entry) => !hasTerminalResultFlag(entry) && entry.exitCode !== 0 && !isResultRunning(entry))
|
|
2761
|
+
|| Boolean(details && workflowGraphHasStatus(details, ["failed"]));
|
|
2762
|
+
const partial = Boolean(details && workflowGraphHasStatus(details, ["partial"]));
|
|
2763
|
+
const state = running ? "running" : failed ? "failed" : stopped ? "stopped" : paused ? "paused" : partial ? "partial" : "completed";
|
|
2764
|
+
const glyph = state === "running"
|
|
2765
|
+
? theme.fg("accent", STATIC_RUNNING_GLYPH)
|
|
2766
|
+
: state === "completed"
|
|
2767
|
+
? theme.fg("success", "✓")
|
|
2768
|
+
: state === "failed"
|
|
2769
|
+
? theme.fg("error", "✗")
|
|
2770
|
+
: theme.fg("warning", "■");
|
|
2771
|
+
const label = details?.mode === "single" && results.length === 1
|
|
2772
|
+
? foregroundSingleDisplayName(results[0])
|
|
2773
|
+
: details?.mode || "subagent";
|
|
2774
|
+
return new Text(
|
|
2775
|
+
truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(label))} ${theme.fg("dim", "·")} ${theme.fg(state === "failed" ? "error" : state === "completed" ? "success" : state === "running" ? "accent" : "warning", state)}`, getTermWidth() - 4),
|
|
2776
|
+
0,
|
|
2777
|
+
0,
|
|
2778
|
+
);
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
/**
|
|
2782
|
+
* Render a subagent result
|
|
2783
|
+
*/
|
|
2784
|
+
export function renderSubagentResult(
|
|
2785
|
+
result: AgentToolResult<Details>,
|
|
2786
|
+
options: { expanded: boolean },
|
|
2787
|
+
theme: Theme,
|
|
2788
|
+
frame?: number,
|
|
2789
|
+
rendererConfig?: MainWindowRendererConfig,
|
|
2790
|
+
foregroundDetachShortcut?: string,
|
|
2791
|
+
): Component {
|
|
2792
|
+
const layout = resolveMainWindowRenderLayout(rendererConfig);
|
|
2793
|
+
const compact = (component: Component): Component => capCompactMainWindowResult(component, layout, theme, !options.expanded);
|
|
2794
|
+
const d = result.details;
|
|
2795
|
+
if (d?.mode === "workflow" && d.chatProgress?.mode === "live-card" && d.workflow?.value === undefined && (!result.isError || (d.workflow?.trace.length ?? 0) > 0)) {
|
|
2796
|
+
return compact(renderWorkflowChatProgress(d, result, theme, options.expanded ? resolveMainWindowRenderLayout() : layout, frame, options.expanded));
|
|
2797
|
+
}
|
|
2798
|
+
if (!d || !d.results.length) {
|
|
2799
|
+
const t = result.content[0];
|
|
2800
|
+
const text = t?.type === "text" ? t.text : "(no output)";
|
|
2801
|
+
const contextPrefix = contextModePrefix(theme, d?.context);
|
|
2802
|
+
const width = getTermWidth() - 4;
|
|
2803
|
+
if (!text.includes("\n")) return compact(new Text(truncLine(`${contextPrefix}${text}`, width), 0, 0));
|
|
2804
|
+
if (d && !options.expanded && !result.isError) {
|
|
2805
|
+
const lines = text.split(/\r?\n/);
|
|
2806
|
+
const firstNonEmptyLine = lines.find((line) => line.trim())?.trim() || "(no output)";
|
|
2807
|
+
const compactLine = d.mode === "workflow" && d.preflight
|
|
2808
|
+
? formatWorkflowPreflightPlanSummary(d.preflight)
|
|
2809
|
+
: firstNonEmptyLine;
|
|
2810
|
+
const c = new Container();
|
|
2811
|
+
const detailIndent = mainWindowIndent(layout, 1);
|
|
2812
|
+
c.addChild(new Text(truncLine(`${contextPrefix}${compactLine} · ${lines.length} lines`, width), 0, 0));
|
|
2813
|
+
c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}Press ${liveDetailKeyText()} for full output`), width), 0, 0));
|
|
2814
|
+
return compact(c);
|
|
2815
|
+
}
|
|
2816
|
+
const c = new Container();
|
|
2817
|
+
const wrapped = wrapPlainText(`${contextPrefix}${text}`, width);
|
|
2818
|
+
for (const line of wrapped) c.addChild(new Text(line, 0, 0));
|
|
2819
|
+
return c;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
const expanded = options.expanded;
|
|
2823
|
+
const mdTheme = getMarkdownTheme();
|
|
2824
|
+
|
|
2825
|
+
if (d.mode === "single" && d.results.length === 1) {
|
|
2826
|
+
const r = d.results[0];
|
|
2827
|
+
const detachableShortcut = d.asyncId || d.background ? undefined : foregroundDetachShortcut;
|
|
2828
|
+
if (!r) return compact(renderMultiCompact(d, theme, layout, frame));
|
|
2829
|
+
if (!expanded) return compact(renderSingleCompact(d, r, theme, layout, frame, detachableShortcut));
|
|
2830
|
+
const isRunning = isResultRunning(r);
|
|
2831
|
+
const contextBadge = contextModeBadge(theme, r.context ?? d.context);
|
|
2832
|
+
const output = r.truncation?.text || getSingleResultOutput(r);
|
|
2833
|
+
const presentation = styledResultPresentation(resultPresentation(r, output, isRunning, undefined, frame), theme);
|
|
2834
|
+
|
|
2835
|
+
const progressInfo = isRunning && r.progress
|
|
2836
|
+
? ` | ${r.progress.toolCount} tools, ${formatTokens(r.progress.tokens)} tok, ${formatDuration(r.progress.durationMs)}`
|
|
2837
|
+
: r.progressSummary
|
|
2838
|
+
? ` | ${r.progressSummary.toolCount} tools, ${formatTokens(r.progressSummary.tokens)} tok, ${formatDuration(r.progressSummary.durationMs)}`
|
|
2839
|
+
: "";
|
|
2840
|
+
|
|
2841
|
+
const w = getTermWidth() - 4;
|
|
2842
|
+
const fit = (text: string) => expanded ? text : truncLine(text, w);
|
|
2843
|
+
const toolCallLines = getToolCallLines(r, expanded);
|
|
2844
|
+
const c = new Container();
|
|
2845
|
+
c.addChild(new Text(fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${contextBadge}${progressInfo} ${theme.fg("dim", "·")} ${presentation.label}`), 0, 0));
|
|
2846
|
+
c.addChild(new Spacer(1));
|
|
2847
|
+
const taskMaxLen = Math.max(20, w - 8);
|
|
2848
|
+
const taskPreview = expanded || r.task.length <= taskMaxLen
|
|
2849
|
+
? r.task
|
|
2850
|
+
: `${r.task.slice(0, taskMaxLen)}...`;
|
|
2851
|
+
c.addChild(
|
|
2852
|
+
new Text(fit(theme.fg("dim", `Task: ${taskPreview}`)), 0, 0),
|
|
2853
|
+
);
|
|
2854
|
+
c.addChild(new Spacer(1));
|
|
2855
|
+
if (!isRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
|
|
2856
|
+
c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, output)}`)), 0, 0));
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
if (isRunning && r.progress) {
|
|
2860
|
+
const progressSnapshotNow = snapshotNowForProgress(r.progress);
|
|
2861
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 12)) {
|
|
2862
|
+
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
2863
|
+
}
|
|
2864
|
+
const toolLine = formatCurrentToolLine(r.progress, w, expanded, progressSnapshotNow);
|
|
2865
|
+
if (toolLine) {
|
|
2866
|
+
c.addChild(new Text(fit(theme.fg("warning", `> ${toolLine}`)), 0, 0));
|
|
2867
|
+
}
|
|
2868
|
+
const liveStatusLine = buildLiveStatusLine(r.progress, progressSnapshotNow);
|
|
2869
|
+
if (liveStatusLine) {
|
|
2870
|
+
c.addChild(new Text(fit(theme.fg("accent", liveStatusLine)), 0, 0));
|
|
2871
|
+
}
|
|
2872
|
+
c.addChild(new Text(fit(theme.fg("accent", foregroundSingleHintText(detachableShortcut))), 0, 0));
|
|
2873
|
+
if (r.artifactPaths) {
|
|
2874
|
+
c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
2875
|
+
}
|
|
2876
|
+
if (r.progress.recentTools?.length) {
|
|
2877
|
+
for (const t of r.progress.recentTools.slice(-3)) {
|
|
2878
|
+
const maxArgsLen = Math.max(40, w - 24);
|
|
2879
|
+
const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
|
|
2880
|
+
c.addChild(new Text(fit(theme.fg("dim", `${t.tool}: ${argsPreview}`)), 0, 0));
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
for (const line of compactRecentOutputLines(r.progress.recentOutput)) {
|
|
2884
|
+
c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
|
|
2885
|
+
}
|
|
2886
|
+
if (toolLine || liveStatusLine || r.progress.recentTools?.length || r.progress.recentOutput?.length || r.artifactPaths) {
|
|
2887
|
+
c.addChild(new Spacer(1));
|
|
2888
|
+
}
|
|
2889
|
+
} else {
|
|
2890
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
|
|
2891
|
+
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
if (expanded) {
|
|
2896
|
+
for (const line of toolCallLines) {
|
|
2897
|
+
c.addChild(new Text(fit(theme.fg("muted", line)), 0, 0));
|
|
2898
|
+
}
|
|
2899
|
+
if (toolCallLines.length) c.addChild(new Spacer(1));
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
if (output) c.addChild(new Markdown(output, 0, 0, mdTheme));
|
|
2903
|
+
c.addChild(new Spacer(1));
|
|
2904
|
+
if (r.skills?.length) {
|
|
2905
|
+
c.addChild(new Text(fit(theme.fg("dim", `Skills: ${r.skills.join(", ")}`)), 0, 0));
|
|
2906
|
+
}
|
|
2907
|
+
if (r.skillsWarning) {
|
|
2908
|
+
c.addChild(new Text(fit(theme.fg("warning", `Warning: ${r.skillsWarning}`)), 0, 0));
|
|
2909
|
+
}
|
|
2910
|
+
if (r.attemptedModels && r.attemptedModels.length > 1) {
|
|
2911
|
+
c.addChild(new Text(fit(theme.fg("dim", `Fallbacks: ${r.attemptedModels.join(" → ")}`)), 0, 0));
|
|
2912
|
+
}
|
|
2913
|
+
c.addChild(new Text(fit(theme.fg("dim", formatUsage(r.usage, r.model))), 0, 0));
|
|
2914
|
+
if (r.sessionFile) {
|
|
2915
|
+
c.addChild(new Text(fit(theme.fg("dim", `Session: ${shortenPath(r.sessionFile)}`)), 0, 0));
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
if (!isRunning && r.artifactPaths) {
|
|
2919
|
+
c.addChild(new Spacer(1));
|
|
2920
|
+
c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
2921
|
+
}
|
|
2922
|
+
return c;
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
if (!expanded) return compact(renderMultiCompact(d, theme, layout, frame));
|
|
2926
|
+
|
|
2927
|
+
const hasRunning = detailsHaveRunningResult(d);
|
|
2928
|
+
const detached = d.results.some((r) => r.detached)
|
|
2929
|
+
|| workflowGraphHasStatus(d, ["detached"]);
|
|
2930
|
+
const stopped = d.results.some((r) => r.stopped)
|
|
2931
|
+
|| workflowGraphHasStatus(d, ["stopped"]);
|
|
2932
|
+
const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
|
|
2933
|
+
|| workflowGraphHasStatus(d, ["failed"]);
|
|
2934
|
+
const paused = d.results.some((r) => r.interrupted)
|
|
2935
|
+
|| workflowGraphHasStatus(d, ["paused"]);
|
|
2936
|
+
const partial = workflowGraphHasStatus(d, ["partial"]);
|
|
2937
|
+
const completedWithoutOutput = d.results.some((r) =>
|
|
2938
|
+
!hasTerminalResultFlag(r)
|
|
2939
|
+
&& r.exitCode === 0
|
|
2940
|
+
&& !isResultRunning(r)
|
|
2941
|
+
&& hasEmptyTextOutputWithoutOutputTarget(r.task, getSingleResultOutput(r)),
|
|
2942
|
+
);
|
|
2943
|
+
const presentation = styledResultPresentation(semanticResultPresentation({
|
|
2944
|
+
running: hasRunning,
|
|
2945
|
+
detached,
|
|
2946
|
+
stopped,
|
|
2947
|
+
interrupted: paused,
|
|
2948
|
+
failed,
|
|
2949
|
+
partial,
|
|
2950
|
+
completedWithoutOutput,
|
|
2951
|
+
frame,
|
|
2952
|
+
}), theme);
|
|
2953
|
+
|
|
2954
|
+
const totalSummary =
|
|
2955
|
+
d.progressSummary ||
|
|
2956
|
+
d.results.reduce(
|
|
2957
|
+
(acc, r) => {
|
|
2958
|
+
const prog = r.progress || r.progressSummary;
|
|
2959
|
+
if (prog) {
|
|
2960
|
+
acc.toolCount += prog.toolCount;
|
|
2961
|
+
acc.tokens += prog.tokens;
|
|
2962
|
+
acc.durationMs =
|
|
2963
|
+
d.mode === "chain"
|
|
2964
|
+
? acc.durationMs + prog.durationMs
|
|
2965
|
+
: Math.max(acc.durationMs, prog.durationMs);
|
|
2966
|
+
}
|
|
2967
|
+
return acc;
|
|
2968
|
+
},
|
|
2969
|
+
{ toolCount: 0, tokens: 0, durationMs: 0 },
|
|
2970
|
+
);
|
|
2971
|
+
|
|
2972
|
+
const summaryParts = [
|
|
2973
|
+
totalSummary.toolCount || totalSummary.tokens
|
|
2974
|
+
? `${totalSummary.toolCount} tools, ${formatTokens(totalSummary.tokens)} tok, ${formatDuration(totalSummary.durationMs)}`
|
|
2975
|
+
: "",
|
|
2976
|
+
formatTotalCostStat(d.totalCost),
|
|
2977
|
+
].filter(Boolean);
|
|
2978
|
+
const summaryStr = summaryParts.length ? ` | ${summaryParts.join(", ")}` : "";
|
|
2979
|
+
|
|
2980
|
+
const modeLabel = d.mode;
|
|
2981
|
+
const contextBadge = contextModeBadge(theme, d.context);
|
|
2982
|
+
const multiLabel = buildMultiProgressLabel(d, hasRunning);
|
|
2983
|
+
const itemTitle = multiLabel.itemTitle;
|
|
2984
|
+
|
|
2985
|
+
const chainVis = d.chainAgents?.length && !multiLabel.hasParallelInChain
|
|
2986
|
+
? d.chainAgents
|
|
2987
|
+
.map((agent, i) => {
|
|
2988
|
+
const result = d.results[i];
|
|
2989
|
+
const displayName = foregroundResultDisplayName(d, i, result, agent);
|
|
2990
|
+
const isCurrent = i === (d.currentStepIndex ?? d.results.length);
|
|
2991
|
+
const stepPresentation = result
|
|
2992
|
+
? styledResultPresentation(resultPresentation(result, getSingleResultOutput(result), isCurrent && hasRunning && !hasTerminalResultFlag(result)), theme)
|
|
2993
|
+
: undefined;
|
|
2994
|
+
const stepStatus = stepPresentation
|
|
2995
|
+
? `${stepPresentation.glyph} ${stepPresentation.label}`
|
|
2996
|
+
: theme.fg("dim", "◦ pending");
|
|
2997
|
+
return `${stepStatus} ${displayName}${contextModeBadge(theme, result?.context)}`;
|
|
2998
|
+
})
|
|
2999
|
+
.join(theme.fg("dim", " → "))
|
|
3000
|
+
: null;
|
|
3001
|
+
|
|
3002
|
+
const w = getTermWidth() - 4;
|
|
3003
|
+
const fit = (text: string) => expanded ? text : truncLine(text, w);
|
|
3004
|
+
const c = new Container();
|
|
3005
|
+
c.addChild(
|
|
3006
|
+
new Text(
|
|
3007
|
+
fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(modeLabel))}${contextBadge} · ${multiLabel.headerLabel}${summaryStr} ${theme.fg("dim", "·")} ${presentation.label}`),
|
|
3008
|
+
0,
|
|
3009
|
+
0,
|
|
3010
|
+
),
|
|
3011
|
+
);
|
|
3012
|
+
if (chainVis) {
|
|
3013
|
+
c.addChild(new Text(fit(` ${chainVis}`), 0, 0));
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
|
|
3017
|
+
const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
|
|
3018
|
+
const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents!.length);
|
|
3019
|
+
const chainEntries = buildChainRenderEntries(d, multiLabel);
|
|
3020
|
+
const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
|
|
3021
|
+
|
|
3022
|
+
c.addChild(new Spacer(1));
|
|
3023
|
+
|
|
3024
|
+
for (const entry of renderEntries) {
|
|
3025
|
+
if (entry.kind === "group") {
|
|
3026
|
+
const statusLabel = widgetStepStatus(entry.status as AsyncJobStep["status"], theme);
|
|
3027
|
+
const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
|
|
3028
|
+
c.addChild(new Text(fit(` ${statusLabel} ${entry.stepLabel}${groupLabel}`), 0, 0));
|
|
3029
|
+
c.addChild(new Text(theme.fg(entry.status === "failed" ? "error" : "dim", ` status: ${entry.status}`), 0, 0));
|
|
3030
|
+
if (entry.error) c.addChild(new Text(theme.fg("error", ` error: ${entry.error}`), 0, 0));
|
|
3031
|
+
c.addChild(new Spacer(1));
|
|
3032
|
+
continue;
|
|
3033
|
+
}
|
|
3034
|
+
const i = entry.resultIndex;
|
|
3035
|
+
const r = d.results[i];
|
|
3036
|
+
const rowNumber = entry.rowNumber;
|
|
3037
|
+
const agentName = entry.agentName;
|
|
3038
|
+
|
|
3039
|
+
if (!r) {
|
|
3040
|
+
const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
|
|
3041
|
+
const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
|
|
3042
|
+
c.addChild(new Text(fit(theme.fg("dim", ` ${labelPrefix}${agentName}`)), 0, 0));
|
|
3043
|
+
c.addChild(new Text(theme.fg("dim", ` status: pending`), 0, 0));
|
|
3044
|
+
c.addChild(new Spacer(1));
|
|
3045
|
+
continue;
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
const progressFromArray = foregroundProgressForResult(d, i);
|
|
3049
|
+
const rProg = r.progress || progressFromArray || r.progressSummary;
|
|
3050
|
+
const rRunning = isResultRunning(r, rProg?.status);
|
|
3051
|
+
|
|
3052
|
+
const resultOutput = getSingleResultOutput(r);
|
|
3053
|
+
const rowPresentation = styledResultPresentation(resultPresentation(r, resultOutput, rRunning, progressRunningSeed(rProg), frame), theme);
|
|
3054
|
+
const stats = rProg ? ` | ${rProg.toolCount} tools, ${formatDuration(rProg.durationMs)}` : "";
|
|
3055
|
+
const modelDisplay = modelThinkingBadge(theme, r.model ?? rProg?.model, r.thinking ?? rProg?.thinking);
|
|
3056
|
+
const stepLabel = entry.rowLabel;
|
|
3057
|
+
const contextBadge = contextModeBadge(theme, r.context);
|
|
3058
|
+
const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
|
|
3059
|
+
const stepHeader = rRunning
|
|
3060
|
+
? `${rowPresentation.glyph} ${labelPrefix}${theme.bold(theme.fg("warning", agentName))}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`
|
|
3061
|
+
: `${rowPresentation.glyph} ${labelPrefix}${theme.bold(agentName)}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`;
|
|
3062
|
+
const toolCallLines = getToolCallLines(r, expanded);
|
|
3063
|
+
c.addChild(new Text(fit(stepHeader), 0, 0));
|
|
3064
|
+
|
|
3065
|
+
const taskMaxLen = Math.max(20, w - 12);
|
|
3066
|
+
const taskPreview = expanded || r.task.length <= taskMaxLen
|
|
3067
|
+
? r.task
|
|
3068
|
+
: `${r.task.slice(0, taskMaxLen)}...`;
|
|
3069
|
+
c.addChild(new Text(fit(theme.fg("dim", ` task: ${taskPreview}`)), 0, 0));
|
|
3070
|
+
|
|
3071
|
+
const outputTarget = extractOutputTarget(r.task);
|
|
3072
|
+
if (outputTarget) {
|
|
3073
|
+
c.addChild(new Text(fit(theme.fg("dim", ` output: ${outputTarget}`)), 0, 0));
|
|
3074
|
+
}
|
|
3075
|
+
if (!rRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
|
|
3076
|
+
c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, resultOutput)}`)), 0, 0));
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
if (r.skills?.length) {
|
|
3080
|
+
c.addChild(new Text(fit(theme.fg("dim", ` skills: ${r.skills.join(", ")}`)), 0, 0));
|
|
3081
|
+
}
|
|
3082
|
+
if (r.skillsWarning) {
|
|
3083
|
+
c.addChild(new Text(fit(theme.fg("warning", ` Warning: ${r.skillsWarning}`)), 0, 0));
|
|
3084
|
+
}
|
|
3085
|
+
if (r.attemptedModels && r.attemptedModels.length > 1) {
|
|
3086
|
+
c.addChild(new Text(fit(theme.fg("dim", ` fallbacks: ${r.attemptedModels.join(" → ")}`)), 0, 0));
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
if (rRunning && rProg) {
|
|
3090
|
+
if (rProg.skills?.length) {
|
|
3091
|
+
c.addChild(new Text(fit(theme.fg("accent", ` skills: ${rProg.skills.join(", ")}`)), 0, 0));
|
|
3092
|
+
}
|
|
3093
|
+
const progressSnapshotNow = snapshotNowForProgress(rProg);
|
|
3094
|
+
const toolLine = formatCurrentToolLine(rProg, w, expanded, progressSnapshotNow);
|
|
3095
|
+
if (toolLine) {
|
|
3096
|
+
c.addChild(new Text(fit(theme.fg("warning", ` > ${toolLine}`)), 0, 0));
|
|
3097
|
+
}
|
|
3098
|
+
const liveStatusLine = buildLiveStatusLine(rProg, progressSnapshotNow);
|
|
3099
|
+
if (liveStatusLine) {
|
|
3100
|
+
c.addChild(new Text(fit(theme.fg("accent", ` ${liveStatusLine}`)), 0, 0));
|
|
3101
|
+
}
|
|
3102
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 8)) {
|
|
3103
|
+
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
3104
|
+
}
|
|
3105
|
+
c.addChild(new Text(fit(theme.fg("accent", ` ${liveDetailHintText()}`)), 0, 0));
|
|
3106
|
+
if (r.artifactPaths) {
|
|
3107
|
+
c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
3108
|
+
}
|
|
3109
|
+
if (rProg.recentTools?.length) {
|
|
3110
|
+
for (const t of rProg.recentTools.slice(-3)) {
|
|
3111
|
+
const maxArgsLen = Math.max(40, w - 30);
|
|
3112
|
+
const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
|
|
3113
|
+
c.addChild(new Text(fit(theme.fg("dim", ` ${t.tool}: ${argsPreview}`)), 0, 0));
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
for (const line of compactRecentOutputLines(rProg.recentOutput)) {
|
|
3117
|
+
c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
if (!rRunning) {
|
|
3122
|
+
for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
|
|
3123
|
+
c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
if (!rRunning && r.artifactPaths) {
|
|
3128
|
+
c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
if (expanded && !rRunning) {
|
|
3132
|
+
for (const line of toolCallLines) {
|
|
3133
|
+
c.addChild(new Text(fit(theme.fg("muted", ` ${line}`)), 0, 0));
|
|
3134
|
+
}
|
|
3135
|
+
if (toolCallLines.length) c.addChild(new Spacer(1));
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
c.addChild(new Spacer(1));
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
if (d.artifacts) {
|
|
3142
|
+
c.addChild(new Spacer(1));
|
|
3143
|
+
c.addChild(new Text(fit(theme.fg("dim", `Artifacts dir: ${shortenPath(d.artifacts.dir)}`)), 0, 0));
|
|
3144
|
+
}
|
|
3145
|
+
return c;
|
|
3146
|
+
}
|