indusagi-coding-agent 0.1.59 → 0.1.61
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 +60 -48
- package/CREDITS.md +19 -0
- package/NOTICE +7 -0
- package/README.md +65 -63
- package/dist/entry.js +19251 -0
- package/dist/types/addons/addons.test.d.ts +21 -0
- package/dist/types/addons/contract.d.ts +640 -0
- package/dist/types/addons/dispatch/event-dispatcher.d.ts +140 -0
- package/dist/types/addons/dispatch/index.d.ts +23 -0
- package/dist/types/addons/dispatch/tool-interceptor.d.ts +128 -0
- package/dist/types/addons/host.d.ts +246 -0
- package/dist/types/addons/index.d.ts +51 -0
- package/dist/types/addons/manifest.d.ts +56 -0
- package/dist/types/addons/sandbox.d.ts +103 -0
- package/dist/types/addons/surface.d.ts +42 -0
- package/dist/types/boot/auth-vault.d.ts +29 -0
- package/dist/types/boot/boot.d.ts +26 -0
- package/dist/types/boot/boot.test.d.ts +15 -0
- package/dist/types/boot/contract.d.ts +234 -0
- package/dist/types/boot/index.d.ts +20 -0
- package/dist/types/boot/invocation.d.ts +40 -0
- package/dist/types/boot/invocation.test.d.ts +8 -0
- package/dist/types/boot/runners/index.d.ts +11 -0
- package/dist/types/boot/runners/link-runner.d.ts +20 -0
- package/dist/types/boot/runners/oneshot-runner.d.ts +19 -0
- package/dist/types/boot/runners/registry.d.ts +30 -0
- package/dist/types/boot/runners/repl-runner.d.ts +19 -0
- package/dist/types/boot/runners/session-persist.test.d.ts +10 -0
- package/dist/types/boot/runners/session.d.ts +45 -0
- package/dist/types/boot/stages.d.ts +92 -0
- package/dist/types/boot/upgrade/apply.d.ts +45 -0
- package/dist/types/boot/upgrade/index.d.ts +13 -0
- package/dist/types/boot/upgrade/upgrades.d.ts +126 -0
- package/dist/types/briefing/briefing.test.d.ts +15 -0
- package/dist/types/briefing/compose.d.ts +37 -0
- package/dist/types/briefing/contract.d.ts +686 -0
- package/dist/types/briefing/index.d.ts +27 -0
- package/dist/types/briefing/macros.d.ts +206 -0
- package/dist/types/briefing/skills.d.ts +67 -0
- package/dist/types/capability-deck/bridge-ledger/index.d.ts +25 -0
- package/dist/types/capability-deck/bridge-ledger/key.d.ts +65 -0
- package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +129 -0
- package/dist/types/capability-deck/bridge-ledger/network.d.ts +115 -0
- package/dist/types/capability-deck/builtin-bridge.d.ts +114 -0
- package/dist/types/capability-deck/capability-deck.test.d.ts +18 -0
- package/dist/types/capability-deck/cards/bg-process-card.d.ts +99 -0
- package/dist/types/capability-deck/cards/index.d.ts +30 -0
- package/dist/types/capability-deck/cards/memory-card.d.ts +69 -0
- package/dist/types/capability-deck/cards/saas-card.d.ts +78 -0
- package/dist/types/capability-deck/cards/task-card.d.ts +82 -0
- package/dist/types/capability-deck/cards/todo-card.d.ts +78 -0
- package/dist/types/capability-deck/contract.d.ts +317 -0
- package/dist/types/capability-deck/index.d.ts +46 -0
- package/dist/types/capability-deck/manifest.d.ts +60 -0
- package/dist/types/capability-deck/provision.d.ts +76 -0
- package/dist/types/channels/channels.test.d.ts +15 -0
- package/dist/types/channels/contract.d.ts +489 -0
- package/dist/types/channels/framer.d.ts +49 -0
- package/dist/types/channels/index.d.ts +24 -0
- package/dist/types/channels/link/dialog.d.ts +138 -0
- package/dist/types/channels/link/driver.d.ts +81 -0
- package/dist/types/channels/link/index.d.ts +13 -0
- package/dist/types/channels/link/server.d.ts +70 -0
- package/dist/types/channels/oneshot.d.ts +37 -0
- package/dist/types/channels/ops.d.ts +89 -0
- package/dist/types/channels/session-ops.d.ts +80 -0
- package/dist/types/conductor/catalog/catalog.d.ts +87 -0
- package/dist/types/conductor/catalog/index.d.ts +14 -0
- package/dist/types/conductor/catalog/matcher.d.ts +47 -0
- package/dist/types/conductor/conductor.d.ts +157 -0
- package/dist/types/conductor/conductor.test.d.ts +10 -0
- package/dist/types/conductor/contract.d.ts +547 -0
- package/dist/types/conductor/index.d.ts +23 -0
- package/dist/types/conductor/signal-hub/hub.d.ts +83 -0
- package/dist/types/conductor/signal-hub/index.d.ts +19 -0
- package/dist/types/conductor/signal-hub/translate.d.ts +74 -0
- package/dist/types/conductor/skill-parse/index.d.ts +10 -0
- package/dist/types/conductor/skill-parse/parse.d.ts +67 -0
- package/dist/types/conductor/submit.test.d.ts +28 -0
- package/dist/types/conductor/transcript-store/index.d.ts +16 -0
- package/dist/types/conductor/transcript-store/serialize.d.ts +106 -0
- package/dist/types/conductor/transcript-store/store.d.ts +170 -0
- package/dist/types/console/components/Banner.d.ts +54 -0
- package/dist/types/console/components/Composer.d.ts +37 -0
- package/dist/types/console/components/StatusBar.d.ts +31 -0
- package/dist/types/console/components/TerminalConsole.d.ts +32 -0
- package/dist/types/console/console.test.d.ts +19 -0
- package/dist/types/console/contract.d.ts +562 -0
- package/dist/types/console/index.d.ts +31 -0
- package/dist/types/console/input/complete.d.ts +120 -0
- package/dist/types/console/input/dir-reader.d.ts +28 -0
- package/dist/types/console/input/index.d.ts +24 -0
- package/dist/types/console/input/input.test.d.ts +14 -0
- package/dist/types/console/input/keymap.d.ts +184 -0
- package/dist/types/console/input/paste.d.ts +131 -0
- package/dist/types/console/mount.d.ts +53 -0
- package/dist/types/console/overlays/auth.d.ts +31 -0
- package/dist/types/console/overlays/host.d.ts +44 -0
- package/dist/types/console/overlays/index.d.ts +13 -0
- package/dist/types/console/overlays/pickers.d.ts +37 -0
- package/dist/types/console/overlays/sessions.d.ts +29 -0
- package/dist/types/console/reducer.d.ts +51 -0
- package/dist/types/console/slash/builtins.d.ts +33 -0
- package/dist/types/console/slash/commands/dynamic.d.ts +57 -0
- package/dist/types/console/slash/commands/dynamic.test.d.ts +9 -0
- package/dist/types/console/slash/commands/integrations.d.ts +28 -0
- package/dist/types/console/slash/commands/integrations.test.d.ts +18 -0
- package/dist/types/console/slash/commands/shared.d.ts +72 -0
- package/dist/types/console/slash/commands/transcript.d.ts +24 -0
- package/dist/types/console/slash/commands/transcript.test.d.ts +10 -0
- package/dist/types/console/slash/commands/workbench.d.ts +21 -0
- package/dist/types/console/slash/commands/workbench.test.d.ts +10 -0
- package/dist/types/console/slash/index.d.ts +34 -0
- package/dist/types/console/slash/registry.d.ts +90 -0
- package/dist/types/console/slash/resolve.d.ts +109 -0
- package/dist/types/console/slash/slash.test.d.ts +18 -0
- package/dist/types/console/startup.d.ts +119 -0
- package/dist/types/console/theme/adapter.d.ts +60 -0
- package/dist/types/console/theme/index.d.ts +18 -0
- package/dist/types/console/theme/palette.d.ts +42 -0
- package/dist/types/console/theme/resolve.d.ts +45 -0
- package/dist/types/console/theme/theme.test.d.ts +16 -0
- package/dist/types/console/theme/tokens.d.ts +40 -0
- package/dist/types/entry.d.ts +17 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/insight/channel.d.ts +45 -0
- package/dist/types/insight/contract.d.ts +411 -0
- package/dist/types/insight/index.d.ts +26 -0
- package/dist/types/insight/insight.test.d.ts +17 -0
- package/dist/types/insight/recorder.d.ts +63 -0
- package/dist/types/insight/redaction.d.ts +44 -0
- package/dist/types/insight/replay.d.ts +77 -0
- package/dist/types/insight/sampling.d.ts +84 -0
- package/dist/types/insight/serialize.d.ts +54 -0
- package/dist/types/insight/sinks/console.d.ts +36 -0
- package/dist/types/insight/sinks/file.d.ts +37 -0
- package/dist/types/insight/sinks/index.d.ts +16 -0
- package/dist/types/insight/sinks/stream.d.ts +53 -0
- package/dist/types/kit/clipboard-image.d.ts +40 -0
- package/dist/types/kit/external-editor.d.ts +35 -0
- package/dist/types/kit/image.d.ts +102 -0
- package/dist/types/kit/index.d.ts +29 -0
- package/dist/types/kit/kit.test.d.ts +13 -0
- package/dist/types/kit/shell.d.ts +50 -0
- package/dist/types/kit/tool-fetch.d.ts +165 -0
- package/dist/types/launch/catalog.d.ts +51 -0
- package/dist/types/launch/contract.d.ts +385 -0
- package/dist/types/launch/credentials.d.ts +112 -0
- package/dist/types/launch/index.d.ts +28 -0
- package/dist/types/launch/invocation/attachments.d.ts +72 -0
- package/dist/types/launch/invocation/flags.d.ts +59 -0
- package/dist/types/launch/invocation/index.d.ts +23 -0
- package/dist/types/launch/invocation/read.d.ts +52 -0
- package/dist/types/launch/invocation/usage.d.ts +25 -0
- package/dist/types/launch/launch.test.d.ts +20 -0
- package/dist/types/launch/oauth.d.ts +88 -0
- package/dist/types/launch/packages.d.ts +75 -0
- package/dist/types/launch/packages.test.d.ts +15 -0
- package/dist/types/launch/pickers.d.ts +97 -0
- package/dist/types/runtime-bridge/bridges/_drive.d.ts +74 -0
- package/dist/types/runtime-bridge/bridges/builtins.d.ts +77 -0
- package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +37 -0
- package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +27 -0
- package/dist/types/runtime-bridge/bridges/index.d.ts +15 -0
- package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +36 -0
- package/dist/types/runtime-bridge/broker.d.ts +182 -0
- package/dist/types/runtime-bridge/contract.d.ts +436 -0
- package/dist/types/runtime-bridge/index.d.ts +21 -0
- package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +17 -0
- package/dist/types/runtime-bridge/sink.d.ts +59 -0
- package/dist/types/sessions/contract.d.ts +79 -0
- package/dist/types/sessions/index.d.ts +11 -0
- package/dist/types/sessions/library.d.ts +95 -0
- package/dist/types/sessions/sessions.test.d.ts +11 -0
- package/dist/types/settings/contract.d.ts +116 -0
- package/dist/types/settings/index.d.ts +13 -0
- package/dist/types/settings/manager.d.ts +109 -0
- package/dist/types/settings/settings.test.d.ts +16 -0
- package/dist/types/transcript-export/index.d.ts +20 -0
- package/dist/types/transcript-export/publish.d.ts +81 -0
- package/dist/types/transcript-export/sgr.d.ts +90 -0
- package/dist/types/transcript-export/template.d.ts +64 -0
- package/dist/types/transcript-export/theme-bridge.d.ts +99 -0
- package/dist/types/transcript-export/transcript-export.test.d.ts +16 -0
- package/dist/types/window-budget/budget/estimate.d.ts +47 -0
- package/dist/types/window-budget/budget/gate.d.ts +37 -0
- package/dist/types/window-budget/budget/index.d.ts +14 -0
- package/dist/types/window-budget/budget/slice.d.ts +38 -0
- package/dist/types/window-budget/condenser.d.ts +59 -0
- package/dist/types/window-budget/contract.d.ts +182 -0
- package/dist/types/window-budget/index.d.ts +15 -0
- package/dist/types/window-budget/summarize/condense.d.ts +70 -0
- package/dist/types/window-budget/summarize/index.d.ts +12 -0
- package/dist/types/window-budget/summarize/prompt.d.ts +56 -0
- package/dist/types/window-budget/window-budget.test.d.ts +18 -0
- package/dist/types/workspace/brand.d.ts +20 -0
- package/dist/types/workspace/index.d.ts +11 -0
- package/dist/types/workspace/locator.d.ts +50 -0
- package/dist/types/workspace/runtime-detect.d.ts +56 -0
- package/package.json +43 -62
- package/LICENSE +0 -8
- package/LICENSE-THIRD-PARTY.txt +0 -30
- package/demos/README.md +0 -12
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -30
- package/dist/cli.js.map +0 -1
- package/dist/command-line/args.d.ts +0 -59
- package/dist/command-line/args.d.ts.map +0 -1
- package/dist/command-line/args.js +0 -332
- package/dist/command-line/args.js.map +0 -1
- package/dist/command-line/config-selector.d.ts +0 -17
- package/dist/command-line/config-selector.d.ts.map +0 -1
- package/dist/command-line/config-selector.js +0 -34
- package/dist/command-line/config-selector.js.map +0 -1
- package/dist/command-line/file-processor.d.ts +0 -15
- package/dist/command-line/file-processor.d.ts.map +0 -1
- package/dist/command-line/file-processor.js +0 -73
- package/dist/command-line/file-processor.js.map +0 -1
- package/dist/command-line/list-models.d.ts +0 -9
- package/dist/command-line/list-models.d.ts.map +0 -1
- package/dist/command-line/list-models.js +0 -74
- package/dist/command-line/list-models.js.map +0 -1
- package/dist/command-line/login-handler.d.ts +0 -94
- package/dist/command-line/login-handler.d.ts.map +0 -1
- package/dist/command-line/login-handler.js +0 -794
- package/dist/command-line/login-handler.js.map +0 -1
- package/dist/command-line/session-picker.d.ts +0 -10
- package/dist/command-line/session-picker.d.ts.map +0 -1
- package/dist/command-line/session-picker.js +0 -60
- package/dist/command-line/session-picker.js.map +0 -1
- package/dist/config.d.ts +0 -31
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -143
- package/dist/config.js.map +0 -1
- package/dist/dev/observe-deep.d.ts +0 -2
- package/dist/dev/observe-deep.d.ts.map +0 -1
- package/dist/dev/observe-deep.js +0 -333
- package/dist/dev/observe-deep.js.map +0 -1
- package/dist/dev/observe-smoke.d.ts +0 -2
- package/dist/dev/observe-smoke.d.ts.map +0 -1
- package/dist/dev/observe-smoke.js +0 -264
- package/dist/dev/observe-smoke.js.map +0 -1
- package/dist/helpers/array.d.ts +0 -438
- package/dist/helpers/array.d.ts.map +0 -1
- package/dist/helpers/array.js +0 -692
- package/dist/helpers/array.js.map +0 -1
- package/dist/helpers/changelog.d.ts +0 -20
- package/dist/helpers/changelog.d.ts.map +0 -1
- package/dist/helpers/changelog.js +0 -79
- package/dist/helpers/changelog.js.map +0 -1
- package/dist/helpers/clipboard-image.d.ts +0 -11
- package/dist/helpers/clipboard-image.d.ts.map +0 -1
- package/dist/helpers/clipboard-image.js +0 -111
- package/dist/helpers/clipboard-image.js.map +0 -1
- package/dist/helpers/clipboard.d.ts +0 -2
- package/dist/helpers/clipboard.d.ts.map +0 -1
- package/dist/helpers/clipboard.js +0 -72
- package/dist/helpers/clipboard.js.map +0 -1
- package/dist/helpers/color-formatter.d.ts +0 -318
- package/dist/helpers/color-formatter.d.ts.map +0 -1
- package/dist/helpers/color-formatter.js +0 -469
- package/dist/helpers/color-formatter.js.map +0 -1
- package/dist/helpers/data-transformer.d.ts +0 -391
- package/dist/helpers/data-transformer.d.ts.map +0 -1
- package/dist/helpers/data-transformer.js +0 -604
- package/dist/helpers/data-transformer.js.map +0 -1
- package/dist/helpers/date-formatter.d.ts +0 -316
- package/dist/helpers/date-formatter.d.ts.map +0 -1
- package/dist/helpers/date-formatter.js +0 -553
- package/dist/helpers/date-formatter.js.map +0 -1
- package/dist/helpers/error-handler.d.ts +0 -541
- package/dist/helpers/error-handler.d.ts.map +0 -1
- package/dist/helpers/error-handler.js +0 -726
- package/dist/helpers/error-handler.js.map +0 -1
- package/dist/helpers/file-operations.d.ts +0 -324
- package/dist/helpers/file-operations.d.ts.map +0 -1
- package/dist/helpers/file-operations.js +0 -543
- package/dist/helpers/file-operations.js.map +0 -1
- package/dist/helpers/frontmatter.d.ts +0 -273
- package/dist/helpers/frontmatter.d.ts.map +0 -1
- package/dist/helpers/frontmatter.js +0 -580
- package/dist/helpers/frontmatter.js.map +0 -1
- package/dist/helpers/git.d.ts +0 -2
- package/dist/helpers/git.d.ts.map +0 -1
- package/dist/helpers/git.js +0 -6
- package/dist/helpers/git.js.map +0 -1
- package/dist/helpers/image-convert.d.ts +0 -9
- package/dist/helpers/image-convert.d.ts.map +0 -1
- package/dist/helpers/image-convert.js +0 -41
- package/dist/helpers/image-convert.js.map +0 -1
- package/dist/helpers/image-resize.d.ts +0 -19
- package/dist/helpers/image-resize.d.ts.map +0 -1
- package/dist/helpers/image-resize.js +0 -143
- package/dist/helpers/image-resize.js.map +0 -1
- package/dist/helpers/json-formatter.d.ts +0 -267
- package/dist/helpers/json-formatter.d.ts.map +0 -1
- package/dist/helpers/json-formatter.js +0 -533
- package/dist/helpers/json-formatter.js.map +0 -1
- package/dist/helpers/logger.d.ts +0 -176
- package/dist/helpers/logger.d.ts.map +0 -1
- package/dist/helpers/logger.js +0 -346
- package/dist/helpers/logger.js.map +0 -1
- package/dist/helpers/markdown-formatter.d.ts +0 -235
- package/dist/helpers/markdown-formatter.d.ts.map +0 -1
- package/dist/helpers/markdown-formatter.js +0 -633
- package/dist/helpers/markdown-formatter.js.map +0 -1
- package/dist/helpers/mime.d.ts +0 -3
- package/dist/helpers/mime.d.ts.map +0 -1
- package/dist/helpers/mime.js +0 -46
- package/dist/helpers/mime.js.map +0 -1
- package/dist/helpers/open-auth-url.d.ts +0 -2
- package/dist/helpers/open-auth-url.d.ts.map +0 -1
- package/dist/helpers/open-auth-url.js +0 -59
- package/dist/helpers/open-auth-url.js.map +0 -1
- package/dist/helpers/path-validator.d.ts +0 -603
- package/dist/helpers/path-validator.d.ts.map +0 -1
- package/dist/helpers/path-validator.js +0 -895
- package/dist/helpers/path-validator.js.map +0 -1
- package/dist/helpers/photon.d.ts +0 -10
- package/dist/helpers/photon.d.ts.map +0 -1
- package/dist/helpers/photon.js +0 -132
- package/dist/helpers/photon.js.map +0 -1
- package/dist/helpers/shell.d.ts +0 -10
- package/dist/helpers/shell.d.ts.map +0 -1
- package/dist/helpers/shell.js +0 -142
- package/dist/helpers/shell.js.map +0 -1
- package/dist/helpers/sleep.d.ts +0 -5
- package/dist/helpers/sleep.d.ts.map +0 -1
- package/dist/helpers/sleep.js +0 -41
- package/dist/helpers/sleep.js.map +0 -1
- package/dist/helpers/string-formatter.d.ts +0 -609
- package/dist/helpers/string-formatter.d.ts.map +0 -1
- package/dist/helpers/string-formatter.js +0 -807
- package/dist/helpers/string-formatter.js.map +0 -1
- package/dist/helpers/tools-manager.d.ts +0 -5
- package/dist/helpers/tools-manager.d.ts.map +0 -1
- package/dist/helpers/tools-manager.js +0 -161
- package/dist/helpers/tools-manager.js.map +0 -1
- package/dist/helpers/type-guards.d.ts +0 -634
- package/dist/helpers/type-guards.d.ts.map +0 -1
- package/dist/helpers/type-guards.js +0 -671
- package/dist/helpers/type-guards.js.map +0 -1
- package/dist/index.d.ts +0 -41
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -16
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -14
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/print-mode.d.ts +0 -561
- package/dist/interfaces/print-mode.d.ts.map +0 -1
- package/dist/interfaces/print-mode.js +0 -633
- package/dist/interfaces/print-mode.js.map +0 -1
- package/dist/interfaces/react-ink/adapters/command-router.d.ts +0 -19
- package/dist/interfaces/react-ink/adapters/command-router.d.ts.map +0 -1
- package/dist/interfaces/react-ink/adapters/command-router.js +0 -674
- package/dist/interfaces/react-ink/adapters/command-router.js.map +0 -1
- package/dist/interfaces/react-ink/adapters/session-events.d.ts +0 -5
- package/dist/interfaces/react-ink/adapters/session-events.d.ts.map +0 -1
- package/dist/interfaces/react-ink/adapters/session-events.js +0 -255
- package/dist/interfaces/react-ink/adapters/session-events.js.map +0 -1
- package/dist/interfaces/react-ink/adapters/session-history.d.ts +0 -14
- package/dist/interfaces/react-ink/adapters/session-history.d.ts.map +0 -1
- package/dist/interfaces/react-ink/adapters/session-history.js +0 -83
- package/dist/interfaces/react-ink/adapters/session-history.js.map +0 -1
- package/dist/interfaces/react-ink/adapters/tool-state.d.ts +0 -4
- package/dist/interfaces/react-ink/adapters/tool-state.d.ts.map +0 -1
- package/dist/interfaces/react-ink/adapters/tool-state.js +0 -67
- package/dist/interfaces/react-ink/adapters/tool-state.js.map +0 -1
- package/dist/interfaces/react-ink/components/AppShell.d.ts +0 -17
- package/dist/interfaces/react-ink/components/AppShell.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/AppShell.js +0 -1535
- package/dist/interfaces/react-ink/components/AppShell.js.map +0 -1
- package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts +0 -9
- package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/ChangelogBlock.js +0 -58
- package/dist/interfaces/react-ink/components/ChangelogBlock.js.map +0 -1
- package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts +0 -9
- package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/DisplayBlockView.js +0 -11
- package/dist/interfaces/react-ink/components/DisplayBlockView.js.map +0 -1
- package/dist/interfaces/react-ink/components/Footer.d.ts +0 -12
- package/dist/interfaces/react-ink/components/Footer.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/Footer.js +0 -88
- package/dist/interfaces/react-ink/components/Footer.js.map +0 -1
- package/dist/interfaces/react-ink/components/Header.d.ts +0 -14
- package/dist/interfaces/react-ink/components/Header.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/Header.js +0 -24
- package/dist/interfaces/react-ink/components/Header.js.map +0 -1
- package/dist/interfaces/react-ink/components/MessageList.d.ts +0 -14
- package/dist/interfaces/react-ink/components/MessageList.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/MessageList.js +0 -43
- package/dist/interfaces/react-ink/components/MessageList.js.map +0 -1
- package/dist/interfaces/react-ink/components/MessageRow.d.ts +0 -13
- package/dist/interfaces/react-ink/components/MessageRow.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/MessageRow.js +0 -35
- package/dist/interfaces/react-ink/components/MessageRow.js.map +0 -1
- package/dist/interfaces/react-ink/components/PromptInput.d.ts +0 -35
- package/dist/interfaces/react-ink/components/PromptInput.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/PromptInput.js +0 -458
- package/dist/interfaces/react-ink/components/PromptInput.js.map +0 -1
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts +0 -9
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js +0 -14
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js.map +0 -1
- package/dist/interfaces/react-ink/components/StatusLine.d.ts +0 -10
- package/dist/interfaces/react-ink/components/StatusLine.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/StatusLine.js +0 -39
- package/dist/interfaces/react-ink/components/StatusLine.js.map +0 -1
- package/dist/interfaces/react-ink/components/TaskPanel.d.ts +0 -10
- package/dist/interfaces/react-ink/components/TaskPanel.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/TaskPanel.js +0 -23
- package/dist/interfaces/react-ink/components/TaskPanel.js.map +0 -1
- package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts +0 -18
- package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/ToolEventBlock.js +0 -61
- package/dist/interfaces/react-ink/components/ToolEventBlock.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts +0 -9
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js +0 -6
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts +0 -15
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js +0 -10
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts +0 -10
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js +0 -64
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts +0 -10
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js +0 -24
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts +0 -10
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js +0 -95
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts +0 -17
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js +0 -66
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts +0 -11
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js +0 -10
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts +0 -15
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js +0 -79
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts +0 -10
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js +0 -99
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts +0 -8
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js +0 -7
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts +0 -9
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js +0 -7
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts +0 -9
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js +0 -7
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js.map +0 -1
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts +0 -30
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js +0 -106
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js.map +0 -1
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts +0 -20
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js +0 -145
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts +0 -12
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.js +0 -20
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts +0 -9
- package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/BashMessage.js +0 -11
- package/dist/interfaces/react-ink/components/messages/BashMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts +0 -9
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js +0 -6
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts +0 -9
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.js +0 -6
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts +0 -10
- package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/CustomMessage.js +0 -9
- package/dist/interfaces/react-ink/components/messages/CustomMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts +0 -8
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js +0 -10
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts +0 -9
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js +0 -8
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts +0 -12
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js +0 -8
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js.map +0 -1
- package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts +0 -10
- package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts.map +0 -1
- package/dist/interfaces/react-ink/components/messages/UserMessage.js +0 -7
- package/dist/interfaces/react-ink/components/messages/UserMessage.js.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts +0 -8
- package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-agent-session.js +0 -34
- package/dist/interfaces/react-ink/hooks/use-agent-session.js.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts +0 -12
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.js +0 -17
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.js.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts +0 -7
- package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-footer-data.js +0 -17
- package/dist/interfaces/react-ink/hooks/use-footer-data.js.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts +0 -17
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.js +0 -66
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.js.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-session-history.d.ts +0 -8
- package/dist/interfaces/react-ink/hooks/use-session-history.d.ts.map +0 -1
- package/dist/interfaces/react-ink/hooks/use-session-history.js +0 -8
- package/dist/interfaces/react-ink/hooks/use-session-history.js.map +0 -1
- package/dist/interfaces/react-ink/index.d.ts +0 -8
- package/dist/interfaces/react-ink/index.d.ts.map +0 -1
- package/dist/interfaces/react-ink/index.js +0 -8
- package/dist/interfaces/react-ink/index.js.map +0 -1
- package/dist/interfaces/react-ink/interactive-mode.d.ts +0 -24
- package/dist/interfaces/react-ink/interactive-mode.d.ts.map +0 -1
- package/dist/interfaces/react-ink/interactive-mode.js +0 -57
- package/dist/interfaces/react-ink/interactive-mode.js.map +0 -1
- package/dist/interfaces/react-ink/render-root.d.ts +0 -19
- package/dist/interfaces/react-ink/render-root.d.ts.map +0 -1
- package/dist/interfaces/react-ink/render-root.js +0 -6
- package/dist/interfaces/react-ink/render-root.js.map +0 -1
- package/dist/interfaces/react-ink/state/reducer.d.ts +0 -51
- package/dist/interfaces/react-ink/state/reducer.d.ts.map +0 -1
- package/dist/interfaces/react-ink/state/reducer.js +0 -122
- package/dist/interfaces/react-ink/state/reducer.js.map +0 -1
- package/dist/interfaces/react-ink/state/store.d.ts +0 -4
- package/dist/interfaces/react-ink/state/store.d.ts.map +0 -1
- package/dist/interfaces/react-ink/state/store.js +0 -5
- package/dist/interfaces/react-ink/state/store.js.map +0 -1
- package/dist/interfaces/react-ink/state/ui-state.d.ts +0 -5
- package/dist/interfaces/react-ink/state/ui-state.d.ts.map +0 -1
- package/dist/interfaces/react-ink/state/ui-state.js +0 -20
- package/dist/interfaces/react-ink/state/ui-state.js.map +0 -1
- package/dist/interfaces/react-ink/theme-adapter.d.ts +0 -4
- package/dist/interfaces/react-ink/theme-adapter.d.ts.map +0 -1
- package/dist/interfaces/react-ink/theme-adapter.js +0 -15
- package/dist/interfaces/react-ink/theme-adapter.js.map +0 -1
- package/dist/interfaces/react-ink/types.d.ts +0 -51
- package/dist/interfaces/react-ink/types.d.ts.map +0 -1
- package/dist/interfaces/react-ink/types.js +0 -2
- package/dist/interfaces/react-ink/types.js.map +0 -1
- package/dist/interfaces/react-ink/utils/changelog.d.ts +0 -7
- package/dist/interfaces/react-ink/utils/changelog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/changelog.js +0 -40
- package/dist/interfaces/react-ink/utils/changelog.js.map +0 -1
- package/dist/interfaces/react-ink/utils/key-data.d.ts +0 -22
- package/dist/interfaces/react-ink/utils/key-data.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/key-data.js +0 -123
- package/dist/interfaces/react-ink/utils/key-data.js.map +0 -1
- package/dist/interfaces/react-ink/utils/message-groups.d.ts +0 -26
- package/dist/interfaces/react-ink/utils/message-groups.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/message-groups.js +0 -230
- package/dist/interfaces/react-ink/utils/message-groups.js.map +0 -1
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts +0 -20
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.js +0 -46
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.js.map +0 -1
- package/dist/interfaces/react-ink/utils/selection-dialog.d.ts +0 -3
- package/dist/interfaces/react-ink/utils/selection-dialog.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/selection-dialog.js +0 -18
- package/dist/interfaces/react-ink/utils/selection-dialog.js.map +0 -1
- package/dist/interfaces/react-ink/utils/session-actions.d.ts +0 -10
- package/dist/interfaces/react-ink/utils/session-actions.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/session-actions.js +0 -66
- package/dist/interfaces/react-ink/utils/session-actions.js.map +0 -1
- package/dist/interfaces/react-ink/utils/slash-commands.d.ts +0 -10
- package/dist/interfaces/react-ink/utils/slash-commands.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/slash-commands.js +0 -111
- package/dist/interfaces/react-ink/utils/slash-commands.js.map +0 -1
- package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts +0 -7
- package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/startup-diagnostics.js +0 -111
- package/dist/interfaces/react-ink/utils/startup-diagnostics.js.map +0 -1
- package/dist/interfaces/react-ink/utils/tool-display.d.ts +0 -22
- package/dist/interfaces/react-ink/utils/tool-display.d.ts.map +0 -1
- package/dist/interfaces/react-ink/utils/tool-display.js +0 -349
- package/dist/interfaces/react-ink/utils/tool-display.js.map +0 -1
- package/dist/interfaces/service-api/rpc-client.d.ts +0 -1129
- package/dist/interfaces/service-api/rpc-client.d.ts.map +0 -1
- package/dist/interfaces/service-api/rpc-client.js +0 -1333
- package/dist/interfaces/service-api/rpc-client.js.map +0 -1
- package/dist/interfaces/service-api/rpc-mode.d.ts +0 -813
- package/dist/interfaces/service-api/rpc-mode.d.ts.map +0 -1
- package/dist/interfaces/service-api/rpc-mode.js +0 -1229
- package/dist/interfaces/service-api/rpc-mode.js.map +0 -1
- package/dist/interfaces/service-api/rpc-types.d.ts +0 -392
- package/dist/interfaces/service-api/rpc-types.d.ts.map +0 -1
- package/dist/interfaces/service-api/rpc-types.js +0 -22
- package/dist/interfaces/service-api/rpc-types.js.map +0 -1
- package/dist/interfaces/shared.d.ts +0 -386
- package/dist/interfaces/shared.d.ts.map +0 -1
- package/dist/interfaces/shared.js +0 -543
- package/dist/interfaces/shared.js.map +0 -1
- package/dist/interfaces/theme/dark.json +0 -91
- package/dist/interfaces/theme/light.json +0 -90
- package/dist/interfaces/theme/theme-schema.json +0 -339
- package/dist/interfaces/theme/theme.d.ts +0 -500
- package/dist/interfaces/theme/theme.d.ts.map +0 -1
- package/dist/interfaces/theme/theme.js +0 -1511
- package/dist/interfaces/theme/theme.js.map +0 -1
- package/dist/main.d.ts +0 -8
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -750
- package/dist/main.js.map +0 -1
- package/dist/migrations.d.ts +0 -8
- package/dist/migrations.d.ts.map +0 -1
- package/dist/migrations.js +0 -206
- package/dist/migrations.js.map +0 -1
- package/dist/observe.d.ts +0 -2
- package/dist/observe.d.ts.map +0 -1
- package/dist/observe.js +0 -2
- package/dist/observe.js.map +0 -1
- package/dist/runtime/agent-session.d.ts +0 -988
- package/dist/runtime/agent-session.d.ts.map +0 -1
- package/dist/runtime/agent-session.js +0 -3114
- package/dist/runtime/agent-session.js.map +0 -1
- package/dist/runtime/auth-storage.d.ts +0 -53
- package/dist/runtime/auth-storage.d.ts.map +0 -1
- package/dist/runtime/auth-storage.js +0 -378
- package/dist/runtime/auth-storage.js.map +0 -1
- package/dist/runtime/bash-executor.d.ts +0 -16
- package/dist/runtime/bash-executor.d.ts.map +0 -1
- package/dist/runtime/bash-executor.js +0 -270
- package/dist/runtime/bash-executor.js.map +0 -1
- package/dist/runtime/context-compression/branch-summarization.d.ts +0 -86
- package/dist/runtime/context-compression/branch-summarization.d.ts.map +0 -1
- package/dist/runtime/context-compression/branch-summarization.js +0 -242
- package/dist/runtime/context-compression/branch-summarization.js.map +0 -1
- package/dist/runtime/context-compression/compaction.d.ts +0 -121
- package/dist/runtime/context-compression/compaction.d.ts.map +0 -1
- package/dist/runtime/context-compression/compaction.js +0 -607
- package/dist/runtime/context-compression/compaction.js.map +0 -1
- package/dist/runtime/context-compression/index.d.ts +0 -35
- package/dist/runtime/context-compression/index.d.ts.map +0 -1
- package/dist/runtime/context-compression/index.js +0 -33
- package/dist/runtime/context-compression/index.js.map +0 -1
- package/dist/runtime/context-compression/utils.d.ts +0 -17
- package/dist/runtime/context-compression/utils.d.ts.map +0 -1
- package/dist/runtime/context-compression/utils.js +0 -117
- package/dist/runtime/context-compression/utils.js.map +0 -1
- package/dist/runtime/diagnostics.d.ts +0 -206
- package/dist/runtime/diagnostics.d.ts.map +0 -1
- package/dist/runtime/diagnostics.js +0 -144
- package/dist/runtime/diagnostics.js.map +0 -1
- package/dist/runtime/discover-packages.d.ts +0 -2
- package/dist/runtime/discover-packages.d.ts.map +0 -1
- package/dist/runtime/discover-packages.js +0 -59
- package/dist/runtime/discover-packages.js.map +0 -1
- package/dist/runtime/event-bus.d.ts +0 -9
- package/dist/runtime/event-bus.d.ts.map +0 -1
- package/dist/runtime/event-bus.js +0 -29
- package/dist/runtime/event-bus.js.map +0 -1
- package/dist/runtime/exec.d.ts +0 -13
- package/dist/runtime/exec.d.ts.map +0 -1
- package/dist/runtime/exec.js +0 -62
- package/dist/runtime/exec.js.map +0 -1
- package/dist/runtime/footer-data-provider.d.ts +0 -19
- package/dist/runtime/footer-data-provider.d.ts.map +0 -1
- package/dist/runtime/footer-data-provider.js +0 -122
- package/dist/runtime/footer-data-provider.js.map +0 -1
- package/dist/runtime/html-export/ansi-to-html.d.ts +0 -26
- package/dist/runtime/html-export/ansi-to-html.d.ts.map +0 -1
- package/dist/runtime/html-export/ansi-to-html.js +0 -253
- package/dist/runtime/html-export/ansi-to-html.js.map +0 -1
- package/dist/runtime/html-export/ansi-to-html.ts +0 -262
- package/dist/runtime/html-export/index.d.ts +0 -162
- package/dist/runtime/html-export/index.d.ts.map +0 -1
- package/dist/runtime/html-export/index.js +0 -350
- package/dist/runtime/html-export/index.js.map +0 -1
- package/dist/runtime/html-export/index.ts +0 -432
- package/dist/runtime/html-export/template.css +0 -905
- package/dist/runtime/html-export/template.html +0 -76
- package/dist/runtime/html-export/template.js +0 -1549
- package/dist/runtime/html-export/tool-renderer.d.ts +0 -18
- package/dist/runtime/html-export/tool-renderer.d.ts.map +0 -1
- package/dist/runtime/html-export/tool-renderer.js +0 -45
- package/dist/runtime/html-export/tool-renderer.js.map +0 -1
- package/dist/runtime/html-export/tool-renderer.ts +0 -80
- package/dist/runtime/html-export/vendor/highlight.min.js +0 -1244
- package/dist/runtime/html-export/vendor/marked.min.js +0 -74
- package/dist/runtime/index.d.ts +0 -35
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -35
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/keybindings.d.ts +0 -20
- package/dist/runtime/keybindings.d.ts.map +0 -1
- package/dist/runtime/keybindings.js +0 -109
- package/dist/runtime/keybindings.js.map +0 -1
- package/dist/runtime/lifecycle/index.d.ts +0 -4
- package/dist/runtime/lifecycle/index.d.ts.map +0 -1
- package/dist/runtime/lifecycle/index.js +0 -3
- package/dist/runtime/lifecycle/index.js.map +0 -1
- package/dist/runtime/lifecycle/loader.d.ts +0 -6
- package/dist/runtime/lifecycle/loader.d.ts.map +0 -1
- package/dist/runtime/lifecycle/loader.js +0 -179
- package/dist/runtime/lifecycle/loader.js.map +0 -1
- package/dist/runtime/lifecycle/runner.d.ts +0 -14
- package/dist/runtime/lifecycle/runner.d.ts.map +0 -1
- package/dist/runtime/lifecycle/runner.js +0 -58
- package/dist/runtime/lifecycle/runner.js.map +0 -1
- package/dist/runtime/lifecycle/types.d.ts +0 -139
- package/dist/runtime/lifecycle/types.d.ts.map +0 -1
- package/dist/runtime/lifecycle/types.js +0 -2
- package/dist/runtime/lifecycle/types.js.map +0 -1
- package/dist/runtime/messages.d.ts +0 -2
- package/dist/runtime/messages.d.ts.map +0 -1
- package/dist/runtime/messages.js +0 -2
- package/dist/runtime/messages.js.map +0 -1
- package/dist/runtime/model-registry.d.ts +0 -62
- package/dist/runtime/model-registry.d.ts.map +0 -1
- package/dist/runtime/model-registry.js +0 -446
- package/dist/runtime/model-registry.js.map +0 -1
- package/dist/runtime/model-resolver.d.ts +0 -35
- package/dist/runtime/model-resolver.d.ts.map +0 -1
- package/dist/runtime/model-resolver.js +0 -232
- package/dist/runtime/model-resolver.js.map +0 -1
- package/dist/runtime/observe.d.ts +0 -50
- package/dist/runtime/observe.d.ts.map +0 -1
- package/dist/runtime/observe.js +0 -233
- package/dist/runtime/observe.js.map +0 -1
- package/dist/runtime/package-manager.d.ts +0 -103
- package/dist/runtime/package-manager.d.ts.map +0 -1
- package/dist/runtime/package-manager.js +0 -583
- package/dist/runtime/package-manager.js.map +0 -1
- package/dist/runtime/plugins/index.d.ts +0 -13
- package/dist/runtime/plugins/index.d.ts.map +0 -1
- package/dist/runtime/plugins/index.js +0 -23
- package/dist/runtime/plugins/index.js.map +0 -1
- package/dist/runtime/plugins/loader.d.ts +0 -19
- package/dist/runtime/plugins/loader.d.ts.map +0 -1
- package/dist/runtime/plugins/loader.js +0 -415
- package/dist/runtime/plugins/loader.js.map +0 -1
- package/dist/runtime/plugins/runner.d.ts +0 -107
- package/dist/runtime/plugins/runner.d.ts.map +0 -1
- package/dist/runtime/plugins/runner.js +0 -468
- package/dist/runtime/plugins/runner.js.map +0 -1
- package/dist/runtime/plugins/types.d.ts +0 -862
- package/dist/runtime/plugins/types.d.ts.map +0 -1
- package/dist/runtime/plugins/types.js +0 -32
- package/dist/runtime/plugins/types.js.map +0 -1
- package/dist/runtime/plugins/wrapper.d.ts +0 -29
- package/dist/runtime/plugins/wrapper.d.ts.map +0 -1
- package/dist/runtime/plugins/wrapper.js +0 -129
- package/dist/runtime/plugins/wrapper.js.map +0 -1
- package/dist/runtime/prompt-templates.d.ts +0 -18
- package/dist/runtime/prompt-templates.d.ts.map +0 -1
- package/dist/runtime/prompt-templates.js +0 -203
- package/dist/runtime/prompt-templates.js.map +0 -1
- package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts +0 -19
- package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts.map +0 -1
- package/dist/runtime/providers/adapters/claude-cli-adapter.js +0 -242
- package/dist/runtime/providers/adapters/claude-cli-adapter.js.map +0 -1
- package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts +0 -18
- package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts.map +0 -1
- package/dist/runtime/providers/adapters/codex-cli-adapter.js +0 -177
- package/dist/runtime/providers/adapters/codex-cli-adapter.js.map +0 -1
- package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts +0 -21
- package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts.map +0 -1
- package/dist/runtime/providers/adapters/indusagi-cli-adapter.js +0 -162
- package/dist/runtime/providers/adapters/indusagi-cli-adapter.js.map +0 -1
- package/dist/runtime/providers/adapters/utils.d.ts +0 -12
- package/dist/runtime/providers/adapters/utils.d.ts.map +0 -1
- package/dist/runtime/providers/adapters/utils.js +0 -122
- package/dist/runtime/providers/adapters/utils.js.map +0 -1
- package/dist/runtime/providers/builtins.d.ts +0 -3
- package/dist/runtime/providers/builtins.d.ts.map +0 -1
- package/dist/runtime/providers/builtins.js +0 -88
- package/dist/runtime/providers/builtins.js.map +0 -1
- package/dist/runtime/providers/provider-adapter-registry.d.ts +0 -11
- package/dist/runtime/providers/provider-adapter-registry.d.ts.map +0 -1
- package/dist/runtime/providers/provider-adapter-registry.js +0 -36
- package/dist/runtime/providers/provider-adapter-registry.js.map +0 -1
- package/dist/runtime/providers/provider-adapter.d.ts +0 -33
- package/dist/runtime/providers/provider-adapter.d.ts.map +0 -1
- package/dist/runtime/providers/provider-adapter.js +0 -2
- package/dist/runtime/providers/provider-adapter.js.map +0 -1
- package/dist/runtime/providers/provider-service.d.ts +0 -33
- package/dist/runtime/providers/provider-service.d.ts.map +0 -1
- package/dist/runtime/providers/provider-service.js +0 -157
- package/dist/runtime/providers/provider-service.js.map +0 -1
- package/dist/runtime/providers/types.d.ts +0 -29
- package/dist/runtime/providers/types.d.ts.map +0 -1
- package/dist/runtime/providers/types.js +0 -9
- package/dist/runtime/providers/types.js.map +0 -1
- package/dist/runtime/resource-loader.d.ts +0 -180
- package/dist/runtime/resource-loader.d.ts.map +0 -1
- package/dist/runtime/resource-loader.js +0 -530
- package/dist/runtime/resource-loader.js.map +0 -1
- package/dist/runtime/sdk.d.ts +0 -65
- package/dist/runtime/sdk.d.ts.map +0 -1
- package/dist/runtime/sdk.js +0 -402
- package/dist/runtime/sdk.js.map +0 -1
- package/dist/runtime/session-manager.d.ts +0 -448
- package/dist/runtime/session-manager.d.ts.map +0 -1
- package/dist/runtime/session-manager.js +0 -1177
- package/dist/runtime/session-manager.js.map +0 -1
- package/dist/runtime/settings-manager.d.ts +0 -234
- package/dist/runtime/settings-manager.d.ts.map +0 -1
- package/dist/runtime/settings-manager.js +0 -298
- package/dist/runtime/settings-manager.js.map +0 -1
- package/dist/runtime/skills.d.ts +0 -33
- package/dist/runtime/skills.d.ts.map +0 -1
- package/dist/runtime/skills.js +0 -277
- package/dist/runtime/skills.js.map +0 -1
- package/dist/runtime/subagents.d.ts +0 -29
- package/dist/runtime/subagents.d.ts.map +0 -1
- package/dist/runtime/subagents.js +0 -163
- package/dist/runtime/subagents.js.map +0 -1
- package/dist/runtime/system-prompt.d.ts +0 -16
- package/dist/runtime/system-prompt.d.ts.map +0 -1
- package/dist/runtime/system-prompt.js +0 -275
- package/dist/runtime/system-prompt.js.map +0 -1
- package/dist/runtime/task-session-manager.d.ts +0 -55
- package/dist/runtime/task-session-manager.d.ts.map +0 -1
- package/dist/runtime/task-session-manager.js +0 -410
- package/dist/runtime/task-session-manager.js.map +0 -1
- package/dist/runtime/timings.d.ts +0 -4
- package/dist/runtime/timings.d.ts.map +0 -1
- package/dist/runtime/timings.js +0 -41
- package/dist/runtime/timings.js.map +0 -1
- package/dist/runtime/todo-store.d.ts +0 -20
- package/dist/runtime/todo-store.d.ts.map +0 -1
- package/dist/runtime/todo-store.js +0 -60
- package/dist/runtime/todo-store.js.map +0 -1
- package/dist/runtime/tooling/bash.d.ts +0 -2
- package/dist/runtime/tooling/bash.d.ts.map +0 -1
- package/dist/runtime/tooling/bash.js +0 -2
- package/dist/runtime/tooling/bash.js.map +0 -1
- package/dist/runtime/tooling/bg-process.d.ts +0 -44
- package/dist/runtime/tooling/bg-process.d.ts.map +0 -1
- package/dist/runtime/tooling/bg-process.js +0 -55
- package/dist/runtime/tooling/bg-process.js.map +0 -1
- package/dist/runtime/tooling/composio-compat.d.ts +0 -169
- package/dist/runtime/tooling/composio-compat.d.ts.map +0 -1
- package/dist/runtime/tooling/composio-compat.js +0 -163
- package/dist/runtime/tooling/composio-compat.js.map +0 -1
- package/dist/runtime/tooling/edit-diff.d.ts +0 -9
- package/dist/runtime/tooling/edit-diff.d.ts.map +0 -1
- package/dist/runtime/tooling/edit-diff.js +0 -2
- package/dist/runtime/tooling/edit-diff.js.map +0 -1
- package/dist/runtime/tooling/edit.d.ts +0 -2
- package/dist/runtime/tooling/edit.d.ts.map +0 -1
- package/dist/runtime/tooling/edit.js +0 -2
- package/dist/runtime/tooling/edit.js.map +0 -1
- package/dist/runtime/tooling/find.d.ts +0 -2
- package/dist/runtime/tooling/find.d.ts.map +0 -1
- package/dist/runtime/tooling/find.js +0 -2
- package/dist/runtime/tooling/find.js.map +0 -1
- package/dist/runtime/tooling/grep.d.ts +0 -2
- package/dist/runtime/tooling/grep.d.ts.map +0 -1
- package/dist/runtime/tooling/grep.js +0 -2
- package/dist/runtime/tooling/grep.js.map +0 -1
- package/dist/runtime/tooling/index.d.ts +0 -248
- package/dist/runtime/tooling/index.d.ts.map +0 -1
- package/dist/runtime/tooling/index.js +0 -325
- package/dist/runtime/tooling/index.js.map +0 -1
- package/dist/runtime/tooling/ls.d.ts +0 -2
- package/dist/runtime/tooling/ls.d.ts.map +0 -1
- package/dist/runtime/tooling/ls.js +0 -2
- package/dist/runtime/tooling/ls.js.map +0 -1
- package/dist/runtime/tooling/memory.d.ts +0 -132
- package/dist/runtime/tooling/memory.d.ts.map +0 -1
- package/dist/runtime/tooling/memory.js +0 -171
- package/dist/runtime/tooling/memory.js.map +0 -1
- package/dist/runtime/tooling/path-utils.d.ts +0 -2
- package/dist/runtime/tooling/path-utils.d.ts.map +0 -1
- package/dist/runtime/tooling/path-utils.js +0 -2
- package/dist/runtime/tooling/path-utils.js.map +0 -1
- package/dist/runtime/tooling/read.d.ts +0 -2
- package/dist/runtime/tooling/read.d.ts.map +0 -1
- package/dist/runtime/tooling/read.js +0 -2
- package/dist/runtime/tooling/read.js.map +0 -1
- package/dist/runtime/tooling/registry.d.ts +0 -18
- package/dist/runtime/tooling/registry.d.ts.map +0 -1
- package/dist/runtime/tooling/registry.js +0 -166
- package/dist/runtime/tooling/registry.js.map +0 -1
- package/dist/runtime/tooling/task.d.ts +0 -37
- package/dist/runtime/tooling/task.d.ts.map +0 -1
- package/dist/runtime/tooling/task.js +0 -65
- package/dist/runtime/tooling/task.js.map +0 -1
- package/dist/runtime/tooling/todo.d.ts +0 -34
- package/dist/runtime/tooling/todo.d.ts.map +0 -1
- package/dist/runtime/tooling/todo.js +0 -96
- package/dist/runtime/tooling/todo.js.map +0 -1
- package/dist/runtime/tooling/truncate.d.ts +0 -2
- package/dist/runtime/tooling/truncate.d.ts.map +0 -1
- package/dist/runtime/tooling/truncate.js +0 -2
- package/dist/runtime/tooling/truncate.js.map +0 -1
- package/dist/runtime/tooling/webfetch.d.ts +0 -2
- package/dist/runtime/tooling/webfetch.d.ts.map +0 -1
- package/dist/runtime/tooling/webfetch.js +0 -2
- package/dist/runtime/tooling/webfetch.js.map +0 -1
- package/dist/runtime/tooling/websearch.d.ts +0 -2
- package/dist/runtime/tooling/websearch.d.ts.map +0 -1
- package/dist/runtime/tooling/websearch.js +0 -2
- package/dist/runtime/tooling/websearch.js.map +0 -1
- package/dist/runtime/tooling/write.d.ts +0 -2
- package/dist/runtime/tooling/write.d.ts.map +0 -1
- package/dist/runtime/tooling/write.js +0 -2
- package/dist/runtime/tooling/write.js.map +0 -1
- package/dist/telemetry/core/config.d.ts +0 -28
- package/dist/telemetry/core/config.d.ts.map +0 -1
- package/dist/telemetry/core/config.js +0 -150
- package/dist/telemetry/core/config.js.map +0 -1
- package/dist/telemetry/core/event-bus.d.ts +0 -15
- package/dist/telemetry/core/event-bus.d.ts.map +0 -1
- package/dist/telemetry/core/event-bus.js +0 -37
- package/dist/telemetry/core/event-bus.js.map +0 -1
- package/dist/telemetry/core/index.d.ts +0 -12
- package/dist/telemetry/core/index.d.ts.map +0 -1
- package/dist/telemetry/core/index.js +0 -14
- package/dist/telemetry/core/index.js.map +0 -1
- package/dist/telemetry/core/observability.d.ts +0 -63
- package/dist/telemetry/core/observability.d.ts.map +0 -1
- package/dist/telemetry/core/observability.js +0 -127
- package/dist/telemetry/core/observability.js.map +0 -1
- package/dist/telemetry/core/span.d.ts +0 -37
- package/dist/telemetry/core/span.d.ts.map +0 -1
- package/dist/telemetry/core/span.js +0 -90
- package/dist/telemetry/core/span.js.map +0 -1
- package/dist/telemetry/core/tracer.d.ts +0 -22
- package/dist/telemetry/core/tracer.d.ts.map +0 -1
- package/dist/telemetry/core/tracer.js +0 -79
- package/dist/telemetry/core/tracer.js.map +0 -1
- package/dist/telemetry/core/types.d.ts +0 -155
- package/dist/telemetry/core/types.d.ts.map +0 -1
- package/dist/telemetry/core/types.js +0 -38
- package/dist/telemetry/core/types.js.map +0 -1
- package/dist/telemetry/exporters/base-exporter.d.ts +0 -16
- package/dist/telemetry/exporters/base-exporter.d.ts.map +0 -1
- package/dist/telemetry/exporters/base-exporter.js +0 -26
- package/dist/telemetry/exporters/base-exporter.js.map +0 -1
- package/dist/telemetry/exporters/console-exporter.d.ts +0 -22
- package/dist/telemetry/exporters/console-exporter.d.ts.map +0 -1
- package/dist/telemetry/exporters/console-exporter.js +0 -80
- package/dist/telemetry/exporters/console-exporter.js.map +0 -1
- package/dist/telemetry/exporters/file-exporter.d.ts +0 -31
- package/dist/telemetry/exporters/file-exporter.d.ts.map +0 -1
- package/dist/telemetry/exporters/file-exporter.js +0 -120
- package/dist/telemetry/exporters/file-exporter.js.map +0 -1
- package/dist/telemetry/exporters/index.d.ts +0 -12
- package/dist/telemetry/exporters/index.d.ts.map +0 -1
- package/dist/telemetry/exporters/index.js +0 -11
- package/dist/telemetry/exporters/index.js.map +0 -1
- package/dist/telemetry/exporters/langfuse-exporter.d.ts +0 -27
- package/dist/telemetry/exporters/langfuse-exporter.d.ts.map +0 -1
- package/dist/telemetry/exporters/langfuse-exporter.js +0 -146
- package/dist/telemetry/exporters/langfuse-exporter.js.map +0 -1
- package/dist/telemetry/exporters/sentry-exporter.d.ts +0 -22
- package/dist/telemetry/exporters/sentry-exporter.d.ts.map +0 -1
- package/dist/telemetry/exporters/sentry-exporter.js +0 -121
- package/dist/telemetry/exporters/sentry-exporter.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -3
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -3
- package/dist/telemetry/index.js.map +0 -1
- package/dist/vendor/observe/adapters/agent-event-adapter.d.ts +0 -28
- package/dist/vendor/observe/adapters/agent-event-adapter.d.ts.map +0 -1
- package/dist/vendor/observe/adapters/agent-event-adapter.js +0 -136
- package/dist/vendor/observe/adapters/agent-event-adapter.js.map +0 -1
- package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts +0 -24
- package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts.map +0 -1
- package/dist/vendor/observe/adapters/ai-stream-adapter.js +0 -118
- package/dist/vendor/observe/adapters/ai-stream-adapter.js.map +0 -1
- package/dist/vendor/observe/artifacts/content-store.d.ts +0 -12
- package/dist/vendor/observe/artifacts/content-store.d.ts.map +0 -1
- package/dist/vendor/observe/artifacts/content-store.js +0 -2
- package/dist/vendor/observe/artifacts/content-store.js.map +0 -1
- package/dist/vendor/observe/artifacts/file-content-store.d.ts +0 -16
- package/dist/vendor/observe/artifacts/file-content-store.d.ts.map +0 -1
- package/dist/vendor/observe/artifacts/file-content-store.js +0 -43
- package/dist/vendor/observe/artifacts/file-content-store.js.map +0 -1
- package/dist/vendor/observe/batcher.d.ts +0 -27
- package/dist/vendor/observe/batcher.d.ts.map +0 -1
- package/dist/vendor/observe/batcher.js +0 -66
- package/dist/vendor/observe/batcher.js.map +0 -1
- package/dist/vendor/observe/client/artifacts-manager.d.ts +0 -29
- package/dist/vendor/observe/client/artifacts-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/artifacts-manager.js +0 -120
- package/dist/vendor/observe/client/artifacts-manager.js.map +0 -1
- package/dist/vendor/observe/client/datasets-manager.d.ts +0 -16
- package/dist/vendor/observe/client/datasets-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/datasets-manager.js +0 -27
- package/dist/vendor/observe/client/datasets-manager.js.map +0 -1
- package/dist/vendor/observe/client/experiments-manager.d.ts +0 -61
- package/dist/vendor/observe/client/experiments-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/experiments-manager.js +0 -132
- package/dist/vendor/observe/client/experiments-manager.js.map +0 -1
- package/dist/vendor/observe/client/index.d.ts +0 -9
- package/dist/vendor/observe/client/index.d.ts.map +0 -1
- package/dist/vendor/observe/client/index.js +0 -9
- package/dist/vendor/observe/client/index.js.map +0 -1
- package/dist/vendor/observe/client/observe-client.d.ts +0 -30
- package/dist/vendor/observe/client/observe-client.d.ts.map +0 -1
- package/dist/vendor/observe/client/observe-client.js +0 -22
- package/dist/vendor/observe/client/observe-client.js.map +0 -1
- package/dist/vendor/observe/client/prompts-manager.d.ts +0 -17
- package/dist/vendor/observe/client/prompts-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/prompts-manager.js +0 -38
- package/dist/vendor/observe/client/prompts-manager.js.map +0 -1
- package/dist/vendor/observe/client/scores-manager.d.ts +0 -10
- package/dist/vendor/observe/client/scores-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/scores-manager.js +0 -15
- package/dist/vendor/observe/client/scores-manager.js.map +0 -1
- package/dist/vendor/observe/client/sessions-manager.d.ts +0 -15
- package/dist/vendor/observe/client/sessions-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/sessions-manager.js +0 -24
- package/dist/vendor/observe/client/sessions-manager.js.map +0 -1
- package/dist/vendor/observe/client/traces-manager.d.ts +0 -23
- package/dist/vendor/observe/client/traces-manager.d.ts.map +0 -1
- package/dist/vendor/observe/client/traces-manager.js +0 -39
- package/dist/vendor/observe/client/traces-manager.js.map +0 -1
- package/dist/vendor/observe/console-exporter.d.ts +0 -11
- package/dist/vendor/observe/console-exporter.d.ts.map +0 -1
- package/dist/vendor/observe/console-exporter.js +0 -18
- package/dist/vendor/observe/console-exporter.js.map +0 -1
- package/dist/vendor/observe/context.d.ts +0 -4
- package/dist/vendor/observe/context.d.ts.map +0 -1
- package/dist/vendor/observe/context.js +0 -9
- package/dist/vendor/observe/context.js.map +0 -1
- package/dist/vendor/observe/entities/artifacts.d.ts +0 -46
- package/dist/vendor/observe/entities/artifacts.d.ts.map +0 -1
- package/dist/vendor/observe/entities/artifacts.js +0 -2
- package/dist/vendor/observe/entities/artifacts.js.map +0 -1
- package/dist/vendor/observe/entities/datasets.d.ts +0 -37
- package/dist/vendor/observe/entities/datasets.d.ts.map +0 -1
- package/dist/vendor/observe/entities/datasets.js +0 -2
- package/dist/vendor/observe/entities/datasets.js.map +0 -1
- package/dist/vendor/observe/entities/experiments.d.ts +0 -66
- package/dist/vendor/observe/entities/experiments.d.ts.map +0 -1
- package/dist/vendor/observe/entities/experiments.js +0 -2
- package/dist/vendor/observe/entities/experiments.js.map +0 -1
- package/dist/vendor/observe/entities/index.d.ts +0 -9
- package/dist/vendor/observe/entities/index.d.ts.map +0 -1
- package/dist/vendor/observe/entities/index.js +0 -9
- package/dist/vendor/observe/entities/index.js.map +0 -1
- package/dist/vendor/observe/entities/prompts.d.ts +0 -25
- package/dist/vendor/observe/entities/prompts.d.ts.map +0 -1
- package/dist/vendor/observe/entities/prompts.js +0 -2
- package/dist/vendor/observe/entities/prompts.js.map +0 -1
- package/dist/vendor/observe/entities/scores.d.ts +0 -28
- package/dist/vendor/observe/entities/scores.d.ts.map +0 -1
- package/dist/vendor/observe/entities/scores.js +0 -2
- package/dist/vendor/observe/entities/scores.js.map +0 -1
- package/dist/vendor/observe/entities/sessions.d.ts +0 -36
- package/dist/vendor/observe/entities/sessions.d.ts.map +0 -1
- package/dist/vendor/observe/entities/sessions.js +0 -2
- package/dist/vendor/observe/entities/sessions.js.map +0 -1
- package/dist/vendor/observe/entities/shared.d.ts +0 -26
- package/dist/vendor/observe/entities/shared.d.ts.map +0 -1
- package/dist/vendor/observe/entities/shared.js +0 -2
- package/dist/vendor/observe/entities/shared.js.map +0 -1
- package/dist/vendor/observe/entities/traces.d.ts +0 -59
- package/dist/vendor/observe/entities/traces.d.ts.map +0 -1
- package/dist/vendor/observe/entities/traces.js +0 -2
- package/dist/vendor/observe/entities/traces.js.map +0 -1
- package/dist/vendor/observe/exporter.d.ts +0 -2
- package/dist/vendor/observe/exporter.d.ts.map +0 -1
- package/dist/vendor/observe/exporter.js +0 -2
- package/dist/vendor/observe/exporter.js.map +0 -1
- package/dist/vendor/observe/file-exporter.d.ts +0 -16
- package/dist/vendor/observe/file-exporter.d.ts.map +0 -1
- package/dist/vendor/observe/file-exporter.js +0 -39
- package/dist/vendor/observe/file-exporter.js.map +0 -1
- package/dist/vendor/observe/global.d.ts +0 -6
- package/dist/vendor/observe/global.d.ts.map +0 -1
- package/dist/vendor/observe/global.js +0 -17
- package/dist/vendor/observe/global.js.map +0 -1
- package/dist/vendor/observe/index.d.ts +0 -24
- package/dist/vendor/observe/index.d.ts.map +0 -1
- package/dist/vendor/observe/index.js +0 -24
- package/dist/vendor/observe/index.js.map +0 -1
- package/dist/vendor/observe/noop.d.ts +0 -17
- package/dist/vendor/observe/noop.d.ts.map +0 -1
- package/dist/vendor/observe/noop.js +0 -80
- package/dist/vendor/observe/noop.js.map +0 -1
- package/dist/vendor/observe/privacy.d.ts +0 -18
- package/dist/vendor/observe/privacy.d.ts.map +0 -1
- package/dist/vendor/observe/privacy.js +0 -160
- package/dist/vendor/observe/privacy.js.map +0 -1
- package/dist/vendor/observe/query/simple-query-client.d.ts +0 -11
- package/dist/vendor/observe/query/simple-query-client.d.ts.map +0 -1
- package/dist/vendor/observe/query/simple-query-client.js +0 -31
- package/dist/vendor/observe/query/simple-query-client.js.map +0 -1
- package/dist/vendor/observe/replay/session-replay.d.ts +0 -20
- package/dist/vendor/observe/replay/session-replay.d.ts.map +0 -1
- package/dist/vendor/observe/replay/session-replay.js +0 -180
- package/dist/vendor/observe/replay/session-replay.js.map +0 -1
- package/dist/vendor/observe/runtime.d.ts +0 -27
- package/dist/vendor/observe/runtime.d.ts.map +0 -1
- package/dist/vendor/observe/runtime.js +0 -177
- package/dist/vendor/observe/runtime.js.map +0 -1
- package/dist/vendor/observe/server/dashboard-html.d.ts +0 -6
- package/dist/vendor/observe/server/dashboard-html.d.ts.map +0 -1
- package/dist/vendor/observe/server/dashboard-html.js +0 -305
- package/dist/vendor/observe/server/dashboard-html.js.map +0 -1
- package/dist/vendor/observe/server/http-observe-server.d.ts +0 -62
- package/dist/vendor/observe/server/http-observe-server.d.ts.map +0 -1
- package/dist/vendor/observe/server/http-observe-server.js +0 -418
- package/dist/vendor/observe/server/http-observe-server.js.map +0 -1
- package/dist/vendor/observe/server/in-memory-observe-server.d.ts +0 -20
- package/dist/vendor/observe/server/in-memory-observe-server.d.ts.map +0 -1
- package/dist/vendor/observe/server/in-memory-observe-server.js +0 -76
- package/dist/vendor/observe/server/in-memory-observe-server.js.map +0 -1
- package/dist/vendor/observe/span.d.ts +0 -45
- package/dist/vendor/observe/span.d.ts.map +0 -1
- package/dist/vendor/observe/span.js +0 -110
- package/dist/vendor/observe/span.js.map +0 -1
- package/dist/vendor/observe/store/contracts.d.ts +0 -59
- package/dist/vendor/observe/store/contracts.d.ts.map +0 -1
- package/dist/vendor/observe/store/contracts.js +0 -2
- package/dist/vendor/observe/store/contracts.js.map +0 -1
- package/dist/vendor/observe/store/file-control-plane-store.d.ts +0 -33
- package/dist/vendor/observe/store/file-control-plane-store.d.ts.map +0 -1
- package/dist/vendor/observe/store/file-control-plane-store.js +0 -146
- package/dist/vendor/observe/store/file-control-plane-store.js.map +0 -1
- package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts +0 -84
- package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts.map +0 -1
- package/dist/vendor/observe/store/in-memory-control-plane-store.js +0 -447
- package/dist/vendor/observe/store/in-memory-control-plane-store.js.map +0 -1
- package/dist/vendor/observe/store/index.d.ts +0 -4
- package/dist/vendor/observe/store/index.d.ts.map +0 -1
- package/dist/vendor/observe/store/index.js +0 -4
- package/dist/vendor/observe/store/index.js.map +0 -1
- package/dist/vendor/observe/types.d.ts +0 -246
- package/dist/vendor/observe/types.d.ts.map +0 -1
- package/dist/vendor/observe/types.js +0 -152
- package/dist/vendor/observe/types.js.map +0 -1
- package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts +0 -25
- package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts.map +0 -1
- package/dist/vendor/observe/worker/in-memory-observe-worker.js +0 -82
- package/dist/vendor/observe/worker/in-memory-observe-worker.js.map +0 -1
- package/guides/CLAUDE_CODEX_CLI_INTEGRATION_PLAN.md +0 -321
- package/guides/INDUSAGI_MONO_MIT_REMOVAL_GUIDE.md +0 -2132
- package/guides/INDUSVX_OBSERVE_FULL_INTEGRATION_REPORT.md +0 -543
- package/guides/OBSERVE_DEEP_VALIDATION.md +0 -252
- package/guides/OBSERVE_LOCAL_TESTING.md +0 -183
- package/guides/OPTION3_PROVIDER_ADAPTER_RUNTIME_PLAN.md +0 -370
- package/guides/SAME_TO_SAME_PARITY_REPORT.md +0 -312
- package/tasks/patch-indusagi-react-host.mjs +0 -247
|
@@ -1,1511 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ============================================================================
|
|
3
|
-
* THEME SYSTEM - Comprehensive Documentation
|
|
4
|
-
* ============================================================================
|
|
5
|
-
*
|
|
6
|
-
* ## ARCHITECTURE OVERVIEW
|
|
7
|
-
*
|
|
8
|
-
* The theme system is a multi-layered color and styling engine that powers the
|
|
9
|
-
* terminal UI of the Indusagi coding agent. It manages:
|
|
10
|
-
*
|
|
11
|
-
* - Terminal color detection and adaptation (truecolor vs 256-color)
|
|
12
|
-
* - Color variable resolution with circular reference detection
|
|
13
|
-
* - Theme JSON parsing with comprehensive validation
|
|
14
|
-
* - ANSI escape code generation for terminal output
|
|
15
|
-
* - Hot-reload capability for custom themes via file watchers
|
|
16
|
-
* - Theme registration for programmatically-defined themes
|
|
17
|
-
* - HTML export color conversion for session recordings
|
|
18
|
-
*
|
|
19
|
-
* The system is built on four core pillars:
|
|
20
|
-
* 1. Color Resolution: Convert hex/indices to terminal codes
|
|
21
|
-
* 2. Theme Loading: Parse JSON and validate against schema
|
|
22
|
-
* 3. Global State: Singleton pattern via globalThis for module consistency
|
|
23
|
-
* 4. Hot Reload: File watchers for development-time theme iteration
|
|
24
|
-
*
|
|
25
|
-
* ## THEME STRUCTURE
|
|
26
|
-
*
|
|
27
|
-
* Each theme (JSON file) contains:
|
|
28
|
-
*
|
|
29
|
-
* ```json
|
|
30
|
-
* {
|
|
31
|
-
* "name": "dark",
|
|
32
|
-
* "vars": {
|
|
33
|
-
* "primary": "#00d7ff",
|
|
34
|
-
* "secondary": "primary" // Variable reference
|
|
35
|
-
* },
|
|
36
|
-
* "colors": {
|
|
37
|
-
* // Core UI colors (11)
|
|
38
|
-
* "accent": "primary",
|
|
39
|
-
* "border": "#5f87ff",
|
|
40
|
-
* "success": "#b5bd68",
|
|
41
|
-
* ...
|
|
42
|
-
*
|
|
43
|
-
* // Message backgrounds (6)
|
|
44
|
-
* "selectedBg": "#3a3a4a",
|
|
45
|
-
* "userMessageBg": "#343541",
|
|
46
|
-
* ...
|
|
47
|
-
*
|
|
48
|
-
* // Markdown styling (10)
|
|
49
|
-
* "mdHeading": "#f0c674",
|
|
50
|
-
* "mdLink": "#81a2be",
|
|
51
|
-
* ...
|
|
52
|
-
*
|
|
53
|
-
* // Diff colors (3)
|
|
54
|
-
* "toolDiffAdded": "#b5bd68",
|
|
55
|
-
* "toolDiffRemoved": "#cc6666",
|
|
56
|
-
* ...
|
|
57
|
-
*
|
|
58
|
-
* // Syntax highlighting (9)
|
|
59
|
-
* "syntaxKeyword": "#569CD6",
|
|
60
|
-
* "syntaxString": "#CE9178",
|
|
61
|
-
* ...
|
|
62
|
-
*
|
|
63
|
-
* // Thinking level indicators (6)
|
|
64
|
-
* "thinkingOff": "#505050",
|
|
65
|
-
* "thinkingHigh": "#b294bb",
|
|
66
|
-
* ...
|
|
67
|
-
* },
|
|
68
|
-
* "export": {
|
|
69
|
-
* "pageBg": "#18181e",
|
|
70
|
-
* "cardBg": "#1e1e24",
|
|
71
|
-
* "infoBg": "#3c3728"
|
|
72
|
-
* }
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* ### Color Categories
|
|
77
|
-
*
|
|
78
|
-
* **Core UI Colors (11):**
|
|
79
|
-
* - accent: Primary interactive color (logo, selection, cursor)
|
|
80
|
-
* - border: Default borders and dividers
|
|
81
|
-
* - borderAccent: Highlighted borders (active input)
|
|
82
|
-
* - borderMuted: Subtle borders (inactive elements)
|
|
83
|
-
* - success: Positive feedback (✓ symbols, success states)
|
|
84
|
-
* - error: Negative feedback (✗ symbols, errors)
|
|
85
|
-
* - warning: Cautionary states (△ symbols, warnings)
|
|
86
|
-
* - muted: Secondary text (descriptions, metadata)
|
|
87
|
-
* - dim: Very subtle text (timestamps, hints)
|
|
88
|
-
* - text: Default text color (usually empty = terminal default)
|
|
89
|
-
* - thinkingText: Text inside thinking blocks
|
|
90
|
-
*
|
|
91
|
-
* **Backgrounds (6):**
|
|
92
|
-
* - selectedBg: Selected list items, active sections
|
|
93
|
-
* - userMessageBg: User input message container
|
|
94
|
-
* - customMessageBg: Hook-injected message background
|
|
95
|
-
* - toolPendingBg: Tool execution during processing
|
|
96
|
-
* - toolSuccessBg: Tool execution after success
|
|
97
|
-
* - toolErrorBg: Tool execution after error
|
|
98
|
-
*
|
|
99
|
-
* **Message Content (8):**
|
|
100
|
-
* - userMessageText, customMessageText: Text inside messages
|
|
101
|
-
* - customMessageLabel: Label/tag color for custom messages
|
|
102
|
-
* - toolTitle: Tool name and execution badges
|
|
103
|
-
* - toolOutput: Tool stdout/stderr content
|
|
104
|
-
*
|
|
105
|
-
* **Markdown Formatting (10):**
|
|
106
|
-
* - mdHeading: H1, H2, H3 text
|
|
107
|
-
* - mdLink: Hyperlink text
|
|
108
|
-
* - mdLinkUrl: URL part of link
|
|
109
|
-
* - mdCode: Inline `code` elements
|
|
110
|
-
* - mdCodeBlock: Code block content
|
|
111
|
-
* - mdCodeBlockBorder: Fence markers (```)
|
|
112
|
-
* - mdQuote: Blockquote text
|
|
113
|
-
* - mdQuoteBorder: Blockquote border (>)
|
|
114
|
-
* - mdHr: Horizontal rules
|
|
115
|
-
* - mdListBullet: List markers (-, *, numbers)
|
|
116
|
-
*
|
|
117
|
-
* **Diff Visualization (3):**
|
|
118
|
-
* - toolDiffAdded: + (added lines)
|
|
119
|
-
* - toolDiffRemoved: - (removed lines)
|
|
120
|
-
* - toolDiffContext: unchanged context lines
|
|
121
|
-
*
|
|
122
|
-
* **Syntax Highlighting (9):**
|
|
123
|
-
* - syntaxKeyword: if, for, const, etc.
|
|
124
|
-
* - syntaxString: "string literals"
|
|
125
|
-
* - syntaxComment: // comments
|
|
126
|
-
* - syntaxNumber: 42, 3.14, etc.
|
|
127
|
-
* - syntaxType: Type, interface, class names
|
|
128
|
-
* - syntaxFunction: function() and method() calls
|
|
129
|
-
* - syntaxVariable: variable and parameter names
|
|
130
|
-
* - syntaxOperator: +, -, *, =, etc.
|
|
131
|
-
* - syntaxPunctuation: {}, [], (), etc.
|
|
132
|
-
*
|
|
133
|
-
* **Thinking Level Indicators (6):**
|
|
134
|
-
* - thinkingOff: No thinking (default border)
|
|
135
|
-
* - thinkingMinimal: level="minimal"
|
|
136
|
-
* - thinkingLow: level="low"
|
|
137
|
-
* - thinkingMedium: level="medium"
|
|
138
|
-
* - thinkingHigh: level="high"
|
|
139
|
-
* - thinkingXhigh: level="xhigh" (OpenAI extended thinking)
|
|
140
|
-
*
|
|
141
|
-
* **Special:**
|
|
142
|
-
* - bashMode: Editor border in bash mode
|
|
143
|
-
*
|
|
144
|
-
* ## COLOR VALUES
|
|
145
|
-
*
|
|
146
|
-
* Three formats supported:
|
|
147
|
-
*
|
|
148
|
-
* 1. **Hex colors**: "#RRGGBB" - RGB hex colors (e.g., "#ff0000")
|
|
149
|
-
* - Automatically downconverted to 256-color on limited terminals
|
|
150
|
-
* - Uses perceptual color distance (weighted RGB) for best mapping
|
|
151
|
-
* - Most accurate on modern terminals (Windows Terminal, iTerm, Kitty)
|
|
152
|
-
*
|
|
153
|
-
* 2. **256-color indices**: 0-255 - ANSI 256-color palette
|
|
154
|
-
* - 0-15: Basic colors (black, red, green, yellow, etc.)
|
|
155
|
-
* - 16-231: 6×6×6 RGB color cube (216 colors)
|
|
156
|
-
* - 232-255: Grayscale ramp (24 shades)
|
|
157
|
-
* - Good fallback for limited terminals
|
|
158
|
-
*
|
|
159
|
-
* 3. **Variable references**: "varName" - Reference to vars object
|
|
160
|
-
* - Allows reusable colors with DRY principle
|
|
161
|
-
* - Supports circular reference detection (prevents infinite loops)
|
|
162
|
-
* - Example: "accent" refers to vars.accent
|
|
163
|
-
*
|
|
164
|
-
* 4. **Empty string**: "" - Terminal default foreground/background
|
|
165
|
-
* - Inherits from terminal color scheme
|
|
166
|
-
* - Useful for text that should match terminal defaults
|
|
167
|
-
* - Common for "text" (uses terminal foreground)
|
|
168
|
-
*
|
|
169
|
-
* ## TERMINAL COLOR DETECTION
|
|
170
|
-
*
|
|
171
|
-
* The theme system automatically detects terminal capabilities:
|
|
172
|
-
*
|
|
173
|
-
* **Truecolor Detection (24-bit RGB):**
|
|
174
|
-
* - COLORTERM=truecolor or COLORTERM=24bit
|
|
175
|
-
* - Windows Terminal (WT_SESSION env var)
|
|
176
|
-
* - Modern Linux terminals (most default)
|
|
177
|
-
* - Assume truecolor unless explicitly limited (safest approach)
|
|
178
|
-
*
|
|
179
|
-
* **256-Color Fallback:**
|
|
180
|
-
* - Apple Terminal (TERM_PROGRAM=Apple_Terminal)
|
|
181
|
-
* - Dumb terminals (TERM=dumb, empty, or "linux")
|
|
182
|
-
* - Legacy systems without truecolor support
|
|
183
|
-
*
|
|
184
|
-
* When colors are downconverted from hex to 256-color:
|
|
185
|
-
* 1. Try to map to 6×6×6 RGB color cube (indices 16-231)
|
|
186
|
-
* 2. Check if color is nearly neutral (low saturation)
|
|
187
|
-
* 3. If neutral and closer to grayscale, use gray ramp (232-255)
|
|
188
|
-
* 4. Otherwise use RGB cube for best color representation
|
|
189
|
-
*
|
|
190
|
-
* ## HOW TO LOAD AND APPLY THEMES
|
|
191
|
-
*
|
|
192
|
-
* ### Initialization
|
|
193
|
-
*
|
|
194
|
-
* ```typescript
|
|
195
|
-
* import { initTheme, theme, onThemeChange } from "./theme/theme.js";
|
|
196
|
-
*
|
|
197
|
-
* // Initialize with auto-detected or named theme
|
|
198
|
-
* initTheme("dark"); // Load dark.json
|
|
199
|
-
* initTheme(); // Auto-detect based on terminal
|
|
200
|
-
*
|
|
201
|
-
* // Enable file watching for custom theme development
|
|
202
|
-
* initTheme("my-custom-theme", true);
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
* ### Runtime Switching
|
|
206
|
-
*
|
|
207
|
-
* ```typescript
|
|
208
|
-
* import { setTheme, getAvailableThemes } from "./theme/theme.js";
|
|
209
|
-
*
|
|
210
|
-
* // List all available themes
|
|
211
|
-
* const themes = getAvailableThemes(); // ["dark", "light", "my-custom"]
|
|
212
|
-
*
|
|
213
|
-
* // Switch theme at runtime
|
|
214
|
-
* const result = setTheme("light");
|
|
215
|
-
* if (!result.success) {
|
|
216
|
-
* console.error("Failed to load theme:", result.error);
|
|
217
|
-
* }
|
|
218
|
-
*
|
|
219
|
-
* // Listen for theme changes
|
|
220
|
-
* onThemeChange(() => {
|
|
221
|
-
* console.log("Theme changed, redraw UI");
|
|
222
|
-
* });
|
|
223
|
-
* ```
|
|
224
|
-
*
|
|
225
|
-
* ### Using Colors in Output
|
|
226
|
-
*
|
|
227
|
-
* ```typescript
|
|
228
|
-
* import { theme } from "./theme/theme.js";
|
|
229
|
-
*
|
|
230
|
-
* // Foreground colors
|
|
231
|
-
* const text = theme.fg("accent", "Hello");
|
|
232
|
-
* const code = theme.fg("mdCode", "`code`");
|
|
233
|
-
* const error = theme.fg("error", "✗ Failed");
|
|
234
|
-
*
|
|
235
|
-
* // Background colors
|
|
236
|
-
* const selected = theme.bg("selectedBg", " Item ");
|
|
237
|
-
* const userMsg = theme.bg("userMessageBg", " User input ");
|
|
238
|
-
*
|
|
239
|
-
* // Text styling
|
|
240
|
-
* const bold = theme.bold("Important");
|
|
241
|
-
* const italic = theme.italic("emphasis");
|
|
242
|
-
* const underline = theme.underline("link");
|
|
243
|
-
* const inverted = theme.inverse("highlight");
|
|
244
|
-
* const strike = theme.strikethrough("removed");
|
|
245
|
-
*
|
|
246
|
-
* // Combinations
|
|
247
|
-
* const styled = theme.fg("accent", theme.bold("Action"));
|
|
248
|
-
* ```
|
|
249
|
-
*
|
|
250
|
-
* ### For TUI Components
|
|
251
|
-
*
|
|
252
|
-
* ```typescript
|
|
253
|
-
* import { getMarkdownTheme, getEditorTheme } from "./theme/theme.js";
|
|
254
|
-
*
|
|
255
|
-
* // Markdown rendering
|
|
256
|
-
* const mdTheme = getMarkdownTheme();
|
|
257
|
-
* const heading = mdTheme.heading("# Title");
|
|
258
|
-
* const code = mdTheme.code("`var x = 1`");
|
|
259
|
-
* const block = mdTheme.codeBlock("function() { ... }");
|
|
260
|
-
*
|
|
261
|
-
* // Editor theming
|
|
262
|
-
* const editorTheme = getEditorTheme();
|
|
263
|
-
* const editor = new Editor(tui, editorTheme);
|
|
264
|
-
*
|
|
265
|
-
* // Select list theming
|
|
266
|
-
* const selectTheme = getSelectListTheme();
|
|
267
|
-
* ```
|
|
268
|
-
*
|
|
269
|
-
* ## HOT-RELOAD CAPABILITY
|
|
270
|
-
*
|
|
271
|
-
* The theme system supports file watching for development:
|
|
272
|
-
*
|
|
273
|
-
* ```typescript
|
|
274
|
-
* // Enable watcher for custom theme
|
|
275
|
-
* initTheme("my-theme", true);
|
|
276
|
-
*
|
|
277
|
-
* // As you edit ~/.indusagi/themes/my-theme.json:
|
|
278
|
-
* // 1. File watcher detects change
|
|
279
|
-
* // 2. Theme is automatically reloaded
|
|
280
|
-
* // 3. onThemeChange callback fires
|
|
281
|
-
* // 4. UI invalidates and re-renders with new colors
|
|
282
|
-
* ```
|
|
283
|
-
*
|
|
284
|
-
* ### How It Works
|
|
285
|
-
*
|
|
286
|
-
* 1. File watch only applies to custom themes (not built-in dark/light)
|
|
287
|
-
* 2. Debounced to 100ms to avoid rapid reloads during saves
|
|
288
|
-
* 3. Invalid JSON silently ignored (file might be mid-edit)
|
|
289
|
-
* 4. File deletion triggers fallback to dark theme
|
|
290
|
-
* 5. Single watcher instance maintained (previous closed first)
|
|
291
|
-
*
|
|
292
|
-
* ## JSON SCHEMA VALIDATION
|
|
293
|
-
*
|
|
294
|
-
* The theme system uses TypeBox for compile-time validation:
|
|
295
|
-
*
|
|
296
|
-
* **Enforced Requirements:**
|
|
297
|
-
* - `name`: string (theme identifier)
|
|
298
|
-
* - `colors`: object with all 45 required properties
|
|
299
|
-
* - `vars`: optional object of reusable colors
|
|
300
|
-
* - `export`: optional section for HTML export colors
|
|
301
|
-
*
|
|
302
|
-
* **Color Properties:**
|
|
303
|
-
* - Each color must be: hex string, 256-color index, or variable reference
|
|
304
|
-
* - Empty strings ("") allowed for terminal defaults
|
|
305
|
-
* - No typos in color names (validation catches these)
|
|
306
|
-
* - No undefined color references (caught at load time)
|
|
307
|
-
*
|
|
308
|
-
* **Validation Flow:**
|
|
309
|
-
* 1. Parse JSON file
|
|
310
|
-
* 2. Check against TypeBox schema
|
|
311
|
-
* 3. Validate all required colors present
|
|
312
|
-
* 4. Resolve variable references
|
|
313
|
-
* 5. Create Theme instance with ANSI codes
|
|
314
|
-
*
|
|
315
|
-
* **Error Messages:**
|
|
316
|
-
* ```
|
|
317
|
-
* Invalid theme "dark.json":
|
|
318
|
-
* Missing required color tokens:
|
|
319
|
-
* - accent
|
|
320
|
-
* - border
|
|
321
|
-
* - mdHeading
|
|
322
|
-
*
|
|
323
|
-
* Please add these colors to your theme's "colors" object.
|
|
324
|
-
* See the built-in themes (dark.json, light.json) for reference values.
|
|
325
|
-
* ```
|
|
326
|
-
*
|
|
327
|
-
* ## THEME REGISTRATION
|
|
328
|
-
*
|
|
329
|
-
* Themes can be registered programmatically (not just from files):
|
|
330
|
-
*
|
|
331
|
-
* ```typescript
|
|
332
|
-
* import { setRegisteredThemes, setTheme } from "./theme/theme.js";
|
|
333
|
-
*
|
|
334
|
-
* // Create theme programmatically
|
|
335
|
-
* const customTheme = new Theme(
|
|
336
|
-
* { accent: "#ff0000", border: "#00ff00", ... }, // fg colors
|
|
337
|
-
* { selectedBg: "#0000ff", ... }, // bg colors
|
|
338
|
-
* "truecolor",
|
|
339
|
-
* { name: "custom", sourcePath: undefined }
|
|
340
|
-
* );
|
|
341
|
-
*
|
|
342
|
-
* // Register it
|
|
343
|
-
* setRegisteredThemes([customTheme]);
|
|
344
|
-
*
|
|
345
|
-
* // Use it
|
|
346
|
-
* setTheme("custom");
|
|
347
|
-
* ```
|
|
348
|
-
*
|
|
349
|
-
* ## THEME FILE LOCATIONS
|
|
350
|
-
*
|
|
351
|
-
* Themes loaded from three locations (in priority order):
|
|
352
|
-
*
|
|
353
|
-
* 1. **Built-in themes**: `<package>/src/modes/interactive/theme/`
|
|
354
|
-
* - dark.json
|
|
355
|
-
* - light.json
|
|
356
|
-
* - Always available
|
|
357
|
-
*
|
|
358
|
-
* 2. **Custom themes**: `~/.indusagi/themes/`
|
|
359
|
-
* - User-created or downloaded themes
|
|
360
|
-
* - Overrides built-in with same name
|
|
361
|
-
* - Hot-reload enabled for development
|
|
362
|
-
*
|
|
363
|
-
* 3. **Registered themes**: In-memory via setRegisteredThemes()
|
|
364
|
-
* - Programmatic or extension themes
|
|
365
|
-
* - No file watching available
|
|
366
|
-
*
|
|
367
|
-
* ## CREATING CUSTOM THEMES
|
|
368
|
-
*
|
|
369
|
-
* See theme/README.md for complete custom theme creation guide.
|
|
370
|
-
* Themes are JSON files following theme-schema.json structure.
|
|
371
|
-
*
|
|
372
|
-
* Quick start:
|
|
373
|
-
* 1. Copy dark.json to ~/.indusagi/themes/my-theme.json
|
|
374
|
-
* 2. Edit color values (hex or 256-color indices)
|
|
375
|
-
* 3. Use setTheme("my-theme")
|
|
376
|
-
* 4. Enable hot-reload: initTheme("my-theme", true)
|
|
377
|
-
*
|
|
378
|
-
* ## PERFORMANCE CHARACTERISTICS
|
|
379
|
-
*
|
|
380
|
-
* - Theme loading: O(1) with caching
|
|
381
|
-
* - Color resolution: O(n) where n = color references depth
|
|
382
|
-
* - Circular reference detection: Tracked via Set
|
|
383
|
-
* - ANSI code generation: Pre-computed on theme load
|
|
384
|
-
* - Color lookup: O(1) HashMap access
|
|
385
|
-
* - File watching: Native fs.watch, minimal overhead
|
|
386
|
-
*
|
|
387
|
-
* ## MODULE CONSISTENCY
|
|
388
|
-
*
|
|
389
|
-
* The theme system uses globalThis (via Symbol.for) to ensure
|
|
390
|
-
* all module instances (tsx dev, production bundle) see the same
|
|
391
|
-
* theme instance. This is critical for consistent colors across
|
|
392
|
-
* the application during development.
|
|
393
|
-
*
|
|
394
|
-
* ```typescript
|
|
395
|
-
* // All of these see the same theme
|
|
396
|
-
* import { theme } from "./theme.ts";
|
|
397
|
-
* const t1 = theme;
|
|
398
|
-
*
|
|
399
|
-
* const { theme: t2 } = require("./theme.ts");
|
|
400
|
-
*
|
|
401
|
-
* // t1 === t2 (same instance from globalThis)
|
|
402
|
-
* ```
|
|
403
|
-
*
|
|
404
|
-
* ## EXPORTS FOR HTML SESSIONS
|
|
405
|
-
*
|
|
406
|
-
* When saving sessions as HTML:
|
|
407
|
-
*
|
|
408
|
-
* ```typescript
|
|
409
|
-
* import { getResolvedThemeColors, getThemeExportColors } from "./theme/theme.js";
|
|
410
|
-
*
|
|
411
|
-
* // All theme colors as CSS hex strings
|
|
412
|
-
* const colors = getResolvedThemeColors("dark");
|
|
413
|
-
*
|
|
414
|
-
* // Export-specific overrides (pageBg, cardBg, infoBg)
|
|
415
|
-
* const exportColors = getThemeExportColors("dark");
|
|
416
|
-
*
|
|
417
|
-
* // Check if theme is "light" for CSS media queries
|
|
418
|
-
* const isLight = isLightTheme("light");
|
|
419
|
-
* ```
|
|
420
|
-
*
|
|
421
|
-
* ============================================================================
|
|
422
|
-
*/
|
|
423
|
-
import * as fs from "node:fs";
|
|
424
|
-
import * as path from "node:path";
|
|
425
|
-
import { Type } from "@sinclair/typebox";
|
|
426
|
-
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
427
|
-
import chalk from "chalk";
|
|
428
|
-
import { highlight, supportsLanguage } from "cli-highlight";
|
|
429
|
-
import { getCustomThemesDir, getThemesDir } from "../../config.js";
|
|
430
|
-
// ============================================================================
|
|
431
|
-
// Types, schemas, and source normalization
|
|
432
|
-
// ============================================================================
|
|
433
|
-
const ColorValueSchema = Type.Union([
|
|
434
|
-
Type.String(),
|
|
435
|
-
Type.Integer({ minimum: 0, maximum: 255 }),
|
|
436
|
-
]);
|
|
437
|
-
const LegacyThemeJsonSchema = Type.Object({
|
|
438
|
-
$schema: Type.Optional(Type.String()),
|
|
439
|
-
name: Type.String(),
|
|
440
|
-
vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),
|
|
441
|
-
colors: Type.Object({
|
|
442
|
-
accent: ColorValueSchema,
|
|
443
|
-
border: ColorValueSchema,
|
|
444
|
-
borderAccent: ColorValueSchema,
|
|
445
|
-
borderMuted: ColorValueSchema,
|
|
446
|
-
success: ColorValueSchema,
|
|
447
|
-
error: ColorValueSchema,
|
|
448
|
-
warning: ColorValueSchema,
|
|
449
|
-
muted: ColorValueSchema,
|
|
450
|
-
dim: ColorValueSchema,
|
|
451
|
-
text: ColorValueSchema,
|
|
452
|
-
thinkingText: ColorValueSchema,
|
|
453
|
-
selectedBg: ColorValueSchema,
|
|
454
|
-
userMessageBg: ColorValueSchema,
|
|
455
|
-
userMessageText: ColorValueSchema,
|
|
456
|
-
customMessageBg: ColorValueSchema,
|
|
457
|
-
customMessageText: ColorValueSchema,
|
|
458
|
-
customMessageLabel: ColorValueSchema,
|
|
459
|
-
toolPendingBg: ColorValueSchema,
|
|
460
|
-
toolSuccessBg: ColorValueSchema,
|
|
461
|
-
toolErrorBg: ColorValueSchema,
|
|
462
|
-
toolTitle: ColorValueSchema,
|
|
463
|
-
toolOutput: ColorValueSchema,
|
|
464
|
-
mdHeading: ColorValueSchema,
|
|
465
|
-
mdLink: ColorValueSchema,
|
|
466
|
-
mdLinkUrl: ColorValueSchema,
|
|
467
|
-
mdCode: ColorValueSchema,
|
|
468
|
-
mdCodeBlock: ColorValueSchema,
|
|
469
|
-
mdCodeBlockBorder: ColorValueSchema,
|
|
470
|
-
mdQuote: ColorValueSchema,
|
|
471
|
-
mdQuoteBorder: ColorValueSchema,
|
|
472
|
-
mdHr: ColorValueSchema,
|
|
473
|
-
mdListBullet: ColorValueSchema,
|
|
474
|
-
toolDiffAdded: ColorValueSchema,
|
|
475
|
-
toolDiffRemoved: ColorValueSchema,
|
|
476
|
-
toolDiffContext: ColorValueSchema,
|
|
477
|
-
syntaxComment: ColorValueSchema,
|
|
478
|
-
syntaxKeyword: ColorValueSchema,
|
|
479
|
-
syntaxFunction: ColorValueSchema,
|
|
480
|
-
syntaxVariable: ColorValueSchema,
|
|
481
|
-
syntaxString: ColorValueSchema,
|
|
482
|
-
syntaxNumber: ColorValueSchema,
|
|
483
|
-
syntaxType: ColorValueSchema,
|
|
484
|
-
syntaxOperator: ColorValueSchema,
|
|
485
|
-
syntaxPunctuation: ColorValueSchema,
|
|
486
|
-
thinkingOff: ColorValueSchema,
|
|
487
|
-
thinkingMinimal: ColorValueSchema,
|
|
488
|
-
thinkingLow: ColorValueSchema,
|
|
489
|
-
thinkingMedium: ColorValueSchema,
|
|
490
|
-
thinkingHigh: ColorValueSchema,
|
|
491
|
-
thinkingXhigh: ColorValueSchema,
|
|
492
|
-
bashMode: ColorValueSchema,
|
|
493
|
-
}),
|
|
494
|
-
export: Type.Optional(Type.Object({
|
|
495
|
-
pageBg: Type.Optional(ColorValueSchema),
|
|
496
|
-
cardBg: Type.Optional(ColorValueSchema),
|
|
497
|
-
infoBg: Type.Optional(ColorValueSchema),
|
|
498
|
-
})),
|
|
499
|
-
});
|
|
500
|
-
const ThemeBlueprintJsonSchema = Type.Object({
|
|
501
|
-
$schema: Type.Optional(Type.String()),
|
|
502
|
-
name: Type.String(),
|
|
503
|
-
palette: Type.Optional(Type.Record(Type.String(), ColorValueSchema)),
|
|
504
|
-
chrome: Type.Object({
|
|
505
|
-
accent: ColorValueSchema,
|
|
506
|
-
border: ColorValueSchema,
|
|
507
|
-
borderAccent: ColorValueSchema,
|
|
508
|
-
borderMuted: ColorValueSchema,
|
|
509
|
-
success: ColorValueSchema,
|
|
510
|
-
error: ColorValueSchema,
|
|
511
|
-
warning: ColorValueSchema,
|
|
512
|
-
muted: ColorValueSchema,
|
|
513
|
-
dim: ColorValueSchema,
|
|
514
|
-
text: ColorValueSchema,
|
|
515
|
-
thinkingText: ColorValueSchema,
|
|
516
|
-
}),
|
|
517
|
-
surfaces: Type.Object({
|
|
518
|
-
selected: ColorValueSchema,
|
|
519
|
-
userMessage: ColorValueSchema,
|
|
520
|
-
userMessageText: ColorValueSchema,
|
|
521
|
-
customMessage: ColorValueSchema,
|
|
522
|
-
customMessageText: ColorValueSchema,
|
|
523
|
-
customMessageLabel: ColorValueSchema,
|
|
524
|
-
toolPending: ColorValueSchema,
|
|
525
|
-
toolSuccess: ColorValueSchema,
|
|
526
|
-
toolError: ColorValueSchema,
|
|
527
|
-
toolTitle: ColorValueSchema,
|
|
528
|
-
toolOutput: ColorValueSchema,
|
|
529
|
-
}),
|
|
530
|
-
markdown: Type.Object({
|
|
531
|
-
heading: ColorValueSchema,
|
|
532
|
-
link: ColorValueSchema,
|
|
533
|
-
linkUrl: ColorValueSchema,
|
|
534
|
-
inlineCode: ColorValueSchema,
|
|
535
|
-
codeBlock: ColorValueSchema,
|
|
536
|
-
codeFence: ColorValueSchema,
|
|
537
|
-
quote: ColorValueSchema,
|
|
538
|
-
quoteBorder: ColorValueSchema,
|
|
539
|
-
rule: ColorValueSchema,
|
|
540
|
-
listBullet: ColorValueSchema,
|
|
541
|
-
}),
|
|
542
|
-
diff: Type.Object({
|
|
543
|
-
added: ColorValueSchema,
|
|
544
|
-
removed: ColorValueSchema,
|
|
545
|
-
context: ColorValueSchema,
|
|
546
|
-
}),
|
|
547
|
-
syntax: Type.Object({
|
|
548
|
-
comment: ColorValueSchema,
|
|
549
|
-
keyword: ColorValueSchema,
|
|
550
|
-
functionName: ColorValueSchema,
|
|
551
|
-
variable: ColorValueSchema,
|
|
552
|
-
string: ColorValueSchema,
|
|
553
|
-
number: ColorValueSchema,
|
|
554
|
-
typeName: ColorValueSchema,
|
|
555
|
-
operator: ColorValueSchema,
|
|
556
|
-
punctuation: ColorValueSchema,
|
|
557
|
-
}),
|
|
558
|
-
thinking: Type.Object({
|
|
559
|
-
off: ColorValueSchema,
|
|
560
|
-
minimal: ColorValueSchema,
|
|
561
|
-
low: ColorValueSchema,
|
|
562
|
-
medium: ColorValueSchema,
|
|
563
|
-
high: ColorValueSchema,
|
|
564
|
-
xhigh: ColorValueSchema,
|
|
565
|
-
}),
|
|
566
|
-
modes: Type.Object({
|
|
567
|
-
bashBorder: ColorValueSchema,
|
|
568
|
-
}),
|
|
569
|
-
exportPalette: Type.Optional(Type.Object({
|
|
570
|
-
page: Type.Optional(ColorValueSchema),
|
|
571
|
-
card: Type.Optional(ColorValueSchema),
|
|
572
|
-
info: Type.Optional(ColorValueSchema),
|
|
573
|
-
})),
|
|
574
|
-
});
|
|
575
|
-
const validateLegacyThemeJson = TypeCompiler.Compile(LegacyThemeJsonSchema);
|
|
576
|
-
const validateThemeBlueprintJson = TypeCompiler.Compile(ThemeBlueprintJsonSchema);
|
|
577
|
-
function isThemeBlueprintJson(json) {
|
|
578
|
-
return Boolean(json) && typeof json === "object" && "chrome" in json;
|
|
579
|
-
}
|
|
580
|
-
function normalizeThemeSource(source) {
|
|
581
|
-
if (!isThemeBlueprintJson(source)) {
|
|
582
|
-
return source;
|
|
583
|
-
}
|
|
584
|
-
return {
|
|
585
|
-
$schema: source.$schema,
|
|
586
|
-
name: source.name,
|
|
587
|
-
vars: source.palette,
|
|
588
|
-
colors: {
|
|
589
|
-
accent: source.chrome.accent,
|
|
590
|
-
border: source.chrome.border,
|
|
591
|
-
borderAccent: source.chrome.borderAccent,
|
|
592
|
-
borderMuted: source.chrome.borderMuted,
|
|
593
|
-
success: source.chrome.success,
|
|
594
|
-
error: source.chrome.error,
|
|
595
|
-
warning: source.chrome.warning,
|
|
596
|
-
muted: source.chrome.muted,
|
|
597
|
-
dim: source.chrome.dim,
|
|
598
|
-
text: source.chrome.text,
|
|
599
|
-
thinkingText: source.chrome.thinkingText,
|
|
600
|
-
selectedBg: source.surfaces.selected,
|
|
601
|
-
userMessageBg: source.surfaces.userMessage,
|
|
602
|
-
userMessageText: source.surfaces.userMessageText,
|
|
603
|
-
customMessageBg: source.surfaces.customMessage,
|
|
604
|
-
customMessageText: source.surfaces.customMessageText,
|
|
605
|
-
customMessageLabel: source.surfaces.customMessageLabel,
|
|
606
|
-
toolPendingBg: source.surfaces.toolPending,
|
|
607
|
-
toolSuccessBg: source.surfaces.toolSuccess,
|
|
608
|
-
toolErrorBg: source.surfaces.toolError,
|
|
609
|
-
toolTitle: source.surfaces.toolTitle,
|
|
610
|
-
toolOutput: source.surfaces.toolOutput,
|
|
611
|
-
mdHeading: source.markdown.heading,
|
|
612
|
-
mdLink: source.markdown.link,
|
|
613
|
-
mdLinkUrl: source.markdown.linkUrl,
|
|
614
|
-
mdCode: source.markdown.inlineCode,
|
|
615
|
-
mdCodeBlock: source.markdown.codeBlock,
|
|
616
|
-
mdCodeBlockBorder: source.markdown.codeFence,
|
|
617
|
-
mdQuote: source.markdown.quote,
|
|
618
|
-
mdQuoteBorder: source.markdown.quoteBorder,
|
|
619
|
-
mdHr: source.markdown.rule,
|
|
620
|
-
mdListBullet: source.markdown.listBullet,
|
|
621
|
-
toolDiffAdded: source.diff.added,
|
|
622
|
-
toolDiffRemoved: source.diff.removed,
|
|
623
|
-
toolDiffContext: source.diff.context,
|
|
624
|
-
syntaxComment: source.syntax.comment,
|
|
625
|
-
syntaxKeyword: source.syntax.keyword,
|
|
626
|
-
syntaxFunction: source.syntax.functionName,
|
|
627
|
-
syntaxVariable: source.syntax.variable,
|
|
628
|
-
syntaxString: source.syntax.string,
|
|
629
|
-
syntaxNumber: source.syntax.number,
|
|
630
|
-
syntaxType: source.syntax.typeName,
|
|
631
|
-
syntaxOperator: source.syntax.operator,
|
|
632
|
-
syntaxPunctuation: source.syntax.punctuation,
|
|
633
|
-
thinkingOff: source.thinking.off,
|
|
634
|
-
thinkingMinimal: source.thinking.minimal,
|
|
635
|
-
thinkingLow: source.thinking.low,
|
|
636
|
-
thinkingMedium: source.thinking.medium,
|
|
637
|
-
thinkingHigh: source.thinking.high,
|
|
638
|
-
thinkingXhigh: source.thinking.xhigh,
|
|
639
|
-
bashMode: source.modes.bashBorder,
|
|
640
|
-
},
|
|
641
|
-
export: source.exportPalette
|
|
642
|
-
? {
|
|
643
|
-
pageBg: source.exportPalette.page,
|
|
644
|
-
cardBg: source.exportPalette.card,
|
|
645
|
-
infoBg: source.exportPalette.info,
|
|
646
|
-
}
|
|
647
|
-
: undefined,
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
// ============================================================================
|
|
651
|
-
// Color Utilities
|
|
652
|
-
// ============================================================================
|
|
653
|
-
function detectColorMode() {
|
|
654
|
-
const colorterm = process.env.COLORTERM;
|
|
655
|
-
if (colorterm === "truecolor" || colorterm === "24bit") {
|
|
656
|
-
return "truecolor";
|
|
657
|
-
}
|
|
658
|
-
// Windows Terminal supports truecolor
|
|
659
|
-
if (process.env.WT_SESSION) {
|
|
660
|
-
return "truecolor";
|
|
661
|
-
}
|
|
662
|
-
const term = process.env.TERM || "";
|
|
663
|
-
// Fall back to 256color for truly limited terminals
|
|
664
|
-
if (term === "dumb" || term === "" || term === "linux") {
|
|
665
|
-
return "256color";
|
|
666
|
-
}
|
|
667
|
-
// Terminal.app also doesn't support truecolor
|
|
668
|
-
if (process.env.TERM_PROGRAM === "Apple_Terminal") {
|
|
669
|
-
return "256color";
|
|
670
|
-
}
|
|
671
|
-
// Assume truecolor for everything else - virtually all modern terminals support it
|
|
672
|
-
return "truecolor";
|
|
673
|
-
}
|
|
674
|
-
function hexToRgb(hex) {
|
|
675
|
-
const cleaned = hex.replace("#", "");
|
|
676
|
-
if (cleaned.length !== 6) {
|
|
677
|
-
throw new Error(`Invalid hex color: ${hex}`);
|
|
678
|
-
}
|
|
679
|
-
const r = parseInt(cleaned.substring(0, 2), 16);
|
|
680
|
-
const g = parseInt(cleaned.substring(2, 4), 16);
|
|
681
|
-
const b = parseInt(cleaned.substring(4, 6), 16);
|
|
682
|
-
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
683
|
-
throw new Error(`Invalid hex color: ${hex}`);
|
|
684
|
-
}
|
|
685
|
-
return { r, g, b };
|
|
686
|
-
}
|
|
687
|
-
// The 6x6x6 color cube channel values (indices 0-5)
|
|
688
|
-
const CUBE_VALUES = [0, 95, 135, 175, 215, 255];
|
|
689
|
-
// Grayscale ramp values (indices 232-255, 24 grays from 8 to 238)
|
|
690
|
-
const GRAY_VALUES = Array.from({ length: 24 }, (_, i) => 8 + i * 10);
|
|
691
|
-
function findClosestCubeIndex(value) {
|
|
692
|
-
let minDist = Infinity;
|
|
693
|
-
let minIdx = 0;
|
|
694
|
-
for (let i = 0; i < CUBE_VALUES.length; i++) {
|
|
695
|
-
const dist = Math.abs(value - CUBE_VALUES[i]);
|
|
696
|
-
if (dist < minDist) {
|
|
697
|
-
minDist = dist;
|
|
698
|
-
minIdx = i;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
return minIdx;
|
|
702
|
-
}
|
|
703
|
-
function findClosestGrayIndex(gray) {
|
|
704
|
-
let minDist = Infinity;
|
|
705
|
-
let minIdx = 0;
|
|
706
|
-
for (let i = 0; i < GRAY_VALUES.length; i++) {
|
|
707
|
-
const dist = Math.abs(gray - GRAY_VALUES[i]);
|
|
708
|
-
if (dist < minDist) {
|
|
709
|
-
minDist = dist;
|
|
710
|
-
minIdx = i;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
return minIdx;
|
|
714
|
-
}
|
|
715
|
-
function colorDistance(r1, g1, b1, r2, g2, b2) {
|
|
716
|
-
// Weighted Euclidean distance (human eye is more sensitive to green)
|
|
717
|
-
const dr = r1 - r2;
|
|
718
|
-
const dg = g1 - g2;
|
|
719
|
-
const db = b1 - b2;
|
|
720
|
-
return dr * dr * 0.299 + dg * dg * 0.587 + db * db * 0.114;
|
|
721
|
-
}
|
|
722
|
-
function rgbTo256(r, g, b) {
|
|
723
|
-
// Find closest color in the 6x6x6 cube
|
|
724
|
-
const rIdx = findClosestCubeIndex(r);
|
|
725
|
-
const gIdx = findClosestCubeIndex(g);
|
|
726
|
-
const bIdx = findClosestCubeIndex(b);
|
|
727
|
-
const cubeR = CUBE_VALUES[rIdx];
|
|
728
|
-
const cubeG = CUBE_VALUES[gIdx];
|
|
729
|
-
const cubeB = CUBE_VALUES[bIdx];
|
|
730
|
-
const cubeIndex = 16 + 36 * rIdx + 6 * gIdx + bIdx;
|
|
731
|
-
const cubeDist = colorDistance(r, g, b, cubeR, cubeG, cubeB);
|
|
732
|
-
// Find closest grayscale
|
|
733
|
-
const gray = Math.round(0.299 * r + 0.587 * g + 0.114 * b);
|
|
734
|
-
const grayIdx = findClosestGrayIndex(gray);
|
|
735
|
-
const grayValue = GRAY_VALUES[grayIdx];
|
|
736
|
-
const grayIndex = 232 + grayIdx;
|
|
737
|
-
const grayDist = colorDistance(r, g, b, grayValue, grayValue, grayValue);
|
|
738
|
-
// Check if color has noticeable saturation (hue matters)
|
|
739
|
-
// If max-min spread is significant, prefer cube to preserve tint
|
|
740
|
-
const maxC = Math.max(r, g, b);
|
|
741
|
-
const minC = Math.min(r, g, b);
|
|
742
|
-
const spread = maxC - minC;
|
|
743
|
-
// Only consider grayscale if color is nearly neutral (spread < 10)
|
|
744
|
-
// AND grayscale is actually closer
|
|
745
|
-
if (spread < 10 && grayDist < cubeDist) {
|
|
746
|
-
return grayIndex;
|
|
747
|
-
}
|
|
748
|
-
return cubeIndex;
|
|
749
|
-
}
|
|
750
|
-
function hexTo256(hex) {
|
|
751
|
-
const { r, g, b } = hexToRgb(hex);
|
|
752
|
-
return rgbTo256(r, g, b);
|
|
753
|
-
}
|
|
754
|
-
function fgAnsi(color, mode) {
|
|
755
|
-
if (color === "")
|
|
756
|
-
return "\x1b[39m";
|
|
757
|
-
if (typeof color === "number")
|
|
758
|
-
return `\x1b[38;5;${color}m`;
|
|
759
|
-
if (color.startsWith("#")) {
|
|
760
|
-
if (mode === "truecolor") {
|
|
761
|
-
const { r, g, b } = hexToRgb(color);
|
|
762
|
-
return `\x1b[38;2;${r};${g};${b}m`;
|
|
763
|
-
}
|
|
764
|
-
else {
|
|
765
|
-
const index = hexTo256(color);
|
|
766
|
-
return `\x1b[38;5;${index}m`;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
throw new Error(`Invalid color value: ${color}`);
|
|
770
|
-
}
|
|
771
|
-
function bgAnsi(color, mode) {
|
|
772
|
-
if (color === "")
|
|
773
|
-
return "\x1b[49m";
|
|
774
|
-
if (typeof color === "number")
|
|
775
|
-
return `\x1b[48;5;${color}m`;
|
|
776
|
-
if (color.startsWith("#")) {
|
|
777
|
-
if (mode === "truecolor") {
|
|
778
|
-
const { r, g, b } = hexToRgb(color);
|
|
779
|
-
return `\x1b[48;2;${r};${g};${b}m`;
|
|
780
|
-
}
|
|
781
|
-
else {
|
|
782
|
-
const index = hexTo256(color);
|
|
783
|
-
return `\x1b[48;5;${index}m`;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
throw new Error(`Invalid color value: ${color}`);
|
|
787
|
-
}
|
|
788
|
-
function resolveVarRefs(value, vars, visited = new Set()) {
|
|
789
|
-
if (typeof value === "number" || value === "" || value.startsWith("#")) {
|
|
790
|
-
return value;
|
|
791
|
-
}
|
|
792
|
-
if (visited.has(value)) {
|
|
793
|
-
throw new Error(`Circular variable reference detected: ${value}`);
|
|
794
|
-
}
|
|
795
|
-
if (!(value in vars)) {
|
|
796
|
-
throw new Error(`Variable reference not found: ${value}`);
|
|
797
|
-
}
|
|
798
|
-
visited.add(value);
|
|
799
|
-
return resolveVarRefs(vars[value], vars, visited);
|
|
800
|
-
}
|
|
801
|
-
function resolveThemeColors(colors, vars = {}) {
|
|
802
|
-
const resolved = {};
|
|
803
|
-
for (const [key, value] of Object.entries(colors)) {
|
|
804
|
-
resolved[key] = resolveVarRefs(value, vars);
|
|
805
|
-
}
|
|
806
|
-
return resolved;
|
|
807
|
-
}
|
|
808
|
-
// ============================================================================
|
|
809
|
-
// Theme Class
|
|
810
|
-
// ============================================================================
|
|
811
|
-
export class Theme {
|
|
812
|
-
constructor(fgColors, bgColors, mode, options = {}) {
|
|
813
|
-
this.name = options.name;
|
|
814
|
-
this.sourcePath = options.sourcePath;
|
|
815
|
-
this.mode = mode;
|
|
816
|
-
this.fgColors = new Map();
|
|
817
|
-
for (const [key, value] of Object.entries(fgColors)) {
|
|
818
|
-
this.fgColors.set(key, fgAnsi(value, mode));
|
|
819
|
-
}
|
|
820
|
-
this.bgColors = new Map();
|
|
821
|
-
for (const [key, value] of Object.entries(bgColors)) {
|
|
822
|
-
this.bgColors.set(key, bgAnsi(value, mode));
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
fg(color, text) {
|
|
826
|
-
const ansi = this.fgColors.get(color);
|
|
827
|
-
if (!ansi)
|
|
828
|
-
throw new Error(`Unknown theme color: ${color}`);
|
|
829
|
-
return `${ansi}${text}\x1b[39m`; // Reset only foreground color
|
|
830
|
-
}
|
|
831
|
-
bg(color, text) {
|
|
832
|
-
const ansi = this.bgColors.get(color);
|
|
833
|
-
if (!ansi)
|
|
834
|
-
throw new Error(`Unknown theme background color: ${color}`);
|
|
835
|
-
return `${ansi}${text}\x1b[49m`; // Reset only background color
|
|
836
|
-
}
|
|
837
|
-
bold(text) {
|
|
838
|
-
return chalk.bold(text);
|
|
839
|
-
}
|
|
840
|
-
italic(text) {
|
|
841
|
-
return chalk.italic(text);
|
|
842
|
-
}
|
|
843
|
-
underline(text) {
|
|
844
|
-
return chalk.underline(text);
|
|
845
|
-
}
|
|
846
|
-
inverse(text) {
|
|
847
|
-
return chalk.inverse(text);
|
|
848
|
-
}
|
|
849
|
-
strikethrough(text) {
|
|
850
|
-
return chalk.strikethrough(text);
|
|
851
|
-
}
|
|
852
|
-
getFgAnsi(color) {
|
|
853
|
-
const ansi = this.fgColors.get(color);
|
|
854
|
-
if (!ansi)
|
|
855
|
-
throw new Error(`Unknown theme color: ${color}`);
|
|
856
|
-
return ansi;
|
|
857
|
-
}
|
|
858
|
-
getBgAnsi(color) {
|
|
859
|
-
const ansi = this.bgColors.get(color);
|
|
860
|
-
if (!ansi)
|
|
861
|
-
throw new Error(`Unknown theme background color: ${color}`);
|
|
862
|
-
return ansi;
|
|
863
|
-
}
|
|
864
|
-
getColorMode() {
|
|
865
|
-
return this.mode;
|
|
866
|
-
}
|
|
867
|
-
getThinkingBorderColor(level) {
|
|
868
|
-
// Map thinking levels to dedicated theme colors
|
|
869
|
-
switch (level) {
|
|
870
|
-
case "off":
|
|
871
|
-
return (str) => this.fg("thinkingOff", str);
|
|
872
|
-
case "minimal":
|
|
873
|
-
return (str) => this.fg("thinkingMinimal", str);
|
|
874
|
-
case "low":
|
|
875
|
-
return (str) => this.fg("thinkingLow", str);
|
|
876
|
-
case "medium":
|
|
877
|
-
return (str) => this.fg("thinkingMedium", str);
|
|
878
|
-
case "high":
|
|
879
|
-
return (str) => this.fg("thinkingHigh", str);
|
|
880
|
-
case "xhigh":
|
|
881
|
-
return (str) => this.fg("thinkingXhigh", str);
|
|
882
|
-
default:
|
|
883
|
-
return (str) => this.fg("thinkingOff", str);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
getBashModeBorderColor() {
|
|
887
|
-
return (str) => this.fg("bashMode", str);
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
// ============================================================================
|
|
891
|
-
// Theme Loading
|
|
892
|
-
// ============================================================================
|
|
893
|
-
let BUILTIN_THEMES;
|
|
894
|
-
function getBuiltinThemes() {
|
|
895
|
-
if (!BUILTIN_THEMES) {
|
|
896
|
-
const themesDir = getThemesDir();
|
|
897
|
-
const darkPath = path.join(themesDir, "dark.json");
|
|
898
|
-
const lightPath = path.join(themesDir, "light.json");
|
|
899
|
-
BUILTIN_THEMES = {
|
|
900
|
-
dark: parseThemeJsonContent(darkPath, fs.readFileSync(darkPath, "utf-8")),
|
|
901
|
-
light: parseThemeJsonContent(lightPath, fs.readFileSync(lightPath, "utf-8")),
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
return BUILTIN_THEMES;
|
|
905
|
-
}
|
|
906
|
-
export function getAvailableThemes() {
|
|
907
|
-
const themes = new Set(Object.keys(getBuiltinThemes()));
|
|
908
|
-
const customThemesDir = getCustomThemesDir();
|
|
909
|
-
if (fs.existsSync(customThemesDir)) {
|
|
910
|
-
const files = fs.readdirSync(customThemesDir);
|
|
911
|
-
for (const file of files) {
|
|
912
|
-
if (file.endsWith(".json")) {
|
|
913
|
-
themes.add(file.slice(0, -5));
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
for (const name of registeredThemes.keys()) {
|
|
918
|
-
themes.add(name);
|
|
919
|
-
}
|
|
920
|
-
return Array.from(themes).sort();
|
|
921
|
-
}
|
|
922
|
-
export function getAvailableThemesWithPaths() {
|
|
923
|
-
const themesDir = getThemesDir();
|
|
924
|
-
const customThemesDir = getCustomThemesDir();
|
|
925
|
-
const result = [];
|
|
926
|
-
// Built-in themes
|
|
927
|
-
for (const name of Object.keys(getBuiltinThemes())) {
|
|
928
|
-
result.push({ name, path: path.join(themesDir, `${name}.json`) });
|
|
929
|
-
}
|
|
930
|
-
// Custom themes
|
|
931
|
-
if (fs.existsSync(customThemesDir)) {
|
|
932
|
-
for (const file of fs.readdirSync(customThemesDir)) {
|
|
933
|
-
if (file.endsWith(".json")) {
|
|
934
|
-
const name = file.slice(0, -5);
|
|
935
|
-
if (!result.some((t) => t.name === name)) {
|
|
936
|
-
result.push({ name, path: path.join(customThemesDir, file) });
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
for (const [name, theme] of registeredThemes.entries()) {
|
|
942
|
-
if (!result.some((t) => t.name === name)) {
|
|
943
|
-
result.push({ name, path: theme.sourcePath });
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
return result.sort((a, b) => a.name.localeCompare(b.name));
|
|
947
|
-
}
|
|
948
|
-
function parseThemeJson(label, json) {
|
|
949
|
-
if (validateLegacyThemeJson.Check(json)) {
|
|
950
|
-
return json;
|
|
951
|
-
}
|
|
952
|
-
if (validateThemeBlueprintJson.Check(json)) {
|
|
953
|
-
return normalizeThemeSource(json);
|
|
954
|
-
}
|
|
955
|
-
const legacyErrors = Array.from(validateLegacyThemeJson.Errors(json));
|
|
956
|
-
const blueprintErrors = Array.from(validateThemeBlueprintJson.Errors(json));
|
|
957
|
-
const missingLegacyColors = [];
|
|
958
|
-
const legacyOtherErrors = [];
|
|
959
|
-
const blueprintErrorsFormatted = [];
|
|
960
|
-
for (const error of legacyErrors) {
|
|
961
|
-
const match = error.path.match(/^\/colors\/(\w+)$/);
|
|
962
|
-
if (match && error.message.includes("Required")) {
|
|
963
|
-
missingLegacyColors.push(match[1]);
|
|
964
|
-
}
|
|
965
|
-
else {
|
|
966
|
-
legacyOtherErrors.push(` - ${error.path}: ${error.message}`);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
for (const error of blueprintErrors) {
|
|
970
|
-
blueprintErrorsFormatted.push(` - ${error.path}: ${error.message}`);
|
|
971
|
-
}
|
|
972
|
-
const sections = [`Invalid theme "${label}":`];
|
|
973
|
-
if (missingLegacyColors.length > 0) {
|
|
974
|
-
sections.push("", "Legacy format is missing required color tokens:", ...missingLegacyColors.map((token) => ` - ${token}`));
|
|
975
|
-
}
|
|
976
|
-
if (legacyOtherErrors.length > 0) {
|
|
977
|
-
sections.push("", "Legacy format validation details:", ...legacyOtherErrors);
|
|
978
|
-
}
|
|
979
|
-
if (blueprintErrorsFormatted.length > 0) {
|
|
980
|
-
sections.push("", "Blueprint format validation details:", ...blueprintErrorsFormatted);
|
|
981
|
-
}
|
|
982
|
-
sections.push("", "Supported formats:", " - legacy themes with vars/colors/export", " - blueprint themes with palette/chrome/surfaces/markdown/diff/syntax/thinking/modes");
|
|
983
|
-
throw new Error(sections.join("\n"));
|
|
984
|
-
}
|
|
985
|
-
function parseThemeJsonContent(label, content) {
|
|
986
|
-
let json;
|
|
987
|
-
try {
|
|
988
|
-
json = JSON.parse(content);
|
|
989
|
-
}
|
|
990
|
-
catch (error) {
|
|
991
|
-
throw new Error(`Failed to parse theme ${label}: ${error}`);
|
|
992
|
-
}
|
|
993
|
-
return parseThemeJson(label, json);
|
|
994
|
-
}
|
|
995
|
-
function loadThemeJson(name) {
|
|
996
|
-
const builtinThemes = getBuiltinThemes();
|
|
997
|
-
if (name in builtinThemes) {
|
|
998
|
-
return builtinThemes[name];
|
|
999
|
-
}
|
|
1000
|
-
const registeredTheme = registeredThemes.get(name);
|
|
1001
|
-
if (registeredTheme?.sourcePath) {
|
|
1002
|
-
const content = fs.readFileSync(registeredTheme.sourcePath, "utf-8");
|
|
1003
|
-
return parseThemeJsonContent(registeredTheme.sourcePath, content);
|
|
1004
|
-
}
|
|
1005
|
-
if (registeredTheme) {
|
|
1006
|
-
throw new Error(`Theme "${name}" does not have a source path for export`);
|
|
1007
|
-
}
|
|
1008
|
-
const customThemesDir = getCustomThemesDir();
|
|
1009
|
-
const themePath = path.join(customThemesDir, `${name}.json`);
|
|
1010
|
-
if (!fs.existsSync(themePath)) {
|
|
1011
|
-
throw new Error(`Theme not found: ${name}`);
|
|
1012
|
-
}
|
|
1013
|
-
const content = fs.readFileSync(themePath, "utf-8");
|
|
1014
|
-
return parseThemeJsonContent(name, content);
|
|
1015
|
-
}
|
|
1016
|
-
function createTheme(themeJson, mode, sourcePath) {
|
|
1017
|
-
const colorMode = mode ?? detectColorMode();
|
|
1018
|
-
const resolvedColors = resolveThemeColors(themeJson.colors, themeJson.vars);
|
|
1019
|
-
const fgColors = {};
|
|
1020
|
-
const bgColors = {};
|
|
1021
|
-
const bgColorKeys = new Set([
|
|
1022
|
-
"selectedBg",
|
|
1023
|
-
"userMessageBg",
|
|
1024
|
-
"customMessageBg",
|
|
1025
|
-
"toolPendingBg",
|
|
1026
|
-
"toolSuccessBg",
|
|
1027
|
-
"toolErrorBg",
|
|
1028
|
-
]);
|
|
1029
|
-
for (const [key, value] of Object.entries(resolvedColors)) {
|
|
1030
|
-
if (bgColorKeys.has(key)) {
|
|
1031
|
-
bgColors[key] = value;
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
fgColors[key] = value;
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
return new Theme(fgColors, bgColors, colorMode, {
|
|
1038
|
-
name: themeJson.name,
|
|
1039
|
-
sourcePath,
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
export function loadThemeFromPath(themePath, mode) {
|
|
1043
|
-
const content = fs.readFileSync(themePath, "utf-8");
|
|
1044
|
-
const themeJson = parseThemeJsonContent(themePath, content);
|
|
1045
|
-
return createTheme(themeJson, mode, themePath);
|
|
1046
|
-
}
|
|
1047
|
-
function loadTheme(name, mode) {
|
|
1048
|
-
const registeredTheme = registeredThemes.get(name);
|
|
1049
|
-
if (registeredTheme) {
|
|
1050
|
-
return registeredTheme;
|
|
1051
|
-
}
|
|
1052
|
-
const themeJson = loadThemeJson(name);
|
|
1053
|
-
return createTheme(themeJson, mode);
|
|
1054
|
-
}
|
|
1055
|
-
export function getThemeByName(name) {
|
|
1056
|
-
try {
|
|
1057
|
-
return loadTheme(name);
|
|
1058
|
-
}
|
|
1059
|
-
catch {
|
|
1060
|
-
return undefined;
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
function detectTerminalBackground() {
|
|
1064
|
-
const colorfgbg = process.env.COLORFGBG || "";
|
|
1065
|
-
if (colorfgbg) {
|
|
1066
|
-
const parts = colorfgbg.split(";");
|
|
1067
|
-
if (parts.length >= 2) {
|
|
1068
|
-
const bg = parseInt(parts[1], 10);
|
|
1069
|
-
if (!Number.isNaN(bg)) {
|
|
1070
|
-
const result = bg < 8 ? "dark" : "light";
|
|
1071
|
-
return result;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
return "dark";
|
|
1076
|
-
}
|
|
1077
|
-
function getDefaultTheme() {
|
|
1078
|
-
return detectTerminalBackground();
|
|
1079
|
-
}
|
|
1080
|
-
// ============================================================================
|
|
1081
|
-
// Global Theme Instance
|
|
1082
|
-
// ============================================================================
|
|
1083
|
-
// Use globalThis to share theme across module loaders (tsx + jiti in dev mode)
|
|
1084
|
-
const THEME_KEY = Symbol.for("induscode:theme");
|
|
1085
|
-
// Export theme as a getter that reads from globalThis
|
|
1086
|
-
// This ensures all module instances (tsx, jiti) see the same theme
|
|
1087
|
-
export const theme = new Proxy({}, {
|
|
1088
|
-
get(_target, prop) {
|
|
1089
|
-
const t = globalThis[THEME_KEY];
|
|
1090
|
-
if (!t)
|
|
1091
|
-
throw new Error("Theme not initialized. Call initTheme() first.");
|
|
1092
|
-
return t[prop];
|
|
1093
|
-
},
|
|
1094
|
-
});
|
|
1095
|
-
function setGlobalTheme(t) {
|
|
1096
|
-
globalThis[THEME_KEY] = t;
|
|
1097
|
-
}
|
|
1098
|
-
let currentThemeName;
|
|
1099
|
-
let themeWatcher;
|
|
1100
|
-
let onThemeChangeCallback;
|
|
1101
|
-
const registeredThemes = new Map();
|
|
1102
|
-
export function setRegisteredThemes(themes) {
|
|
1103
|
-
registeredThemes.clear();
|
|
1104
|
-
for (const theme of themes) {
|
|
1105
|
-
if (theme.name) {
|
|
1106
|
-
registeredThemes.set(theme.name, theme);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
export function initTheme(themeName, enableWatcher = false) {
|
|
1111
|
-
const name = themeName ?? getDefaultTheme();
|
|
1112
|
-
currentThemeName = name;
|
|
1113
|
-
try {
|
|
1114
|
-
setGlobalTheme(loadTheme(name));
|
|
1115
|
-
if (enableWatcher) {
|
|
1116
|
-
startThemeWatcher();
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
catch (_error) {
|
|
1120
|
-
// Theme is invalid - fall back to dark theme silently
|
|
1121
|
-
currentThemeName = "dark";
|
|
1122
|
-
setGlobalTheme(loadTheme("dark"));
|
|
1123
|
-
// Don't start watcher for fallback theme
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
export function setTheme(name, enableWatcher = false) {
|
|
1127
|
-
currentThemeName = name;
|
|
1128
|
-
try {
|
|
1129
|
-
setGlobalTheme(loadTheme(name));
|
|
1130
|
-
if (enableWatcher) {
|
|
1131
|
-
startThemeWatcher();
|
|
1132
|
-
}
|
|
1133
|
-
if (onThemeChangeCallback) {
|
|
1134
|
-
onThemeChangeCallback();
|
|
1135
|
-
}
|
|
1136
|
-
return { success: true };
|
|
1137
|
-
}
|
|
1138
|
-
catch (error) {
|
|
1139
|
-
// Theme is invalid - fall back to dark theme
|
|
1140
|
-
currentThemeName = "dark";
|
|
1141
|
-
setGlobalTheme(loadTheme("dark"));
|
|
1142
|
-
// Don't start watcher for fallback theme
|
|
1143
|
-
return {
|
|
1144
|
-
success: false,
|
|
1145
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1146
|
-
};
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
export function setThemeInstance(themeInstance) {
|
|
1150
|
-
setGlobalTheme(themeInstance);
|
|
1151
|
-
currentThemeName = "<in-memory>";
|
|
1152
|
-
stopThemeWatcher(); // Can't watch a direct instance
|
|
1153
|
-
if (onThemeChangeCallback) {
|
|
1154
|
-
onThemeChangeCallback();
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
export function onThemeChange(callback) {
|
|
1158
|
-
onThemeChangeCallback = callback;
|
|
1159
|
-
}
|
|
1160
|
-
function startThemeWatcher() {
|
|
1161
|
-
// Stop existing watcher if any
|
|
1162
|
-
if (themeWatcher) {
|
|
1163
|
-
themeWatcher.close();
|
|
1164
|
-
themeWatcher = undefined;
|
|
1165
|
-
}
|
|
1166
|
-
// Only watch if it's a custom theme (not built-in)
|
|
1167
|
-
if (!currentThemeName || currentThemeName === "dark" || currentThemeName === "light") {
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
const customThemesDir = getCustomThemesDir();
|
|
1171
|
-
const themeFile = path.join(customThemesDir, `${currentThemeName}.json`);
|
|
1172
|
-
// Only watch if the file exists
|
|
1173
|
-
if (!fs.existsSync(themeFile)) {
|
|
1174
|
-
return;
|
|
1175
|
-
}
|
|
1176
|
-
try {
|
|
1177
|
-
themeWatcher = fs.watch(themeFile, (eventType) => {
|
|
1178
|
-
if (eventType === "change") {
|
|
1179
|
-
// Debounce rapid changes
|
|
1180
|
-
setTimeout(() => {
|
|
1181
|
-
try {
|
|
1182
|
-
// Reload the theme
|
|
1183
|
-
setGlobalTheme(loadTheme(currentThemeName));
|
|
1184
|
-
// Notify callback (to invalidate UI)
|
|
1185
|
-
if (onThemeChangeCallback) {
|
|
1186
|
-
onThemeChangeCallback();
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
catch (_error) {
|
|
1190
|
-
// Ignore errors (file might be in invalid state while being edited)
|
|
1191
|
-
}
|
|
1192
|
-
}, 100);
|
|
1193
|
-
}
|
|
1194
|
-
else if (eventType === "rename") {
|
|
1195
|
-
// File was deleted or renamed - fall back to default theme
|
|
1196
|
-
setTimeout(() => {
|
|
1197
|
-
if (!fs.existsSync(themeFile)) {
|
|
1198
|
-
currentThemeName = "dark";
|
|
1199
|
-
setGlobalTheme(loadTheme("dark"));
|
|
1200
|
-
if (themeWatcher) {
|
|
1201
|
-
themeWatcher.close();
|
|
1202
|
-
themeWatcher = undefined;
|
|
1203
|
-
}
|
|
1204
|
-
if (onThemeChangeCallback) {
|
|
1205
|
-
onThemeChangeCallback();
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
}, 100);
|
|
1209
|
-
}
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
catch (_error) {
|
|
1213
|
-
// Ignore errors starting watcher
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
export function stopThemeWatcher() {
|
|
1217
|
-
if (themeWatcher) {
|
|
1218
|
-
themeWatcher.close();
|
|
1219
|
-
themeWatcher = undefined;
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
// ============================================================================
|
|
1223
|
-
// HTML Export Helpers
|
|
1224
|
-
// ============================================================================
|
|
1225
|
-
/**
|
|
1226
|
-
* Convert a 256-color index to hex string.
|
|
1227
|
-
* Indices 0-15: basic colors (approximate)
|
|
1228
|
-
* Indices 16-231: 6x6x6 color cube
|
|
1229
|
-
* Indices 232-255: grayscale ramp
|
|
1230
|
-
*/
|
|
1231
|
-
function ansi256ToHex(index) {
|
|
1232
|
-
// Basic colors (0-15) - approximate common terminal values
|
|
1233
|
-
const basicColors = [
|
|
1234
|
-
"#000000",
|
|
1235
|
-
"#800000",
|
|
1236
|
-
"#008000",
|
|
1237
|
-
"#808000",
|
|
1238
|
-
"#000080",
|
|
1239
|
-
"#800080",
|
|
1240
|
-
"#008080",
|
|
1241
|
-
"#c0c0c0",
|
|
1242
|
-
"#808080",
|
|
1243
|
-
"#ff0000",
|
|
1244
|
-
"#00ff00",
|
|
1245
|
-
"#ffff00",
|
|
1246
|
-
"#0000ff",
|
|
1247
|
-
"#ff00ff",
|
|
1248
|
-
"#00ffff",
|
|
1249
|
-
"#ffffff",
|
|
1250
|
-
];
|
|
1251
|
-
if (index < 16) {
|
|
1252
|
-
return basicColors[index];
|
|
1253
|
-
}
|
|
1254
|
-
// Color cube (16-231): 6x6x6 = 216 colors
|
|
1255
|
-
if (index < 232) {
|
|
1256
|
-
const cubeIndex = index - 16;
|
|
1257
|
-
const r = Math.floor(cubeIndex / 36);
|
|
1258
|
-
const g = Math.floor((cubeIndex % 36) / 6);
|
|
1259
|
-
const b = cubeIndex % 6;
|
|
1260
|
-
const toHex = (n) => (n === 0 ? 0 : 55 + n * 40).toString(16).padStart(2, "0");
|
|
1261
|
-
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
1262
|
-
}
|
|
1263
|
-
// Grayscale (232-255): 24 shades
|
|
1264
|
-
const gray = 8 + (index - 232) * 10;
|
|
1265
|
-
const grayHex = gray.toString(16).padStart(2, "0");
|
|
1266
|
-
return `#${grayHex}${grayHex}${grayHex}`;
|
|
1267
|
-
}
|
|
1268
|
-
/**
|
|
1269
|
-
* Get resolved theme colors as CSS-compatible hex strings.
|
|
1270
|
-
* Used by HTML export to generate CSS custom properties.
|
|
1271
|
-
*/
|
|
1272
|
-
export function getResolvedThemeColors(themeName) {
|
|
1273
|
-
const name = themeName ?? currentThemeName ?? getDefaultTheme();
|
|
1274
|
-
const isLight = name === "light";
|
|
1275
|
-
const themeJson = loadThemeJson(name);
|
|
1276
|
-
const resolved = resolveThemeColors(themeJson.colors, themeJson.vars);
|
|
1277
|
-
// Default text color for empty values (terminal uses default fg color)
|
|
1278
|
-
const defaultText = isLight ? "#000000" : "#e5e5e7";
|
|
1279
|
-
const cssColors = {};
|
|
1280
|
-
for (const [key, value] of Object.entries(resolved)) {
|
|
1281
|
-
if (typeof value === "number") {
|
|
1282
|
-
cssColors[key] = ansi256ToHex(value);
|
|
1283
|
-
}
|
|
1284
|
-
else if (value === "") {
|
|
1285
|
-
// Empty means default terminal color - use sensible fallback for HTML
|
|
1286
|
-
cssColors[key] = defaultText;
|
|
1287
|
-
}
|
|
1288
|
-
else {
|
|
1289
|
-
cssColors[key] = value;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
return cssColors;
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* Check if a theme is a "light" theme (for CSS that needs light/dark variants).
|
|
1296
|
-
*/
|
|
1297
|
-
export function isLightTheme(themeName) {
|
|
1298
|
-
// Currently just check the name - could be extended to analyze colors
|
|
1299
|
-
return themeName === "light";
|
|
1300
|
-
}
|
|
1301
|
-
/**
|
|
1302
|
-
* Get explicit export colors from theme JSON, if specified.
|
|
1303
|
-
* Returns undefined for each color that isn't explicitly set.
|
|
1304
|
-
*/
|
|
1305
|
-
export function getThemeExportColors(themeName) {
|
|
1306
|
-
const name = themeName ?? currentThemeName ?? getDefaultTheme();
|
|
1307
|
-
try {
|
|
1308
|
-
const themeJson = loadThemeJson(name);
|
|
1309
|
-
const exportSection = themeJson.export;
|
|
1310
|
-
if (!exportSection)
|
|
1311
|
-
return {};
|
|
1312
|
-
const vars = themeJson.vars ?? {};
|
|
1313
|
-
const resolve = (value) => {
|
|
1314
|
-
if (value === undefined)
|
|
1315
|
-
return undefined;
|
|
1316
|
-
if (typeof value === "number")
|
|
1317
|
-
return ansi256ToHex(value);
|
|
1318
|
-
if (value.startsWith("$")) {
|
|
1319
|
-
const resolved = vars[value];
|
|
1320
|
-
if (resolved === undefined)
|
|
1321
|
-
return undefined;
|
|
1322
|
-
if (typeof resolved === "number")
|
|
1323
|
-
return ansi256ToHex(resolved);
|
|
1324
|
-
return resolved;
|
|
1325
|
-
}
|
|
1326
|
-
return value;
|
|
1327
|
-
};
|
|
1328
|
-
return {
|
|
1329
|
-
pageBg: resolve(exportSection.pageBg),
|
|
1330
|
-
cardBg: resolve(exportSection.cardBg),
|
|
1331
|
-
infoBg: resolve(exportSection.infoBg),
|
|
1332
|
-
};
|
|
1333
|
-
}
|
|
1334
|
-
catch {
|
|
1335
|
-
return {};
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
let cachedHighlightThemeFor;
|
|
1339
|
-
let cachedCliHighlightTheme;
|
|
1340
|
-
function buildCliHighlightTheme(t) {
|
|
1341
|
-
return {
|
|
1342
|
-
keyword: (s) => t.fg("syntaxKeyword", s),
|
|
1343
|
-
built_in: (s) => t.fg("syntaxType", s),
|
|
1344
|
-
literal: (s) => t.fg("syntaxNumber", s),
|
|
1345
|
-
number: (s) => t.fg("syntaxNumber", s),
|
|
1346
|
-
string: (s) => t.fg("syntaxString", s),
|
|
1347
|
-
comment: (s) => t.fg("syntaxComment", s),
|
|
1348
|
-
function: (s) => t.fg("syntaxFunction", s),
|
|
1349
|
-
title: (s) => t.fg("syntaxFunction", s),
|
|
1350
|
-
class: (s) => t.fg("syntaxType", s),
|
|
1351
|
-
type: (s) => t.fg("syntaxType", s),
|
|
1352
|
-
attr: (s) => t.fg("syntaxVariable", s),
|
|
1353
|
-
variable: (s) => t.fg("syntaxVariable", s),
|
|
1354
|
-
params: (s) => t.fg("syntaxVariable", s),
|
|
1355
|
-
operator: (s) => t.fg("syntaxOperator", s),
|
|
1356
|
-
punctuation: (s) => t.fg("syntaxPunctuation", s),
|
|
1357
|
-
};
|
|
1358
|
-
}
|
|
1359
|
-
function getCliHighlightTheme(t) {
|
|
1360
|
-
if (cachedHighlightThemeFor !== t || !cachedCliHighlightTheme) {
|
|
1361
|
-
cachedHighlightThemeFor = t;
|
|
1362
|
-
cachedCliHighlightTheme = buildCliHighlightTheme(t);
|
|
1363
|
-
}
|
|
1364
|
-
return cachedCliHighlightTheme;
|
|
1365
|
-
}
|
|
1366
|
-
/**
|
|
1367
|
-
* Highlight code with syntax coloring based on file extension or language.
|
|
1368
|
-
* Returns array of highlighted lines.
|
|
1369
|
-
*/
|
|
1370
|
-
export function highlightCode(code, lang) {
|
|
1371
|
-
// Validate language before highlighting to avoid stderr spam from cli-highlight
|
|
1372
|
-
const validLang = lang && supportsLanguage(lang) ? lang : undefined;
|
|
1373
|
-
const opts = {
|
|
1374
|
-
language: validLang,
|
|
1375
|
-
ignoreIllegals: true,
|
|
1376
|
-
theme: getCliHighlightTheme(theme),
|
|
1377
|
-
};
|
|
1378
|
-
try {
|
|
1379
|
-
return highlight(code, opts).split("\n");
|
|
1380
|
-
}
|
|
1381
|
-
catch {
|
|
1382
|
-
return code.split("\n");
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
/**
|
|
1386
|
-
* Get language identifier from file path extension.
|
|
1387
|
-
*/
|
|
1388
|
-
export function getLanguageFromPath(filePath) {
|
|
1389
|
-
const ext = filePath.split(".").pop()?.toLowerCase();
|
|
1390
|
-
if (!ext)
|
|
1391
|
-
return undefined;
|
|
1392
|
-
const extToLang = {
|
|
1393
|
-
ts: "typescript",
|
|
1394
|
-
tsx: "typescript",
|
|
1395
|
-
js: "javascript",
|
|
1396
|
-
jsx: "javascript",
|
|
1397
|
-
mjs: "javascript",
|
|
1398
|
-
cjs: "javascript",
|
|
1399
|
-
py: "python",
|
|
1400
|
-
rb: "ruby",
|
|
1401
|
-
rs: "rust",
|
|
1402
|
-
go: "go",
|
|
1403
|
-
java: "java",
|
|
1404
|
-
kt: "kotlin",
|
|
1405
|
-
swift: "swift",
|
|
1406
|
-
c: "c",
|
|
1407
|
-
h: "c",
|
|
1408
|
-
cpp: "cpp",
|
|
1409
|
-
cc: "cpp",
|
|
1410
|
-
cxx: "cpp",
|
|
1411
|
-
hpp: "cpp",
|
|
1412
|
-
cs: "csharp",
|
|
1413
|
-
php: "php",
|
|
1414
|
-
sh: "bash",
|
|
1415
|
-
bash: "bash",
|
|
1416
|
-
zsh: "bash",
|
|
1417
|
-
fish: "fish",
|
|
1418
|
-
ps1: "powershell",
|
|
1419
|
-
sql: "sql",
|
|
1420
|
-
html: "html",
|
|
1421
|
-
htm: "html",
|
|
1422
|
-
css: "css",
|
|
1423
|
-
scss: "scss",
|
|
1424
|
-
sass: "sass",
|
|
1425
|
-
less: "less",
|
|
1426
|
-
json: "json",
|
|
1427
|
-
yaml: "yaml",
|
|
1428
|
-
yml: "yaml",
|
|
1429
|
-
toml: "toml",
|
|
1430
|
-
xml: "xml",
|
|
1431
|
-
md: "markdown",
|
|
1432
|
-
markdown: "markdown",
|
|
1433
|
-
dockerfile: "dockerfile",
|
|
1434
|
-
makefile: "makefile",
|
|
1435
|
-
cmake: "cmake",
|
|
1436
|
-
lua: "lua",
|
|
1437
|
-
perl: "perl",
|
|
1438
|
-
r: "r",
|
|
1439
|
-
scala: "scala",
|
|
1440
|
-
clj: "clojure",
|
|
1441
|
-
ex: "elixir",
|
|
1442
|
-
exs: "elixir",
|
|
1443
|
-
erl: "erlang",
|
|
1444
|
-
hs: "haskell",
|
|
1445
|
-
ml: "ocaml",
|
|
1446
|
-
vim: "vim",
|
|
1447
|
-
graphql: "graphql",
|
|
1448
|
-
proto: "protobuf",
|
|
1449
|
-
tf: "hcl",
|
|
1450
|
-
hcl: "hcl",
|
|
1451
|
-
};
|
|
1452
|
-
return extToLang[ext];
|
|
1453
|
-
}
|
|
1454
|
-
export function getMarkdownTheme() {
|
|
1455
|
-
return {
|
|
1456
|
-
heading: (text) => theme.fg("mdHeading", text),
|
|
1457
|
-
link: (text) => theme.fg("mdLink", text),
|
|
1458
|
-
linkUrl: (text) => theme.fg("mdLinkUrl", text),
|
|
1459
|
-
code: (text) => theme.fg("mdCode", text),
|
|
1460
|
-
codeBlock: (text) => theme.fg("mdCodeBlock", text),
|
|
1461
|
-
codeBlockBorder: (text) => theme.fg("mdCodeBlockBorder", text),
|
|
1462
|
-
quote: (text) => theme.fg("mdQuote", text),
|
|
1463
|
-
quoteBorder: (text) => theme.fg("mdQuoteBorder", text),
|
|
1464
|
-
hr: (text) => theme.fg("mdHr", text),
|
|
1465
|
-
listBullet: (text) => theme.fg("mdListBullet", text),
|
|
1466
|
-
bold: (text) => theme.bold(text),
|
|
1467
|
-
italic: (text) => theme.italic(text),
|
|
1468
|
-
underline: (text) => theme.underline(text),
|
|
1469
|
-
strikethrough: (text) => chalk.strikethrough(text),
|
|
1470
|
-
highlightCode: (code, lang) => {
|
|
1471
|
-
// Validate language before highlighting to avoid stderr spam from cli-highlight
|
|
1472
|
-
const validLang = lang && supportsLanguage(lang) ? lang : undefined;
|
|
1473
|
-
const opts = {
|
|
1474
|
-
language: validLang,
|
|
1475
|
-
ignoreIllegals: true,
|
|
1476
|
-
theme: getCliHighlightTheme(theme),
|
|
1477
|
-
};
|
|
1478
|
-
try {
|
|
1479
|
-
return highlight(code, opts).split("\n");
|
|
1480
|
-
}
|
|
1481
|
-
catch {
|
|
1482
|
-
return code.split("\n").map((line) => theme.fg("mdCodeBlock", line));
|
|
1483
|
-
}
|
|
1484
|
-
},
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
export function getSelectListTheme() {
|
|
1488
|
-
return {
|
|
1489
|
-
selectedPrefix: (text) => theme.fg("accent", text),
|
|
1490
|
-
selectedText: (text) => theme.fg("accent", text),
|
|
1491
|
-
description: (text) => theme.fg("muted", text),
|
|
1492
|
-
scrollInfo: (text) => theme.fg("muted", text),
|
|
1493
|
-
noMatch: (text) => theme.fg("muted", text),
|
|
1494
|
-
};
|
|
1495
|
-
}
|
|
1496
|
-
export function getEditorTheme() {
|
|
1497
|
-
return {
|
|
1498
|
-
borderColor: (text) => theme.fg("borderMuted", text),
|
|
1499
|
-
selectList: getSelectListTheme(),
|
|
1500
|
-
};
|
|
1501
|
-
}
|
|
1502
|
-
export function getSettingsListTheme() {
|
|
1503
|
-
return {
|
|
1504
|
-
label: (text, selected) => (selected ? theme.fg("accent", text) : text),
|
|
1505
|
-
value: (text, selected) => (selected ? theme.fg("accent", text) : theme.fg("muted", text)),
|
|
1506
|
-
description: (text) => theme.fg("dim", text),
|
|
1507
|
-
cursor: theme.fg("accent", "→ "),
|
|
1508
|
-
hint: (text) => theme.fg("dim", text),
|
|
1509
|
-
};
|
|
1510
|
-
}
|
|
1511
|
-
//# sourceMappingURL=theme.js.map
|