gsd-pi 2.74.0-dev.6e23363 → 2.74.0-dev.b2838e6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/extensions/gsd/auto/phases.js +51 -6
- package/dist/resources/extensions/gsd/auto-model-selection.js +3 -3
- package/dist/resources/extensions/gsd/auto-post-unit.js +7 -3
- package/dist/resources/extensions/gsd/auto-recovery.js +24 -10
- package/dist/resources/extensions/gsd/auto-worktree.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +10 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +61 -9
- package/dist/resources/extensions/gsd/cache.js +16 -5
- package/dist/resources/extensions/gsd/commands/catalog.js +6 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +5 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +5 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +225 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +50 -3
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +2 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +144 -0
- package/dist/resources/extensions/gsd/ecosystem/loader.js +145 -0
- package/dist/resources/extensions/gsd/guided-flow.js +8 -6
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +10 -0
- package/dist/resources/extensions/gsd/preferences.js +5 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +15 -30
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +8 -8
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/readers/graph.d.ts +1 -1
- package/packages/mcp-server/dist/readers/graph.d.ts.map +1 -1
- package/packages/mcp-server/dist/readers/graph.js +107 -0
- package/packages/mcp-server/dist/readers/graph.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +88 -6
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/readers/graph.test.ts +178 -0
- package/packages/mcp-server/src/readers/graph.ts +148 -1
- package/packages/mcp-server/src/workflow-tools.ts +95 -10
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/index.d.ts +1 -9
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -9
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts +19 -0
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/capability-patches.js +36 -0
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -0
- package/packages/pi-ai/dist/{models.custom.d.ts → models/custom.d.ts} +1 -1
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -0
- package/packages/pi-ai/dist/{models.custom.js → models/custom.js} +4 -4
- package/packages/pi-ai/dist/models/custom.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +1482 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +1484 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +377 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js +379 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js +702 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts +71 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js +73 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts +590 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js +444 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +156 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +158 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js +107 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts +207 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js +209 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts +462 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.js +464 -0
- package/packages/pi-ai/dist/models/generated/google.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts +309 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.js +311 -0
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts +383 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js +347 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js.map +1 -0
- package/packages/pi-ai/dist/{models.generated.d.ts → models/generated/index.d.ts} +1 -1
- package/packages/pi-ai/dist/{models.generated.d.ts.map → models/generated/index.d.ts.map} +1 -1
- package/packages/pi-ai/dist/models/generated/index.js +51 -0
- package/packages/pi-ai/dist/models/generated/index.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts +37 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js +39 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts +445 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.js +447 -0
- package/packages/pi-ai/dist/models/generated/mistral.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +139 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js +141 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.js +702 -0
- package/packages/pi-ai/dist/models/generated/openai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts +122 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js +124 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts +530 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.js +532 -0
- package/packages/pi-ai/dist/models/generated/opencode.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +4270 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js +4272 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts +2604 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js +2606 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts +411 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.js +413 -0
- package/packages/pi-ai/dist/models/generated/xai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts +276 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.js +239 -0
- package/packages/pi-ai/dist/models/generated/zai.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts +27 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/index.js +80 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -0
- package/packages/pi-ai/dist/models.d.ts +1 -36
- package/packages/pi-ai/dist/models.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +1 -2
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/models.js +3 -112
- package/packages/pi-ai/dist/models.js.map +1 -1
- package/packages/pi-ai/dist/models.test.js +6 -5
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +74 -40
- package/packages/pi-ai/src/index.ts +1 -9
- package/packages/pi-ai/src/models/capability-patches.ts +40 -0
- package/packages/pi-ai/src/{models.custom.ts → models/custom.ts} +4 -4
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +1486 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +381 -0
- package/packages/pi-ai/src/models/generated/azure-openai-responses.ts +704 -0
- package/packages/pi-ai/src/models/generated/cerebras.ts +75 -0
- package/packages/pi-ai/src/models/generated/github-copilot.ts +446 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +160 -0
- package/packages/pi-ai/src/models/generated/google-gemini-cli.ts +109 -0
- package/packages/pi-ai/src/models/generated/google-vertex.ts +211 -0
- package/packages/pi-ai/src/models/generated/google.ts +466 -0
- package/packages/pi-ai/src/models/generated/groq.ts +313 -0
- package/packages/pi-ai/src/models/generated/huggingface.ts +349 -0
- package/packages/pi-ai/src/models/generated/index.ts +52 -0
- package/packages/pi-ai/src/models/generated/kimi-coding.ts +41 -0
- package/packages/pi-ai/src/models/generated/minimax-cn.ts +109 -0
- package/packages/pi-ai/src/models/generated/minimax.ts +109 -0
- package/packages/pi-ai/src/models/generated/mistral.ts +449 -0
- package/packages/pi-ai/src/models/generated/openai-codex.ts +143 -0
- package/packages/pi-ai/src/models/generated/openai.ts +704 -0
- package/packages/pi-ai/src/models/generated/opencode-go.ts +126 -0
- package/packages/pi-ai/src/models/generated/opencode.ts +534 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +4274 -0
- package/packages/pi-ai/src/models/generated/vercel-ai-gateway.ts +2608 -0
- package/packages/pi-ai/src/models/generated/xai.ts +415 -0
- package/packages/pi-ai/src/models/generated/zai.ts +241 -0
- package/packages/pi-ai/src/models/index.ts +106 -0
- package/packages/pi-ai/src/models.generated.test.ts +1 -2
- package/packages/pi-ai/src/models.test.ts +6 -5
- package/packages/pi-ai/src/models.ts +3 -153
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +8 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +359 -7
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +61 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +23 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +53 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +8 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +27 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +8 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +68 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +22 -22
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +192 -22
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +38 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +14 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +70 -6
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +12 -6
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +453 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +92 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +19 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +25 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +36 -15
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +83 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +23 -26
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +253 -45
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +92 -6
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +9 -2
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/tui.ts +9 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/src/resources/extensions/gsd/auto/phases.ts +70 -6
- package/src/resources/extensions/gsd/auto-model-selection.ts +3 -3
- package/src/resources/extensions/gsd/auto-post-unit.ts +7 -3
- package/src/resources/extensions/gsd/auto-recovery.ts +29 -9
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -0
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +5 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +15 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +72 -8
- package/src/resources/extensions/gsd/cache.ts +16 -5
- package/src/resources/extensions/gsd/commands/catalog.ts +6 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +5 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +304 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +57 -3
- package/src/resources/extensions/gsd/docs/preferences-reference.md +2 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +228 -0
- package/src/resources/extensions/gsd/ecosystem/loader.ts +201 -0
- package/src/resources/extensions/gsd/guided-flow.ts +4 -2
- package/src/resources/extensions/gsd/preferences-types.ts +6 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +10 -0
- package/src/resources/extensions/gsd/preferences.ts +6 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +15 -31
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +177 -0
- package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +340 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/preferences.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +57 -2
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +1 -1
- package/src/resources/extensions/gsd/types.ts +13 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +2 -1
- package/packages/pi-ai/dist/models.custom.d.ts.map +0 -1
- package/packages/pi-ai/dist/models.custom.js.map +0 -1
- package/packages/pi-ai/dist/models.generated.js +0 -14343
- package/packages/pi-ai/dist/models.generated.js.map +0 -1
- package/packages/pi-ai/src/models.generated.ts +0 -14345
- /package/dist/web/standalone/.next/static/{bc2gRVFTgD7j--BsJE7vP → wuiYdNtJdo9ISED55DAkz}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{bc2gRVFTgD7j--BsJE7vP → wuiYdNtJdo9ISED55DAkz}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AssistantMessage } from "@gsd/pi-ai";
|
|
2
2
|
import { Container, Markdown, type MarkdownTheme, Spacer, Text } from "@gsd/pi-tui";
|
|
3
3
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
4
|
-
import {
|
|
4
|
+
import { type TimestampFormat } from "./timestamp.js";
|
|
5
|
+
import { renderChatFrame } from "./chat-frame.js";
|
|
5
6
|
|
|
6
7
|
export interface ContentRange {
|
|
7
8
|
startIndex: number;
|
|
@@ -89,10 +90,10 @@ export class AssistantMessageComponent extends Container {
|
|
|
89
90
|
);
|
|
90
91
|
const hasTextContent = message.content.some((c) => c.type === "text" && c.text.trim().length > 0);
|
|
91
92
|
const hasToolContent = message.content.some((c) => c.type === "toolCall" || c.type === "serverToolUse");
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
// Claude Code often emits long reasoning blocks ahead of user-visible text/tool
|
|
94
|
+
// output in the same lifecycle. Keep chat output visible without requiring a
|
|
95
|
+
// manual thinking toggle every turn.
|
|
96
|
+
const shouldCapThinking = hasTextContent || hasToolContent || message.provider === "claude-code";
|
|
96
97
|
|
|
97
98
|
// Render content in order; non-text/thinking blocks are silently skipped
|
|
98
99
|
for (let i = 0; i < slice.length; i++) {
|
|
@@ -122,7 +123,7 @@ export class AssistantMessageComponent extends Container {
|
|
|
122
123
|
});
|
|
123
124
|
// Keep visible chat output readable when thinking traces are long.
|
|
124
125
|
// Tool-bearing turns can stream text in a later assistant message.
|
|
125
|
-
if (
|
|
126
|
+
if (shouldCapThinking) {
|
|
126
127
|
thinkingMarkdown.maxLines = 8;
|
|
127
128
|
}
|
|
128
129
|
this.contentContainer.addChild(thinkingMarkdown);
|
|
@@ -156,10 +157,24 @@ export class AssistantMessageComponent extends Container {
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
if (message.stopReason && message.timestamp) {
|
|
160
|
-
const timeStr = formatTimestamp(message.timestamp, this.timestampFormat);
|
|
161
|
-
this.contentContainer.addChild(new Text(theme.fg("dim", timeStr), 1, 0));
|
|
162
|
-
}
|
|
163
160
|
}
|
|
164
161
|
}
|
|
162
|
+
|
|
163
|
+
override render(width: number): string[] {
|
|
164
|
+
const frameWidth = Math.max(20, width);
|
|
165
|
+
const contentWidth = Math.max(1, frameWidth - 4);
|
|
166
|
+
const lines = super.render(contentWidth);
|
|
167
|
+
const headerLabel = this.lastMessage?.model ? `GSD - ${this.lastMessage.model}` : "GSD";
|
|
168
|
+
const framed = renderChatFrame(lines, frameWidth, {
|
|
169
|
+
label: headerLabel,
|
|
170
|
+
tone: "assistant",
|
|
171
|
+
timestamp: this.lastMessage?.timestamp,
|
|
172
|
+
timestampFormat: this.timestampFormat,
|
|
173
|
+
showTimestamp: this.showMetadata,
|
|
174
|
+
});
|
|
175
|
+
if (framed.length === 0) {
|
|
176
|
+
return framed;
|
|
177
|
+
}
|
|
178
|
+
return ["", ...framed];
|
|
179
|
+
}
|
|
165
180
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { truncateToWidth, visibleWidth } from "@gsd/pi-tui";
|
|
2
|
+
import { theme } from "../theme/theme.js";
|
|
3
|
+
import { formatTimestamp, type TimestampFormat } from "./timestamp.js";
|
|
4
|
+
|
|
5
|
+
type FrameTone = "assistant" | "user" | "compaction";
|
|
6
|
+
|
|
7
|
+
function trimOuterBlankLines(lines: string[]): string[] {
|
|
8
|
+
let start = 0;
|
|
9
|
+
let end = lines.length;
|
|
10
|
+
while (start < end && lines[start].trim().length === 0) start++;
|
|
11
|
+
while (end > start && lines[end - 1].trim().length === 0) end--;
|
|
12
|
+
return lines.slice(start, end);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function renderChatFrame(
|
|
16
|
+
contentLines: string[],
|
|
17
|
+
width: number,
|
|
18
|
+
opts: {
|
|
19
|
+
label: string;
|
|
20
|
+
tone: FrameTone;
|
|
21
|
+
timestamp?: number;
|
|
22
|
+
timestampFormat: TimestampFormat;
|
|
23
|
+
showTimestamp?: boolean;
|
|
24
|
+
},
|
|
25
|
+
): string[] {
|
|
26
|
+
const outerWidth = Math.max(20, width);
|
|
27
|
+
const contentWidth = Math.max(1, outerWidth - 2); // "│ " + content
|
|
28
|
+
const borderColor =
|
|
29
|
+
opts.tone === "user"
|
|
30
|
+
? "borderAccent"
|
|
31
|
+
: opts.tone === "compaction"
|
|
32
|
+
? "customMessageLabel"
|
|
33
|
+
: "border";
|
|
34
|
+
const borderMuted =
|
|
35
|
+
opts.tone === "compaction" ? "customMessageLabel" : "borderMuted";
|
|
36
|
+
const border = (s: string) => theme.fg(borderColor, s);
|
|
37
|
+
const leftRaw = `• ${opts.label}`;
|
|
38
|
+
const rightRaw =
|
|
39
|
+
opts.showTimestamp === false || !opts.timestamp
|
|
40
|
+
? ""
|
|
41
|
+
: formatTimestamp(opts.timestamp, opts.timestampFormat);
|
|
42
|
+
|
|
43
|
+
const leftBudget = rightRaw
|
|
44
|
+
? Math.max(1, outerWidth - visibleWidth(rightRaw) - 1)
|
|
45
|
+
: outerWidth;
|
|
46
|
+
const left = truncateToWidth(leftRaw, leftBudget, "");
|
|
47
|
+
const leftStyled =
|
|
48
|
+
opts.tone === "user"
|
|
49
|
+
? theme.fg("accent", theme.bold(left))
|
|
50
|
+
: opts.tone === "compaction"
|
|
51
|
+
? theme.fg("customMessageLabel", theme.bold(left))
|
|
52
|
+
: theme.fg("muted", theme.bold(left));
|
|
53
|
+
const rightStyled = rightRaw ? theme.fg("dim", rightRaw) : "";
|
|
54
|
+
const gap =
|
|
55
|
+
rightRaw.length > 0
|
|
56
|
+
? Math.max(
|
|
57
|
+
1,
|
|
58
|
+
outerWidth - visibleWidth(leftStyled) - visibleWidth(rightStyled),
|
|
59
|
+
)
|
|
60
|
+
: Math.max(0, outerWidth - visibleWidth(leftStyled));
|
|
61
|
+
const headerRow = `${leftStyled}${" ".repeat(gap)}${rightStyled}`;
|
|
62
|
+
const headerPad = Math.max(0, outerWidth - visibleWidth(headerRow));
|
|
63
|
+
|
|
64
|
+
const sourceLines = trimOuterBlankLines(contentLines);
|
|
65
|
+
const bodyLines = (sourceLines.length > 0 ? sourceLines : [""]).map((line) => {
|
|
66
|
+
const clipped = truncateToWidth(line, contentWidth, "");
|
|
67
|
+
return border("│ ") + clipped;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return [
|
|
71
|
+
theme.fg(borderMuted, "─".repeat(outerWidth)),
|
|
72
|
+
headerRow + " ".repeat(headerPad),
|
|
73
|
+
...bodyLines,
|
|
74
|
+
];
|
|
75
|
+
}
|
package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container, Markdown, type MarkdownTheme, Text } from "@gsd/pi-tui";
|
|
2
2
|
import type { CompactionSummaryMessage } from "../../../core/messages.js";
|
|
3
3
|
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
4
|
+
import { renderChatFrame } from "./chat-frame.js";
|
|
4
5
|
import { editorKey } from "./keybinding-hints.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Renders a compaction notice in the shared chat-frame style (top rule,
|
|
9
|
+
* `• compaction` header, `│ ` body margin) with purple border/label so it
|
|
10
|
+
* visually matches the other framed messages (user / assistant / tool
|
|
11
|
+
* execution) while standing apart from the conversation flow.
|
|
9
12
|
*/
|
|
10
|
-
export class CompactionSummaryMessageComponent extends
|
|
13
|
+
export class CompactionSummaryMessageComponent extends Container {
|
|
11
14
|
private expanded = false;
|
|
12
15
|
private message: CompactionSummaryMessage;
|
|
13
16
|
private markdownTheme: MarkdownTheme;
|
|
14
17
|
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
18
|
+
constructor(
|
|
19
|
+
message: CompactionSummaryMessage,
|
|
20
|
+
markdownTheme: MarkdownTheme = getMarkdownTheme(),
|
|
21
|
+
) {
|
|
22
|
+
super();
|
|
17
23
|
this.message = message;
|
|
18
24
|
this.markdownTheme = markdownTheme;
|
|
19
|
-
this.
|
|
25
|
+
this.rebuild();
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
setExpanded(expanded: boolean): void {
|
|
23
|
-
this.expanded
|
|
24
|
-
|
|
29
|
+
if (this.expanded !== expanded) {
|
|
30
|
+
this.expanded = expanded;
|
|
31
|
+
this.rebuild();
|
|
32
|
+
}
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
override invalidate(): void {
|
|
28
36
|
super.invalidate();
|
|
29
|
-
this.
|
|
37
|
+
this.rebuild();
|
|
30
38
|
}
|
|
31
39
|
|
|
32
|
-
private
|
|
40
|
+
private rebuild(): void {
|
|
33
41
|
this.clear();
|
|
34
42
|
|
|
35
43
|
const tokenStr = this.message.tokensBefore.toLocaleString();
|
|
36
|
-
const label = theme.fg("customMessageLabel", theme.bold("[compaction]"));
|
|
37
|
-
this.addChild(new Text(label, 0, 0));
|
|
38
|
-
this.addChild(new Spacer(1));
|
|
39
44
|
|
|
40
45
|
if (this.expanded) {
|
|
41
46
|
const header = `**Compacted from ${tokenStr} tokens**\n\n`;
|
|
@@ -47,7 +52,10 @@ export class CompactionSummaryMessageComponent extends Box {
|
|
|
47
52
|
} else {
|
|
48
53
|
this.addChild(
|
|
49
54
|
new Text(
|
|
50
|
-
theme.fg(
|
|
55
|
+
theme.fg(
|
|
56
|
+
"customMessageText",
|
|
57
|
+
`Compacted from ${tokenStr} tokens (`,
|
|
58
|
+
) +
|
|
51
59
|
theme.fg("dim", editorKey("expandTools")) +
|
|
52
60
|
theme.fg("customMessageText", " to expand)"),
|
|
53
61
|
0,
|
|
@@ -56,4 +64,17 @@ export class CompactionSummaryMessageComponent extends Box {
|
|
|
56
64
|
);
|
|
57
65
|
}
|
|
58
66
|
}
|
|
67
|
+
|
|
68
|
+
override render(width: number): string[] {
|
|
69
|
+
const frameWidth = Math.max(20, width);
|
|
70
|
+
const contentWidth = Math.max(1, frameWidth - 4);
|
|
71
|
+
const lines = super.render(contentWidth);
|
|
72
|
+
const framed = renderChatFrame(lines, frameWidth, {
|
|
73
|
+
label: "compaction",
|
|
74
|
+
tone: "compaction",
|
|
75
|
+
timestampFormat: "date-time-iso",
|
|
76
|
+
showTimestamp: false,
|
|
77
|
+
});
|
|
78
|
+
return framed.length > 0 ? ["", ...framed] : framed;
|
|
79
|
+
}
|
|
59
80
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Text,
|
|
10
10
|
type TUI,
|
|
11
11
|
truncateToWidth,
|
|
12
|
+
visibleWidth,
|
|
12
13
|
} from "@gsd/pi-tui";
|
|
13
14
|
import stripAnsi from "strip-ansi";
|
|
14
15
|
import type { ToolDefinition } from "../../../core/extensions/types.js";
|
|
@@ -65,6 +66,53 @@ function parseMcpToolName(name: string): { server: string; tool: string } | null
|
|
|
65
66
|
return { server: rest.slice(0, delim), tool: rest.slice(delim + 2) };
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
type ToolFrameTone = "pending" | "success" | "error";
|
|
70
|
+
|
|
71
|
+
function trimOuterBlankLines(lines: string[]): string[] {
|
|
72
|
+
let start = 0;
|
|
73
|
+
let end = lines.length;
|
|
74
|
+
while (start < end && lines[start].trim().length === 0) start++;
|
|
75
|
+
while (end > start && lines[end - 1].trim().length === 0) end--;
|
|
76
|
+
return lines.slice(start, end);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function renderToolFrame(
|
|
80
|
+
contentLines: string[],
|
|
81
|
+
width: number,
|
|
82
|
+
opts: {
|
|
83
|
+
label: string;
|
|
84
|
+
status: string;
|
|
85
|
+
tone: ToolFrameTone;
|
|
86
|
+
},
|
|
87
|
+
): string[] {
|
|
88
|
+
const outerWidth = Math.max(20, width);
|
|
89
|
+
const contentWidth = Math.max(1, outerWidth - 2); // "│ " + content
|
|
90
|
+
|
|
91
|
+
const borderColor = opts.tone === "error" ? "error" : "toolTitle";
|
|
92
|
+
const topColor = opts.tone === "error" ? "error" : "toolTitle";
|
|
93
|
+
const labelColor = opts.tone === "error" ? "error" : "toolTitle";
|
|
94
|
+
const statusColor = opts.tone === "error" ? "error" : opts.tone === "pending" ? "warning" : "success";
|
|
95
|
+
const border = (s: string) => theme.fg(borderColor, s);
|
|
96
|
+
|
|
97
|
+
const leftStyled = theme.fg(labelColor, theme.bold(`• ${opts.label}`));
|
|
98
|
+
const rightStyled = theme.fg(statusColor, opts.status);
|
|
99
|
+
const gap = Math.max(1, outerWidth - visibleWidth(leftStyled) - visibleWidth(rightStyled));
|
|
100
|
+
const headerRow = `${leftStyled}${" ".repeat(gap)}${rightStyled}`;
|
|
101
|
+
const headerPad = Math.max(0, outerWidth - visibleWidth(headerRow));
|
|
102
|
+
|
|
103
|
+
const sourceLines = trimOuterBlankLines(contentLines);
|
|
104
|
+
const bodyLines = (sourceLines.length > 0 ? sourceLines : [""]).map((line) => {
|
|
105
|
+
const clipped = truncateToWidth(line, contentWidth, "");
|
|
106
|
+
return border("│ ") + clipped;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return [
|
|
110
|
+
theme.fg(topColor, "─".repeat(outerWidth)),
|
|
111
|
+
headerRow + " ".repeat(headerPad),
|
|
112
|
+
...bodyLines,
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
|
|
68
116
|
const COMPACT_ARG_VALUE_LIMIT = 60;
|
|
69
117
|
const GENERIC_OUTPUT_PREVIEW_LINES = 10;
|
|
70
118
|
const GENERIC_ARGS_JSON_PREVIEW_LINES = 10;
|
|
@@ -379,6 +427,23 @@ export class ToolExecutionComponent extends Container {
|
|
|
379
427
|
this.maybeConvertImagesForKitty();
|
|
380
428
|
}
|
|
381
429
|
|
|
430
|
+
/**
|
|
431
|
+
* Mark a tool call as historical when replaying from session context and
|
|
432
|
+
* no matching tool result is available. Happens after compaction squashes
|
|
433
|
+
* tool_result messages out of history — the tool call block survives but
|
|
434
|
+
* the result is gone. Without this, the component stays in "Running" state
|
|
435
|
+
* forever even though the tool completed long ago.
|
|
436
|
+
*/
|
|
437
|
+
markHistoricalNoResult(): void {
|
|
438
|
+
if (this.result) return; // real result already set, nothing to do
|
|
439
|
+
this.isPartial = false;
|
|
440
|
+
this.result = {
|
|
441
|
+
content: [],
|
|
442
|
+
isError: false,
|
|
443
|
+
};
|
|
444
|
+
this.updateDisplay();
|
|
445
|
+
}
|
|
446
|
+
|
|
382
447
|
/**
|
|
383
448
|
* Finalize a pending tool call as failed/interrupted while preserving any streamed partial output.
|
|
384
449
|
*/
|
|
@@ -452,16 +517,27 @@ export class ToolExecutionComponent extends Container {
|
|
|
452
517
|
if (this.hideComponent) {
|
|
453
518
|
return [];
|
|
454
519
|
}
|
|
455
|
-
|
|
520
|
+
const frameWidth = Math.max(20, width);
|
|
521
|
+
const contentWidth = Math.max(1, frameWidth - 4);
|
|
522
|
+
const lines = super.render(contentWidth);
|
|
523
|
+
const frameTone: ToolFrameTone =
|
|
524
|
+
this.result?.isError ? "error" : this.isPartial || !this.result ? "pending" : "success";
|
|
525
|
+
const frameStatus = this.isPartial || !this.result ? "Running" : this.result.isError ? "Error" : "Done";
|
|
526
|
+
const parsed = parseMcpToolName(this.toolName);
|
|
527
|
+
const frameLabel = parsed
|
|
528
|
+
? `Tool ${parsed.server}·${parsed.tool}`
|
|
529
|
+
: `Tool ${this.normalizedToolName || this.toolName || "unknown"}`;
|
|
530
|
+
const framed = renderToolFrame(lines, frameWidth, {
|
|
531
|
+
label: frameLabel,
|
|
532
|
+
status: frameStatus,
|
|
533
|
+
tone: frameTone,
|
|
534
|
+
});
|
|
535
|
+
return framed.length > 0 ? ["", ...framed] : framed;
|
|
456
536
|
}
|
|
457
537
|
|
|
458
538
|
private updateDisplay(): void {
|
|
459
|
-
//
|
|
460
|
-
const bgFn =
|
|
461
|
-
? (text: string) => theme.bg("toolPendingBg", text)
|
|
462
|
-
: this.result?.isError
|
|
463
|
-
? (text: string) => theme.bg("toolErrorBg", text)
|
|
464
|
-
: (text: string) => theme.bg("toolSuccessBg", text);
|
|
539
|
+
// Tool body now uses transparent background; status is conveyed in the frame header.
|
|
540
|
+
const bgFn = (text: string) => text;
|
|
465
541
|
|
|
466
542
|
const useBuiltInRenderer = this.shouldUseBuiltInRenderer();
|
|
467
543
|
let customRendererHasContent = false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Container, Markdown, type MarkdownTheme
|
|
2
|
-
import { getMarkdownTheme
|
|
3
|
-
import {
|
|
1
|
+
import { Container, Markdown, type MarkdownTheme } from "@gsd/pi-tui";
|
|
2
|
+
import { getMarkdownTheme } from "../theme/theme.js";
|
|
3
|
+
import { type TimestampFormat } from "./timestamp.js";
|
|
4
|
+
import { renderChatFrame } from "./chat-frame.js";
|
|
4
5
|
|
|
5
6
|
const OSC133_ZONE_START = "\x1b]133;A\x07";
|
|
6
7
|
const OSC133_ZONE_END = "\x1b]133;B\x07";
|
|
@@ -16,32 +17,28 @@ export class UserMessageComponent extends Container {
|
|
|
16
17
|
super();
|
|
17
18
|
this.timestamp = timestamp;
|
|
18
19
|
this.timestampFormat = timestampFormat;
|
|
19
|
-
this.addChild(new
|
|
20
|
-
this.addChild(
|
|
21
|
-
new Markdown(text, 1, 1, markdownTheme, {
|
|
22
|
-
bgColor: (text: string) => theme.bg("userMessageBg", text),
|
|
23
|
-
color: (text: string) => theme.fg("userMessageText", text),
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
20
|
+
this.addChild(new Markdown(text, 0, 0, markdownTheme));
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
override render(width: number): string[] {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
const frameWidth = Math.max(20, width);
|
|
25
|
+
const contentWidth = Math.max(1, frameWidth - 4);
|
|
26
|
+
const lines = super.render(contentWidth);
|
|
27
|
+
const framed = renderChatFrame(lines, frameWidth, {
|
|
28
|
+
label: "You",
|
|
29
|
+
tone: "user",
|
|
30
|
+
timestamp: this.timestamp,
|
|
31
|
+
timestampFormat: this.timestampFormat,
|
|
32
|
+
showTimestamp: true,
|
|
33
|
+
});
|
|
34
|
+
if (framed.length === 0) {
|
|
35
|
+
return framed;
|
|
32
36
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const timestampLine = " ".repeat(padding) + label;
|
|
40
|
-
lines.splice(0, 0, timestampLine);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
lines[0] = OSC133_ZONE_START + lines[0];
|
|
44
|
-
lines[lines.length - 1] = lines[lines.length - 1] + OSC133_ZONE_END;
|
|
45
|
-
return lines;
|
|
37
|
+
const out = ["", ...framed];
|
|
38
|
+
const firstFrameLine = 1;
|
|
39
|
+
const lastFrameLine = out.length - 1;
|
|
40
|
+
out[firstFrameLine] = OSC133_ZONE_START + out[firstFrameLine];
|
|
41
|
+
out[lastFrameLine] = out[lastFrameLine] + OSC133_ZONE_END;
|
|
42
|
+
return out;
|
|
46
43
|
}
|
|
47
44
|
}
|