spidersan 0.9.0 → 0.20.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/CHANGELOG.md +187 -0
- package/README.md +39 -280
- package/package.json +9 -13
- package/dist/bin/spidersan.d.ts +0 -9
- package/dist/bin/spidersan.d.ts.map +0 -1
- package/dist/bin/spidersan.js +0 -117
- package/dist/bin/spidersan.js.map +0 -1
- package/dist/commands/abandon.d.ts +0 -8
- package/dist/commands/abandon.d.ts.map +0 -1
- package/dist/commands/abandon.js +0 -43
- package/dist/commands/abandon.js.map +0 -1
- package/dist/commands/activate.d.ts +0 -9
- package/dist/commands/activate.d.ts.map +0 -1
- package/dist/commands/activate.js +0 -45
- package/dist/commands/activate.js.map +0 -1
- package/dist/commands/active-windows.d.ts +0 -16
- package/dist/commands/active-windows.d.ts.map +0 -1
- package/dist/commands/active-windows.js +0 -373
- package/dist/commands/active-windows.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -15
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -498
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/audit-mark.d.ts +0 -12
- package/dist/commands/audit-mark.d.ts.map +0 -1
- package/dist/commands/audit-mark.js +0 -204
- package/dist/commands/audit-mark.js.map +0 -1
- package/dist/commands/auto.d.ts +0 -8
- package/dist/commands/auto.d.ts.map +0 -1
- package/dist/commands/auto.js +0 -207
- package/dist/commands/auto.js.map +0 -1
- package/dist/commands/bot.d.ts +0 -16
- package/dist/commands/bot.d.ts.map +0 -1
- package/dist/commands/bot.js +0 -398
- package/dist/commands/bot.js.map +0 -1
- package/dist/commands/cleanup.d.ts +0 -8
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js +0 -36
- package/dist/commands/cleanup.js.map +0 -1
- package/dist/commands/close.d.ts +0 -9
- package/dist/commands/close.d.ts.map +0 -1
- package/dist/commands/close.js +0 -129
- package/dist/commands/close.js.map +0 -1
- package/dist/commands/collab-sync.d.ts +0 -14
- package/dist/commands/collab-sync.d.ts.map +0 -1
- package/dist/commands/collab-sync.js +0 -264
- package/dist/commands/collab-sync.js.map +0 -1
- package/dist/commands/collab.d.ts +0 -6
- package/dist/commands/collab.d.ts.map +0 -1
- package/dist/commands/collab.js +0 -103
- package/dist/commands/collab.js.map +0 -1
- package/dist/commands/completions.d.ts +0 -8
- package/dist/commands/completions.d.ts.map +0 -1
- package/dist/commands/completions.js +0 -83
- package/dist/commands/completions.js.map +0 -1
- package/dist/commands/config.d.ts +0 -15
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -337
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/conflicts.d.ts +0 -12
- package/dist/commands/conflicts.d.ts.map +0 -1
- package/dist/commands/conflicts.js +0 -581
- package/dist/commands/conflicts.js.map +0 -1
- package/dist/commands/context.d.ts +0 -8
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js +0 -104
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/cross-conflicts.d.ts +0 -17
- package/dist/commands/cross-conflicts.d.ts.map +0 -1
- package/dist/commands/cross-conflicts.js +0 -268
- package/dist/commands/cross-conflicts.js.map +0 -1
- package/dist/commands/daily.d.ts +0 -7
- package/dist/commands/daily.d.ts.map +0 -1
- package/dist/commands/daily.js +0 -171
- package/dist/commands/daily.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -22
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -401
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/demo.d.ts +0 -3
- package/dist/commands/demo.d.ts.map +0 -1
- package/dist/commands/demo.js +0 -118
- package/dist/commands/demo.js.map +0 -1
- package/dist/commands/depends.d.ts +0 -8
- package/dist/commands/depends.d.ts.map +0 -1
- package/dist/commands/depends.js +0 -36
- package/dist/commands/depends.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -30
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -540
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/ecosystem-loader.d.ts +0 -14
- package/dist/commands/ecosystem-loader.d.ts.map +0 -1
- package/dist/commands/ecosystem-loader.js +0 -90
- package/dist/commands/ecosystem-loader.js.map +0 -1
- package/dist/commands/fleet-status.d.ts +0 -14
- package/dist/commands/fleet-status.d.ts.map +0 -1
- package/dist/commands/fleet-status.js +0 -127
- package/dist/commands/fleet-status.js.map +0 -1
- package/dist/commands/git-watch.d.ts +0 -24
- package/dist/commands/git-watch.d.ts.map +0 -1
- package/dist/commands/git-watch.js +0 -84
- package/dist/commands/git-watch.js.map +0 -1
- package/dist/commands/github-sync.d.ts +0 -9
- package/dist/commands/github-sync.d.ts.map +0 -1
- package/dist/commands/github-sync.js +0 -180
- package/dist/commands/github-sync.js.map +0 -1
- package/dist/commands/inbox.d.ts +0 -3
- package/dist/commands/inbox.d.ts.map +0 -1
- package/dist/commands/inbox.js +0 -120
- package/dist/commands/inbox.js.map +0 -1
- package/dist/commands/index.d.ts +0 -36
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -44
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -23
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/intent-scan.d.ts +0 -17
- package/dist/commands/intent-scan.d.ts.map +0 -1
- package/dist/commands/intent-scan.js +0 -336
- package/dist/commands/intent-scan.js.map +0 -1
- package/dist/commands/key-import.d.ts +0 -3
- package/dist/commands/key-import.d.ts.map +0 -1
- package/dist/commands/key-import.js +0 -54
- package/dist/commands/key-import.js.map +0 -1
- package/dist/commands/keygen.d.ts +0 -3
- package/dist/commands/keygen.d.ts.map +0 -1
- package/dist/commands/keygen.js +0 -53
- package/dist/commands/keygen.js.map +0 -1
- package/dist/commands/keys.d.ts +0 -3
- package/dist/commands/keys.d.ts.map +0 -1
- package/dist/commands/keys.js +0 -56
- package/dist/commands/keys.js.map +0 -1
- package/dist/commands/list.d.ts +0 -3
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -45
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/lock.d.ts +0 -11
- package/dist/commands/lock.d.ts.map +0 -1
- package/dist/commands/lock.js +0 -257
- package/dist/commands/lock.js.map +0 -1
- package/dist/commands/log.d.ts +0 -7
- package/dist/commands/log.d.ts.map +0 -1
- package/dist/commands/log.js +0 -110
- package/dist/commands/log.js.map +0 -1
- package/dist/commands/mcp-health.d.ts +0 -3
- package/dist/commands/mcp-health.d.ts.map +0 -1
- package/dist/commands/mcp-health.js +0 -305
- package/dist/commands/mcp-health.js.map +0 -1
- package/dist/commands/mcp-restart.d.ts +0 -3
- package/dist/commands/mcp-restart.d.ts.map +0 -1
- package/dist/commands/mcp-restart.js +0 -176
- package/dist/commands/mcp-restart.js.map +0 -1
- package/dist/commands/merge-order.d.ts +0 -9
- package/dist/commands/merge-order.d.ts.map +0 -1
- package/dist/commands/merge-order.js +0 -96
- package/dist/commands/merge-order.js.map +0 -1
- package/dist/commands/merged.d.ts +0 -8
- package/dist/commands/merged.d.ts.map +0 -1
- package/dist/commands/merged.js +0 -33
- package/dist/commands/merged.js.map +0 -1
- package/dist/commands/monitor.d.ts +0 -3
- package/dist/commands/monitor.d.ts.map +0 -1
- package/dist/commands/monitor.js +0 -153
- package/dist/commands/monitor.js.map +0 -1
- package/dist/commands/msg-read.d.ts +0 -3
- package/dist/commands/msg-read.d.ts.map +0 -1
- package/dist/commands/msg-read.js +0 -95
- package/dist/commands/msg-read.js.map +0 -1
- package/dist/commands/pulse.d.ts +0 -13
- package/dist/commands/pulse.d.ts.map +0 -1
- package/dist/commands/pulse.js +0 -245
- package/dist/commands/pulse.js.map +0 -1
- package/dist/commands/queen.d.ts +0 -25
- package/dist/commands/queen.d.ts.map +0 -1
- package/dist/commands/queen.js +0 -326
- package/dist/commands/queen.js.map +0 -1
- package/dist/commands/radar.d.ts +0 -3
- package/dist/commands/radar.d.ts.map +0 -1
- package/dist/commands/radar.js +0 -147
- package/dist/commands/radar.js.map +0 -1
- package/dist/commands/ready-check.d.ts +0 -11
- package/dist/commands/ready-check.d.ts.map +0 -1
- package/dist/commands/ready-check.js +0 -147
- package/dist/commands/ready-check.js.map +0 -1
- package/dist/commands/rebase-helper.d.ts +0 -3
- package/dist/commands/rebase-helper.d.ts.map +0 -1
- package/dist/commands/rebase-helper.js +0 -52
- package/dist/commands/rebase-helper.js.map +0 -1
- package/dist/commands/register.d.ts +0 -5
- package/dist/commands/register.d.ts.map +0 -1
- package/dist/commands/register.js +0 -156
- package/dist/commands/register.js.map +0 -1
- package/dist/commands/registry-sync.d.ts +0 -9
- package/dist/commands/registry-sync.d.ts.map +0 -1
- package/dist/commands/registry-sync.js +0 -163
- package/dist/commands/registry-sync.js.map +0 -1
- package/dist/commands/rescue.d.ts +0 -11
- package/dist/commands/rescue.d.ts.map +0 -1
- package/dist/commands/rescue.js +0 -147
- package/dist/commands/rescue.js.map +0 -1
- package/dist/commands/semantic.d.ts +0 -3
- package/dist/commands/semantic.d.ts.map +0 -1
- package/dist/commands/semantic.js +0 -62
- package/dist/commands/semantic.js.map +0 -1
- package/dist/commands/send.d.ts +0 -3
- package/dist/commands/send.d.ts.map +0 -1
- package/dist/commands/send.js +0 -121
- package/dist/commands/send.js.map +0 -1
- package/dist/commands/stale.d.ts +0 -17
- package/dist/commands/stale.d.ts.map +0 -1
- package/dist/commands/stale.js +0 -131
- package/dist/commands/stale.js.map +0 -1
- package/dist/commands/status.d.ts +0 -9
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -41
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync-advisor.d.ts +0 -14
- package/dist/commands/sync-advisor.d.ts.map +0 -1
- package/dist/commands/sync-advisor.js +0 -110
- package/dist/commands/sync-advisor.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -8
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -60
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/tension.d.ts +0 -12
- package/dist/commands/tension.d.ts.map +0 -1
- package/dist/commands/tension.js +0 -262
- package/dist/commands/tension.js.map +0 -1
- package/dist/commands/torrent.d.ts +0 -9
- package/dist/commands/torrent.d.ts.map +0 -1
- package/dist/commands/torrent.js +0 -470
- package/dist/commands/torrent.js.map +0 -1
- package/dist/commands/tui.d.ts +0 -8
- package/dist/commands/tui.d.ts.map +0 -1
- package/dist/commands/tui.js +0 -15
- package/dist/commands/tui.js.map +0 -1
- package/dist/commands/wake.d.ts +0 -9
- package/dist/commands/wake.d.ts.map +0 -1
- package/dist/commands/wake.js +0 -188
- package/dist/commands/wake.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -3
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -428
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/welcome.d.ts +0 -8
- package/dist/commands/welcome.d.ts.map +0 -1
- package/dist/commands/welcome.js +0 -85
- package/dist/commands/welcome.js.map +0 -1
- package/dist/commands/who-owns.d.ts +0 -3
- package/dist/commands/who-owns.d.ts.map +0 -1
- package/dist/commands/who-owns.js +0 -68
- package/dist/commands/who-owns.js.map +0 -1
- package/dist/commands/who-touched.d.ts +0 -9
- package/dist/commands/who-touched.d.ts.map +0 -1
- package/dist/commands/who-touched.js +0 -198
- package/dist/commands/who-touched.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/lib/activity.d.ts +0 -53
- package/dist/lib/activity.d.ts.map +0 -1
- package/dist/lib/activity.js +0 -267
- package/dist/lib/activity.js.map +0 -1
- package/dist/lib/agent-errors.d.ts +0 -41
- package/dist/lib/agent-errors.d.ts.map +0 -1
- package/dist/lib/agent-errors.js +0 -145
- package/dist/lib/agent-errors.js.map +0 -1
- package/dist/lib/ai/context-builder.d.ts +0 -16
- package/dist/lib/ai/context-builder.d.ts.map +0 -1
- package/dist/lib/ai/context-builder.js +0 -216
- package/dist/lib/ai/context-builder.js.map +0 -1
- package/dist/lib/ai/event-handler.d.ts +0 -21
- package/dist/lib/ai/event-handler.d.ts.map +0 -1
- package/dist/lib/ai/event-handler.js +0 -98
- package/dist/lib/ai/event-handler.js.map +0 -1
- package/dist/lib/ai/index.d.ts +0 -13
- package/dist/lib/ai/index.d.ts.map +0 -1
- package/dist/lib/ai/index.js +0 -11
- package/dist/lib/ai/index.js.map +0 -1
- package/dist/lib/ai/llm-client.d.ts +0 -37
- package/dist/lib/ai/llm-client.d.ts.map +0 -1
- package/dist/lib/ai/llm-client.js +0 -225
- package/dist/lib/ai/llm-client.js.map +0 -1
- package/dist/lib/ai/reasoner.d.ts +0 -11
- package/dist/lib/ai/reasoner.d.ts.map +0 -1
- package/dist/lib/ai/reasoner.js +0 -246
- package/dist/lib/ai/reasoner.js.map +0 -1
- package/dist/lib/ai/setup.d.ts +0 -40
- package/dist/lib/ai/setup.d.ts.map +0 -1
- package/dist/lib/ai/setup.js +0 -154
- package/dist/lib/ai/setup.js.map +0 -1
- package/dist/lib/ai/types.d.ts +0 -135
- package/dist/lib/ai/types.d.ts.map +0 -1
- package/dist/lib/ai/types.js +0 -39
- package/dist/lib/ai/types.js.map +0 -1
- package/dist/lib/ast.d.ts +0 -36
- package/dist/lib/ast.d.ts.map +0 -1
- package/dist/lib/ast.js +0 -135
- package/dist/lib/ast.js.map +0 -1
- package/dist/lib/colony-subscriber.d.ts +0 -56
- package/dist/lib/colony-subscriber.d.ts.map +0 -1
- package/dist/lib/colony-subscriber.js +0 -265
- package/dist/lib/colony-subscriber.js.map +0 -1
- package/dist/lib/config.d.ts +0 -62
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -230
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/conflict-analyzer.d.ts +0 -33
- package/dist/lib/conflict-analyzer.d.ts.map +0 -1
- package/dist/lib/conflict-analyzer.js +0 -114
- package/dist/lib/conflict-analyzer.js.map +0 -1
- package/dist/lib/conflict-renderer.d.ts +0 -7
- package/dist/lib/conflict-renderer.d.ts.map +0 -1
- package/dist/lib/conflict-renderer.js +0 -162
- package/dist/lib/conflict-renderer.js.map +0 -1
- package/dist/lib/conflict-tier.d.ts +0 -20
- package/dist/lib/conflict-tier.d.ts.map +0 -1
- package/dist/lib/conflict-tier.js +0 -49
- package/dist/lib/conflict-tier.js.map +0 -1
- package/dist/lib/crdt.d.ts +0 -83
- package/dist/lib/crdt.d.ts.map +0 -1
- package/dist/lib/crdt.js +0 -160
- package/dist/lib/crdt.js.map +0 -1
- package/dist/lib/crypto.d.ts +0 -71
- package/dist/lib/crypto.d.ts.map +0 -1
- package/dist/lib/crypto.js +0 -176
- package/dist/lib/crypto.js.map +0 -1
- package/dist/lib/daily-bridge.d.ts +0 -41
- package/dist/lib/daily-bridge.d.ts.map +0 -1
- package/dist/lib/daily-bridge.js +0 -186
- package/dist/lib/daily-bridge.js.map +0 -1
- package/dist/lib/errors.d.ts +0 -35
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js +0 -71
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/git-events-subscriber.d.ts +0 -59
- package/dist/lib/git-events-subscriber.d.ts.map +0 -1
- package/dist/lib/git-events-subscriber.js +0 -779
- package/dist/lib/git-events-subscriber.js.map +0 -1
- package/dist/lib/git.d.ts +0 -15
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js +0 -180
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/github.d.ts +0 -83
- package/dist/lib/github.d.ts.map +0 -1
- package/dist/lib/github.js +0 -211
- package/dist/lib/github.js.map +0 -1
- package/dist/lib/graph.d.ts +0 -23
- package/dist/lib/graph.d.ts.map +0 -1
- package/dist/lib/graph.js +0 -134
- package/dist/lib/graph.js.map +0 -1
- package/dist/lib/hub.d.ts +0 -31
- package/dist/lib/hub.d.ts.map +0 -1
- package/dist/lib/hub.js +0 -92
- package/dist/lib/hub.js.map +0 -1
- package/dist/lib/license.d.ts +0 -61
- package/dist/lib/license.d.ts.map +0 -1
- package/dist/lib/license.js +0 -171
- package/dist/lib/license.js.map +0 -1
- package/dist/lib/regex-utils.d.ts +0 -6
- package/dist/lib/regex-utils.d.ts.map +0 -1
- package/dist/lib/regex-utils.js +0 -24
- package/dist/lib/regex-utils.js.map +0 -1
- package/dist/lib/remote-drift.d.ts +0 -60
- package/dist/lib/remote-drift.d.ts.map +0 -1
- package/dist/lib/remote-drift.js +0 -225
- package/dist/lib/remote-drift.js.map +0 -1
- package/dist/lib/repo-scanner.d.ts +0 -32
- package/dist/lib/repo-scanner.d.ts.map +0 -1
- package/dist/lib/repo-scanner.js +0 -160
- package/dist/lib/repo-scanner.js.map +0 -1
- package/dist/lib/salvage-analyzer.d.ts +0 -29
- package/dist/lib/salvage-analyzer.d.ts.map +0 -1
- package/dist/lib/salvage-analyzer.js +0 -121
- package/dist/lib/salvage-analyzer.js.map +0 -1
- package/dist/lib/security.d.ts +0 -77
- package/dist/lib/security.d.ts.map +0 -1
- package/dist/lib/security.js +0 -190
- package/dist/lib/security.js.map +0 -1
- package/dist/lib/session-logger.d.ts +0 -54
- package/dist/lib/session-logger.d.ts.map +0 -1
- package/dist/lib/session-logger.js +0 -136
- package/dist/lib/session-logger.js.map +0 -1
- package/dist/lib/symbol-extractor.d.ts +0 -41
- package/dist/lib/symbol-extractor.d.ts.map +0 -1
- package/dist/lib/symbol-extractor.js +0 -78
- package/dist/lib/symbol-extractor.js.map +0 -1
- package/dist/lib/update-check.d.ts +0 -11
- package/dist/lib/update-check.d.ts.map +0 -1
- package/dist/lib/update-check.js +0 -113
- package/dist/lib/update-check.js.map +0 -1
- package/dist/storage/adapter.d.ts +0 -62
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js +0 -8
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/branch-registry-store.d.ts +0 -13
- package/dist/storage/branch-registry-store.d.ts.map +0 -1
- package/dist/storage/branch-registry-store.js +0 -2
- package/dist/storage/branch-registry-store.js.map +0 -1
- package/dist/storage/factory.d.ts +0 -10
- package/dist/storage/factory.d.ts.map +0 -1
- package/dist/storage/factory.js +0 -38
- package/dist/storage/factory.js.map +0 -1
- package/dist/storage/git-messages.d.ts +0 -53
- package/dist/storage/git-messages.d.ts.map +0 -1
- package/dist/storage/git-messages.js +0 -376
- package/dist/storage/git-messages.js.map +0 -1
- package/dist/storage/index.d.ts +0 -10
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -11
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/json-branch-registry-store.d.ts +0 -19
- package/dist/storage/json-branch-registry-store.d.ts.map +0 -1
- package/dist/storage/json-branch-registry-store.js +0 -112
- package/dist/storage/json-branch-registry-store.js.map +0 -1
- package/dist/storage/local-messages.d.ts +0 -37
- package/dist/storage/local-messages.d.ts.map +0 -1
- package/dist/storage/local-messages.js +0 -151
- package/dist/storage/local-messages.js.map +0 -1
- package/dist/storage/local.d.ts +0 -20
- package/dist/storage/local.d.ts.map +0 -1
- package/dist/storage/local.js +0 -40
- package/dist/storage/local.js.map +0 -1
- package/dist/storage/memory-branch-registry-store.d.ts +0 -16
- package/dist/storage/memory-branch-registry-store.d.ts.map +0 -1
- package/dist/storage/memory-branch-registry-store.js +0 -65
- package/dist/storage/memory-branch-registry-store.js.map +0 -1
- package/dist/storage/message-adapter.d.ts +0 -86
- package/dist/storage/message-adapter.d.ts.map +0 -1
- package/dist/storage/message-adapter.js +0 -28
- package/dist/storage/message-adapter.js.map +0 -1
- package/dist/storage/message-factory.d.ts +0 -36
- package/dist/storage/message-factory.d.ts.map +0 -1
- package/dist/storage/message-factory.js +0 -99
- package/dist/storage/message-factory.js.map +0 -1
- package/dist/storage/mycmail-adapter.d.ts +0 -38
- package/dist/storage/mycmail-adapter.d.ts.map +0 -1
- package/dist/storage/mycmail-adapter.js +0 -300
- package/dist/storage/mycmail-adapter.js.map +0 -1
- package/dist/storage/supabase-registry-sync-client-impl.d.ts +0 -46
- package/dist/storage/supabase-registry-sync-client-impl.d.ts.map +0 -1
- package/dist/storage/supabase-registry-sync-client-impl.js +0 -322
- package/dist/storage/supabase-registry-sync-client-impl.js.map +0 -1
- package/dist/storage/supabase-registry-sync-client.d.ts +0 -9
- package/dist/storage/supabase-registry-sync-client.d.ts.map +0 -1
- package/dist/storage/supabase-registry-sync-client.js +0 -2
- package/dist/storage/supabase-registry-sync-client.js.map +0 -1
- package/dist/storage/supabase.d.ts +0 -34
- package/dist/storage/supabase.d.ts.map +0 -1
- package/dist/storage/supabase.js +0 -74
- package/dist/storage/supabase.js.map +0 -1
- package/dist/tui/dashboard.d.ts +0 -35
- package/dist/tui/dashboard.d.ts.map +0 -1
- package/dist/tui/dashboard.js +0 -199
- package/dist/tui/dashboard.js.map +0 -1
- package/dist/tui/screen.d.ts +0 -14
- package/dist/tui/screen.d.ts.map +0 -1
- package/dist/tui/screen.js +0 -138
- package/dist/tui/screen.js.map +0 -1
- package/dist/types/cloud.d.ts +0 -101
- package/dist/types/cloud.d.ts.map +0 -1
- package/dist/types/cloud.js +0 -13
- package/dist/types/cloud.js.map +0 -1
package/dist/lib/security.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate agent ID (e.g., "sherlocksan", "watsan-1", "agent_01")
|
|
3
|
-
* @throws Error if invalid
|
|
4
|
-
*/
|
|
5
|
-
export declare function validateAgentId(agentId: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* Validate git branch name
|
|
8
|
-
* @throws Error if invalid
|
|
9
|
-
*/
|
|
10
|
-
export declare function validateBranchName(branch: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Validate PR number
|
|
13
|
-
* @throws Error if invalid
|
|
14
|
-
*/
|
|
15
|
-
export declare function validatePRNumber(prNumber: number | string): number;
|
|
16
|
-
/**
|
|
17
|
-
* Validate task ID (for torrent/task commands)
|
|
18
|
-
* @throws Error if invalid
|
|
19
|
-
*/
|
|
20
|
-
export declare function validateTaskId(taskId: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Validate file path (basic safety check)
|
|
23
|
-
* @throws Error if invalid
|
|
24
|
-
*/
|
|
25
|
-
export declare function validateFilePath(filePath: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Sanitize free-form text by removing shell metacharacters
|
|
28
|
-
* Use for message bodies, subjects, etc.
|
|
29
|
-
*/
|
|
30
|
-
export declare function sanitizeText(text: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Sanitize an array of file paths
|
|
33
|
-
*/
|
|
34
|
-
export declare function sanitizeFilePaths(files: string[]): string[];
|
|
35
|
-
/**
|
|
36
|
-
* Escape a string for safe use in git commands (minimal escaping)
|
|
37
|
-
*/
|
|
38
|
-
export declare function escapeGitArg(arg: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Escapes a string so it can be safely used in a shell script.
|
|
41
|
-
* Replaces single quotes with '\'' and wraps the result in single quotes.
|
|
42
|
-
* Prevents command injection when generating bash scripts.
|
|
43
|
-
*/
|
|
44
|
-
export declare function escapeShellString(str: string): string;
|
|
45
|
-
export declare const patterns: {
|
|
46
|
-
VALID_AGENT_ID: RegExp;
|
|
47
|
-
VALID_BRANCH_NAME: RegExp;
|
|
48
|
-
VALID_TASK_ID: RegExp;
|
|
49
|
-
VALID_FILE_PATH: RegExp;
|
|
50
|
-
SHELL_METACHARACTERS: RegExp;
|
|
51
|
-
};
|
|
52
|
-
export declare const sanitizeAgentId: typeof validateAgentId;
|
|
53
|
-
export declare const sanitizeBranchName: typeof validateBranchName;
|
|
54
|
-
export declare const sanitizeFilePath: typeof validateFilePath;
|
|
55
|
-
export declare const sanitizePRNumber: typeof validatePRNumber;
|
|
56
|
-
export declare function isValidMessageId(messageId: string): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Validate that a file path resolves to a location inside the current repository.
|
|
59
|
-
* Prevents arbitrary file read/write vulnerabilities via path traversal or absolute paths.
|
|
60
|
-
*
|
|
61
|
-
* @param filePath The path to validate
|
|
62
|
-
* @param rootDir The root directory (defaults to CWD)
|
|
63
|
-
* @returns The resolved absolute path if valid
|
|
64
|
-
* @throws Error if path is outside rootDir
|
|
65
|
-
*/
|
|
66
|
-
export declare function validateRepoPath(filePath: string, rootDir?: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Escape text for blessed TUI to prevent markup injection.
|
|
69
|
-
* Replaces '{' with '{open}' and '}' with '{close}'.
|
|
70
|
-
*/
|
|
71
|
-
export declare function escapeBlessed(text: string): string;
|
|
72
|
-
/**
|
|
73
|
-
* Safely resolves the CLI entry point path.
|
|
74
|
-
* Replaces insecure usage of process.argv[1] which can be manipulated.
|
|
75
|
-
*/
|
|
76
|
-
export declare function getCLIPath(): string;
|
|
77
|
-
//# sourceMappingURL=security.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/lib/security.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAMlE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYzD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAU3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrD;AAGD,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAA;AAGD,eAAO,MAAM,eAAe,wBAAkB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,2BAAqB,CAAC;AACrD,eAAO,MAAM,gBAAgB,yBAAmB,CAAC;AACjD,eAAO,MAAM,gBAAgB,yBAAmB,CAAC;AAIjD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,CAgB1F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAKnC"}
|
package/dist/lib/security.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { resolve, relative, isAbsolute, dirname } from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
/**
|
|
4
|
-
* Spidersan Security Utilities
|
|
5
|
-
*
|
|
6
|
-
* Input validation and sanitization for shell command safety.
|
|
7
|
-
* Prevents command injection attacks via agent IDs, branch names, etc.
|
|
8
|
-
*
|
|
9
|
-
* @module security
|
|
10
|
-
*/
|
|
11
|
-
// Validation patterns
|
|
12
|
-
const VALID_AGENT_ID = /^[a-z0-9][a-z0-9_-]{0,30}$/i;
|
|
13
|
-
const VALID_BRANCH_NAME = /^[a-zA-Z0-9][a-zA-Z0-9/_.-]{0,99}$/;
|
|
14
|
-
const VALID_TASK_ID = /^[a-z0-9][a-z0-9_-]{0,50}$/i;
|
|
15
|
-
// Allow spaces in file paths
|
|
16
|
-
const VALID_FILE_PATH = /^[./a-zA-Z0-9][a-zA-Z0-9/_.@\- ]{0,200}$/;
|
|
17
|
-
// Shell metacharacters to remove from text
|
|
18
|
-
const SHELL_METACHARACTERS = /[`$(){}[\]|;&<>\\]/g;
|
|
19
|
-
/**
|
|
20
|
-
* Validate agent ID (e.g., "sherlocksan", "watsan-1", "agent_01")
|
|
21
|
-
* @throws Error if invalid
|
|
22
|
-
*/
|
|
23
|
-
export function validateAgentId(agentId) {
|
|
24
|
-
if (!agentId || typeof agentId !== 'string') {
|
|
25
|
-
throw new Error('Agent ID is required');
|
|
26
|
-
}
|
|
27
|
-
if (!VALID_AGENT_ID.test(agentId)) {
|
|
28
|
-
throw new Error(`Invalid agent ID: "${agentId.slice(0, 20)}..." (must be alphanumeric with - or _)`);
|
|
29
|
-
}
|
|
30
|
-
return agentId;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Validate git branch name
|
|
34
|
-
* @throws Error if invalid
|
|
35
|
-
*/
|
|
36
|
-
export function validateBranchName(branch) {
|
|
37
|
-
if (!branch || typeof branch !== 'string') {
|
|
38
|
-
throw new Error('Branch name is required');
|
|
39
|
-
}
|
|
40
|
-
if (!VALID_BRANCH_NAME.test(branch)) {
|
|
41
|
-
throw new Error(`Invalid branch name: "${branch.slice(0, 20)}..."`);
|
|
42
|
-
}
|
|
43
|
-
return branch;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Validate PR number
|
|
47
|
-
* @throws Error if invalid
|
|
48
|
-
*/
|
|
49
|
-
export function validatePRNumber(prNumber) {
|
|
50
|
-
const num = typeof prNumber === 'string' ? parseInt(prNumber, 10) : prNumber;
|
|
51
|
-
if (!Number.isInteger(num) || num <= 0) {
|
|
52
|
-
throw new Error(`Invalid PR number: ${prNumber}`);
|
|
53
|
-
}
|
|
54
|
-
return num;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Validate task ID (for torrent/task commands)
|
|
58
|
-
* @throws Error if invalid
|
|
59
|
-
*/
|
|
60
|
-
export function validateTaskId(taskId) {
|
|
61
|
-
if (!taskId || typeof taskId !== 'string') {
|
|
62
|
-
throw new Error('Task ID is required');
|
|
63
|
-
}
|
|
64
|
-
if (!VALID_TASK_ID.test(taskId)) {
|
|
65
|
-
throw new Error(`Invalid task ID: "${taskId.slice(0, 20)}..." (must be alphanumeric with - or _)`);
|
|
66
|
-
}
|
|
67
|
-
return taskId;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Validate file path (basic safety check)
|
|
71
|
-
* @throws Error if invalid
|
|
72
|
-
*/
|
|
73
|
-
export function validateFilePath(filePath) {
|
|
74
|
-
if (!filePath || typeof filePath !== 'string') {
|
|
75
|
-
throw new Error('File path is required');
|
|
76
|
-
}
|
|
77
|
-
// Block path traversal
|
|
78
|
-
if (filePath.includes('..')) {
|
|
79
|
-
throw new Error('Path traversal not allowed');
|
|
80
|
-
}
|
|
81
|
-
if (!VALID_FILE_PATH.test(filePath)) {
|
|
82
|
-
throw new Error(`Invalid file path: "${filePath.slice(0, 20)}..."`);
|
|
83
|
-
}
|
|
84
|
-
return filePath;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Sanitize free-form text by removing shell metacharacters
|
|
88
|
-
* Use for message bodies, subjects, etc.
|
|
89
|
-
*/
|
|
90
|
-
export function sanitizeText(text) {
|
|
91
|
-
if (!text || typeof text !== 'string') {
|
|
92
|
-
return '';
|
|
93
|
-
}
|
|
94
|
-
return text.replace(SHELL_METACHARACTERS, '');
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Sanitize an array of file paths
|
|
98
|
-
*/
|
|
99
|
-
export function sanitizeFilePaths(files) {
|
|
100
|
-
return files.filter(f => {
|
|
101
|
-
try {
|
|
102
|
-
validateFilePath(f);
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
console.warn(`⚠️ Skipping invalid file path: ${f.slice(0, 30)}...`);
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Escape a string for safe use in git commands (minimal escaping)
|
|
113
|
-
*/
|
|
114
|
-
export function escapeGitArg(arg) {
|
|
115
|
-
// For use with execFileSync where no shell is invoked
|
|
116
|
-
// Just basic validation, no escaping needed
|
|
117
|
-
return arg;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Escapes a string so it can be safely used in a shell script.
|
|
121
|
-
* Replaces single quotes with '\'' and wraps the result in single quotes.
|
|
122
|
-
* Prevents command injection when generating bash scripts.
|
|
123
|
-
*/
|
|
124
|
-
export function escapeShellString(str) {
|
|
125
|
-
if (str === null || str === undefined)
|
|
126
|
-
return "''";
|
|
127
|
-
return `'${String(str).replace(/'/g, "'\\''")}'`;
|
|
128
|
-
}
|
|
129
|
-
// Export validation patterns for testing
|
|
130
|
-
export const patterns = {
|
|
131
|
-
VALID_AGENT_ID,
|
|
132
|
-
VALID_BRANCH_NAME,
|
|
133
|
-
VALID_TASK_ID,
|
|
134
|
-
VALID_FILE_PATH,
|
|
135
|
-
SHELL_METACHARACTERS,
|
|
136
|
-
};
|
|
137
|
-
// Test-compatible aliases for vitest security tests
|
|
138
|
-
export const sanitizeAgentId = validateAgentId;
|
|
139
|
-
export const sanitizeBranchName = validateBranchName;
|
|
140
|
-
export const sanitizeFilePath = validateFilePath;
|
|
141
|
-
export const sanitizePRNumber = validatePRNumber;
|
|
142
|
-
// Message ID validation (for mycmail commands)
|
|
143
|
-
const VALID_MESSAGE_ID = /^[a-z0-9][a-z0-9_-]{0,64}$/i;
|
|
144
|
-
export function isValidMessageId(messageId) {
|
|
145
|
-
return typeof messageId === 'string' && VALID_MESSAGE_ID.test(messageId);
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Validate that a file path resolves to a location inside the current repository.
|
|
149
|
-
* Prevents arbitrary file read/write vulnerabilities via path traversal or absolute paths.
|
|
150
|
-
*
|
|
151
|
-
* @param filePath The path to validate
|
|
152
|
-
* @param rootDir The root directory (defaults to CWD)
|
|
153
|
-
* @returns The resolved absolute path if valid
|
|
154
|
-
* @throws Error if path is outside rootDir
|
|
155
|
-
*/
|
|
156
|
-
export function validateRepoPath(filePath, rootDir = process.cwd()) {
|
|
157
|
-
if (!filePath || typeof filePath !== 'string') {
|
|
158
|
-
throw new Error('File path is required');
|
|
159
|
-
}
|
|
160
|
-
const resolved = resolve(rootDir, filePath);
|
|
161
|
-
const rel = relative(rootDir, resolved);
|
|
162
|
-
// Check if path is outside root (starts with ..) or is absolute (on different drive on Windows)
|
|
163
|
-
// Note: on Linux/Mac relative() returns relative path, on Windows it might be absolute if different drive.
|
|
164
|
-
// Checking isAbsolute(rel) handles the different drive case.
|
|
165
|
-
if (rel.startsWith('..') || isAbsolute(rel)) {
|
|
166
|
-
throw new Error(`Security Error: Path "${filePath}" resolves outside the repository.`);
|
|
167
|
-
}
|
|
168
|
-
return resolved;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Escape text for blessed TUI to prevent markup injection.
|
|
172
|
-
* Replaces '{' with '{open}' and '}' with '{close}'.
|
|
173
|
-
*/
|
|
174
|
-
export function escapeBlessed(text) {
|
|
175
|
-
if (!text || typeof text !== 'string') {
|
|
176
|
-
return '';
|
|
177
|
-
}
|
|
178
|
-
return text.replace(/[{}]/g, (char) => char === '{' ? '{open}' : '{close}');
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Safely resolves the CLI entry point path.
|
|
182
|
-
* Replaces insecure usage of process.argv[1] which can be manipulated.
|
|
183
|
-
*/
|
|
184
|
-
export function getCLIPath() {
|
|
185
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
186
|
-
const __dirname = dirname(__filename);
|
|
187
|
-
const ext = __filename.endsWith('.ts') ? '.ts' : '.js';
|
|
188
|
-
return resolve(__dirname, '..', 'bin', `spidersan${ext}`);
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=security.js.map
|
package/dist/lib/security.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/lib/security.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;;;;;GAOG;AAEH,sBAAsB;AACtB,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAC/D,MAAM,aAAa,GAAG,6BAA6B,CAAC;AACpD,6BAA6B;AAC7B,MAAM,eAAe,GAAG,0CAA0C,CAAC;AAEnE,2CAA2C;AAC3C,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC3C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,yCAAyC,CAAC,CAAC;IACzG,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC7C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM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IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAChF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACtB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,OAAO,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Logger — captures raw spidersan ask/advise/explain sessions for training.
|
|
3
|
-
*
|
|
4
|
-
* Writes to ~/.spidersan/sessions/YYYY-MM-DD.jsonl (one JSON object per line).
|
|
5
|
-
* Each entry is a raw session: context + result + outcome.
|
|
6
|
-
*
|
|
7
|
-
* Outcome is what makes this a gold pair. Without it we just have questions.
|
|
8
|
-
* Outcome is captured inline (TTY prompt after response) or left null.
|
|
9
|
-
*
|
|
10
|
-
* Anonymization + gold pair transformation happens at `watsan index-pair` time,
|
|
11
|
-
* not here. This logger stores raw data locally — nothing leaves the machine.
|
|
12
|
-
*
|
|
13
|
-
* Design:
|
|
14
|
-
* - Never throws — session logging must not crash spidersan ask
|
|
15
|
-
* - Append-only JSONL — safe for concurrent writes, easy to process
|
|
16
|
-
* - File per day — easy to hand to watsan for a given date range
|
|
17
|
-
*/
|
|
18
|
-
import type { Interface as ReadlineInterface } from 'readline';
|
|
19
|
-
import type { SpiderContext } from './ai/types.js';
|
|
20
|
-
import type { ReasoningResult, ReasoningMode } from './ai/index.js';
|
|
21
|
-
export type SessionOutcome = 'followed' | 'ignored' | `modified:${string}` | null;
|
|
22
|
-
export interface RawSession {
|
|
23
|
-
session_id: string;
|
|
24
|
-
logged_at: string;
|
|
25
|
-
mode: ReasoningMode;
|
|
26
|
-
question?: string;
|
|
27
|
-
branch?: string;
|
|
28
|
-
context: SpiderContext;
|
|
29
|
-
result: ReasoningResult;
|
|
30
|
-
outcome: SessionOutcome;
|
|
31
|
-
outcome_captured_at: string | null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Append a session entry to today's log file.
|
|
35
|
-
* Returns the session_id so the caller can later capture the outcome.
|
|
36
|
-
* Never throws.
|
|
37
|
-
*/
|
|
38
|
-
export declare function logSession(mode: ReasoningMode, context: SpiderContext, result: ReasoningResult, opts?: {
|
|
39
|
-
question?: string;
|
|
40
|
-
branch?: string;
|
|
41
|
-
}): string;
|
|
42
|
-
/**
|
|
43
|
-
* Update the outcome for a previously logged session.
|
|
44
|
-
* Checks today's and yesterday's log files.
|
|
45
|
-
* Never throws.
|
|
46
|
-
*/
|
|
47
|
-
export declare function captureOutcome(session_id: string, outcome: SessionOutcome): void;
|
|
48
|
-
/**
|
|
49
|
-
* Show a brief outcome prompt after a response (TTY only).
|
|
50
|
-
* Non-blocking: skips if stdin is not a TTY or SPIDERSAN_NO_OUTCOME_PROMPT=1.
|
|
51
|
-
* Returns the captured outcome (or null if skipped).
|
|
52
|
-
*/
|
|
53
|
-
export declare function promptOutcome(session_id: string, rl: ReadlineInterface): Promise<SessionOutcome>;
|
|
54
|
-
//# sourceMappingURL=session-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-logger.d.ts","sourceRoot":"","sources":["../../src/lib/session-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAIpE,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,SAAS,GACT,YAAY,MAAM,EAAE,GACpB,IAAI,CAAC;AAET,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAqBD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,eAAe,EACvB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,MAAM,CAoBR;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAuBhF;AAID;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,iBAAiB,GACpB,OAAO,CAAC,cAAc,CAAC,CA8BzB"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Logger — captures raw spidersan ask/advise/explain sessions for training.
|
|
3
|
-
*
|
|
4
|
-
* Writes to ~/.spidersan/sessions/YYYY-MM-DD.jsonl (one JSON object per line).
|
|
5
|
-
* Each entry is a raw session: context + result + outcome.
|
|
6
|
-
*
|
|
7
|
-
* Outcome is what makes this a gold pair. Without it we just have questions.
|
|
8
|
-
* Outcome is captured inline (TTY prompt after response) or left null.
|
|
9
|
-
*
|
|
10
|
-
* Anonymization + gold pair transformation happens at `watsan index-pair` time,
|
|
11
|
-
* not here. This logger stores raw data locally — nothing leaves the machine.
|
|
12
|
-
*
|
|
13
|
-
* Design:
|
|
14
|
-
* - Never throws — session logging must not crash spidersan ask
|
|
15
|
-
* - Append-only JSONL — safe for concurrent writes, easy to process
|
|
16
|
-
* - File per day — easy to hand to watsan for a given date range
|
|
17
|
-
*/
|
|
18
|
-
import { appendFileSync, readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
19
|
-
import { join } from 'path';
|
|
20
|
-
import { homedir } from 'os';
|
|
21
|
-
import { randomUUID } from 'crypto';
|
|
22
|
-
// ─── Paths ────────────────────────────────────────────────────
|
|
23
|
-
function sessionsDir() {
|
|
24
|
-
return join(homedir(), '.spidersan', 'sessions');
|
|
25
|
-
}
|
|
26
|
-
function dateFile(offsetDays = 0) {
|
|
27
|
-
const d = new Date(Date.now() - offsetDays * 86_400_000);
|
|
28
|
-
const ymd = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
29
|
-
return join(sessionsDir(), `${ymd}.jsonl`);
|
|
30
|
-
}
|
|
31
|
-
function ensureDir() {
|
|
32
|
-
const dir = sessionsDir();
|
|
33
|
-
if (!existsSync(dir))
|
|
34
|
-
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
35
|
-
}
|
|
36
|
-
// ─── Write ────────────────────────────────────────────────────
|
|
37
|
-
/**
|
|
38
|
-
* Append a session entry to today's log file.
|
|
39
|
-
* Returns the session_id so the caller can later capture the outcome.
|
|
40
|
-
* Never throws.
|
|
41
|
-
*/
|
|
42
|
-
export function logSession(mode, context, result, opts) {
|
|
43
|
-
const session_id = randomUUID();
|
|
44
|
-
try {
|
|
45
|
-
ensureDir();
|
|
46
|
-
const entry = {
|
|
47
|
-
session_id,
|
|
48
|
-
logged_at: new Date().toISOString(),
|
|
49
|
-
mode,
|
|
50
|
-
question: opts?.question,
|
|
51
|
-
branch: opts?.branch,
|
|
52
|
-
context,
|
|
53
|
-
result,
|
|
54
|
-
outcome: null,
|
|
55
|
-
outcome_captured_at: null,
|
|
56
|
-
};
|
|
57
|
-
appendFileSync(dateFile(), JSON.stringify(entry) + '\n', { encoding: 'utf-8' });
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
// Silent — logging must never crash the main command
|
|
61
|
-
}
|
|
62
|
-
return session_id;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Update the outcome for a previously logged session.
|
|
66
|
-
* Checks today's and yesterday's log files.
|
|
67
|
-
* Never throws.
|
|
68
|
-
*/
|
|
69
|
-
export function captureOutcome(session_id, outcome) {
|
|
70
|
-
try {
|
|
71
|
-
const now = new Date().toISOString();
|
|
72
|
-
// Check today and yesterday (covers sessions that started near midnight)
|
|
73
|
-
for (const filePath of [dateFile(0), dateFile(1)]) {
|
|
74
|
-
if (!existsSync(filePath))
|
|
75
|
-
continue;
|
|
76
|
-
const lines = readFileSync(filePath, 'utf-8').split('\n').filter(Boolean);
|
|
77
|
-
const idx = lines.findIndex(line => {
|
|
78
|
-
try {
|
|
79
|
-
return JSON.parse(line).session_id === session_id;
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
if (idx === -1)
|
|
86
|
-
continue;
|
|
87
|
-
const entry = JSON.parse(lines[idx]);
|
|
88
|
-
entry.outcome = outcome;
|
|
89
|
-
entry.outcome_captured_at = now;
|
|
90
|
-
lines[idx] = JSON.stringify(entry);
|
|
91
|
-
writeFileSync(filePath, lines.join('\n') + '\n', { encoding: 'utf-8' });
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Silent
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// ─── Inline outcome prompt ────────────────────────────────────
|
|
100
|
-
/**
|
|
101
|
-
* Show a brief outcome prompt after a response (TTY only).
|
|
102
|
-
* Non-blocking: skips if stdin is not a TTY or SPIDERSAN_NO_OUTCOME_PROMPT=1.
|
|
103
|
-
* Returns the captured outcome (or null if skipped).
|
|
104
|
-
*/
|
|
105
|
-
export async function promptOutcome(session_id, rl) {
|
|
106
|
-
if (!process.stdin.isTTY || process.env['SPIDERSAN_NO_OUTCOME_PROMPT'] === '1') {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
return new Promise((resolve) => {
|
|
110
|
-
process.stdout.write('\x1b[2m Follow this advice? [y/n/m=modified, Enter to skip] \x1b[0m');
|
|
111
|
-
rl.once('line', (answer) => {
|
|
112
|
-
const a = answer.trim().toLowerCase();
|
|
113
|
-
if (a === 'y' || a === 'yes') {
|
|
114
|
-
captureOutcome(session_id, 'followed');
|
|
115
|
-
resolve('followed');
|
|
116
|
-
}
|
|
117
|
-
else if (a === 'n' || a === 'no') {
|
|
118
|
-
captureOutcome(session_id, 'ignored');
|
|
119
|
-
resolve('ignored');
|
|
120
|
-
}
|
|
121
|
-
else if (a.startsWith('m')) {
|
|
122
|
-
process.stdout.write('\x1b[2m What changed? (one line) \x1b[0m');
|
|
123
|
-
rl.once('line', (desc) => {
|
|
124
|
-
const outcome = `modified:${desc.trim().slice(0, 200)}`;
|
|
125
|
-
captureOutcome(session_id, outcome);
|
|
126
|
-
resolve(outcome);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
// Enter / anything else → skip
|
|
131
|
-
resolve(null);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=session-logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"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CAAC,UAAU,CAAC,CAAC;YACtB,CAAC;iBAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBACnC,cAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACtC,OAAO,CAAC,SAAS,CAAC,CAAC;YACrB,CAAC;iBAAM,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBAClE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;oBAC/B,MAAM,OAAO,GAAmB,YAAY,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;oBACxE,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;oBACpC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,+BAA+B;gBAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* symbol-extractor.ts — Phase C semantic intelligence
|
|
3
|
-
*
|
|
4
|
-
* Extract exported symbols (functions, classes, types, consts) from a TS file
|
|
5
|
-
* using ts-morph. Used by `spidersan conflicts --semantic`.
|
|
6
|
-
*/
|
|
7
|
-
export interface ExtractedSymbol {
|
|
8
|
-
name: string;
|
|
9
|
-
kind: 'function' | 'class' | 'type' | 'interface' | 'const' | 'enum' | 'other';
|
|
10
|
-
line: number;
|
|
11
|
-
}
|
|
12
|
-
export interface FileSymbols {
|
|
13
|
-
file: string;
|
|
14
|
-
symbols: ExtractedSymbol[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Extract all exported symbols from a TypeScript file.
|
|
18
|
-
* Returns an empty symbols array if the file doesn't exist or isn't parseable.
|
|
19
|
-
*/
|
|
20
|
-
export declare function extractSymbols(filePath: string): FileSymbols;
|
|
21
|
-
/**
|
|
22
|
-
* Find symbol-level overlaps between two sets of file symbols.
|
|
23
|
-
* Returns symbols that share the same name across different branches.
|
|
24
|
-
*/
|
|
25
|
-
export interface SymbolOverlap {
|
|
26
|
-
name: string;
|
|
27
|
-
kind: ExtractedSymbol['kind'];
|
|
28
|
-
branches: Array<{
|
|
29
|
-
branch: string;
|
|
30
|
-
file: string;
|
|
31
|
-
line: number;
|
|
32
|
-
}>;
|
|
33
|
-
}
|
|
34
|
-
export declare function findSymbolOverlaps(left: {
|
|
35
|
-
branch: string;
|
|
36
|
-
symbols: FileSymbols;
|
|
37
|
-
}, right: {
|
|
38
|
-
branch: string;
|
|
39
|
-
symbols: FileSymbols;
|
|
40
|
-
}): SymbolOverlap[];
|
|
41
|
-
//# sourceMappingURL=symbol-extractor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-extractor.d.ts","sourceRoot":"","sources":["../../src/lib/symbol-extractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CA0B5D;AAyBD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,EAC9C,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAC9C,aAAa,EAAE,CAmBjB"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* symbol-extractor.ts — Phase C semantic intelligence
|
|
3
|
-
*
|
|
4
|
-
* Extract exported symbols (functions, classes, types, consts) from a TS file
|
|
5
|
-
* using ts-morph. Used by `spidersan conflicts --semantic`.
|
|
6
|
-
*/
|
|
7
|
-
import { Project, SyntaxKind } from 'ts-morph';
|
|
8
|
-
import { existsSync } from 'fs';
|
|
9
|
-
/**
|
|
10
|
-
* Extract all exported symbols from a TypeScript file.
|
|
11
|
-
* Returns an empty symbols array if the file doesn't exist or isn't parseable.
|
|
12
|
-
*/
|
|
13
|
-
export function extractSymbols(filePath) {
|
|
14
|
-
if (!existsSync(filePath)) {
|
|
15
|
-
return { file: filePath, symbols: [] };
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
const project = new Project({
|
|
19
|
-
compilerOptions: { allowJs: true },
|
|
20
|
-
skipAddingFilesFromTsConfig: true,
|
|
21
|
-
});
|
|
22
|
-
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
23
|
-
const symbols = [];
|
|
24
|
-
for (const decl of sourceFile.getExportedDeclarations()) {
|
|
25
|
-
const [name, nodes] = decl;
|
|
26
|
-
for (const node of nodes) {
|
|
27
|
-
const kind = kindOf(node.getKind());
|
|
28
|
-
const line = node.getStartLineNumber();
|
|
29
|
-
symbols.push({ name, kind, line });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return { file: filePath, symbols };
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
return { file: filePath, symbols: [] };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function kindOf(syntaxKind) {
|
|
39
|
-
switch (syntaxKind) {
|
|
40
|
-
case SyntaxKind.FunctionDeclaration:
|
|
41
|
-
case SyntaxKind.ArrowFunction:
|
|
42
|
-
case SyntaxKind.FunctionExpression:
|
|
43
|
-
case SyntaxKind.MethodDeclaration:
|
|
44
|
-
return 'function';
|
|
45
|
-
case SyntaxKind.ClassDeclaration:
|
|
46
|
-
return 'class';
|
|
47
|
-
case SyntaxKind.TypeAliasDeclaration:
|
|
48
|
-
return 'type';
|
|
49
|
-
case SyntaxKind.InterfaceDeclaration:
|
|
50
|
-
return 'interface';
|
|
51
|
-
case SyntaxKind.EnumDeclaration:
|
|
52
|
-
return 'enum';
|
|
53
|
-
case SyntaxKind.VariableDeclaration:
|
|
54
|
-
case SyntaxKind.VariableStatement:
|
|
55
|
-
return 'const';
|
|
56
|
-
default:
|
|
57
|
-
return 'other';
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export function findSymbolOverlaps(left, right) {
|
|
61
|
-
const leftMap = new Map(left.symbols.symbols.map(s => [s.name, s]));
|
|
62
|
-
const overlaps = [];
|
|
63
|
-
for (const rs of right.symbols.symbols) {
|
|
64
|
-
const ls = leftMap.get(rs.name);
|
|
65
|
-
if (ls) {
|
|
66
|
-
overlaps.push({
|
|
67
|
-
name: rs.name,
|
|
68
|
-
kind: rs.kind,
|
|
69
|
-
branches: [
|
|
70
|
-
{ branch: left.branch, file: left.symbols.file, line: ls.line },
|
|
71
|
-
{ branch: right.branch, file: right.symbols.file, line: rs.line },
|
|
72
|
-
],
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return overlaps;
|
|
77
|
-
}
|
|
78
|
-
//# source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AAC,IAAI;gBACb,QAAQ,EAAE;oBACR,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;oBAC/D,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;iBAClE;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update Check Module
|
|
3
|
-
*
|
|
4
|
-
* Checks npm registry for newer versions and displays update notification.
|
|
5
|
-
* Non-blocking, fails silently.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Check for updates (non-blocking)
|
|
9
|
-
*/
|
|
10
|
-
export declare function checkForUpdates(): Promise<void>;
|
|
11
|
-
//# sourceMappingURL=update-check.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuEH;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAkCrD"}
|