@odysx/codemind 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +293 -2
- package/dist/commands/agents.d.ts +2 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +91 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +35 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/chat.d.ts +2 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +180 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/keys.d.ts +2 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.js +81 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/local.d.ts +2 -0
- package/dist/commands/local.d.ts.map +1 -0
- package/dist/commands/local.js +325 -0
- package/dist/commands/local.js.map +1 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +73 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/prompts.d.ts +2 -0
- package/dist/commands/prompts.d.ts.map +1 -0
- package/dist/commands/prompts.js +59 -0
- package/dist/commands/prompts.js.map +1 -0
- package/dist/commands/skills.d.ts +2 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +41 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/core/auth/index.d.ts +10 -0
- package/dist/core/auth/index.d.ts.map +1 -0
- package/dist/core/auth/index.js +82 -0
- package/dist/core/auth/index.js.map +1 -0
- package/dist/core/config/index.d.ts +47 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +118 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/history.d.ts +14 -0
- package/dist/core/history.d.ts.map +1 -0
- package/dist/core/history.js +80 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/markdown-renderer.d.ts +47 -0
- package/dist/core/markdown-renderer.d.ts.map +1 -0
- package/dist/core/markdown-renderer.js +385 -0
- package/dist/core/markdown-renderer.js.map +1 -0
- package/dist/core/permissions/index.d.ts +31 -0
- package/dist/core/permissions/index.d.ts.map +1 -0
- package/dist/core/permissions/index.js +64 -0
- package/dist/core/permissions/index.js.map +1 -0
- package/dist/core/provider/external.d.ts +28 -0
- package/dist/core/provider/external.d.ts.map +1 -0
- package/dist/core/provider/external.js +248 -0
- package/dist/core/provider/external.js.map +1 -0
- package/dist/core/provider/index.d.ts +96 -0
- package/dist/core/provider/index.d.ts.map +1 -0
- package/dist/core/provider/index.js +423 -0
- package/dist/core/provider/index.js.map +1 -0
- package/dist/core/registry/index.d.ts +25 -0
- package/dist/core/registry/index.d.ts.map +1 -0
- package/dist/core/registry/index.js +216 -0
- package/dist/core/registry/index.js.map +1 -0
- package/dist/core/schema/types.d.ts +93 -0
- package/dist/core/schema/types.d.ts.map +1 -0
- package/dist/core/schema/types.js +12 -0
- package/dist/core/schema/types.js.map +1 -0
- package/dist/core/terminal.d.ts +40 -0
- package/dist/core/terminal.d.ts.map +1 -0
- package/dist/core/terminal.js +134 -0
- package/dist/core/terminal.js.map +1 -0
- package/dist/core/workspace/index.d.ts +35 -0
- package/dist/core/workspace/index.d.ts.map +1 -0
- package/dist/core/workspace/index.js +194 -0
- package/dist/core/workspace/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +393 -0
- package/dist/index.js.map +1 -0
- package/dist/ui/app.d.ts +3 -0
- package/dist/ui/app.d.ts.map +1 -0
- package/dist/ui/app.js +554 -0
- package/dist/ui/app.js.map +1 -0
- package/dist/ui/commands/cases/catalog.d.ts +11 -0
- package/dist/ui/commands/cases/catalog.d.ts.map +1 -0
- package/dist/ui/commands/cases/catalog.js +62 -0
- package/dist/ui/commands/cases/catalog.js.map +1 -0
- package/dist/ui/commands/cases/misc.d.ts +35 -0
- package/dist/ui/commands/cases/misc.d.ts.map +1 -0
- package/dist/ui/commands/cases/misc.js +245 -0
- package/dist/ui/commands/cases/misc.js.map +1 -0
- package/dist/ui/commands/cases/tasks.d.ts +13 -0
- package/dist/ui/commands/cases/tasks.d.ts.map +1 -0
- package/dist/ui/commands/cases/tasks.js +91 -0
- package/dist/ui/commands/cases/tasks.js.map +1 -0
- package/dist/ui/commands/runCommand.d.ts +22 -0
- package/dist/ui/commands/runCommand.d.ts.map +1 -0
- package/dist/ui/commands/runCommand.js +136 -0
- package/dist/ui/commands/runCommand.js.map +1 -0
- package/dist/ui/components/AgentPicker.d.ts +11 -0
- package/dist/ui/components/AgentPicker.d.ts.map +1 -0
- package/dist/ui/components/AgentPicker.js +7 -0
- package/dist/ui/components/AgentPicker.js.map +1 -0
- package/dist/ui/components/AuthPicker.d.ts +14 -0
- package/dist/ui/components/AuthPicker.d.ts.map +1 -0
- package/dist/ui/components/AuthPicker.js +7 -0
- package/dist/ui/components/AuthPicker.js.map +1 -0
- package/dist/ui/components/Banner.d.ts +8 -0
- package/dist/ui/components/Banner.d.ts.map +1 -0
- package/dist/ui/components/Banner.js +24 -0
- package/dist/ui/components/Banner.js.map +1 -0
- package/dist/ui/components/CommandMenu.d.ts +17 -0
- package/dist/ui/components/CommandMenu.d.ts.map +1 -0
- package/dist/ui/components/CommandMenu.js +21 -0
- package/dist/ui/components/CommandMenu.js.map +1 -0
- package/dist/ui/components/ErrorBoundary.d.ts +24 -0
- package/dist/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/ui/components/ErrorBoundary.js +51 -0
- package/dist/ui/components/ErrorBoundary.js.map +1 -0
- package/dist/ui/components/InputBar.d.ts +28 -0
- package/dist/ui/components/InputBar.d.ts.map +1 -0
- package/dist/ui/components/InputBar.js +108 -0
- package/dist/ui/components/InputBar.js.map +1 -0
- package/dist/ui/components/KeysPanel.d.ts +12 -0
- package/dist/ui/components/KeysPanel.d.ts.map +1 -0
- package/dist/ui/components/KeysPanel.js +25 -0
- package/dist/ui/components/KeysPanel.js.map +1 -0
- package/dist/ui/components/MessageView.d.ts +29 -0
- package/dist/ui/components/MessageView.d.ts.map +1 -0
- package/dist/ui/components/MessageView.js +107 -0
- package/dist/ui/components/MessageView.js.map +1 -0
- package/dist/ui/components/PermissionPrompt.d.ts +10 -0
- package/dist/ui/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/ui/components/PermissionPrompt.js +4 -0
- package/dist/ui/components/PermissionPrompt.js.map +1 -0
- package/dist/ui/components/Pickers.d.ts +43 -0
- package/dist/ui/components/Pickers.d.ts.map +1 -0
- package/dist/ui/components/Pickers.js +33 -0
- package/dist/ui/components/Pickers.js.map +1 -0
- package/dist/ui/components/SearchOverlay.d.ts +21 -0
- package/dist/ui/components/SearchOverlay.d.ts.map +1 -0
- package/dist/ui/components/SearchOverlay.js +14 -0
- package/dist/ui/components/SearchOverlay.js.map +1 -0
- package/dist/ui/components/SessionPicker.d.ts +12 -0
- package/dist/ui/components/SessionPicker.d.ts.map +1 -0
- package/dist/ui/components/SessionPicker.js +8 -0
- package/dist/ui/components/SessionPicker.js.map +1 -0
- package/dist/ui/components/WorkingIndicator.d.ts +10 -0
- package/dist/ui/components/WorkingIndicator.d.ts.map +1 -0
- package/dist/ui/components/WorkingIndicator.js +23 -0
- package/dist/ui/components/WorkingIndicator.js.map +1 -0
- package/dist/ui/controls/ApiKeyEntry.d.ts +8 -0
- package/dist/ui/controls/ApiKeyEntry.d.ts.map +1 -0
- package/dist/ui/controls/ApiKeyEntry.js +5 -0
- package/dist/ui/controls/ApiKeyEntry.js.map +1 -0
- package/dist/ui/controls/MultiSelect.d.ts +18 -0
- package/dist/ui/controls/MultiSelect.d.ts.map +1 -0
- package/dist/ui/controls/MultiSelect.js +9 -0
- package/dist/ui/controls/MultiSelect.js.map +1 -0
- package/dist/ui/hooks/useAgentPicker.d.ts +14 -0
- package/dist/ui/hooks/useAgentPicker.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentPicker.js +53 -0
- package/dist/ui/hooks/useAgentPicker.js.map +1 -0
- package/dist/ui/hooks/useAuthFlow.d.ts +14 -0
- package/dist/ui/hooks/useAuthFlow.d.ts.map +1 -0
- package/dist/ui/hooks/useAuthFlow.js +31 -0
- package/dist/ui/hooks/useAuthFlow.js.map +1 -0
- package/dist/ui/hooks/useKeysFlow.d.ts +17 -0
- package/dist/ui/hooks/useKeysFlow.d.ts.map +1 -0
- package/dist/ui/hooks/useKeysFlow.js +130 -0
- package/dist/ui/hooks/useKeysFlow.js.map +1 -0
- package/dist/ui/hooks/useSessionPicker.d.ts +29 -0
- package/dist/ui/hooks/useSessionPicker.d.ts.map +1 -0
- package/dist/ui/hooks/useSessionPicker.js +58 -0
- package/dist/ui/hooks/useSessionPicker.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +6 -0
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalSize.js +29 -0
- package/dist/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/input/keyRouter.d.ts +125 -0
- package/dist/ui/input/keyRouter.d.ts.map +1 -0
- package/dist/ui/input/keyRouter.js +574 -0
- package/dist/ui/input/keyRouter.js.map +1 -0
- package/dist/ui/layouts/ScreenLayout.d.ts +98 -0
- package/dist/ui/layouts/ScreenLayout.d.ts.map +1 -0
- package/dist/ui/layouts/ScreenLayout.js +56 -0
- package/dist/ui/layouts/ScreenLayout.js.map +1 -0
- package/dist/ui/shared/types.d.ts +143 -0
- package/dist/ui/shared/types.d.ts.map +1 -0
- package/dist/ui/shared/types.js +38 -0
- package/dist/ui/shared/types.js.map +1 -0
- package/dist/ui/theme.d.ts +29 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +54 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/utils/markdown.d.ts +74 -0
- package/dist/ui/utils/markdown.d.ts.map +1 -0
- package/dist/ui/utils/markdown.js +187 -0
- package/dist/ui/utils/markdown.js.map +1 -0
- package/dist/ui/utils/mentions.d.ts +12 -0
- package/dist/ui/utils/mentions.d.ts.map +1 -0
- package/dist/ui/utils/mentions.js +28 -0
- package/dist/ui/utils/mentions.js.map +1 -0
- package/dist/ui/utils/terminal-text.d.ts +33 -0
- package/dist/ui/utils/terminal-text.d.ts.map +1 -0
- package/dist/ui/utils/terminal-text.js +123 -0
- package/dist/ui/utils/terminal-text.js.map +1 -0
- package/dist/ui/utils/text.d.ts +72 -0
- package/dist/ui/utils/text.d.ts.map +1 -0
- package/dist/ui/utils/text.js +171 -0
- package/dist/ui/utils/text.js.map +1 -0
- package/eslint.config.js +40 -0
- package/graphify-out/GRAPH_REPORT.md +140 -0
- package/graphify-out/cache/1236b1806943f8eb5c64fece9fb448149370f4a1b52b32f0977ad528d7911291.json +1 -0
- package/graphify-out/cache/15cbf641dcc0fd641c18da872214918203a1f64baa7ac8430e4702ef32d18b02.json +1 -0
- package/graphify-out/cache/1abc52745bb46f6cc5a528530e2bc1f368c26e348dff85cdde5cad6f275d7177.json +1 -0
- package/graphify-out/cache/1c7815c37c13177e98895e272285f6151a8d0807478fc843ec452634b3e9912d.json +1 -0
- package/graphify-out/cache/1ec38c39f044f329c78642b61d6394fb8e15d0014335f32947d1f5c7b88c02bc.json +1 -0
- package/graphify-out/cache/20c9b57ff76dbb9d57cbd00659b0a42d2b28dd2abacf1ef4143cc67a5b6fe7f4.json +1 -0
- package/graphify-out/cache/285e11876884eb619e779d540cd957b33e70f14c67ecc26c9b9755aa9cedd717.json +1 -0
- package/graphify-out/cache/2c0a9c49ab51f4e0f07543b4e941bf802b7db31fa607c4cee8e595575be68fe7.json +1 -0
- package/graphify-out/cache/3025e6c2756c79ccaadd51d611f25a8b6630a6a11ce1b4e6e261b3e033dc194f.json +1 -0
- package/graphify-out/cache/4801a686ddfa0a52824a4fc3d65443cbb0ab9f0b030af67d02fccb520c584a08.json +1 -0
- package/graphify-out/cache/4f8fd96f38aa7d0293b4fab60c4581c4f3e68f4533c664c9cd78d1c53bea1cba.json +1 -0
- package/graphify-out/cache/5928e562b0f5700184b810e2403f4aa685e2b93c3c584c10460562b514c40fdd.json +1 -0
- package/graphify-out/cache/66132486efb0a4cfaeea766448f1f15bb33635808714052e7e24e5b00fbc984f.json +1 -0
- package/graphify-out/cache/66ab27669e7ec685130063662af9f30018c267f7639b4af4b0504a98282c383a.json +1 -0
- package/graphify-out/cache/6ff6b3dd433b5ffe96e166263a203dd622397e419dc00bb676824988b7defeab.json +1 -0
- package/graphify-out/cache/7a00a49932177a6215e2590b1ddfd6f1d8494792f693068e9d427d16b165d370.json +1 -0
- package/graphify-out/cache/7b681bc5182f40f707f1c0b16b78af38efffa62a1df315d10878f4de888408ef.json +1 -0
- package/graphify-out/cache/81196d44e50ac0b276d826a531ed10c425a528b298e3fe18e8d5a3eec996e9d5.json +1 -0
- package/graphify-out/cache/8934e9b32dea6e66fdc34fa1681b287ff1335c389917e0fc6ee2fc573e23e87b.json +1 -0
- package/graphify-out/cache/975f6c99807f86b79c80ca40c783618e2080a927eaebe6ea3db37b869f048851.json +1 -0
- package/graphify-out/cache/9ab98f08626fd8190462595e38de828293ad184db8df5e1177b05a8fe290faa1.json +1 -0
- package/graphify-out/cache/9c434a6796d7932b6e87a908c155c09cb2b8d097fc55f141f0302b6600f94749.json +1 -0
- package/graphify-out/cache/ac5cf4c489dc417c1f6ea728d0b6ba12ac7087bc6c2e736697ff3024b4d4e534.json +1 -0
- package/graphify-out/cache/ae5083b5c1dca3e5c6af485e7f6eb8a08ff8b382cdecf92ab5e0902053442afe.json +1 -0
- package/graphify-out/cache/b274057fc2e0118cf2746d1d8060841122bb2a2b0305566fc3f32d3a51e08bcc.json +1 -0
- package/graphify-out/cache/b39beef31da682387f030c0d149f6cd5b3e66effbf936cc8430db15360759dda.json +1 -0
- package/graphify-out/cache/bf3c6a36bb72820bc11cbf4a5c49067d1f62013d4686c019a4dbd9951b1e980e.json +1 -0
- package/graphify-out/cache/c034e156028d1a58b89bce659726e9a4065ddc4d2b560d6bce7a206fdff8dad3.json +1 -0
- package/graphify-out/cache/c619b5bbe8d1f427fbd7816d1e9fcfaf90d7201b020ae6b578166aeb9cb20683.json +1 -0
- package/graphify-out/cache/c8db77a9da0b0f601acfa50a620f31155cdda0d0cc0f2285adcea19e77194ee6.json +1 -0
- package/graphify-out/cache/ca664791ec7741a2077d9e7c10384142d30e7a3b77b388df719c315da608d57d.json +1 -0
- package/graphify-out/cache/cba43a116186bd55c8a63368dea4eee4a8123b2bec0a42df6efb3254f89f9a7a.json +1 -0
- package/graphify-out/cache/cd51cbb3dad1cf34417b9761fe2eb184a9f57d23dc86e45630e63bfa2ecafddc.json +1 -0
- package/graphify-out/cache/d06738cde193b34a136b94104220c17e0212b814b3e4d7ff399105635cae1a03.json +1 -0
- package/graphify-out/cache/d093c19f0169c0398eeb1360895b1c16ecc50abc59f4be8eec3f6fd27c89a6e5.json +1 -0
- package/graphify-out/cache/da8f75c438531d232fe114d5cbf2374576ce842a5fb87c7e5a88b78fdb334e5e.json +1 -0
- package/graphify-out/cache/e35798fa04ddede548a6953bdea506bd7d0788dfed4e8a8ea6ae77b1b60ef5e0.json +1 -0
- package/graphify-out/cache/e5a38c254719000487098782125e15e2e982c07d66b99d359ed1781f30f9fc8c.json +1 -0
- package/graphify-out/cache/e6e4c4a5a7200ee0154585b5d6538f699b0a746dbded3164f8391f06ce7cb212.json +1 -0
- package/graphify-out/cache/ea8d0838df6309b673b031f616b253af957898ee7289d25a541fa6183b732e4e.json +1 -0
- package/graphify-out/cache/ebaee92b0e881efd7a08f3143e2c1803310396b4651d4f77532003c699cc6836.json +1 -0
- package/graphify-out/cache/edf8543318a9e60d56d04704078da6c37202ddd6fdfc83144fe2b94fe19b80ef.json +1 -0
- package/graphify-out/cache/efca19d3668035f11126fc9eccbeab290abfa94babf3f9a8706de81d17aba263.json +1 -0
- package/graphify-out/cache/f1480bb642025ebd6d99986cdd8a7d5726897ec038300e4b095c9c938435dfad.json +1 -0
- package/graphify-out/cache/f459f21277f03865f732affb175b1b092954dae5967f27b3cd1864466e3e24f4.json +1 -0
- package/graphify-out/cache/f899e37e864010b30f4c196e86082d7bd022a0df032005e0407883ebcec36514.json +1 -0
- package/graphify-out/cache/fb3cbe07fbcd97c536cff9c6bc343c35f22d49613f05c53ad30ef67a75c5d93e.json +1 -0
- package/graphify-out/cache/fd3dc682b1ca2f5ae03b50d6b0e045ae50f5701c0a21c5a388d77ef482939d3a.json +1 -0
- package/graphify-out/graph.html +257 -0
- package/graphify-out/graph.json +4396 -0
- package/package.json +45 -6
- package/scripts/e2e-external.mjs +65 -0
- package/scripts/live-agents.mjs +6 -0
- package/scripts/live-stream.mjs +51 -0
- package/src/commands/agents.ts +91 -0
- package/src/commands/auth.ts +39 -0
- package/src/commands/chat.ts +198 -0
- package/src/commands/keys.ts +83 -0
- package/src/commands/local.ts +302 -0
- package/src/commands/mcp.ts +74 -0
- package/src/commands/prompts.ts +58 -0
- package/src/commands/skills.ts +43 -0
- package/src/core/auth/index.ts +101 -0
- package/src/core/config/index.ts +152 -0
- package/src/core/history.ts +79 -0
- package/src/core/markdown-renderer.ts +420 -0
- package/src/core/permissions/index.ts +99 -0
- package/src/core/provider/external.ts +312 -0
- package/src/core/provider/index.ts +517 -0
- package/src/core/registry/index.ts +250 -0
- package/src/core/schema/types.ts +106 -0
- package/src/core/terminal.ts +124 -0
- package/src/core/workspace/index.ts +216 -0
- package/src/index.ts +401 -0
- package/src/ui/app.tsx +644 -0
- package/src/ui/commands/cases/catalog.ts +76 -0
- package/src/ui/commands/cases/misc.ts +293 -0
- package/src/ui/commands/cases/tasks.ts +115 -0
- package/src/ui/commands/runCommand.ts +178 -0
- package/src/ui/components/Banner.tsx +63 -0
- package/src/ui/components/CommandMenu.tsx +63 -0
- package/src/ui/components/ErrorBoundary.tsx +75 -0
- package/src/ui/components/InputBar.tsx +227 -0
- package/src/ui/components/KeysPanel.tsx +115 -0
- package/src/ui/components/MessageView.tsx +226 -0
- package/src/ui/components/Pickers.tsx +234 -0
- package/src/ui/components/SearchOverlay.tsx +65 -0
- package/src/ui/components/WorkingIndicator.tsx +35 -0
- package/src/ui/controls/ApiKeyEntry.tsx +29 -0
- package/src/ui/controls/MultiSelect.tsx +55 -0
- package/src/ui/hooks/useAgentPicker.ts +64 -0
- package/src/ui/hooks/useAuthFlow.ts +47 -0
- package/src/ui/hooks/useKeysFlow.ts +157 -0
- package/src/ui/hooks/useSessionPicker.ts +84 -0
- package/src/ui/hooks/useTerminalSize.ts +36 -0
- package/src/ui/input/keyRouter.ts +627 -0
- package/src/ui/layouts/ScreenLayout.tsx +202 -0
- package/src/ui/shared/types.ts +160 -0
- package/src/ui/theme.ts +53 -0
- package/src/ui/utils/markdown.ts +255 -0
- package/src/ui/utils/mentions.ts +40 -0
- package/src/ui/utils/terminal-text.ts +130 -0
- package/src/ui/utils/text.ts +174 -0
- package/test/commands.test.mjs +127 -0
- package/test/config.test.mjs +123 -0
- package/test/history.test.mjs +42 -0
- package/test/keyrouter.test.mjs +324 -0
- package/test/layout.test.mjs +271 -0
- package/test/markdown.test.mjs +92 -0
- package/test/mentions.test.mjs +51 -0
- package/test/permissions.test.mjs +130 -0
- package/test/provider.test.mjs +287 -0
- package/test/terminal-text.test.mjs +116 -0
- package/test/text.test.mjs +134 -0
- package/test/workspace.test.mjs +101 -0
- package/tsconfig.json +32 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeysPanel.js","sourceRoot":"","sources":["../../../src/ui/components/KeysPanel.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAgE,EAAE,EAAE,CAAC,CAC1G,MAAC,GAAG,IAAC,aAAa,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AAU,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAQ,CAC9D,KAZO,GAAG,CAAC,EAAE,CAaV,CACP,CAAC;gBACJ,CAAC,CAAC,GACE,CACP,IACK,CACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message rendering — user prompts, system notices, and markdown-aware agent
|
|
3
|
+
* replies.
|
|
4
|
+
*
|
|
5
|
+
* Completed messages render once inside Ink's static region (see
|
|
6
|
+
* ScreenLayout), so this component can afford real structure: headings,
|
|
7
|
+
* lists, fenced code with a language label, quotes, rules, and tables. The
|
|
8
|
+
* cheap line parser lives in utils/markdown.ts.
|
|
9
|
+
*/
|
|
10
|
+
import React from "react";
|
|
11
|
+
import type { ChatMessage } from "../shared/types.js";
|
|
12
|
+
declare const MessageViewImpl: ({ msg, live }: {
|
|
13
|
+
msg: ChatMessage;
|
|
14
|
+
live?: boolean;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
export declare const MessageView: React.MemoExoticComponent<typeof MessageViewImpl>;
|
|
17
|
+
/**
|
|
18
|
+
* The reply currently being streamed. Rendered outside the static region.
|
|
19
|
+
*
|
|
20
|
+
* Memoized on purpose: a token commit replaces the message object and should
|
|
21
|
+
* re-parse, but keystrokes and the elapsed-seconds tick also re-render App
|
|
22
|
+
* while a turn is live. Without `memo` each of those re-parses the entire
|
|
23
|
+
* reply (several ms on a long answer) for no visible change.
|
|
24
|
+
*/
|
|
25
|
+
export declare const StreamingMessage: React.MemoExoticComponent<({ msg }: {
|
|
26
|
+
msg: ChatMessage;
|
|
27
|
+
}) => React.JSX.Element>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=MessageView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageView.d.ts","sourceRoot":"","sources":["../../../src/ui/components/MessageView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiJtD,QAAA,MAAM,eAAe,kBAA2B;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,sBAuDnF,CAAC;AAEF,eAAO,MAAM,WAAW,mDAAwB,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,sCAAkB;IAAE,GAAG,EAAE,WAAW,CAAA;CAAE,uBAEjE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Message rendering — user prompts, system notices, and markdown-aware agent
|
|
4
|
+
* replies.
|
|
5
|
+
*
|
|
6
|
+
* Completed messages render once inside Ink's static region (see
|
|
7
|
+
* ScreenLayout), so this component can afford real structure: headings,
|
|
8
|
+
* lists, fenced code with a language label, quotes, rules, and tables. The
|
|
9
|
+
* cheap line parser lives in utils/markdown.ts.
|
|
10
|
+
*/
|
|
11
|
+
import { memo } from "react";
|
|
12
|
+
import { Box, Text, useStdout } from "ink";
|
|
13
|
+
import { parseMarkdown } from "../utils/markdown.js";
|
|
14
|
+
import { displayWidth, padToWidth, sanitize, truncateToWidth } from "../utils/terminal-text.js";
|
|
15
|
+
import { theme, systemColor } from "../theme.js";
|
|
16
|
+
/* ── Inline styling ─────────────────────────────────────────────────────── */
|
|
17
|
+
const Run = ({ run }) => (_jsx(Text, { bold: run.bold, italic: run.italic, underline: run.underline, strikethrough: run.strike, color: run.code ? theme.color.code : run.link ? theme.color.link : undefined, children: run.text }));
|
|
18
|
+
const Runs = ({ runs }) => runs.length === 0 ? null : (_jsx(_Fragment, { children: runs.map((run, i) => (_jsx(Run, { run: run }, i))) }));
|
|
19
|
+
/* ── Block rendering ────────────────────────────────────────────────────── */
|
|
20
|
+
const MAX_CODE_LINES = 400;
|
|
21
|
+
const CodeBlock = ({ lang, lines, open }) => {
|
|
22
|
+
const shown = lines.slice(0, MAX_CODE_LINES);
|
|
23
|
+
const hidden = lines.length - shown.length;
|
|
24
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { dimColor: true, children: [theme.glyph.rule.repeat(2), " ", lang || "code", open ? " …" : ""] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, children: [shown.map((line, i) => (_jsx(Text, { color: theme.color.muted, children: line || " " }, i))), hidden > 0 && _jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " more lines"] })] }), _jsx(Text, { dimColor: true, children: theme.glyph.rule.repeat(2) })] }));
|
|
25
|
+
};
|
|
26
|
+
const TableBlock = ({ line }) => {
|
|
27
|
+
const { stdout } = useStdout();
|
|
28
|
+
const available = Math.max(20, (stdout?.columns ?? 80) - 4);
|
|
29
|
+
const columns = line.header.length;
|
|
30
|
+
// Column widths are measured in terminal columns, not code units: a CJK or
|
|
31
|
+
// emoji cell is two columns wide and would misalign every row after it.
|
|
32
|
+
// The per-cell cap keeps a wide table inside the terminal instead of
|
|
33
|
+
// letting Ink wrap it into unreadable fragments.
|
|
34
|
+
const cap = Math.max(6, Math.floor((available - 2 * (columns - 1)) / columns));
|
|
35
|
+
const widths = line.header.map((cell, i) => {
|
|
36
|
+
let width = Math.max(displayWidth(cell), 3);
|
|
37
|
+
// reduce, not spread: Math.max(...rows) overflows the stack on huge tables
|
|
38
|
+
for (const row of line.rows)
|
|
39
|
+
width = Math.max(width, displayWidth(row[i] ?? ""));
|
|
40
|
+
return Math.min(width, cap);
|
|
41
|
+
});
|
|
42
|
+
const pad = (cell, i) => padToWidth(truncateToWidth(cell, widths[i], ""), widths[i], line.align[i] ?? "left");
|
|
43
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { bold: true, color: theme.color.brand, children: line.header.map((c, i) => pad(c, i)).join(" ") }), _jsx(Text, { dimColor: true, children: widths.map((w) => theme.glyph.rule.repeat(w)).join(" ") }), line.rows.map((row, r) => (_jsx(Text, { children: row.map((c, i) => pad(c ?? "", i)).join(" ") }, r)))] }));
|
|
44
|
+
};
|
|
45
|
+
const Block = ({ line }) => {
|
|
46
|
+
// Called unconditionally: hooks may not sit inside a switch branch.
|
|
47
|
+
const { stdout } = useStdout();
|
|
48
|
+
switch (line.kind) {
|
|
49
|
+
case "blank":
|
|
50
|
+
return _jsx(Text, { children: " " });
|
|
51
|
+
case "heading":
|
|
52
|
+
return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, color: theme.color.brand, children: _jsx(Runs, { runs: line.runs }) }) }));
|
|
53
|
+
case "rule": {
|
|
54
|
+
// A fixed 40 is right for exactly one width: at 40 columns the 41st
|
|
55
|
+
// cell wrapped and left an orphan glyph on the next line.
|
|
56
|
+
const width = Math.max(10, Math.min(40, (stdout?.columns ?? 80) - 4));
|
|
57
|
+
return _jsx(Text, { dimColor: true, children: theme.glyph.rule.repeat(width) });
|
|
58
|
+
}
|
|
59
|
+
case "quote":
|
|
60
|
+
return (_jsxs(Text, { color: theme.color.accent, children: [theme.glyph.bar, " ", _jsx(Runs, { runs: line.runs })] }));
|
|
61
|
+
case "bullet":
|
|
62
|
+
return (_jsxs(Text, { children: [" ".repeat(line.depth), _jsxs(Text, { color: theme.color.success, children: [line.marker, " "] }), _jsx(Runs, { runs: line.runs })] }));
|
|
63
|
+
case "code":
|
|
64
|
+
return _jsx(CodeBlock, { lang: line.lang, lines: line.lines, open: line.open });
|
|
65
|
+
case "table":
|
|
66
|
+
return _jsx(TableBlock, { line: line });
|
|
67
|
+
case "text":
|
|
68
|
+
default:
|
|
69
|
+
return (_jsx(Text, { wrap: "wrap", children: _jsx(Runs, { runs: line.runs }) }));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/* ── Messages ───────────────────────────────────────────────────────────── */
|
|
73
|
+
/**
|
|
74
|
+
* How many rendered blocks of a live reply are shown at once.
|
|
75
|
+
*
|
|
76
|
+
* A 1200-line reply costs ~266 ms per frame in Ink's layout/output pass; 90%
|
|
77
|
+
* of that is node layout, not parsing. Rendering only the tail bounds the
|
|
78
|
+
* frame to roughly constant time. Nothing is lost: when the turn ends the
|
|
79
|
+
* whole message moves into <Static> and is written once, in full.
|
|
80
|
+
*/
|
|
81
|
+
const LIVE_BLOCK_LIMIT = 60;
|
|
82
|
+
const MessageViewImpl = ({ msg, live = false }) => {
|
|
83
|
+
// User text comes from the keyboard (and mid-prompt pastes) and system lines
|
|
84
|
+
// can embed server error strings: both are untrusted for terminal purposes.
|
|
85
|
+
if (msg.role === "user") {
|
|
86
|
+
return (_jsxs(Box, { marginTop: 1, marginBottom: 1, paddingLeft: 1, borderStyle: "round", borderColor: theme.color.muted, borderTop: false, borderRight: false, borderBottom: false, children: [_jsxs(Text, { color: theme.color.user, bold: true, children: [theme.glyph.pointer, " "] }), _jsx(Text, { color: theme.color.user, children: sanitize(msg.text) })] }));
|
|
87
|
+
}
|
|
88
|
+
if (msg.role === "system") {
|
|
89
|
+
const text = sanitize(msg.text);
|
|
90
|
+
return (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(Text, { color: systemColor(text), wrap: "wrap", children: text }) }));
|
|
91
|
+
}
|
|
92
|
+
const blocks = parseMarkdown(msg.text);
|
|
93
|
+
const hidden = live ? Math.max(0, blocks.length - LIVE_BLOCK_LIMIT) : 0;
|
|
94
|
+
const shown = hidden > 0 ? blocks.slice(-LIVE_BLOCK_LIMIT) : blocks;
|
|
95
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.color.accent, bold: true, children: msg.agentName ?? "agent" }), _jsxs(Text, { dimColor: true, children: [" ", theme.glyph.info] })] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, children: [hidden > 0 && (_jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " earlier line", hidden === 1 ? "" : "s", " (shown in full when the reply finishes)"] })), shown.map((line, i) => (_jsx(Block, { line: line }, hidden + i)))] })] }));
|
|
96
|
+
};
|
|
97
|
+
export const MessageView = memo(MessageViewImpl);
|
|
98
|
+
/**
|
|
99
|
+
* The reply currently being streamed. Rendered outside the static region.
|
|
100
|
+
*
|
|
101
|
+
* Memoized on purpose: a token commit replaces the message object and should
|
|
102
|
+
* re-parse, but keystrokes and the elapsed-seconds tick also re-render App
|
|
103
|
+
* while a turn is live. Without `memo` each of those re-parses the entire
|
|
104
|
+
* reply (several ms on a long answer) for no visible change.
|
|
105
|
+
*/
|
|
106
|
+
export const StreamingMessage = memo(({ msg }) => (_jsx(MessageViewImpl, { msg: msg, live: true })));
|
|
107
|
+
//# sourceMappingURL=MessageView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageView.js","sourceRoot":"","sources":["../../../src/ui/components/MessageView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjD,+EAA+E;AAE/E,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAsB,EAAE,EAAE,CAAC,CAC3C,KAAC,IAAI,IACH,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,SAAS,EAAE,GAAG,CAAC,SAAS,EACxB,aAAa,EAAE,GAAG,CAAC,MAAM,EACzB,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAA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ACtB,KAAC,KAAK,IAAkB,IAAI,EAAE,IAAI,IAAtB,MAAM,GAAG,CAAC,CAAgB,CACvC,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,EAAE,GAAG,EAAwB,EAAE,EAAE,CAAC,CACtE,KAAC,eAAe,IAAC,GAAG,EAAE,GAAG,EAAE,IAAI,SAAG,CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PermissionPrompt — Claude Code style y/N confirmation for risky local ops,
|
|
3
|
+
* with a before/after diff preview when the op is a file write.
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { PendingOp } from "../shared/types.js";
|
|
7
|
+
export declare const PermissionPrompt: ({ op }: {
|
|
8
|
+
op: PendingOp;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=PermissionPrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionPrompt.d.ts","sourceRoot":"","sources":["../../../src/ui/components/PermissionPrompt.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,WAAY;IAAE,EAAE,EAAE,SAAS,CAAA;CAAE,sBAmBzD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export const PermissionPrompt = ({ op }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "\u26A0 Permission required" }), _jsxs(Text, { children: ["OdysX wants to ", _jsx(Text, { bold: true, children: op.kind }), ": ", op.summary] }), op.diff && (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: [_jsx(Text, { bold: true, children: op.diff.file }), op.diff.before ? (_jsxs(Text, { color: "red", children: ["- ", op.diff.before.slice(0, 120).replace(/\n/g, " ⏎ ")] })) : (_jsx(Text, { dimColor: true, children: "(new file)" })), _jsxs(Text, { color: "green", children: ["+ ", op.diff.after.slice(0, 120).replace(/\n/g, " ⏎ ")] })] })), _jsx(Text, { dimColor: true, children: "y = allow \u00B7 n/esc = deny" })] }));
|
|
4
|
+
//# sourceMappingURL=PermissionPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionPrompt.js","sourceRoot":"","sources":["../../../src/ui/components/PermissionPrompt.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,EAAqB,EAAE,EAAE,CAAC,CAC7D,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,aAC/F,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,2CAA6B,EACtD,MAAC,IAAI,kCACY,KAAC,IAAI,IAAC,IAAI,kBAAE,EAAE,CAAC,IAAI,GAAQ,QAAG,EAAE,CAAC,OAAO,IAClD,EACN,EAAE,CAAC,IAAI,IAAI,CACV,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,aACtD,KAAC,IAAI,IAAC,IAAI,kBAAE,EAAE,CAAC,IAAI,CAAC,IAAI,GAAQ,EAC/B,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAChB,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,mBAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAQ,CAChF,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,QAAQ,iCAAkB,CACjC,EACD,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,mBAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAQ,IAC5E,CACP,EACD,KAAC,IAAI,IAAC,QAAQ,oDAAgC,IAC1C,CACP,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay pickers: agent switcher, session resumer, sign-in chooser, and the
|
|
3
|
+
* y/N permission prompt for risky local ops.
|
|
4
|
+
*
|
|
5
|
+
* One frame, one interaction grammar (`↑/↓ move · Enter confirm · esc back`),
|
|
6
|
+
* one palette — the four overlays should feel like the same control.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { AgentOption, PendingOp, SessionRow } from "../shared/types.js";
|
|
10
|
+
export declare const AgentPicker: ({ options, selected, busy, }: {
|
|
11
|
+
options: AgentOption[];
|
|
12
|
+
selected: number;
|
|
13
|
+
busy?: boolean;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export declare const SessionPicker: ({ rows, selected, busy, }: {
|
|
16
|
+
rows: SessionRow[];
|
|
17
|
+
selected: number;
|
|
18
|
+
busy?: boolean;
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
export declare const AuthPicker: ({ options, selected, busy, }: {
|
|
21
|
+
options: readonly {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}[];
|
|
26
|
+
selected: number;
|
|
27
|
+
busy?: boolean;
|
|
28
|
+
}) => React.JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Folder trust prompt — shown once per unfamiliar workspace, before the REPL
|
|
31
|
+
* exposes any read/write/exec capability. Unlike the y/N op prompt, declining
|
|
32
|
+
* here exits: an untrusted folder means no session at all, not a session with
|
|
33
|
+
* capabilities turned off one by one after the fact.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TrustPrompt: ({ folder, selected, mode, }: {
|
|
36
|
+
folder: string;
|
|
37
|
+
selected: number;
|
|
38
|
+
mode: string;
|
|
39
|
+
}) => React.JSX.Element;
|
|
40
|
+
export declare const PermissionPrompt: ({ op }: {
|
|
41
|
+
op: PendingOp;
|
|
42
|
+
}) => React.JSX.Element;
|
|
43
|
+
//# sourceMappingURL=Pickers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pickers.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Pickers.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAqE7E,eAAO,MAAM,WAAW,iCAIrB;IACD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,sBAkBA,CAAC;AAGF,eAAO,MAAM,aAAa,8BAIvB;IACD,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,sBA8BA,CAAC;AAGF,eAAO,MAAM,UAAU,iCAIpB;IACD,OAAO,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,sBAYA,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,gCAIrB;IACD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,sBAwBA,CAAC;AAGF,eAAO,MAAM,gBAAgB,WAAY;IAAE,EAAE,EAAE,SAAS,CAAA;CAAE,sBAiBzD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { theme } from "../theme.js";
|
|
4
|
+
/** Shared frame so every overlay has identical chrome. */
|
|
5
|
+
const Panel = ({ title, hint, color = theme.color.accent, children, }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: color, paddingX: 1, paddingY: 0, marginBottom: 1, children: [_jsx(Text, { bold: true, color: color, children: title }), hint && _jsx(Text, { dimColor: true, children: hint }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: children })] }));
|
|
6
|
+
/** A selectable row: pointer, label, and a dimmed detail. */
|
|
7
|
+
const Row = ({ selected, color, label, detail, disabled, }) => (_jsxs(Text, { color: selected ? color : theme.color.muted, bold: selected, dimColor: disabled, wrap: "truncate-end", children: [selected ? `${theme.glyph.pointer} ` : " ", label, detail ? ` — ${detail}` : ""] }));
|
|
8
|
+
/** Notice rendered in place of rows when a list is empty. */
|
|
9
|
+
const Empty = ({ children }) => (_jsx(Text, { dimColor: true, children: children }));
|
|
10
|
+
/* ── /agent picker ── */
|
|
11
|
+
export const AgentPicker = ({ options, selected, busy, }) => (_jsx(Panel, { title: "Select an agent", hint: "\u2191/\u2193 move \u00B7 Enter switch \u00B7 esc cancel", children: busy && options.length === 0 ? (_jsx(Empty, { children: "Loading your agents\u2026" })) : options.length === 0 ? (_jsx(Empty, { children: "No agents available." })) : (options.map((opt, idx) => (_jsx(Row, { selected: idx === selected, color: theme.color.accent, label: opt.label, detail: opt.description }, opt.id)))) }));
|
|
12
|
+
/* ── /sessions picker ── */
|
|
13
|
+
export const SessionPicker = ({ rows, selected, busy, }) => (_jsx(Panel, { title: "Resume a session", hint: "\u2191/\u2193 move \u00B7 Enter resume \u00B7 esc cancel", color: theme.color.info, children: busy && rows.length === 0 ? (_jsx(Empty, { children: "Loading your sessions\u2026" })) : rows.length === 0 ? (_jsx(Empty, { children: "No sessions yet." })) : (rows.map((s, idx) => {
|
|
14
|
+
const when = s.updated_at ? new Date(s.updated_at).toLocaleString() : "unknown time";
|
|
15
|
+
const who = s.agent_name || s.agent_id || "agent";
|
|
16
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Row, { selected: idx === selected, color: theme.color.info, label: s.title?.slice(0, 60) || s.session_id.slice(0, 8), detail: when }), idx === selected && (_jsxs(Text, { dimColor: true, children: [" ", who, s.model ? ` · ${s.model}` : "", " \u00B7 ", s.session_id.slice(0, 12)] }))] }, s.session_id));
|
|
17
|
+
})) }));
|
|
18
|
+
/* ── Sign-in method picker ── */
|
|
19
|
+
export const AuthPicker = ({ options, selected, busy, }) => (_jsx(Panel, { title: "Sign in to OdysX", hint: "\u2191/\u2193 move \u00B7 Enter select \u00B7 esc cancel", color: theme.color.info, children: options.map((opt, idx) => (_jsx(Row, { selected: idx === selected && !busy, color: theme.color.info, label: opt.label, detail: opt.description }, opt.id))) }));
|
|
20
|
+
/**
|
|
21
|
+
* Folder trust prompt — shown once per unfamiliar workspace, before the REPL
|
|
22
|
+
* exposes any read/write/exec capability. Unlike the y/N op prompt, declining
|
|
23
|
+
* here exits: an untrusted folder means no session at all, not a session with
|
|
24
|
+
* capabilities turned off one by one after the fact.
|
|
25
|
+
*/
|
|
26
|
+
export const TrustPrompt = ({ folder, selected, mode, }) => (_jsxs(Panel, { title: `${theme.glyph.warn} Trust this folder?`, color: theme.color.warning, hint: "\u2191/\u2193 or 1/2 to choose \u00B7 Enter confirm \u00B7 esc exit", children: [_jsx(Text, { wrap: "truncate-end", children: folder }), _jsx(Text, { dimColor: true, children: "Codemind can read, edit, and run commands here. Only trust folders you own." }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Row, { selected: selected === 0, color: theme.color.success, label: "1. Yes, I trust this folder" }), _jsx(Row, { selected: selected === 1, color: theme.color.error, label: "2. No, exit" })] }), _jsxs(Text, { dimColor: true, children: ["Permission mode after trusting: ", mode, " (/mode to change)"] })] }));
|
|
27
|
+
/* ── PermissionPrompt — y/N for risky local ops, with a diff preview ── */
|
|
28
|
+
export const PermissionPrompt = ({ op }) => (_jsxs(Panel, { title: `${theme.glyph.warn} Permission required`, color: theme.color.warning, hint: "y = allow \u00B7 n/esc = deny", children: [_jsxs(Text, { children: ["OdysX wants to ", _jsx(Text, { bold: true, children: op.kind }), ": ", op.summary] }), op.diff && (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, children: [_jsx(Text, { bold: true, children: op.diff.file }), op.diff.before ? (_jsxs(Text, { color: theme.color.error, children: ["- ", preview(op.diff.before)] })) : (_jsx(Text, { dimColor: true, children: "(new file)" })), _jsxs(Text, { color: theme.color.success, children: ["+ ", preview(op.diff.after)] })] }))] }));
|
|
29
|
+
const preview = (text) => {
|
|
30
|
+
const single = text.replace(/\s*\n\s*/g, " ⏎ ");
|
|
31
|
+
return single.length > 160 ? single.slice(0, 159) + "…" : single;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=Pickers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pickers.js","sourceRoot":"","sources":["../../../src/ui/components/Pickers.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,O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AAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAC,+BAA0B,aACnH,MAAC,IAAI,kCACY,KAAC,IAAI,IAAC,IAAI,kBAAE,EAAE,CAAC,IAAI,GAAQ,QAAG,EAAE,CAAC,OAAO,IAClD,EACN,EAAE,CAAC,IAAI,IAAI,CACV,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,aACtD,KAAC,IAAI,IAAC,IAAI,kBAAE,EAAE,CAAC,IAAI,CAAC,IAAI,GAAQ,EAC/B,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAChB,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,mBAAK,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAQ,CACnE,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,QAAQ,iCAAkB,CACjC,EACD,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,mBAAK,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAQ,IAC/D,CACP,IACK,CACT,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACnE,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Searchable overlay used by Ctrl+/ (command palette) and Ctrl+R (history).
|
|
3
|
+
*
|
|
4
|
+
* Both modes share one interaction grammar and one frame; only the title,
|
|
5
|
+
* rows and empty hint differ. It renders above the input bar and outside
|
|
6
|
+
* <Static>, so results are redrawn on every keystroke.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
export interface SearchRow {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const SearchOverlay: ({ title, query, rows, selected, hint, }: {
|
|
15
|
+
title: string;
|
|
16
|
+
query: string;
|
|
17
|
+
rows: SearchRow[];
|
|
18
|
+
selected: number;
|
|
19
|
+
hint: string;
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=SearchOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchOverlay.d.ts","sourceRoot":"","sources":["../../../src/ui/components/SearchOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,4CAMvB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,sBAkCA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useStdout } from "ink";
|
|
3
|
+
import { theme } from "../theme.js";
|
|
4
|
+
import { displayWidth, truncateToWidth } from "../utils/terminal-text.js";
|
|
5
|
+
export const SearchOverlay = ({ title, query, rows, selected, hint, }) => {
|
|
6
|
+
const { stdout } = useStdout();
|
|
7
|
+
const width = Math.max(20, (stdout?.columns ?? 80) - 6);
|
|
8
|
+
// Bound the visible window so a long history can't push the input offscreen.
|
|
9
|
+
const limit = 10;
|
|
10
|
+
const start = Math.max(0, Math.min(selected - 4, Math.max(0, rows.length - limit)));
|
|
11
|
+
const visible = rows.slice(start, start + limit);
|
|
12
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.color.info, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: theme.color.info, children: title }), _jsxs(Text, { color: theme.color.user, children: [theme.glyph.pointer, " ", query || "…"] }), visible.map((row, i) => (_jsxs(Text, { color: start + i === selected ? theme.color.brand : theme.color.muted, bold: start + i === selected, wrap: "truncate-end", children: [start + i === selected ? "› " : " ", truncateToWidth(row.label, Math.max(8, Math.floor(width * 0.55))), row.detail ? ` ${truncateToWidth(row.detail, Math.max(6, width - displayWidth(row.label) - 8))}` : ""] }, row.key))), rows.length === 0 && _jsx(Text, { dimColor: true, children: "No matches." }), start > 0 && _jsxs(Text, { dimColor: true, children: [" \u2026 ", start, " above"] }), rows.length - start - visible.length > 0 && (_jsxs(Text, { dimColor: true, children: [" \u2026 ", rows.length - start - visible.length, " below"] })), _jsx(Text, { dimColor: true, children: hint })] }));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=SearchOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchOverlay.js","sourceRoot":"","sources":["../../../src/ui/components/SearchOverlay.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQ1E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,GAOL,EAAE,E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,EAAC,cAAc,aAElB,KAAK,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACpC,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EACjE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAPlG,GAAG,CAAC,GAAG,CAQP,CACR,CAAC,EACD,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,KAAC,IAAI,IAAC,QAAQ,kCAAmB,EACtD,KAAK,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,QAAQ,gCAAM,KAAK,cAAc,EACpD,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3C,MAAC,IAAI,IAAC,QAAQ,gCAAM,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,cAAc,CACvE,EACD,KAAC,IAAI,IAAC,QAAQ,kBAAE,IAAI,GAAQ,IACxB,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session picker (/sessions → select a past session to resume).
|
|
3
|
+
* Same interaction model as AgentPicker: ↑/↓ · Enter · esc.
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { SessionRow } from "../shared/types.js";
|
|
7
|
+
export declare const SessionPicker: ({ options, selected, busy, }: {
|
|
8
|
+
options: SessionRow[];
|
|
9
|
+
selected: number;
|
|
10
|
+
busy?: boolean;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=SessionPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionPicker.d.ts","sourceRoot":"","sources":["../../../src/ui/components/SessionPicker.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,aAAa,iCAIvB;IACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,sBA4BA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export const SessionPicker = ({ options, selected, busy, }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "blue", children: "Resume a session" }), _jsx(Text, { dimColor: true, children: "\u2191/\u2193 to move \u00B7 Enter to resume \u00B7 esc to cancel" }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: busy && options.length === 0 ? (_jsx(Text, { dimColor: true, children: "Loading your sessions\u2026" })) : (options.map((opt, idx) => {
|
|
4
|
+
const isSelected = idx === selected && !busy;
|
|
5
|
+
const when = opt.updated_at ? new Date(opt.updated_at).toLocaleString() : "unknown time";
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: isSelected ? "blue" : "gray", bold: isSelected, children: [isSelected ? "❯ " : " ", opt.title || opt.session_id.slice(0, 8), _jsxs(Text, { dimColor: true, children: [" \u2014 ", when] })] }), (opt.agent_name || opt.agent_id) && (_jsxs(Text, { dimColor: true, children: [" ", "agent: ", opt.agent_name ?? opt.agent_id, opt.model ? ` · ${opt.model}` : ""] }))] }, opt.session_id));
|
|
7
|
+
})) })] }));
|
|
8
|
+
//# sourceMappingURL=SessionPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionPicker.js","sourceRoot":"","sources":["../../../src/ui/components/SessionPicker.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,IAAI,GAKL,EAAE,EAAE,CAAC,CACJ,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,aAC7F,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,iCAAwB,EAC/C,KAAC,IAAI,IAAC,QAAQ,wFAAqD,EAEnE,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACtC,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC9B,KAAC,IAAI,IAAC,QAAQ,kDAA8B,CAC7C,CAAC,CAAC,CAAC,CACF,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBACvB,MAAM,UAAU,GAAG,GAAG,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC;gBAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;gBACzF,OAAO,CACL,MAAC,GAAG,IAAsB,aAAa,EAAC,QAAQ,aAC9C,MAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,aACxD,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACxB,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACxC,MAAC,IAAI,IAAC,QAAQ,+BAAK,IAAI,IAAQ,IAC1B,EACN,CAAC,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CACnC,MAAC,IAAI,IAAC,QAAQ,mBAAE,KAAK,aAAS,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAQ,CACzG,KARO,GAAG,CAAC,UAAU,CASlB,CACP,CAAC;YACJ,CAAC,CAAC,CACH,GACG,IACF,CACP,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live spinner while the agent streams — frame, elapsed time, and what Enter
|
|
3
|
+
* will do (queue) vs Esc (interrupt).
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export declare const WorkingIndicator: ({ elapsed, agent }: {
|
|
7
|
+
elapsed: number;
|
|
8
|
+
agent?: string;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=WorkingIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkingIndicator.d.ts","sourceRoot":"","sources":["../../../src/ui/components/WorkingIndicator.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAWnD,eAAO,MAAM,gBAAgB,uBAAwB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,sBAmBvF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Live spinner while the agent streams — frame, elapsed time, and what Enter
|
|
4
|
+
* will do (queue) vs Esc (interrupt).
|
|
5
|
+
*/
|
|
6
|
+
import { useState, useEffect } from "react";
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { theme } from "../theme.js";
|
|
9
|
+
const SPINNER_FRAMES = ["✶", "✻", "✽", "✺", "❋", "✹"];
|
|
10
|
+
const formatElapsed = (seconds) => {
|
|
11
|
+
if (seconds < 60)
|
|
12
|
+
return `${seconds}s`;
|
|
13
|
+
return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
|
|
14
|
+
};
|
|
15
|
+
export const WorkingIndicator = ({ elapsed, agent }) => {
|
|
16
|
+
const [frame, setFrame] = useState(0);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const iv = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 90);
|
|
19
|
+
return () => clearInterval(iv);
|
|
20
|
+
}, []);
|
|
21
|
+
return (_jsxs(Box, { marginBottom: 1, paddingLeft: 1, columnGap: 1, children: [_jsx(Text, { color: theme.color.accent, children: SPINNER_FRAMES[frame] }), _jsxs(Text, { color: theme.color.muted, wrap: "truncate-end", children: [agent ? `${agent} is thinking` : "Thinking", " \u00B7 ", formatElapsed(elapsed)] }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: "esc to interrupt \u00B7 enter to queue" })] }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=WorkingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkingIndicator.js","sourceRoot":"","sources":["../../../src/ui/components/WorkingIndicator.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EA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AAG,KAAK,cAAc,CAAC,CAAC,CAAC,UAAU,cAAK,aAAa,CAAC,OAAO,CAAC,IAClE,EAGP,KAAC,IAAI,IAAC,QAAQ,QAAC,IAAI,EAAC,cAAc,uDAAyC,IACvE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiKeyEntry.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/ApiKeyEntry.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,WAAW,cAAe;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,sBAqBvD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { theme } from "../theme.js";
|
|
4
|
+
export const ApiKeyEntry = ({ draft }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.color.info, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: theme.color.info, children: "Paste your OdysX API key" }), _jsx(Text, { dimColor: true, children: "Enter to save \u00B7 esc to cancel \u00B7 input is masked" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.color.info, bold: true, children: [theme.glyph.pointer, " ", "•".repeat(draft.length), _jsx(Text, { dimColor: true, children: "_" })] }) })] }));
|
|
5
|
+
//# sourceMappingURL=ApiKeyEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiKeyEntry.js","sourceRoot":"","sources":["../../../src/ui/controls/ApiKeyEntry.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAqB,EAAE,EAAE,CAAC,CAC3D,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAC7B,QAAQ,EAAE,CAAC,EACX,YAAY,EAAE,CAAC,aAEf,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,yCAE3B,EACP,KAAC,IAAI,IAAC,QAAQ,gFAAuD,EACrE,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,mBAChC,KAAK,CAAC,KAAK,CAAC,OAAO,EACnB,GAAG,EACH,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,KAAC,IAAI,IAAC,QAAQ,wBAAS,IAClB,GACH,IACF,CACP,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiSelect — checkbox list for picking multiple options.
|
|
3
|
+
* space toggles a row · enter confirms · esc cancels (via parent).
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface MultiSelectProps {
|
|
7
|
+
title: string;
|
|
8
|
+
options: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}>;
|
|
13
|
+
selectedIds: ReadonlySet<string>;
|
|
14
|
+
cursorIndex: number;
|
|
15
|
+
busy?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const MultiSelect: ({ title, options, selectedIds, cursorIndex, busy, }: MultiSelectProps) => React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=MultiSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/MultiSelect.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,wDAMrB,gBAAgB,sBAgClB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { theme } from "../theme.js";
|
|
4
|
+
export const MultiSelect = ({ title, options, selectedIds, cursorIndex, busy, }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.color.accent, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: theme.color.accent, children: title }), _jsx(Text, { dimColor: true, children: "\u2191/\u2193 to move \u00B7 space to toggle \u00B7 enter to confirm \u00B7 esc to cancel" }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: busy ? (_jsx(Text, { dimColor: true, children: "Loading\u2026" })) : (options.map((opt, idx) => {
|
|
5
|
+
const isCursor = idx === cursorIndex;
|
|
6
|
+
const checked = selectedIds.has(opt.id);
|
|
7
|
+
return (_jsx(Box, { children: _jsxs(Text, { color: isCursor ? theme.color.accent : theme.color.muted, bold: isCursor, children: [isCursor ? `${theme.glyph.pointer} ` : " ", "[", checked ? theme.glyph.check : " ", "] ", opt.label, opt.description && _jsxs(Text, { dimColor: true, children: [" \u2014 ", opt.description] })] }) }, opt.id));
|
|
8
|
+
})) })] }));
|
|
9
|
+
//# source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AC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,OAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAI,GAAG,CAAC,KAAK,EAC5F,GAAG,CAAC,WAAW,IAAI,MAAC,IAAI,IAAC,QAAQ,+BAAK,GAAG,CAAC,WAAW,IAAQ,IACzD,IAJC,GAAG,CAAC,EAAE,CAKV,CACP,CAAC;YACJ,CAAC,CAAC,CACH,GACG,IACF,CACP,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentOption } from "../shared/types.js";
|
|
2
|
+
export interface AgentPickerState {
|
|
3
|
+
open: boolean;
|
|
4
|
+
busy: boolean;
|
|
5
|
+
options: AgentOption[];
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const useAgentPicker: (addMessage: (text: string) => void) => {
|
|
9
|
+
agentPick: AgentPickerState;
|
|
10
|
+
setAgentPick: import("react").Dispatch<import("react").SetStateAction<AgentPickerState>>;
|
|
11
|
+
openAgentPicker: (currentAgentId: string) => Promise<void>;
|
|
12
|
+
agentNames: import("react").RefObject<Map<string, string>>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useAgentPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentPicker.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useAgentPicker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAID,eAAO,MAAM,cAAc,eACb,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;;;sCAMyB,MAAM;;CAyClE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* /agent picker — option list + the id→display-name cache used by the footer.
|
|
3
|
+
*/
|
|
4
|
+
import { useCallback, useRef, useState } from "react";
|
|
5
|
+
const CLOSED = { open: false, busy: false, options: [], index: 0 };
|
|
6
|
+
export const useAgentPicker = (addMessage) => {
|
|
7
|
+
const [agentPick, setAgentPick] = useState(CLOSED);
|
|
8
|
+
/* id → display-name cache for the agent footer */
|
|
9
|
+
const agentNames = useRef(new Map([["master", "Master"]]));
|
|
10
|
+
const openAgentPicker = useCallback(async (currentAgentId) => {
|
|
11
|
+
setAgentPick({ open: true, busy: true, options: [], index: 0 });
|
|
12
|
+
let rows = [];
|
|
13
|
+
try {
|
|
14
|
+
const { apiCall } = await import("../../core/provider/index.js");
|
|
15
|
+
const res = await apiCall("/api/v1/agents");
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
addMessage(`✗ ${res.error}`);
|
|
18
|
+
setAgentPick(CLOSED);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
rows = Array.isArray(res.data) ? res.data : [];
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
addMessage(`✗ ${err instanceof Error ? err.message : String(err)}`);
|
|
25
|
+
setAgentPick(CLOSED);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Master first (auto-routing), then the user's published agents.
|
|
29
|
+
const names = new Map([["master", "Master"]]);
|
|
30
|
+
for (const a of rows) {
|
|
31
|
+
const id = (a.id ?? a.agent_id ?? "");
|
|
32
|
+
if (id && a.name)
|
|
33
|
+
names.set(id, a.name);
|
|
34
|
+
}
|
|
35
|
+
agentNames.current = names;
|
|
36
|
+
const options = [
|
|
37
|
+
{ id: "master", label: "master", description: "Auto-route to the best sub-agent" },
|
|
38
|
+
...rows
|
|
39
|
+
.filter((a) => (a.status ?? a.is_live ?? "published") !== "disabled")
|
|
40
|
+
.map((a) => ({
|
|
41
|
+
id: (a.id ?? a.agent_id ?? ""),
|
|
42
|
+
label: (a.name ?? (a.id ?? a.agent_id ?? "agent")),
|
|
43
|
+
description: (a.description ?? "").slice(0, 60),
|
|
44
|
+
}))
|
|
45
|
+
.filter((a) => a.id),
|
|
46
|
+
];
|
|
47
|
+
// Preselect the currently-active agent.
|
|
48
|
+
const idx = Math.max(0, options.findIndex((o) => o.id === currentAgentId));
|
|
49
|
+
setAgentPick({ open: true, busy: false, options, index: idx });
|
|
50
|
+
}, [addMessage]);
|
|
51
|
+
return { agentPick, setAgentPick, openAgentPicker, agentNames };
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=useAgentPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentPicker.js","sourceRoot":"","sources":["../../../src/ui/hooks/useAgentPicker.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUtD,MAAM,MAAM,GAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAErF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,UAAkC,EAClC,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAmB,MAAM,CAAC,CAAC;IACrE,kDAAkD;IAClD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,GAAG,CAAiB,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3E,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,EAAE,cAAsB,EAAE,EAAE;QACnE,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE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|
3
|
+
authMode: AuthMode;
|
|
4
|
+
setAuthMode: React.Dispatch<React.SetStateAction<AuthMode>>;
|
|
5
|
+
authIndex: number;
|
|
6
|
+
setAuthIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
7
|
+
apiKeyDraft: string;
|
|
8
|
+
setApiKeyDraft: React.Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
authBusy: boolean;
|
|
10
|
+
/** Save the entered API key via core/auth, reporting the outcome. */
|
|
11
|
+
submitApiKey: (keyVal: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const useAuthFlow: (addMessage: (text: string) => void) => AuthFlow;
|
|
14
|
+
//# sourceMappingURL=useAuthFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthFlow.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useAuthFlow.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,WAAW,eACV,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KACjC,QAyBF,CAAC"}
|