orient-cli 0.1.0-alpha.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/NOTICE.md +0 -0
- package/README.md +0 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/extensions/orient-core.d.ts +0 -0
- package/dist/extensions/orient-core.js +0 -0
- package/dist/extensions/orient-core.js.map +0 -0
- package/dist/extensions/orient-notebooklm.d.ts +0 -0
- package/dist/extensions/orient-notebooklm.js +0 -0
- package/dist/extensions/orient-notebooklm.js.map +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/notebooklm/bridge.d.ts +0 -0
- package/dist/integrations/notebooklm/bridge.js +0 -0
- package/dist/integrations/notebooklm/bridge.js.map +0 -0
- package/dist/integrations/notebooklm/notebooklm-extension.d.ts +1 -1
- package/dist/integrations/notebooklm/notebooklm-extension.js +1 -1
- package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
- package/dist/orient/artifact-graph.d.ts +0 -0
- package/dist/orient/artifact-graph.js +0 -0
- package/dist/orient/artifact-graph.js.map +0 -0
- package/dist/orient/change-packet.d.ts +2 -1
- package/dist/orient/change-packet.js +25 -8
- package/dist/orient/change-packet.js.map +1 -1
- package/dist/orient/clarify.d.ts +114 -0
- package/dist/orient/clarify.js +186 -0
- package/dist/orient/clarify.js.map +1 -0
- package/dist/orient/clear-command.d.ts +79 -0
- package/dist/orient/clear-command.js +117 -0
- package/dist/orient/clear-command.js.map +1 -0
- package/dist/orient/mode.d.ts +70 -0
- package/dist/orient/mode.js +124 -0
- package/dist/orient/mode.js.map +1 -0
- package/dist/orient/orient-extension.d.ts +1 -1
- package/dist/orient/orient-extension.js +306 -17
- package/dist/orient/orient-extension.js.map +1 -1
- package/dist/orient/phases.d.ts +0 -0
- package/dist/orient/phases.js +0 -0
- package/dist/orient/phases.js.map +0 -0
- package/dist/orient/plan-execute.d.ts +137 -0
- package/dist/orient/plan-execute.js +333 -0
- package/dist/orient/plan-execute.js.map +1 -0
- package/dist/orient/state-machine.d.ts +0 -0
- package/dist/orient/state-machine.js +0 -0
- package/dist/orient/state-machine.js.map +0 -0
- package/dist/orient/tiers.d.ts +109 -0
- package/dist/orient/tiers.js +162 -0
- package/dist/orient/tiers.js.map +1 -0
- package/dist/orient/types.d.ts +0 -0
- package/dist/orient/types.js +0 -0
- package/dist/orient/types.js.map +0 -0
- package/dist/orient/wizard.d.ts +108 -0
- package/dist/orient/wizard.js +183 -0
- package/dist/orient/wizard.js.map +1 -0
- package/dist/package-paths.d.ts +0 -0
- package/dist/package-paths.js +0 -0
- package/dist/package-paths.js.map +0 -0
- package/docs/architecture.md +0 -0
- package/docs/artifacts.md +0 -0
- package/docs/commands.md +0 -0
- package/docs/configuration.md +0 -0
- package/docs/getting-started.md +0 -0
- package/docs/open-source-resources.md +1 -1
- package/docs/phases.md +0 -0
- package/docs/research-integration.md +0 -0
- package/docs/workflows.md +0 -0
- package/node_modules/@orient-cli/agent-core/README.md +456 -0
- package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/agent-loop.js +404 -0
- package/node_modules/@orient-cli/agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/agent.d.ts +115 -0
- package/node_modules/@orient-cli/agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/agent.js +395 -0
- package/node_modules/@orient-cli/agent-core/dist/agent.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/index.d.ts +5 -0
- package/node_modules/@orient-cli/agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/index.js +9 -0
- package/node_modules/@orient-cli/agent-core/dist/index.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts +85 -0
- package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/proxy.js +268 -0
- package/node_modules/@orient-cli/agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/types.d.ts +323 -0
- package/node_modules/@orient-cli/agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@orient-cli/agent-core/dist/types.js +2 -0
- package/node_modules/@orient-cli/agent-core/dist/types.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/package.json +44 -0
- package/node_modules/@orient-cli/ai/README.md +1315 -0
- package/node_modules/@orient-cli/ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@orient-cli/ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/api-registry.js +44 -0
- package/node_modules/@orient-cli/ai/dist/api-registry.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@orient-cli/ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/cli.d.ts +3 -0
- package/node_modules/@orient-cli/ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/cli.js +116 -0
- package/node_modules/@orient-cli/ai/dist/cli.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts +9 -0
- package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/env-api-keys.js +107 -0
- package/node_modules/@orient-cli/ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/index.d.ts +26 -0
- package/node_modules/@orient-cli/ai/dist/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/index.js +14 -0
- package/node_modules/@orient-cli/ai/dist/index.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/models.d.ts +24 -0
- package/node_modules/@orient-cli/ai/dist/models.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/models.generated.d.ts +14473 -0
- package/node_modules/@orient-cli/ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/models.generated.js +14241 -0
- package/node_modules/@orient-cli/ai/dist/models.generated.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/models.js +55 -0
- package/node_modules/@orient-cli/ai/dist/models.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/oauth.d.ts +2 -0
- package/node_modules/@orient-cli/ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/oauth.js +2 -0
- package/node_modules/@orient-cli/ai/dist/oauth.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts +20 -0
- package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js +651 -0
- package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts +40 -0
- package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/anthropic.js +749 -0
- package/node_modules/@orient-cli/ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js +176 -0
- package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts +56 -0
- package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/faux.js +367 -0
- package/node_modules/@orient-cli/ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts +74 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js +776 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts +65 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-shared.js +312 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js +419 -0
- package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@orient-cli/ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/google.js +399 -0
- package/node_modules/@orient-cli/ai/dist/providers/google.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts +22 -0
- package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/mistral.js +501 -0
- package/node_modules/@orient-cli/ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts +9 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js +741 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts +15 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js +753 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts +17 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js +470 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js +190 -0
- package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts +38 -0
- package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js +261 -0
- package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts +8 -0
- package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/simple-options.js +35 -0
- package/node_modules/@orient-cli/ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts +8 -0
- package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js +155 -0
- package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/stream.d.ts +8 -0
- package/node_modules/@orient-cli/ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/stream.js +27 -0
- package/node_modules/@orient-cli/ai/dist/stream.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/types.d.ts +353 -0
- package/node_modules/@orient-cli/ai/dist/types.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/types.js +2 -0
- package/node_modules/@orient-cli/ai/dist/types.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@orient-cli/ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/hash.js +14 -0
- package/node_modules/@orient-cli/ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts +9 -0
- package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/json-parse.js +29 -0
- package/node_modules/@orient-cli/ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js +292 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js +376 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js +481 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts +61 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js +131 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts +34 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js +373 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts +47 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts +53 -0
- package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/overflow.js +132 -0
- package/node_modules/@orient-cli/ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@orient-cli/ai/dist/utils/validation.js +80 -0
- package/node_modules/@orient-cli/ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@orient-cli/ai/package.json +114 -0
- package/node_modules/@orient-cli/coding-agent/README.md +618 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts +3 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js +7 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts +2 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js +4 -0
- package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts +52 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.js +326 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts +14 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js +31 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts +15 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js +83 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +18 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js +22 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js +92 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js +35 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts +3 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli.js +15 -0
- package/node_modules/@orient-cli/coding-agent/dist/cli.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/config.d.ts +77 -0
- package/node_modules/@orient-cli/coding-agent/dist/config.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/config.js +229 -0
- package/node_modules/@orient-cli/coding-agent/dist/config.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts +83 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +236 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts +86 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js +116 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts +585 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js +2497 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +132 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js +422 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts +46 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js +125 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js +243 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts +121 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js +613 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts +7 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js +7 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts +38 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js +153 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts +3 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js +2 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts +15 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js +2 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js +25 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts +29 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.js +75 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts +37 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js +224 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.css +1001 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.html +55 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.js +1690 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts +40 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js +95 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +6 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts +12 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts +25 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js +438 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts +148 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js +700 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts +1073 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js +45 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts +20 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js +22 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts +48 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js +314 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts +12 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/index.js +12 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts +288 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js +240 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts +77 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.js +123 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts +132 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js +612 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts +110 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js +486 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts +6 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js +59 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts +192 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js +1829 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts +51 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js +249 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts +23 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js +126 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts +185 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js +720 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts +93 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js +236 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts +19 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js +38 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts +333 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js +1105 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts +237 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js +708 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts +60 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.js +409 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts +14 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js +23 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts +18 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js +19 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts +28 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js +116 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.js +31 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts +73 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js +352 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts +85 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js +337 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts +53 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js +196 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js +37 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts +46 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js +258 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts +56 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js +293 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts +115 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js +86 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts +46 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js +172 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js +81 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts +46 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js +225 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts +21 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js +49 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js +32 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts +70 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js +205 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts +35 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js +216 -0
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/index.d.ts +28 -0
- package/node_modules/@orient-cli/coding-agent/dist/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/index.js +43 -0
- package/node_modules/@orient-cli/coding-agent/dist/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/main.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/main.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/main.js +593 -0
- package/node_modules/@orient-cli/coding-agent/dist/main.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts +33 -0
- package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/migrations.js +281 -0
- package/node_modules/@orient-cli/coding-agent/dist/migrations.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/index.js +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts +18 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +107 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +175 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +51 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +479 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +70 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +79 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js +133 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +111 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +61 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +78 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts +27 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +201 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts +31 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js +34 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js +22 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +145 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +275 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +97 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts +53 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js +204 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +275 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +848 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +301 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +50 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts +58 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +274 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts +89 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +1084 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +113 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js +28 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +321 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +4000 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/dark.json +85 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/light.json +84 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts +81 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +979 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts +28 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js +112 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js +49 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +402 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js +550 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts +408 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts +4 -0
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js +234 -0
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts +21 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js +87 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts +11 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js +78 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts +11 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js +245 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js +14 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts +2 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js +78 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts +5 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js +158 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts +8 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js +26 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts +26 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.js +163 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts +9 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js +39 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts +36 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js +137 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts +2 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js +26 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts +7 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js +19 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts +21 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js +121 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts +26 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js +186 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts +5 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js +17 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts +3 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js +252 -0
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -0
- package/node_modules/@orient-cli/coding-agent/package.json +104 -0
- package/node_modules/@orient-cli/tui/README.md +767 -0
- package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts +52 -0
- package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/autocomplete.js +623 -0
- package/node_modules/@orient-cli/tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/box.d.ts +22 -0
- package/node_modules/@orient-cli/tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/box.js +104 -0
- package/node_modules/@orient-cli/tui/dist/components/box.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/editor.d.ts +244 -0
- package/node_modules/@orient-cli/tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/editor.js +1861 -0
- package/node_modules/@orient-cli/tui/dist/components/editor.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/image.d.ts +28 -0
- package/node_modules/@orient-cli/tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/image.js +69 -0
- package/node_modules/@orient-cli/tui/dist/components/image.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/input.d.ts +37 -0
- package/node_modules/@orient-cli/tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/input.js +426 -0
- package/node_modules/@orient-cli/tui/dist/components/input.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/loader.d.ts +21 -0
- package/node_modules/@orient-cli/tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/loader.js +49 -0
- package/node_modules/@orient-cli/tui/dist/components/loader.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts +95 -0
- package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/markdown.js +663 -0
- package/node_modules/@orient-cli/tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/select-list.js +159 -0
- package/node_modules/@orient-cli/tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/settings-list.js +185 -0
- package/node_modules/@orient-cli/tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/spacer.js +23 -0
- package/node_modules/@orient-cli/tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/text.d.ts +19 -0
- package/node_modules/@orient-cli/tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/text.js +89 -0
- package/node_modules/@orient-cli/tui/dist/components/text.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@orient-cli/tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@orient-cli/tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/editor-component.js +2 -0
- package/node_modules/@orient-cli/tui/dist/editor-component.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/fuzzy.js +107 -0
- package/node_modules/@orient-cli/tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/index.d.ts +23 -0
- package/node_modules/@orient-cli/tui/dist/index.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/index.js +32 -0
- package/node_modules/@orient-cli/tui/dist/index.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@orient-cli/tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/keybindings.js +174 -0
- package/node_modules/@orient-cli/tui/dist/keybindings.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/keys.d.ts +170 -0
- package/node_modules/@orient-cli/tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/keys.js +1124 -0
- package/node_modules/@orient-cli/tui/dist/keys.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/kill-ring.js +44 -0
- package/node_modules/@orient-cli/tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts +48 -0
- package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/stdin-buffer.js +317 -0
- package/node_modules/@orient-cli/tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts +68 -0
- package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/terminal-image.js +288 -0
- package/node_modules/@orient-cli/tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/terminal.d.ts +84 -0
- package/node_modules/@orient-cli/tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/terminal.js +285 -0
- package/node_modules/@orient-cli/tui/dist/terminal.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/tui.d.ts +222 -0
- package/node_modules/@orient-cli/tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/tui.js +1008 -0
- package/node_modules/@orient-cli/tui/dist/tui.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/undo-stack.js +25 -0
- package/node_modules/@orient-cli/tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@orient-cli/tui/dist/utils.d.ts +78 -0
- package/node_modules/@orient-cli/tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@orient-cli/tui/dist/utils.js +960 -0
- package/node_modules/@orient-cli/tui/dist/utils.js.map +1 -0
- package/node_modules/@orient-cli/tui/package.json +52 -0
- package/package.json +47 -8
- package/prompts/orient-blockers.md +0 -0
- package/prompts/orient-handoff.md +0 -0
- package/prompts/orient-recap.md +0 -0
- package/schemas/orient-full/schema.yaml +0 -0
- package/schemas/orient-minimal/schema.yaml +0 -0
- package/schemas/orient-standard/schema.yaml +0 -0
- package/schemas/orient-standard/templates/archive-summary.md +0 -0
- package/schemas/orient-standard/templates/brief.md +0 -0
- package/schemas/orient-standard/templates/constitution.md +0 -0
- package/schemas/orient-standard/templates/current-system-audit.md +0 -0
- package/schemas/orient-standard/templates/current-truth-sync.md +0 -0
- package/schemas/orient-standard/templates/decisions.md +0 -0
- package/schemas/orient-standard/templates/normalize-checklist.md +0 -0
- package/schemas/orient-standard/templates/plan.md +0 -0
- package/schemas/orient-standard/templates/qa-checklist.md +0 -0
- package/schemas/orient-standard/templates/research.md +0 -0
- package/schemas/orient-standard/templates/sources.md +0 -0
- package/schemas/orient-standard/templates/spec.md +0 -0
- package/schemas/orient-standard/templates/state.md +0 -0
- package/schemas/orient-standard/templates/tasks.md +0 -0
- package/schemas/orient-standard/templates/traceability-matrix.md +0 -0
- package/schemas/orient-standard/templates/verify.md +0 -0
- package/schemas/orient-standard/templates/work-log.md +0 -0
- package/schemas/orient-standard/templates-tier-1/brief.md +22 -0
- package/schemas/orient-standard/templates-tier-1/plan.md +17 -0
- package/schemas/orient-standard/templates-tier-1/spec.md +23 -0
- package/schemas/orient-standard/templates-tier-1/tasks.md +14 -0
- package/schemas/orient-standard/templates-tier-2/brief.md +32 -0
- package/schemas/orient-standard/templates-tier-2/plan.md +44 -0
- package/schemas/orient-standard/templates-tier-2/spec.md +46 -0
- package/schemas/orient-standard/templates-tier-2/tasks.md +34 -0
- package/schemas/orient-standard/templates-tier-3/brief.md +54 -0
- package/schemas/orient-standard/templates-tier-3/plan.md +67 -0
- package/schemas/orient-standard/templates-tier-3/spec.md +65 -0
- package/schemas/orient-standard/templates-tier-3/tasks.md +79 -0
- package/skills/orient-analyze/SKILL.md +0 -0
- package/skills/orient-archive/SKILL.md +0 -0
- package/skills/orient-clarify/SKILL.md +0 -0
- package/skills/orient-constitution/SKILL.md +0 -0
- package/skills/orient-decide/SKILL.md +0 -0
- package/skills/orient-execute/SKILL.md +0 -0
- package/skills/orient-integrate/SKILL.md +0 -0
- package/skills/orient-normalize/SKILL.md +0 -0
- package/skills/orient-orient/SKILL.md +0 -0
- package/skills/orient-plan/SKILL.md +0 -0
- package/skills/orient-research/SKILL.md +0 -0
- package/skills/orient-state/SKILL.md +0 -0
- package/skills/orient-tasks/SKILL.md +0 -0
- package/skills/orient-test/SKILL.md +0 -0
- package/skills/orient-verify/SKILL.md +0 -0
|
@@ -0,0 +1,1690 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// ============================================================
|
|
5
|
+
// DATA LOADING
|
|
6
|
+
// ============================================================
|
|
7
|
+
|
|
8
|
+
const base64 = document.getElementById('session-data').textContent;
|
|
9
|
+
const binary = atob(base64);
|
|
10
|
+
const bytes = new Uint8Array(binary.length);
|
|
11
|
+
for (let i = 0; i < binary.length; i++) {
|
|
12
|
+
bytes[i] = binary.charCodeAt(i);
|
|
13
|
+
}
|
|
14
|
+
const data = JSON.parse(new TextDecoder('utf-8').decode(bytes));
|
|
15
|
+
const { header, entries, leafId: defaultLeafId, systemPrompt, tools, renderedTools } = data;
|
|
16
|
+
|
|
17
|
+
// ============================================================
|
|
18
|
+
// URL PARAMETER HANDLING
|
|
19
|
+
// ============================================================
|
|
20
|
+
|
|
21
|
+
// Parse URL parameters for deep linking: leafId and targetId
|
|
22
|
+
// Check for injected params (when loaded in iframe via srcdoc) or use window.location
|
|
23
|
+
const injectedParams = document.querySelector('meta[name="pi-url-params"]');
|
|
24
|
+
const searchString = injectedParams ? injectedParams.content : window.location.search.substring(1);
|
|
25
|
+
const urlParams = new URLSearchParams(searchString);
|
|
26
|
+
const urlLeafId = urlParams.get('leafId');
|
|
27
|
+
const urlTargetId = urlParams.get('targetId');
|
|
28
|
+
// Use URL leafId if provided, otherwise fall back to session default
|
|
29
|
+
const leafId = urlLeafId || defaultLeafId;
|
|
30
|
+
|
|
31
|
+
// ============================================================
|
|
32
|
+
// DATA STRUCTURES
|
|
33
|
+
// ============================================================
|
|
34
|
+
|
|
35
|
+
// Entry lookup by ID
|
|
36
|
+
const byId = new Map();
|
|
37
|
+
for (const entry of entries) {
|
|
38
|
+
byId.set(entry.id, entry);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Tool call lookup (toolCallId -> {name, arguments})
|
|
42
|
+
const toolCallMap = new Map();
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
if (entry.type === 'message' && entry.message.role === 'assistant') {
|
|
45
|
+
const content = entry.message.content;
|
|
46
|
+
if (Array.isArray(content)) {
|
|
47
|
+
for (const block of content) {
|
|
48
|
+
if (block.type === 'toolCall') {
|
|
49
|
+
toolCallMap.set(block.id, { name: block.name, arguments: block.arguments });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Label lookup (entryId -> label string)
|
|
57
|
+
// Labels are stored in 'label' entries that reference their target via targetId
|
|
58
|
+
const labelMap = new Map();
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (entry.type === 'label' && entry.targetId && entry.label) {
|
|
61
|
+
labelMap.set(entry.targetId, entry.label);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ============================================================
|
|
66
|
+
// TREE DATA PREPARATION (no DOM, pure data)
|
|
67
|
+
// ============================================================
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Build tree structure from flat entries.
|
|
71
|
+
* Returns array of root nodes, each with { entry, children, label }.
|
|
72
|
+
*/
|
|
73
|
+
function buildTree() {
|
|
74
|
+
const nodeMap = new Map();
|
|
75
|
+
const roots = [];
|
|
76
|
+
|
|
77
|
+
// Create nodes
|
|
78
|
+
for (const entry of entries) {
|
|
79
|
+
nodeMap.set(entry.id, {
|
|
80
|
+
entry,
|
|
81
|
+
children: [],
|
|
82
|
+
label: labelMap.get(entry.id)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Build parent-child relationships
|
|
87
|
+
for (const entry of entries) {
|
|
88
|
+
const node = nodeMap.get(entry.id);
|
|
89
|
+
if (entry.parentId === null || entry.parentId === undefined || entry.parentId === entry.id) {
|
|
90
|
+
roots.push(node);
|
|
91
|
+
} else {
|
|
92
|
+
const parent = nodeMap.get(entry.parentId);
|
|
93
|
+
if (parent) {
|
|
94
|
+
parent.children.push(node);
|
|
95
|
+
} else {
|
|
96
|
+
roots.push(node);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Sort children by timestamp
|
|
102
|
+
function sortChildren(node) {
|
|
103
|
+
node.children.sort((a, b) =>
|
|
104
|
+
new Date(a.entry.timestamp).getTime() - new Date(b.entry.timestamp).getTime()
|
|
105
|
+
);
|
|
106
|
+
node.children.forEach(sortChildren);
|
|
107
|
+
}
|
|
108
|
+
roots.forEach(sortChildren);
|
|
109
|
+
|
|
110
|
+
return roots;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Build set of entry IDs on path from root to target.
|
|
115
|
+
*/
|
|
116
|
+
function buildActivePathIds(targetId) {
|
|
117
|
+
const ids = new Set();
|
|
118
|
+
let current = byId.get(targetId);
|
|
119
|
+
while (current) {
|
|
120
|
+
ids.add(current.id);
|
|
121
|
+
// Stop if no parent or self-referencing (root)
|
|
122
|
+
if (!current.parentId || current.parentId === current.id) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
current = byId.get(current.parentId);
|
|
126
|
+
}
|
|
127
|
+
return ids;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Get array of entries from root to target (the conversation path).
|
|
132
|
+
*/
|
|
133
|
+
function getPath(targetId) {
|
|
134
|
+
const path = [];
|
|
135
|
+
let current = byId.get(targetId);
|
|
136
|
+
while (current) {
|
|
137
|
+
path.unshift(current);
|
|
138
|
+
// Stop if no parent or self-referencing (root)
|
|
139
|
+
if (!current.parentId || current.parentId === current.id) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
current = byId.get(current.parentId);
|
|
143
|
+
}
|
|
144
|
+
return path;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Tree node lookup for finding leaves
|
|
148
|
+
let treeNodeMap = null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Find the newest leaf node reachable from a given node.
|
|
152
|
+
* This allows clicking any node in a branch to show the full branch.
|
|
153
|
+
* Children are sorted by timestamp, so the newest is always last.
|
|
154
|
+
*/
|
|
155
|
+
function findNewestLeaf(nodeId) {
|
|
156
|
+
// Build tree node map lazily
|
|
157
|
+
if (!treeNodeMap) {
|
|
158
|
+
treeNodeMap = new Map();
|
|
159
|
+
const tree = buildTree();
|
|
160
|
+
function mapNodes(node) {
|
|
161
|
+
treeNodeMap.set(node.entry.id, node);
|
|
162
|
+
node.children.forEach(mapNodes);
|
|
163
|
+
}
|
|
164
|
+
tree.forEach(mapNodes);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const node = treeNodeMap.get(nodeId);
|
|
168
|
+
if (!node) return nodeId;
|
|
169
|
+
|
|
170
|
+
// Follow the newest (last) child at each level
|
|
171
|
+
let current = node;
|
|
172
|
+
while (current.children.length > 0) {
|
|
173
|
+
current = current.children[current.children.length - 1];
|
|
174
|
+
}
|
|
175
|
+
return current.entry.id;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Flatten tree into list with indentation and connector info.
|
|
180
|
+
* Returns array of { node, indent, showConnector, isLast, gutters, isVirtualRootChild, multipleRoots }.
|
|
181
|
+
* Matches tree-selector.ts logic exactly.
|
|
182
|
+
*/
|
|
183
|
+
function flattenTree(roots, activePathIds) {
|
|
184
|
+
const result = [];
|
|
185
|
+
const multipleRoots = roots.length > 1;
|
|
186
|
+
|
|
187
|
+
// Mark which subtrees contain the active leaf
|
|
188
|
+
const containsActive = new Map();
|
|
189
|
+
function markActive(node) {
|
|
190
|
+
let has = activePathIds.has(node.entry.id);
|
|
191
|
+
for (const child of node.children) {
|
|
192
|
+
if (markActive(child)) has = true;
|
|
193
|
+
}
|
|
194
|
+
containsActive.set(node, has);
|
|
195
|
+
return has;
|
|
196
|
+
}
|
|
197
|
+
roots.forEach(markActive);
|
|
198
|
+
|
|
199
|
+
// Stack: [node, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild]
|
|
200
|
+
const stack = [];
|
|
201
|
+
|
|
202
|
+
// Add roots (prioritize branch containing active leaf)
|
|
203
|
+
const orderedRoots = [...roots].sort((a, b) =>
|
|
204
|
+
Number(containsActive.get(b)) - Number(containsActive.get(a))
|
|
205
|
+
);
|
|
206
|
+
for (let i = orderedRoots.length - 1; i >= 0; i--) {
|
|
207
|
+
const isLast = i === orderedRoots.length - 1;
|
|
208
|
+
stack.push([orderedRoots[i], multipleRoots ? 1 : 0, multipleRoots, multipleRoots, isLast, [], multipleRoots]);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
while (stack.length > 0) {
|
|
212
|
+
const [node, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild] = stack.pop();
|
|
213
|
+
|
|
214
|
+
result.push({ node, indent, showConnector, isLast, gutters, isVirtualRootChild, multipleRoots });
|
|
215
|
+
|
|
216
|
+
const children = node.children;
|
|
217
|
+
const multipleChildren = children.length > 1;
|
|
218
|
+
|
|
219
|
+
// Order children (active branch first)
|
|
220
|
+
const orderedChildren = [...children].sort((a, b) =>
|
|
221
|
+
Number(containsActive.get(b)) - Number(containsActive.get(a))
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
// Calculate child indent (matches tree-selector.ts)
|
|
225
|
+
let childIndent;
|
|
226
|
+
if (multipleChildren) {
|
|
227
|
+
// Parent branches: children get +1
|
|
228
|
+
childIndent = indent + 1;
|
|
229
|
+
} else if (justBranched && indent > 0) {
|
|
230
|
+
// First generation after a branch: +1 for visual grouping
|
|
231
|
+
childIndent = indent + 1;
|
|
232
|
+
} else {
|
|
233
|
+
// Single-child chain: stay flat
|
|
234
|
+
childIndent = indent;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Build gutters for children
|
|
238
|
+
const connectorDisplayed = showConnector && !isVirtualRootChild;
|
|
239
|
+
const currentDisplayIndent = multipleRoots ? Math.max(0, indent - 1) : indent;
|
|
240
|
+
const connectorPosition = Math.max(0, currentDisplayIndent - 1);
|
|
241
|
+
const childGutters = connectorDisplayed
|
|
242
|
+
? [...gutters, { position: connectorPosition, show: !isLast }]
|
|
243
|
+
: gutters;
|
|
244
|
+
|
|
245
|
+
// Add children in reverse order for stack
|
|
246
|
+
for (let i = orderedChildren.length - 1; i >= 0; i--) {
|
|
247
|
+
const childIsLast = i === orderedChildren.length - 1;
|
|
248
|
+
stack.push([orderedChildren[i], childIndent, multipleChildren, multipleChildren, childIsLast, childGutters, false]);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return result;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Build ASCII prefix string for tree node.
|
|
257
|
+
*/
|
|
258
|
+
function buildTreePrefix(flatNode) {
|
|
259
|
+
const { indent, showConnector, isLast, gutters, isVirtualRootChild, multipleRoots } = flatNode;
|
|
260
|
+
const displayIndent = multipleRoots ? Math.max(0, indent - 1) : indent;
|
|
261
|
+
const connector = showConnector && !isVirtualRootChild ? (isLast ? '└─ ' : '├─ ') : '';
|
|
262
|
+
const connectorPosition = connector ? displayIndent - 1 : -1;
|
|
263
|
+
|
|
264
|
+
const totalChars = displayIndent * 3;
|
|
265
|
+
const prefixChars = [];
|
|
266
|
+
for (let i = 0; i < totalChars; i++) {
|
|
267
|
+
const level = Math.floor(i / 3);
|
|
268
|
+
const posInLevel = i % 3;
|
|
269
|
+
|
|
270
|
+
const gutter = gutters.find(g => g.position === level);
|
|
271
|
+
if (gutter) {
|
|
272
|
+
prefixChars.push(posInLevel === 0 ? (gutter.show ? '│' : ' ') : ' ');
|
|
273
|
+
} else if (connector && level === connectorPosition) {
|
|
274
|
+
if (posInLevel === 0) {
|
|
275
|
+
prefixChars.push(isLast ? '└' : '├');
|
|
276
|
+
} else if (posInLevel === 1) {
|
|
277
|
+
prefixChars.push('─');
|
|
278
|
+
} else {
|
|
279
|
+
prefixChars.push(' ');
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
prefixChars.push(' ');
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return prefixChars.join('');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ============================================================
|
|
289
|
+
// FILTERING (pure data)
|
|
290
|
+
// ============================================================
|
|
291
|
+
|
|
292
|
+
let filterMode = 'default';
|
|
293
|
+
let searchQuery = '';
|
|
294
|
+
|
|
295
|
+
function hasTextContent(content) {
|
|
296
|
+
if (typeof content === 'string') return content.trim().length > 0;
|
|
297
|
+
if (Array.isArray(content)) {
|
|
298
|
+
for (const c of content) {
|
|
299
|
+
if (c.type === 'text' && c.text && c.text.trim().length > 0) return true;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function extractContent(content) {
|
|
306
|
+
if (typeof content === 'string') return content;
|
|
307
|
+
if (Array.isArray(content)) {
|
|
308
|
+
return content
|
|
309
|
+
.filter(c => c.type === 'text' && c.text)
|
|
310
|
+
.map(c => c.text)
|
|
311
|
+
.join('');
|
|
312
|
+
}
|
|
313
|
+
return '';
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function getSearchableText(entry, label) {
|
|
317
|
+
const parts = [];
|
|
318
|
+
if (label) parts.push(label);
|
|
319
|
+
|
|
320
|
+
switch (entry.type) {
|
|
321
|
+
case 'message': {
|
|
322
|
+
const msg = entry.message;
|
|
323
|
+
parts.push(msg.role);
|
|
324
|
+
if (msg.content) parts.push(extractContent(msg.content));
|
|
325
|
+
if (msg.role === 'bashExecution' && msg.command) parts.push(msg.command);
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
case 'custom_message':
|
|
329
|
+
parts.push(entry.customType);
|
|
330
|
+
parts.push(typeof entry.content === 'string' ? entry.content : extractContent(entry.content));
|
|
331
|
+
break;
|
|
332
|
+
case 'compaction':
|
|
333
|
+
parts.push('compaction');
|
|
334
|
+
break;
|
|
335
|
+
case 'branch_summary':
|
|
336
|
+
parts.push('branch summary', entry.summary);
|
|
337
|
+
break;
|
|
338
|
+
case 'model_change':
|
|
339
|
+
parts.push('model', entry.modelId);
|
|
340
|
+
break;
|
|
341
|
+
case 'thinking_level_change':
|
|
342
|
+
parts.push('thinking', entry.thinkingLevel);
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return parts.join(' ').toLowerCase();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Filter flat nodes based on current filterMode and searchQuery.
|
|
351
|
+
*/
|
|
352
|
+
function filterNodes(flatNodes, currentLeafId) {
|
|
353
|
+
const searchTokens = searchQuery.toLowerCase().split(/\s+/).filter(Boolean);
|
|
354
|
+
|
|
355
|
+
const filtered = flatNodes.filter(flatNode => {
|
|
356
|
+
const entry = flatNode.node.entry;
|
|
357
|
+
const label = flatNode.node.label;
|
|
358
|
+
const isCurrentLeaf = entry.id === currentLeafId;
|
|
359
|
+
|
|
360
|
+
// Always show current leaf
|
|
361
|
+
if (isCurrentLeaf) return true;
|
|
362
|
+
|
|
363
|
+
// Hide assistant messages with only tool calls (no text) unless error/aborted
|
|
364
|
+
if (entry.type === 'message' && entry.message.role === 'assistant') {
|
|
365
|
+
const msg = entry.message;
|
|
366
|
+
const hasText = hasTextContent(msg.content);
|
|
367
|
+
const isErrorOrAborted = msg.stopReason && msg.stopReason !== 'stop' && msg.stopReason !== 'toolUse';
|
|
368
|
+
if (!hasText && !isErrorOrAborted) return false;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Apply filter mode
|
|
372
|
+
const isSettingsEntry = ['label', 'custom', 'model_change', 'thinking_level_change'].includes(entry.type);
|
|
373
|
+
let passesFilter = true;
|
|
374
|
+
|
|
375
|
+
switch (filterMode) {
|
|
376
|
+
case 'user-only':
|
|
377
|
+
passesFilter = entry.type === 'message' && entry.message.role === 'user';
|
|
378
|
+
break;
|
|
379
|
+
case 'no-tools':
|
|
380
|
+
passesFilter = !isSettingsEntry && !(entry.type === 'message' && entry.message.role === 'toolResult');
|
|
381
|
+
break;
|
|
382
|
+
case 'labeled-only':
|
|
383
|
+
passesFilter = label !== undefined;
|
|
384
|
+
break;
|
|
385
|
+
case 'all':
|
|
386
|
+
passesFilter = true;
|
|
387
|
+
break;
|
|
388
|
+
default: // 'default'
|
|
389
|
+
passesFilter = !isSettingsEntry;
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (!passesFilter) return false;
|
|
394
|
+
|
|
395
|
+
// Apply search filter
|
|
396
|
+
if (searchTokens.length > 0) {
|
|
397
|
+
const nodeText = getSearchableText(entry, label);
|
|
398
|
+
if (!searchTokens.every(t => nodeText.includes(t))) return false;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return true;
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// Recalculate visual structure based on visible tree
|
|
405
|
+
recalculateVisualStructure(filtered, flatNodes);
|
|
406
|
+
|
|
407
|
+
return filtered;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Recompute indentation/connectors for the filtered view
|
|
412
|
+
*
|
|
413
|
+
* Filtering can hide intermediate entries; descendants attach to the nearest visible ancestor.
|
|
414
|
+
* Keep indentation semantics aligned with flattenTree() so single-child chains don't drift right.
|
|
415
|
+
*/
|
|
416
|
+
function recalculateVisualStructure(filteredNodes, allFlatNodes) {
|
|
417
|
+
if (filteredNodes.length === 0) return;
|
|
418
|
+
|
|
419
|
+
const visibleIds = new Set(filteredNodes.map(n => n.node.entry.id));
|
|
420
|
+
|
|
421
|
+
// Build entry map for parent lookup (using full tree)
|
|
422
|
+
const entryMap = new Map();
|
|
423
|
+
for (const flatNode of allFlatNodes) {
|
|
424
|
+
entryMap.set(flatNode.node.entry.id, flatNode);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Find nearest visible ancestor for a node
|
|
428
|
+
function findVisibleAncestor(nodeId) {
|
|
429
|
+
let currentId = entryMap.get(nodeId)?.node.entry.parentId;
|
|
430
|
+
while (currentId != null) {
|
|
431
|
+
if (visibleIds.has(currentId)) {
|
|
432
|
+
return currentId;
|
|
433
|
+
}
|
|
434
|
+
currentId = entryMap.get(currentId)?.node.entry.parentId;
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Build visible tree structure
|
|
440
|
+
const visibleParent = new Map();
|
|
441
|
+
const visibleChildren = new Map();
|
|
442
|
+
visibleChildren.set(null, []); // root-level nodes
|
|
443
|
+
|
|
444
|
+
for (const flatNode of filteredNodes) {
|
|
445
|
+
const nodeId = flatNode.node.entry.id;
|
|
446
|
+
const ancestorId = findVisibleAncestor(nodeId);
|
|
447
|
+
visibleParent.set(nodeId, ancestorId);
|
|
448
|
+
|
|
449
|
+
if (!visibleChildren.has(ancestorId)) {
|
|
450
|
+
visibleChildren.set(ancestorId, []);
|
|
451
|
+
}
|
|
452
|
+
visibleChildren.get(ancestorId).push(nodeId);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// Update multipleRoots based on visible roots
|
|
456
|
+
const visibleRootIds = visibleChildren.get(null);
|
|
457
|
+
const multipleRoots = visibleRootIds.length > 1;
|
|
458
|
+
|
|
459
|
+
// Build a map for quick lookup: nodeId → FlatNode
|
|
460
|
+
const filteredNodeMap = new Map();
|
|
461
|
+
for (const flatNode of filteredNodes) {
|
|
462
|
+
filteredNodeMap.set(flatNode.node.entry.id, flatNode);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// DFS traversal of visible tree, applying same indentation rules as flattenTree()
|
|
466
|
+
// Stack items: [nodeId, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild]
|
|
467
|
+
const stack = [];
|
|
468
|
+
|
|
469
|
+
// Add visible roots in reverse order (to process in forward order via stack)
|
|
470
|
+
for (let i = visibleRootIds.length - 1; i >= 0; i--) {
|
|
471
|
+
const isLast = i === visibleRootIds.length - 1;
|
|
472
|
+
stack.push([
|
|
473
|
+
visibleRootIds[i],
|
|
474
|
+
multipleRoots ? 1 : 0,
|
|
475
|
+
multipleRoots,
|
|
476
|
+
multipleRoots,
|
|
477
|
+
isLast,
|
|
478
|
+
[],
|
|
479
|
+
multipleRoots
|
|
480
|
+
]);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
while (stack.length > 0) {
|
|
484
|
+
const [nodeId, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild] = stack.pop();
|
|
485
|
+
|
|
486
|
+
const flatNode = filteredNodeMap.get(nodeId);
|
|
487
|
+
if (!flatNode) continue;
|
|
488
|
+
|
|
489
|
+
// Update this node's visual properties
|
|
490
|
+
flatNode.indent = indent;
|
|
491
|
+
flatNode.showConnector = showConnector;
|
|
492
|
+
flatNode.isLast = isLast;
|
|
493
|
+
flatNode.gutters = gutters;
|
|
494
|
+
flatNode.isVirtualRootChild = isVirtualRootChild;
|
|
495
|
+
flatNode.multipleRoots = multipleRoots;
|
|
496
|
+
|
|
497
|
+
// Get visible children of this node
|
|
498
|
+
const children = visibleChildren.get(nodeId) || [];
|
|
499
|
+
const multipleChildren = children.length > 1;
|
|
500
|
+
|
|
501
|
+
// Calculate child indent using same rules as flattenTree():
|
|
502
|
+
// - Parent branches (multiple children): children get +1
|
|
503
|
+
// - Just branched and indent > 0: children get +1 for visual grouping
|
|
504
|
+
// - Single-child chain: stay flat
|
|
505
|
+
let childIndent;
|
|
506
|
+
if (multipleChildren) {
|
|
507
|
+
childIndent = indent + 1;
|
|
508
|
+
} else if (justBranched && indent > 0) {
|
|
509
|
+
childIndent = indent + 1;
|
|
510
|
+
} else {
|
|
511
|
+
childIndent = indent;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// Build gutters for children (same logic as flattenTree)
|
|
515
|
+
const connectorDisplayed = showConnector && !isVirtualRootChild;
|
|
516
|
+
const currentDisplayIndent = multipleRoots ? Math.max(0, indent - 1) : indent;
|
|
517
|
+
const connectorPosition = Math.max(0, currentDisplayIndent - 1);
|
|
518
|
+
const childGutters = connectorDisplayed
|
|
519
|
+
? [...gutters, { position: connectorPosition, show: !isLast }]
|
|
520
|
+
: gutters;
|
|
521
|
+
|
|
522
|
+
// Add children in reverse order (to process in forward order via stack)
|
|
523
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
524
|
+
const childIsLast = i === children.length - 1;
|
|
525
|
+
stack.push([
|
|
526
|
+
children[i],
|
|
527
|
+
childIndent,
|
|
528
|
+
multipleChildren,
|
|
529
|
+
multipleChildren,
|
|
530
|
+
childIsLast,
|
|
531
|
+
childGutters,
|
|
532
|
+
false
|
|
533
|
+
]);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// ============================================================
|
|
539
|
+
// TREE DISPLAY TEXT (pure data -> string)
|
|
540
|
+
// ============================================================
|
|
541
|
+
|
|
542
|
+
function shortenPath(p) {
|
|
543
|
+
if (typeof p !== 'string') return '';
|
|
544
|
+
if (p.startsWith('/Users/')) {
|
|
545
|
+
const parts = p.split('/');
|
|
546
|
+
if (parts.length > 2) return '~' + p.slice(('/Users/' + parts[2]).length);
|
|
547
|
+
}
|
|
548
|
+
if (p.startsWith('/home/')) {
|
|
549
|
+
const parts = p.split('/');
|
|
550
|
+
if (parts.length > 2) return '~' + p.slice(('/home/' + parts[2]).length);
|
|
551
|
+
}
|
|
552
|
+
return p;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function formatToolCall(name, args) {
|
|
556
|
+
switch (name) {
|
|
557
|
+
case 'read': {
|
|
558
|
+
const path = shortenPath(String(args.path || args.file_path || ''));
|
|
559
|
+
const offset = args.offset;
|
|
560
|
+
const limit = args.limit;
|
|
561
|
+
let display = path;
|
|
562
|
+
if (offset !== undefined || limit !== undefined) {
|
|
563
|
+
const start = offset ?? 1;
|
|
564
|
+
const end = limit !== undefined ? start + limit - 1 : '';
|
|
565
|
+
display += `:${start}${end ? `-${end}` : ''}`;
|
|
566
|
+
}
|
|
567
|
+
return `[read: ${display}]`;
|
|
568
|
+
}
|
|
569
|
+
case 'write':
|
|
570
|
+
return `[write: ${shortenPath(String(args.path || args.file_path || ''))}]`;
|
|
571
|
+
case 'edit':
|
|
572
|
+
return `[edit: ${shortenPath(String(args.path || args.file_path || ''))}]`;
|
|
573
|
+
case 'bash': {
|
|
574
|
+
const rawCmd = String(args.command || '');
|
|
575
|
+
const cmd = rawCmd.replace(/[\n\t]/g, ' ').trim().slice(0, 50);
|
|
576
|
+
return `[bash: ${cmd}${rawCmd.length > 50 ? '...' : ''}]`;
|
|
577
|
+
}
|
|
578
|
+
case 'grep':
|
|
579
|
+
return `[grep: /${args.pattern || ''}/ in ${shortenPath(String(args.path || '.'))}]`;
|
|
580
|
+
case 'find':
|
|
581
|
+
return `[find: ${args.pattern || ''} in ${shortenPath(String(args.path || '.'))}]`;
|
|
582
|
+
case 'ls':
|
|
583
|
+
return `[ls: ${shortenPath(String(args.path || '.'))}]`;
|
|
584
|
+
default: {
|
|
585
|
+
const argsStr = JSON.stringify(args).slice(0, 40);
|
|
586
|
+
return `[${name}: ${argsStr}${JSON.stringify(args).length > 40 ? '...' : ''}]`;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function escapeHtml(text) {
|
|
592
|
+
const div = document.createElement('div');
|
|
593
|
+
div.textContent = text;
|
|
594
|
+
return div.innerHTML;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Truncate string to maxLen chars, append "..." if truncated.
|
|
599
|
+
*/
|
|
600
|
+
function truncate(s, maxLen = 100) {
|
|
601
|
+
if (s.length <= maxLen) return s;
|
|
602
|
+
return s.slice(0, maxLen) + '...';
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Get display text for tree node (returns HTML string).
|
|
607
|
+
*/
|
|
608
|
+
function getTreeNodeDisplayHtml(entry, label) {
|
|
609
|
+
const normalize = s => s.replace(/[\n\t]/g, ' ').trim();
|
|
610
|
+
const labelHtml = label ? `<span class="tree-label">[${escapeHtml(label)}]</span> ` : '';
|
|
611
|
+
|
|
612
|
+
switch (entry.type) {
|
|
613
|
+
case 'message': {
|
|
614
|
+
const msg = entry.message;
|
|
615
|
+
if (msg.role === 'user') {
|
|
616
|
+
const content = truncate(normalize(extractContent(msg.content)));
|
|
617
|
+
return labelHtml + `<span class="tree-role-user">user:</span> ${escapeHtml(content)}`;
|
|
618
|
+
}
|
|
619
|
+
if (msg.role === 'assistant') {
|
|
620
|
+
const textContent = truncate(normalize(extractContent(msg.content)));
|
|
621
|
+
if (textContent) {
|
|
622
|
+
return labelHtml + `<span class="tree-role-assistant">assistant:</span> ${escapeHtml(textContent)}`;
|
|
623
|
+
}
|
|
624
|
+
if (msg.stopReason === 'aborted') {
|
|
625
|
+
return labelHtml + `<span class="tree-role-assistant">assistant:</span> <span class="tree-muted">(aborted)</span>`;
|
|
626
|
+
}
|
|
627
|
+
if (msg.errorMessage) {
|
|
628
|
+
return labelHtml + `<span class="tree-role-assistant">assistant:</span> <span class="tree-error">${escapeHtml(truncate(msg.errorMessage))}</span>`;
|
|
629
|
+
}
|
|
630
|
+
return labelHtml + `<span class="tree-role-assistant">assistant:</span> <span class="tree-muted">(no text)</span>`;
|
|
631
|
+
}
|
|
632
|
+
if (msg.role === 'toolResult') {
|
|
633
|
+
const toolCall = msg.toolCallId ? toolCallMap.get(msg.toolCallId) : null;
|
|
634
|
+
if (toolCall) {
|
|
635
|
+
return labelHtml + `<span class="tree-role-tool">${escapeHtml(formatToolCall(toolCall.name, toolCall.arguments))}</span>`;
|
|
636
|
+
}
|
|
637
|
+
return labelHtml + `<span class="tree-role-tool">[${msg.toolName || 'tool'}]</span>`;
|
|
638
|
+
}
|
|
639
|
+
if (msg.role === 'bashExecution') {
|
|
640
|
+
const cmd = truncate(normalize(msg.command || ''));
|
|
641
|
+
return labelHtml + `<span class="tree-role-tool">[bash]:</span> ${escapeHtml(cmd)}`;
|
|
642
|
+
}
|
|
643
|
+
return labelHtml + `<span class="tree-muted">[${msg.role}]</span>`;
|
|
644
|
+
}
|
|
645
|
+
case 'compaction':
|
|
646
|
+
return labelHtml + `<span class="tree-compaction">[compaction: ${Math.round(entry.tokensBefore/1000)}k tokens]</span>`;
|
|
647
|
+
case 'branch_summary': {
|
|
648
|
+
const summary = truncate(normalize(entry.summary || ''));
|
|
649
|
+
return labelHtml + `<span class="tree-branch-summary">[branch summary]:</span> ${escapeHtml(summary)}`;
|
|
650
|
+
}
|
|
651
|
+
case 'custom_message': {
|
|
652
|
+
const content = typeof entry.content === 'string' ? entry.content : extractContent(entry.content);
|
|
653
|
+
return labelHtml + `<span class="tree-custom">[${escapeHtml(entry.customType)}]:</span> ${escapeHtml(truncate(normalize(content)))}`;
|
|
654
|
+
}
|
|
655
|
+
case 'model_change':
|
|
656
|
+
return labelHtml + `<span class="tree-muted">[model: ${entry.modelId}]</span>`;
|
|
657
|
+
case 'thinking_level_change':
|
|
658
|
+
return labelHtml + `<span class="tree-muted">[thinking: ${entry.thinkingLevel}]</span>`;
|
|
659
|
+
default:
|
|
660
|
+
return labelHtml + `<span class="tree-muted">[${entry.type}]</span>`;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// ============================================================
|
|
665
|
+
// TREE RENDERING (DOM manipulation)
|
|
666
|
+
// ============================================================
|
|
667
|
+
|
|
668
|
+
let currentLeafId = leafId;
|
|
669
|
+
let currentTargetId = urlTargetId || leafId;
|
|
670
|
+
let treeRendered = false;
|
|
671
|
+
|
|
672
|
+
function renderTree() {
|
|
673
|
+
const tree = buildTree();
|
|
674
|
+
const activePathIds = buildActivePathIds(currentLeafId);
|
|
675
|
+
const flatNodes = flattenTree(tree, activePathIds);
|
|
676
|
+
const filtered = filterNodes(flatNodes, currentLeafId);
|
|
677
|
+
const container = document.getElementById('tree-container');
|
|
678
|
+
|
|
679
|
+
// Full render only on first call or when filter/search changes
|
|
680
|
+
if (!treeRendered) {
|
|
681
|
+
container.innerHTML = '';
|
|
682
|
+
|
|
683
|
+
for (const flatNode of filtered) {
|
|
684
|
+
const entry = flatNode.node.entry;
|
|
685
|
+
const isOnPath = activePathIds.has(entry.id);
|
|
686
|
+
const isTarget = entry.id === currentTargetId;
|
|
687
|
+
|
|
688
|
+
const div = document.createElement('div');
|
|
689
|
+
div.className = 'tree-node';
|
|
690
|
+
if (isOnPath) div.classList.add('in-path');
|
|
691
|
+
if (isTarget) div.classList.add('active');
|
|
692
|
+
div.dataset.id = entry.id;
|
|
693
|
+
|
|
694
|
+
const prefix = buildTreePrefix(flatNode);
|
|
695
|
+
const prefixSpan = document.createElement('span');
|
|
696
|
+
prefixSpan.className = 'tree-prefix';
|
|
697
|
+
prefixSpan.textContent = prefix;
|
|
698
|
+
|
|
699
|
+
const marker = document.createElement('span');
|
|
700
|
+
marker.className = 'tree-marker';
|
|
701
|
+
marker.textContent = isOnPath ? '•' : ' ';
|
|
702
|
+
|
|
703
|
+
const content = document.createElement('span');
|
|
704
|
+
content.className = 'tree-content';
|
|
705
|
+
content.innerHTML = getTreeNodeDisplayHtml(entry, flatNode.node.label);
|
|
706
|
+
|
|
707
|
+
div.appendChild(prefixSpan);
|
|
708
|
+
div.appendChild(marker);
|
|
709
|
+
div.appendChild(content);
|
|
710
|
+
// Navigate to the newest leaf through this node, but scroll to the clicked node
|
|
711
|
+
div.addEventListener('click', () => {
|
|
712
|
+
const leafId = findNewestLeaf(entry.id);
|
|
713
|
+
navigateTo(leafId, 'target', entry.id);
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
container.appendChild(div);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
treeRendered = true;
|
|
720
|
+
} else {
|
|
721
|
+
// Just update markers and classes
|
|
722
|
+
const nodes = container.querySelectorAll('.tree-node');
|
|
723
|
+
for (const node of nodes) {
|
|
724
|
+
const id = node.dataset.id;
|
|
725
|
+
const isOnPath = activePathIds.has(id);
|
|
726
|
+
const isTarget = id === currentTargetId;
|
|
727
|
+
|
|
728
|
+
node.classList.toggle('in-path', isOnPath);
|
|
729
|
+
node.classList.toggle('active', isTarget);
|
|
730
|
+
|
|
731
|
+
const marker = node.querySelector('.tree-marker');
|
|
732
|
+
if (marker) {
|
|
733
|
+
marker.textContent = isOnPath ? '•' : ' ';
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
document.getElementById('tree-status').textContent = `${filtered.length} / ${flatNodes.length} entries`;
|
|
739
|
+
|
|
740
|
+
// Scroll active node into view after layout
|
|
741
|
+
setTimeout(() => {
|
|
742
|
+
const activeNode = container.querySelector('.tree-node.active');
|
|
743
|
+
if (activeNode) {
|
|
744
|
+
activeNode.scrollIntoView({ block: 'nearest' });
|
|
745
|
+
}
|
|
746
|
+
}, 0);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function forceTreeRerender() {
|
|
750
|
+
treeRendered = false;
|
|
751
|
+
renderTree();
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// ============================================================
|
|
755
|
+
// MESSAGE RENDERING
|
|
756
|
+
// ============================================================
|
|
757
|
+
|
|
758
|
+
function formatTokens(count) {
|
|
759
|
+
if (count < 1000) return count.toString();
|
|
760
|
+
if (count < 10000) return (count / 1000).toFixed(1) + 'k';
|
|
761
|
+
if (count < 1000000) return Math.round(count / 1000) + 'k';
|
|
762
|
+
return (count / 1000000).toFixed(1) + 'M';
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function formatTimestamp(ts) {
|
|
766
|
+
if (!ts) return '';
|
|
767
|
+
const date = new Date(ts);
|
|
768
|
+
return date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function replaceTabs(text) {
|
|
772
|
+
return text.replace(/\t/g, ' ');
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/** Safely coerce value to string for display. Returns null if invalid type. */
|
|
776
|
+
function str(value) {
|
|
777
|
+
if (typeof value === 'string') return value;
|
|
778
|
+
if (value == null) return '';
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function getLanguageFromPath(filePath) {
|
|
783
|
+
const ext = filePath.split('.').pop()?.toLowerCase();
|
|
784
|
+
const extToLang = {
|
|
785
|
+
ts: 'typescript', tsx: 'typescript', js: 'javascript', jsx: 'javascript',
|
|
786
|
+
py: 'python', rb: 'ruby', rs: 'rust', go: 'go', java: 'java',
|
|
787
|
+
c: 'c', cpp: 'cpp', h: 'c', hpp: 'cpp', cs: 'csharp',
|
|
788
|
+
php: 'php', sh: 'bash', bash: 'bash', zsh: 'bash',
|
|
789
|
+
sql: 'sql', html: 'html', css: 'css', scss: 'scss',
|
|
790
|
+
json: 'json', yaml: 'yaml', yml: 'yaml', xml: 'xml',
|
|
791
|
+
md: 'markdown', dockerfile: 'dockerfile'
|
|
792
|
+
};
|
|
793
|
+
return extToLang[ext];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function findToolResult(toolCallId) {
|
|
797
|
+
for (const entry of entries) {
|
|
798
|
+
if (entry.type === 'message' && entry.message.role === 'toolResult') {
|
|
799
|
+
if (entry.message.toolCallId === toolCallId) {
|
|
800
|
+
return entry.message;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function formatExpandableOutput(text, maxLines, lang) {
|
|
808
|
+
text = replaceTabs(text);
|
|
809
|
+
const lines = text.split('\n');
|
|
810
|
+
const displayLines = lines.slice(0, maxLines);
|
|
811
|
+
const remaining = lines.length - maxLines;
|
|
812
|
+
|
|
813
|
+
if (lang) {
|
|
814
|
+
let highlighted;
|
|
815
|
+
try {
|
|
816
|
+
highlighted = hljs.highlight(text, { language: lang }).value;
|
|
817
|
+
} catch {
|
|
818
|
+
highlighted = escapeHtml(text);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
if (remaining > 0) {
|
|
822
|
+
const previewCode = displayLines.join('\n');
|
|
823
|
+
let previewHighlighted;
|
|
824
|
+
try {
|
|
825
|
+
previewHighlighted = hljs.highlight(previewCode, { language: lang }).value;
|
|
826
|
+
} catch {
|
|
827
|
+
previewHighlighted = escapeHtml(previewCode);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return `<div class="tool-output expandable" onclick="this.classList.toggle('expanded')">
|
|
831
|
+
<div class="output-preview"><pre><code class="hljs">${previewHighlighted}</code></pre>
|
|
832
|
+
<div class="expand-hint">... (${remaining} more lines)</div></div>
|
|
833
|
+
<div class="output-full"><pre><code class="hljs">${highlighted}</code></pre></div></div>`;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return `<div class="tool-output"><pre><code class="hljs">${highlighted}</code></pre></div>`;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// Plain text output
|
|
840
|
+
if (remaining > 0) {
|
|
841
|
+
let out = '<div class="tool-output expandable" onclick="this.classList.toggle(\'expanded\')">';
|
|
842
|
+
out += '<div class="output-preview">';
|
|
843
|
+
for (const line of displayLines) {
|
|
844
|
+
out += `<div>${escapeHtml(replaceTabs(line))}</div>`;
|
|
845
|
+
}
|
|
846
|
+
out += `<div class="expand-hint">... (${remaining} more lines)</div></div>`;
|
|
847
|
+
out += '<div class="output-full">';
|
|
848
|
+
for (const line of lines) {
|
|
849
|
+
out += `<div>${escapeHtml(replaceTabs(line))}</div>`;
|
|
850
|
+
}
|
|
851
|
+
out += '</div></div>';
|
|
852
|
+
return out;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
let out = '<div class="tool-output">';
|
|
856
|
+
for (const line of displayLines) {
|
|
857
|
+
out += `<div>${escapeHtml(replaceTabs(line))}</div>`;
|
|
858
|
+
}
|
|
859
|
+
out += '</div>';
|
|
860
|
+
return out;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function renderToolCall(call) {
|
|
864
|
+
const result = findToolResult(call.id);
|
|
865
|
+
const isError = result?.isError || false;
|
|
866
|
+
const statusClass = result ? (isError ? 'error' : 'success') : 'pending';
|
|
867
|
+
|
|
868
|
+
const getResultText = () => {
|
|
869
|
+
if (!result) return '';
|
|
870
|
+
const textBlocks = result.content.filter(c => c.type === 'text');
|
|
871
|
+
return textBlocks.map(c => c.text).join('\n');
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
const getResultImages = () => {
|
|
875
|
+
if (!result) return [];
|
|
876
|
+
return result.content.filter(c => c.type === 'image');
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
const renderResultImages = () => {
|
|
880
|
+
const images = getResultImages();
|
|
881
|
+
if (images.length === 0) return '';
|
|
882
|
+
return '<div class="tool-images">' +
|
|
883
|
+
images.map(img => `<img src="data:${img.mimeType};base64,${img.data}" class="tool-image" />`).join('') +
|
|
884
|
+
'</div>';
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
let html = `<div class="tool-execution ${statusClass}">`;
|
|
888
|
+
const args = call.arguments || {};
|
|
889
|
+
const name = call.name;
|
|
890
|
+
|
|
891
|
+
const invalidArg = '<span class="tool-error">[invalid arg]</span>';
|
|
892
|
+
|
|
893
|
+
switch (name) {
|
|
894
|
+
case 'bash': {
|
|
895
|
+
const command = str(args.command);
|
|
896
|
+
const cmdDisplay = command === null ? invalidArg : escapeHtml(command || '...');
|
|
897
|
+
html += `<div class="tool-command">$ ${cmdDisplay}</div>`;
|
|
898
|
+
if (result) {
|
|
899
|
+
const output = getResultText().trim();
|
|
900
|
+
if (output) html += formatExpandableOutput(output, 5);
|
|
901
|
+
}
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
case 'read': {
|
|
905
|
+
const filePath = str(args.file_path ?? args.path);
|
|
906
|
+
const offset = args.offset;
|
|
907
|
+
const limit = args.limit;
|
|
908
|
+
|
|
909
|
+
let pathHtml = filePath === null ? invalidArg : escapeHtml(shortenPath(filePath || ''));
|
|
910
|
+
if (filePath !== null && (offset !== undefined || limit !== undefined)) {
|
|
911
|
+
const startLine = offset ?? 1;
|
|
912
|
+
const endLine = limit !== undefined ? startLine + limit - 1 : '';
|
|
913
|
+
pathHtml += `<span class="line-numbers">:${startLine}${endLine ? '-' + endLine : ''}</span>`;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
html += `<div class="tool-header"><span class="tool-name">read</span> <span class="tool-path">${pathHtml}</span></div>`;
|
|
917
|
+
if (result) {
|
|
918
|
+
html += renderResultImages();
|
|
919
|
+
const output = getResultText();
|
|
920
|
+
const lang = filePath ? getLanguageFromPath(filePath) : null;
|
|
921
|
+
if (output) html += formatExpandableOutput(output, 10, lang);
|
|
922
|
+
}
|
|
923
|
+
break;
|
|
924
|
+
}
|
|
925
|
+
case 'write': {
|
|
926
|
+
const filePath = str(args.file_path ?? args.path);
|
|
927
|
+
const content = str(args.content);
|
|
928
|
+
|
|
929
|
+
html += `<div class="tool-header"><span class="tool-name">write</span> <span class="tool-path">${filePath === null ? invalidArg : escapeHtml(shortenPath(filePath || ''))}</span>`;
|
|
930
|
+
if (content !== null && content) {
|
|
931
|
+
const lines = content.split('\n');
|
|
932
|
+
if (lines.length > 10) html += ` <span class="line-count">(${lines.length} lines)</span>`;
|
|
933
|
+
}
|
|
934
|
+
html += '</div>';
|
|
935
|
+
|
|
936
|
+
if (content === null) {
|
|
937
|
+
html += `<div class="tool-error">[invalid content arg - expected string]</div>`;
|
|
938
|
+
} else if (content) {
|
|
939
|
+
const lang = filePath ? getLanguageFromPath(filePath) : null;
|
|
940
|
+
html += formatExpandableOutput(content, 10, lang);
|
|
941
|
+
}
|
|
942
|
+
if (result) {
|
|
943
|
+
const output = getResultText().trim();
|
|
944
|
+
if (output) html += `<div class="tool-output"><div>${escapeHtml(output)}</div></div>`;
|
|
945
|
+
}
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
case 'edit': {
|
|
949
|
+
const filePath = str(args.file_path ?? args.path);
|
|
950
|
+
html += `<div class="tool-header"><span class="tool-name">edit</span> <span class="tool-path">${filePath === null ? invalidArg : escapeHtml(shortenPath(filePath || ''))}</span></div>`;
|
|
951
|
+
|
|
952
|
+
if (result?.details?.diff) {
|
|
953
|
+
const diffLines = result.details.diff.split('\n');
|
|
954
|
+
html += '<div class="tool-diff">';
|
|
955
|
+
for (const line of diffLines) {
|
|
956
|
+
const cls = line.match(/^\+/) ? 'diff-added' : line.match(/^-/) ? 'diff-removed' : 'diff-context';
|
|
957
|
+
html += `<div class="${cls}">${escapeHtml(replaceTabs(line))}</div>`;
|
|
958
|
+
}
|
|
959
|
+
html += '</div>';
|
|
960
|
+
} else if (result) {
|
|
961
|
+
const output = getResultText().trim();
|
|
962
|
+
if (output) html += `<div class="tool-output"><pre>${escapeHtml(output)}</pre></div>`;
|
|
963
|
+
}
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
default: {
|
|
967
|
+
// Check for pre-rendered custom tool HTML
|
|
968
|
+
const rendered = renderedTools?.[call.id];
|
|
969
|
+
if (rendered?.callHtml || rendered?.resultHtmlCollapsed || rendered?.resultHtmlExpanded) {
|
|
970
|
+
// Custom tool with pre-rendered HTML from TUI renderer
|
|
971
|
+
if (rendered.callHtml) {
|
|
972
|
+
html += `<div class="tool-header ansi-rendered">${rendered.callHtml}</div>`;
|
|
973
|
+
} else {
|
|
974
|
+
html += `<div class="tool-header"><span class="tool-name">${escapeHtml(name)}</span></div>`;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (rendered.resultHtmlCollapsed && rendered.resultHtmlExpanded && rendered.resultHtmlCollapsed !== rendered.resultHtmlExpanded) {
|
|
978
|
+
// Both collapsed and expanded differ - render expandable section
|
|
979
|
+
html += `<div class="tool-output expandable ansi-rendered" onclick="this.classList.toggle('expanded')">
|
|
980
|
+
<div class="output-preview">${rendered.resultHtmlCollapsed}</div>
|
|
981
|
+
<div class="output-full">${rendered.resultHtmlExpanded}</div>
|
|
982
|
+
</div>`;
|
|
983
|
+
} else if (rendered.resultHtmlExpanded) {
|
|
984
|
+
// Only expanded exists (or collapsed is identical) - show directly
|
|
985
|
+
html += `<div class="tool-output ansi-rendered">${rendered.resultHtmlExpanded}</div>`;
|
|
986
|
+
} else if (result) {
|
|
987
|
+
// No pre-rendered result HTML - fallback to JSON
|
|
988
|
+
const output = getResultText();
|
|
989
|
+
if (output) html += formatExpandableOutput(output, 10);
|
|
990
|
+
}
|
|
991
|
+
} else {
|
|
992
|
+
// Fallback to JSON display (existing behavior)
|
|
993
|
+
html += `<div class="tool-header"><span class="tool-name">${escapeHtml(name)}</span></div>`;
|
|
994
|
+
html += `<div class="tool-output"><pre>${escapeHtml(JSON.stringify(args, null, 2))}</pre></div>`;
|
|
995
|
+
if (result) {
|
|
996
|
+
const output = getResultText();
|
|
997
|
+
if (output) html += formatExpandableOutput(output, 10);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
html += '</div>';
|
|
1004
|
+
return html;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Download the session data as a JSONL file.
|
|
1009
|
+
* Reconstructs the original format: header line + entry lines.
|
|
1010
|
+
*/
|
|
1011
|
+
window.downloadSessionJson = function() {
|
|
1012
|
+
// Build JSONL content: header first, then all entries
|
|
1013
|
+
const lines = [];
|
|
1014
|
+
if (header) {
|
|
1015
|
+
lines.push(JSON.stringify({ type: 'header', ...header }));
|
|
1016
|
+
}
|
|
1017
|
+
for (const entry of entries) {
|
|
1018
|
+
lines.push(JSON.stringify(entry));
|
|
1019
|
+
}
|
|
1020
|
+
const jsonlContent = lines.join('\n');
|
|
1021
|
+
|
|
1022
|
+
// Create download
|
|
1023
|
+
const blob = new Blob([jsonlContent], { type: 'application/x-ndjson' });
|
|
1024
|
+
const url = URL.createObjectURL(blob);
|
|
1025
|
+
const a = document.createElement('a');
|
|
1026
|
+
a.href = url;
|
|
1027
|
+
a.download = `${header?.id || 'session'}.jsonl`;
|
|
1028
|
+
document.body.appendChild(a);
|
|
1029
|
+
a.click();
|
|
1030
|
+
document.body.removeChild(a);
|
|
1031
|
+
URL.revokeObjectURL(url);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Build a shareable URL for a specific message.
|
|
1036
|
+
* URL format: base?gistId&leafId=<leafId>&targetId=<entryId>
|
|
1037
|
+
*/
|
|
1038
|
+
function buildShareUrl(entryId) {
|
|
1039
|
+
// Check for injected base URL (used when loaded in iframe via srcdoc)
|
|
1040
|
+
const baseUrlMeta = document.querySelector('meta[name="pi-share-base-url"]');
|
|
1041
|
+
const baseUrl = baseUrlMeta ? baseUrlMeta.content : window.location.href.split('?')[0];
|
|
1042
|
+
|
|
1043
|
+
const url = new URL(window.location.href);
|
|
1044
|
+
// Find the gist ID (first query param without value, e.g., ?abc123)
|
|
1045
|
+
const gistId = Array.from(url.searchParams.keys()).find(k => !url.searchParams.get(k));
|
|
1046
|
+
|
|
1047
|
+
// Build the share URL
|
|
1048
|
+
const params = new URLSearchParams();
|
|
1049
|
+
params.set('leafId', currentLeafId);
|
|
1050
|
+
params.set('targetId', entryId);
|
|
1051
|
+
|
|
1052
|
+
// If we have an injected base URL (iframe context), use it directly
|
|
1053
|
+
if (baseUrlMeta) {
|
|
1054
|
+
return `${baseUrl}&${params.toString()}`;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
// Otherwise build from current location (direct file access)
|
|
1058
|
+
url.search = gistId ? `?${gistId}&${params.toString()}` : `?${params.toString()}`;
|
|
1059
|
+
return url.toString();
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Copy text to clipboard with visual feedback.
|
|
1064
|
+
* Uses navigator.clipboard with fallback to execCommand for HTTP contexts.
|
|
1065
|
+
*/
|
|
1066
|
+
async function copyToClipboard(text, button) {
|
|
1067
|
+
let success = false;
|
|
1068
|
+
try {
|
|
1069
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1070
|
+
await navigator.clipboard.writeText(text);
|
|
1071
|
+
success = true;
|
|
1072
|
+
}
|
|
1073
|
+
} catch (err) {
|
|
1074
|
+
// Clipboard API failed, try fallback
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
// Fallback for HTTP or when Clipboard API is unavailable
|
|
1078
|
+
if (!success) {
|
|
1079
|
+
try {
|
|
1080
|
+
const textarea = document.createElement('textarea');
|
|
1081
|
+
textarea.value = text;
|
|
1082
|
+
textarea.style.position = 'fixed';
|
|
1083
|
+
textarea.style.opacity = '0';
|
|
1084
|
+
document.body.appendChild(textarea);
|
|
1085
|
+
textarea.select();
|
|
1086
|
+
success = document.execCommand('copy');
|
|
1087
|
+
document.body.removeChild(textarea);
|
|
1088
|
+
} catch (err) {
|
|
1089
|
+
console.error('Failed to copy:', err);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
if (success && button) {
|
|
1094
|
+
const originalHtml = button.innerHTML;
|
|
1095
|
+
button.innerHTML = '✓';
|
|
1096
|
+
button.classList.add('copied');
|
|
1097
|
+
setTimeout(() => {
|
|
1098
|
+
button.innerHTML = originalHtml;
|
|
1099
|
+
button.classList.remove('copied');
|
|
1100
|
+
}, 1500);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Render the copy-link button HTML for a message.
|
|
1106
|
+
*/
|
|
1107
|
+
function renderCopyLinkButton(entryId) {
|
|
1108
|
+
return `<button class="copy-link-btn" data-entry-id="${entryId}" title="Copy link to this message">
|
|
1109
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1110
|
+
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/>
|
|
1111
|
+
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>
|
|
1112
|
+
</svg>
|
|
1113
|
+
</button>`;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
function renderEntry(entry) {
|
|
1117
|
+
const ts = formatTimestamp(entry.timestamp);
|
|
1118
|
+
const tsHtml = ts ? `<div class="message-timestamp">${ts}</div>` : '';
|
|
1119
|
+
const entryId = `entry-${entry.id}`;
|
|
1120
|
+
const copyBtnHtml = renderCopyLinkButton(entry.id);
|
|
1121
|
+
|
|
1122
|
+
if (entry.type === 'message') {
|
|
1123
|
+
const msg = entry.message;
|
|
1124
|
+
|
|
1125
|
+
if (msg.role === 'user') {
|
|
1126
|
+
let html = `<div class="user-message" id="${entryId}">${copyBtnHtml}${tsHtml}`;
|
|
1127
|
+
const content = msg.content;
|
|
1128
|
+
|
|
1129
|
+
if (Array.isArray(content)) {
|
|
1130
|
+
const images = content.filter(c => c.type === 'image');
|
|
1131
|
+
if (images.length > 0) {
|
|
1132
|
+
html += '<div class="message-images">';
|
|
1133
|
+
for (const img of images) {
|
|
1134
|
+
html += `<img src="data:${img.mimeType};base64,${img.data}" class="message-image" />`;
|
|
1135
|
+
}
|
|
1136
|
+
html += '</div>';
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
const text = typeof content === 'string' ? content :
|
|
1141
|
+
content.filter(c => c.type === 'text').map(c => c.text).join('\n');
|
|
1142
|
+
if (text.trim()) {
|
|
1143
|
+
html += `<div class="markdown-content">${safeMarkedParse(text)}</div>`;
|
|
1144
|
+
}
|
|
1145
|
+
html += '</div>';
|
|
1146
|
+
return html;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
if (msg.role === 'assistant') {
|
|
1150
|
+
let html = `<div class="assistant-message" id="${entryId}">${copyBtnHtml}${tsHtml}`;
|
|
1151
|
+
|
|
1152
|
+
for (const block of msg.content) {
|
|
1153
|
+
if (block.type === 'text' && block.text.trim()) {
|
|
1154
|
+
html += `<div class="assistant-text markdown-content">${safeMarkedParse(block.text)}</div>`;
|
|
1155
|
+
} else if (block.type === 'thinking' && block.thinking.trim()) {
|
|
1156
|
+
html += `<div class="thinking-block">
|
|
1157
|
+
<div class="thinking-text">${escapeHtml(block.thinking)}</div>
|
|
1158
|
+
<div class="thinking-collapsed">Thinking ...</div>
|
|
1159
|
+
</div>`;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
for (const block of msg.content) {
|
|
1164
|
+
if (block.type === 'toolCall') {
|
|
1165
|
+
html += renderToolCall(block);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
if (msg.stopReason === 'aborted') {
|
|
1170
|
+
html += '<div class="error-text">Aborted</div>';
|
|
1171
|
+
} else if (msg.stopReason === 'error') {
|
|
1172
|
+
html += `<div class="error-text">Error: ${escapeHtml(msg.errorMessage || 'Unknown error')}</div>`;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
html += '</div>';
|
|
1176
|
+
return html;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
if (msg.role === 'bashExecution') {
|
|
1180
|
+
const isError = msg.cancelled || (msg.exitCode !== 0 && msg.exitCode !== null);
|
|
1181
|
+
let html = `<div class="tool-execution ${isError ? 'error' : 'success'}" id="${entryId}">${tsHtml}`;
|
|
1182
|
+
html += `<div class="tool-command">$ ${escapeHtml(msg.command)}</div>`;
|
|
1183
|
+
if (msg.output) html += formatExpandableOutput(msg.output, 10);
|
|
1184
|
+
if (msg.cancelled) {
|
|
1185
|
+
html += '<div style="color: var(--warning)">(cancelled)</div>';
|
|
1186
|
+
} else if (msg.exitCode !== 0 && msg.exitCode !== null) {
|
|
1187
|
+
html += `<div style="color: var(--error)">(exit ${msg.exitCode})</div>`;
|
|
1188
|
+
}
|
|
1189
|
+
html += '</div>';
|
|
1190
|
+
return html;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
if (msg.role === 'toolResult') return '';
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
if (entry.type === 'model_change') {
|
|
1197
|
+
return `<div class="model-change" id="${entryId}">${tsHtml}Switched to model: <span class="model-name">${escapeHtml(entry.provider)}/${escapeHtml(entry.modelId)}</span></div>`;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
if (entry.type === 'compaction') {
|
|
1201
|
+
return `<div class="compaction" id="${entryId}" onclick="this.classList.toggle('expanded')">
|
|
1202
|
+
<div class="compaction-label">[compaction]</div>
|
|
1203
|
+
<div class="compaction-collapsed">Compacted from ${entry.tokensBefore.toLocaleString()} tokens</div>
|
|
1204
|
+
<div class="compaction-content"><strong>Compacted from ${entry.tokensBefore.toLocaleString()} tokens</strong>\n\n${escapeHtml(entry.summary)}</div>
|
|
1205
|
+
</div>`;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
if (entry.type === 'branch_summary') {
|
|
1209
|
+
return `<div class="branch-summary" id="${entryId}">${tsHtml}
|
|
1210
|
+
<div class="branch-summary-header">Branch Summary</div>
|
|
1211
|
+
<div class="markdown-content">${safeMarkedParse(entry.summary)}</div>
|
|
1212
|
+
</div>`;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
if (entry.type === 'custom_message' && entry.display) {
|
|
1216
|
+
return `<div class="hook-message" id="${entryId}">${tsHtml}
|
|
1217
|
+
<div class="hook-type">[${escapeHtml(entry.customType)}]</div>
|
|
1218
|
+
<div class="markdown-content">${safeMarkedParse(typeof entry.content === 'string' ? entry.content : JSON.stringify(entry.content))}</div>
|
|
1219
|
+
</div>`;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
return '';
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
// ============================================================
|
|
1226
|
+
// HEADER / STATS
|
|
1227
|
+
// ============================================================
|
|
1228
|
+
|
|
1229
|
+
function computeStats(entryList) {
|
|
1230
|
+
let userMessages = 0, assistantMessages = 0, toolResults = 0;
|
|
1231
|
+
let customMessages = 0, compactions = 0, branchSummaries = 0, toolCalls = 0;
|
|
1232
|
+
const tokens = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
|
1233
|
+
const cost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
|
1234
|
+
const models = new Set();
|
|
1235
|
+
|
|
1236
|
+
for (const entry of entryList) {
|
|
1237
|
+
if (entry.type === 'message') {
|
|
1238
|
+
const msg = entry.message;
|
|
1239
|
+
if (msg.role === 'user') userMessages++;
|
|
1240
|
+
if (msg.role === 'assistant') {
|
|
1241
|
+
assistantMessages++;
|
|
1242
|
+
if (msg.model) models.add(msg.provider ? `${msg.provider}/${msg.model}` : msg.model);
|
|
1243
|
+
if (msg.usage) {
|
|
1244
|
+
tokens.input += msg.usage.input || 0;
|
|
1245
|
+
tokens.output += msg.usage.output || 0;
|
|
1246
|
+
tokens.cacheRead += msg.usage.cacheRead || 0;
|
|
1247
|
+
tokens.cacheWrite += msg.usage.cacheWrite || 0;
|
|
1248
|
+
if (msg.usage.cost) {
|
|
1249
|
+
cost.input += msg.usage.cost.input || 0;
|
|
1250
|
+
cost.output += msg.usage.cost.output || 0;
|
|
1251
|
+
cost.cacheRead += msg.usage.cost.cacheRead || 0;
|
|
1252
|
+
cost.cacheWrite += msg.usage.cost.cacheWrite || 0;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
toolCalls += msg.content.filter(c => c.type === 'toolCall').length;
|
|
1256
|
+
}
|
|
1257
|
+
if (msg.role === 'toolResult') toolResults++;
|
|
1258
|
+
} else if (entry.type === 'compaction') {
|
|
1259
|
+
compactions++;
|
|
1260
|
+
} else if (entry.type === 'branch_summary') {
|
|
1261
|
+
branchSummaries++;
|
|
1262
|
+
} else if (entry.type === 'custom_message') {
|
|
1263
|
+
customMessages++;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
return { userMessages, assistantMessages, toolResults, customMessages, compactions, branchSummaries, toolCalls, tokens, cost, models: Array.from(models) };
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
const globalStats = computeStats(entries);
|
|
1271
|
+
|
|
1272
|
+
function renderHeader() {
|
|
1273
|
+
const totalCost = globalStats.cost.input + globalStats.cost.output + globalStats.cost.cacheRead + globalStats.cost.cacheWrite;
|
|
1274
|
+
|
|
1275
|
+
const tokenParts = [];
|
|
1276
|
+
if (globalStats.tokens.input) tokenParts.push(`↑${formatTokens(globalStats.tokens.input)}`);
|
|
1277
|
+
if (globalStats.tokens.output) tokenParts.push(`↓${formatTokens(globalStats.tokens.output)}`);
|
|
1278
|
+
if (globalStats.tokens.cacheRead) tokenParts.push(`R${formatTokens(globalStats.tokens.cacheRead)}`);
|
|
1279
|
+
if (globalStats.tokens.cacheWrite) tokenParts.push(`W${formatTokens(globalStats.tokens.cacheWrite)}`);
|
|
1280
|
+
|
|
1281
|
+
const msgParts = [];
|
|
1282
|
+
if (globalStats.userMessages) msgParts.push(`${globalStats.userMessages} user`);
|
|
1283
|
+
if (globalStats.assistantMessages) msgParts.push(`${globalStats.assistantMessages} assistant`);
|
|
1284
|
+
if (globalStats.toolResults) msgParts.push(`${globalStats.toolResults} tool results`);
|
|
1285
|
+
if (globalStats.customMessages) msgParts.push(`${globalStats.customMessages} custom`);
|
|
1286
|
+
if (globalStats.compactions) msgParts.push(`${globalStats.compactions} compactions`);
|
|
1287
|
+
if (globalStats.branchSummaries) msgParts.push(`${globalStats.branchSummaries} branch summaries`);
|
|
1288
|
+
|
|
1289
|
+
let html = `
|
|
1290
|
+
<div class="header">
|
|
1291
|
+
<h1>Session: ${escapeHtml(header?.id || 'unknown')}</h1>
|
|
1292
|
+
<div class="help-bar">
|
|
1293
|
+
<span>Ctrl+T toggle thinking · Ctrl+O toggle tools</span>
|
|
1294
|
+
<button class="download-json-btn" onclick="downloadSessionJson()" title="Download session as JSONL">↓ JSONL</button>
|
|
1295
|
+
</div>
|
|
1296
|
+
<div class="header-info">
|
|
1297
|
+
<div class="info-item"><span class="info-label">Date:</span><span class="info-value">${header?.timestamp ? new Date(header.timestamp).toLocaleString() : 'unknown'}</span></div>
|
|
1298
|
+
<div class="info-item"><span class="info-label">Models:</span><span class="info-value">${globalStats.models.join(', ') || 'unknown'}</span></div>
|
|
1299
|
+
<div class="info-item"><span class="info-label">Messages:</span><span class="info-value">${msgParts.join(', ') || '0'}</span></div>
|
|
1300
|
+
<div class="info-item"><span class="info-label">Tool Calls:</span><span class="info-value">${globalStats.toolCalls}</span></div>
|
|
1301
|
+
<div class="info-item"><span class="info-label">Tokens:</span><span class="info-value">${tokenParts.join(' ') || '0'}</span></div>
|
|
1302
|
+
<div class="info-item"><span class="info-label">Cost:</span><span class="info-value">$${totalCost.toFixed(3)}</span></div>
|
|
1303
|
+
</div>
|
|
1304
|
+
</div>`;
|
|
1305
|
+
|
|
1306
|
+
// Render system prompt (user's base prompt, applies to all providers)
|
|
1307
|
+
if (systemPrompt) {
|
|
1308
|
+
const lines = systemPrompt.split('\n');
|
|
1309
|
+
const previewLines = 10;
|
|
1310
|
+
if (lines.length > previewLines) {
|
|
1311
|
+
const preview = lines.slice(0, previewLines).join('\n');
|
|
1312
|
+
const remaining = lines.length - previewLines;
|
|
1313
|
+
html += `<div class="system-prompt expandable" onclick="this.classList.toggle('expanded')">
|
|
1314
|
+
<div class="system-prompt-header">System Prompt</div>
|
|
1315
|
+
<div class="system-prompt-preview">${escapeHtml(preview)}</div>
|
|
1316
|
+
<div class="system-prompt-expand-hint">... (${remaining} more lines, click to expand)</div>
|
|
1317
|
+
<div class="system-prompt-full">${escapeHtml(systemPrompt)}</div>
|
|
1318
|
+
</div>`;
|
|
1319
|
+
} else {
|
|
1320
|
+
html += `<div class="system-prompt">
|
|
1321
|
+
<div class="system-prompt-header">System Prompt</div>
|
|
1322
|
+
<div class="system-prompt-full" style="display: block">${escapeHtml(systemPrompt)}</div>
|
|
1323
|
+
</div>`;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
if (tools && tools.length > 0) {
|
|
1328
|
+
html += `<div class="tools-list">
|
|
1329
|
+
<div class="tools-header">Available Tools</div>
|
|
1330
|
+
<div class="tools-content">
|
|
1331
|
+
${tools.map(t => {
|
|
1332
|
+
const hasParams = t.parameters && typeof t.parameters === 'object' && t.parameters.properties && Object.keys(t.parameters.properties).length > 0;
|
|
1333
|
+
if (!hasParams) {
|
|
1334
|
+
return `<div class="tool-item"><span class="tool-item-name">${escapeHtml(t.name)}</span> - <span class="tool-item-desc">${escapeHtml(t.description)}</span></div>`;
|
|
1335
|
+
}
|
|
1336
|
+
const params = t.parameters;
|
|
1337
|
+
const properties = params.properties;
|
|
1338
|
+
const required = params.required || [];
|
|
1339
|
+
let paramsHtml = '';
|
|
1340
|
+
for (const [name, prop] of Object.entries(properties)) {
|
|
1341
|
+
const isRequired = required.includes(name);
|
|
1342
|
+
const typeStr = prop.type || 'any';
|
|
1343
|
+
const reqLabel = isRequired ? '<span class="tool-param-required">required</span>' : '<span class="tool-param-optional">optional</span>';
|
|
1344
|
+
paramsHtml += `<div class="tool-param"><span class="tool-param-name">${escapeHtml(name)}</span> <span class="tool-param-type">${escapeHtml(typeStr)}</span> ${reqLabel}`;
|
|
1345
|
+
if (prop.description) {
|
|
1346
|
+
paramsHtml += `<div class="tool-param-desc">${escapeHtml(prop.description)}</div>`;
|
|
1347
|
+
}
|
|
1348
|
+
paramsHtml += `</div>`;
|
|
1349
|
+
}
|
|
1350
|
+
return `<div class="tool-item" onclick="this.classList.toggle('params-expanded')"><span class="tool-item-name">${escapeHtml(t.name)}</span> - <span class="tool-item-desc">${escapeHtml(t.description)}</span> <span class="tool-params-hint"></span><div class="tool-params-content">${paramsHtml}</div></div>`;
|
|
1351
|
+
}).join('')}
|
|
1352
|
+
</div>
|
|
1353
|
+
</div>`;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
return html;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// ============================================================
|
|
1360
|
+
// NAVIGATION
|
|
1361
|
+
// ============================================================
|
|
1362
|
+
|
|
1363
|
+
// Cache for rendered entry DOM nodes
|
|
1364
|
+
const entryCache = new Map();
|
|
1365
|
+
|
|
1366
|
+
function renderEntryToNode(entry) {
|
|
1367
|
+
// Check cache first
|
|
1368
|
+
if (entryCache.has(entry.id)) {
|
|
1369
|
+
return entryCache.get(entry.id).cloneNode(true);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// Render to HTML string, then parse to node
|
|
1373
|
+
const html = renderEntry(entry);
|
|
1374
|
+
if (!html) return null;
|
|
1375
|
+
|
|
1376
|
+
const template = document.createElement('template');
|
|
1377
|
+
template.innerHTML = html;
|
|
1378
|
+
const node = template.content.firstElementChild;
|
|
1379
|
+
|
|
1380
|
+
// Cache the node
|
|
1381
|
+
if (node) {
|
|
1382
|
+
entryCache.set(entry.id, node.cloneNode(true));
|
|
1383
|
+
}
|
|
1384
|
+
return node;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function navigateTo(targetId, scrollMode = 'target', scrollToEntryId = null) {
|
|
1388
|
+
currentLeafId = targetId;
|
|
1389
|
+
currentTargetId = scrollToEntryId || targetId;
|
|
1390
|
+
const path = getPath(targetId);
|
|
1391
|
+
|
|
1392
|
+
renderTree();
|
|
1393
|
+
|
|
1394
|
+
document.getElementById('header-container').innerHTML = renderHeader();
|
|
1395
|
+
|
|
1396
|
+
// Build messages using cached DOM nodes
|
|
1397
|
+
const messagesEl = document.getElementById('messages');
|
|
1398
|
+
const fragment = document.createDocumentFragment();
|
|
1399
|
+
|
|
1400
|
+
for (const entry of path) {
|
|
1401
|
+
const node = renderEntryToNode(entry);
|
|
1402
|
+
if (node) {
|
|
1403
|
+
fragment.appendChild(node);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
messagesEl.innerHTML = '';
|
|
1408
|
+
messagesEl.appendChild(fragment);
|
|
1409
|
+
|
|
1410
|
+
// Attach click handlers for copy-link buttons
|
|
1411
|
+
messagesEl.querySelectorAll('.copy-link-btn').forEach(btn => {
|
|
1412
|
+
btn.addEventListener('click', (e) => {
|
|
1413
|
+
e.stopPropagation();
|
|
1414
|
+
const entryId = btn.dataset.entryId;
|
|
1415
|
+
const shareUrl = buildShareUrl(entryId);
|
|
1416
|
+
copyToClipboard(shareUrl, btn);
|
|
1417
|
+
});
|
|
1418
|
+
});
|
|
1419
|
+
|
|
1420
|
+
// Use setTimeout(0) to ensure DOM is fully laid out before scrolling
|
|
1421
|
+
setTimeout(() => {
|
|
1422
|
+
const content = document.getElementById('content');
|
|
1423
|
+
if (scrollMode === 'bottom') {
|
|
1424
|
+
content.scrollTop = content.scrollHeight;
|
|
1425
|
+
} else if (scrollMode === 'target') {
|
|
1426
|
+
// If scrollToEntryId is provided, scroll to that specific entry
|
|
1427
|
+
const scrollTargetId = scrollToEntryId || targetId;
|
|
1428
|
+
const targetEl = document.getElementById(`entry-${scrollTargetId}`);
|
|
1429
|
+
if (targetEl) {
|
|
1430
|
+
targetEl.scrollIntoView({ block: 'center' });
|
|
1431
|
+
// Briefly highlight the target message
|
|
1432
|
+
if (scrollToEntryId) {
|
|
1433
|
+
targetEl.classList.add('highlight');
|
|
1434
|
+
setTimeout(() => targetEl.classList.remove('highlight'), 2000);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}, 0);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
// ============================================================
|
|
1442
|
+
// INITIALIZATION
|
|
1443
|
+
// ============================================================
|
|
1444
|
+
|
|
1445
|
+
// Escape HTML tags in text (but not code blocks)
|
|
1446
|
+
function escapeHtmlTags(text) {
|
|
1447
|
+
return text.replace(/<(?=[a-zA-Z\/])/g, '<');
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
// Configure marked with syntax highlighting and HTML escaping for text
|
|
1451
|
+
marked.use({
|
|
1452
|
+
breaks: true,
|
|
1453
|
+
gfm: true,
|
|
1454
|
+
renderer: {
|
|
1455
|
+
// Code blocks: syntax highlight, no HTML escaping
|
|
1456
|
+
code(token) {
|
|
1457
|
+
const code = token.text;
|
|
1458
|
+
const lang = token.lang;
|
|
1459
|
+
let highlighted;
|
|
1460
|
+
if (lang && hljs.getLanguage(lang)) {
|
|
1461
|
+
try {
|
|
1462
|
+
highlighted = hljs.highlight(code, { language: lang }).value;
|
|
1463
|
+
} catch {
|
|
1464
|
+
highlighted = escapeHtml(code);
|
|
1465
|
+
}
|
|
1466
|
+
} else {
|
|
1467
|
+
// Auto-detect language if not specified
|
|
1468
|
+
try {
|
|
1469
|
+
highlighted = hljs.highlightAuto(code).value;
|
|
1470
|
+
} catch {
|
|
1471
|
+
highlighted = escapeHtml(code);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
return `<pre><code class="hljs">${highlighted}</code></pre>`;
|
|
1475
|
+
},
|
|
1476
|
+
// Text content: escape HTML tags
|
|
1477
|
+
text(token) {
|
|
1478
|
+
return escapeHtmlTags(escapeHtml(token.text));
|
|
1479
|
+
},
|
|
1480
|
+
// Inline code: escape HTML
|
|
1481
|
+
codespan(token) {
|
|
1482
|
+
return `<code>${escapeHtml(token.text)}</code>`;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
|
|
1487
|
+
// Simple marked parse (escaping handled in renderers)
|
|
1488
|
+
function safeMarkedParse(text) {
|
|
1489
|
+
return marked.parse(text);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// Search input
|
|
1493
|
+
const searchInput = document.getElementById('tree-search');
|
|
1494
|
+
searchInput.addEventListener('input', (e) => {
|
|
1495
|
+
searchQuery = e.target.value;
|
|
1496
|
+
forceTreeRerender();
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
// Filter buttons
|
|
1500
|
+
document.querySelectorAll('.filter-btn').forEach(btn => {
|
|
1501
|
+
btn.addEventListener('click', () => {
|
|
1502
|
+
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
|
|
1503
|
+
btn.classList.add('active');
|
|
1504
|
+
filterMode = btn.dataset.filter;
|
|
1505
|
+
forceTreeRerender();
|
|
1506
|
+
});
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
// Sidebar toggle
|
|
1510
|
+
const sidebar = document.getElementById('sidebar');
|
|
1511
|
+
const overlay = document.getElementById('sidebar-overlay');
|
|
1512
|
+
const hamburger = document.getElementById('hamburger');
|
|
1513
|
+
const sidebarResizer = document.getElementById('sidebar-resizer');
|
|
1514
|
+
const SIDEBAR_WIDTH_STORAGE_KEY = 'pi-share:v1:sidebar-width';
|
|
1515
|
+
const MIN_CONTENT_WIDTH = 320;
|
|
1516
|
+
|
|
1517
|
+
function isMobileLayout() {
|
|
1518
|
+
return window.matchMedia('(max-width: 900px)').matches;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
function getSidebarBounds() {
|
|
1522
|
+
const rootStyles = getComputedStyle(document.documentElement);
|
|
1523
|
+
const minWidth = parseFloat(rootStyles.getPropertyValue('--sidebar-min-width')) || 240;
|
|
1524
|
+
const maxWidth = parseFloat(rootStyles.getPropertyValue('--sidebar-max-width')) || 720;
|
|
1525
|
+
const viewportMaxWidth = window.innerWidth - MIN_CONTENT_WIDTH;
|
|
1526
|
+
return {
|
|
1527
|
+
minWidth,
|
|
1528
|
+
maxWidth: Math.max(minWidth, Math.min(maxWidth, viewportMaxWidth))
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
function clampSidebarWidth(width) {
|
|
1533
|
+
const { minWidth, maxWidth } = getSidebarBounds();
|
|
1534
|
+
return Math.max(minWidth, Math.min(maxWidth, width));
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
function applySidebarWidth(width) {
|
|
1538
|
+
document.documentElement.style.setProperty('--sidebar-width', `${Math.round(clampSidebarWidth(width))}px`);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
function loadSidebarWidth() {
|
|
1542
|
+
try {
|
|
1543
|
+
const raw = localStorage.getItem(SIDEBAR_WIDTH_STORAGE_KEY);
|
|
1544
|
+
if (raw === null) return null;
|
|
1545
|
+
const width = Number(raw);
|
|
1546
|
+
return Number.isFinite(width) ? width : null;
|
|
1547
|
+
} catch {
|
|
1548
|
+
return null;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
function saveSidebarWidth(width) {
|
|
1553
|
+
try {
|
|
1554
|
+
localStorage.setItem(SIDEBAR_WIDTH_STORAGE_KEY, String(Math.round(clampSidebarWidth(width))));
|
|
1555
|
+
} catch {
|
|
1556
|
+
// Ignore storage failures (e.g. private browsing restrictions)
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
function setupSidebarResize() {
|
|
1561
|
+
const savedWidth = loadSidebarWidth();
|
|
1562
|
+
if (savedWidth !== null) {
|
|
1563
|
+
applySidebarWidth(savedWidth);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
if (!sidebarResizer) return;
|
|
1567
|
+
|
|
1568
|
+
let cleanupDrag = null;
|
|
1569
|
+
|
|
1570
|
+
const stopDrag = (pointerId) => {
|
|
1571
|
+
if (cleanupDrag) {
|
|
1572
|
+
cleanupDrag(pointerId);
|
|
1573
|
+
cleanupDrag = null;
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
sidebarResizer.addEventListener('pointerdown', (e) => {
|
|
1578
|
+
if (isMobileLayout()) return;
|
|
1579
|
+
|
|
1580
|
+
e.preventDefault();
|
|
1581
|
+
const startX = e.clientX;
|
|
1582
|
+
const startWidth = sidebar.getBoundingClientRect().width;
|
|
1583
|
+
document.body.classList.add('sidebar-resizing');
|
|
1584
|
+
sidebarResizer.setPointerCapture?.(e.pointerId);
|
|
1585
|
+
|
|
1586
|
+
const onPointerMove = (event) => {
|
|
1587
|
+
applySidebarWidth(startWidth + (event.clientX - startX));
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
cleanupDrag = (pointerIdToRelease) => {
|
|
1591
|
+
document.body.classList.remove('sidebar-resizing');
|
|
1592
|
+
sidebarResizer.releasePointerCapture?.(pointerIdToRelease);
|
|
1593
|
+
window.removeEventListener('pointermove', onPointerMove);
|
|
1594
|
+
window.removeEventListener('pointerup', onPointerUp);
|
|
1595
|
+
window.removeEventListener('pointercancel', onPointerCancel);
|
|
1596
|
+
saveSidebarWidth(sidebar.getBoundingClientRect().width);
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
const onPointerUp = (event) => stopDrag(event.pointerId);
|
|
1600
|
+
const onPointerCancel = (event) => stopDrag(event.pointerId);
|
|
1601
|
+
|
|
1602
|
+
window.addEventListener('pointermove', onPointerMove);
|
|
1603
|
+
window.addEventListener('pointerup', onPointerUp);
|
|
1604
|
+
window.addEventListener('pointercancel', onPointerCancel);
|
|
1605
|
+
});
|
|
1606
|
+
|
|
1607
|
+
sidebarResizer.addEventListener('dblclick', () => {
|
|
1608
|
+
if (isMobileLayout()) return;
|
|
1609
|
+
applySidebarWidth(400);
|
|
1610
|
+
saveSidebarWidth(400);
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
window.addEventListener('resize', () => {
|
|
1614
|
+
if (isMobileLayout()) return;
|
|
1615
|
+
applySidebarWidth(sidebar.getBoundingClientRect().width);
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
setupSidebarResize();
|
|
1620
|
+
|
|
1621
|
+
hamburger.addEventListener('click', () => {
|
|
1622
|
+
sidebar.classList.add('open');
|
|
1623
|
+
overlay.classList.add('open');
|
|
1624
|
+
hamburger.style.display = 'none';
|
|
1625
|
+
});
|
|
1626
|
+
|
|
1627
|
+
const closeSidebar = () => {
|
|
1628
|
+
sidebar.classList.remove('open');
|
|
1629
|
+
overlay.classList.remove('open');
|
|
1630
|
+
hamburger.style.display = '';
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1633
|
+
overlay.addEventListener('click', closeSidebar);
|
|
1634
|
+
document.getElementById('sidebar-close').addEventListener('click', closeSidebar);
|
|
1635
|
+
|
|
1636
|
+
// Toggle states
|
|
1637
|
+
let thinkingExpanded = true;
|
|
1638
|
+
let toolOutputsExpanded = false;
|
|
1639
|
+
|
|
1640
|
+
const toggleThinking = () => {
|
|
1641
|
+
thinkingExpanded = !thinkingExpanded;
|
|
1642
|
+
document.querySelectorAll('.thinking-text').forEach(el => {
|
|
1643
|
+
el.style.display = thinkingExpanded ? '' : 'none';
|
|
1644
|
+
});
|
|
1645
|
+
document.querySelectorAll('.thinking-collapsed').forEach(el => {
|
|
1646
|
+
el.style.display = thinkingExpanded ? 'none' : 'block';
|
|
1647
|
+
});
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1650
|
+
const toggleToolOutputs = () => {
|
|
1651
|
+
toolOutputsExpanded = !toolOutputsExpanded;
|
|
1652
|
+
document.querySelectorAll('.tool-output.expandable').forEach(el => {
|
|
1653
|
+
el.classList.toggle('expanded', toolOutputsExpanded);
|
|
1654
|
+
});
|
|
1655
|
+
document.querySelectorAll('.compaction').forEach(el => {
|
|
1656
|
+
el.classList.toggle('expanded', toolOutputsExpanded);
|
|
1657
|
+
});
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
// Keyboard shortcuts
|
|
1661
|
+
document.addEventListener('keydown', (e) => {
|
|
1662
|
+
if (e.key === 'Escape') {
|
|
1663
|
+
searchInput.value = '';
|
|
1664
|
+
searchQuery = '';
|
|
1665
|
+
navigateTo(leafId, 'bottom');
|
|
1666
|
+
}
|
|
1667
|
+
if (e.ctrlKey && e.key === 't') {
|
|
1668
|
+
e.preventDefault();
|
|
1669
|
+
toggleThinking();
|
|
1670
|
+
}
|
|
1671
|
+
if (e.ctrlKey && e.key === 'o') {
|
|
1672
|
+
e.preventDefault();
|
|
1673
|
+
toggleToolOutputs();
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1676
|
+
|
|
1677
|
+
// Initial render
|
|
1678
|
+
// If URL has targetId, scroll to that specific message; otherwise stay at top
|
|
1679
|
+
if (leafId) {
|
|
1680
|
+
if (urlTargetId && byId.has(urlTargetId)) {
|
|
1681
|
+
// Deep link: navigate to leaf and scroll to target message
|
|
1682
|
+
navigateTo(leafId, 'target', urlTargetId);
|
|
1683
|
+
} else {
|
|
1684
|
+
navigateTo(leafId, 'none');
|
|
1685
|
+
}
|
|
1686
|
+
} else if (entries.length > 0) {
|
|
1687
|
+
// Fallback: use last entry if no leafId
|
|
1688
|
+
navigateTo(entries[entries.length - 1].id, 'none');
|
|
1689
|
+
}
|
|
1690
|
+
})();
|