@psnext/slingcli 2.4.20260507-3 → 2.4.20260509-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/bin/sling.js +12 -12
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/agent-loop.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/agent.js +4 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +526 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +243 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +616 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +348 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/factory.js +9 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +194 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +92 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +31 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +196 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +170 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +90 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +258 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +16 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +97 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +26 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/proxy.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/package.json +7 -5
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/cli.js +6 -6
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/env-api-keys.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +307 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js +14 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/index.js +4 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/models.generated.js +427 -122
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +129 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-codex-responses.js +1 -1
- package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-completions.js +150 -122
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-responses-shared.js +14 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/openai-codex.js +25 -14
- package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/overflow.js +3 -0
- package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/package.json +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/bun/register-bedrock.js +4 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/args.js +1 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/list-models.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/session-picker.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/config.js +52 -30
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/auth-storage.js +2 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/branch-summarization.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/compaction.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +153 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.css +45 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.js +68 -4
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/loader.js +26 -12
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/keybindings.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/model-registry.js +3 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/model-resolver.js +2 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/package-manager.js +22 -5
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/provider-display-names.js +1 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/sdk.js +3 -3
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/bash.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/edit.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/find.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/grep.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/ls.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/read.js +3 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/render-utils.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +205 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/write.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/main.js +2 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/migrations.js +3 -3
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/config-selector.js +25 -3
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/custom-editor.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/earendil-announcement.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-input.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/footer.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +4 -3
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/model-selector.js +2 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/session-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/theme-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +3 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/interactive-mode.js +47 -32
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -1
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/package-manager-cli.js +42 -39
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard.js +9 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/paths.js +16 -0
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/version-check.js +9 -2
- package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/package.json +9 -8
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/image.js +14 -7
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/markdown.js +24 -84
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/terminal-image.js +10 -4
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/tui.js +73 -4
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/utils.js +33 -7
- package/node_modules/{@mariozechner → @earendil-works}/pi-tui/package.json +3 -3
- package/node_modules/@mariozechner/clipboard/README.md +58 -0
- package/node_modules/@mariozechner/clipboard/index.d.ts +23 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/README.md +3 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/http2.d.ts +4 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/stream/web.d.ts +4 -0
- package/node_modules/brace-expansion/dist/commonjs/index.js +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +1 -1
- package/node_modules/fast-xml-builder/CHANGELOG.md +4 -0
- package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -1
- package/node_modules/fast-xml-builder/lib/fxb.d.cts +91 -1
- package/node_modules/fast-xml-builder/lib/fxb.min.js +1 -1
- package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -1
- package/node_modules/fast-xml-builder/package.json +3 -2
- package/node_modules/fast-xml-builder/src/fxb.d.ts +92 -3
- package/node_modules/fast-xml-builder/src/fxb.js +92 -31
- package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +87 -33
- package/node_modules/get-east-asian-width/lookup-data.js +15 -12
- package/node_modules/get-east-asian-width/lookup.js +25 -22
- package/node_modules/get-east-asian-width/package.json +1 -1
- package/node_modules/jiti/README.md +258 -0
- package/node_modules/jiti/dist/babel.cjs +257 -0
- package/node_modules/jiti/dist/jiti.cjs +1 -0
- package/node_modules/jiti/lib/jiti.mjs +29 -0
- package/node_modules/jiti/lib/types.d.ts +420 -0
- package/node_modules/jiti/package.json +146 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +5 -3
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +5 -3
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/namespace.js +3 -1
- package/node_modules/semver/README.md +19 -4
- package/node_modules/semver/bin/semver.js +14 -10
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/index.js +2 -0
- package/node_modules/semver/internal/re.js +1 -1
- package/node_modules/semver/package.json +3 -3
- package/node_modules/semver/range.bnf +5 -4
- package/node_modules/socks/package.json +2 -2
- package/node_modules/xml-naming/README.md +189 -0
- package/node_modules/xml-naming/package.json +54 -0
- package/node_modules/xml-naming/src/index.d.ts +74 -0
- package/node_modules/xml-naming/src/index.js +270 -0
- package/package.json +6 -6
- package/sling-default-packages.json +2 -1
- package/slingshot/index.js +442 -23
- package/node_modules/@mariozechner/jiti/dist/babel.cjs +0 -246
- package/node_modules/@mariozechner/jiti/dist/jiti.cjs +0 -1
- package/node_modules/@mariozechner/jiti/package.json +0 -96
- package/node_modules/@mariozechner/pi-agent-core/dist/index.js +0 -9
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/cli.js +0 -116
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/env-api-keys.js +0 -166
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/index.js +0 -15
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/models.generated.js +0 -16568
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/amazon-bedrock.js +0 -753
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/openai-codex-responses.js +0 -909
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/openai-responses-shared.js +0 -479
- package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/utils/oauth/openai-codex.js +0 -374
- package/node_modules/@mariozechner/pi-ai/dist/api-registry.js +0 -44
- package/node_modules/@mariozechner/pi-ai/dist/bedrock-provider.js +0 -6
- package/node_modules/@mariozechner/pi-ai/dist/models.js +0 -71
- package/node_modules/@mariozechner/pi-ai/dist/oauth.js +0 -2
- package/node_modules/@mariozechner/pi-ai/dist/providers/anthropic.js +0 -951
- package/node_modules/@mariozechner/pi-ai/dist/providers/azure-openai-responses.js +0 -208
- package/node_modules/@mariozechner/pi-ai/dist/providers/cloudflare.js +0 -26
- package/node_modules/@mariozechner/pi-ai/dist/providers/faux.js +0 -368
- package/node_modules/@mariozechner/pi-ai/dist/providers/github-copilot-headers.js +0 -29
- package/node_modules/@mariozechner/pi-ai/dist/providers/google-shared.js +0 -329
- package/node_modules/@mariozechner/pi-ai/dist/providers/google-vertex.js +0 -442
- package/node_modules/@mariozechner/pi-ai/dist/providers/google.js +0 -400
- package/node_modules/@mariozechner/pi-ai/dist/providers/mistral.js +0 -535
- package/node_modules/@mariozechner/pi-ai/dist/providers/openai-completions.js +0 -908
- package/node_modules/@mariozechner/pi-ai/dist/providers/openai-responses.js +0 -220
- package/node_modules/@mariozechner/pi-ai/dist/providers/register-builtins.js +0 -243
- package/node_modules/@mariozechner/pi-ai/dist/providers/simple-options.js +0 -39
- package/node_modules/@mariozechner/pi-ai/dist/providers/transform-messages.js +0 -184
- package/node_modules/@mariozechner/pi-ai/dist/stream.js +0 -27
- package/node_modules/@mariozechner/pi-ai/dist/types.js +0 -2
- package/node_modules/@mariozechner/pi-ai/dist/utils/event-stream.js +0 -81
- package/node_modules/@mariozechner/pi-ai/dist/utils/hash.js +0 -14
- package/node_modules/@mariozechner/pi-ai/dist/utils/headers.js +0 -8
- package/node_modules/@mariozechner/pi-ai/dist/utils/json-parse.js +0 -113
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/anthropic.js +0 -335
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/github-copilot.js +0 -292
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/index.js +0 -121
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/oauth-page.js +0 -105
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/pkce.js +0 -31
- package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/types.js +0 -2
- package/node_modules/@mariozechner/pi-ai/dist/utils/overflow.js +0 -146
- package/node_modules/@mariozechner/pi-ai/dist/utils/sanitize-unicode.js +0 -26
- package/node_modules/@mariozechner/pi-ai/dist/utils/typebox-helpers.js +0 -21
- package/node_modules/@mariozechner/pi-ai/dist/utils/validation.js +0 -281
- package/node_modules/@mariozechner/pi-ai/package.json +0 -108
- package/node_modules/@mariozechner/pi-coding-agent/dist/bun/register-bedrock.js +0 -4
- package/node_modules/@mariozechner/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +0 -22
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/agent-loop.js +0 -458
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/agent.js +0 -398
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/index.js +0 -9
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/proxy.js +0 -278
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/types.js +0 -2
- package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/package.json +0 -45
- package/node_modules/socks/.claude/settings.local.json +0 -26
- package/node_modules/std-env/LICENCE +0 -22
- package/node_modules/std-env/README.md +0 -118
- package/node_modules/std-env/dist/index.cjs +0 -1
- package/node_modules/std-env/dist/index.d.cts +0 -92
- package/node_modules/std-env/dist/index.d.mts +0 -92
- package/node_modules/std-env/dist/index.d.ts +0 -92
- package/node_modules/std-env/dist/index.mjs +0 -1
- package/node_modules/std-env/package.json +0 -46
- package/node_modules/yoctocolors/base.d.ts +0 -47
- package/node_modules/yoctocolors/base.js +0 -94
- package/node_modules/yoctocolors/index.d.ts +0 -2
- package/node_modules/yoctocolors/index.js +0 -2
- package/node_modules/yoctocolors/license +0 -9
- package/node_modules/yoctocolors/package.json +0 -69
- package/node_modules/yoctocolors/readme.md +0 -138
- /package/node_modules/{@mariozechner/pi-coding-agent/dist/core → @earendil-works/pi-agent-core/dist/harness}/compaction/utils.js +0 -0
- /package/node_modules/{@mariozechner/pi-coding-agent/dist/core/tools → @earendil-works/pi-agent-core/dist/harness/utils}/truncate.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/types.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/api-registry.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/bedrock-provider.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/models.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/oauth.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/amazon-bedrock.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/anthropic.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/azure-openai-responses.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/cloudflare.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/faux.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/github-copilot-headers.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google-shared.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google-vertex.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/mistral.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-responses.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/register-builtins.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/simple-options.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/transform-messages.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/session-resources.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/stream.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/types.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/utils/diagnostics.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/event-stream.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/hash.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/headers.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/json-parse.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/anthropic.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/github-copilot.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/index.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/oauth-page.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/pkce.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/types.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/sanitize-unicode.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/typebox-helpers.js +0 -0
- /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/validation.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/bun/cli.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/bun/restore-sandbox-env.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/file-processor.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/initial-message.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session-runtime.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session-services.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/auth-guidance.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/bash-executor.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/defaults.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/diagnostics.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/event-bus.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/exec.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/ansi-to-html.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.html +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/tool-renderer.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/vendor/highlight.min.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/runner.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/types.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/wrapper.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/footer-data-provider.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/messages.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/output-guard.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/prompt-templates.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/resolve-config-value.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/resource-loader.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/session-cwd.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/session-manager.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/settings-manager.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/skills.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/slash-commands.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/source-info.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/system-prompt.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/telemetry.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/timings.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/edit-diff.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/file-mutation-queue.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/output-accumulator.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/path-utils.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/tool-definition-wrapper.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/assets/clankolas.png +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/armin.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/diff.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/print-mode.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/jsonl.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-client.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-mode.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-types.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/changelog.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/child-process.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard-image.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard-native.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/exif-orientation.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/frontmatter.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/fs-watch.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/git.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/image-convert.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/image-resize.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/mime.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/photon.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/pi-user-agent.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/shell.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/sleep.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/tools-manager.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/autocomplete.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/box.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/cancellable-loader.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/editor.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/input.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/loader.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/select-list.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/settings-list.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/spacer.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/text.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/truncated-text.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/editor-component.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/fuzzy.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/index.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/keybindings.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/keys.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/kill-ring.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/stdin-buffer.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/terminal.js +0 -0
- /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/undo-stack.js +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/LICENSE +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-cli.mjs +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-hooks.mjs +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-native.mjs +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-register.d.mts +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-register.mjs +0 -0
- /package/node_modules/{@mariozechner/jiti/lib/jiti.mjs → jiti/lib/jiti-static.mjs} +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.cjs +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.d.cts +0 -0
- /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.d.mts +0 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - xAI: "This model's maximum prompt length is 131072 but the request contains 537812 tokens"
|
|
14
14
|
* - Groq: "Please reduce the length of the messages or completion"
|
|
15
15
|
* - OpenRouter: "This endpoint's maximum context length is X tokens. However, you requested about Y tokens"
|
|
16
|
+
* - Together AI: "The input (X tokens) is longer than the model's context length (Y tokens)."
|
|
16
17
|
* - llama.cpp: "the request exceeds the available context size, try increasing it"
|
|
17
18
|
* - LM Studio: "tokens to keep from the initial prompt is greater than the context length"
|
|
18
19
|
* - GitHub Copilot: "prompt token count of X exceeds the limit of Y"
|
|
@@ -35,6 +36,7 @@ const OVERFLOW_PATTERNS = [
|
|
|
35
36
|
/maximum prompt length is \d+/i, // xAI (Grok)
|
|
36
37
|
/reduce the length of the messages/i, // Groq
|
|
37
38
|
/maximum context length is \d+ tokens/i, // OpenRouter (all backends)
|
|
39
|
+
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i, // Together AI
|
|
38
40
|
/exceeds the limit of \d+/i, // GitHub Copilot
|
|
39
41
|
/exceeds the available context size/i, // llama.cpp server
|
|
40
42
|
/greater than the context length/i, // LM Studio
|
|
@@ -82,6 +84,7 @@ const NON_OVERFLOW_PATTERNS = [
|
|
|
82
84
|
* - Cerebras: 400/413 status code (no body)
|
|
83
85
|
* - Mistral: "Prompt contains X tokens ... too large for model with Y maximum context length"
|
|
84
86
|
* - OpenRouter (all backends): "maximum context length is X tokens"
|
|
87
|
+
* - Together AI: "The input (X tokens) is longer than the model's context length (Y tokens)."
|
|
85
88
|
* - llama.cpp: "exceeds the available context size"
|
|
86
89
|
* - LM Studio: "greater than the context length"
|
|
87
90
|
* - Kimi For Coding: "exceeded model token limit: X (requested: Y)"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@
|
|
3
|
-
"version": "0.
|
|
2
|
+
"name": "@earendil-works/pi-ai",
|
|
3
|
+
"version": "0.74.0",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"scripts": {
|
|
62
62
|
"clean": "shx rm -rf dist",
|
|
63
63
|
"generate-models": "npx tsx scripts/generate-models.ts",
|
|
64
|
-
"
|
|
64
|
+
"generate-image-models": "npx tsx scripts/generate-image-models.ts",
|
|
65
|
+
"build": "npm run generate-models && npm run generate-image-models && tsgo -p tsconfig.build.json",
|
|
65
66
|
"dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
66
67
|
"dev:tsc": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
67
68
|
"test": "vitest --run",
|
|
@@ -94,7 +95,7 @@
|
|
|
94
95
|
"license": "MIT",
|
|
95
96
|
"repository": {
|
|
96
97
|
"type": "git",
|
|
97
|
-
"url": "git+https://github.com/
|
|
98
|
+
"url": "git+https://github.com/earendil-works/pi-mono.git",
|
|
98
99
|
"directory": "packages/ai"
|
|
99
100
|
},
|
|
100
101
|
"engines": {
|
|
@@ -300,6 +300,7 @@ ${chalk.bold("Environment Variables:")}
|
|
|
300
300
|
CEREBRAS_API_KEY - Cerebras API key
|
|
301
301
|
XAI_API_KEY - xAI Grok API key
|
|
302
302
|
FIREWORKS_API_KEY - Fireworks API key
|
|
303
|
+
TOGETHER_API_KEY - Together AI API key
|
|
303
304
|
OPENROUTER_API_KEY - OpenRouter API key
|
|
304
305
|
AI_GATEWAY_API_KEY - Vercel AI Gateway API key
|
|
305
306
|
ZAI_API_KEY - ZAI API key
|
package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/config-selector.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TUI config selector for `pi config` command
|
|
3
3
|
*/
|
|
4
|
-
import { ProcessTerminal, TUI } from "@
|
|
4
|
+
import { ProcessTerminal, TUI } from "@earendil-works/pi-tui";
|
|
5
5
|
import { ConfigSelectorComponent } from "../modes/interactive/components/config-selector.js";
|
|
6
6
|
import { initTheme, stopThemeWatcher } from "../modes/interactive/theme/theme.js";
|
|
7
7
|
/** Show TUI config selector and return when closed */
|
package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/list-models.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List available models with optional fuzzy search
|
|
3
3
|
*/
|
|
4
|
-
import { fuzzyFilter } from "@
|
|
4
|
+
import { fuzzyFilter } from "@earendil-works/pi-tui";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { formatNoModelsAvailableMessage } from "../core/auth-guidance.js";
|
|
7
7
|
/**
|
package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/session-picker.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TUI session selector for --resume flag
|
|
3
3
|
*/
|
|
4
|
-
import { ProcessTerminal, setKeybindings, TUI } from "@
|
|
4
|
+
import { ProcessTerminal, setKeybindings, TUI } from "@earendil-works/pi-tui";
|
|
5
5
|
import { KeybindingsManager } from "../core/keybindings.js";
|
|
6
6
|
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector.js";
|
|
7
7
|
/** Show TUI session selector and return selected session path or null if cancelled */
|
|
@@ -16,6 +16,22 @@ const __dirname = dirname(__filename);
|
|
|
16
16
|
export const isBunBinary = import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN");
|
|
17
17
|
/** Detect if Bun is the runtime (compiled binary or bun run) */
|
|
18
18
|
export const isBunRuntime = !!process.versions.bun;
|
|
19
|
+
function makeSelfUpdateCommand(installStep, uninstallStep) {
|
|
20
|
+
if (!uninstallStep)
|
|
21
|
+
return installStep;
|
|
22
|
+
return {
|
|
23
|
+
...installStep,
|
|
24
|
+
display: `${uninstallStep.display} && ${installStep.display}`,
|
|
25
|
+
steps: [uninstallStep, installStep],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function makeSelfUpdateCommandStep(command, args) {
|
|
29
|
+
return {
|
|
30
|
+
command,
|
|
31
|
+
args,
|
|
32
|
+
display: [command, ...args].map((arg) => (/\s/.test(arg) ? `"${arg}"` : arg)).join(" "),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
19
35
|
export function detectInstallMethod() {
|
|
20
36
|
if (isBunBinary) {
|
|
21
37
|
return "bun-binary";
|
|
@@ -35,46 +51,52 @@ export function detectInstallMethod() {
|
|
|
35
51
|
}
|
|
36
52
|
return "unknown";
|
|
37
53
|
}
|
|
38
|
-
function getInferredNpmInstall(
|
|
54
|
+
function getInferredNpmInstall() {
|
|
39
55
|
const packageDir = getPackageDir();
|
|
40
56
|
const path = process.platform === "win32" || packageDir.includes("\\") ? win32 : { basename, dirname };
|
|
41
|
-
const
|
|
57
|
+
const parent = path.dirname(packageDir);
|
|
42
58
|
let root;
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
path.basename(path.dirname(packageDir)) === scope &&
|
|
46
|
-
path.basename(packageDir) === name) {
|
|
47
|
-
root = path.dirname(path.dirname(packageDir));
|
|
59
|
+
if (path.basename(parent).startsWith("@") && path.basename(path.dirname(parent)) === "node_modules") {
|
|
60
|
+
root = path.dirname(parent);
|
|
48
61
|
}
|
|
49
|
-
else if (
|
|
50
|
-
root =
|
|
62
|
+
else if (path.basename(parent) === "node_modules") {
|
|
63
|
+
root = parent;
|
|
51
64
|
}
|
|
52
|
-
if (!root
|
|
65
|
+
if (!root)
|
|
53
66
|
return undefined;
|
|
54
|
-
const
|
|
55
|
-
if (path.basename(
|
|
56
|
-
return { root, prefix: path.dirname(
|
|
67
|
+
const rootParent = path.dirname(root);
|
|
68
|
+
if (path.basename(rootParent) === "lib")
|
|
69
|
+
return { root, prefix: path.dirname(rootParent) };
|
|
57
70
|
// Windows global npm prefixes use `<prefix>\\node_modules`, which is
|
|
58
71
|
// indistinguishable from local project installs by path shape alone. Do not
|
|
59
72
|
// infer unsupported Windows custom prefixes without `npm root -g` evidence.
|
|
60
73
|
return undefined;
|
|
61
74
|
}
|
|
62
|
-
function getSelfUpdateCommandForMethod(method,
|
|
75
|
+
function getSelfUpdateCommandForMethod(method, installedPackageName, updatePackageName = installedPackageName, npmCommand) {
|
|
63
76
|
switch (method) {
|
|
64
77
|
case "bun-binary":
|
|
65
78
|
return undefined;
|
|
66
79
|
case "pnpm":
|
|
67
|
-
return
|
|
80
|
+
return makeSelfUpdateCommand(makeSelfUpdateCommandStep("pnpm", ["install", "-g", updatePackageName]), updatePackageName === installedPackageName
|
|
81
|
+
? undefined
|
|
82
|
+
: makeSelfUpdateCommandStep("pnpm", ["remove", "-g", installedPackageName]));
|
|
68
83
|
case "yarn":
|
|
69
|
-
return
|
|
84
|
+
return makeSelfUpdateCommand(makeSelfUpdateCommandStep("yarn", ["global", "add", updatePackageName]), updatePackageName === installedPackageName
|
|
85
|
+
? undefined
|
|
86
|
+
: makeSelfUpdateCommandStep("yarn", ["global", "remove", installedPackageName]));
|
|
70
87
|
case "bun":
|
|
71
|
-
return
|
|
88
|
+
return makeSelfUpdateCommand(makeSelfUpdateCommandStep("bun", ["install", "-g", updatePackageName]), updatePackageName === installedPackageName
|
|
89
|
+
? undefined
|
|
90
|
+
: makeSelfUpdateCommandStep("bun", ["uninstall", "-g", installedPackageName]));
|
|
72
91
|
case "npm": {
|
|
73
92
|
const [command = "npm", ...npmArgs] = npmCommand ?? [];
|
|
74
|
-
const inferred = npmCommand?.length ? undefined : getInferredNpmInstall(
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
93
|
+
const inferred = npmCommand?.length ? undefined : getInferredNpmInstall();
|
|
94
|
+
const prefixArgs = [...npmArgs, ...(inferred ? ["--prefix", inferred.prefix] : [])];
|
|
95
|
+
const installStep = makeSelfUpdateCommandStep(command, [...prefixArgs, "install", "-g", updatePackageName]);
|
|
96
|
+
const uninstallStep = updatePackageName === installedPackageName
|
|
97
|
+
? undefined
|
|
98
|
+
: makeSelfUpdateCommandStep(command, [...prefixArgs, "uninstall", "-g", installedPackageName]);
|
|
99
|
+
return makeSelfUpdateCommand(installStep, uninstallStep);
|
|
78
100
|
}
|
|
79
101
|
case "unknown":
|
|
80
102
|
return undefined;
|
|
@@ -94,7 +116,7 @@ function readCommandOutput(command, args, options = {}) {
|
|
|
94
116
|
}
|
|
95
117
|
return undefined;
|
|
96
118
|
}
|
|
97
|
-
function getGlobalPackageRoots(method,
|
|
119
|
+
function getGlobalPackageRoots(method, _packageName, npmCommand) {
|
|
98
120
|
switch (method) {
|
|
99
121
|
case "npm": {
|
|
100
122
|
const configured = !!npmCommand?.length;
|
|
@@ -112,7 +134,7 @@ function getGlobalPackageRoots(method, packageName, npmCommand) {
|
|
|
112
134
|
const root = readCommandOutput(command, [...npmArgs, "root", "-g"], {
|
|
113
135
|
requireSuccess: configured,
|
|
114
136
|
});
|
|
115
|
-
const inferred = configured ? undefined : getInferredNpmInstall(
|
|
137
|
+
const inferred = configured ? undefined : getInferredNpmInstall();
|
|
116
138
|
return [root, inferred?.root].filter((x) => !!x);
|
|
117
139
|
}
|
|
118
140
|
case "pnpm": {
|
|
@@ -173,27 +195,27 @@ function isManagedByGlobalPackageManager(method, packageName, npmCommand) {
|
|
|
173
195
|
packageDir.startsWith(normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`));
|
|
174
196
|
}));
|
|
175
197
|
}
|
|
176
|
-
export function getSelfUpdateCommand(packageName, npmCommand) {
|
|
198
|
+
export function getSelfUpdateCommand(packageName, npmCommand, updatePackageName = packageName) {
|
|
177
199
|
const method = detectInstallMethod();
|
|
178
|
-
const command = getSelfUpdateCommandForMethod(method, packageName, npmCommand);
|
|
200
|
+
const command = getSelfUpdateCommandForMethod(method, packageName, updatePackageName, npmCommand);
|
|
179
201
|
if (!command || !isManagedByGlobalPackageManager(method, packageName, npmCommand) || !isSelfUpdatePathWritable()) {
|
|
180
202
|
return undefined;
|
|
181
203
|
}
|
|
182
204
|
return command;
|
|
183
205
|
}
|
|
184
|
-
export function getSelfUpdateUnavailableInstruction(packageName, npmCommand) {
|
|
206
|
+
export function getSelfUpdateUnavailableInstruction(packageName, npmCommand, updatePackageName = packageName) {
|
|
185
207
|
const method = detectInstallMethod();
|
|
186
208
|
if (method === "bun-binary") {
|
|
187
|
-
return `Download from: https://github.com/
|
|
209
|
+
return `Download from: https://github.com/earendil-works/pi-mono/releases/latest`;
|
|
188
210
|
}
|
|
189
|
-
const command = getSelfUpdateCommandForMethod(method, packageName, npmCommand);
|
|
211
|
+
const command = getSelfUpdateCommandForMethod(method, packageName, updatePackageName, npmCommand);
|
|
190
212
|
if (command) {
|
|
191
213
|
if (isManagedByGlobalPackageManager(method, packageName, npmCommand) && !isSelfUpdatePathWritable()) {
|
|
192
214
|
return `This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`;
|
|
193
215
|
}
|
|
194
216
|
return `This installation is not managed by a global ${method} install. Update it with the package manager, wrapper, or source checkout that provides it.`;
|
|
195
217
|
}
|
|
196
|
-
return `Update ${
|
|
218
|
+
return `Update ${updatePackageName} using the package manager, wrapper, or source checkout that provides this installation.`;
|
|
197
219
|
}
|
|
198
220
|
export function getUpdateInstruction(packageName) {
|
|
199
221
|
const method = detectInstallMethod();
|
|
@@ -306,7 +328,7 @@ export function getBundledInteractiveAssetPath(name) {
|
|
|
306
328
|
}
|
|
307
329
|
const pkg = JSON.parse(readFileSync(getPackageJsonPath(), "utf-8"));
|
|
308
330
|
const piConfigName = pkg.piConfig?.name;
|
|
309
|
-
export const PACKAGE_NAME = pkg.name || "@
|
|
331
|
+
export const PACKAGE_NAME = pkg.name || "@earendil-works/pi-coding-agent";
|
|
310
332
|
export const APP_NAME = piConfigName || "pi";
|
|
311
333
|
export const APP_TITLE = piConfigName ? APP_NAME : "π";
|
|
312
334
|
export const CONFIG_DIR_NAME = pkg.piConfig?.configDir || ".pi";
|
package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session.js
RENAMED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { basename, dirname, resolve } from "node:path";
|
|
17
|
-
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, isContextOverflow, modelsAreEqual, resetApiProviders, } from "@
|
|
17
|
+
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, isContextOverflow, modelsAreEqual, resetApiProviders, } from "@earendil-works/pi-ai";
|
|
18
18
|
import { theme } from "../modes/interactive/theme/theme.js";
|
|
19
19
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
20
20
|
import { sleep } from "../utils/sleep.js";
|
package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/auth-storage.js
RENAMED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Uses file locking to prevent race conditions when multiple pi instances
|
|
6
6
|
* try to refresh tokens simultaneously.
|
|
7
7
|
*/
|
|
8
|
-
import { findEnvKeys, getEnvApiKey, } from "@
|
|
9
|
-
import { getOAuthApiKey, getOAuthProvider, getOAuthProviders } from "@
|
|
8
|
+
import { findEnvKeys, getEnvApiKey, } from "@earendil-works/pi-ai";
|
|
9
|
+
import { getOAuthApiKey, getOAuthProvider, getOAuthProviders } from "@earendil-works/pi-ai/oauth";
|
|
10
10
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
11
11
|
import { dirname, join } from "path";
|
|
12
12
|
import lockfile from "proper-lockfile";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* When navigating to a different point in the session tree, this generates
|
|
5
5
|
* a summary of the branch being left so context isn't lost.
|
|
6
6
|
*/
|
|
7
|
-
import { completeSimple } from "@
|
|
7
|
+
import { completeSimple } from "@earendil-works/pi-ai";
|
|
8
8
|
import { convertToLlm, createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, } from "../messages.js";
|
|
9
9
|
import { estimateTokens } from "./compaction.js";
|
|
10
10
|
import { computeFileLists, createFileOps, extractFileOpsFromMessage, formatFileOperations, SUMMARIZATION_SYSTEM_PROMPT, serializeConversation, } from "./utils.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Pure functions for compaction logic. The session manager handles I/O,
|
|
5
5
|
* and after compaction the session is reloaded.
|
|
6
6
|
*/
|
|
7
|
-
import { completeSimple } from "@
|
|
7
|
+
import { completeSimple } from "@earendil-works/pi-ai";
|
|
8
8
|
import { convertToLlm, createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, } from "../messages.js";
|
|
9
9
|
import { buildSessionContext } from "../session-manager.js";
|
|
10
10
|
import { computeFileLists, createFileOps, extractFileOpsFromMessage, formatFileOperations, SUMMARIZATION_SYSTEM_PROMPT, serializeConversation, } from "./utils.js";
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for compaction and branch summarization.
|
|
3
|
+
*/
|
|
4
|
+
export function createFileOps() {
|
|
5
|
+
return {
|
|
6
|
+
read: new Set(),
|
|
7
|
+
written: new Set(),
|
|
8
|
+
edited: new Set(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extract file operations from tool calls in an assistant message.
|
|
13
|
+
*/
|
|
14
|
+
export function extractFileOpsFromMessage(message, fileOps) {
|
|
15
|
+
if (message.role !== "assistant")
|
|
16
|
+
return;
|
|
17
|
+
if (!("content" in message) || !Array.isArray(message.content))
|
|
18
|
+
return;
|
|
19
|
+
for (const block of message.content) {
|
|
20
|
+
if (typeof block !== "object" || block === null)
|
|
21
|
+
continue;
|
|
22
|
+
if (!("type" in block) || block.type !== "toolCall")
|
|
23
|
+
continue;
|
|
24
|
+
if (!("arguments" in block) || !("name" in block))
|
|
25
|
+
continue;
|
|
26
|
+
const args = block.arguments;
|
|
27
|
+
if (!args)
|
|
28
|
+
continue;
|
|
29
|
+
const path = typeof args.path === "string" ? args.path : undefined;
|
|
30
|
+
if (!path)
|
|
31
|
+
continue;
|
|
32
|
+
switch (block.name) {
|
|
33
|
+
case "read":
|
|
34
|
+
fileOps.read.add(path);
|
|
35
|
+
break;
|
|
36
|
+
case "write":
|
|
37
|
+
fileOps.written.add(path);
|
|
38
|
+
break;
|
|
39
|
+
case "edit":
|
|
40
|
+
fileOps.edited.add(path);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Compute final file lists from file operations.
|
|
47
|
+
* Returns readFiles (files only read, not modified) and modifiedFiles.
|
|
48
|
+
*/
|
|
49
|
+
export function computeFileLists(fileOps) {
|
|
50
|
+
const modified = new Set([...fileOps.edited, ...fileOps.written]);
|
|
51
|
+
const readOnly = [...fileOps.read].filter((f) => !modified.has(f)).sort();
|
|
52
|
+
const modifiedFiles = [...modified].sort();
|
|
53
|
+
return { readFiles: readOnly, modifiedFiles };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Format file operations as XML tags for summary.
|
|
57
|
+
*/
|
|
58
|
+
export function formatFileOperations(readFiles, modifiedFiles) {
|
|
59
|
+
const sections = [];
|
|
60
|
+
if (readFiles.length > 0) {
|
|
61
|
+
sections.push(`<read-files>\n${readFiles.join("\n")}\n</read-files>`);
|
|
62
|
+
}
|
|
63
|
+
if (modifiedFiles.length > 0) {
|
|
64
|
+
sections.push(`<modified-files>\n${modifiedFiles.join("\n")}\n</modified-files>`);
|
|
65
|
+
}
|
|
66
|
+
if (sections.length === 0)
|
|
67
|
+
return "";
|
|
68
|
+
return `\n\n${sections.join("\n\n")}`;
|
|
69
|
+
}
|
|
70
|
+
// ============================================================================
|
|
71
|
+
// Message Serialization
|
|
72
|
+
// ============================================================================
|
|
73
|
+
/** Maximum characters for a tool result in serialized summaries. */
|
|
74
|
+
const TOOL_RESULT_MAX_CHARS = 2000;
|
|
75
|
+
/**
|
|
76
|
+
* Truncate text to a maximum character length for summarization.
|
|
77
|
+
* Keeps the beginning and appends a truncation marker.
|
|
78
|
+
*/
|
|
79
|
+
function truncateForSummary(text, maxChars) {
|
|
80
|
+
if (text.length <= maxChars)
|
|
81
|
+
return text;
|
|
82
|
+
const truncatedChars = text.length - maxChars;
|
|
83
|
+
return `${text.slice(0, maxChars)}\n\n[... ${truncatedChars} more characters truncated]`;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Serialize LLM messages to text for summarization.
|
|
87
|
+
* This prevents the model from treating it as a conversation to continue.
|
|
88
|
+
* Call convertToLlm() first to handle custom message types.
|
|
89
|
+
*
|
|
90
|
+
* Tool results are truncated to keep the summarization request within
|
|
91
|
+
* reasonable token budgets. Full content is not needed for summarization.
|
|
92
|
+
*/
|
|
93
|
+
export function serializeConversation(messages) {
|
|
94
|
+
const parts = [];
|
|
95
|
+
for (const msg of messages) {
|
|
96
|
+
if (msg.role === "user") {
|
|
97
|
+
const content = typeof msg.content === "string"
|
|
98
|
+
? msg.content
|
|
99
|
+
: msg.content
|
|
100
|
+
.filter((c) => c.type === "text")
|
|
101
|
+
.map((c) => c.text)
|
|
102
|
+
.join("");
|
|
103
|
+
if (content)
|
|
104
|
+
parts.push(`[User]: ${content}`);
|
|
105
|
+
}
|
|
106
|
+
else if (msg.role === "assistant") {
|
|
107
|
+
const textParts = [];
|
|
108
|
+
const thinkingParts = [];
|
|
109
|
+
const toolCalls = [];
|
|
110
|
+
for (const block of msg.content) {
|
|
111
|
+
if (block.type === "text") {
|
|
112
|
+
textParts.push(block.text);
|
|
113
|
+
}
|
|
114
|
+
else if (block.type === "thinking") {
|
|
115
|
+
thinkingParts.push(block.thinking);
|
|
116
|
+
}
|
|
117
|
+
else if (block.type === "toolCall") {
|
|
118
|
+
const args = block.arguments;
|
|
119
|
+
const argsStr = Object.entries(args)
|
|
120
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
121
|
+
.join(", ");
|
|
122
|
+
toolCalls.push(`${block.name}(${argsStr})`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (thinkingParts.length > 0) {
|
|
126
|
+
parts.push(`[Assistant thinking]: ${thinkingParts.join("\n")}`);
|
|
127
|
+
}
|
|
128
|
+
if (textParts.length > 0) {
|
|
129
|
+
parts.push(`[Assistant]: ${textParts.join("\n")}`);
|
|
130
|
+
}
|
|
131
|
+
if (toolCalls.length > 0) {
|
|
132
|
+
parts.push(`[Assistant tool calls]: ${toolCalls.join("; ")}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (msg.role === "toolResult") {
|
|
136
|
+
const content = msg.content
|
|
137
|
+
.filter((c) => c.type === "text")
|
|
138
|
+
.map((c) => c.text)
|
|
139
|
+
.join("");
|
|
140
|
+
if (content) {
|
|
141
|
+
parts.push(`[Tool result]: ${truncateForSummary(content, TOOL_RESULT_MAX_CHARS)}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return parts.join("\n\n");
|
|
146
|
+
}
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// Summarization System Prompt
|
|
149
|
+
// ============================================================================
|
|
150
|
+
export const SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI coding assistant, then produce a structured summary following the exact format specified.
|
|
151
|
+
|
|
152
|
+
Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;
|
|
153
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -204,6 +204,10 @@
|
|
|
204
204
|
color: var(--accent);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
.tree-role-skill {
|
|
208
|
+
color: var(--customMessageLabel);
|
|
209
|
+
}
|
|
210
|
+
|
|
207
211
|
.tree-role-assistant {
|
|
208
212
|
color: var(--success);
|
|
209
213
|
}
|
|
@@ -383,7 +387,8 @@
|
|
|
383
387
|
}
|
|
384
388
|
|
|
385
389
|
.user-message:hover .copy-link-btn,
|
|
386
|
-
.assistant-message:hover .copy-link-btn
|
|
390
|
+
.assistant-message:hover .copy-link-btn,
|
|
391
|
+
.skill-user-entry:hover .copy-link-btn {
|
|
387
392
|
opacity: 1;
|
|
388
393
|
}
|
|
389
394
|
|
|
@@ -786,6 +791,45 @@
|
|
|
786
791
|
font-weight: bold;
|
|
787
792
|
}
|
|
788
793
|
|
|
794
|
+
/* Skill invocation - matches compaction style (clickable, collapsed by default) */
|
|
795
|
+
.skill-invocation {
|
|
796
|
+
background: var(--customMessageBg);
|
|
797
|
+
border-radius: 4px;
|
|
798
|
+
padding: var(--line-height);
|
|
799
|
+
cursor: pointer;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.skill-invocation-label {
|
|
803
|
+
color: var(--customMessageLabel);
|
|
804
|
+
font-weight: bold;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.skill-invocation-collapsed {
|
|
808
|
+
color: var(--customMessageText);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.skill-invocation-content {
|
|
812
|
+
display: none;
|
|
813
|
+
color: var(--customMessageText);
|
|
814
|
+
margin-top: var(--line-height);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
.skill-invocation.expanded .skill-invocation-collapsed {
|
|
818
|
+
display: none;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.skill-invocation.expanded .skill-invocation-content {
|
|
822
|
+
display: block;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.skill-invocation + .user-message {
|
|
826
|
+
margin-top: var(--line-height);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.skill-user-entry {
|
|
830
|
+
position: relative;
|
|
831
|
+
}
|
|
832
|
+
|
|
789
833
|
/* Branch summary */
|
|
790
834
|
.branch-summary {
|
|
791
835
|
background: var(--customMessageBg);
|
|
@@ -313,6 +313,22 @@
|
|
|
313
313
|
return '';
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Parse a skill block from message text.
|
|
318
|
+
* Returns null if the text doesn't contain a skill block.
|
|
319
|
+
* Matches the format: <skill name="..." location="...">\n...\n</skill>\n\nuser message
|
|
320
|
+
*/
|
|
321
|
+
function parseSkillBlock(text) {
|
|
322
|
+
const match = text.match(/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/);
|
|
323
|
+
if (!match) return null;
|
|
324
|
+
return {
|
|
325
|
+
name: match[1],
|
|
326
|
+
location: match[2],
|
|
327
|
+
content: match[3],
|
|
328
|
+
userMessage: match[4]?.trim() || undefined,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
316
332
|
function getSearchableText(entry, label) {
|
|
317
333
|
const parts = [];
|
|
318
334
|
if (label) parts.push(label);
|
|
@@ -613,7 +629,16 @@
|
|
|
613
629
|
case 'message': {
|
|
614
630
|
const msg = entry.message;
|
|
615
631
|
if (msg.role === 'user') {
|
|
616
|
-
const
|
|
632
|
+
const rawContent = extractContent(msg.content);
|
|
633
|
+
const skillBlock = parseSkillBlock(rawContent);
|
|
634
|
+
if (skillBlock) {
|
|
635
|
+
let treeHtml = labelHtml + `<span class="tree-role-skill">skill:</span> ${escapeHtml(skillBlock.name)}`;
|
|
636
|
+
if (skillBlock.userMessage) {
|
|
637
|
+
treeHtml += ` · <span class="tree-role-user">user:</span> ${escapeHtml(truncate(normalize(skillBlock.userMessage)))}`;
|
|
638
|
+
}
|
|
639
|
+
return treeHtml;
|
|
640
|
+
}
|
|
641
|
+
const content = truncate(normalize(rawContent));
|
|
617
642
|
return labelHtml + `<span class="tree-role-user">user:</span> ${escapeHtml(content)}`;
|
|
618
643
|
}
|
|
619
644
|
if (msg.role === 'assistant') {
|
|
@@ -1140,8 +1165,46 @@
|
|
|
1140
1165
|
const msg = entry.message;
|
|
1141
1166
|
|
|
1142
1167
|
if (msg.role === 'user') {
|
|
1143
|
-
let html = `<div class="user-message" id="${entryDomId}">${copyBtnHtml}${tsHtml}`;
|
|
1144
1168
|
const content = msg.content;
|
|
1169
|
+
const text = typeof content === 'string' ? content :
|
|
1170
|
+
content.filter(c => c.type === 'text').map(c => c.text).join('\n');
|
|
1171
|
+
const skillBlock = parseSkillBlock(text);
|
|
1172
|
+
|
|
1173
|
+
if (skillBlock) {
|
|
1174
|
+
// Collect images from content array
|
|
1175
|
+
const images = Array.isArray(content) ? content.filter(c => c.type === 'image') : [];
|
|
1176
|
+
const hasUserContent = skillBlock.userMessage || images.length > 0;
|
|
1177
|
+
let html = `<div class="skill-user-entry" id="${entryDomId}">${copyBtnHtml}${tsHtml}`;
|
|
1178
|
+
|
|
1179
|
+
// Skill invocation (collapsed by default, click to expand)
|
|
1180
|
+
html += `<div class="skill-invocation" onclick="if(window.getSelection().toString())return;this.classList.toggle('expanded')">
|
|
1181
|
+
<div class="skill-invocation-label">[skill] ${escapeHtml(skillBlock.name)}</div>
|
|
1182
|
+
<div class="skill-invocation-collapsed">${escapeHtml(skillBlock.name)} (click to expand)</div>
|
|
1183
|
+
<div class="skill-invocation-content markdown-content">${safeMarkedParse(skillBlock.content)}</div>
|
|
1184
|
+
</div>`;
|
|
1185
|
+
|
|
1186
|
+
// User message (separate block if present)
|
|
1187
|
+
if (hasUserContent) {
|
|
1188
|
+
html += '<div class="user-message">';
|
|
1189
|
+
if (images.length > 0) {
|
|
1190
|
+
html += '<div class="message-images">';
|
|
1191
|
+
for (const img of images) {
|
|
1192
|
+
html += `<img src="data:${escapeHtml(img.mimeType || 'image/png')};base64,${escapeHtml(img.data || '')}" class="message-image" />`;
|
|
1193
|
+
}
|
|
1194
|
+
html += '</div>';
|
|
1195
|
+
}
|
|
1196
|
+
if (skillBlock.userMessage) {
|
|
1197
|
+
html += `<div class="markdown-content">${safeMarkedParse(skillBlock.userMessage)}</div>`;
|
|
1198
|
+
}
|
|
1199
|
+
html += '</div>';
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
html += '</div>';
|
|
1203
|
+
return html;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
// No skill block - normal user message
|
|
1207
|
+
let html = `<div class="user-message" id="${entryDomId}">${copyBtnHtml}${tsHtml}`;
|
|
1145
1208
|
|
|
1146
1209
|
if (Array.isArray(content)) {
|
|
1147
1210
|
const images = content.filter(c => c.type === 'image');
|
|
@@ -1154,8 +1217,6 @@
|
|
|
1154
1217
|
}
|
|
1155
1218
|
}
|
|
1156
1219
|
|
|
1157
|
-
const text = typeof content === 'string' ? content :
|
|
1158
|
-
content.filter(c => c.type === 'text').map(c => c.text).join('\n');
|
|
1159
1220
|
if (text.trim()) {
|
|
1160
1221
|
html += `<div class="markdown-content">${safeMarkedParse(text)}</div>`;
|
|
1161
1222
|
}
|
|
@@ -1716,6 +1777,9 @@
|
|
|
1716
1777
|
document.querySelectorAll('.compaction').forEach(el => {
|
|
1717
1778
|
el.classList.toggle('expanded', toolOutputsExpanded);
|
|
1718
1779
|
});
|
|
1780
|
+
document.querySelectorAll('.skill-invocation').forEach(el => {
|
|
1781
|
+
el.classList.toggle('expanded', toolOutputsExpanded);
|
|
1782
|
+
});
|
|
1719
1783
|
};
|
|
1720
1784
|
|
|
1721
1785
|
const attachHeaderHandlers = () => {
|