@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/views/timeline.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XML context formatting and stripping for recall injection.
|
|
3
|
-
* Wraps Nex answers in <nex-context> tags and strips them before capture.
|
|
4
|
-
*/
|
|
5
|
-
const OPEN_TAG = "<nex-context>";
|
|
6
|
-
const CLOSE_TAG = "</nex-context>";
|
|
7
|
-
/**
|
|
8
|
-
* Format a Nex /ask response as an XML block for context injection.
|
|
9
|
-
*/
|
|
10
|
-
export function formatNexContext(result) {
|
|
11
|
-
const parts = [
|
|
12
|
-
OPEN_TAG,
|
|
13
|
-
"The following is relevant context from the user's knowledge base. Use it to inform your response, but do not mention this block directly.",
|
|
14
|
-
];
|
|
15
|
-
if (result.entityCount > 0) {
|
|
16
|
-
parts.push(`[${result.entityCount} related entities found]`);
|
|
17
|
-
}
|
|
18
|
-
parts.push("");
|
|
19
|
-
parts.push(result.answer);
|
|
20
|
-
parts.push(CLOSE_TAG);
|
|
21
|
-
return parts.join("\n");
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Strip all <nex-context>...</nex-context> blocks from text.
|
|
25
|
-
* Also handles unclosed tags (strips from open tag to end of text).
|
|
26
|
-
*/
|
|
27
|
-
export function stripNexContext(text) {
|
|
28
|
-
// First: strip complete blocks
|
|
29
|
-
let result = text.replace(/<nex-context>[\s\S]*?<\/nex-context>/g, "");
|
|
30
|
-
// Then: strip unclosed tags (open tag without matching close)
|
|
31
|
-
result = result.replace(/<nex-context>[\s\S]*/g, "");
|
|
32
|
-
return result.trim();
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=context-format.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-format.js","sourceRoot":"","sources":["../../src/plugin/context-format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,QAAQ,GAAG,eAAe,CAAC;AACjC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAQnC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACtD,MAAM,KAAK,GAAa;QACtB,QAAQ;QACR,2IAA2I;KAC5I,CAAC;IAEF,IAAI,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,WAAW,0BAA0B,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEtB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,+BAA+B;IAC/B,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,uCAAuC,EAAE,EAAE,CAAC,CAAC;IACvE,8DAA8D;IAC9D,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistent file manifest — tracks which files have been ingested
|
|
3
|
-
* using mtime + size as change detection.
|
|
4
|
-
*
|
|
5
|
-
* Stored at ~/.nex/file-scan-manifest.json. Follows session-store.ts pattern.
|
|
6
|
-
*/
|
|
7
|
-
import { type Stats } from "node:fs";
|
|
8
|
-
export interface FileManifestEntry {
|
|
9
|
-
mtime: number;
|
|
10
|
-
size: number;
|
|
11
|
-
ingestedAt: number;
|
|
12
|
-
context: string;
|
|
13
|
-
}
|
|
14
|
-
export interface FileManifest {
|
|
15
|
-
version: 1;
|
|
16
|
-
lastScanAt?: number;
|
|
17
|
-
files: Record<string, FileManifestEntry>;
|
|
18
|
-
}
|
|
19
|
-
export declare function readManifest(): FileManifest;
|
|
20
|
-
export declare function writeManifest(manifest: FileManifest): void;
|
|
21
|
-
export declare function isChanged(path: string, stat: Stats, manifest: FileManifest): boolean;
|
|
22
|
-
export declare function markIngested(path: string, stat: Stats, context: string, manifest: FileManifest): void;
|
|
23
|
-
/**
|
|
24
|
-
* Record that a full scan completed at this moment.
|
|
25
|
-
*/
|
|
26
|
-
export declare function markScanned(manifest: FileManifest): void;
|
|
27
|
-
export declare function isScanFresh(manifest: FileManifest, windowMs?: number): boolean;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Persistent file manifest — tracks which files have been ingested
|
|
3
|
-
* using mtime + size as change detection.
|
|
4
|
-
*
|
|
5
|
-
* Stored at ~/.nex/file-scan-manifest.json. Follows session-store.ts pattern.
|
|
6
|
-
*/
|
|
7
|
-
import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
8
|
-
import { join } from "node:path";
|
|
9
|
-
import { workspaceDataDir } from "./workspace-data-dir.js";
|
|
10
|
-
function dataDir() {
|
|
11
|
-
return workspaceDataDir();
|
|
12
|
-
}
|
|
13
|
-
function manifestPath() {
|
|
14
|
-
return join(dataDir(), "file-scan-manifest.json");
|
|
15
|
-
}
|
|
16
|
-
export function readManifest() {
|
|
17
|
-
try {
|
|
18
|
-
const raw = readFileSync(manifestPath(), "utf-8");
|
|
19
|
-
const data = JSON.parse(raw);
|
|
20
|
-
if (data && data.version === 1 && data.files) {
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
23
|
-
return { version: 1, files: {} };
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return { version: 1, files: {} };
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export function writeManifest(manifest) {
|
|
30
|
-
try {
|
|
31
|
-
mkdirSync(dataDir(), { recursive: true });
|
|
32
|
-
writeFileSync(manifestPath(), JSON.stringify(manifest, null, 2), "utf-8");
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
// Best-effort — if we can't write, next scan re-ingests
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export function isChanged(path, stat, manifest) {
|
|
39
|
-
const entry = manifest.files[path];
|
|
40
|
-
if (!entry)
|
|
41
|
-
return true;
|
|
42
|
-
return entry.mtime !== stat.mtimeMs || entry.size !== stat.size;
|
|
43
|
-
}
|
|
44
|
-
export function markIngested(path, stat, context, manifest) {
|
|
45
|
-
manifest.files[path] = {
|
|
46
|
-
mtime: stat.mtimeMs,
|
|
47
|
-
size: stat.size,
|
|
48
|
-
ingestedAt: Date.now(),
|
|
49
|
-
context,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Record that a full scan completed at this moment.
|
|
54
|
-
*/
|
|
55
|
-
export function markScanned(manifest) {
|
|
56
|
-
manifest.lastScanAt = Date.now();
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Check if a scan completed recently (within the given window).
|
|
60
|
-
* Default window: 1 hour.
|
|
61
|
-
*/
|
|
62
|
-
const DEFAULT_SCAN_FRESHNESS_MS = 60 * 60 * 1000; // 1 hour
|
|
63
|
-
export function isScanFresh(manifest, windowMs = DEFAULT_SCAN_FRESHNESS_MS) {
|
|
64
|
-
if (!manifest.lastScanAt)
|
|
65
|
-
return false;
|
|
66
|
-
return Date.now() - manifest.lastScanAt < windowMs;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=file-manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-manifest.js","sourceRoot":"","sources":["../../src/plugin/file-manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAc,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAe3D,SAAS,OAAO;IACd,O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AI,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,IAAW,EACX,OAAe,EACf,QAAsB;IAEtB,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;QACrB,KAAK,EAAE,IAAI,CAAC,OAAO;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;QACtB,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAsB;IAChD,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAE3D,MAAM,UAAU,WAAW,CAAC,QAAsB,EAAE,QAAQ,GAAG,yBAAyB;IACtF,IAAI,CAAC,QAAQ,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC;AACrD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core file scanner — walks project directories, detects changed files,
|
|
3
|
-
* and ingests them into Nex via the developer API.
|
|
4
|
-
*
|
|
5
|
-
* No new dependencies — uses only Node.js built-ins.
|
|
6
|
-
*/
|
|
7
|
-
import type { NexClient } from "./nex-client.js";
|
|
8
|
-
import type { RateLimiter } from "./rate-limiter.js";
|
|
9
|
-
import type { ScanConfig } from "./config.js";
|
|
10
|
-
export interface ScanResult {
|
|
11
|
-
scanned: number;
|
|
12
|
-
ingested: number;
|
|
13
|
-
skipped: number;
|
|
14
|
-
errors: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Scan project directory for text files and ingest changed ones into Nex.
|
|
18
|
-
*/
|
|
19
|
-
export declare function scanAndIngest(client: NexClient, rateLimiter: RateLimiter, cwd: string, config: ScanConfig): Promise<ScanResult>;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core file scanner — walks project directories, detects changed files,
|
|
3
|
-
* and ingests them into Nex via the developer API.
|
|
4
|
-
*
|
|
5
|
-
* No new dependencies — uses only Node.js built-ins.
|
|
6
|
-
*/
|
|
7
|
-
import { readdirSync, statSync, readFileSync } from "node:fs";
|
|
8
|
-
import { join, relative, extname } from "node:path";
|
|
9
|
-
import { readManifest, writeManifest, isChanged, markIngested } from "./file-manifest.js";
|
|
10
|
-
/**
|
|
11
|
-
* Recursively collect candidate files up to scanDepth levels.
|
|
12
|
-
*/
|
|
13
|
-
function walkDir(dir, cwd, config, depth, results) {
|
|
14
|
-
if (depth > config.scanDepth)
|
|
15
|
-
return;
|
|
16
|
-
let entries;
|
|
17
|
-
try {
|
|
18
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return; // Permission denied or missing — skip silently
|
|
22
|
-
}
|
|
23
|
-
for (const entry of entries) {
|
|
24
|
-
const fullPath = join(dir, entry.name);
|
|
25
|
-
if (entry.isDirectory()) {
|
|
26
|
-
if (config.ignoreDirs.includes(entry.name))
|
|
27
|
-
continue;
|
|
28
|
-
walkDir(fullPath, cwd, config, depth + 1, results);
|
|
29
|
-
}
|
|
30
|
-
else if (entry.isFile()) {
|
|
31
|
-
const ext = extname(entry.name).toLowerCase();
|
|
32
|
-
if (!config.extensions.includes(ext))
|
|
33
|
-
continue;
|
|
34
|
-
try {
|
|
35
|
-
const stat = statSync(fullPath);
|
|
36
|
-
results.push({
|
|
37
|
-
absolutePath: fullPath,
|
|
38
|
-
relativePath: relative(cwd, fullPath),
|
|
39
|
-
stat,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
// stat failed — skip
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Scan project directory for text files and ingest changed ones into Nex.
|
|
50
|
-
*/
|
|
51
|
-
export async function scanAndIngest(client, rateLimiter, cwd, config) {
|
|
52
|
-
const result = { scanned: 0, ingested: 0, skipped: 0, errors: 0 };
|
|
53
|
-
if (!config.enabled)
|
|
54
|
-
return result;
|
|
55
|
-
const manifest = readManifest();
|
|
56
|
-
const candidates = [];
|
|
57
|
-
walkDir(cwd, cwd, config, 0, candidates);
|
|
58
|
-
result.scanned = candidates.length;
|
|
59
|
-
// Filter to changed files, sort by mtime descending (newest first)
|
|
60
|
-
const changed = candidates
|
|
61
|
-
.filter((f) => isChanged(f.absolutePath, f.stat, manifest))
|
|
62
|
-
.sort((a, b) => b.stat.mtimeMs - a.stat.mtimeMs)
|
|
63
|
-
.slice(0, config.maxFilesPerScan);
|
|
64
|
-
result.skipped = candidates.length - changed.length;
|
|
65
|
-
for (const file of changed) {
|
|
66
|
-
if (!rateLimiter.canProceed()) {
|
|
67
|
-
process.stderr.write(`[nex-scan] Rate limited — stopping after ${result.ingested} files\n`);
|
|
68
|
-
result.skipped += changed.length - result.ingested - result.errors;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
let content = readFileSync(file.absolutePath, "utf-8");
|
|
73
|
-
// Truncate large files
|
|
74
|
-
if (content.length > config.maxFileSize) {
|
|
75
|
-
content = content.slice(0, config.maxFileSize) + "\n[...truncated]";
|
|
76
|
-
}
|
|
77
|
-
const context = `file-scan:${file.relativePath}`;
|
|
78
|
-
await client.ingest(content, context, 10_000);
|
|
79
|
-
markIngested(file.absolutePath, file.stat, context, manifest);
|
|
80
|
-
result.ingested++;
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
process.stderr.write(`[nex-scan] Failed to ingest ${file.relativePath}: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
84
|
-
result.errors++;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
writeManifest(manifest);
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=file-scanner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-scanner.js","sourceRoot":"","sources":["../../src/plugin/file-scanner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAe1F;;GAEG;AACH,SAAS,OAAO,CACd,GAAW,EACX,GAAW,EACX,MAAkB,EAClB,KAAa,EACb,OAAwB;IAExB,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS;QAAE,OAAO;IAErC,IAAI,OAAO,CAAC;IACZ,IAAI,CAAC;QACH,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,+CAA+C;IACzD,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAS;YACrD,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,MAAM,GAAG,GAAG,OA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AAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC1G,CAAC;YACF,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP client for the Nex Developer API.
|
|
3
|
-
* Adapted from openclaw-plugin — uses native fetch with timeout.
|
|
4
|
-
*/
|
|
5
|
-
export declare class NexAuthError extends Error {
|
|
6
|
-
constructor(message?: string);
|
|
7
|
-
}
|
|
8
|
-
export declare class NexRateLimitError extends Error {
|
|
9
|
-
retryAfterMs: number;
|
|
10
|
-
constructor(retryAfterMs?: number);
|
|
11
|
-
}
|
|
12
|
-
export declare class NexServerError extends Error {
|
|
13
|
-
status: number;
|
|
14
|
-
constructor(status: number, body?: string);
|
|
15
|
-
}
|
|
16
|
-
export interface RegisterResponse {
|
|
17
|
-
api_key: string;
|
|
18
|
-
workspace_id?: string | number;
|
|
19
|
-
workspace_slug?: string;
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
export interface IngestResponse {
|
|
23
|
-
artifact_id: string;
|
|
24
|
-
}
|
|
25
|
-
export interface EntityReference {
|
|
26
|
-
id?: number;
|
|
27
|
-
name: string;
|
|
28
|
-
type: string;
|
|
29
|
-
count?: number;
|
|
30
|
-
}
|
|
31
|
-
export interface AskResponse {
|
|
32
|
-
answer: string;
|
|
33
|
-
session_id?: string;
|
|
34
|
-
entity_references?: EntityReference[];
|
|
35
|
-
}
|
|
36
|
-
export declare class NexClient {
|
|
37
|
-
private apiKey;
|
|
38
|
-
private baseUrl;
|
|
39
|
-
constructor(apiKey: string, baseUrl: string);
|
|
40
|
-
private request;
|
|
41
|
-
/**
|
|
42
|
-
* Register a new account and get an API key.
|
|
43
|
-
* Does NOT require an existing API key — uses the public registration endpoint.
|
|
44
|
-
*/
|
|
45
|
-
static register(baseUrl: string, email: string, name?: string, companyName?: string): Promise<RegisterResponse>;
|
|
46
|
-
/** Ingest text content into the Nex knowledge graph. */
|
|
47
|
-
ingest(content: string, context?: string, timeoutMs?: number): Promise<IngestResponse>;
|
|
48
|
-
/** Ask a question against the Nex knowledge graph. */
|
|
49
|
-
ask(query: string, sessionId?: string, timeoutMs?: number): Promise<AskResponse>;
|
|
50
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP client for the Nex Developer API.
|
|
3
|
-
* Adapted from openclaw-plugin — uses native fetch with timeout.
|
|
4
|
-
*/
|
|
5
|
-
// --- Error types ---
|
|
6
|
-
export class NexAuthError extends Error {
|
|
7
|
-
constructor(message = "Invalid or missing API key") {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "NexAuthError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export class NexRateLimitError extends Error {
|
|
13
|
-
retryAfterMs;
|
|
14
|
-
constructor(retryAfterMs = 60_000) {
|
|
15
|
-
super(`Rate limited — retry after ${retryAfterMs}ms`);
|
|
16
|
-
this.name = "NexRateLimitError";
|
|
17
|
-
this.retryAfterMs = retryAfterMs;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export class NexServerError extends Error {
|
|
21
|
-
status;
|
|
22
|
-
constructor(status, body) {
|
|
23
|
-
super(`Nex API error ${status}${body ? `: ${body}` : ""}`);
|
|
24
|
-
this.name = "NexServerError";
|
|
25
|
-
this.status = status;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// --- Client ---
|
|
29
|
-
export class NexClient {
|
|
30
|
-
apiKey;
|
|
31
|
-
baseUrl;
|
|
32
|
-
constructor(apiKey, baseUrl) {
|
|
33
|
-
this.apiKey = apiKey;
|
|
34
|
-
this.baseUrl = baseUrl;
|
|
35
|
-
}
|
|
36
|
-
async request(method, path, body, timeoutMs = 10_000) {
|
|
37
|
-
const url = `${this.baseUrl}/api/developers${path}`;
|
|
38
|
-
const controller = new AbortController();
|
|
39
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
40
|
-
try {
|
|
41
|
-
const headers = {
|
|
42
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
43
|
-
};
|
|
44
|
-
if (body !== undefined) {
|
|
45
|
-
headers["Content-Type"] = "application/json";
|
|
46
|
-
}
|
|
47
|
-
const res = await fetch(url, {
|
|
48
|
-
method,
|
|
49
|
-
headers,
|
|
50
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
51
|
-
signal: controller.signal,
|
|
52
|
-
});
|
|
53
|
-
if (res.status === 401 || res.status === 403) {
|
|
54
|
-
throw new NexAuthError();
|
|
55
|
-
}
|
|
56
|
-
if (res.status === 429) {
|
|
57
|
-
const retryAfter = res.headers.get("retry-after");
|
|
58
|
-
const ms = retryAfter ? parseInt(retryAfter, 10) * 1000 : 60_000;
|
|
59
|
-
throw new NexRateLimitError(ms);
|
|
60
|
-
}
|
|
61
|
-
if (!res.ok) {
|
|
62
|
-
let errorBody;
|
|
63
|
-
try {
|
|
64
|
-
errorBody = await res.text();
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
// ignore
|
|
68
|
-
}
|
|
69
|
-
throw new NexServerError(res.status, errorBody);
|
|
70
|
-
}
|
|
71
|
-
const text = await res.text();
|
|
72
|
-
if (!text || !text.trim())
|
|
73
|
-
return {};
|
|
74
|
-
return JSON.parse(text);
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
clearTimeout(timer);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Register a new account and get an API key.
|
|
82
|
-
* Does NOT require an existing API key — uses the public registration endpoint.
|
|
83
|
-
*/
|
|
84
|
-
static async register(baseUrl, email, name, companyName) {
|
|
85
|
-
const url = `${baseUrl}/api/v1/agents/register`;
|
|
86
|
-
const body = { email, source: "claude-code" };
|
|
87
|
-
if (name)
|
|
88
|
-
body.name = name;
|
|
89
|
-
if (companyName)
|
|
90
|
-
body.company_name = companyName;
|
|
91
|
-
const controller = new AbortController();
|
|
92
|
-
const timer = setTimeout(() => controller.abort(), 30_000);
|
|
93
|
-
try {
|
|
94
|
-
const res = await fetch(url, {
|
|
95
|
-
method: "POST",
|
|
96
|
-
headers: { "Content-Type": "application/json" },
|
|
97
|
-
body: JSON.stringify(body),
|
|
98
|
-
signal: controller.signal,
|
|
99
|
-
});
|
|
100
|
-
if (!res.ok) {
|
|
101
|
-
let errorBody;
|
|
102
|
-
try {
|
|
103
|
-
errorBody = await res.text();
|
|
104
|
-
}
|
|
105
|
-
catch { /* ignore */ }
|
|
106
|
-
throw new NexServerError(res.status, errorBody);
|
|
107
|
-
}
|
|
108
|
-
return await res.json();
|
|
109
|
-
}
|
|
110
|
-
finally {
|
|
111
|
-
clearTimeout(timer);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/** Ingest text content into the Nex knowledge graph. */
|
|
115
|
-
async ingest(content, context, timeoutMs) {
|
|
116
|
-
const body = { content };
|
|
117
|
-
if (context)
|
|
118
|
-
body.context = context;
|
|
119
|
-
return this.request("POST", "/v1/context/text", body, timeoutMs ?? 60_000);
|
|
120
|
-
}
|
|
121
|
-
/** Ask a question against the Nex knowledge graph. */
|
|
122
|
-
async ask(query, sessionId, timeoutMs) {
|
|
123
|
-
const body = { query };
|
|
124
|
-
if (sessionId)
|
|
125
|
-
body.session_id = sessionId;
|
|
126
|
-
return this.request("POST", "/v1/context/ask", body, timeoutMs);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=nex-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nex-client.js","sourceRoot":"","sources":["../../src/plugin/nex-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sBAAsB;AAEtB,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,GAAG,4BAA4B;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AAC;YAClD,CAAC;YAED,OAAO,MAAM,GAAG,CAAC,IAAI,EAAsB,CAAC;QAC9C,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,OAAgB,EAAE,SAAkB;QAChE,MAAM,IAAI,GAA2B,EAAE,OAAO,EAAE,CAAC;QACjD,IAAI,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAiB,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,IAAI,MAAM,CAAC,CAAC;IAC7F,CAAC;IAED,sDAAsD;IACtD,KAAK,CAAC,GAAG,CAAC,KAAa,EAAE,SAAkB,EAAE,SAAkB;QAC7D,MAAM,IAAI,GAA4B,EAAE,KAAK,EAAE,CAAC;QAChD,IAAI,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAc,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC/E,CAAC;CACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File-based sliding window rate limiter.
|
|
3
|
-
* Designed for Nex /text endpoint (10 req/min).
|
|
4
|
-
*
|
|
5
|
-
* Since Claude Code hooks are short-lived processes (start, run, exit),
|
|
6
|
-
* in-memory state is lost between invocations. This implementation persists
|
|
7
|
-
* timestamps to a JSON file so rate limits are respected across invocations.
|
|
8
|
-
*/
|
|
9
|
-
export interface RateLimiterConfig {
|
|
10
|
-
maxRequests: number;
|
|
11
|
-
windowMs: number;
|
|
12
|
-
dataDir: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class RateLimiter {
|
|
15
|
-
private config;
|
|
16
|
-
private filePath;
|
|
17
|
-
constructor(config?: Partial<RateLimiterConfig>);
|
|
18
|
-
private readTimestamps;
|
|
19
|
-
private writeTimestamps;
|
|
20
|
-
/**
|
|
21
|
-
* Check if a request can proceed, and if so, record the timestamp.
|
|
22
|
-
* Returns true if the request is allowed, false if rate limited.
|
|
23
|
-
*/
|
|
24
|
-
canProceed(): boolean;
|
|
25
|
-
get pending(): number;
|
|
26
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File-based sliding window rate limiter.
|
|
3
|
-
* Designed for Nex /text endpoint (10 req/min).
|
|
4
|
-
*
|
|
5
|
-
* Since Claude Code hooks are short-lived processes (start, run, exit),
|
|
6
|
-
* in-memory state is lost between invocations. This implementation persists
|
|
7
|
-
* timestamps to a JSON file so rate limits are respected across invocations.
|
|
8
|
-
*/
|
|
9
|
-
import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
import { workspaceDataDir } from "./workspace-data-dir.js";
|
|
12
|
-
const DEFAULTS = {
|
|
13
|
-
maxRequests: 10,
|
|
14
|
-
windowMs: 60_000,
|
|
15
|
-
dataDir: workspaceDataDir(),
|
|
16
|
-
};
|
|
17
|
-
export class RateLimiter {
|
|
18
|
-
config;
|
|
19
|
-
filePath;
|
|
20
|
-
constructor(config) {
|
|
21
|
-
this.config = { ...DEFAULTS, ...config };
|
|
22
|
-
this.filePath = join(this.config.dataDir, "rate-limiter.json");
|
|
23
|
-
mkdirSync(this.config.dataDir, { recursive: true });
|
|
24
|
-
}
|
|
25
|
-
readTimestamps() {
|
|
26
|
-
try {
|
|
27
|
-
const raw = readFileSync(this.filePath, "utf-8");
|
|
28
|
-
const data = JSON.parse(raw);
|
|
29
|
-
if (Array.isArray(data))
|
|
30
|
-
return data;
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
writeTimestamps(timestamps) {
|
|
38
|
-
try {
|
|
39
|
-
writeFileSync(this.filePath, JSON.stringify(timestamps), "utf-8");
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
// Best-effort — if we can't write, proceed without rate limiting
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Check if a request can proceed, and if so, record the timestamp.
|
|
47
|
-
* Returns true if the request is allowed, false if rate limited.
|
|
48
|
-
*/
|
|
49
|
-
canProceed() {
|
|
50
|
-
const now = Date.now();
|
|
51
|
-
const timestamps = this.readTimestamps().filter((t) => now - t < this.config.windowMs);
|
|
52
|
-
if (timestamps.length >= this.config.maxRequests) {
|
|
53
|
-
// Write back pruned timestamps
|
|
54
|
-
this.writeTimestamps(timestamps);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
timestamps.push(now);
|
|
58
|
-
this.writeTimestamps(timestamps);
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
get pending() {
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=rate-limiter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limiter.js","sourceRoot":"","sources":["../../src/plugin/rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQ3D,MAAM,QAAQ,GAAsB;IAClC,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,gBAAgB,EAAE;CAC5B,CAAC;AAEF,MAAM,OAAO,WAAW;IACd,MAAM,CAAoB;IAC1B,QAAQ,CAAS;IAEzB,YAAY,MAAmC;QAC7C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE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IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO;QACT,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface PendingRecallEntry {
|
|
2
|
-
promptHash: string;
|
|
3
|
-
createdAt: number;
|
|
4
|
-
}
|
|
5
|
-
export interface ReadyRecallEntry {
|
|
6
|
-
promptHash: string;
|
|
7
|
-
context: string;
|
|
8
|
-
createdAt: number;
|
|
9
|
-
deliveredAt?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface RecallSessionEntry {
|
|
12
|
-
pending?: PendingRecallEntry;
|
|
13
|
-
ready?: ReadyRecallEntry;
|
|
14
|
-
}
|
|
15
|
-
export interface RecallCacheConfig {
|
|
16
|
-
maxSize: number;
|
|
17
|
-
dataDir: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function hashPrompt(prompt: string): string;
|
|
20
|
-
export declare class RecallCache {
|
|
21
|
-
private filePath;
|
|
22
|
-
private maxSize;
|
|
23
|
-
constructor(config?: Partial<RecallCacheConfig>);
|
|
24
|
-
private readStore;
|
|
25
|
-
private writeStore;
|
|
26
|
-
private trimStore;
|
|
27
|
-
private pruneEmptyEntry;
|
|
28
|
-
get(sessionKey: string): RecallSessionEntry | undefined;
|
|
29
|
-
list(): Record<string, RecallSessionEntry>;
|
|
30
|
-
setPending(sessionKey: string, promptHash: string, now?: number): void;
|
|
31
|
-
hasPending(sessionKey: string, promptHash: string, maxAgeMs: number, now?: number): boolean;
|
|
32
|
-
clearPending(sessionKey: string, promptHash?: string): boolean;
|
|
33
|
-
setReady(sessionKey: string, ready: {
|
|
34
|
-
promptHash: string;
|
|
35
|
-
context: string;
|
|
36
|
-
}, now?: number): void;
|
|
37
|
-
getInjectable(sessionKey: string, maxAgeMs: number, now?: number): ReadyRecallEntry | undefined;
|
|
38
|
-
markReadyDelivered(sessionKey: string, now?: number): boolean;
|
|
39
|
-
delete(sessionKey: string): boolean;
|
|
40
|
-
clear(): void;
|
|
41
|
-
}
|