pi-ui-extend 0.1.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/README.md +307 -0
- package/bin/pix.mjs +219 -0
- package/dist/app/app.d.ts +96 -0
- package/dist/app/app.js +871 -0
- package/dist/app/blink-controller.d.ts +23 -0
- package/dist/app/blink-controller.js +82 -0
- package/dist/app/cli.d.ts +8 -0
- package/dist/app/cli.js +83 -0
- package/dist/app/clipboard.d.ts +1 -0
- package/dist/app/clipboard.js +24 -0
- package/dist/app/command-controller.d.ts +18 -0
- package/dist/app/command-controller.js +58 -0
- package/dist/app/command-host.d.ts +44 -0
- package/dist/app/command-host.js +1 -0
- package/dist/app/command-model-actions.d.ts +12 -0
- package/dist/app/command-model-actions.js +176 -0
- package/dist/app/command-navigation-actions.d.ts +19 -0
- package/dist/app/command-navigation-actions.js +267 -0
- package/dist/app/command-registry.d.ts +32 -0
- package/dist/app/command-registry.js +225 -0
- package/dist/app/command-runtime.d.ts +5 -0
- package/dist/app/command-runtime.js +32 -0
- package/dist/app/command-session-actions.d.ts +20 -0
- package/dist/app/command-session-actions.js +295 -0
- package/dist/app/constants.d.ts +52 -0
- package/dist/app/constants.js +103 -0
- package/dist/app/conversation-entry-renderer.d.ts +21 -0
- package/dist/app/conversation-entry-renderer.js +81 -0
- package/dist/app/conversation-shell-renderer.d.ts +5 -0
- package/dist/app/conversation-shell-renderer.js +43 -0
- package/dist/app/conversation-tool-renderer.d.ts +16 -0
- package/dist/app/conversation-tool-renderer.js +216 -0
- package/dist/app/conversation-viewport.d.ts +55 -0
- package/dist/app/conversation-viewport.js +252 -0
- package/dist/app/dcp-stats.d.ts +2 -0
- package/dist/app/dcp-stats.js +116 -0
- package/dist/app/editor-layout-renderer.d.ts +31 -0
- package/dist/app/editor-layout-renderer.js +211 -0
- package/dist/app/editor-panels.d.ts +4 -0
- package/dist/app/editor-panels.js +130 -0
- package/dist/app/extension-actions-controller.d.ts +22 -0
- package/dist/app/extension-actions-controller.js +60 -0
- package/dist/app/extension-event-bus.d.ts +3 -0
- package/dist/app/extension-event-bus.js +23 -0
- package/dist/app/extension-ui-controller.d.ts +57 -0
- package/dist/app/extension-ui-controller.js +532 -0
- package/dist/app/file-link-opener.d.ts +2 -0
- package/dist/app/file-link-opener.js +66 -0
- package/dist/app/file-links.d.ts +10 -0
- package/dist/app/file-links.js +117 -0
- package/dist/app/guards.d.ts +3 -0
- package/dist/app/guards.js +9 -0
- package/dist/app/icons.d.ts +37 -0
- package/dist/app/icons.js +97 -0
- package/dist/app/id.d.ts +1 -0
- package/dist/app/id.js +4 -0
- package/dist/app/image-click-targets.d.ts +5 -0
- package/dist/app/image-click-targets.js +32 -0
- package/dist/app/image-opener.d.ts +2 -0
- package/dist/app/image-opener.js +64 -0
- package/dist/app/input-action-controller.d.ts +47 -0
- package/dist/app/input-action-controller.js +209 -0
- package/dist/app/input-controller.d.ts +60 -0
- package/dist/app/input-controller.js +425 -0
- package/dist/app/input-paste-handler.d.ts +27 -0
- package/dist/app/input-paste-handler.js +146 -0
- package/dist/app/menu-items-controller.d.ts +32 -0
- package/dist/app/menu-items-controller.js +182 -0
- package/dist/app/message-content.d.ts +8 -0
- package/dist/app/message-content.js +115 -0
- package/dist/app/model-ref.d.ts +13 -0
- package/dist/app/model-ref.js +50 -0
- package/dist/app/model-usage-controller.d.ts +35 -0
- package/dist/app/model-usage-controller.js +99 -0
- package/dist/app/model-usage-status.d.ts +125 -0
- package/dist/app/model-usage-status.js +749 -0
- package/dist/app/mouse-controller.d.ts +182 -0
- package/dist/app/mouse-controller.js +968 -0
- package/dist/app/native-modifiers.d.ts +3 -0
- package/dist/app/native-modifiers.js +60 -0
- package/dist/app/nerd-font-controller.d.ts +11 -0
- package/dist/app/nerd-font-controller.js +90 -0
- package/dist/app/popup-action-controller.d.ts +44 -0
- package/dist/app/popup-action-controller.js +278 -0
- package/dist/app/popup-menu-controller.d.ts +183 -0
- package/dist/app/popup-menu-controller.js +1070 -0
- package/dist/app/prompt-enhancer-controller.d.ts +40 -0
- package/dist/app/prompt-enhancer-controller.js +215 -0
- package/dist/app/queued-message-controller.d.ts +62 -0
- package/dist/app/queued-message-controller.js +377 -0
- package/dist/app/render-controller.d.ts +41 -0
- package/dist/app/render-controller.js +378 -0
- package/dist/app/render-text.d.ts +19 -0
- package/dist/app/render-text.js +67 -0
- package/dist/app/request-history.d.ts +23 -0
- package/dist/app/request-history.js +131 -0
- package/dist/app/runtime.d.ts +39 -0
- package/dist/app/runtime.js +195 -0
- package/dist/app/screen-selection.d.ts +6 -0
- package/dist/app/screen-selection.js +9 -0
- package/dist/app/screen-styler.d.ts +34 -0
- package/dist/app/screen-styler.js +168 -0
- package/dist/app/scroll-controller.d.ts +51 -0
- package/dist/app/scroll-controller.js +207 -0
- package/dist/app/session-event-controller.d.ts +69 -0
- package/dist/app/session-event-controller.js +338 -0
- package/dist/app/session-history.d.ts +23 -0
- package/dist/app/session-history.js +164 -0
- package/dist/app/session-lifecycle-controller.d.ts +55 -0
- package/dist/app/session-lifecycle-controller.js +116 -0
- package/dist/app/session-search.d.ts +24 -0
- package/dist/app/session-search.js +215 -0
- package/dist/app/shell-command.d.ts +27 -0
- package/dist/app/shell-command.js +176 -0
- package/dist/app/shell-controller.d.ts +28 -0
- package/dist/app/shell-controller.js +124 -0
- package/dist/app/slash-commands.d.ts +6 -0
- package/dist/app/slash-commands.js +75 -0
- package/dist/app/startup-checks.d.ts +8 -0
- package/dist/app/startup-checks.js +59 -0
- package/dist/app/startup-info.d.ts +3 -0
- package/dist/app/startup-info.js +176 -0
- package/dist/app/status-controller.d.ts +35 -0
- package/dist/app/status-controller.js +105 -0
- package/dist/app/status-line-renderer.d.ts +68 -0
- package/dist/app/status-line-renderer.js +453 -0
- package/dist/app/subagents-files.d.ts +10 -0
- package/dist/app/subagents-files.js +193 -0
- package/dist/app/subagents-model.d.ts +23 -0
- package/dist/app/subagents-model.js +224 -0
- package/dist/app/subagents-widget-controller.d.ts +43 -0
- package/dist/app/subagents-widget-controller.js +311 -0
- package/dist/app/tab-line-renderer.d.ts +26 -0
- package/dist/app/tab-line-renderer.js +222 -0
- package/dist/app/tabs-controller.d.ts +100 -0
- package/dist/app/tabs-controller.js +885 -0
- package/dist/app/terminal-controller.d.ts +40 -0
- package/dist/app/terminal-controller.js +135 -0
- package/dist/app/terminal-edit-shortcuts.d.ts +23 -0
- package/dist/app/terminal-edit-shortcuts.js +138 -0
- package/dist/app/terminal-output-buffer.d.ts +20 -0
- package/dist/app/terminal-output-buffer.js +52 -0
- package/dist/app/toast-controller.d.ts +13 -0
- package/dist/app/toast-controller.js +40 -0
- package/dist/app/toast-renderer.d.ts +9 -0
- package/dist/app/toast-renderer.js +79 -0
- package/dist/app/todo-model.d.ts +22 -0
- package/dist/app/todo-model.js +179 -0
- package/dist/app/todo-widget-controller.d.ts +21 -0
- package/dist/app/todo-widget-controller.js +59 -0
- package/dist/app/tool-block-renderer.d.ts +26 -0
- package/dist/app/tool-block-renderer.js +439 -0
- package/dist/app/types.d.ts +550 -0
- package/dist/app/types.js +1 -0
- package/dist/app/update.d.ts +36 -0
- package/dist/app/update.js +315 -0
- package/dist/app/voice-controller.d.ts +52 -0
- package/dist/app/voice-controller.js +600 -0
- package/dist/app/workspace-actions-controller.d.ts +40 -0
- package/dist/app/workspace-actions-controller.js +215 -0
- package/dist/app/workspace-undo.d.ts +44 -0
- package/dist/app/workspace-undo.js +215 -0
- package/dist/config.d.ts +62 -0
- package/dist/config.js +527 -0
- package/dist/context-progress-bar.d.ts +17 -0
- package/dist/context-progress-bar.js +48 -0
- package/dist/default-pix-config.d.ts +1 -0
- package/dist/default-pix-config.js +375 -0
- package/dist/fuzzy.d.ts +23 -0
- package/dist/fuzzy.js +165 -0
- package/dist/input-editor-files.d.ts +15 -0
- package/dist/input-editor-files.js +62 -0
- package/dist/input-editor.d.ts +186 -0
- package/dist/input-editor.js +835 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +12 -0
- package/dist/markdown-format.d.ts +22 -0
- package/dist/markdown-format.js +542 -0
- package/dist/sdk.d.ts +3 -0
- package/dist/sdk.js +1 -0
- package/dist/syntax-highlight.d.ts +22 -0
- package/dist/syntax-highlight.js +528 -0
- package/dist/terminal-width.d.ts +6 -0
- package/dist/terminal-width.js +245 -0
- package/dist/theme.d.ts +56 -0
- package/dist/theme.js +118 -0
- package/dist/tool-renderers/apply-patch.d.ts +2 -0
- package/dist/tool-renderers/apply-patch.js +36 -0
- package/dist/tool-renderers/ast.d.ts +2 -0
- package/dist/tool-renderers/ast.js +5 -0
- package/dist/tool-renderers/compress.d.ts +2 -0
- package/dist/tool-renderers/compress.js +126 -0
- package/dist/tool-renderers/index.d.ts +3 -0
- package/dist/tool-renderers/index.js +44 -0
- package/dist/tool-renderers/question.d.ts +2 -0
- package/dist/tool-renderers/question.js +88 -0
- package/dist/tool-renderers/read.d.ts +2 -0
- package/dist/tool-renderers/read.js +36 -0
- package/dist/tool-renderers/repo.d.ts +2 -0
- package/dist/tool-renderers/repo.js +13 -0
- package/dist/tool-renderers/shell.d.ts +3 -0
- package/dist/tool-renderers/shell.js +27 -0
- package/dist/tool-renderers/skill.d.ts +2 -0
- package/dist/tool-renderers/skill.js +132 -0
- package/dist/tool-renderers/subagents.d.ts +2 -0
- package/dist/tool-renderers/subagents.js +51 -0
- package/dist/tool-renderers/todo.d.ts +2 -0
- package/dist/tool-renderers/todo.js +9 -0
- package/dist/tool-renderers/types.d.ts +42 -0
- package/dist/tool-renderers/types.js +1 -0
- package/dist/tool-renderers/utils.d.ts +31 -0
- package/dist/tool-renderers/utils.js +230 -0
- package/dist/tool-renderers/web.d.ts +3 -0
- package/dist/tool-renderers/web.js +9 -0
- package/dist/tool-renderers/write.d.ts +2 -0
- package/dist/tool-renderers/write.js +42 -0
- package/dist/ui.d.ts +56 -0
- package/dist/ui.js +94 -0
- package/docs/release.md +81 -0
- package/extensions/question/contract.ts +100 -0
- package/extensions/question/index.ts +34 -0
- package/extensions/question/render.ts +28 -0
- package/extensions/question/result.ts +86 -0
- package/extensions/question/tool-description.ts +11 -0
- package/extensions/question/tui.ts +629 -0
- package/extensions/question/types.ts +123 -0
- package/extensions/session-title/config.ts +169 -0
- package/extensions/session-title/index.ts +459 -0
- package/extensions/terminal-bell/index.ts +315 -0
- package/external/pi-tools-suite/README.md +242 -0
- package/external/pi-tools-suite/index.ts +1 -0
- package/external/pi-tools-suite/licenses/ollama-pi-web-search.MIT +21 -0
- package/external/pi-tools-suite/licenses/opencode-mystatus-MIT.txt +21 -0
- package/external/pi-tools-suite/package.json +53 -0
- package/external/pi-tools-suite/src/antigravity-auth/auth-store.ts +194 -0
- package/external/pi-tools-suite/src/antigravity-auth/commands.ts +80 -0
- package/external/pi-tools-suite/src/antigravity-auth/constants.ts +26 -0
- package/external/pi-tools-suite/src/antigravity-auth/headers.ts +20 -0
- package/external/pi-tools-suite/src/antigravity-auth/index.ts +104 -0
- package/external/pi-tools-suite/src/antigravity-auth/models.ts +86 -0
- package/external/pi-tools-suite/src/antigravity-auth/oauth.ts +305 -0
- package/external/pi-tools-suite/src/antigravity-auth/payload.ts +423 -0
- package/external/pi-tools-suite/src/antigravity-auth/status.ts +78 -0
- package/external/pi-tools-suite/src/antigravity-auth/stream.ts +302 -0
- package/external/pi-tools-suite/src/antigravity-auth/types.ts +113 -0
- package/external/pi-tools-suite/src/ast-grep/index.ts +6 -0
- package/external/pi-tools-suite/src/ast-grep/render.ts +70 -0
- package/external/pi-tools-suite/src/ast-grep/schema.ts +109 -0
- package/external/pi-tools-suite/src/ast-grep/tool.ts +345 -0
- package/external/pi-tools-suite/src/ast-grep/types.ts +55 -0
- package/external/pi-tools-suite/src/ast-grep/utils.ts +65 -0
- package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +222 -0
- package/external/pi-tools-suite/src/async-subagents/commands.ts +518 -0
- package/external/pi-tools-suite/src/async-subagents/constants.ts +11 -0
- package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +74 -0
- package/external/pi-tools-suite/src/async-subagents/core/attachment-bridge.ts +133 -0
- package/external/pi-tools-suite/src/async-subagents/core/cleanup.ts +66 -0
- package/external/pi-tools-suite/src/async-subagents/core/concurrency.ts +90 -0
- package/external/pi-tools-suite/src/async-subagents/core/config.ts +819 -0
- package/external/pi-tools-suite/src/async-subagents/core/log-limits.ts +166 -0
- package/external/pi-tools-suite/src/async-subagents/core/model-fallback.ts +133 -0
- package/external/pi-tools-suite/src/async-subagents/core/paths.ts +47 -0
- package/external/pi-tools-suite/src/async-subagents/core/pi-invocation.ts +35 -0
- package/external/pi-tools-suite/src/async-subagents/core/presets.ts +67 -0
- package/external/pi-tools-suite/src/async-subagents/core/process.ts +15 -0
- package/external/pi-tools-suite/src/async-subagents/core/prompt.ts +66 -0
- package/external/pi-tools-suite/src/async-subagents/core/registry.ts +224 -0
- package/external/pi-tools-suite/src/async-subagents/core/retry.ts +191 -0
- package/external/pi-tools-suite/src/async-subagents/core/routing.ts +259 -0
- package/external/pi-tools-suite/src/async-subagents/core/sessions.ts +138 -0
- package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +688 -0
- package/external/pi-tools-suite/src/async-subagents/core/state.ts +281 -0
- package/external/pi-tools-suite/src/async-subagents/core/stop.ts +131 -0
- package/external/pi-tools-suite/src/async-subagents/core/structured-result.ts +237 -0
- package/external/pi-tools-suite/src/async-subagents/core/tool-guard.ts +34 -0
- package/external/pi-tools-suite/src/async-subagents/core/types.ts +150 -0
- package/external/pi-tools-suite/src/async-subagents/core/ultrawork-auto.ts +184 -0
- package/external/pi-tools-suite/src/async-subagents/core/utils.ts +11 -0
- package/external/pi-tools-suite/src/async-subagents/format.ts +41 -0
- package/external/pi-tools-suite/src/async-subagents/index.ts +422 -0
- package/external/pi-tools-suite/src/async-subagents/lib.ts +88 -0
- package/external/pi-tools-suite/src/async-subagents/live.ts +10 -0
- package/external/pi-tools-suite/src/async-subagents/polling.ts +83 -0
- package/external/pi-tools-suite/src/async-subagents/render.ts +230 -0
- package/external/pi-tools-suite/src/async-subagents/subagent-overlay.ts +77 -0
- package/external/pi-tools-suite/src/async-subagents/tasks.ts +120 -0
- package/external/pi-tools-suite/src/async-subagents/tools/cleanup.ts +99 -0
- package/external/pi-tools-suite/src/async-subagents/tools/result.ts +179 -0
- package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +372 -0
- package/external/pi-tools-suite/src/async-subagents/tools/status.ts +60 -0
- package/external/pi-tools-suite/src/async-subagents/tools/stop.ts +79 -0
- package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +152 -0
- package/external/pi-tools-suite/src/async-subagents/tools/wait.ts +67 -0
- package/external/pi-tools-suite/src/async-subagents/types.ts +45 -0
- package/external/pi-tools-suite/src/async-subagents/ui.ts +5 -0
- package/external/pi-tools-suite/src/compress/commands.ts +440 -0
- package/external/pi-tools-suite/src/compress/compress-tool.ts +368 -0
- package/external/pi-tools-suite/src/compress/compression-blocks.ts +524 -0
- package/external/pi-tools-suite/src/compress/config.ts +310 -0
- package/external/pi-tools-suite/src/compress/dcp-tui-filter.ts +498 -0
- package/external/pi-tools-suite/src/compress/index.ts +397 -0
- package/external/pi-tools-suite/src/compress/prompts.ts +269 -0
- package/external/pi-tools-suite/src/compress/pruner-candidates.ts +176 -0
- package/external/pi-tools-suite/src/compress/pruner-compression-blocks.ts +260 -0
- package/external/pi-tools-suite/src/compress/pruner-message-ids.ts +147 -0
- package/external/pi-tools-suite/src/compress/pruner-metadata.ts +268 -0
- package/external/pi-tools-suite/src/compress/pruner-nudge.ts +315 -0
- package/external/pi-tools-suite/src/compress/pruner-tools.ts +263 -0
- package/external/pi-tools-suite/src/compress/pruner-types.ts +25 -0
- package/external/pi-tools-suite/src/compress/pruner.ts +92 -0
- package/external/pi-tools-suite/src/compress/state.ts +486 -0
- package/external/pi-tools-suite/src/compress/ui.ts +308 -0
- package/external/pi-tools-suite/src/config.ts +176 -0
- package/external/pi-tools-suite/src/context-usage.ts +31 -0
- package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +355 -0
- package/external/pi-tools-suite/src/index.ts +46 -0
- package/external/pi-tools-suite/src/lib/lsp.ts +62 -0
- package/external/pi-tools-suite/src/lib/project.ts +42 -0
- package/external/pi-tools-suite/src/lib/tool-args.ts +137 -0
- package/external/pi-tools-suite/src/lsp/_shared/config.ts +156 -0
- package/external/pi-tools-suite/src/lsp/_shared/glob.ts +60 -0
- package/external/pi-tools-suite/src/lsp/_shared/output.ts +102 -0
- package/external/pi-tools-suite/src/lsp/_shared/paths.ts +138 -0
- package/external/pi-tools-suite/src/lsp/_shared/runner.ts +64 -0
- package/external/pi-tools-suite/src/lsp/_shared/template.ts +23 -0
- package/external/pi-tools-suite/src/lsp/_shared/trust.ts +116 -0
- package/external/pi-tools-suite/src/lsp/_shared/types.ts +98 -0
- package/external/pi-tools-suite/src/lsp/async.ts +29 -0
- package/external/pi-tools-suite/src/lsp/child-process.ts +81 -0
- package/external/pi-tools-suite/src/lsp/client.ts +340 -0
- package/external/pi-tools-suite/src/lsp/constants.ts +9 -0
- package/external/pi-tools-suite/src/lsp/diagnostics-store.ts +64 -0
- package/external/pi-tools-suite/src/lsp/documents.ts +24 -0
- package/external/pi-tools-suite/src/lsp/index.ts +31 -0
- package/external/pi-tools-suite/src/lsp/lsp-utils.ts +37 -0
- package/external/pi-tools-suite/src/lsp/manager.ts +190 -0
- package/external/pi-tools-suite/src/lsp/mutation-events.ts +78 -0
- package/external/pi-tools-suite/src/lsp/renderer.ts +1 -0
- package/external/pi-tools-suite/src/lsp/tool-result.ts +6 -0
- package/external/pi-tools-suite/src/lsp/tsserver.ts +107 -0
- package/external/pi-tools-suite/src/lsp/types.ts +15 -0
- package/external/pi-tools-suite/src/model-tools/apply-patch.ts +590 -0
- package/external/pi-tools-suite/src/model-tools/index.ts +430 -0
- package/external/pi-tools-suite/src/model-tools/path-utils.ts +6 -0
- package/external/pi-tools-suite/src/model-tools/tool-args.ts +11 -0
- package/external/pi-tools-suite/src/prompt-commands/index.ts +349 -0
- package/external/pi-tools-suite/src/repo-discovery/index.ts +384 -0
- package/external/pi-tools-suite/src/repo-discovery/project.ts +7 -0
- package/external/pi-tools-suite/src/startup-section.ts +13 -0
- package/external/pi-tools-suite/src/terminal-bell/index.ts +309 -0
- package/external/pi-tools-suite/src/todo/index.ts +201 -0
- package/external/pi-tools-suite/src/todo/state/auto-clear.ts +13 -0
- package/external/pi-tools-suite/src/todo/state/invariants.ts +21 -0
- package/external/pi-tools-suite/src/todo/state/persistence.ts +94 -0
- package/external/pi-tools-suite/src/todo/state/replay.ts +38 -0
- package/external/pi-tools-suite/src/todo/state/selectors.ts +49 -0
- package/external/pi-tools-suite/src/todo/state/state-reducer.ts +362 -0
- package/external/pi-tools-suite/src/todo/state/state.ts +18 -0
- package/external/pi-tools-suite/src/todo/state/store.ts +52 -0
- package/external/pi-tools-suite/src/todo/state/task-graph.ts +57 -0
- package/external/pi-tools-suite/src/todo/todo.ts +487 -0
- package/external/pi-tools-suite/src/todo/tool/response-envelope.ts +143 -0
- package/external/pi-tools-suite/src/todo/tool/types.ts +188 -0
- package/external/pi-tools-suite/src/todo/view/format.ts +18 -0
- package/external/pi-tools-suite/src/todo/view/labels.ts +13 -0
- package/external/pi-tools-suite/src/tool-descriptions.ts +369 -0
- package/external/pi-tools-suite/src/usage/index.ts +152 -0
- package/external/pi-tools-suite/src/usage/lib/copilot.ts +535 -0
- package/external/pi-tools-suite/src/usage/lib/google.ts +478 -0
- package/external/pi-tools-suite/src/usage/lib/openai.ts +268 -0
- package/external/pi-tools-suite/src/usage/lib/types.ts +114 -0
- package/external/pi-tools-suite/src/usage/lib/utils.ts +134 -0
- package/external/pi-tools-suite/src/usage/lib/zhipu.ts +228 -0
- package/external/pi-tools-suite/src/web-search/index.ts +397 -0
- package/package.json +89 -0
- package/skills/context7/SKILL.md +69 -0
- package/skills/context7/scripts/context7.sh +73 -0
- package/skills/handoff/SKILL.md +15 -0
- package/skills/pdf/LICENSE.txt +30 -0
- package/skills/pdf/SKILL.md +314 -0
- package/skills/pdf/forms.md +294 -0
- package/skills/pdf/reference.md +612 -0
- package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/skills/pdf/scripts/create_validation_image.py +37 -0
- package/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/skills/playwright-cli/SKILL.md +388 -0
- package/skills/playwright-cli/references/element-attributes.md +23 -0
- package/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/skills/playwright-cli/references/request-mocking.md +87 -0
- package/skills/playwright-cli/references/running-code.md +241 -0
- package/skills/playwright-cli/references/session-management.md +225 -0
- package/skills/playwright-cli/references/spec-driven-testing.md +305 -0
- package/skills/playwright-cli/references/storage-state.md +275 -0
- package/skills/playwright-cli/references/test-generation.md +134 -0
- package/skills/playwright-cli/references/tracing.md +139 -0
- package/skills/playwright-cli/references/video-recording.md +143 -0
- package/skills/simplify/SKILL.md +51 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +485 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +328 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { Theme } from "../theme.js";
|
|
3
|
+
import type { AppBlinkController } from "./blink-controller.js";
|
|
4
|
+
import type { SessionActivity } from "./types.js";
|
|
5
|
+
export type AppStatusControllerHost = {
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly theme: Theme;
|
|
8
|
+
readonly blinkController: AppBlinkController;
|
|
9
|
+
runtimeSession(): AgentSession | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare class AppStatusController {
|
|
12
|
+
private readonly host;
|
|
13
|
+
private status;
|
|
14
|
+
private statusFollowsSession;
|
|
15
|
+
private gitBranchCache;
|
|
16
|
+
sessionActivity: SessionActivity;
|
|
17
|
+
get statusDotBright(): boolean;
|
|
18
|
+
constructor(host: AppStatusControllerHost);
|
|
19
|
+
setStatus(status: string): void;
|
|
20
|
+
setSessionStatus(session: AgentSession | undefined): void;
|
|
21
|
+
currentStatus(): string;
|
|
22
|
+
setSessionActivity(activity: SessionActivity): void;
|
|
23
|
+
stopStatusBlink(): void;
|
|
24
|
+
formatSessionStatus(session: AgentSession): string;
|
|
25
|
+
statusModelLabel(session: AgentSession): string;
|
|
26
|
+
statusThinkingLabel(session: AgentSession): string;
|
|
27
|
+
statusSessionLabel(session: AgentSession): string;
|
|
28
|
+
statusWorkspaceLabel(): string;
|
|
29
|
+
statusWorkspaceGitBranchLabel(): string | undefined;
|
|
30
|
+
formatContextUsagePercent(session: AgentSession): string;
|
|
31
|
+
roundedContextUsagePercent(session: AgentSession): number | undefined;
|
|
32
|
+
contextUsagePercentColor(percent: number): string;
|
|
33
|
+
private currentGitBranchName;
|
|
34
|
+
private startStatusBlink;
|
|
35
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { GIT_BRANCH_CACHE_MS } from "./constants.js";
|
|
4
|
+
const STATUS_DOT_BLINK_KEY = "status-dot";
|
|
5
|
+
export class AppStatusController {
|
|
6
|
+
host;
|
|
7
|
+
status = "starting";
|
|
8
|
+
statusFollowsSession = false;
|
|
9
|
+
gitBranchCache;
|
|
10
|
+
sessionActivity = "idle";
|
|
11
|
+
get statusDotBright() {
|
|
12
|
+
return this.host.blinkController.visible(STATUS_DOT_BLINK_KEY, false);
|
|
13
|
+
}
|
|
14
|
+
constructor(host) {
|
|
15
|
+
this.host = host;
|
|
16
|
+
}
|
|
17
|
+
setStatus(status) {
|
|
18
|
+
this.status = status;
|
|
19
|
+
this.statusFollowsSession = false;
|
|
20
|
+
}
|
|
21
|
+
setSessionStatus(session) {
|
|
22
|
+
this.statusFollowsSession = true;
|
|
23
|
+
this.status = session ? this.formatSessionStatus(session) : "no session";
|
|
24
|
+
}
|
|
25
|
+
currentStatus() {
|
|
26
|
+
if (!this.statusFollowsSession)
|
|
27
|
+
return this.status;
|
|
28
|
+
const session = this.host.runtimeSession();
|
|
29
|
+
this.status = session ? this.formatSessionStatus(session) : "no session";
|
|
30
|
+
return this.status;
|
|
31
|
+
}
|
|
32
|
+
setSessionActivity(activity) {
|
|
33
|
+
if (this.sessionActivity === activity)
|
|
34
|
+
return;
|
|
35
|
+
this.sessionActivity = activity;
|
|
36
|
+
if (activity === "idle") {
|
|
37
|
+
this.stopStatusBlink();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.startStatusBlink();
|
|
41
|
+
}
|
|
42
|
+
stopStatusBlink() {
|
|
43
|
+
this.host.blinkController.setActive(STATUS_DOT_BLINK_KEY, false, {
|
|
44
|
+
scope: "status-line",
|
|
45
|
+
initialVisible: false,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
formatSessionStatus(session) {
|
|
49
|
+
return `${this.statusModelLabel(session)} ${this.statusThinkingLabel(session)} ${this.formatContextUsagePercent(session)}`;
|
|
50
|
+
}
|
|
51
|
+
statusModelLabel(session) {
|
|
52
|
+
return session.model ? `${session.model.provider}/${session.model.id}` : "no model";
|
|
53
|
+
}
|
|
54
|
+
statusThinkingLabel(session) {
|
|
55
|
+
return session.thinkingLevel;
|
|
56
|
+
}
|
|
57
|
+
statusSessionLabel(session) {
|
|
58
|
+
const name = session.sessionName?.trim();
|
|
59
|
+
return name ? name : `session ${session.sessionId.slice(0, 8)}`;
|
|
60
|
+
}
|
|
61
|
+
statusWorkspaceLabel() {
|
|
62
|
+
const folderName = basename(this.host.cwd) || this.host.cwd;
|
|
63
|
+
const branchLabel = this.statusWorkspaceGitBranchLabel();
|
|
64
|
+
return branchLabel ? `${folderName} ${branchLabel}` : folderName;
|
|
65
|
+
}
|
|
66
|
+
statusWorkspaceGitBranchLabel() {
|
|
67
|
+
const branchName = this.currentGitBranchName();
|
|
68
|
+
return branchName ? `(${branchName})` : undefined;
|
|
69
|
+
}
|
|
70
|
+
formatContextUsagePercent(session) {
|
|
71
|
+
const percent = this.roundedContextUsagePercent(session);
|
|
72
|
+
return percent === undefined ? "?%" : `${percent.toString().padStart(2, " ")}%`;
|
|
73
|
+
}
|
|
74
|
+
roundedContextUsagePercent(session) {
|
|
75
|
+
const percent = session.getContextUsage()?.percent;
|
|
76
|
+
return typeof percent === "number" && Number.isFinite(percent) ? Math.round(percent) : undefined;
|
|
77
|
+
}
|
|
78
|
+
contextUsagePercentColor(percent) {
|
|
79
|
+
if (percent <= 30)
|
|
80
|
+
return this.host.theme.colors.success;
|
|
81
|
+
if (percent <= 50)
|
|
82
|
+
return this.host.theme.colors.warning;
|
|
83
|
+
return this.host.theme.colors.error;
|
|
84
|
+
}
|
|
85
|
+
currentGitBranchName() {
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
if (this.gitBranchCache && now - this.gitBranchCache.checkedAt < GIT_BRANCH_CACHE_MS) {
|
|
88
|
+
return this.gitBranchCache.branch;
|
|
89
|
+
}
|
|
90
|
+
const result = spawnSync("git", ["-C", this.host.cwd, "branch", "--show-current"], {
|
|
91
|
+
encoding: "utf8",
|
|
92
|
+
timeout: 150,
|
|
93
|
+
});
|
|
94
|
+
const branch = result.status === 0 ? result.stdout.trim() || undefined : undefined;
|
|
95
|
+
this.gitBranchCache = { checkedAt: now, branch };
|
|
96
|
+
return branch;
|
|
97
|
+
}
|
|
98
|
+
startStatusBlink() {
|
|
99
|
+
this.host.blinkController.setActive(STATUS_DOT_BLINK_KEY, true, {
|
|
100
|
+
scope: "status-line",
|
|
101
|
+
initialVisible: false,
|
|
102
|
+
resetVisible: true,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { Theme } from "../theme.js";
|
|
3
|
+
import type { SessionActivity, StatusCompactToolsTarget, StatusContextTarget, StatusLineLayout, StatusModelTarget, StatusModelUsageTarget, StatusPromptEnhancerTarget, StatusSessionTarget, StatusThinkingExpandTarget, StatusThinkingTarget, StatusUserJumpTarget, StatusVoiceLanguageTarget, StatusVoiceMicTarget } from "./types.js";
|
|
4
|
+
import type { ScreenStyler } from "./screen-styler.js";
|
|
5
|
+
import { type ModelColorsConfig } from "../config.js";
|
|
6
|
+
export type StatusLineRendererHost = {
|
|
7
|
+
readonly theme: Theme;
|
|
8
|
+
readonly screenStyler: ScreenStyler;
|
|
9
|
+
readonly session: AgentSession | undefined;
|
|
10
|
+
readonly modelColors?: ModelColorsConfig;
|
|
11
|
+
readonly sessionActivity: SessionActivity;
|
|
12
|
+
readonly statusDotBright: boolean;
|
|
13
|
+
currentStatus(): string;
|
|
14
|
+
statusWorkspaceLabel(): string;
|
|
15
|
+
statusWorkspaceGitBranchLabel(): string | undefined;
|
|
16
|
+
statusModelLabel(session: AgentSession): string;
|
|
17
|
+
statusThinkingLabel(session: AgentSession): string;
|
|
18
|
+
formatContextUsagePercent(session: AgentSession): string;
|
|
19
|
+
roundedContextUsagePercent(session: AgentSession): number | undefined;
|
|
20
|
+
contextUsagePercentColor(percent: number): string;
|
|
21
|
+
modelUsageStatusLabel(): string;
|
|
22
|
+
promptEnhancerStatusWidgetText(): string;
|
|
23
|
+
promptEnhancerStatusWidgetActive(): boolean;
|
|
24
|
+
promptEnhancerStatusWidgetEnabled(): boolean;
|
|
25
|
+
voiceStatusWidgetText(): string;
|
|
26
|
+
voiceStatusWidgetActive(): boolean;
|
|
27
|
+
userMessageJumpMenuActive?(): boolean;
|
|
28
|
+
allThinkingExpandedActive?(): boolean;
|
|
29
|
+
superCompactToolsActive?(): boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare class StatusLineRenderer {
|
|
32
|
+
private readonly host;
|
|
33
|
+
constructor(host: StatusLineRendererHost);
|
|
34
|
+
layout(width: number): StatusLineLayout;
|
|
35
|
+
render(row: number, layout: StatusLineLayout, width: number): string;
|
|
36
|
+
modelTarget(statusText: string, row: number): StatusModelTarget | undefined;
|
|
37
|
+
thinkingTarget(statusText: string, row: number): StatusThinkingTarget | undefined;
|
|
38
|
+
contextTarget(statusText: string, row: number, layout: StatusLineLayout): StatusContextTarget | undefined;
|
|
39
|
+
modelUsageTarget(statusText: string, row: number, layout: StatusLineLayout): StatusModelUsageTarget | undefined;
|
|
40
|
+
promptEnhancerTarget(layout: StatusLineLayout, row: number): StatusPromptEnhancerTarget | undefined;
|
|
41
|
+
voiceMicTarget(layout: StatusLineLayout, row: number): StatusVoiceMicTarget | undefined;
|
|
42
|
+
voiceLanguageTarget(layout: StatusLineLayout, row: number): StatusVoiceLanguageTarget | undefined;
|
|
43
|
+
userJumpTarget(layout: StatusLineLayout, row: number): StatusUserJumpTarget | undefined;
|
|
44
|
+
thinkingExpandTarget(layout: StatusLineLayout, row: number): StatusThinkingExpandTarget | undefined;
|
|
45
|
+
compactToolsTarget(layout: StatusLineLayout, row: number): StatusCompactToolsTarget | undefined;
|
|
46
|
+
sessionTarget(statusText: string, row: number, label: string, workspaceLabel: string): StatusSessionTarget | undefined;
|
|
47
|
+
private segments;
|
|
48
|
+
private pushPromptEnhancerWidgetSegment;
|
|
49
|
+
private pushUserJumpWidgetSegment;
|
|
50
|
+
private pushThinkingExpandWidgetSegment;
|
|
51
|
+
private pushCompactToolsWidgetSegment;
|
|
52
|
+
private pushVoiceWidgetSegment;
|
|
53
|
+
private pushWorkspaceSegments;
|
|
54
|
+
private pushModelUsageSegments;
|
|
55
|
+
private modelUsageResetLength;
|
|
56
|
+
private pushSegment;
|
|
57
|
+
private pushContextBarSegments;
|
|
58
|
+
private modelUsageProgressColor;
|
|
59
|
+
private modelProviderColor;
|
|
60
|
+
private thinkingLevelColor;
|
|
61
|
+
private availableThinkingLevels;
|
|
62
|
+
private thinkingRankColor;
|
|
63
|
+
private contextBarLabel;
|
|
64
|
+
private widgetLayout;
|
|
65
|
+
private voiceWidgetLayout;
|
|
66
|
+
private statusDotColor;
|
|
67
|
+
}
|
|
68
|
+
export declare function modelProviderThemeColor(provider: string, colors: Theme["colors"]): string;
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { compactProgressBarSegments, formatCompactProgressBar } from "../context-progress-bar.js";
|
|
2
|
+
import { padOrTrimPlain } from "./render-text.js";
|
|
3
|
+
import { stringDisplayWidth } from "../terminal-width.js";
|
|
4
|
+
import { APP_ICONS } from "./icons.js";
|
|
5
|
+
import { resolveColor, resolveModelColor } from "../config.js";
|
|
6
|
+
const MODEL_USAGE_PROGRESS_BAR_WIDTH = stringDisplayWidth(formatCompactProgressBar(100));
|
|
7
|
+
export class StatusLineRenderer {
|
|
8
|
+
host;
|
|
9
|
+
constructor(host) {
|
|
10
|
+
this.host = host;
|
|
11
|
+
}
|
|
12
|
+
layout(width) {
|
|
13
|
+
const contentWidth = Math.max(1, width);
|
|
14
|
+
const left = 0;
|
|
15
|
+
const statusDot = APP_ICONS.record;
|
|
16
|
+
const userJumpButton = APP_ICONS.user;
|
|
17
|
+
const thinkingExpandButton = APP_ICONS.thinkingExpanded;
|
|
18
|
+
const compactToolsButton = APP_ICONS.compactTools;
|
|
19
|
+
const promptEnhancerWidgetText = this.host.promptEnhancerStatusWidgetText();
|
|
20
|
+
const voiceWidgetText = this.host.voiceStatusWidgetText();
|
|
21
|
+
const rightWidgetText = [userJumpButton, thinkingExpandButton, compactToolsButton, promptEnhancerWidgetText, voiceWidgetText].filter((text) => text.length > 0).join(" ");
|
|
22
|
+
const rightWidgetWidth = stringDisplayWidth(rightWidgetText);
|
|
23
|
+
const leftWidth = rightWidgetWidth > 0 && contentWidth > rightWidgetWidth + 1 ? contentWidth - rightWidgetWidth - 1 : contentWidth;
|
|
24
|
+
const baseStatus = this.host.currentStatus();
|
|
25
|
+
const workspaceLabel = this.host.statusWorkspaceLabel();
|
|
26
|
+
const modelUsageLabel = this.host.modelUsageStatusLabel();
|
|
27
|
+
const workspaceDetailsLabel = modelUsageLabel ? `${workspaceLabel} ${modelUsageLabel}` : workspaceLabel;
|
|
28
|
+
const contextBarLabel = this.contextBarLabel(baseStatus, leftWidth, workspaceDetailsLabel);
|
|
29
|
+
const status = contextBarLabel ? `${baseStatus} ${contextBarLabel}` : baseStatus;
|
|
30
|
+
const sessionLabel = "";
|
|
31
|
+
const details = `${status} ${workspaceDetailsLabel}`;
|
|
32
|
+
const leftText = padOrTrimPlain(`${statusDot} ${details}`, leftWidth);
|
|
33
|
+
const innerText = leftWidth < contentWidth ? `${leftText} ${rightWidgetText}` : padOrTrimPlain(leftText, contentWidth);
|
|
34
|
+
const text = padOrTrimPlain(innerText, width);
|
|
35
|
+
let nextWidgetStartColumn = left + leftWidth + 2;
|
|
36
|
+
const userJumpWidget = leftWidth < contentWidth
|
|
37
|
+
? this.widgetLayout(nextWidgetStartColumn, userJumpButton)
|
|
38
|
+
: undefined;
|
|
39
|
+
if (userJumpWidget)
|
|
40
|
+
nextWidgetStartColumn = userJumpWidget.endColumn + 1;
|
|
41
|
+
const thinkingExpandWidget = leftWidth < contentWidth
|
|
42
|
+
? this.widgetLayout(nextWidgetStartColumn, thinkingExpandButton)
|
|
43
|
+
: undefined;
|
|
44
|
+
if (thinkingExpandWidget)
|
|
45
|
+
nextWidgetStartColumn = thinkingExpandWidget.endColumn + 1;
|
|
46
|
+
const compactToolsWidget = leftWidth < contentWidth
|
|
47
|
+
? this.widgetLayout(nextWidgetStartColumn, compactToolsButton)
|
|
48
|
+
: undefined;
|
|
49
|
+
if (compactToolsWidget)
|
|
50
|
+
nextWidgetStartColumn = compactToolsWidget.endColumn + 1;
|
|
51
|
+
const promptEnhancerWidget = leftWidth < contentWidth && promptEnhancerWidgetText.length > 0
|
|
52
|
+
? this.widgetLayout(nextWidgetStartColumn, promptEnhancerWidgetText)
|
|
53
|
+
: undefined;
|
|
54
|
+
if (promptEnhancerWidget)
|
|
55
|
+
nextWidgetStartColumn = promptEnhancerWidget.endColumn + 1;
|
|
56
|
+
const voiceWidget = leftWidth < contentWidth && voiceWidgetText.length > 0 ? this.voiceWidgetLayout(nextWidgetStartColumn, voiceWidgetText) : undefined;
|
|
57
|
+
return {
|
|
58
|
+
details,
|
|
59
|
+
text,
|
|
60
|
+
sessionLabel,
|
|
61
|
+
workspaceLabel,
|
|
62
|
+
...(userJumpWidget ? { userJumpWidget } : {}),
|
|
63
|
+
...(thinkingExpandWidget ? { thinkingExpandWidget } : {}),
|
|
64
|
+
...(compactToolsWidget ? { compactToolsWidget } : {}),
|
|
65
|
+
...(modelUsageLabel ? { modelUsageLabel } : {}),
|
|
66
|
+
...(contextBarLabel ? { contextBarLabel } : {}),
|
|
67
|
+
...(promptEnhancerWidget ? { promptEnhancerWidget } : {}),
|
|
68
|
+
...(voiceWidget ? { voiceWidget } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
render(row, layout, width) {
|
|
72
|
+
const colors = this.host.theme.colors;
|
|
73
|
+
return this.host.screenStyler.styleLineSegments(row, layout.text, width, {
|
|
74
|
+
foreground: colors.statusForeground,
|
|
75
|
+
}, this.segments(layout.text, layout));
|
|
76
|
+
}
|
|
77
|
+
modelTarget(statusText, row) {
|
|
78
|
+
const session = this.host.session;
|
|
79
|
+
if (!session)
|
|
80
|
+
return undefined;
|
|
81
|
+
const label = this.host.statusModelLabel(session);
|
|
82
|
+
const marker = `${label} ${this.host.statusThinkingLabel(session)} `;
|
|
83
|
+
const startIndex = statusText.indexOf(marker);
|
|
84
|
+
if (startIndex < 0)
|
|
85
|
+
return undefined;
|
|
86
|
+
return { row, startColumn: startIndex + 1, endColumn: startIndex + label.length + 1 };
|
|
87
|
+
}
|
|
88
|
+
thinkingTarget(statusText, row) {
|
|
89
|
+
const session = this.host.session;
|
|
90
|
+
if (!session)
|
|
91
|
+
return undefined;
|
|
92
|
+
const label = this.host.statusThinkingLabel(session);
|
|
93
|
+
const marker = ` ${label} ${this.host.formatContextUsagePercent(session)}`;
|
|
94
|
+
const markerIndex = statusText.indexOf(marker);
|
|
95
|
+
const startIndex = markerIndex >= 0 ? markerIndex + 1 : statusText.indexOf(label);
|
|
96
|
+
if (startIndex < 0)
|
|
97
|
+
return undefined;
|
|
98
|
+
return { row, startColumn: startIndex + 1, endColumn: startIndex + label.length + 1 };
|
|
99
|
+
}
|
|
100
|
+
contextTarget(statusText, row, layout) {
|
|
101
|
+
const session = this.host.session;
|
|
102
|
+
if (!session)
|
|
103
|
+
return undefined;
|
|
104
|
+
const thinkingLabel = this.host.statusThinkingLabel(session);
|
|
105
|
+
const contextLabel = this.host.formatContextUsagePercent(session);
|
|
106
|
+
const marker = ` ${thinkingLabel} ${contextLabel}`;
|
|
107
|
+
const markerIndex = statusText.indexOf(marker);
|
|
108
|
+
if (markerIndex < 0)
|
|
109
|
+
return undefined;
|
|
110
|
+
const startIndex = markerIndex + thinkingLabel.length + 2;
|
|
111
|
+
let endIndex = startIndex + contextLabel.length;
|
|
112
|
+
if (layout.contextBarLabel)
|
|
113
|
+
endIndex += 1 + layout.contextBarLabel.length;
|
|
114
|
+
return { row, startColumn: startIndex + 1, endColumn: endIndex + 1 };
|
|
115
|
+
}
|
|
116
|
+
modelUsageTarget(statusText, row, layout) {
|
|
117
|
+
const label = layout.modelUsageLabel;
|
|
118
|
+
if (!label)
|
|
119
|
+
return undefined;
|
|
120
|
+
const startIndex = statusText.lastIndexOf(label);
|
|
121
|
+
if (startIndex < 0)
|
|
122
|
+
return undefined;
|
|
123
|
+
return { row, startColumn: startIndex + 1, endColumn: startIndex + label.length + 1 };
|
|
124
|
+
}
|
|
125
|
+
promptEnhancerTarget(layout, row) {
|
|
126
|
+
if (!this.host.promptEnhancerStatusWidgetEnabled())
|
|
127
|
+
return undefined;
|
|
128
|
+
const widget = layout.promptEnhancerWidget;
|
|
129
|
+
if (!widget)
|
|
130
|
+
return undefined;
|
|
131
|
+
return { row, startColumn: widget.startColumn, endColumn: widget.endColumn };
|
|
132
|
+
}
|
|
133
|
+
voiceMicTarget(layout, row) {
|
|
134
|
+
const voiceWidget = layout.voiceWidget;
|
|
135
|
+
if (!voiceWidget)
|
|
136
|
+
return undefined;
|
|
137
|
+
return { row, startColumn: voiceWidget.startColumn, endColumn: voiceWidget.micEndColumn };
|
|
138
|
+
}
|
|
139
|
+
voiceLanguageTarget(layout, row) {
|
|
140
|
+
const voiceWidget = layout.voiceWidget;
|
|
141
|
+
if (!voiceWidget)
|
|
142
|
+
return undefined;
|
|
143
|
+
if (voiceWidget.languageStartColumn >= voiceWidget.languageEndColumn)
|
|
144
|
+
return undefined;
|
|
145
|
+
return { row, startColumn: voiceWidget.languageStartColumn, endColumn: voiceWidget.languageEndColumn };
|
|
146
|
+
}
|
|
147
|
+
userJumpTarget(layout, row) {
|
|
148
|
+
const widget = layout.userJumpWidget;
|
|
149
|
+
if (!widget)
|
|
150
|
+
return undefined;
|
|
151
|
+
return { row, startColumn: widget.startColumn, endColumn: widget.endColumn };
|
|
152
|
+
}
|
|
153
|
+
thinkingExpandTarget(layout, row) {
|
|
154
|
+
const widget = layout.thinkingExpandWidget;
|
|
155
|
+
if (!widget)
|
|
156
|
+
return undefined;
|
|
157
|
+
return { row, startColumn: widget.startColumn, endColumn: widget.endColumn };
|
|
158
|
+
}
|
|
159
|
+
compactToolsTarget(layout, row) {
|
|
160
|
+
const widget = layout.compactToolsWidget;
|
|
161
|
+
if (!widget)
|
|
162
|
+
return undefined;
|
|
163
|
+
return { row, startColumn: widget.startColumn, endColumn: widget.endColumn };
|
|
164
|
+
}
|
|
165
|
+
sessionTarget(statusText, row, label, workspaceLabel) {
|
|
166
|
+
if (!this.host.session || !label)
|
|
167
|
+
return undefined;
|
|
168
|
+
const marker = ` ${label} ${workspaceLabel}`;
|
|
169
|
+
const markerIndex = statusText.lastIndexOf(marker);
|
|
170
|
+
const startIndex = markerIndex >= 0 ? markerIndex + 1 : statusText.lastIndexOf(label);
|
|
171
|
+
if (startIndex < 0)
|
|
172
|
+
return undefined;
|
|
173
|
+
const endIndex = Math.min(statusText.length, startIndex + label.length);
|
|
174
|
+
if (endIndex <= startIndex)
|
|
175
|
+
return undefined;
|
|
176
|
+
return { row, startColumn: startIndex + 1, endColumn: endIndex + 1 };
|
|
177
|
+
}
|
|
178
|
+
segments(statusText, layout) {
|
|
179
|
+
const statusDotStart = statusText.indexOf(APP_ICONS.record);
|
|
180
|
+
const segments = statusDotStart >= 0 ? [{
|
|
181
|
+
start: statusDotStart,
|
|
182
|
+
end: statusDotStart + APP_ICONS.record.length,
|
|
183
|
+
foreground: this.statusDotColor(),
|
|
184
|
+
}] : [];
|
|
185
|
+
this.pushUserJumpWidgetSegment(segments, statusText);
|
|
186
|
+
this.pushThinkingExpandWidgetSegment(segments, statusText);
|
|
187
|
+
this.pushCompactToolsWidgetSegment(segments, statusText);
|
|
188
|
+
this.pushWorkspaceSegments(segments, statusText, layout.workspaceLabel);
|
|
189
|
+
if (layout.modelUsageLabel)
|
|
190
|
+
this.pushModelUsageSegments(segments, statusText, layout.modelUsageLabel);
|
|
191
|
+
this.pushPromptEnhancerWidgetSegment(segments, statusText);
|
|
192
|
+
this.pushVoiceWidgetSegment(segments, statusText);
|
|
193
|
+
const session = this.host.session;
|
|
194
|
+
if (!session)
|
|
195
|
+
return segments;
|
|
196
|
+
const modelLabel = this.host.statusModelLabel(session);
|
|
197
|
+
const thinkingLabel = this.host.statusThinkingLabel(session);
|
|
198
|
+
const contextLabel = this.host.formatContextUsagePercent(session);
|
|
199
|
+
this.pushSegment(segments, statusText.indexOf(`${modelLabel} ${thinkingLabel} `), modelLabel.length, this.modelProviderColor(session));
|
|
200
|
+
const thinkingMarkerStart = statusText.indexOf(` ${thinkingLabel} ${contextLabel}`);
|
|
201
|
+
const thinkingStart = thinkingMarkerStart >= 0 ? thinkingMarkerStart + 1 : -1;
|
|
202
|
+
this.pushSegment(segments, thinkingStart, thinkingLabel.length, this.thinkingLevelColor(thinkingLabel));
|
|
203
|
+
const contextPercent = this.host.roundedContextUsagePercent(session);
|
|
204
|
+
if (contextPercent !== undefined && thinkingStart >= 0) {
|
|
205
|
+
const contextStart = thinkingStart + thinkingLabel.length + 1;
|
|
206
|
+
this.pushSegment(segments, contextStart, contextLabel.length, this.host.contextUsagePercentColor(contextPercent));
|
|
207
|
+
if (layout.contextBarLabel) {
|
|
208
|
+
const barStart = contextStart + contextLabel.length + 1;
|
|
209
|
+
this.pushContextBarSegments(segments, barStart, contextPercent);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
this.pushSegment(segments, statusText.lastIndexOf(layout.sessionLabel), layout.sessionLabel.length, this.host.theme.colors.selectionForeground);
|
|
213
|
+
return segments;
|
|
214
|
+
}
|
|
215
|
+
pushPromptEnhancerWidgetSegment(segments, statusText) {
|
|
216
|
+
const widgetText = this.host.promptEnhancerStatusWidgetText();
|
|
217
|
+
const start = statusText.lastIndexOf(widgetText);
|
|
218
|
+
if (start < 0 || widgetText.length <= 0)
|
|
219
|
+
return;
|
|
220
|
+
const foreground = this.host.promptEnhancerStatusWidgetActive()
|
|
221
|
+
? this.host.theme.colors.warning
|
|
222
|
+
: this.host.promptEnhancerStatusWidgetEnabled()
|
|
223
|
+
? this.host.theme.colors.info
|
|
224
|
+
: this.host.theme.colors.muted;
|
|
225
|
+
this.pushSegment(segments, start, widgetText.length, foreground);
|
|
226
|
+
}
|
|
227
|
+
pushUserJumpWidgetSegment(segments, statusText) {
|
|
228
|
+
const buttonText = APP_ICONS.user;
|
|
229
|
+
const start = statusText.indexOf(buttonText);
|
|
230
|
+
if (start < 0)
|
|
231
|
+
return;
|
|
232
|
+
const foreground = this.host.userMessageJumpMenuActive?.()
|
|
233
|
+
? this.host.theme.colors.info
|
|
234
|
+
: this.host.theme.colors.muted;
|
|
235
|
+
this.pushSegment(segments, start, buttonText.length, foreground);
|
|
236
|
+
}
|
|
237
|
+
pushThinkingExpandWidgetSegment(segments, statusText) {
|
|
238
|
+
const buttonText = APP_ICONS.thinkingExpanded;
|
|
239
|
+
const start = statusText.indexOf(buttonText);
|
|
240
|
+
if (start < 0)
|
|
241
|
+
return;
|
|
242
|
+
this.pushSegment(segments, start, buttonText.length, this.host.allThinkingExpandedActive?.() ? this.host.theme.colors.info : this.host.theme.colors.muted);
|
|
243
|
+
}
|
|
244
|
+
pushCompactToolsWidgetSegment(segments, statusText) {
|
|
245
|
+
const buttonText = APP_ICONS.compactTools;
|
|
246
|
+
const start = statusText.indexOf(buttonText);
|
|
247
|
+
if (start < 0)
|
|
248
|
+
return;
|
|
249
|
+
this.pushSegment(segments, start, buttonText.length, this.host.superCompactToolsActive?.() ? this.host.theme.colors.info : this.host.theme.colors.muted);
|
|
250
|
+
}
|
|
251
|
+
pushVoiceWidgetSegment(segments, statusText) {
|
|
252
|
+
const widgetText = this.host.voiceStatusWidgetText();
|
|
253
|
+
const start = statusText.lastIndexOf(widgetText);
|
|
254
|
+
if (start < 0 || widgetText.length <= 0)
|
|
255
|
+
return;
|
|
256
|
+
if (this.host.voiceStatusWidgetActive()) {
|
|
257
|
+
const separatorIndex = widgetText.indexOf(" ");
|
|
258
|
+
const micLength = separatorIndex >= 0 ? separatorIndex : widgetText.length;
|
|
259
|
+
this.pushSegment(segments, start, micLength, this.host.theme.colors.error);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const separatorIndex = widgetText.indexOf(" ");
|
|
263
|
+
const micLength = separatorIndex >= 0 ? separatorIndex : widgetText.length;
|
|
264
|
+
this.pushSegment(segments, start, micLength, this.host.theme.colors.info);
|
|
265
|
+
}
|
|
266
|
+
pushWorkspaceSegments(segments, statusText, workspaceLabel) {
|
|
267
|
+
const start = statusText.lastIndexOf(workspaceLabel);
|
|
268
|
+
if (start < 0 || workspaceLabel.length <= 0)
|
|
269
|
+
return;
|
|
270
|
+
const branchLabel = this.host.statusWorkspaceGitBranchLabel();
|
|
271
|
+
if (!branchLabel) {
|
|
272
|
+
this.pushSegment(segments, start, workspaceLabel.length, this.host.theme.colors.selectionForeground);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const branchStart = workspaceLabel.lastIndexOf(branchLabel);
|
|
276
|
+
const branchEndsWorkspace = branchStart >= 0 && branchStart + branchLabel.length === workspaceLabel.length;
|
|
277
|
+
if (!branchEndsWorkspace) {
|
|
278
|
+
this.pushSegment(segments, start, workspaceLabel.length, this.host.theme.colors.selectionForeground);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.pushSegment(segments, start, branchStart, this.host.theme.colors.selectionForeground);
|
|
282
|
+
this.pushSegment(segments, start + branchStart, branchLabel.length, this.host.theme.colors.muted);
|
|
283
|
+
}
|
|
284
|
+
pushModelUsageSegments(segments, statusText, modelUsageLabel) {
|
|
285
|
+
const labelStart = statusText.lastIndexOf(modelUsageLabel);
|
|
286
|
+
if (labelStart < 0)
|
|
287
|
+
return;
|
|
288
|
+
const usageMatches = modelUsageLabel.matchAll(/(\d{1,3})% /gu);
|
|
289
|
+
let prefixColored = false;
|
|
290
|
+
for (const match of usageMatches) {
|
|
291
|
+
const localStart = match.index;
|
|
292
|
+
const percentToken = `${match[1]}%`;
|
|
293
|
+
const percentText = match[1];
|
|
294
|
+
if (localStart === undefined || !percentText)
|
|
295
|
+
continue;
|
|
296
|
+
if (!prefixColored) {
|
|
297
|
+
prefixColored = true;
|
|
298
|
+
const prefixLength = modelUsageLabel.slice(0, localStart).trimEnd().length;
|
|
299
|
+
this.pushSegment(segments, labelStart, prefixLength, this.host.theme.colors.selectionForeground);
|
|
300
|
+
}
|
|
301
|
+
const percent = Number.parseInt(percentText, 10);
|
|
302
|
+
if (!Number.isFinite(percent))
|
|
303
|
+
continue;
|
|
304
|
+
const start = labelStart + localStart;
|
|
305
|
+
const color = this.modelUsageProgressColor(percent);
|
|
306
|
+
this.pushSegment(segments, start, percentToken.length, color);
|
|
307
|
+
const barStart = start + percentToken.length + 1;
|
|
308
|
+
segments.push(...compactProgressBarSegments(barStart, percent, {
|
|
309
|
+
fill: color,
|
|
310
|
+
track: this.host.theme.colors.statusDotBase,
|
|
311
|
+
}, MODEL_USAGE_PROGRESS_BAR_WIDTH));
|
|
312
|
+
const resetStart = barStart + MODEL_USAGE_PROGRESS_BAR_WIDTH + 1;
|
|
313
|
+
const resetLength = this.modelUsageResetLength(modelUsageLabel, resetStart - labelStart);
|
|
314
|
+
this.pushSegment(segments, resetStart, resetLength, this.host.theme.colors.muted);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
modelUsageResetLength(modelUsageLabel, localStart) {
|
|
318
|
+
if (localStart < 0 || localStart >= modelUsageLabel.length)
|
|
319
|
+
return 0;
|
|
320
|
+
const nextSeparator = modelUsageLabel.indexOf(" • ", localStart);
|
|
321
|
+
return (nextSeparator >= 0 ? nextSeparator : modelUsageLabel.length) - localStart;
|
|
322
|
+
}
|
|
323
|
+
pushSegment(segments, start, length, foreground) {
|
|
324
|
+
if (start < 0 || length <= 0)
|
|
325
|
+
return;
|
|
326
|
+
segments.push({ start, end: start + length, foreground });
|
|
327
|
+
}
|
|
328
|
+
pushContextBarSegments(segments, start, percent) {
|
|
329
|
+
segments.push(...compactProgressBarSegments(start, percent, {
|
|
330
|
+
fill: this.host.contextUsagePercentColor(percent),
|
|
331
|
+
track: this.host.theme.colors.statusDotBase,
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
modelUsageProgressColor(percent) {
|
|
335
|
+
if (percent < 20)
|
|
336
|
+
return this.host.theme.colors.error;
|
|
337
|
+
if (percent < 50)
|
|
338
|
+
return this.host.theme.colors.warning;
|
|
339
|
+
return this.host.theme.colors.success;
|
|
340
|
+
}
|
|
341
|
+
modelProviderColor(session) {
|
|
342
|
+
const provider = session.model?.provider;
|
|
343
|
+
if (!provider)
|
|
344
|
+
return this.host.theme.colors.selectionForeground;
|
|
345
|
+
const modelId = session.model?.id;
|
|
346
|
+
const configuredColor = modelId && this.host.modelColors
|
|
347
|
+
? resolveModelColor(`${provider}/${modelId}`, this.host.modelColors)
|
|
348
|
+
: undefined;
|
|
349
|
+
return configuredColor
|
|
350
|
+
? resolveColor(configuredColor, this.host.theme.colors)
|
|
351
|
+
: modelProviderThemeColor(provider, this.host.theme.colors);
|
|
352
|
+
}
|
|
353
|
+
thinkingLevelColor(label) {
|
|
354
|
+
const levels = this.availableThinkingLevels();
|
|
355
|
+
const rank = levels.indexOf(label);
|
|
356
|
+
if (rank >= 0)
|
|
357
|
+
return this.thinkingRankColor(label, rank, levels.length);
|
|
358
|
+
const fallbackLevels = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
359
|
+
const fallbackRank = fallbackLevels.indexOf(label);
|
|
360
|
+
return fallbackRank >= 0
|
|
361
|
+
? this.thinkingRankColor(label, fallbackRank, fallbackLevels.length)
|
|
362
|
+
: this.host.theme.colors.info;
|
|
363
|
+
}
|
|
364
|
+
availableThinkingLevels() {
|
|
365
|
+
const levels = this.host.session?.getAvailableThinkingLevels();
|
|
366
|
+
return Array.isArray(levels) && levels.length > 0 ? levels.map(String) : ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
367
|
+
}
|
|
368
|
+
thinkingRankColor(label, rank, count) {
|
|
369
|
+
const baseColors = [
|
|
370
|
+
this.host.theme.colors.muted,
|
|
371
|
+
this.host.theme.colors.success,
|
|
372
|
+
this.host.theme.colors.warning,
|
|
373
|
+
this.host.theme.colors.toolMutation,
|
|
374
|
+
this.host.theme.colors.error,
|
|
375
|
+
this.host.theme.colors.thinkingXHigh,
|
|
376
|
+
];
|
|
377
|
+
const colors = count > baseColors.length ? [this.host.theme.colors.statusForeground, ...baseColors] : baseColors;
|
|
378
|
+
const fallbackLevels = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
379
|
+
const fallbackRank = fallbackLevels.indexOf(label);
|
|
380
|
+
const colorIndex = count <= baseColors.length && fallbackRank >= 0 ? fallbackRank : rank;
|
|
381
|
+
return colors[Math.max(0, Math.min(colors.length - 1, colorIndex))] ?? this.host.theme.colors.info;
|
|
382
|
+
}
|
|
383
|
+
contextBarLabel(status, width, workspaceLabel) {
|
|
384
|
+
const session = this.host.session;
|
|
385
|
+
if (!session)
|
|
386
|
+
return undefined;
|
|
387
|
+
const contextPercent = this.host.roundedContextUsagePercent(session);
|
|
388
|
+
if (contextPercent === undefined)
|
|
389
|
+
return undefined;
|
|
390
|
+
const contextLabel = this.host.formatContextUsagePercent(session);
|
|
391
|
+
if (!status.endsWith(contextLabel))
|
|
392
|
+
return undefined;
|
|
393
|
+
const label = formatCompactProgressBar(contextPercent);
|
|
394
|
+
const details = `${status} ${label} ${workspaceLabel}`;
|
|
395
|
+
return stringDisplayWidth(`${APP_ICONS.record} ${details}`) <= width ? label : undefined;
|
|
396
|
+
}
|
|
397
|
+
widgetLayout(startColumn, widgetText) {
|
|
398
|
+
return {
|
|
399
|
+
startColumn,
|
|
400
|
+
endColumn: startColumn + stringDisplayWidth(widgetText),
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
voiceWidgetLayout(startColumn, widgetText) {
|
|
404
|
+
const separatorIndex = widgetText.indexOf(" ");
|
|
405
|
+
const micText = separatorIndex >= 0 ? widgetText.slice(0, separatorIndex) : widgetText;
|
|
406
|
+
const languageStartOffset = separatorIndex >= 0 ? stringDisplayWidth(widgetText.slice(0, separatorIndex + 1)) : stringDisplayWidth(widgetText);
|
|
407
|
+
const afterLanguageIndex = widgetText.indexOf(" ", separatorIndex + 1);
|
|
408
|
+
const languageTextEndIndex = afterLanguageIndex >= 0 ? afterLanguageIndex : widgetText.length;
|
|
409
|
+
const languageEndOffset = stringDisplayWidth(widgetText.slice(0, languageTextEndIndex));
|
|
410
|
+
return {
|
|
411
|
+
startColumn,
|
|
412
|
+
micEndColumn: startColumn + stringDisplayWidth(micText),
|
|
413
|
+
languageStartColumn: startColumn + languageStartOffset,
|
|
414
|
+
languageEndColumn: startColumn + languageEndOffset,
|
|
415
|
+
endColumn: startColumn + stringDisplayWidth(widgetText),
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
statusDotColor() {
|
|
419
|
+
switch (this.host.sessionActivity) {
|
|
420
|
+
case "thinking":
|
|
421
|
+
return this.host.statusDotBright ? this.host.theme.colors.info : this.host.theme.colors.statusDotBase;
|
|
422
|
+
case "running":
|
|
423
|
+
return this.host.statusDotBright ? this.host.theme.colors.warning : this.host.theme.colors.statusDotBase;
|
|
424
|
+
case "idle":
|
|
425
|
+
return this.host.theme.colors.statusDotBase;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
export function modelProviderThemeColor(provider, colors) {
|
|
430
|
+
const palette = modelProviderThemePalette(colors);
|
|
431
|
+
const hash = hashString(provider.trim().toLowerCase());
|
|
432
|
+
return palette[hash % palette.length] ?? colors.info;
|
|
433
|
+
}
|
|
434
|
+
function modelProviderThemePalette(colors) {
|
|
435
|
+
return [
|
|
436
|
+
colors.accent,
|
|
437
|
+
colors.info,
|
|
438
|
+
colors.toolSearch,
|
|
439
|
+
colors.toolMutation,
|
|
440
|
+
colors.success,
|
|
441
|
+
colors.warning,
|
|
442
|
+
];
|
|
443
|
+
}
|
|
444
|
+
function hashString(value) {
|
|
445
|
+
let hash = 1779033703 ^ value.length;
|
|
446
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
447
|
+
hash = Math.imul(hash ^ value.charCodeAt(index), 3432918353);
|
|
448
|
+
hash = (hash << 13) | (hash >>> 19);
|
|
449
|
+
}
|
|
450
|
+
hash = Math.imul(hash ^ (hash >>> 16), 2246822507);
|
|
451
|
+
hash = Math.imul(hash ^ (hash >>> 13), 3266489909);
|
|
452
|
+
return (hash ^ (hash >>> 16)) >>> 0;
|
|
453
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SubagentAgentState, SubagentRegistry } from "./types.js";
|
|
2
|
+
export declare function subagentsRegistryPath(cwd: string): string;
|
|
3
|
+
export declare function readSubagentRegistry(cwd: string): Promise<SubagentRegistry | undefined>;
|
|
4
|
+
export declare function readSubagentRunStateFromFiles(runDir: string, options?: {
|
|
5
|
+
includeLineCounts?: boolean;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
runDir: string;
|
|
8
|
+
agents: SubagentAgentState[];
|
|
9
|
+
} | undefined>;
|
|
10
|
+
export declare function subagentRunHasParentSession(runDir: string, parentSessionFile: string | undefined): Promise<boolean>;
|