@nex-ai/nex 0.1.65 → 0.2.1
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 +190 -263
- package/bin/nex-mcp.js +50 -0
- package/bin/nex.js +53 -0
- package/package.json +15 -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 -1544
- 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 -111
- 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 -584
- 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/compounding-worker.d.ts +0 -2
- package/dist/lib/compounding-worker.js +0 -21
- package/dist/lib/compounding-worker.js.map +0 -1
- package/dist/lib/compounding.d.ts +0 -20
- package/dist/lib/compounding.js +0 -45
- package/dist/lib/compounding.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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C;QAC5E,WAAW,EAAE,uDAAuD;QACpE,aAAa,EAAE,aAAa;QAC5B,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,CAAC;KACtF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,CAAC;QAC5F,WAAW,EAAE,4XAA4X;QACzY,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;KAChI;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC;QAC3E,WAAW,EAAE,uIAAuI;QACpJ,aAAa,EAAE,OAAO;QACtB,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;KAChI;CACF,CAAC"}
|
package/dist/agent/tools.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime tool registry and built-in Nex tools.
|
|
3
|
-
*/
|
|
4
|
-
import type { AgentTool } from './types.js';
|
|
5
|
-
import type { NexClient } from '../lib/client.js';
|
|
6
|
-
import type { GossipLayer } from './gossip.js';
|
|
7
|
-
export declare class ToolRegistry {
|
|
8
|
-
private tools;
|
|
9
|
-
register(tool: AgentTool): void;
|
|
10
|
-
unregister(name: string): void;
|
|
11
|
-
get(name: string): AgentTool | undefined;
|
|
12
|
-
list(): AgentTool[];
|
|
13
|
-
has(name: string): boolean;
|
|
14
|
-
validate(toolName: string, params: unknown): {
|
|
15
|
-
valid: boolean;
|
|
16
|
-
errors?: string[];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare function createBuiltinTools(client: NexClient): AgentTool[];
|
|
20
|
-
/**
|
|
21
|
-
* Create gossip-related tools for inter-agent knowledge sharing.
|
|
22
|
-
* @param gossipLayer - The gossip layer instance
|
|
23
|
-
* @param agentSlug - The slug of the agent using these tools
|
|
24
|
-
*/
|
|
25
|
-
export declare function createGossipTools(gossipLayer: GossipLayer, agentSlug: string): AgentTool[];
|
package/dist/agent/tools.js
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime tool registry and built-in Nex tools.
|
|
3
|
-
*/
|
|
4
|
-
export class ToolRegistry {
|
|
5
|
-
tools = new Map();
|
|
6
|
-
register(tool) {
|
|
7
|
-
this.tools.set(tool.name, tool);
|
|
8
|
-
}
|
|
9
|
-
unregister(name) {
|
|
10
|
-
this.tools.delete(name);
|
|
11
|
-
}
|
|
12
|
-
get(name) {
|
|
13
|
-
return this.tools.get(name);
|
|
14
|
-
}
|
|
15
|
-
list() {
|
|
16
|
-
return Array.from(this.tools.values());
|
|
17
|
-
}
|
|
18
|
-
has(name) {
|
|
19
|
-
return this.tools.has(name);
|
|
20
|
-
}
|
|
21
|
-
validate(toolName, params) {
|
|
22
|
-
const tool = this.tools.get(toolName);
|
|
23
|
-
if (!tool) {
|
|
24
|
-
return { valid: false, errors: [`Unknown tool: ${toolName}`] };
|
|
25
|
-
}
|
|
26
|
-
const schema = tool.schema;
|
|
27
|
-
if (!schema || typeof schema !== 'object') {
|
|
28
|
-
return { valid: true };
|
|
29
|
-
}
|
|
30
|
-
const errors = [];
|
|
31
|
-
const required = schema.required ?? [];
|
|
32
|
-
const properties = schema.properties ?? {};
|
|
33
|
-
const paramObj = (params && typeof params === 'object' ? params : {});
|
|
34
|
-
for (const field of required) {
|
|
35
|
-
if (paramObj[field] === undefined || paramObj[field] === null) {
|
|
36
|
-
errors.push(`Missing required parameter: ${field}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
for (const key of Object.keys(paramObj)) {
|
|
40
|
-
if (Object.keys(properties).length > 0 && !(key in properties)) {
|
|
41
|
-
errors.push(`Unknown parameter: ${key}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return errors.length > 0 ? { valid: false, errors } : { valid: true };
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export function createBuiltinTools(client) {
|
|
48
|
-
const tools = [
|
|
49
|
-
{
|
|
50
|
-
name: 'nex_search',
|
|
51
|
-
description: 'Search organizational knowledge base',
|
|
52
|
-
schema: {
|
|
53
|
-
type: 'object',
|
|
54
|
-
required: ['query'],
|
|
55
|
-
properties: {
|
|
56
|
-
query: { type: 'string', description: 'Search query' },
|
|
57
|
-
limit: { type: 'number', description: 'Max results' },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
async execute(params, signal, onUpdate) {
|
|
61
|
-
signal.throwIfAborted();
|
|
62
|
-
onUpdate('Searching...');
|
|
63
|
-
const result = await client.post('/search', {
|
|
64
|
-
query: params.query,
|
|
65
|
-
limit: params.limit ?? 10,
|
|
66
|
-
});
|
|
67
|
-
return JSON.stringify(result);
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'nex_ask',
|
|
72
|
-
description: 'Ask a question to the organizational AI',
|
|
73
|
-
schema: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
required: ['question'],
|
|
76
|
-
properties: {
|
|
77
|
-
question: { type: 'string', description: 'Question to ask' },
|
|
78
|
-
context: { type: 'string', description: 'Additional context' },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
async execute(params, signal, onUpdate) {
|
|
82
|
-
signal.throwIfAborted();
|
|
83
|
-
onUpdate('Thinking...');
|
|
84
|
-
const result = await client.post('/ask', {
|
|
85
|
-
question: params.question,
|
|
86
|
-
context: params.context,
|
|
87
|
-
});
|
|
88
|
-
return JSON.stringify(result);
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'nex_remember',
|
|
93
|
-
description: 'Store an insight or fact in organizational memory',
|
|
94
|
-
schema: {
|
|
95
|
-
type: 'object',
|
|
96
|
-
required: ['content'],
|
|
97
|
-
properties: {
|
|
98
|
-
content: { type: 'string', description: 'Content to remember' },
|
|
99
|
-
tags: { type: 'array', description: 'Tags for categorization' },
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
async execute(params, signal, onUpdate) {
|
|
103
|
-
signal.throwIfAborted();
|
|
104
|
-
onUpdate('Storing...');
|
|
105
|
-
const result = await client.post('/remember', {
|
|
106
|
-
content: params.content,
|
|
107
|
-
tags: params.tags,
|
|
108
|
-
});
|
|
109
|
-
return JSON.stringify(result);
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'nex_record_list',
|
|
114
|
-
description: 'List records from a CRM object type',
|
|
115
|
-
schema: {
|
|
116
|
-
type: 'object',
|
|
117
|
-
required: ['objectType'],
|
|
118
|
-
properties: {
|
|
119
|
-
objectType: { type: 'string', description: 'CRM object type (contacts, companies, deals)' },
|
|
120
|
-
limit: { type: 'number', description: 'Max records to return' },
|
|
121
|
-
filters: { type: 'object', description: 'Filter criteria' },
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
async execute(params, signal, onUpdate) {
|
|
125
|
-
signal.throwIfAborted();
|
|
126
|
-
onUpdate('Listing records...');
|
|
127
|
-
const query = new URLSearchParams();
|
|
128
|
-
if (params.limit)
|
|
129
|
-
query.set('limit', String(params.limit));
|
|
130
|
-
const result = await client.get(`/records/${params.objectType}?${query.toString()}`);
|
|
131
|
-
return JSON.stringify(result);
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'nex_record_get',
|
|
136
|
-
description: 'Get a specific record by ID',
|
|
137
|
-
schema: {
|
|
138
|
-
type: 'object',
|
|
139
|
-
required: ['objectType', 'recordId'],
|
|
140
|
-
properties: {
|
|
141
|
-
objectType: { type: 'string', description: 'CRM object type' },
|
|
142
|
-
recordId: { type: 'string', description: 'Record ID' },
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
async execute(params, signal, onUpdate) {
|
|
146
|
-
signal.throwIfAborted();
|
|
147
|
-
onUpdate('Fetching record...');
|
|
148
|
-
const result = await client.get(`/records/${params.objectType}/${params.recordId}`);
|
|
149
|
-
return JSON.stringify(result);
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: 'nex_record_create',
|
|
154
|
-
description: 'Create a new CRM record',
|
|
155
|
-
schema: {
|
|
156
|
-
type: 'object',
|
|
157
|
-
required: ['objectType', 'properties'],
|
|
158
|
-
properties: {
|
|
159
|
-
objectType: { type: 'string', description: 'CRM object type' },
|
|
160
|
-
properties: { type: 'object', description: 'Record properties' },
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
async execute(params, signal, onUpdate) {
|
|
164
|
-
signal.throwIfAborted();
|
|
165
|
-
onUpdate('Creating record...');
|
|
166
|
-
const result = await client.post(`/records/${params.objectType}`, {
|
|
167
|
-
properties: params.properties,
|
|
168
|
-
});
|
|
169
|
-
return JSON.stringify(result);
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: 'nex_record_update',
|
|
174
|
-
description: 'Update an existing CRM record',
|
|
175
|
-
schema: {
|
|
176
|
-
type: 'object',
|
|
177
|
-
required: ['objectType', 'recordId', 'properties'],
|
|
178
|
-
properties: {
|
|
179
|
-
objectType: { type: 'string', description: 'CRM object type' },
|
|
180
|
-
recordId: { type: 'string', description: 'Record ID' },
|
|
181
|
-
properties: { type: 'object', description: 'Properties to update' },
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
async execute(params, signal, onUpdate) {
|
|
185
|
-
signal.throwIfAborted();
|
|
186
|
-
onUpdate('Updating record...');
|
|
187
|
-
const result = await client.patch(`/records/${params.objectType}/${params.recordId}`, { properties: params.properties });
|
|
188
|
-
return JSON.stringify(result);
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
];
|
|
192
|
-
return tools;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Create gossip-related tools for inter-agent knowledge sharing.
|
|
196
|
-
* @param gossipLayer - The gossip layer instance
|
|
197
|
-
* @param agentSlug - The slug of the agent using these tools
|
|
198
|
-
*/
|
|
199
|
-
export function createGossipTools(gossipLayer, agentSlug) {
|
|
200
|
-
return [
|
|
201
|
-
{
|
|
202
|
-
name: 'nex_gossip_publish',
|
|
203
|
-
description: 'Publish an insight for other agents to discover via the gossip network',
|
|
204
|
-
schema: {
|
|
205
|
-
type: 'object',
|
|
206
|
-
required: ['insight'],
|
|
207
|
-
properties: {
|
|
208
|
-
insight: { type: 'string', description: 'The insight or finding to share' },
|
|
209
|
-
context: { type: 'string', description: 'Optional context about the insight' },
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
async execute(params, signal, onUpdate) {
|
|
213
|
-
signal.throwIfAborted();
|
|
214
|
-
onUpdate('Publishing insight...');
|
|
215
|
-
const id = await gossipLayer.publish(agentSlug, params.insight, params.context);
|
|
216
|
-
return JSON.stringify({ published: true, id });
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: 'nex_gossip_query',
|
|
221
|
-
description: 'Query the gossip network for insights from other agents on a topic',
|
|
222
|
-
schema: {
|
|
223
|
-
type: 'object',
|
|
224
|
-
required: ['topic'],
|
|
225
|
-
properties: {
|
|
226
|
-
topic: { type: 'string', description: 'The topic to search for insights about' },
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
async execute(params, signal, onUpdate) {
|
|
230
|
-
signal.throwIfAborted();
|
|
231
|
-
onUpdate('Querying gossip network...');
|
|
232
|
-
const insights = await gossipLayer.query(agentSlug, params.topic);
|
|
233
|
-
return JSON.stringify({ insights, count: insights.length });
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
];
|
|
237
|
-
}
|
|
238
|
-
//# sourceMappingURL=tools.js.map
|
package/dist/agent/tools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/agent/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,OAAO,YAAY;IACf,KAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;IAE7C,QAAQ,CAAC,IAAe;QACtB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,QAAQ,CAAC,QAAgB,EAAE,MAAe;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,iBAAiB,QAAQ,EAAE,CAAC,EAAE,CAAC;QACjE,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAA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c,EAAE,CAAC;gBACxB,QAAQ,CAAC,4BAA4B,CAAC,CAAC;gBACvC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,SAAS,EACT,MAAM,CAAC,KAAe,CACvB,CAAC;gBACF,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC9D,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/agent/types.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core type definitions for the Pi-based agent runtime.
|
|
3
|
-
*/
|
|
4
|
-
export type AgentPhase = 'idle' | 'build_context' | 'stream_llm' | 'execute_tool' | 'done' | 'error';
|
|
5
|
-
export interface AgentConfig {
|
|
6
|
-
slug: string;
|
|
7
|
-
name: string;
|
|
8
|
-
expertise: string[];
|
|
9
|
-
personality?: string;
|
|
10
|
-
heartbeatCron?: string;
|
|
11
|
-
tools?: string[];
|
|
12
|
-
budget?: {
|
|
13
|
-
maxTokens: number;
|
|
14
|
-
maxCostUsd: number;
|
|
15
|
-
};
|
|
16
|
-
autoDecideTimeout?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface AgentState {
|
|
19
|
-
phase: AgentPhase;
|
|
20
|
-
config: AgentConfig;
|
|
21
|
-
sessionId?: string;
|
|
22
|
-
currentTask?: string;
|
|
23
|
-
tokensUsed: number;
|
|
24
|
-
costUsd: number;
|
|
25
|
-
lastHeartbeat?: number;
|
|
26
|
-
nextHeartbeat?: number;
|
|
27
|
-
error?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface AgentTool {
|
|
30
|
-
name: string;
|
|
31
|
-
description: string;
|
|
32
|
-
schema: Record<string, unknown>;
|
|
33
|
-
execute: (params: Record<string, unknown>, signal: AbortSignal, onUpdate: (partial: string) => void) => Promise<string>;
|
|
34
|
-
}
|
|
35
|
-
export interface ToolCall {
|
|
36
|
-
toolName: string;
|
|
37
|
-
params: Record<string, unknown>;
|
|
38
|
-
result?: string;
|
|
39
|
-
error?: string;
|
|
40
|
-
startedAt: number;
|
|
41
|
-
completedAt?: number;
|
|
42
|
-
}
|
|
43
|
-
export interface SessionEntry {
|
|
44
|
-
id: string;
|
|
45
|
-
parentId?: string;
|
|
46
|
-
type: 'user' | 'assistant' | 'tool_call' | 'tool_result' | 'system';
|
|
47
|
-
content: string;
|
|
48
|
-
timestamp: number;
|
|
49
|
-
metadata?: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
export type StreamFn = (messages: Array<{
|
|
52
|
-
role: string;
|
|
53
|
-
content: string;
|
|
54
|
-
}>, tools: AgentTool[]) => AsyncGenerator<{
|
|
55
|
-
type: 'text' | 'tool_call';
|
|
56
|
-
content?: string;
|
|
57
|
-
toolName?: string;
|
|
58
|
-
toolParams?: Record<string, unknown>;
|
|
59
|
-
}>;
|
package/dist/agent/types.js
DELETED
package/dist/agent/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cron parser and scheduling engine.
|
|
3
|
-
* Supports: standard 5-field cron, "daily", "hourly", "Nh" shorthand.
|
|
4
|
-
* No external dependencies.
|
|
5
|
-
*/
|
|
6
|
-
import type { CalendarStore } from './store.js';
|
|
7
|
-
import type { ScheduledTask } from './types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Parse human-friendly cron expressions to standard 5-field cron.
|
|
10
|
-
* Supports:
|
|
11
|
-
* "daily" -> "0 0 * * *"
|
|
12
|
-
* "hourly" -> "0 * * * *"
|
|
13
|
-
* "6h" -> "0 */6 * * *" (every N hours)
|
|
14
|
-
* "30m" -> "*/30 * * * *" (every N minutes)
|
|
15
|
-
* Standard 5-field cron passed through as-is.
|
|
16
|
-
*/
|
|
17
|
-
export declare function parseCron(expression: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* Calculate the next run time for a cron expression after the given date.
|
|
20
|
-
* Brute-forces by advancing minute-by-minute (bounded to 400 days).
|
|
21
|
-
*/
|
|
22
|
-
export declare function nextRun(cronExpression: string, after?: Date): Date;
|
|
23
|
-
export declare class Scheduler {
|
|
24
|
-
private store;
|
|
25
|
-
constructor(store: CalendarStore);
|
|
26
|
-
parseCron(expression: string): string;
|
|
27
|
-
nextRun(cronExpression: string, after?: Date): Date;
|
|
28
|
-
getMissed(): ScheduledTask[];
|
|
29
|
-
schedule(task: Omit<ScheduledTask, 'id' | 'nextRun' | 'missed'>): ScheduledTask;
|
|
30
|
-
getUpcoming(from: Date, to: Date): ScheduledTask[];
|
|
31
|
-
markCompleted(taskId: string): void;
|
|
32
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cron parser and scheduling engine.
|
|
3
|
-
* Supports: standard 5-field cron, "daily", "hourly", "Nh" shorthand.
|
|
4
|
-
* No external dependencies.
|
|
5
|
-
*/
|
|
6
|
-
import { randomUUID } from 'node:crypto';
|
|
7
|
-
/**
|
|
8
|
-
* Parse human-friendly cron expressions to standard 5-field cron.
|
|
9
|
-
* Supports:
|
|
10
|
-
* "daily" -> "0 0 * * *"
|
|
11
|
-
* "hourly" -> "0 * * * *"
|
|
12
|
-
* "6h" -> "0 */6 * * *" (every N hours)
|
|
13
|
-
* "30m" -> "*/30 * * * *" (every N minutes)
|
|
14
|
-
* Standard 5-field cron passed through as-is.
|
|
15
|
-
*/
|
|
16
|
-
export function parseCron(expression) {
|
|
17
|
-
const trimmed = expression.trim().toLowerCase();
|
|
18
|
-
if (trimmed === 'daily')
|
|
19
|
-
return '0 0 * * *';
|
|
20
|
-
if (trimmed === 'hourly')
|
|
21
|
-
return '0 * * * *';
|
|
22
|
-
if (trimmed === 'weekly')
|
|
23
|
-
return '0 0 * * 0';
|
|
24
|
-
// Nh pattern (e.g. "6h", "12h")
|
|
25
|
-
const hourMatch = trimmed.match(/^(\d+)h$/);
|
|
26
|
-
if (hourMatch) {
|
|
27
|
-
const n = parseInt(hourMatch[1], 10);
|
|
28
|
-
if (n > 0 && n <= 23)
|
|
29
|
-
return `0 */${n} * * *`;
|
|
30
|
-
}
|
|
31
|
-
// Nm pattern (e.g. "30m", "15m")
|
|
32
|
-
const minMatch = trimmed.match(/^(\d+)m$/);
|
|
33
|
-
if (minMatch) {
|
|
34
|
-
const n = parseInt(minMatch[1], 10);
|
|
35
|
-
if (n > 0 && n <= 59)
|
|
36
|
-
return `*/${n} * * * *`;
|
|
37
|
-
}
|
|
38
|
-
// Standard 5-field cron: validate it has 5 space-separated fields with valid chars
|
|
39
|
-
const fields = expression.trim().split(/\s+/);
|
|
40
|
-
const cronFieldRe = /^(\*|\d+)([/-]\d+)?([,](\*|\d+)([/-]\d+)?)*$/;
|
|
41
|
-
if (fields.length === 5 && fields.every(f => cronFieldRe.test(f))) {
|
|
42
|
-
return expression.trim();
|
|
43
|
-
}
|
|
44
|
-
throw new Error(`Invalid cron expression: ${expression}`);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Parse a single cron field and return the set of matching values.
|
|
48
|
-
* Supports: *, N, N-M, */N, N-M/S, comma-separated lists.
|
|
49
|
-
*/
|
|
50
|
-
function parseCronField(field, min, max) {
|
|
51
|
-
const values = new Set();
|
|
52
|
-
for (const part of field.split(',')) {
|
|
53
|
-
const trimmed = part.trim();
|
|
54
|
-
// */N
|
|
55
|
-
const stepWild = trimmed.match(/^\*\/(\d+)$/);
|
|
56
|
-
if (stepWild) {
|
|
57
|
-
const step = parseInt(stepWild[1], 10);
|
|
58
|
-
for (let i = min; i <= max; i += step)
|
|
59
|
-
values.add(i);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
// N-M/S
|
|
63
|
-
const rangeStep = trimmed.match(/^(\d+)-(\d+)\/(\d+)$/);
|
|
64
|
-
if (rangeStep) {
|
|
65
|
-
const start = parseInt(rangeStep[1], 10);
|
|
66
|
-
const end = parseInt(rangeStep[2], 10);
|
|
67
|
-
const step = parseInt(rangeStep[3], 10);
|
|
68
|
-
for (let i = start; i <= end; i += step)
|
|
69
|
-
values.add(i);
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
// N-M
|
|
73
|
-
const range = trimmed.match(/^(\d+)-(\d+)$/);
|
|
74
|
-
if (range) {
|
|
75
|
-
const start = parseInt(range[1], 10);
|
|
76
|
-
const end = parseInt(range[2], 10);
|
|
77
|
-
for (let i = start; i <= end; i++)
|
|
78
|
-
values.add(i);
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
// *
|
|
82
|
-
if (trimmed === '*') {
|
|
83
|
-
for (let i = min; i <= max; i++)
|
|
84
|
-
values.add(i);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
// Single number
|
|
88
|
-
const n = parseInt(trimmed, 10);
|
|
89
|
-
if (!isNaN(n) && n >= min && n <= max) {
|
|
90
|
-
values.add(n);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return Array.from(values).sort((a, b) => a - b);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Calculate the next run time for a cron expression after the given date.
|
|
97
|
-
* Brute-forces by advancing minute-by-minute (bounded to 400 days).
|
|
98
|
-
*/
|
|
99
|
-
export function nextRun(cronExpression, after) {
|
|
100
|
-
const cron = parseCron(cronExpression);
|
|
101
|
-
const fields = cron.split(/\s+/);
|
|
102
|
-
if (fields.length !== 5)
|
|
103
|
-
throw new Error(`Invalid cron: ${cronExpression}`);
|
|
104
|
-
const minutes = parseCronField(fields[0], 0, 59);
|
|
105
|
-
const hours = parseCronField(fields[1], 0, 23);
|
|
106
|
-
const daysOfMonth = parseCronField(fields[2], 1, 31);
|
|
107
|
-
const months = parseCronField(fields[3], 1, 12);
|
|
108
|
-
const daysOfWeek = parseCronField(fields[4], 0, 6);
|
|
109
|
-
const start = after ? new Date(after.getTime()) : new Date();
|
|
110
|
-
// Advance to next minute (UTC)
|
|
111
|
-
start.setUTCSeconds(0, 0);
|
|
112
|
-
start.setUTCMinutes(start.getUTCMinutes() + 1);
|
|
113
|
-
const maxIterations = 400 * 24 * 60; // ~400 days in minutes
|
|
114
|
-
const candidate = new Date(start.getTime());
|
|
115
|
-
for (let i = 0; i < maxIterations; i++) {
|
|
116
|
-
const m = candidate.getUTCMinutes();
|
|
117
|
-
const h = candidate.getUTCHours();
|
|
118
|
-
const dom = candidate.getUTCDate();
|
|
119
|
-
const mon = candidate.getUTCMonth() + 1; // 0-indexed -> 1-indexed
|
|
120
|
-
const dow = candidate.getUTCDay();
|
|
121
|
-
if (minutes.includes(m) &&
|
|
122
|
-
hours.includes(h) &&
|
|
123
|
-
daysOfMonth.includes(dom) &&
|
|
124
|
-
months.includes(mon) &&
|
|
125
|
-
daysOfWeek.includes(dow)) {
|
|
126
|
-
return candidate;
|
|
127
|
-
}
|
|
128
|
-
candidate.setUTCMinutes(candidate.getUTCMinutes() + 1);
|
|
129
|
-
}
|
|
130
|
-
// Fallback: return 24h from now if no match found
|
|
131
|
-
return new Date(Date.now() + 24 * 60 * 60 * 1000);
|
|
132
|
-
}
|
|
133
|
-
export class Scheduler {
|
|
134
|
-
store;
|
|
135
|
-
constructor(store) {
|
|
136
|
-
this.store = store;
|
|
137
|
-
}
|
|
138
|
-
parseCron(expression) {
|
|
139
|
-
return parseCron(expression);
|
|
140
|
-
}
|
|
141
|
-
nextRun(cronExpression, after) {
|
|
142
|
-
return nextRun(cronExpression, after);
|
|
143
|
-
}
|
|
144
|
-
getMissed() {
|
|
145
|
-
const now = Date.now();
|
|
146
|
-
const tasks = this.store.load();
|
|
147
|
-
return tasks.filter(t => t.enabled && t.nextRun < now && !t.missed);
|
|
148
|
-
}
|
|
149
|
-
schedule(task) {
|
|
150
|
-
const nextRunTime = nextRun(task.cronExpression);
|
|
151
|
-
const full = {
|
|
152
|
-
...task,
|
|
153
|
-
id: randomUUID(),
|
|
154
|
-
nextRun: nextRunTime.getTime(),
|
|
155
|
-
missed: false,
|
|
156
|
-
};
|
|
157
|
-
this.store.add(full);
|
|
158
|
-
return full;
|
|
159
|
-
}
|
|
160
|
-
getUpcoming(from, to) {
|
|
161
|
-
const fromMs = from.getTime();
|
|
162
|
-
const toMs = to.getTime();
|
|
163
|
-
return this.store.load().filter(t => t.enabled && t.nextRun >= fromMs && t.nextRun <= toMs);
|
|
164
|
-
}
|
|
165
|
-
markCompleted(taskId) {
|
|
166
|
-
const tasks = this.store.load();
|
|
167
|
-
const task = tasks.find(t => t.id === taskId);
|
|
168
|
-
if (!task)
|
|
169
|
-
return;
|
|
170
|
-
const nextRunTime = nextRun(task.cronExpression);
|
|
171
|
-
this.store.update(taskId, {
|
|
172
|
-
lastRun: Date.now(),
|
|
173
|
-
nextRun: nextRunTime.getTime(),
|
|
174
|
-
missed: false,
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=scheduler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../src/calendar/scheduler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,UAAkB;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEhD,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC;IAC7C,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC;IAE7C,gCAAgC;IAChC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5C,IAAI,SAAS,EAAE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,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,CAC7B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAC3D,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,MAAc;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;YACxB,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;YACnB,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE;YAC9B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/calendar/store.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calendar persistence layer.
|
|
3
|
-
* Stores scheduled tasks in a JSON file at ~/.nex-cli/calendar.json
|
|
4
|
-
*/
|
|
5
|
-
import type { ScheduledTask } from './types.js';
|
|
6
|
-
export declare class CalendarStore {
|
|
7
|
-
private filePath;
|
|
8
|
-
constructor(filePath?: string);
|
|
9
|
-
load(): ScheduledTask[];
|
|
10
|
-
save(tasks: ScheduledTask[]): void;
|
|
11
|
-
add(task: ScheduledTask): void;
|
|
12
|
-
remove(taskId: string): void;
|
|
13
|
-
update(taskId: string, updates: Partial<ScheduledTask>): void;
|
|
14
|
-
getByAgent(agentSlug: string): ScheduledTask[];
|
|
15
|
-
}
|
package/dist/calendar/store.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calendar persistence layer.
|
|
3
|
-
* Stores scheduled tasks in a JSON file at ~/.nex-cli/calendar.json
|
|
4
|
-
*/
|
|
5
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
6
|
-
import { dirname, join } from 'node:path';
|
|
7
|
-
import { homedir } from 'node:os';
|
|
8
|
-
export class CalendarStore {
|
|
9
|
-
filePath;
|
|
10
|
-
constructor(filePath) {
|
|
11
|
-
this.filePath = filePath ?? join(homedir(), '.nex-cli', 'calendar.json');
|
|
12
|
-
}
|
|
13
|
-
load() {
|
|
14
|
-
try {
|
|
15
|
-
if (!existsSync(this.filePath))
|
|
16
|
-
return [];
|
|
17
|
-
const raw = readFileSync(this.filePath, 'utf-8');
|
|
18
|
-
const data = JSON.parse(raw);
|
|
19
|
-
return Array.isArray(data) ? data : [];
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
save(tasks) {
|
|
26
|
-
mkdirSync(dirname(this.filePath), { recursive: true });
|
|
27
|
-
writeFileSync(this.filePath, JSON.stringify(tasks, null, 2) + '\n', 'utf-8');
|
|
28
|
-
}
|
|
29
|
-
add(task) {
|
|
30
|
-
const tasks = this.load();
|
|
31
|
-
tasks.push(task);
|
|
32
|
-
this.save(tasks);
|
|
33
|
-
}
|
|
34
|
-
remove(taskId) {
|
|
35
|
-
const tasks = this.load().filter(t => t.id !== taskId);
|
|
36
|
-
this.save(tasks);
|
|
37
|
-
}
|
|
38
|
-
update(taskId, updates) {
|
|
39
|
-
const tasks = this.load();
|
|
40
|
-
const idx = tasks.findIndex(t => t.id === taskId);
|
|
41
|
-
if (idx >= 0) {
|
|
42
|
-
tasks[idx] = { ...tasks[idx], ...updates };
|
|
43
|
-
this.save(tasks);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
getByAgent(agentSlug) {
|
|
47
|
-
return this.load().filter(t => t.agentSlug === agentSlug);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/calendar/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,MAAM,OAAO,aAAa;IAChB,QAAQ,CAAS;IAEzB,YAAY,QAAiB;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI;QACF,IAAI,CAAC;YACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAAE,OAAO,EAAE,CAAC;YAC1C,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAsB;QACzB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IA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