@nex-ai/nex 0.1.64 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +236 -231
- package/bin/nex-mcp.js +50 -0
- package/bin/nex.js +53 -0
- package/package.json +9 -36
- package/dist/agent/adoption.d.ts +0 -23
- package/dist/agent/adoption.js +0 -87
- package/dist/agent/adoption.js.map +0 -1
- package/dist/agent/gossip.d.ts +0 -17
- package/dist/agent/gossip.js +0 -48
- package/dist/agent/gossip.js.map +0 -1
- package/dist/agent/loop.d.ts +0 -59
- package/dist/agent/loop.js +0 -389
- package/dist/agent/loop.js.map +0 -1
- package/dist/agent/queues.d.ts +0 -16
- package/dist/agent/queues.js +0 -44
- package/dist/agent/queues.js.map +0 -1
- package/dist/agent/session-store.d.ts +0 -21
- package/dist/agent/session-store.js +0 -96
- package/dist/agent/session-store.js.map +0 -1
- package/dist/agent/templates.d.ts +0 -5
- package/dist/agent/templates.js +0 -55
- package/dist/agent/templates.js.map +0 -1
- package/dist/agent/tools.d.ts +0 -25
- package/dist/agent/tools.js +0 -238
- package/dist/agent/tools.js.map +0 -1
- package/dist/agent/types.d.ts +0 -59
- package/dist/agent/types.js +0 -5
- package/dist/agent/types.js.map +0 -1
- package/dist/calendar/scheduler.d.ts +0 -32
- package/dist/calendar/scheduler.js +0 -178
- package/dist/calendar/scheduler.js.map +0 -1
- package/dist/calendar/store.d.ts +0 -15
- package/dist/calendar/store.js +0 -50
- package/dist/calendar/store.js.map +0 -1
- package/dist/calendar/types.d.ts +0 -17
- package/dist/calendar/types.js +0 -5
- package/dist/calendar/types.js.map +0 -1
- package/dist/chat/channel.d.ts +0 -20
- package/dist/chat/channel.js +0 -84
- package/dist/chat/channel.js.map +0 -1
- package/dist/chat/message-store.d.ts +0 -18
- package/dist/chat/message-store.js +0 -82
- package/dist/chat/message-store.js.map +0 -1
- package/dist/chat/router.d.ts +0 -17
- package/dist/chat/router.js +0 -65
- package/dist/chat/router.js.map +0 -1
- package/dist/chat/suggested-responses.d.ts +0 -6
- package/dist/chat/suggested-responses.js +0 -99
- package/dist/chat/suggested-responses.js.map +0 -1
- package/dist/chat/types.d.ts +0 -28
- package/dist/chat/types.js +0 -5
- package/dist/chat/types.js.map +0 -1
- package/dist/cli.d.ts +0 -5
- package/dist/cli.js +0 -20
- package/dist/cli.js.map +0 -1
- package/dist/commands/attribute.d.ts +0 -4
- package/dist/commands/attribute.js +0 -75
- package/dist/commands/attribute.js.map +0 -1
- package/dist/commands/config-cmd.d.ts +0 -4
- package/dist/commands/config-cmd.js +0 -53
- package/dist/commands/config-cmd.js.map +0 -1
- package/dist/commands/context.d.ts +0 -4
- package/dist/commands/context.js +0 -167
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/dispatch.d.ts +0 -44
- package/dist/commands/dispatch.js +0 -1550
- package/dist/commands/dispatch.js.map +0 -1
- package/dist/commands/graph.d.ts +0 -5
- package/dist/commands/graph.js +0 -77
- package/dist/commands/graph.js.map +0 -1
- package/dist/commands/init.d.ts +0 -49
- package/dist/commands/init.js +0 -319
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/insight.d.ts +0 -4
- package/dist/commands/insight.js +0 -39
- package/dist/commands/insight.js.map +0 -1
- package/dist/commands/integrate.d.ts +0 -4
- package/dist/commands/integrate.js +0 -361
- package/dist/commands/integrate.js.map +0 -1
- package/dist/commands/list-job.d.ts +0 -4
- package/dist/commands/list-job.js +0 -41
- package/dist/commands/list-job.js.map +0 -1
- package/dist/commands/list.d.ts +0 -4
- package/dist/commands/list.js +0 -148
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/note.d.ts +0 -4
- package/dist/commands/note.js +0 -77
- package/dist/commands/note.js.map +0 -1
- package/dist/commands/object.d.ts +0 -4
- package/dist/commands/object.js +0 -78
- package/dist/commands/object.js.map +0 -1
- package/dist/commands/parse-input.d.ts +0 -5
- package/dist/commands/parse-input.js +0 -37
- package/dist/commands/parse-input.js.map +0 -1
- package/dist/commands/record.d.ts +0 -4
- package/dist/commands/record.js +0 -126
- package/dist/commands/record.js.map +0 -1
- package/dist/commands/register.d.ts +0 -4
- package/dist/commands/register.js +0 -23
- package/dist/commands/register.js.map +0 -1
- package/dist/commands/relationship.d.ts +0 -4
- package/dist/commands/relationship.js +0 -80
- package/dist/commands/relationship.js.map +0 -1
- package/dist/commands/scan.d.ts +0 -4
- package/dist/commands/scan.js +0 -107
- package/dist/commands/scan.js.map +0 -1
- package/dist/commands/search.d.ts +0 -4
- package/dist/commands/search.js +0 -62
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/session.d.ts +0 -4
- package/dist/commands/session.js +0 -31
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -25
- package/dist/commands/setup.js +0 -580
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/task.d.ts +0 -4
- package/dist/commands/task.js +0 -140
- package/dist/commands/task.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -8
- package/dist/commands/workspace.js +0 -251
- package/dist/commands/workspace.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -142
- package/dist/index.js.map +0 -1
- package/dist/lib/capture-filter.d.ts +0 -9
- package/dist/lib/capture-filter.js +0 -14
- package/dist/lib/capture-filter.js.map +0 -1
- package/dist/lib/client.d.ts +0 -20
- package/dist/lib/client.js +0 -160
- package/dist/lib/client.js.map +0 -1
- package/dist/lib/config.d.ts +0 -35
- package/dist/lib/config.js +0 -96
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/context-format.d.ts +0 -7
- package/dist/lib/context-format.js +0 -21
- package/dist/lib/context-format.js.map +0 -1
- package/dist/lib/errors.d.ts +0 -18
- package/dist/lib/errors.js +0 -30
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/file-scanner.d.ts +0 -38
- package/dist/lib/file-scanner.js +0 -188
- package/dist/lib/file-scanner.js.map +0 -1
- package/dist/lib/graph-html.d.ts +0 -59
- package/dist/lib/graph-html.js +0 -859
- package/dist/lib/graph-html.js.map +0 -1
- package/dist/lib/installers.d.ts +0 -80
- package/dist/lib/installers.js +0 -602
- package/dist/lib/installers.js.map +0 -1
- package/dist/lib/integrations.d.ts +0 -23
- package/dist/lib/integrations.js +0 -25
- package/dist/lib/integrations.js.map +0 -1
- package/dist/lib/output.d.ts +0 -7
- package/dist/lib/output.js +0 -70
- package/dist/lib/output.js.map +0 -1
- package/dist/lib/platform-detect.d.ts +0 -23
- package/dist/lib/platform-detect.js +0 -359
- package/dist/lib/platform-detect.js.map +0 -1
- package/dist/lib/project-config.d.ts +0 -53
- package/dist/lib/project-config.js +0 -151
- package/dist/lib/project-config.js.map +0 -1
- package/dist/lib/prompt.d.ts +0 -15
- package/dist/lib/prompt.js +0 -213
- package/dist/lib/prompt.js.map +0 -1
- package/dist/lib/rate-limiter.d.ts +0 -13
- package/dist/lib/rate-limiter.js +0 -49
- package/dist/lib/rate-limiter.js.map +0 -1
- package/dist/lib/recall-filter.d.ts +0 -5
- package/dist/lib/recall-filter.js +0 -24
- package/dist/lib/recall-filter.js.map +0 -1
- package/dist/lib/session-store.d.ts +0 -15
- package/dist/lib/session-store.js +0 -62
- package/dist/lib/session-store.js.map +0 -1
- package/dist/lib/tui.d.ts +0 -57
- package/dist/lib/tui.js +0 -247
- package/dist/lib/tui.js.map +0 -1
- package/dist/lib/workspace-registry.d.ts +0 -47
- package/dist/lib/workspace-registry.js +0 -240
- package/dist/lib/workspace-registry.js.map +0 -1
- package/dist/mcp/channel.d.ts +0 -24
- package/dist/mcp/channel.js +0 -198
- package/dist/mcp/channel.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -20
- package/dist/mcp/client.js +0 -131
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -19
- package/dist/mcp/config.js +0 -48
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/context-files.d.ts +0 -9
- package/dist/mcp/context-files.js +0 -90
- package/dist/mcp/context-files.js.map +0 -1
- package/dist/mcp/file-manifest.d.ts +0 -27
- package/dist/mcp/file-manifest.js +0 -68
- package/dist/mcp/file-manifest.js.map +0 -1
- package/dist/mcp/file-scanner.d.ts +0 -17
- package/dist/mcp/file-scanner.js +0 -77
- package/dist/mcp/file-scanner.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -2
- package/dist/mcp/index.js +0 -51
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/rate-limiter.d.ts +0 -14
- package/dist/mcp/rate-limiter.js +0 -60
- package/dist/mcp/rate-limiter.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -6
- package/dist/mcp/server.js +0 -44
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/session-store.d.ts +0 -16
- package/dist/mcp/session-store.js +0 -70
- package/dist/mcp/session-store.js.map +0 -1
- package/dist/mcp/tools/context.d.ts +0 -3
- package/dist/mcp/tools/context.js +0 -65
- package/dist/mcp/tools/context.js.map +0 -1
- package/dist/mcp/tools/insights.d.ts +0 -3
- package/dist/mcp/tools/insights.js +0 -24
- package/dist/mcp/tools/insights.js.map +0 -1
- package/dist/mcp/tools/integrations.d.ts +0 -3
- package/dist/mcp/tools/integrations.js +0 -27
- package/dist/mcp/tools/integrations.js.map +0 -1
- package/dist/mcp/tools/lists.d.ts +0 -3
- package/dist/mcp/tools/lists.js +0 -101
- package/dist/mcp/tools/lists.js.map +0 -1
- package/dist/mcp/tools/notes.d.ts +0 -3
- package/dist/mcp/tools/notes.js +0 -52
- package/dist/mcp/tools/notes.js.map +0 -1
- package/dist/mcp/tools/notifications.d.ts +0 -3
- package/dist/mcp/tools/notifications.js +0 -53
- package/dist/mcp/tools/notifications.js.map +0 -1
- package/dist/mcp/tools/records.d.ts +0 -3
- package/dist/mcp/tools/records.js +0 -74
- package/dist/mcp/tools/records.js.map +0 -1
- package/dist/mcp/tools/register.d.ts +0 -3
- package/dist/mcp/tools/register.js +0 -41
- package/dist/mcp/tools/register.js.map +0 -1
- package/dist/mcp/tools/relationships.d.ts +0 -3
- package/dist/mcp/tools/relationships.js +0 -47
- package/dist/mcp/tools/relationships.js.map +0 -1
- package/dist/mcp/tools/scan.d.ts +0 -3
- package/dist/mcp/tools/scan.js +0 -37
- package/dist/mcp/tools/scan.js.map +0 -1
- package/dist/mcp/tools/schema.d.ts +0 -3
- package/dist/mcp/tools/schema.js +0 -108
- package/dist/mcp/tools/schema.js.map +0 -1
- package/dist/mcp/tools/search.d.ts +0 -3
- package/dist/mcp/tools/search.js +0 -8
- package/dist/mcp/tools/search.js.map +0 -1
- package/dist/mcp/tools/tasks.d.ts +0 -3
- package/dist/mcp/tools/tasks.js +0 -88
- package/dist/mcp/tools/tasks.js.map +0 -1
- package/dist/mcp/workspace-data-dir.d.ts +0 -2
- package/dist/mcp/workspace-data-dir.js +0 -28
- package/dist/mcp/workspace-data-dir.js.map +0 -1
- package/dist/orchestration/budget.d.ts +0 -32
- package/dist/orchestration/budget.js +0 -72
- package/dist/orchestration/budget.js.map +0 -1
- package/dist/orchestration/executor.d.ts +0 -59
- package/dist/orchestration/executor.js +0 -197
- package/dist/orchestration/executor.js.map +0 -1
- package/dist/orchestration/router.d.ts +0 -30
- package/dist/orchestration/router.js +0 -98
- package/dist/orchestration/router.js.map +0 -1
- package/dist/orchestration/templates.d.ts +0 -11
- package/dist/orchestration/templates.js +0 -99
- package/dist/orchestration/templates.js.map +0 -1
- package/dist/orchestration/types.d.ts +0 -58
- package/dist/orchestration/types.js +0 -7
- package/dist/orchestration/types.js.map +0 -1
- package/dist/plugin/auto-capture.d.ts +0 -11
- package/dist/plugin/auto-capture.js +0 -135
- package/dist/plugin/auto-capture.js.map +0 -1
- package/dist/plugin/auto-recall-worker.d.ts +0 -2
- package/dist/plugin/auto-recall-worker.js +0 -74
- package/dist/plugin/auto-recall-worker.js.map +0 -1
- package/dist/plugin/auto-recall.d.ts +0 -11
- package/dist/plugin/auto-recall.js +0 -186
- package/dist/plugin/auto-recall.js.map +0 -1
- package/dist/plugin/auto-register.d.ts +0 -10
- package/dist/plugin/auto-register.js +0 -81
- package/dist/plugin/auto-register.js.map +0 -1
- package/dist/plugin/auto-scan.d.ts +0 -10
- package/dist/plugin/auto-scan.js +0 -54
- package/dist/plugin/auto-scan.js.map +0 -1
- package/dist/plugin/auto-session-start.d.ts +0 -14
- package/dist/plugin/auto-session-start.js +0 -156
- package/dist/plugin/auto-session-start.js.map +0 -1
- package/dist/plugin/capture-filter.d.ts +0 -21
- package/dist/plugin/capture-filter.js +0 -32
- package/dist/plugin/capture-filter.js.map +0 -1
- package/dist/plugin/config.d.ts +0 -61
- package/dist/plugin/config.js +0 -182
- package/dist/plugin/config.js.map +0 -1
- package/dist/plugin/context-files.d.ts +0 -23
- package/dist/plugin/context-files.js +0 -103
- package/dist/plugin/context-files.js.map +0 -1
- package/dist/plugin/context-format.d.ts +0 -18
- package/dist/plugin/context-format.js +0 -34
- package/dist/plugin/context-format.js.map +0 -1
- package/dist/plugin/file-manifest.d.ts +0 -27
- package/dist/plugin/file-manifest.js +0 -68
- package/dist/plugin/file-manifest.js.map +0 -1
- package/dist/plugin/file-scanner.d.ts +0 -19
- package/dist/plugin/file-scanner.js +0 -90
- package/dist/plugin/file-scanner.js.map +0 -1
- package/dist/plugin/nex-client.d.ts +0 -50
- package/dist/plugin/nex-client.js +0 -129
- package/dist/plugin/nex-client.js.map +0 -1
- package/dist/plugin/rate-limiter.d.ts +0 -26
- package/dist/plugin/rate-limiter.js +0 -65
- package/dist/plugin/rate-limiter.js.map +0 -1
- package/dist/plugin/recall-cache.d.ts +0 -41
- package/dist/plugin/recall-cache.js +0 -195
- package/dist/plugin/recall-cache.js.map +0 -1
- package/dist/plugin/recall-filter.d.ts +0 -13
- package/dist/plugin/recall-filter.js +0 -39
- package/dist/plugin/recall-filter.js.map +0 -1
- package/dist/plugin/session-store.d.ts +0 -23
- package/dist/plugin/session-store.js +0 -73
- package/dist/plugin/session-store.js.map +0 -1
- package/dist/plugin/workspace-data-dir.d.ts +0 -2
- package/dist/plugin/workspace-data-dir.js +0 -31
- package/dist/plugin/workspace-data-dir.js.map +0 -1
- package/dist/tui/agent-colors.d.ts +0 -19
- package/dist/tui/agent-colors.js +0 -34
- package/dist/tui/agent-colors.js.map +0 -1
- package/dist/tui/app.d.ts +0 -14
- package/dist/tui/app.js +0 -181
- package/dist/tui/app.js.map +0 -1
- package/dist/tui/channel-colors.d.ts +0 -16
- package/dist/tui/channel-colors.js +0 -43
- package/dist/tui/channel-colors.js.map +0 -1
- package/dist/tui/components/agent-card.d.ts +0 -11
- package/dist/tui/components/agent-card.js +0 -40
- package/dist/tui/components/agent-card.js.map +0 -1
- package/dist/tui/components/banner.d.ts +0 -44
- package/dist/tui/components/banner.js +0 -130
- package/dist/tui/components/banner.js.map +0 -1
- package/dist/tui/components/channel-colors.d.ts +0 -21
- package/dist/tui/components/channel-colors.js +0 -53
- package/dist/tui/components/channel-colors.js.map +0 -1
- package/dist/tui/components/channel-message.d.ts +0 -53
- package/dist/tui/components/channel-message.js +0 -66
- package/dist/tui/components/channel-message.js.map +0 -1
- package/dist/tui/components/chat-input.d.ts +0 -11
- package/dist/tui/components/chat-input.js +0 -19
- package/dist/tui/components/chat-input.js.map +0 -1
- package/dist/tui/components/data-table.d.ts +0 -11
- package/dist/tui/components/data-table.js +0 -47
- package/dist/tui/components/data-table.js.map +0 -1
- package/dist/tui/components/error-box.d.ts +0 -11
- package/dist/tui/components/error-box.js +0 -59
- package/dist/tui/components/error-box.js.map +0 -1
- package/dist/tui/components/help-screen.d.ts +0 -3
- package/dist/tui/components/help-screen.js +0 -63
- package/dist/tui/components/help-screen.js.map +0 -1
- package/dist/tui/components/index.d.ts +0 -17
- package/dist/tui/components/index.js +0 -10
- package/dist/tui/components/index.js.map +0 -1
- package/dist/tui/components/inline-confirm.d.ts +0 -14
- package/dist/tui/components/inline-confirm.js +0 -13
- package/dist/tui/components/inline-confirm.js.map +0 -1
- package/dist/tui/components/inline-select.d.ts +0 -21
- package/dist/tui/components/inline-select.js +0 -20
- package/dist/tui/components/inline-select.js.map +0 -1
- package/dist/tui/components/markdown.d.ts +0 -6
- package/dist/tui/components/markdown.js +0 -179
- package/dist/tui/components/markdown.js.map +0 -1
- package/dist/tui/components/mention-autocomplete.d.ts +0 -79
- package/dist/tui/components/mention-autocomplete.js +0 -250
- package/dist/tui/components/mention-autocomplete.js.map +0 -1
- package/dist/tui/components/message-list.d.ts +0 -18
- package/dist/tui/components/message-list.js +0 -29
- package/dist/tui/components/message-list.js.map +0 -1
- package/dist/tui/components/picker.d.ts +0 -16
- package/dist/tui/components/picker.js +0 -32
- package/dist/tui/components/picker.js.map +0 -1
- package/dist/tui/components/progress-steps.d.ts +0 -13
- package/dist/tui/components/progress-steps.js +0 -21
- package/dist/tui/components/progress-steps.js.map +0 -1
- package/dist/tui/components/slack/compose.d.ts +0 -27
- package/dist/tui/components/slack/compose.js +0 -147
- package/dist/tui/components/slack/compose.js.map +0 -1
- package/dist/tui/components/slack/layout.d.ts +0 -36
- package/dist/tui/components/slack/layout.js +0 -96
- package/dist/tui/components/slack/layout.js.map +0 -1
- package/dist/tui/components/slack/messages.d.ts +0 -72
- package/dist/tui/components/slack/messages.js +0 -177
- package/dist/tui/components/slack/messages.js.map +0 -1
- package/dist/tui/components/slack/quick-switcher.d.ts +0 -33
- package/dist/tui/components/slack/quick-switcher.js +0 -98
- package/dist/tui/components/slack/quick-switcher.js.map +0 -1
- package/dist/tui/components/slack/sidebar-types.d.ts +0 -65
- package/dist/tui/components/slack/sidebar-types.js +0 -7
- package/dist/tui/components/slack/sidebar-types.js.map +0 -1
- package/dist/tui/components/slack/sidebar.d.ts +0 -46
- package/dist/tui/components/slack/sidebar.js +0 -52
- package/dist/tui/components/slack/sidebar.js.map +0 -1
- package/dist/tui/components/slack/thread-panel.d.ts +0 -45
- package/dist/tui/components/slack/thread-panel.js +0 -47
- package/dist/tui/components/slack/thread-panel.js.map +0 -1
- package/dist/tui/components/slash-autocomplete.d.ts +0 -83
- package/dist/tui/components/slash-autocomplete.js +0 -233
- package/dist/tui/components/slash-autocomplete.js.map +0 -1
- package/dist/tui/components/spinner.d.ts +0 -17
- package/dist/tui/components/spinner.js +0 -30
- package/dist/tui/components/spinner.js.map +0 -1
- package/dist/tui/components/status-bar.d.ts +0 -23
- package/dist/tui/components/status-bar.js +0 -55
- package/dist/tui/components/status-bar.js.map +0 -1
- package/dist/tui/components/success-box.d.ts +0 -7
- package/dist/tui/components/success-box.js +0 -10
- package/dist/tui/components/success-box.js.map +0 -1
- package/dist/tui/components/tool-indicator.d.ts +0 -12
- package/dist/tui/components/tool-indicator.js +0 -18
- package/dist/tui/components/tool-indicator.js.map +0 -1
- package/dist/tui/components/viewport.d.ts +0 -9
- package/dist/tui/components/viewport.js +0 -24
- package/dist/tui/components/viewport.js.map +0 -1
- package/dist/tui/generative/bindings.d.ts +0 -27
- package/dist/tui/generative/bindings.js +0 -152
- package/dist/tui/generative/bindings.js.map +0 -1
- package/dist/tui/generative/registry.d.ts +0 -19
- package/dist/tui/generative/registry.js +0 -31
- package/dist/tui/generative/registry.js.map +0 -1
- package/dist/tui/generative/renderer.d.ts +0 -24
- package/dist/tui/generative/renderer.js +0 -160
- package/dist/tui/generative/renderer.js.map +0 -1
- package/dist/tui/generative/types.d.ts +0 -68
- package/dist/tui/generative/types.js +0 -7
- package/dist/tui/generative/types.js.map +0 -1
- package/dist/tui/hooks/use-cancellable.d.ts +0 -28
- package/dist/tui/hooks/use-cancellable.js +0 -51
- package/dist/tui/hooks/use-cancellable.js.map +0 -1
- package/dist/tui/hooks/use-streaming.d.ts +0 -44
- package/dist/tui/hooks/use-streaming.js +0 -105
- package/dist/tui/hooks/use-streaming.js.map +0 -1
- package/dist/tui/index.d.ts +0 -4
- package/dist/tui/index.js +0 -7
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/keybindings.d.ts +0 -25
- package/dist/tui/keybindings.js +0 -277
- package/dist/tui/keybindings.js.map +0 -1
- package/dist/tui/register-views.d.ts +0 -8
- package/dist/tui/register-views.js +0 -122
- package/dist/tui/register-views.js.map +0 -1
- package/dist/tui/router.d.ts +0 -29
- package/dist/tui/router.js +0 -87
- package/dist/tui/router.js.map +0 -1
- package/dist/tui/services/agent-service.d.ts +0 -58
- package/dist/tui/services/agent-service.js +0 -197
- package/dist/tui/services/agent-service.js.map +0 -1
- package/dist/tui/services/calendar-service.d.ts +0 -31
- package/dist/tui/services/calendar-service.js +0 -133
- package/dist/tui/services/calendar-service.js.map +0 -1
- package/dist/tui/services/chat-service.d.ts +0 -28
- package/dist/tui/services/chat-service.js +0 -91
- package/dist/tui/services/chat-service.js.map +0 -1
- package/dist/tui/services/orchestration-service.d.ts +0 -42
- package/dist/tui/services/orchestration-service.js +0 -153
- package/dist/tui/services/orchestration-service.js.map +0 -1
- package/dist/tui/slash-commands.d.ts +0 -106
- package/dist/tui/slash-commands.js +0 -1421
- package/dist/tui/slash-commands.js.map +0 -1
- package/dist/tui/store.d.ts +0 -96
- package/dist/tui/store.js +0 -120
- package/dist/tui/store.js.map +0 -1
- package/dist/tui/theme.d.ts +0 -40
- package/dist/tui/theme.js +0 -39
- package/dist/tui/theme.js.map +0 -1
- package/dist/tui/tui-context.d.ts +0 -22
- package/dist/tui/tui-context.js +0 -17
- package/dist/tui/tui-context.js.map +0 -1
- package/dist/tui/views/agent-list.d.ts +0 -8
- package/dist/tui/views/agent-list.js +0 -11
- package/dist/tui/views/agent-list.js.map +0 -1
- package/dist/tui/views/ask-chat.d.ts +0 -9
- package/dist/tui/views/ask-chat.js +0 -40
- package/dist/tui/views/ask-chat.js.map +0 -1
- package/dist/tui/views/calendar.d.ts +0 -15
- package/dist/tui/views/calendar.js +0 -29
- package/dist/tui/views/calendar.js.map +0 -1
- package/dist/tui/views/chat.d.ts +0 -18
- package/dist/tui/views/chat.js +0 -28
- package/dist/tui/views/chat.js.map +0 -1
- package/dist/tui/views/generative.d.ts +0 -14
- package/dist/tui/views/generative.js +0 -37
- package/dist/tui/views/generative.js.map +0 -1
- package/dist/tui/views/help.d.ts +0 -6
- package/dist/tui/views/help.js +0 -9
- package/dist/tui/views/help.js.map +0 -1
- package/dist/tui/views/home-screen.d.ts +0 -67
- package/dist/tui/views/home-screen.js +0 -192
- package/dist/tui/views/home-screen.js.map +0 -1
- package/dist/tui/views/home.d.ts +0 -33
- package/dist/tui/views/home.js +0 -60
- package/dist/tui/views/home.js.map +0 -1
- package/dist/tui/views/index.d.ts +0 -20
- package/dist/tui/views/index.js +0 -11
- package/dist/tui/views/index.js.map +0 -1
- package/dist/tui/views/insights.d.ts +0 -19
- package/dist/tui/views/insights.js +0 -46
- package/dist/tui/views/insights.js.map +0 -1
- package/dist/tui/views/orchestration.d.ts +0 -18
- package/dist/tui/views/orchestration.js +0 -73
- package/dist/tui/views/orchestration.js.map +0 -1
- package/dist/tui/views/record-detail.d.ts +0 -10
- package/dist/tui/views/record-detail.js +0 -22
- package/dist/tui/views/record-detail.js.map +0 -1
- package/dist/tui/views/record-list.d.ts +0 -15
- package/dist/tui/views/record-list.js +0 -22
- package/dist/tui/views/record-list.js.map +0 -1
- package/dist/tui/views/slack-channel-header.d.ts +0 -15
- package/dist/tui/views/slack-channel-header.js +0 -16
- package/dist/tui/views/slack-channel-header.js.map +0 -1
- package/dist/tui/views/slack-home.d.ts +0 -21
- package/dist/tui/views/slack-home.js +0 -572
- package/dist/tui/views/slack-home.js.map +0 -1
- package/dist/tui/views/stream.d.ts +0 -16
- package/dist/tui/views/stream.js +0 -210
- package/dist/tui/views/stream.js.map +0 -1
- package/dist/tui/views/task-board.d.ts +0 -21
- package/dist/tui/views/task-board.js +0 -33
- package/dist/tui/views/task-board.js.map +0 -1
- package/dist/tui/views/timeline.d.ts +0 -17
- package/dist/tui/views/timeline.js +0 -24
- package/dist/tui/views/timeline.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack-style sidebar component.
|
|
3
|
-
*
|
|
4
|
-
* Contains workspace header, collapsible DM/channel sections,
|
|
5
|
-
* and individual sidebar items with online status, unread badges,
|
|
6
|
-
* and active/cursor indicators.
|
|
7
|
-
*/
|
|
8
|
-
import React from "react";
|
|
9
|
-
import type { SidebarItemData } from "./sidebar-types.js";
|
|
10
|
-
export type { SidebarItemData, SidebarSectionData, SidebarProps, SidebarSectionProps, SidebarItemProps, WorkspaceHeaderProps, } from "./sidebar-types.js";
|
|
11
|
-
export interface WorkspaceHeaderComponentProps {
|
|
12
|
-
name: string;
|
|
13
|
-
width: number;
|
|
14
|
-
focused?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function WorkspaceHeader({ name, width, focused, }: WorkspaceHeaderComponentProps): React.JSX.Element;
|
|
17
|
-
export declare function SidebarItem({ item, isActive, isCursor, }: {
|
|
18
|
-
item: SidebarItemData;
|
|
19
|
-
isActive: boolean;
|
|
20
|
-
isCursor: boolean;
|
|
21
|
-
}): React.JSX.Element;
|
|
22
|
-
export declare function SidebarSection({ title, collapsed, items, activeChannelId, cursorIndex, startIndex, onToggle, onSelect, }: {
|
|
23
|
-
title: string;
|
|
24
|
-
collapsed: boolean;
|
|
25
|
-
items: SidebarItemData[];
|
|
26
|
-
activeChannelId: string;
|
|
27
|
-
cursorIndex: number;
|
|
28
|
-
startIndex: number;
|
|
29
|
-
onToggle: () => void;
|
|
30
|
-
onSelect: (id: string) => void;
|
|
31
|
-
}): React.JSX.Element;
|
|
32
|
-
export declare function SlackSidebar({ width, focused, workspaceName, sections, collapsedSections, activeChannelId, cursor, onToggleSection, onSelectItem, }: {
|
|
33
|
-
width: number;
|
|
34
|
-
focused: boolean;
|
|
35
|
-
workspaceName: string;
|
|
36
|
-
sections: Array<{
|
|
37
|
-
title: string;
|
|
38
|
-
items: SidebarItemData[];
|
|
39
|
-
}>;
|
|
40
|
-
collapsedSections: string[];
|
|
41
|
-
activeChannelId: string;
|
|
42
|
-
cursor: number;
|
|
43
|
-
onToggleSection: (title: string) => void;
|
|
44
|
-
onSelectItem: (id: string) => void;
|
|
45
|
-
}): React.JSX.Element;
|
|
46
|
-
export default SlackSidebar;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
export function WorkspaceHeader({ name, width, focused, }) {
|
|
4
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, children: [_jsxs(Box, { paddingLeft: 1, children: [focused && _jsx(Text, { color: "cyan", children: "◆ " }), _jsx(Text, { bold: true, color: focused ? "cyan" : "white", children: name })] }), _jsx(Box, { paddingLeft: 1, children: _jsx(Text, { dimColor: true, children: "─".repeat(Math.max(width - 2, 1)) }) })] }));
|
|
5
|
-
}
|
|
6
|
-
// ── SidebarItem ─────────────────────────────────────────────────────
|
|
7
|
-
export function SidebarItem({ item, isActive, isCursor, }) {
|
|
8
|
-
const isUnread = item.unread > 0;
|
|
9
|
-
const isBold = isActive || isUnread;
|
|
10
|
-
// Active indicator: ▎ left border for active item (spec §2.3)
|
|
11
|
-
const prefix = isActive ? "▎ " : " ";
|
|
12
|
-
// Build the status dot / hash prefix
|
|
13
|
-
let indicator;
|
|
14
|
-
if (item.type === "dm" || item.type === "group-dm") {
|
|
15
|
-
const dotColor = item.online ? "green" : "gray";
|
|
16
|
-
const dot = item.online ? "●" : "○";
|
|
17
|
-
indicator = _jsxs(Text, { color: dotColor, children: [dot, " "] });
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
indicator = _jsx(Text, { color: "gray", children: "# " });
|
|
21
|
-
}
|
|
22
|
-
// Name color: active=cyan, unread=white bold, normal=white, muted=gray
|
|
23
|
-
const nameColor = isActive ? "cyan" : item.muted ? "gray" : "white";
|
|
24
|
-
// Unread badge
|
|
25
|
-
const badge = item.unread > 0 ? (_jsxs(Text, { color: "white", dimColor: !isActive, children: [" ", "(", item.unread, ")"] })) : null;
|
|
26
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: isActive ? "cyan" : isCursor ? "white" : "gray", children: prefix }), indicator, _jsx(Text, { color: nameColor, bold: isBold, children: item.name }), badge] }));
|
|
27
|
-
}
|
|
28
|
-
// ── SidebarSection ──────────────────────────────────────────────────
|
|
29
|
-
export function SidebarSection({ title, collapsed, items, activeChannelId, cursorIndex, startIndex, onToggle, onSelect, }) {
|
|
30
|
-
const triangle = collapsed ? "▸" : "▾";
|
|
31
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "gray", children: [triangle, " ", title] }) }), !collapsed &&
|
|
32
|
-
items.map((item, idx) => {
|
|
33
|
-
const flatIdx = startIndex + idx;
|
|
34
|
-
return (_jsx(SidebarItem, { item: item, isActive: item.id === activeChannelId, isCursor: cursorIndex === flatIdx }, item.id));
|
|
35
|
-
})] }));
|
|
36
|
-
}
|
|
37
|
-
// ── SlackSidebar (root) ─────────────────────────────────────────────
|
|
38
|
-
export function SlackSidebar({ width, focused, workspaceName, sections, collapsedSections, activeChannelId, cursor, onToggleSection, onSelectItem, }) {
|
|
39
|
-
// Compute flat index offsets for each section
|
|
40
|
-
let runningIndex = 0;
|
|
41
|
-
const sectionOffsets = [];
|
|
42
|
-
for (const section of sections) {
|
|
43
|
-
sectionOffsets.push(runningIndex);
|
|
44
|
-
const isCollapsed = collapsedSections.includes(section.title);
|
|
45
|
-
if (!isCollapsed) {
|
|
46
|
-
runningIndex += section.items.length;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, children: [_jsx(WorkspaceHeader, { name: workspaceName, width: width, focused: focused }), _jsx(Box, { height: 1 }), sections.map((section, sIdx) => (_jsx(SidebarSection, { title: section.title, collapsed: collapsedSections.includes(section.title), items: section.items, activeChannelId: activeChannelId, cursorIndex: cursor, startIndex: sectionOffsets[sIdx], onToggle: () => onToggleSection(section.title), onSelect: onSelectItem }, section.title))), _jsx(Box, { height: 1 }), _jsxs(Box, { paddingLeft: 1, gap: 2, children: [_jsx(Text, { color: "gray", children: "[n] channel" }), _jsx(Text, { color: "gray", children: "[a] agent" })] })] }));
|
|
50
|
-
}
|
|
51
|
-
export default SlackSidebar;
|
|
52
|
-
//# sourceMappingURL=sidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../../../src/tui/components/slack/sidebar.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAqBhC,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EACJ,KAAK,EACL,OAAO,GACuB;IAC9B,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,aACtC,MAAC,GAAG,IAAC,WAAW,EAAE,CAAC,aAChB,OAAO,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAC5C,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,YACzC,IAAI,GACA,IACH,EACN,KAAC,GAAG,IAAC,WAAW,EAAE,CAAC,YACjB,KAAC,IAAI,IAAC,QAAQ,kBAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAQ,GACtD,IACF,CACP,CAAC;AACJ,CAAC;AAED,uEAAuE;AAEvE,MAAM,UAAU,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAQ,EACR,QAAQ,GAKT;IACC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,QAAQ,IAAI,QAAQ,CAAC;IAEpC,8DAA8D;IAC9D,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAEtC,qCAAqC;IACrC,IAAI,SAA4B,C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AC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,aAEZ,KAAC,eAAe,IAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,EACxE,KAAC,GAAG,IAAC,MAAM,EAAE,CAAC,GAAI,EACjB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAC/B,KAAC,cAAc,IAEb,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,SAAS,EAAE,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EACpD,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,EAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,EAC9C,QAAQ,EAAE,YAAY,IARjB,OAAO,CAAC,KAAK,CASlB,CACH,CAAC,EACF,KAAC,GAAG,IAAC,MAAM,EAAE,CAAC,GAAI,EAClB,MAAC,GAAG,IAAC,WAAW,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,aACzB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,4BAAmB,EACrC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,0BAAiB,IAC/B,IACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack-style thread panel component.
|
|
3
|
-
*
|
|
4
|
-
* Right panel showing a parent message, reply count divider,
|
|
5
|
-
* thread replies, and a compose area for sending replies.
|
|
6
|
-
* Escape closes the panel.
|
|
7
|
-
*/
|
|
8
|
-
import React from "react";
|
|
9
|
-
import type { SlashCommandEntry } from "../slash-autocomplete.js";
|
|
10
|
-
import type { AgentEntry } from "../mention-autocomplete.js";
|
|
11
|
-
/** A message with grouping metadata (matches architecture spec). */
|
|
12
|
-
export interface ThreadMessage {
|
|
13
|
-
id: string;
|
|
14
|
-
sender: string;
|
|
15
|
-
senderType: "agent" | "human" | "system";
|
|
16
|
-
initials: string;
|
|
17
|
-
content: string;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
isFirstInGroup: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ThreadPanelProps {
|
|
22
|
-
width: number;
|
|
23
|
-
focused: boolean;
|
|
24
|
-
parentMessage: ThreadMessage;
|
|
25
|
-
replies: ThreadMessage[];
|
|
26
|
-
sourceChannelName: string;
|
|
27
|
-
sourceChannelType: "channel" | "dm" | "group-dm";
|
|
28
|
-
alsoSendToChannel: boolean;
|
|
29
|
-
onSendReply: (content: string) => void;
|
|
30
|
-
onToggleAlsoSend: () => void;
|
|
31
|
-
onClose: () => void;
|
|
32
|
-
slashCommands?: SlashCommandEntry[];
|
|
33
|
-
agents?: AgentEntry[];
|
|
34
|
-
}
|
|
35
|
-
export declare function ThreadHeader({ channelName, channelType, onClose, }: {
|
|
36
|
-
channelName: string;
|
|
37
|
-
channelType: "channel" | "dm" | "group-dm";
|
|
38
|
-
onClose: () => void;
|
|
39
|
-
}): React.JSX.Element;
|
|
40
|
-
export declare function ReplyDivider({ count, width, }: {
|
|
41
|
-
count: number;
|
|
42
|
-
width: number;
|
|
43
|
-
}): React.JSX.Element;
|
|
44
|
-
export declare function ThreadPanel({ width, focused, parentMessage, replies, sourceChannelName, sourceChannelType, alsoSendToChannel, onSendReply, onToggleAlsoSend, onClose, slashCommands, agents, }: ThreadPanelProps): React.JSX.Element;
|
|
45
|
-
export default ThreadPanel;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { ComposeArea } from "./compose.js";
|
|
4
|
-
import { getAgentColor } from "../../agent-colors.js";
|
|
5
|
-
// ── Helpers ─────────────────────────────────────────────────────────
|
|
6
|
-
function formatTime(ts) {
|
|
7
|
-
const d = new Date(ts);
|
|
8
|
-
const h = d.getHours();
|
|
9
|
-
const m = d.getMinutes().toString().padStart(2, "0");
|
|
10
|
-
const ampm = h >= 12 ? "PM" : "AM";
|
|
11
|
-
const hour = h % 12 || 12;
|
|
12
|
-
return `${hour}:${m} ${ampm}`;
|
|
13
|
-
}
|
|
14
|
-
// ── ThreadHeader ────────────────────────────────────────────────────
|
|
15
|
-
export function ThreadHeader({ channelName, channelType, onClose, }) {
|
|
16
|
-
const channelLabel = channelType === "channel" ? `#${channelName}` : channelName;
|
|
17
|
-
return (_jsxs(Box, { justifyContent: "space-between", paddingX: 1, children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { bold: true, color: "white", children: "Thread" }), _jsx(Text, { color: "cyan", children: channelLabel })] }), _jsx(Text, { color: "gray", children: "\u2715 Esc" })] }));
|
|
18
|
-
}
|
|
19
|
-
// ── ReplyDivider ────────────────────────────────────────────────────
|
|
20
|
-
export function ReplyDivider({ count, width, }) {
|
|
21
|
-
const label = `${count} ${count === 1 ? "reply" : "replies"}`;
|
|
22
|
-
const pad = Math.max(Math.floor((width - label.length - 4) / 2), 1);
|
|
23
|
-
const line = "─".repeat(pad);
|
|
24
|
-
return (_jsx(Box, { paddingX: 1, children: _jsxs(Text, { color: "gray", children: [line, " ", label, " ", line] }) }));
|
|
25
|
-
}
|
|
26
|
-
// ── ThreadMessageItem ───────────────────────────────────────────────
|
|
27
|
-
function ThreadMessageItem({ message, }) {
|
|
28
|
-
const color = getAgentColor(message.sender);
|
|
29
|
-
const time = formatTime(message.timestamp);
|
|
30
|
-
if (message.isFirstInGroup) {
|
|
31
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsxs(Box, { gap: 1, children: [_jsxs(Text, { color: color, bold: true, children: ["[", message.initials, "]"] }), _jsx(Text, { bold: true, color: "white", children: message.sender }), _jsx(Text, { color: "gray", children: time })] }), _jsx(Box, { paddingLeft: 5, children: _jsx(Text, { children: message.content }) })] }));
|
|
32
|
-
}
|
|
33
|
-
return (_jsx(Box, { paddingX: 1, paddingLeft: 6, children: _jsx(Text, { children: message.content }) }));
|
|
34
|
-
}
|
|
35
|
-
// ── AlsoSendCheckbox ────────────────────────────────────────────────
|
|
36
|
-
function AlsoSendCheckbox({ checked, channelName, channelType, onToggle, }) {
|
|
37
|
-
const icon = checked ? "☑" : "☐";
|
|
38
|
-
const iconColor = checked ? "green" : "gray";
|
|
39
|
-
const channelLabel = channelType === "channel" ? `#${channelName}` : channelName;
|
|
40
|
-
return (_jsxs(Box, { paddingX: 1, gap: 1, children: [_jsx(Text, { color: iconColor, children: icon }), _jsxs(Text, { color: "gray", children: ["Also send to ", channelLabel] })] }));
|
|
41
|
-
}
|
|
42
|
-
// ── ThreadPanel ─────────────────────────────────────────────────────
|
|
43
|
-
export function ThreadPanel({ width, focused, parentMessage, replies, sourceChannelName, sourceChannelType, alsoSendToChannel, onSendReply, onToggleAlsoSend, onClose, slashCommands = [], agents = [], }) {
|
|
44
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, borderStyle: "single", borderColor: focused ? "cyan" : "gray", children: [_jsx(ThreadHeader, { channelName: sourceChannelName, channelType: sourceChannelType, onClose: onClose }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { color: "gray", children: "─".repeat(Math.max(width - 4, 1)) }) }), _jsx(ThreadMessageItem, { message: parentMessage }), _jsx(Box, { height: 1 }), _jsx(ReplyDivider, { count: replies.length, width: width }), _jsx(Box, { height: 1 }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: replies.map((reply) => (_jsx(ThreadMessageItem, { message: reply }, reply.id))) }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { color: "gray", children: "─".repeat(Math.max(width - 4, 1)) }) }), _jsx(ComposeArea, { channelName: sourceChannelName, channelType: sourceChannelType, focused: focused, isThread: true, onSubmit: onSendReply, slashCommands: slashCommands, agents: agents }), _jsx(AlsoSendCheckbox, { checked: alsoSendToChannel, channelName: sourceChannelName, channelType: sourceChannelType, onToggle: onToggleAlsoSend })] }));
|
|
45
|
-
}
|
|
46
|
-
export default ThreadPanel;
|
|
47
|
-
//# sourceMappingURL=thread-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thread-panel.js","sourceRoot":"","sources":["../../../../src/tui/components/slack/thread-panel.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAgCtD,uEAAuE;AAEvE,SAAS,UAAU,CAAC,EAAU;IAC5B,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;IACvB,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvB,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IAC1B,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;AAChC,CAAC;AAED,uEAAuE;AAEvE,MAAM,UAAU,YAAY,CAAC,EAC3B,WAAW,EACX,WAAW,EACX,OAAO,GAKR;IACC,MAAM,YAAY,GAChB,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAC9D,OAAO,CACL,MAAC,GAAG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AC,GAAQ,GAC1D,EAGN,KAAC,WAAW,IACV,WAAW,EAAE,iBAAiB,EAC9B,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GACd,EAGF,KAAC,gBAAgB,IACf,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,iBAAiB,EAC9B,WAAW,EAAE,iBAAiB,EAC9B,QAAQ,EAAE,gBAAgB,GAC1B,IACE,CACP,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash command autocomplete overlay and hook.
|
|
3
|
-
*
|
|
4
|
-
* Shows a small overlay Box above the input line listing matching slash
|
|
5
|
-
* commands when the input starts with "/". Tab cycles through matches,
|
|
6
|
-
* Enter accepts the current match, Escape dismisses.
|
|
7
|
-
*
|
|
8
|
-
* This is a standalone component — wire it into the home/conversation
|
|
9
|
-
* view by:
|
|
10
|
-
* 1. Calling useSlashAutocomplete(inputValue, slashCommands)
|
|
11
|
-
* 2. Rendering <SlashAutocomplete {...autocomplete} /> above the input
|
|
12
|
-
* 3. Intercepting Tab/Enter/Escape in useInput and calling the
|
|
13
|
-
* returned handlers (onTab, onAccept, onDismiss)
|
|
14
|
-
*/
|
|
15
|
-
import React from "react";
|
|
16
|
-
export interface SlashCommandEntry {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
usage?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface AutocompleteState {
|
|
22
|
-
/** Whether the autocomplete overlay is visible */
|
|
23
|
-
visible: boolean;
|
|
24
|
-
/** Filtered list of matching commands */
|
|
25
|
-
matches: SlashCommandEntry[];
|
|
26
|
-
/** Currently highlighted index */
|
|
27
|
-
selectedIndex: number;
|
|
28
|
-
/** The query text (everything after "/") */
|
|
29
|
-
query: string;
|
|
30
|
-
}
|
|
31
|
-
export interface AutocompleteActions {
|
|
32
|
-
/** Call when Tab is pressed — cycles to next match */
|
|
33
|
-
onTab: () => AutocompleteResult | null;
|
|
34
|
-
/** Call on Shift+Tab — cycles to previous match */
|
|
35
|
-
onShiftTab: () => AutocompleteResult | null;
|
|
36
|
-
/** Call when Enter is pressed while overlay is visible — accepts the match */
|
|
37
|
-
onAccept: () => AutocompleteResult | null;
|
|
38
|
-
/** Call when Escape is pressed — dismisses the overlay */
|
|
39
|
-
onDismiss: () => void;
|
|
40
|
-
/** Move selection up/down without accepting (for arrow keys) */
|
|
41
|
-
onNavigate: (direction: number) => void;
|
|
42
|
-
/** Update the autocomplete state when input changes */
|
|
43
|
-
update: (input: string) => void;
|
|
44
|
-
}
|
|
45
|
-
export interface AutocompleteResult {
|
|
46
|
-
/** The completed text to replace the input with (e.g. "/search ") */
|
|
47
|
-
text: string;
|
|
48
|
-
/** The command name that was selected */
|
|
49
|
-
command: string;
|
|
50
|
-
}
|
|
51
|
-
export interface SlashAutocompleteProps {
|
|
52
|
-
/** Current autocomplete state */
|
|
53
|
-
state: AutocompleteState;
|
|
54
|
-
/** Max number of items to show in the overlay */
|
|
55
|
-
maxVisible?: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Filter and rank commands that match a prefix query.
|
|
59
|
-
*/
|
|
60
|
-
export declare function filterCommands(query: string, commands: SlashCommandEntry[]): SlashCommandEntry[];
|
|
61
|
-
/**
|
|
62
|
-
* Create initial autocomplete state.
|
|
63
|
-
*/
|
|
64
|
-
export declare function createAutocompleteState(): AutocompleteState;
|
|
65
|
-
/**
|
|
66
|
-
* Compute new autocomplete state from current input value.
|
|
67
|
-
*/
|
|
68
|
-
export declare function computeAutocompleteState(input: string, commands: SlashCommandEntry[]): AutocompleteState;
|
|
69
|
-
/**
|
|
70
|
-
* Create actions that manage autocomplete state.
|
|
71
|
-
* This is a factory for use in React state management.
|
|
72
|
-
*/
|
|
73
|
-
export declare function createAutocompleteActions(state: AutocompleteState, setState: (s: AutocompleteState) => void, commands: SlashCommandEntry[]): AutocompleteActions;
|
|
74
|
-
export declare function useSlashAutocomplete(commands: SlashCommandEntry[]): {
|
|
75
|
-
state: AutocompleteState;
|
|
76
|
-
actions: AutocompleteActions;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Overlay rendering the list of matching slash commands.
|
|
80
|
-
* Position this above the input line.
|
|
81
|
-
*/
|
|
82
|
-
export declare function SlashAutocomplete({ state, maxVisible, }: SlashAutocompleteProps): React.JSX.Element | null;
|
|
83
|
-
export default SlashAutocomplete;
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Slash command autocomplete overlay and hook.
|
|
4
|
-
*
|
|
5
|
-
* Shows a small overlay Box above the input line listing matching slash
|
|
6
|
-
* commands when the input starts with "/". Tab cycles through matches,
|
|
7
|
-
* Enter accepts the current match, Escape dismisses.
|
|
8
|
-
*
|
|
9
|
-
* This is a standalone component — wire it into the home/conversation
|
|
10
|
-
* view by:
|
|
11
|
-
* 1. Calling useSlashAutocomplete(inputValue, slashCommands)
|
|
12
|
-
* 2. Rendering <SlashAutocomplete {...autocomplete} /> above the input
|
|
13
|
-
* 3. Intercepting Tab/Enter/Escape in useInput and calling the
|
|
14
|
-
* returned handlers (onTab, onAccept, onDismiss)
|
|
15
|
-
*/
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Box, Text } from "ink";
|
|
18
|
-
// ── Pure functions ──────────────────────────────────────────────────
|
|
19
|
-
/**
|
|
20
|
-
* Filter and rank commands that match a prefix query.
|
|
21
|
-
*/
|
|
22
|
-
export function filterCommands(query, commands) {
|
|
23
|
-
const q = query.toLowerCase();
|
|
24
|
-
if (!q)
|
|
25
|
-
return commands;
|
|
26
|
-
return commands.filter((cmd) => cmd.name.toLowerCase().startsWith(q));
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create initial autocomplete state.
|
|
30
|
-
*/
|
|
31
|
-
export function createAutocompleteState() {
|
|
32
|
-
return {
|
|
33
|
-
visible: false,
|
|
34
|
-
matches: [],
|
|
35
|
-
selectedIndex: 0,
|
|
36
|
-
query: "",
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Compute new autocomplete state from current input value.
|
|
41
|
-
*/
|
|
42
|
-
export function computeAutocompleteState(input, commands) {
|
|
43
|
-
const trimmed = input.trimStart();
|
|
44
|
-
// Only activate when input starts with "/" and has no space yet
|
|
45
|
-
// (space means the user has moved on to arguments)
|
|
46
|
-
if (!trimmed.startsWith("/") || trimmed.includes(" ")) {
|
|
47
|
-
return createAutocompleteState();
|
|
48
|
-
}
|
|
49
|
-
const query = trimmed.slice(1); // everything after "/"
|
|
50
|
-
const matches = filterCommands(query, commands);
|
|
51
|
-
// Don't show if there's exactly one match that equals the query
|
|
52
|
-
if (matches.length === 1 && matches[0].name === query) {
|
|
53
|
-
return createAutocompleteState();
|
|
54
|
-
}
|
|
55
|
-
// Don't show if no matches
|
|
56
|
-
if (matches.length === 0) {
|
|
57
|
-
return { visible: false, matches: [], selectedIndex: 0, query };
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
visible: true,
|
|
61
|
-
matches,
|
|
62
|
-
selectedIndex: 0,
|
|
63
|
-
query,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Create actions that manage autocomplete state.
|
|
68
|
-
* This is a factory for use in React state management.
|
|
69
|
-
*/
|
|
70
|
-
export function createAutocompleteActions(state, setState, commands) {
|
|
71
|
-
const accept = (index) => {
|
|
72
|
-
if (!state.visible || state.matches.length === 0)
|
|
73
|
-
return null;
|
|
74
|
-
const match = state.matches[index];
|
|
75
|
-
if (!match)
|
|
76
|
-
return null;
|
|
77
|
-
setState(createAutocompleteState());
|
|
78
|
-
return { text: `/${match.name} `, command: match.name };
|
|
79
|
-
};
|
|
80
|
-
return {
|
|
81
|
-
onTab: () => {
|
|
82
|
-
if (!state.visible || state.matches.length === 0)
|
|
83
|
-
return null;
|
|
84
|
-
// If only one match, accept it immediately
|
|
85
|
-
if (state.matches.length === 1) {
|
|
86
|
-
return accept(0);
|
|
87
|
-
}
|
|
88
|
-
// Cycle to next
|
|
89
|
-
const nextIndex = (state.selectedIndex + 1) % state.matches.length;
|
|
90
|
-
setState({ ...state, selectedIndex: nextIndex });
|
|
91
|
-
return null;
|
|
92
|
-
},
|
|
93
|
-
onShiftTab: () => {
|
|
94
|
-
if (!state.visible || state.matches.length === 0)
|
|
95
|
-
return null;
|
|
96
|
-
if (state.matches.length === 1) {
|
|
97
|
-
return accept(0);
|
|
98
|
-
}
|
|
99
|
-
const nextIndex = (state.selectedIndex - 1 + state.matches.length) % state.matches.length;
|
|
100
|
-
setState({ ...state, selectedIndex: nextIndex });
|
|
101
|
-
return null;
|
|
102
|
-
},
|
|
103
|
-
onAccept: () => {
|
|
104
|
-
return accept(state.selectedIndex);
|
|
105
|
-
},
|
|
106
|
-
onDismiss: () => {
|
|
107
|
-
setState(createAutocompleteState());
|
|
108
|
-
},
|
|
109
|
-
onNavigate: (direction) => {
|
|
110
|
-
if (!state.visible || state.matches.length <= 1)
|
|
111
|
-
return;
|
|
112
|
-
const len = state.matches.length;
|
|
113
|
-
const next = ((state.selectedIndex + direction) % len + len) % len;
|
|
114
|
-
setState({ ...state, selectedIndex: next });
|
|
115
|
-
},
|
|
116
|
-
update: (input) => {
|
|
117
|
-
const newState = computeAutocompleteState(input, commands);
|
|
118
|
-
setState(newState);
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
// ── React hook ──────────────────────────────────────────────────────
|
|
123
|
-
/**
|
|
124
|
-
* Hook that manages slash command autocomplete state.
|
|
125
|
-
*
|
|
126
|
-
* Usage:
|
|
127
|
-
* ```tsx
|
|
128
|
-
* const { state, actions } = useSlashAutocomplete(commands);
|
|
129
|
-
*
|
|
130
|
-
* // In your onChange handler:
|
|
131
|
-
* actions.update(newValue);
|
|
132
|
-
*
|
|
133
|
-
* // In your useInput handler:
|
|
134
|
-
* if (key.name === "tab" && acState.visible) {
|
|
135
|
-
* const result = actions.onTab();
|
|
136
|
-
* if (result) setInputValue(result.text);
|
|
137
|
-
* return;
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
import { useState, useRef } from "react";
|
|
142
|
-
export function useSlashAutocomplete(commands) {
|
|
143
|
-
const [acState, setAcState] = useState(createAutocompleteState());
|
|
144
|
-
const commandsRef = useRef(commands);
|
|
145
|
-
commandsRef.current = commands;
|
|
146
|
-
const stateRef = useRef(acState);
|
|
147
|
-
stateRef.current = acState;
|
|
148
|
-
// Stable reference — reads state/commands through refs so the object never changes
|
|
149
|
-
const actions = React.useMemo(() => {
|
|
150
|
-
const accept = (index) => {
|
|
151
|
-
const s = stateRef.current;
|
|
152
|
-
if (!s.visible || s.matches.length === 0)
|
|
153
|
-
return null;
|
|
154
|
-
const match = s.matches[index];
|
|
155
|
-
if (!match)
|
|
156
|
-
return null;
|
|
157
|
-
setAcState(createAutocompleteState());
|
|
158
|
-
return { text: `/${match.name} `, command: match.name };
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
onTab: () => {
|
|
162
|
-
const s = stateRef.current;
|
|
163
|
-
if (!s.visible || s.matches.length === 0)
|
|
164
|
-
return null;
|
|
165
|
-
if (s.matches.length === 1)
|
|
166
|
-
return accept(0);
|
|
167
|
-
const next = (s.selectedIndex + 1) % s.matches.length;
|
|
168
|
-
setAcState({ ...s, selectedIndex: next });
|
|
169
|
-
return null;
|
|
170
|
-
},
|
|
171
|
-
onShiftTab: () => {
|
|
172
|
-
const s = stateRef.current;
|
|
173
|
-
if (!s.visible || s.matches.length === 0)
|
|
174
|
-
return null;
|
|
175
|
-
if (s.matches.length === 1)
|
|
176
|
-
return accept(0);
|
|
177
|
-
const next = (s.selectedIndex - 1 + s.matches.length) % s.matches.length;
|
|
178
|
-
setAcState({ ...s, selectedIndex: next });
|
|
179
|
-
return null;
|
|
180
|
-
},
|
|
181
|
-
onAccept: () => accept(stateRef.current.selectedIndex),
|
|
182
|
-
onDismiss: () => setAcState(createAutocompleteState()),
|
|
183
|
-
onNavigate: (direction) => {
|
|
184
|
-
const s = stateRef.current;
|
|
185
|
-
if (!s.visible || s.matches.length <= 1)
|
|
186
|
-
return;
|
|
187
|
-
const len = s.matches.length;
|
|
188
|
-
const next = ((s.selectedIndex + direction) % len + len) % len;
|
|
189
|
-
setAcState({ ...s, selectedIndex: next });
|
|
190
|
-
},
|
|
191
|
-
update: (input) => {
|
|
192
|
-
const newState = computeAutocompleteState(input, commandsRef.current);
|
|
193
|
-
const cur = stateRef.current;
|
|
194
|
-
// Skip setState when nothing meaningful changed to avoid extra renders
|
|
195
|
-
if (cur.visible === newState.visible &&
|
|
196
|
-
cur.query === newState.query &&
|
|
197
|
-
cur.selectedIndex === newState.selectedIndex &&
|
|
198
|
-
cur.matches.length === newState.matches.length)
|
|
199
|
-
return;
|
|
200
|
-
setAcState(newState);
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}, []); // stable — reads through refs
|
|
204
|
-
return { state: acState, actions };
|
|
205
|
-
}
|
|
206
|
-
// ── Component ───────────────────────────────────────────────────────
|
|
207
|
-
/**
|
|
208
|
-
* Overlay rendering the list of matching slash commands.
|
|
209
|
-
* Position this above the input line.
|
|
210
|
-
*/
|
|
211
|
-
export function SlashAutocomplete({ state, maxVisible = 8, }) {
|
|
212
|
-
if (!state.visible || state.matches.length === 0) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
// Determine visible window
|
|
216
|
-
const total = state.matches.length;
|
|
217
|
-
const visible = Math.min(total, maxVisible);
|
|
218
|
-
let startIdx = 0;
|
|
219
|
-
if (state.selectedIndex >= startIdx + visible) {
|
|
220
|
-
startIdx = state.selectedIndex - visible + 1;
|
|
221
|
-
}
|
|
222
|
-
if (state.selectedIndex < startIdx) {
|
|
223
|
-
startIdx = state.selectedIndex;
|
|
224
|
-
}
|
|
225
|
-
const visibleItems = state.matches.slice(startIdx, startIdx + visible);
|
|
226
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, borderStyle: "single", borderColor: "cyan", children: [visibleItems.map((cmd, i) => {
|
|
227
|
-
const actualIndex = startIdx + i;
|
|
228
|
-
const isSelected = actualIndex === state.selectedIndex;
|
|
229
|
-
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: isSelected ? "cyan" : undefined, bold: isSelected, dimColor: !isSelected, children: isSelected ? ">" : " " }), _jsx(Text, { color: isSelected ? "cyan" : "white", bold: isSelected, children: `/${cmd.name}` }), _jsx(Text, { dimColor: true, children: cmd.description })] }, cmd.name));
|
|
230
|
-
}), total > visible && (_jsx(Box, { justifyContent: "flex-end", children: _jsx(Text, { dimColor: true, children: `${state.selectedIndex + 1}/${total}` }) }))] }));
|
|
231
|
-
}
|
|
232
|
-
export default SlashAutocomplete;
|
|
233
|
-
//# sourceMappingURL=slash-autocomplete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slash-autocomplete.js","sourceRoot":"","sources":["../../../src/tui/components/slash-autocomplete.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAkDhC,uEAAuE;AAEvE;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAa,EACb,QAA6B;IAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxB,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE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ACjC,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface SpinnerProps {
|
|
3
|
-
/** Label displayed after the spinner character */
|
|
4
|
-
label?: string;
|
|
5
|
-
/** Animation interval in ms (default: 80) */
|
|
6
|
-
interval?: number;
|
|
7
|
-
/** Ink Text color for the spinner character */
|
|
8
|
-
color?: string;
|
|
9
|
-
/** When true, the spinner stops animating */
|
|
10
|
-
stopped?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Returns the current braille spinner frame, advancing every `interval` ms.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useSpinner(interval?: number): string;
|
|
16
|
-
export declare function Spinner({ label, interval, color, stopped, }: SpinnerProps): React.JSX.Element;
|
|
17
|
-
export default Spinner;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import { Text } from "ink";
|
|
4
|
-
// ── Braille spinner frames ──────────────────────────────────────────
|
|
5
|
-
const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
6
|
-
const DEFAULT_INTERVAL = 80;
|
|
7
|
-
// ── Hook ────────────────────────────────────────────────────────────
|
|
8
|
-
/**
|
|
9
|
-
* Returns the current braille spinner frame, advancing every `interval` ms.
|
|
10
|
-
*/
|
|
11
|
-
export function useSpinner(interval = DEFAULT_INTERVAL) {
|
|
12
|
-
const [index, setIndex] = useState(0);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const id = setInterval(() => {
|
|
15
|
-
setIndex((prev) => (prev + 1) % FRAMES.length);
|
|
16
|
-
}, interval);
|
|
17
|
-
return () => clearInterval(id);
|
|
18
|
-
}, [interval]);
|
|
19
|
-
return FRAMES[index];
|
|
20
|
-
}
|
|
21
|
-
// ── Component ───────────────────────────────────────────────────────
|
|
22
|
-
export function Spinner({ label, interval = DEFAULT_INTERVAL, color = "cyan", stopped = false, }) {
|
|
23
|
-
const frame = useSpinner(interval);
|
|
24
|
-
if (stopped) {
|
|
25
|
-
return label ? _jsx(Text, { dimColor: true, children: label }) : _jsx(Text, { children: "" });
|
|
26
|
-
}
|
|
27
|
-
return (_jsxs(Text, { children: [_jsx(Text, { color: color, children: frame }), label ? _jsx(Text, { children: ` ${label}` }) : null] }));
|
|
28
|
-
}
|
|
29
|
-
export default Spinner;
|
|
30
|
-
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../src/tui/components/spinner.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,uEAAuE;AAEvE,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC3E,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAe5B,uEAAuE;AAEvE;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAQ,GAAG,gBAAgB;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE;YAC1B,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC,EAAE,QAAQ,CAAC,CAAC;QACb,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,uEAAuE;AAEvE,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,GAAG,gBAAgB,EAC3B,KAAK,GAAG,MAAM,EACd,OAAO,GAAG,KAAK,GACF;IACb,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,QAAQ,kBAAE,KAAK,GAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,cAAE,EAAE,GAAQ,CAAC;IACnE,CAAC;IAED,OAAO,CACL,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,KAAK,GAAQ,EACjC,KAAK,CAAC,CAAC,CAAC,KAAC,IAAI,cAAE,IAAI,KAAK,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,IACrC,CACR,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export type Mode = "normal" | "insert";
|
|
3
|
-
export interface SessionStats {
|
|
4
|
-
tokensUsed?: number;
|
|
5
|
-
costUsd?: number;
|
|
6
|
-
model?: string;
|
|
7
|
-
startTime?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface StatusBarProps {
|
|
10
|
-
mode: Mode;
|
|
11
|
-
breadcrumbs: string[];
|
|
12
|
-
scrollPercent?: number;
|
|
13
|
-
hint?: string;
|
|
14
|
-
/** When true, hides the mode badge (conversation view handles its own input) */
|
|
15
|
-
conversationMode?: boolean;
|
|
16
|
-
/** Session stats for token/cost/elapsed display */
|
|
17
|
-
session?: SessionStats;
|
|
18
|
-
}
|
|
19
|
-
export declare function formatTokens(n: number): string;
|
|
20
|
-
export declare function formatCost(usd: number): string;
|
|
21
|
-
export declare function formatElapsed(startTime: number, now?: number): string;
|
|
22
|
-
export declare function StatusBar({ mode, breadcrumbs, scrollPercent, hint, conversationMode, session, }: StatusBarProps): React.JSX.Element;
|
|
23
|
-
export default StatusBar;
|