apex-code 0.0.1-alpha.0 → 0.0.1-alpha.2
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/CHANGELOG.md +24 -0
- package/README.md +66 -681
- package/dist/cli/args.d.ts +5 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +45 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +3 -3
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/cost-command.d.ts +19 -0
- package/dist/cli/cost-command.d.ts.map +1 -0
- package/dist/cli/cost-command.js +107 -0
- package/dist/cli/cost-command.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -2
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +45 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -7
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +2 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +9 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +30 -4
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +46 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +137 -19
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +6 -6
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/context/deferred-schemas.d.ts +92 -0
- package/dist/core/context/deferred-schemas.d.ts.map +1 -0
- package/dist/core/context/deferred-schemas.js +74 -0
- package/dist/core/context/deferred-schemas.js.map +1 -0
- package/dist/core/context/eviction.d.ts +47 -0
- package/dist/core/context/eviction.d.ts.map +1 -0
- package/dist/core/context/eviction.js +83 -0
- package/dist/core/context/eviction.js.map +1 -0
- package/dist/core/context/pipeline.d.ts +90 -0
- package/dist/core/context/pipeline.d.ts.map +1 -0
- package/dist/core/context/pipeline.js +109 -0
- package/dist/core/context/pipeline.js.map +1 -0
- package/dist/core/credential-failover.d.ts +30 -0
- package/dist/core/credential-failover.d.ts.map +1 -0
- package/dist/core/credential-failover.js +46 -0
- package/dist/core/credential-failover.js.map +1 -0
- package/dist/core/credential-pool.d.ts +60 -0
- package/dist/core/credential-pool.d.ts.map +1 -0
- package/dist/core/credential-pool.js +84 -0
- package/dist/core/credential-pool.js.map +1 -0
- package/dist/core/delegation/agents.d.ts +15 -0
- package/dist/core/delegation/agents.d.ts.map +1 -0
- package/dist/core/delegation/agents.js +55 -0
- package/dist/core/delegation/agents.js.map +1 -0
- package/dist/core/delegation/ceiling.d.ts +29 -0
- package/dist/core/delegation/ceiling.d.ts.map +1 -0
- package/dist/core/delegation/ceiling.js +34 -0
- package/dist/core/delegation/ceiling.js.map +1 -0
- package/dist/core/delegation/runtime.d.ts +94 -0
- package/dist/core/delegation/runtime.d.ts.map +1 -0
- package/dist/core/delegation/runtime.js +117 -0
- package/dist/core/delegation/runtime.js.map +1 -0
- package/dist/core/durable-state/daemon.d.ts +37 -0
- package/dist/core/durable-state/daemon.d.ts.map +1 -0
- package/dist/core/durable-state/daemon.js +62 -0
- package/dist/core/durable-state/daemon.js.map +1 -0
- package/dist/core/durable-state/provenance.d.ts +7 -0
- package/dist/core/durable-state/provenance.d.ts.map +1 -0
- package/dist/core/durable-state/provenance.js +24 -0
- package/dist/core/durable-state/provenance.js.map +1 -0
- package/dist/core/durable-state/sqlite.d.ts +84 -0
- package/dist/core/durable-state/sqlite.d.ts.map +1 -0
- package/dist/core/durable-state/sqlite.js +331 -0
- package/dist/core/durable-state/sqlite.js.map +1 -0
- package/dist/core/environment.d.ts +12 -0
- package/dist/core/environment.d.ts.map +1 -0
- package/dist/core/environment.js +69 -0
- package/dist/core/environment.js.map +1 -0
- package/dist/core/evidence-policy.d.ts +17 -0
- package/dist/core/evidence-policy.d.ts.map +1 -0
- package/dist/core/evidence-policy.js +25 -0
- package/dist/core/evidence-policy.js.map +1 -0
- package/dist/core/evidence.d.ts +16 -0
- package/dist/core/evidence.d.ts.map +1 -0
- package/dist/core/evidence.js +51 -0
- package/dist/core/evidence.js.map +1 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +2 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-config.d.ts +8 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +21 -5
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +20 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +59 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +73 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +225 -8
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/observability/aggregate.d.ts +21 -0
- package/dist/core/observability/aggregate.d.ts.map +1 -0
- package/dist/core/observability/aggregate.js +36 -0
- package/dist/core/observability/aggregate.js.map +1 -0
- package/dist/core/observability/otlp.d.ts +66 -0
- package/dist/core/observability/otlp.d.ts.map +1 -0
- package/dist/core/observability/otlp.js +95 -0
- package/dist/core/observability/otlp.js.map +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +3 -2
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions/gate.d.ts +35 -0
- package/dist/core/permissions/gate.d.ts.map +1 -0
- package/dist/core/permissions/gate.js +72 -0
- package/dist/core/permissions/gate.js.map +1 -0
- package/dist/core/permissions/modes.d.ts +18 -0
- package/dist/core/permissions/modes.d.ts.map +1 -0
- package/dist/core/permissions/modes.js +57 -0
- package/dist/core/permissions/modes.js.map +1 -0
- package/dist/core/permissions/responder.d.ts +30 -0
- package/dist/core/permissions/responder.d.ts.map +1 -0
- package/dist/core/permissions/responder.js +32 -0
- package/dist/core/permissions/responder.js.map +1 -0
- package/dist/core/permissions/rules.d.ts +34 -0
- package/dist/core/permissions/rules.d.ts.map +1 -0
- package/dist/core/permissions/rules.js +74 -0
- package/dist/core/permissions/rules.js.map +1 -0
- package/dist/core/permissions/startup.d.ts +33 -0
- package/dist/core/permissions/startup.d.ts.map +1 -0
- package/dist/core/permissions/startup.js +55 -0
- package/dist/core/permissions/startup.js.map +1 -0
- package/dist/core/permissions/store.d.ts +114 -0
- package/dist/core/permissions/store.d.ts.map +1 -0
- package/dist/core/permissions/store.js +229 -0
- package/dist/core/permissions/store.js.map +1 -0
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js +6 -7
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +2 -2
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +20 -16
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/sandbox/child-entry.d.ts +2 -0
- package/dist/core/sandbox/child-entry.d.ts.map +1 -0
- package/dist/core/sandbox/child-entry.js +11 -0
- package/dist/core/sandbox/child-entry.js.map +1 -0
- package/dist/core/sandbox/cli-launch.d.ts +27 -0
- package/dist/core/sandbox/cli-launch.d.ts.map +1 -0
- package/dist/core/sandbox/cli-launch.js +133 -0
- package/dist/core/sandbox/cli-launch.js.map +1 -0
- package/dist/core/sandbox/cli-supervisor.d.ts +25 -0
- package/dist/core/sandbox/cli-supervisor.d.ts.map +1 -0
- package/dist/core/sandbox/cli-supervisor.js +57 -0
- package/dist/core/sandbox/cli-supervisor.js.map +1 -0
- package/dist/core/sandbox/linux-backend.d.ts +18 -0
- package/dist/core/sandbox/linux-backend.d.ts.map +1 -0
- package/dist/core/sandbox/linux-backend.js +186 -0
- package/dist/core/sandbox/linux-backend.js.map +1 -0
- package/dist/core/sandbox/macos-backend.d.ts +18 -0
- package/dist/core/sandbox/macos-backend.d.ts.map +1 -0
- package/dist/core/sandbox/macos-backend.js +195 -0
- package/dist/core/sandbox/macos-backend.js.map +1 -0
- package/dist/core/sandbox/network-proxy.d.ts +19 -0
- package/dist/core/sandbox/network-proxy.d.ts.map +1 -0
- package/dist/core/sandbox/network-proxy.js +79 -0
- package/dist/core/sandbox/network-proxy.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +32 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +38 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/supervisor.d.ts +31 -0
- package/dist/core/sandbox/supervisor.d.ts.map +1 -0
- package/dist/core/sandbox/supervisor.js +18 -0
- package/dist/core/sandbox/supervisor.js.map +1 -0
- package/dist/core/sandbox/violations.d.ts +23 -0
- package/dist/core/sandbox/violations.d.ts.map +1 -0
- package/dist/core/sandbox/violations.js +30 -0
- package/dist/core/sandbox/violations.js.map +1 -0
- package/dist/core/sdk.d.ts +20 -36
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +129 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +41 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +57 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-share.d.ts +16 -0
- package/dist/core/session-share.d.ts.map +1 -0
- package/dist/core/session-share.js +22 -0
- package/dist/core/session-share.js.map +1 -0
- package/dist/core/settings-manager.d.ts +38 -9
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +39 -24
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -5
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/timings.d.ts +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +3 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/ask-user.d.ts +25 -0
- package/dist/core/tools/ask-user.d.ts.map +1 -0
- package/dist/core/tools/ask-user.js +49 -0
- package/dist/core/tools/ask-user.js.map +1 -0
- package/dist/core/tools/bash-command-segments.d.ts +22 -0
- package/dist/core/tools/bash-command-segments.d.ts.map +1 -0
- package/dist/core/tools/bash-command-segments.js +128 -0
- package/dist/core/tools/bash-command-segments.js.map +1 -0
- package/dist/core/tools/bash.d.ts +26 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +105 -16
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/contract.d.ts +156 -0
- package/dist/core/tools/contract.d.ts.map +1 -0
- package/dist/core/tools/contract.js +48 -0
- package/dist/core/tools/contract.js.map +1 -0
- package/dist/core/tools/delegate.d.ts +38 -0
- package/dist/core/tools/delegate.d.ts.map +1 -0
- package/dist/core/tools/delegate.js +66 -0
- package/dist/core/tools/delegate.js.map +1 -0
- package/dist/core/tools/edit.d.ts +2 -2
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +24 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +12 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +12 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +29 -4
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +118 -2
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +12 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-permission.d.ts +18 -0
- package/dist/core/tools/path-permission.d.ts.map +1 -0
- package/dist/core/tools/path-permission.js +28 -0
- package/dist/core/tools/path-permission.js.map +1 -0
- package/dist/core/tools/plan-present.d.ts +27 -0
- package/dist/core/tools/plan-present.d.ts.map +1 -0
- package/dist/core/tools/plan-present.js +55 -0
- package/dist/core/tools/plan-present.js.map +1 -0
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +12 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/test.d.ts +34 -0
- package/dist/core/tools/test.d.ts.map +1 -0
- package/dist/core/tools/test.js +75 -0
- package/dist/core/tools/test.js.map +1 -0
- package/dist/core/tools/todo-write.d.ts +31 -0
- package/dist/core/tools/todo-write.d.ts.map +1 -0
- package/dist/core/tools/todo-write.js +51 -0
- package/dist/core/tools/todo-write.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +13 -2
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +11 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/tool-schema.d.ts +22 -0
- package/dist/core/tools/tool-schema.d.ts.map +1 -0
- package/dist/core/tools/tool-schema.js +45 -0
- package/dist/core/tools/tool-schema.js.map +1 -0
- package/dist/core/tools/web-fetch.d.ts +26 -0
- package/dist/core/tools/web-fetch.d.ts.map +1 -0
- package/dist/core/tools/web-fetch.js +62 -0
- package/dist/core/tools/web-fetch.js.map +1 -0
- package/dist/core/tools/web-search.d.ts +26 -0
- package/dist/core/tools/web-search.d.ts.map +1 -0
- package/dist/core/tools/web-search.js +53 -0
- package/dist/core/tools/web-search.js.map +1 -0
- package/dist/core/tools/write.d.ts +6 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +32 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-performance-store.d.ts +56 -0
- package/dist/core/usage-performance-store.d.ts.map +1 -0
- package/dist/core/usage-performance-store.js +85 -0
- package/dist/core/usage-performance-store.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +48 -6
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +9 -6
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +11 -39
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +8 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +49 -20
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +6 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +58 -9
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -3
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +92 -104
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +2 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +15 -10
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/rpc-entry.d.ts.map +1 -1
- package/dist/rpc-entry.js +2 -1
- package/dist/rpc-entry.js.map +1 -1
- package/dist/server/create-harness.d.ts +1 -1
- package/dist/server/create-harness.d.ts.map +1 -1
- package/dist/server/create-harness.js +6 -5
- package/dist/server/create-harness.js.map +1 -1
- package/dist/testing/replay/metrics.d.ts +24 -0
- package/dist/testing/replay/metrics.d.ts.map +1 -0
- package/dist/testing/replay/metrics.js +35 -0
- package/dist/testing/replay/metrics.js.map +1 -0
- package/dist/testing/replay/recorded-provider.d.ts +10 -0
- package/dist/testing/replay/recorded-provider.d.ts.map +1 -0
- package/dist/testing/replay/recorded-provider.js +108 -0
- package/dist/testing/replay/recorded-provider.js.map +1 -0
- package/dist/testing/replay/runner.d.ts +56 -0
- package/dist/testing/replay/runner.d.ts.map +1 -0
- package/dist/testing/replay/runner.js +406 -0
- package/dist/testing/replay/runner.js.map +1 -0
- package/dist/utils/apex-code-user-agent.d.ts +2 -0
- package/dist/utils/apex-code-user-agent.d.ts.map +1 -0
- package/dist/utils/apex-code-user-agent.js +5 -0
- package/dist/utils/apex-code-user-agent.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +32 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +198 -100
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +5 -5
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +23 -14
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/docs/compaction.md +21 -21
- package/docs/containerization.md +24 -21
- package/docs/custom-provider.md +9 -9
- package/docs/development.md +11 -11
- package/docs/environment-variables.md +36 -77
- package/docs/extensions.md +47 -47
- package/docs/index.md +12 -24
- package/docs/json.md +6 -6
- package/docs/keybindings.md +3 -3
- package/docs/llama-cpp.md +7 -7
- package/docs/models.md +11 -11
- package/docs/packages.md +46 -42
- package/docs/prompt-templates.md +3 -3
- package/docs/providers.md +10 -10
- package/docs/quickstart.md +49 -32
- package/docs/rpc.md +11 -11
- package/docs/sdk.md +4 -4
- package/docs/security.md +18 -18
- package/docs/session-format.md +9 -9
- package/docs/sessions.md +13 -13
- package/docs/settings.md +10 -14
- package/docs/shell-aliases.md +1 -1
- package/docs/skills.md +8 -8
- package/docs/terminal-setup.md +12 -12
- package/docs/termux.md +4 -4
- package/docs/themes.md +8 -8
- package/docs/tmux.md +4 -4
- package/docs/tui.md +3 -3
- package/docs/usage.md +54 -51
- package/docs/windows.md +1 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -3
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js +0 -9
- package/dist/core/telemetry.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js +0 -5
- package/dist/utils/pi-user-agent.js.map +0 -1
|
@@ -14,17 +14,19 @@ import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebu
|
|
|
14
14
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
15
15
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
16
16
|
import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, } from "../../core/cache-stats.js";
|
|
17
|
+
import { getApexEnvironment } from "../../core/environment.js";
|
|
17
18
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
18
19
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
19
20
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
20
21
|
import { createCompactionSummaryMessage } from "../../core/messages.js";
|
|
21
22
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
|
|
22
23
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
24
|
+
import { aggregateUsagePerformance } from "../../core/observability/aggregate.js";
|
|
23
25
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
24
26
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
25
27
|
import { SessionManager, sessionEntryToContextMessages } from "../../core/session-manager.js";
|
|
28
|
+
import { publishSessionShare } from "../../core/session-share.js";
|
|
26
29
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
27
|
-
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
28
30
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
29
31
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
30
32
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
@@ -33,10 +35,9 @@ import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipb
|
|
|
33
35
|
import { parseGitUrl } from "../../utils/git.js";
|
|
34
36
|
import { openBrowser } from "../../utils/open-browser.js";
|
|
35
37
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
36
|
-
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
37
38
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
38
39
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
39
|
-
import {
|
|
40
|
+
import { checkForNewApexCodeVersion } from "../../utils/version-check.js";
|
|
40
41
|
import { ArminComponent } from "./components/armin.js";
|
|
41
42
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
42
43
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
@@ -366,7 +367,7 @@ export class InteractiveMode {
|
|
|
366
367
|
this.editorContainer = new Container();
|
|
367
368
|
this.editorContainer.addChild(this.editor);
|
|
368
369
|
this.footerDataProvider = new FooterDataProvider(this.sessionManager.getCwd());
|
|
369
|
-
this.footer = new FooterComponent(this.session, this.footerDataProvider);
|
|
370
|
+
this.footer = new FooterComponent(this.session, this.footerDataProvider, this.settingsManager);
|
|
370
371
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
371
372
|
this.footerContainer = new Container();
|
|
372
373
|
this.footerContainer.addChild(this.footer);
|
|
@@ -690,7 +691,7 @@ export class InteractiveMode {
|
|
|
690
691
|
hint("app.tools.expand", "more"),
|
|
691
692
|
].join(theme.fg("muted", " · "));
|
|
692
693
|
const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
|
|
693
|
-
const onboarding = theme.fg("dim", `
|
|
694
|
+
const onboarding = theme.fg("dim", `Apex Code can explain its own features and look up its docs. Ask it how to use or extend Apex Code.`);
|
|
694
695
|
this.builtInHeader = new ExpandableText(() => `${logo}\n${compactInstructions}\n${compactOnboarding}\n\n${onboarding}`, () => `${logo}\n${expandedInstructions}\n\n${onboarding}`, this.getStartupExpansionState(), 1, 0);
|
|
695
696
|
// Setup UI layout
|
|
696
697
|
this.headerContainer.addChild(new Spacer(1));
|
|
@@ -739,7 +740,7 @@ export class InteractiveMode {
|
|
|
739
740
|
*/
|
|
740
741
|
async run() {
|
|
741
742
|
await this.init();
|
|
742
|
-
if (!
|
|
743
|
+
if (!getApexEnvironment("APEX_CODE_OFFLINE")) {
|
|
743
744
|
const controller = new AbortController();
|
|
744
745
|
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
745
746
|
void this.session.modelRuntime
|
|
@@ -749,7 +750,7 @@ export class InteractiveMode {
|
|
|
749
750
|
.finally(() => clearTimeout(timeout));
|
|
750
751
|
}
|
|
751
752
|
// Start version check asynchronously
|
|
752
|
-
|
|
753
|
+
checkForNewApexCodeVersion(this.version).then((newRelease) => {
|
|
753
754
|
if (newRelease) {
|
|
754
755
|
this.showNewVersionNotification(newRelease);
|
|
755
756
|
}
|
|
@@ -821,7 +822,7 @@ export class InteractiveMode {
|
|
|
821
822
|
}
|
|
822
823
|
}
|
|
823
824
|
async checkForPackageUpdates() {
|
|
824
|
-
if (
|
|
825
|
+
if (getApexEnvironment("APEX_CODE_OFFLINE")) {
|
|
825
826
|
return [];
|
|
826
827
|
}
|
|
827
828
|
try {
|
|
@@ -874,7 +875,7 @@ export class InteractiveMode {
|
|
|
874
875
|
return "tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.";
|
|
875
876
|
}
|
|
876
877
|
if (extendedKeysFormat === "xterm") {
|
|
877
|
-
return "tmux extended-keys-format is xterm.
|
|
878
|
+
return "tmux extended-keys-format is xterm. Apex Code works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.";
|
|
878
879
|
}
|
|
879
880
|
return undefined;
|
|
880
881
|
}
|
|
@@ -891,35 +892,17 @@ export class InteractiveMode {
|
|
|
891
892
|
const changelogPath = getChangelogPath();
|
|
892
893
|
const entries = parseChangelog(changelogPath);
|
|
893
894
|
if (!lastVersion) {
|
|
894
|
-
// Fresh install - record the version,
|
|
895
|
+
// Fresh install - record the version, don't show changelog
|
|
895
896
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
896
|
-
this.reportInstallTelemetry(VERSION);
|
|
897
897
|
return undefined;
|
|
898
898
|
}
|
|
899
899
|
const newEntries = getNewEntries(entries, lastVersion);
|
|
900
900
|
if (newEntries.length > 0) {
|
|
901
901
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
902
|
-
this.reportInstallTelemetry(VERSION);
|
|
903
902
|
return newEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
|
|
904
903
|
}
|
|
905
904
|
return undefined;
|
|
906
905
|
}
|
|
907
|
-
reportInstallTelemetry(version) {
|
|
908
|
-
if (process.env.PI_OFFLINE) {
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
if (!isInstallTelemetryEnabled(this.settingsManager)) {
|
|
912
|
-
return;
|
|
913
|
-
}
|
|
914
|
-
void fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`, {
|
|
915
|
-
headers: {
|
|
916
|
-
"User-Agent": getPiUserAgent(version),
|
|
917
|
-
},
|
|
918
|
-
signal: AbortSignal.timeout(5000),
|
|
919
|
-
})
|
|
920
|
-
.then(() => undefined)
|
|
921
|
-
.catch(() => undefined);
|
|
922
|
-
}
|
|
923
906
|
getMarkdownThemeWithSettings() {
|
|
924
907
|
return {
|
|
925
908
|
...getMarkdownTheme(),
|
|
@@ -2274,7 +2257,7 @@ export class InteractiveMode {
|
|
|
2274
2257
|
if (image) {
|
|
2275
2258
|
const tmpDir = os.tmpdir();
|
|
2276
2259
|
const ext = extensionForImageMimeType(image.mimeType) ?? "png";
|
|
2277
|
-
const fileName = `
|
|
2260
|
+
const fileName = `apex-code-clipboard-${crypto.randomUUID()}.${ext}`;
|
|
2278
2261
|
const filePath = path.join(tmpDir, fileName);
|
|
2279
2262
|
fs.writeFileSync(filePath, Buffer.from(image.bytes));
|
|
2280
2263
|
this.editor.insertTextAtCursor?.(filePath);
|
|
@@ -2339,7 +2322,7 @@ export class InteractiveMode {
|
|
|
2339
2322
|
return;
|
|
2340
2323
|
}
|
|
2341
2324
|
if (text === "/session") {
|
|
2342
|
-
this.handleSessionCommand();
|
|
2325
|
+
await this.handleSessionCommand();
|
|
2343
2326
|
this.editor.setText("");
|
|
2344
2327
|
return;
|
|
2345
2328
|
}
|
|
@@ -3024,7 +3007,7 @@ export class InteractiveMode {
|
|
|
3024
3007
|
if (this.chatContainer.children.length > 0) {
|
|
3025
3008
|
this.chatContainer.addChild(new Spacer(1));
|
|
3026
3009
|
}
|
|
3027
|
-
this.chatContainer.addChild(new Text(theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart
|
|
3010
|
+
this.chatContainer.addChild(new Text(theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart apex-code.`), 1, 0));
|
|
3028
3011
|
}
|
|
3029
3012
|
async getUserInput() {
|
|
3030
3013
|
const queuedInput = this.pendingUserInputs.shift();
|
|
@@ -3137,7 +3120,7 @@ export class InteractiveMode {
|
|
|
3137
3120
|
this.ui.stop();
|
|
3138
3121
|
}
|
|
3139
3122
|
catch { }
|
|
3140
|
-
console.error("
|
|
3123
|
+
console.error("apex-code exiting due to uncaughtException:");
|
|
3141
3124
|
console.error(error);
|
|
3142
3125
|
process.exit(1);
|
|
3143
3126
|
}
|
|
@@ -3374,7 +3357,7 @@ export class InteractiveMode {
|
|
|
3374
3357
|
showNewVersionNotification(release) {
|
|
3375
3358
|
const action = theme.fg("accent", `${APP_NAME} update`);
|
|
3376
3359
|
const updateInstruction = theme.fg("muted", `New version ${release.version} is available. Run `) + action;
|
|
3377
|
-
const changelogUrl = "https://
|
|
3360
|
+
const changelogUrl = "https://github.com/Fchery87/apex-code/blob/main/packages/coding-agent/CHANGELOG.md";
|
|
3378
3361
|
const changelogLink = getCapabilities().hyperlinks
|
|
3379
3362
|
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
3380
3363
|
: theme.fg("accent", changelogUrl);
|
|
@@ -3628,7 +3611,7 @@ export class InteractiveMode {
|
|
|
3628
3611
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
3629
3612
|
mermaidRenderingMode: this.settingsManager.getMermaidRenderingMode(),
|
|
3630
3613
|
collapseChangelog: this.settingsManager.getCollapseChangelog(),
|
|
3631
|
-
|
|
3614
|
+
sendProviderAttribution: this.settingsManager.getSendProviderAttribution(),
|
|
3632
3615
|
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
|
|
3633
3616
|
treeFilterMode: this.settingsManager.getTreeFilterMode(),
|
|
3634
3617
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
@@ -3722,8 +3705,8 @@ export class InteractiveMode {
|
|
|
3722
3705
|
onCollapseChangelogChange: (collapsed) => {
|
|
3723
3706
|
this.settingsManager.setCollapseChangelog(collapsed);
|
|
3724
3707
|
},
|
|
3725
|
-
|
|
3726
|
-
this.settingsManager.
|
|
3708
|
+
onSendProviderAttributionChange: (enabled) => {
|
|
3709
|
+
this.settingsManager.setSendProviderAttribution(enabled);
|
|
3727
3710
|
},
|
|
3728
3711
|
onQuietStartupChange: (enabled) => {
|
|
3729
3712
|
this.settingsManager.setQuietStartup(enabled);
|
|
@@ -4590,7 +4573,7 @@ export class InteractiveMode {
|
|
|
4590
4573
|
this.ui.requestRender();
|
|
4591
4574
|
};
|
|
4592
4575
|
const dialog = new LoginDialogComponent(this.ui, providerOption.id, () => restoreEditor(), providerOption.name, `${providerOption.name} setup`);
|
|
4593
|
-
dialog.showInfo(`${providerOption.method?.name ?? "Authentication"} is configured outside
|
|
4576
|
+
dialog.showInfo(`${providerOption.method?.name ?? "Authentication"} is configured outside Apex Code.`, [], true);
|
|
4594
4577
|
this.editorContainer.clear();
|
|
4595
4578
|
this.editorContainer.addChild(dialog);
|
|
4596
4579
|
this.ui.setFocus(dialog);
|
|
@@ -4903,7 +4886,7 @@ export class InteractiveMode {
|
|
|
4903
4886
|
}
|
|
4904
4887
|
}
|
|
4905
4888
|
async handleShareCommand() {
|
|
4906
|
-
// Check
|
|
4889
|
+
// Check before confirmation so a user without a working GitHub CLI gets an actionable error.
|
|
4907
4890
|
try {
|
|
4908
4891
|
const authResult = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
|
|
4909
4892
|
if (authResult.status !== 0) {
|
|
@@ -4915,77 +4898,62 @@ export class InteractiveMode {
|
|
|
4915
4898
|
this.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");
|
|
4916
4899
|
return;
|
|
4917
4900
|
}
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
try {
|
|
4921
|
-
await this.session.exportToHtml(tmpFile);
|
|
4922
|
-
}
|
|
4923
|
-
catch (error) {
|
|
4924
|
-
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4925
|
-
return;
|
|
4926
|
-
}
|
|
4927
|
-
// Show cancellable loader, replacing the editor
|
|
4928
|
-
const loader = new BorderedLoader(this.ui, theme, "Creating gist...");
|
|
4929
|
-
this.editorContainer.clear();
|
|
4930
|
-
this.editorContainer.addChild(loader);
|
|
4931
|
-
this.ui.setFocus(loader);
|
|
4932
|
-
this.ui.requestRender();
|
|
4933
|
-
const restoreEditor = () => {
|
|
4934
|
-
loader.dispose();
|
|
4935
|
-
this.editorContainer.clear();
|
|
4936
|
-
this.editorContainer.addChild(this.editor);
|
|
4937
|
-
this.ui.setFocus(this.editor);
|
|
4938
|
-
try {
|
|
4939
|
-
fs.unlinkSync(tmpFile);
|
|
4940
|
-
}
|
|
4941
|
-
catch {
|
|
4942
|
-
// Ignore cleanup errors
|
|
4943
|
-
}
|
|
4944
|
-
};
|
|
4945
|
-
// Create a secret gist asynchronously
|
|
4946
|
-
let proc = null;
|
|
4947
|
-
loader.onAbort = () => {
|
|
4948
|
-
proc?.kill();
|
|
4949
|
-
restoreEditor();
|
|
4950
|
-
this.showStatus("Share cancelled");
|
|
4951
|
-
};
|
|
4901
|
+
let loader;
|
|
4902
|
+
let proc;
|
|
4952
4903
|
try {
|
|
4953
|
-
const result = await
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4904
|
+
const result = await publishSessionShare({
|
|
4905
|
+
confirm: () => this.showExtensionConfirm("Publish session to GitHub?", "This uploads a complete HTML export to a secret GitHub Gist. Secret Gists are unlisted, not private or access-controlled; anyone with the URL can read the transcript, prompts, tool activity, and included file content. Review a local /export first if needed."),
|
|
4906
|
+
exportToHtml: async (exportPath) => {
|
|
4907
|
+
await this.session.exportToHtml(exportPath);
|
|
4908
|
+
},
|
|
4909
|
+
publishGist: (exportPath) => new Promise((resolve, reject) => {
|
|
4910
|
+
loader = new BorderedLoader(this.ui, theme, "Creating secret GitHub Gist...");
|
|
4911
|
+
this.editorContainer.clear();
|
|
4912
|
+
this.editorContainer.addChild(loader);
|
|
4913
|
+
this.ui.setFocus(loader);
|
|
4914
|
+
this.ui.requestRender();
|
|
4915
|
+
loader.onAbort = () => proc?.kill();
|
|
4916
|
+
proc = spawn("gh", ["gist", "create", "--public=false", exportPath]);
|
|
4917
|
+
let stdout = "";
|
|
4918
|
+
let stderr = "";
|
|
4919
|
+
proc.stdout?.on("data", (data) => {
|
|
4920
|
+
stdout += data.toString();
|
|
4921
|
+
});
|
|
4922
|
+
proc.stderr?.on("data", (data) => {
|
|
4923
|
+
stderr += data.toString();
|
|
4924
|
+
});
|
|
4925
|
+
proc.on("error", reject);
|
|
4926
|
+
proc.on("close", (code) => {
|
|
4927
|
+
if (loader?.signal.aborted)
|
|
4928
|
+
reject(new Error("Share cancelled"));
|
|
4929
|
+
else if (code !== 0)
|
|
4930
|
+
reject(new Error(stderr.trim() || "Unknown GitHub CLI error"));
|
|
4931
|
+
else
|
|
4932
|
+
resolve(stdout);
|
|
4933
|
+
});
|
|
4934
|
+
}),
|
|
4964
4935
|
});
|
|
4965
|
-
if (
|
|
4966
|
-
|
|
4967
|
-
restoreEditor();
|
|
4968
|
-
if (result.code !== 0) {
|
|
4969
|
-
const errorMsg = result.stderr?.trim() || "Unknown error";
|
|
4970
|
-
this.showError(`Failed to create gist: ${errorMsg}`);
|
|
4936
|
+
if (result.kind === "cancelled") {
|
|
4937
|
+
this.showStatus("Share cancelled");
|
|
4971
4938
|
return;
|
|
4972
4939
|
}
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
if (!gistId) {
|
|
4978
|
-
this.showError("Failed to parse gist ID from gh output");
|
|
4979
|
-
return;
|
|
4980
|
-
}
|
|
4981
|
-
// Create the preview URL
|
|
4982
|
-
const previewUrl = getShareViewerUrl(gistId);
|
|
4983
|
-
this.showStatus(`Share URL: ${previewUrl}\nGist: ${gistUrl}`);
|
|
4940
|
+
const previewUrl = getShareViewerUrl(result.gistId);
|
|
4941
|
+
this.showStatus(previewUrl
|
|
4942
|
+
? `Secret GitHub Gist: ${result.gistUrl}\nConfigured preview: ${previewUrl}`
|
|
4943
|
+
: `Secret GitHub Gist: ${result.gistUrl}`);
|
|
4984
4944
|
}
|
|
4985
4945
|
catch (error) {
|
|
4986
|
-
if (
|
|
4987
|
-
|
|
4988
|
-
|
|
4946
|
+
if (error instanceof Error && error.message === "Share cancelled")
|
|
4947
|
+
this.showStatus("Share cancelled");
|
|
4948
|
+
else
|
|
4949
|
+
this.showError(`Failed to create secret GitHub Gist: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4950
|
+
}
|
|
4951
|
+
finally {
|
|
4952
|
+
if (loader) {
|
|
4953
|
+
loader.dispose();
|
|
4954
|
+
this.editorContainer.clear();
|
|
4955
|
+
this.editorContainer.addChild(this.editor);
|
|
4956
|
+
this.ui.setFocus(this.editor);
|
|
4989
4957
|
}
|
|
4990
4958
|
}
|
|
4991
4959
|
}
|
|
@@ -5031,7 +4999,7 @@ export class InteractiveMode {
|
|
|
5031
4999
|
this.chatContainer.addChild(new Text(theme.fg("dim", `Session name set: ${sessionName ?? name}`), 1, 0));
|
|
5032
5000
|
this.ui.requestRender();
|
|
5033
5001
|
}
|
|
5034
|
-
handleSessionCommand() {
|
|
5002
|
+
async handleSessionCommand() {
|
|
5035
5003
|
const stats = this.session.getSessionStats();
|
|
5036
5004
|
const sessionName = this.sessionManager.getSessionName();
|
|
5037
5005
|
const entries = this.sessionManager.getEntries();
|
|
@@ -5084,6 +5052,26 @@ export class InteractiveMode {
|
|
|
5084
5052
|
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5085
5053
|
}
|
|
5086
5054
|
}
|
|
5055
|
+
// Role and latency: the two dimensions the durable ledger (roadmap Phase 8)
|
|
5056
|
+
// carries that session entries never did. Scoped to this session's rows only
|
|
5057
|
+
// -- a ledger that also served other sessions must never leak their cost in.
|
|
5058
|
+
const usagePerformanceSamples = (await this.session.modelRuntime.listUsagePerformanceSamples()).filter((sample) => sample.sessionId === stats.sessionId);
|
|
5059
|
+
if (usagePerformanceSamples.length > 0) {
|
|
5060
|
+
const avgTtftMs = usagePerformanceSamples.reduce((sum, sample) => sum + sample.ttftMs, 0) / usagePerformanceSamples.length;
|
|
5061
|
+
const avgGenerationMs = usagePerformanceSamples.reduce((sum, sample) => sum + sample.generationMs, 0) /
|
|
5062
|
+
usagePerformanceSamples.length;
|
|
5063
|
+
info += `\n\n${theme.bold("Latency")}\n`;
|
|
5064
|
+
info += `${theme.fg("dim", "Avg TTFT:")} ${Math.round(avgTtftMs)}ms\n`;
|
|
5065
|
+
info += `${theme.fg("dim", "Avg Generation:")} ${Math.round(avgGenerationMs)}ms`;
|
|
5066
|
+
const roleRows = aggregateUsagePerformance(usagePerformanceSamples, "role");
|
|
5067
|
+
if (roleRows.length > 0) {
|
|
5068
|
+
info += `\n\n${theme.bold("Roles")}`;
|
|
5069
|
+
for (const row of roleRows) {
|
|
5070
|
+
const requestLabel = row.sampleCount === 1 ? "1 request" : `${row.sampleCount} requests`;
|
|
5071
|
+
info += `\n ${theme.fg("dim", `${row.key}:`)} $${row.cost.toFixed(3)} ${theme.fg("dim", `(${requestLabel})`)}`;
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5074
|
+
}
|
|
5087
5075
|
this.chatContainer.addChild(new Spacer(1));
|
|
5088
5076
|
this.chatContainer.addChild(new Text(info, 1, 0));
|
|
5089
5077
|
this.ui.requestRender();
|