@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,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TUI service layer for the calendar/scheduling system.
|
|
3
|
-
* Wraps Scheduler and CalendarStore into a single facade
|
|
4
|
-
* that the calendar view can consume without touching backend internals.
|
|
5
|
-
*/
|
|
6
|
-
import { join } from 'node:path';
|
|
7
|
-
import { homedir } from 'node:os';
|
|
8
|
-
import { Scheduler } from '../../calendar/scheduler.js';
|
|
9
|
-
import { CalendarStore } from '../../calendar/store.js';
|
|
10
|
-
export class CalendarService {
|
|
11
|
-
scheduler;
|
|
12
|
-
store;
|
|
13
|
-
listeners = [];
|
|
14
|
-
constructor(calendarFilePath) {
|
|
15
|
-
const filePath = calendarFilePath ?? join(homedir(), '.nex-cli', 'calendar.json');
|
|
16
|
-
this.store = new CalendarStore(filePath);
|
|
17
|
-
this.scheduler = new Scheduler(this.store);
|
|
18
|
-
}
|
|
19
|
-
// ── View data ──
|
|
20
|
-
/**
|
|
21
|
-
* Returns events formatted for the calendar grid view.
|
|
22
|
-
* Maps scheduled tasks to day/hour slots for the given week.
|
|
23
|
-
*/
|
|
24
|
-
getWeekEvents(weekOffset = 0) {
|
|
25
|
-
const { start, end } = this.getWeekRange(weekOffset);
|
|
26
|
-
const tasks = this.scheduler.getUpcoming(start, end);
|
|
27
|
-
const allTasks = this.store.load().filter(t => t.enabled);
|
|
28
|
-
// For recurring tasks, generate occurrences within the week window
|
|
29
|
-
const events = [];
|
|
30
|
-
// Include tasks whose nextRun falls within the week
|
|
31
|
-
for (const task of tasks) {
|
|
32
|
-
const runDate = new Date(task.nextRun);
|
|
33
|
-
events.push({
|
|
34
|
-
id: task.id,
|
|
35
|
-
agentName: task.agentSlug,
|
|
36
|
-
day: runDate.getDay(),
|
|
37
|
-
hour: runDate.getHours(),
|
|
38
|
-
label: `${task.agentSlug} ${task.type}`,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
// Also scan all enabled tasks and project their cron into the week
|
|
42
|
-
for (const task of allTasks) {
|
|
43
|
-
// Skip tasks already captured via getUpcoming
|
|
44
|
-
if (tasks.some(t => t.id === task.id))
|
|
45
|
-
continue;
|
|
46
|
-
try {
|
|
47
|
-
let cursor = new Date(start.getTime());
|
|
48
|
-
// Walk through the week generating occurrences
|
|
49
|
-
while (cursor.getTime() <= end.getTime()) {
|
|
50
|
-
const next = this.scheduler.nextRun(task.cronExpression, cursor);
|
|
51
|
-
if (next.getTime() > end.getTime())
|
|
52
|
-
break;
|
|
53
|
-
if (next.getTime() >= start.getTime()) {
|
|
54
|
-
events.push({
|
|
55
|
-
id: task.id,
|
|
56
|
-
agentName: task.agentSlug,
|
|
57
|
-
day: next.getDay(),
|
|
58
|
-
hour: next.getHours(),
|
|
59
|
-
label: `${task.agentSlug} ${task.type}`,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
// Advance cursor past this occurrence
|
|
63
|
-
cursor = new Date(next.getTime());
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
// Skip tasks with unparseable cron
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return events;
|
|
71
|
-
}
|
|
72
|
-
// ── Scheduling ──
|
|
73
|
-
scheduleHeartbeat(agentSlug, agentName, cronExpression) {
|
|
74
|
-
this.scheduler.schedule({
|
|
75
|
-
agentSlug,
|
|
76
|
-
type: 'heartbeat',
|
|
77
|
-
cronExpression,
|
|
78
|
-
enabled: true,
|
|
79
|
-
});
|
|
80
|
-
this.notify();
|
|
81
|
-
}
|
|
82
|
-
removeSchedule(agentSlug) {
|
|
83
|
-
const agentTasks = this.store.getByAgent(agentSlug);
|
|
84
|
-
for (const task of agentTasks) {
|
|
85
|
-
this.store.remove(task.id);
|
|
86
|
-
}
|
|
87
|
-
this.notify();
|
|
88
|
-
}
|
|
89
|
-
// ── Queries ──
|
|
90
|
-
getUpcoming(hours = 24) {
|
|
91
|
-
const now = new Date();
|
|
92
|
-
const to = new Date(now.getTime() + hours * 60 * 60 * 1000);
|
|
93
|
-
return this.scheduler.getUpcoming(now, to);
|
|
94
|
-
}
|
|
95
|
-
getMissed() {
|
|
96
|
-
return this.scheduler.getMissed();
|
|
97
|
-
}
|
|
98
|
-
// ── Subscription for TUI re-renders ──
|
|
99
|
-
subscribe(listener) {
|
|
100
|
-
this.listeners.push(listener);
|
|
101
|
-
return () => {
|
|
102
|
-
const idx = this.listeners.indexOf(listener);
|
|
103
|
-
if (idx >= 0)
|
|
104
|
-
this.listeners.splice(idx, 1);
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
notify() {
|
|
108
|
-
for (const listener of this.listeners) {
|
|
109
|
-
listener();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// ── Internal helpers ──
|
|
113
|
-
getWeekRange(offset) {
|
|
114
|
-
const now = new Date();
|
|
115
|
-
const dayOfWeek = now.getDay();
|
|
116
|
-
const start = new Date(now);
|
|
117
|
-
start.setDate(now.getDate() - dayOfWeek + offset * 7);
|
|
118
|
-
start.setHours(0, 0, 0, 0);
|
|
119
|
-
const end = new Date(start);
|
|
120
|
-
end.setDate(start.getDate() + 6);
|
|
121
|
-
end.setHours(23, 59, 59, 999);
|
|
122
|
-
return { start, end };
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// ── Singleton accessor ──
|
|
126
|
-
let instance;
|
|
127
|
-
export function getCalendarService() {
|
|
128
|
-
if (!instance) {
|
|
129
|
-
instance = new CalendarService();
|
|
130
|
-
}
|
|
131
|
-
return instance;
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=calendar-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-service.js","sourceRoot":"","sources":["../../../src/tui/services/calendar-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,OAAO,eAAe;IAClB,SAAS,CAAY;IACrB,KAAK,CAAgB;IACrB,SAAS,GAAs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B;IAEjB,YAAY,CAAC,MAAc;QACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QACjC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACxB,CAAC;CACF;AAED,2BAA2B;AAE3B,IAAI,QAAqC,CAAC;AAE1C,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TUI service layer for the chat system.
|
|
3
|
-
* Wraps ChannelManager, MessageStore, and ChatRouter into a single facade
|
|
4
|
-
* that the chat view can consume without touching backend internals.
|
|
5
|
-
*/
|
|
6
|
-
import type { Channel, ChatMessage } from '../../chat/types.js';
|
|
7
|
-
export declare class ChatService {
|
|
8
|
-
private channelManager;
|
|
9
|
-
private messageStore;
|
|
10
|
-
private chatRouter;
|
|
11
|
-
private listeners;
|
|
12
|
-
constructor(baseDir?: string);
|
|
13
|
-
getChannels(): Array<{
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
unread: number;
|
|
17
|
-
}>;
|
|
18
|
-
createChannel(name: string, type?: 'public' | 'private'): Channel;
|
|
19
|
-
/** Get existing channel by name, or create it if it doesn't exist. */
|
|
20
|
-
ensureChannel(name: string, type?: 'public' | 'private'): Channel;
|
|
21
|
-
getMessages(channelId: string, limit?: number): ChatMessage[];
|
|
22
|
-
send(channelId: string, content: string, sender?: string): ChatMessage;
|
|
23
|
-
route(channelId: string, sender: string, content: string): ChatMessage;
|
|
24
|
-
getPendingMentions(): ChatMessage[];
|
|
25
|
-
subscribe(listener: () => void): () => void;
|
|
26
|
-
private notify;
|
|
27
|
-
}
|
|
28
|
-
export declare function getChatService(): ChatService;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TUI service layer for the chat system.
|
|
3
|
-
* Wraps ChannelManager, MessageStore, and ChatRouter into a single facade
|
|
4
|
-
* that the chat view can consume without touching backend internals.
|
|
5
|
-
*/
|
|
6
|
-
import { join } from 'node:path';
|
|
7
|
-
import { homedir } from 'node:os';
|
|
8
|
-
import { ChannelManager } from '../../chat/channel.js';
|
|
9
|
-
import { MessageStore } from '../../chat/message-store.js';
|
|
10
|
-
import { ChatRouter } from '../../chat/router.js';
|
|
11
|
-
export class ChatService {
|
|
12
|
-
channelManager;
|
|
13
|
-
messageStore;
|
|
14
|
-
chatRouter;
|
|
15
|
-
listeners = [];
|
|
16
|
-
constructor(baseDir) {
|
|
17
|
-
const dir = baseDir ?? join(process.env.NEX_CLI_DATA_DIR ?? join(homedir(), '.nex-cli'), 'chat');
|
|
18
|
-
this.channelManager = new ChannelManager(dir);
|
|
19
|
-
this.messageStore = new MessageStore(join(dir, 'messages'));
|
|
20
|
-
this.chatRouter = new ChatRouter(this.channelManager, this.messageStore);
|
|
21
|
-
// Ensure a #general channel always exists
|
|
22
|
-
this.channelManager.ensureDefaults();
|
|
23
|
-
}
|
|
24
|
-
// ── Channel operations ──
|
|
25
|
-
getChannels() {
|
|
26
|
-
const channels = this.channelManager.list();
|
|
27
|
-
return channels.map(ch => ({
|
|
28
|
-
id: ch.id,
|
|
29
|
-
name: ch.name,
|
|
30
|
-
unread: this.messageStore.getUnread('human', 0)
|
|
31
|
-
.filter(m => m.channelId === ch.id).length,
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
createChannel(name, type = 'public') {
|
|
35
|
-
const channel = this.channelManager.create({
|
|
36
|
-
name,
|
|
37
|
-
type,
|
|
38
|
-
members: ['human'],
|
|
39
|
-
});
|
|
40
|
-
this.notify();
|
|
41
|
-
return channel;
|
|
42
|
-
}
|
|
43
|
-
/** Get existing channel by name, or create it if it doesn't exist. */
|
|
44
|
-
ensureChannel(name, type = 'public') {
|
|
45
|
-
const existing = this.channelManager.list().find((ch) => ch.name === name);
|
|
46
|
-
if (existing)
|
|
47
|
-
return existing;
|
|
48
|
-
return this.createChannel(name, type);
|
|
49
|
-
}
|
|
50
|
-
// ── Message operations ──
|
|
51
|
-
getMessages(channelId, limit) {
|
|
52
|
-
return this.messageStore.getMessages(channelId, { limit });
|
|
53
|
-
}
|
|
54
|
-
send(channelId, content, sender = 'human') {
|
|
55
|
-
const message = this.chatRouter.route(channelId, sender, content);
|
|
56
|
-
this.notify();
|
|
57
|
-
return message;
|
|
58
|
-
}
|
|
59
|
-
// ── Routing ──
|
|
60
|
-
route(channelId, sender, content) {
|
|
61
|
-
const message = this.chatRouter.route(channelId, sender, content);
|
|
62
|
-
this.notify();
|
|
63
|
-
return message;
|
|
64
|
-
}
|
|
65
|
-
getPendingMentions() {
|
|
66
|
-
return this.chatRouter.hasPendingMentions();
|
|
67
|
-
}
|
|
68
|
-
// ── Subscription for TUI re-renders ──
|
|
69
|
-
subscribe(listener) {
|
|
70
|
-
this.listeners.push(listener);
|
|
71
|
-
return () => {
|
|
72
|
-
const idx = this.listeners.indexOf(listener);
|
|
73
|
-
if (idx >= 0)
|
|
74
|
-
this.listeners.splice(idx, 1);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
notify() {
|
|
78
|
-
for (const listener of this.listeners) {
|
|
79
|
-
listener();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// ── Singleton accessor ──
|
|
84
|
-
let instance;
|
|
85
|
-
export function getChatService() {
|
|
86
|
-
if (!instance) {
|
|
87
|
-
instance = new ChatService();
|
|
88
|
-
}
|
|
89
|
-
return instance;
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=chat-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-service.js","sourceRoot":"","sources":["../../../src/tui/services/chat-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,MAAM,OAAO,WAAW;IACd,cAAc,CAAiB;IAC/B,YAAY,CAAe;IAC3B,UAAU,CAAa;IACvB,SAAS,GAAsB,EAAE,CAAC;IAE1C,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;QACjG,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,C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AW,EAAE,CAAC;IAC/B,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TUI service layer for multi-agent orchestration.
|
|
3
|
-
* Wraps BudgetTracker, TaskRouter, OrchestratorExecutor, and workflow
|
|
4
|
-
* templates into a single facade the orchestration view can consume.
|
|
5
|
-
*/
|
|
6
|
-
import type { GoalDefinition, TaskDefinition, OrchestratorConfig, BudgetSnapshot, SkillDeclaration } from '../../orchestration/types.js';
|
|
7
|
-
export declare class OrchestrationService {
|
|
8
|
-
private executor;
|
|
9
|
-
private budget;
|
|
10
|
-
private router;
|
|
11
|
-
private goals;
|
|
12
|
-
private tasks;
|
|
13
|
-
private listeners;
|
|
14
|
-
constructor(config?: Partial<OrchestratorConfig>);
|
|
15
|
-
createGoal(title: string, description: string): GoalDefinition;
|
|
16
|
-
getGoals(): GoalDefinition[];
|
|
17
|
-
createTask(task: Omit<TaskDefinition, 'id' | 'createdAt' | 'status'>): TaskDefinition;
|
|
18
|
-
getTasks(goalId?: string): TaskDefinition[];
|
|
19
|
-
getActiveTasks(): TaskDefinition[];
|
|
20
|
-
instantiateWorkflow(templateName: string): {
|
|
21
|
-
goal: GoalDefinition;
|
|
22
|
-
tasks: TaskDefinition[];
|
|
23
|
-
};
|
|
24
|
-
getTemplateNames(): string[];
|
|
25
|
-
registerAgentSkills(agentSlug: string, skills: SkillDeclaration[]): void;
|
|
26
|
-
findBestAgentForTask(taskId: string): {
|
|
27
|
-
agentSlug: string;
|
|
28
|
-
score: number;
|
|
29
|
-
} | null;
|
|
30
|
-
getBudgetSnapshots(): BudgetSnapshot[];
|
|
31
|
-
getGlobalBudget(): {
|
|
32
|
-
tokens: number;
|
|
33
|
-
cost: number;
|
|
34
|
-
percentTokens: number;
|
|
35
|
-
percentCost: number;
|
|
36
|
-
};
|
|
37
|
-
submitTask(taskId: string): Promise<void>;
|
|
38
|
-
stopAll(): Promise<void>;
|
|
39
|
-
subscribe(listener: () => void): () => void;
|
|
40
|
-
private notify;
|
|
41
|
-
}
|
|
42
|
-
export declare function getOrchestrationService(): OrchestrationService;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TUI service layer for multi-agent orchestration.
|
|
3
|
-
* Wraps BudgetTracker, TaskRouter, OrchestratorExecutor, and workflow
|
|
4
|
-
* templates into a single facade the orchestration view can consume.
|
|
5
|
-
*/
|
|
6
|
-
import { randomUUID } from 'node:crypto';
|
|
7
|
-
import { BudgetTracker } from '../../orchestration/budget.js';
|
|
8
|
-
import { TaskRouter } from '../../orchestration/router.js';
|
|
9
|
-
import { OrchestratorExecutor } from '../../orchestration/executor.js';
|
|
10
|
-
import { workflows } from '../../orchestration/templates.js';
|
|
11
|
-
const DEFAULT_CONFIG = {
|
|
12
|
-
maxConcurrentAgents: 3,
|
|
13
|
-
globalBudget: { maxTokens: 100_000, maxCostUsd: 0.5 },
|
|
14
|
-
taskTimeout: 5 * 60 * 1000, // 5 minutes
|
|
15
|
-
autoRetry: true,
|
|
16
|
-
maxRetries: 2,
|
|
17
|
-
};
|
|
18
|
-
export class OrchestrationService {
|
|
19
|
-
executor;
|
|
20
|
-
budget;
|
|
21
|
-
router;
|
|
22
|
-
goals = new Map();
|
|
23
|
-
tasks = new Map();
|
|
24
|
-
listeners = [];
|
|
25
|
-
constructor(config) {
|
|
26
|
-
const merged = { ...DEFAULT_CONFIG, ...config };
|
|
27
|
-
this.executor = new OrchestratorExecutor(merged);
|
|
28
|
-
this.budget = new BudgetTracker(merged.globalBudget);
|
|
29
|
-
this.router = new TaskRouter();
|
|
30
|
-
}
|
|
31
|
-
// ── Goal management ──
|
|
32
|
-
createGoal(title, description) {
|
|
33
|
-
const goal = {
|
|
34
|
-
id: randomUUID(),
|
|
35
|
-
title,
|
|
36
|
-
description,
|
|
37
|
-
tasks: [],
|
|
38
|
-
status: 'active',
|
|
39
|
-
createdAt: Date.now(),
|
|
40
|
-
};
|
|
41
|
-
this.goals.set(goal.id, goal);
|
|
42
|
-
this.notify();
|
|
43
|
-
return goal;
|
|
44
|
-
}
|
|
45
|
-
getGoals() {
|
|
46
|
-
return [...this.goals.values()];
|
|
47
|
-
}
|
|
48
|
-
// ── Task management ──
|
|
49
|
-
createTask(task) {
|
|
50
|
-
const full = {
|
|
51
|
-
...task,
|
|
52
|
-
id: randomUUID(),
|
|
53
|
-
status: 'pending',
|
|
54
|
-
createdAt: Date.now(),
|
|
55
|
-
};
|
|
56
|
-
this.tasks.set(full.id, full);
|
|
57
|
-
// Link to parent goal if specified
|
|
58
|
-
if (full.parentGoalId) {
|
|
59
|
-
const goal = this.goals.get(full.parentGoalId);
|
|
60
|
-
if (goal) {
|
|
61
|
-
goal.tasks.push(full.id);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
this.notify();
|
|
65
|
-
return full;
|
|
66
|
-
}
|
|
67
|
-
getTasks(goalId) {
|
|
68
|
-
const all = [...this.tasks.values()];
|
|
69
|
-
if (goalId) {
|
|
70
|
-
const goal = this.goals.get(goalId);
|
|
71
|
-
if (!goal)
|
|
72
|
-
return [];
|
|
73
|
-
const taskIdSet = new Set(goal.tasks);
|
|
74
|
-
return all.filter((t) => taskIdSet.has(t.id));
|
|
75
|
-
}
|
|
76
|
-
return all;
|
|
77
|
-
}
|
|
78
|
-
getActiveTasks() {
|
|
79
|
-
return [...this.tasks.values()].filter((t) => t.status === 'in_progress' || t.status === 'locked');
|
|
80
|
-
}
|
|
81
|
-
// ── Workflow templates ──
|
|
82
|
-
instantiateWorkflow(templateName) {
|
|
83
|
-
const template = workflows[templateName];
|
|
84
|
-
if (!template) {
|
|
85
|
-
throw new Error(`Unknown workflow template: ${templateName}`);
|
|
86
|
-
}
|
|
87
|
-
// Create goal from first template goal (templates define one)
|
|
88
|
-
const goalDef = template.goals[0];
|
|
89
|
-
const goal = this.createGoal(goalDef.title, goalDef.description);
|
|
90
|
-
// Create tasks linked to the goal
|
|
91
|
-
const tasks = template.tasks.map((t) => this.createTask({
|
|
92
|
-
...t,
|
|
93
|
-
parentGoalId: goal.id,
|
|
94
|
-
}));
|
|
95
|
-
return { goal, tasks };
|
|
96
|
-
}
|
|
97
|
-
getTemplateNames() {
|
|
98
|
-
return Object.keys(workflows);
|
|
99
|
-
}
|
|
100
|
-
// ── Agent routing ──
|
|
101
|
-
registerAgentSkills(agentSlug, skills) {
|
|
102
|
-
this.router.registerAgent(agentSlug, skills);
|
|
103
|
-
this.notify();
|
|
104
|
-
}
|
|
105
|
-
findBestAgentForTask(taskId) {
|
|
106
|
-
const task = this.tasks.get(taskId);
|
|
107
|
-
if (!task)
|
|
108
|
-
return null;
|
|
109
|
-
return this.router.findBestAgent(task);
|
|
110
|
-
}
|
|
111
|
-
// ── Budget ──
|
|
112
|
-
getBudgetSnapshots() {
|
|
113
|
-
return this.budget.getAllSnapshots();
|
|
114
|
-
}
|
|
115
|
-
getGlobalBudget() {
|
|
116
|
-
return this.budget.getGlobalUsage();
|
|
117
|
-
}
|
|
118
|
-
// ── Execution ──
|
|
119
|
-
async submitTask(taskId) {
|
|
120
|
-
const task = this.tasks.get(taskId);
|
|
121
|
-
if (!task)
|
|
122
|
-
throw new Error(`Task not found: ${taskId}`);
|
|
123
|
-
await this.executor.submit(task);
|
|
124
|
-
this.notify();
|
|
125
|
-
}
|
|
126
|
-
async stopAll() {
|
|
127
|
-
await this.executor.stopAll();
|
|
128
|
-
this.notify();
|
|
129
|
-
}
|
|
130
|
-
// ── Subscribe for TUI re-renders ──
|
|
131
|
-
subscribe(listener) {
|
|
132
|
-
this.listeners.push(listener);
|
|
133
|
-
return () => {
|
|
134
|
-
const idx = this.listeners.indexOf(listener);
|
|
135
|
-
if (idx >= 0)
|
|
136
|
-
this.listeners.splice(idx, 1);
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
notify() {
|
|
140
|
-
for (const listener of this.listeners) {
|
|
141
|
-
listener();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// ── Singleton accessor ──
|
|
146
|
-
let instance;
|
|
147
|
-
export function getOrchestrationService() {
|
|
148
|
-
if (!instance) {
|
|
149
|
-
instance = new OrchestrationService();
|
|
150
|
-
}
|
|
151
|
-
return instance;
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=orchestration-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-service.js","sourceRoot":"","sources":["../../../src/tui/services/orchestration-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAS7D,MAAM,cAAc,GAAuB;IACzC,mBAAmB,EAAE,CAAC;IACtB,YAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE;IACrD,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,YAAY;IACxC,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,OAAO,oBAAoB;IACvB,QAAQ,CAAuB;IAC/B,MAAM,CAAgB;IACtB,MAAM,CAAa;IACnB,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IAC/C,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IAC/C,SAAS,GAAsB,EAAE,CAAC;IAE1C,YAAY,MAAoC;QAC9C,MAAM,MAAM,GAAuB,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;QACpE,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAA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MAAM,EAAE,CAAC;IAChB,CAAC;IAED,qCAAqC;IAErC,SAAS,CAAC,QAAoB;QAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC7C,IAAI,GAAG,IAAI,CAAC;gBAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC;IACJ,CAAC;IAEO,MAAM;QACZ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC;CACF;AAED,2BAA2B;AAE3B,IAAI,QAA0C,CAAC;AAE/C,MAAM,UAAU,uBAAuB;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash command registry for the conversation-first TUI.
|
|
3
|
-
*
|
|
4
|
-
* Slash commands (/help, /agents, etc.) are the explicit navigation model.
|
|
5
|
-
* Natural language input goes to the Pi agent via dispatch("ask ...").
|
|
6
|
-
*/
|
|
7
|
-
import type { ViewEntry } from "./store.js";
|
|
8
|
-
import type { CommandResult } from "../commands/dispatch.js";
|
|
9
|
-
import type { SelectOption } from "./components/inline-select.js";
|
|
10
|
-
export interface SlashCommand {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
usage?: string;
|
|
14
|
-
execute: (args: string, context: SlashCommandContext) => Promise<SlashCommandResult>;
|
|
15
|
-
}
|
|
16
|
-
export interface SlashCommandContext {
|
|
17
|
-
push: (view: ViewEntry) => void;
|
|
18
|
-
dispatch: (input: string) => Promise<CommandResult>;
|
|
19
|
-
addMessage: (msg: ConversationMessage) => void;
|
|
20
|
-
setLoading: (loading: boolean, hint?: string) => void;
|
|
21
|
-
/** Show an arrow-key navigable inline select picker. */
|
|
22
|
-
showPicker: (title: string, options: SelectOption[], onSelect: (value: string) => void) => void;
|
|
23
|
-
/** Clear the current picker. */
|
|
24
|
-
clearPicker: () => void;
|
|
25
|
-
/** Show an inline y/n confirm prompt. */
|
|
26
|
-
showConfirm: (question: string, onConfirm: (confirmed: boolean) => void) => void;
|
|
27
|
-
/** Clear the current confirm prompt. */
|
|
28
|
-
clearConfirm: () => void;
|
|
29
|
-
}
|
|
30
|
-
export interface SlashCommandResult {
|
|
31
|
-
output?: string;
|
|
32
|
-
silent?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export type ConversationMessage = {
|
|
35
|
-
id: string;
|
|
36
|
-
role: "user" | "assistant" | "system" | "tool";
|
|
37
|
-
content: string;
|
|
38
|
-
timestamp: number;
|
|
39
|
-
toolName?: string;
|
|
40
|
-
isError?: boolean;
|
|
41
|
-
/** When true, MessageBubble shows a trailing cursor block ▌ */
|
|
42
|
-
isStreaming?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export declare function registerSlashCommand(cmd: SlashCommand): void;
|
|
45
|
-
export declare function getSlashCommand(name: string): SlashCommand | undefined;
|
|
46
|
-
export declare function listSlashCommands(): SlashCommand[];
|
|
47
|
-
/**
|
|
48
|
-
* Parse raw input to determine if it is a slash command.
|
|
49
|
-
* Returns `{ isSlash: true, command, args }` for "/foo bar baz",
|
|
50
|
-
* or `{ isSlash: false }` for everything else.
|
|
51
|
-
*/
|
|
52
|
-
export declare function parseSlashInput(input: string): {
|
|
53
|
-
isSlash: boolean;
|
|
54
|
-
command?: string;
|
|
55
|
-
args?: string;
|
|
56
|
-
};
|
|
57
|
-
export type InitState = {
|
|
58
|
-
phase: "idle";
|
|
59
|
-
} | {
|
|
60
|
-
phase: "awaiting_email";
|
|
61
|
-
loginOnly?: boolean;
|
|
62
|
-
} | {
|
|
63
|
-
phase: "awaiting_new_email";
|
|
64
|
-
loginOnly?: boolean;
|
|
65
|
-
} | {
|
|
66
|
-
phase: "awaiting_agent_prompt";
|
|
67
|
-
};
|
|
68
|
-
export declare function getInitState(): InitState;
|
|
69
|
-
export declare function resetInitState(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Handle user input when the init flow is awaiting a text response.
|
|
72
|
-
* Called by the home adapter when `getInitState().phase !== 'idle'`.
|
|
73
|
-
*
|
|
74
|
-
* Picker-based choices (regen, agent, template) are now handled via
|
|
75
|
-
* showPicker callbacks -- only text-input phases remain here.
|
|
76
|
-
*/
|
|
77
|
-
export declare function handleInitInput(input: string, context: SlashCommandContext): Promise<void>;
|
|
78
|
-
export type AgentWizardState = {
|
|
79
|
-
phase: "idle";
|
|
80
|
-
} | {
|
|
81
|
-
phase: "agent_create_name";
|
|
82
|
-
} | {
|
|
83
|
-
phase: "agent_create_expertise";
|
|
84
|
-
slug: string;
|
|
85
|
-
name: string;
|
|
86
|
-
} | {
|
|
87
|
-
phase: "agent_create_describe";
|
|
88
|
-
} | {
|
|
89
|
-
phase: "agent_edit_name";
|
|
90
|
-
slug: string;
|
|
91
|
-
} | {
|
|
92
|
-
phase: "agent_edit_expertise";
|
|
93
|
-
slug: string;
|
|
94
|
-
};
|
|
95
|
-
export declare function getAgentWizardState(): AgentWizardState;
|
|
96
|
-
export declare function resetAgentWizardState(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Main entry point for the /agents interactive manager.
|
|
99
|
-
* Exported so SlackHome can call it from the sidebar `[a]` shortcut.
|
|
100
|
-
*/
|
|
101
|
-
export declare function openAgentsManager(ctx: SlashCommandContext): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Handle text input when the agent wizard is awaiting user input.
|
|
104
|
-
* Called by SlackHome's handleSend when agentWizardState.phase !== "idle".
|
|
105
|
-
*/
|
|
106
|
-
export declare function handleAgentWizardInput(input: string, ctx: SlashCommandContext): Promise<void>;
|