swarmdo 1.4.8 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/.claude/helpers/statusline.cjs +7 -7
  2. package/README.md +9 -6
  3. package/package.json +5 -3
  4. package/v3/@swarmdo/cli/dist/src/commands/compact.d.ts +16 -0
  5. package/v3/@swarmdo/cli/dist/src/commands/compact.js +106 -0
  6. package/v3/@swarmdo/cli/dist/src/commands/hooks.js +26 -24
  7. package/v3/@swarmdo/cli/dist/src/commands/index.js +10 -3
  8. package/v3/@swarmdo/cli/dist/src/commands/integrations.d.ts +14 -0
  9. package/v3/@swarmdo/cli/dist/src/commands/integrations.js +158 -0
  10. package/v3/@swarmdo/cli/dist/src/commands/memory.js +50 -1
  11. package/v3/@swarmdo/cli/dist/src/commands/providers.js +3 -0
  12. package/v3/@swarmdo/cli/dist/src/commands/release.d.ts +15 -0
  13. package/v3/@swarmdo/cli/dist/src/commands/release.js +241 -0
  14. package/v3/@swarmdo/cli/dist/src/commands/security.js +14 -0
  15. package/v3/@swarmdo/cli/dist/src/commands/transcript.js +82 -1
  16. package/v3/@swarmdo/cli/dist/src/commands/usage.js +80 -1
  17. package/v3/@swarmdo/cli/dist/src/compact/compact.d.ts +60 -0
  18. package/v3/@swarmdo/cli/dist/src/compact/compact.js +170 -0
  19. package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +11 -1
  20. package/v3/@swarmdo/cli/dist/src/index.js +4 -2
  21. package/v3/@swarmdo/cli/dist/src/init/statusline-generator.js +6 -6
  22. package/v3/@swarmdo/cli/dist/src/integrations/integrations.d.ts +54 -0
  23. package/v3/@swarmdo/cli/dist/src/integrations/integrations.js +162 -0
  24. package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-execute-core.js +25 -3
  25. package/v3/@swarmdo/cli/dist/src/mcp-tools/agentdb-tools.js +8 -8
  26. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.d.ts +12 -0
  27. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.js +32 -1
  28. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.d.ts +32 -0
  29. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.js +66 -0
  30. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.d.ts +91 -0
  31. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.js +186 -0
  32. package/v3/@swarmdo/cli/dist/src/release/release.d.ts +72 -0
  33. package/v3/@swarmdo/cli/dist/src/release/release.js +86 -0
  34. package/v3/@swarmdo/cli/dist/src/resilience/backoff.d.ts +23 -0
  35. package/v3/@swarmdo/cli/dist/src/resilience/backoff.js +30 -0
  36. package/v3/@swarmdo/cli/dist/src/swarmvector/model-router.js +14 -0
  37. package/v3/@swarmdo/cli/dist/src/transcript/search.d.ts +39 -0
  38. package/v3/@swarmdo/cli/dist/src/transcript/search.js +67 -0
  39. package/v3/@swarmdo/cli/dist/src/usage/diff.d.ts +69 -0
  40. package/v3/@swarmdo/cli/dist/src/usage/diff.js +112 -0
  41. package/v3/@swarmdo/cli/package.json +4 -4
  42. package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
  43. package/v3/@swarmdo/codex/dist/cli.js +0 -0
  44. package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
  45. package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
  46. package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
  47. package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +4 -1
  48. package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
  49. package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
  50. package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
  51. package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
  52. package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
  53. package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
  54. package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
  55. package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
  56. package/v3/@swarmdo/shared/dist/mcp/transport/http.js +8 -1
  57. package/v3/vendor/agentdb/package.json +0 -1
  58. package/v3/vendor/agentic-flow/package.json +0 -1
  59. package/.claude/scheduled_tasks.lock +0 -1
  60. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  61. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__main__.cpython-314.pyc +0 -0
  62. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/cli.cpython-314.pyc +0 -0
  63. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/compress.cpython-314.pyc +0 -0
  64. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/detect.cpython-314.pyc +0 -0
  65. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  66. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +0 -2
  67. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +0 -2
  68. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +0 -138
  69. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +0 -418
  70. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +0 -15
  71. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +0 -240
  72. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +0 -7
  73. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +0 -508
  74. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +0 -54
  75. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +0 -2
  76. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +0 -46
  77. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +0 -2
  78. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +0 -18
  79. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +0 -28
  80. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +0 -5
  81. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +0 -2
  82. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +0 -35
  83. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +0 -2
  84. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +0 -11
  85. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +0 -2
  86. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +0 -9
  87. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +0 -2
  88. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +0 -5
  89. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +0 -2
  90. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +0 -12
  91. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +0 -2
  92. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +0 -19
  93. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +0 -2
  94. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +0 -44
  95. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +0 -117
  96. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +0 -70
  97. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +0 -194
  98. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +0 -69
  99. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +0 -139
  100. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +0 -34
  101. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +0 -101
  102. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +0 -10
  103. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +0 -10
  104. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +0 -64
  105. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +0 -70
  106. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +0 -44
  107. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +0 -79
  108. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +0 -37
  109. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +0 -39
  110. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +0 -67
  111. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +0 -58
  112. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +0 -45
  113. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +0 -63
  114. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +0 -26
  115. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +0 -17
  116. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +0 -51
  117. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +0 -110
  118. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +0 -13
  119. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +0 -25
  120. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +0 -11
  121. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +0 -19
  122. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +0 -11
  123. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +0 -27
  124. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +0 -6
  125. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +0 -6
  126. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +0 -41
  127. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +0 -64
  128. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +0 -8
  129. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +0 -703
  130. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +0 -23
  131. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +0 -239
  132. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +0 -17
  133. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +0 -42
  134. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +0 -18
  135. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +0 -45
  136. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +0 -19
  137. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +0 -50
  138. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +0 -19
  139. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +0 -47
  140. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +0 -17
  141. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +0 -40
  142. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +0 -18
  143. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +0 -51
  144. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +0 -214
  145. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +0 -595
  146. package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +0 -76
  147. package/v3/@swarmdo/testing/dist/fixtures/agents.js +0 -158
  148. package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +0 -157
  149. package/v3/@swarmdo/testing/dist/fixtures/configurations.js +0 -337
  150. package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +0 -10
  151. package/v3/@swarmdo/testing/dist/fixtures/index.js +0 -17
  152. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +0 -329
  153. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +0 -714
  154. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +0 -159
  155. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +0 -262
  156. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +0 -290
  157. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +0 -547
  158. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +0 -289
  159. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +0 -534
  160. package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +0 -106
  161. package/v3/@swarmdo/testing/dist/fixtures/tasks.js +0 -229
  162. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +0 -213
  163. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +0 -435
  164. package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +0 -135
  165. package/v3/@swarmdo/testing/dist/helpers/assertions.js +0 -217
  166. package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +0 -96
  167. package/v3/@swarmdo/testing/dist/helpers/create-mock.js +0 -164
  168. package/v3/@swarmdo/testing/dist/helpers/index.d.ts +0 -14
  169. package/v3/@swarmdo/testing/dist/helpers/index.js +0 -22
  170. package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +0 -323
  171. package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +0 -350
  172. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +0 -271
  173. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +0 -446
  174. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +0 -142
  175. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +0 -205
  176. package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +0 -190
  177. package/v3/@swarmdo/testing/dist/helpers/test-application.js +0 -138
  178. package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +0 -274
  179. package/v3/@swarmdo/testing/dist/helpers/test-utils.js +0 -456
  180. package/v3/@swarmdo/testing/dist/index.d.ts +0 -42
  181. package/v3/@swarmdo/testing/dist/index.js +0 -66
  182. package/v3/@swarmdo/testing/dist/mocks/index.d.ts +0 -8
  183. package/v3/@swarmdo/testing/dist/mocks/index.js +0 -10
  184. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +0 -206
  185. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +0 -575
  186. package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +0 -287
  187. package/v3/@swarmdo/testing/dist/mocks/mock-services.js +0 -563
  188. package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +0 -109
  189. package/v3/@swarmdo/testing/dist/regression/api-contract.js +0 -374
  190. package/v3/@swarmdo/testing/dist/regression/index.d.ts +0 -18
  191. package/v3/@swarmdo/testing/dist/regression/index.js +0 -18
  192. package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +0 -67
  193. package/v3/@swarmdo/testing/dist/regression/integration-regression.js +0 -334
  194. package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +0 -106
  195. package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +0 -268
  196. package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +0 -124
  197. package/v3/@swarmdo/testing/dist/regression/regression-runner.js +0 -227
  198. package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +0 -73
  199. package/v3/@swarmdo/testing/dist/regression/security-regression.js +0 -258
  200. package/v3/@swarmdo/testing/dist/setup.d.ts +0 -43
  201. package/v3/@swarmdo/testing/dist/setup.js +0 -91
  202. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +0 -10
  203. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +0 -433
  204. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +0 -10
  205. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +0 -352
  206. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +0 -206
  207. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +0 -839
  208. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +0 -10
  209. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +0 -428
  210. package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +0 -38
  211. package/v3/@swarmdo/testing/dist/v2-compat/index.js +0 -41
  212. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +0 -10
  213. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +0 -419
  214. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +0 -34
  215. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.js +0 -372
@@ -0,0 +1,39 @@
1
+ /**
2
+ * search.ts — full-text search across Claude Code session transcripts.
3
+ *
4
+ * "Which session did I discuss X in?" — answered locally. Matches only what
5
+ * the humans and the model actually said (user/assistant messages; tool spam
6
+ * and system reminders are not part of the conversation record we search).
7
+ * All matching/snippeting/ranking is pure; the command layer streams files.
8
+ */
9
+ import { type RawTranscriptLine } from './export.js';
10
+ export interface SearchHit {
11
+ role: 'user' | 'assistant';
12
+ snippet: string;
13
+ }
14
+ export interface SessionMatch {
15
+ sessionId: string;
16
+ project: string;
17
+ mtimeMs: number;
18
+ hits: number;
19
+ snippets: SearchHit[];
20
+ }
21
+ /** Lowercased, deduped, non-empty terms. Throws on an effectively-empty query. */
22
+ export declare function parseQuery(raw: string): string[];
23
+ /** Case-insensitive AND across terms. */
24
+ export declare function matchesQuery(text: string, terms: string[]): boolean;
25
+ /** Window the text around the first term occurrence; single-line ellipsized. */
26
+ export declare function makeSnippet(text: string, terms: string[], width?: number): string;
27
+ /** Extract the searchable conversational text of one transcript line, or null. */
28
+ export declare function searchableText(line: RawTranscriptLine): {
29
+ role: 'user' | 'assistant';
30
+ text: string;
31
+ } | null;
32
+ /** Search parsed lines of one session; returns hit count + top snippets. */
33
+ export declare function searchLines(lines: RawTranscriptLine[], terms: string[], maxSnippets?: number): {
34
+ hits: number;
35
+ snippets: SearchHit[];
36
+ };
37
+ /** Rank: most hits first, then most recent. */
38
+ export declare function rankMatches(matches: SessionMatch[]): SessionMatch[];
39
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1,67 @@
1
+ /**
2
+ * search.ts — full-text search across Claude Code session transcripts.
3
+ *
4
+ * "Which session did I discuss X in?" — answered locally. Matches only what
5
+ * the humans and the model actually said (user/assistant messages; tool spam
6
+ * and system reminders are not part of the conversation record we search).
7
+ * All matching/snippeting/ranking is pure; the command layer streams files.
8
+ */
9
+ import { contentToText, cleanUserText } from './export.js';
10
+ /** Lowercased, deduped, non-empty terms. Throws on an effectively-empty query. */
11
+ export function parseQuery(raw) {
12
+ const terms = [...new Set(String(raw).toLowerCase().split(/\s+/).filter(Boolean))];
13
+ if (terms.length === 0)
14
+ throw new Error('empty search query');
15
+ return terms;
16
+ }
17
+ /** Case-insensitive AND across terms. */
18
+ export function matchesQuery(text, terms) {
19
+ const lower = text.toLowerCase();
20
+ return terms.every((t) => lower.includes(t));
21
+ }
22
+ /** Window the text around the first term occurrence; single-line ellipsized. */
23
+ export function makeSnippet(text, terms, width = 160) {
24
+ const flat = text.replace(/\s+/g, ' ').trim();
25
+ const lower = flat.toLowerCase();
26
+ let at = -1;
27
+ for (const t of terms) {
28
+ const i = lower.indexOf(t);
29
+ if (i !== -1 && (at === -1 || i < at))
30
+ at = i;
31
+ }
32
+ if (at === -1)
33
+ at = 0;
34
+ const start = Math.max(0, at - Math.floor(width / 3));
35
+ const end = Math.min(flat.length, start + width);
36
+ return `${start > 0 ? '…' : ''}${flat.slice(start, end)}${end < flat.length ? '…' : ''}`;
37
+ }
38
+ /** Extract the searchable conversational text of one transcript line, or null. */
39
+ export function searchableText(line) {
40
+ const role = line.message?.role;
41
+ if (role !== 'user' && role !== 'assistant')
42
+ return null;
43
+ const text = contentToText(line.message?.content);
44
+ const cleaned = role === 'user' ? cleanUserText(text) : text;
45
+ if (!cleaned || !cleaned.trim())
46
+ return null;
47
+ return { role, text: cleaned };
48
+ }
49
+ /** Search parsed lines of one session; returns hit count + top snippets. */
50
+ export function searchLines(lines, terms, maxSnippets = 3) {
51
+ let hits = 0;
52
+ const snippets = [];
53
+ for (const line of lines) {
54
+ const s = searchableText(line);
55
+ if (!s || !matchesQuery(s.text, terms))
56
+ continue;
57
+ hits++;
58
+ if (snippets.length < maxSnippets)
59
+ snippets.push({ role: s.role, snippet: makeSnippet(s.text, terms) });
60
+ }
61
+ return { hits, snippets };
62
+ }
63
+ /** Rank: most hits first, then most recent. */
64
+ export function rankMatches(matches) {
65
+ return [...matches].sort((a, b) => b.hits - a.hits || b.mtimeMs - a.mtimeMs);
66
+ }
67
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1,69 @@
1
+ /**
2
+ * diff.ts — compare Claude Code spend between two periods.
3
+ *
4
+ * The usage views show single windows; this is the compare layer: this week
5
+ * vs last, today vs yesterday, or any two explicit date ranges — totals,
6
+ * deltas, and the per-model movers. Pure: everything computes over the
7
+ * existing per-day aggregation rows, so tests need no transcripts.
8
+ */
9
+ export interface DayTotals {
10
+ costUsd: number;
11
+ inputTokens: number;
12
+ outputTokens: number;
13
+ cacheReadTokens: number;
14
+ cacheWriteTokens: number;
15
+ totalTokens: number;
16
+ }
17
+ export interface DayRow {
18
+ /** YYYY-MM-DD (local) */
19
+ key: string;
20
+ totals: DayTotals;
21
+ }
22
+ export interface ModelRow {
23
+ key: string;
24
+ day: string;
25
+ totals: DayTotals;
26
+ }
27
+ export interface Period {
28
+ /** inclusive YYYY-MM-DD bounds */
29
+ from: string;
30
+ to: string;
31
+ label: string;
32
+ }
33
+ /** Built-in period pairs. `now` is a local YYYY-MM-DD anchor (injected). */
34
+ export declare function resolvePeriodPair(kind: string, today: string): {
35
+ a: Period;
36
+ b: Period;
37
+ };
38
+ /** Parse an explicit "YYYY-MM-DD:YYYY-MM-DD" range. */
39
+ export declare function parseRange(raw: string, label?: string): Period;
40
+ /** Sum day rows falling inside a period (inclusive bounds, string compare). */
41
+ export declare function sumPeriod(rows: DayRow[], p: Period): DayTotals;
42
+ export interface MetricDelta {
43
+ a: number;
44
+ b: number;
45
+ delta: number;
46
+ /** delta / b; null when b === 0 (renders as "new") */
47
+ pct: number | null;
48
+ }
49
+ export declare function metricDelta(a: number, b: number): MetricDelta;
50
+ export interface DiffReport {
51
+ a: Period;
52
+ b: Period;
53
+ cost: MetricDelta;
54
+ totalTokens: MetricDelta;
55
+ inputTokens: MetricDelta;
56
+ outputTokens: MetricDelta;
57
+ cacheReadTokens: MetricDelta;
58
+ activeDays: MetricDelta;
59
+ }
60
+ export declare function diffPeriods(rows: DayRow[], a: Period, b: Period): DiffReport;
61
+ export interface ModelMover {
62
+ model: string;
63
+ cost: MetricDelta;
64
+ }
65
+ /** Per-model cost deltas sorted by |delta| desc. `modelDayRows` carries one
66
+ * row per (model, day) — the shape aggregateUsage(events,'model-day') style
67
+ * callers flatten to. */
68
+ export declare function modelMovers(modelDayRows: ModelRow[], a: Period, b: Period, limit?: number): ModelMover[];
69
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1,112 @@
1
+ /**
2
+ * diff.ts — compare Claude Code spend between two periods.
3
+ *
4
+ * The usage views show single windows; this is the compare layer: this week
5
+ * vs last, today vs yesterday, or any two explicit date ranges — totals,
6
+ * deltas, and the per-model movers. Pure: everything computes over the
7
+ * existing per-day aggregation rows, so tests need no transcripts.
8
+ */
9
+ const DATE = /^\d{4}-\d{2}-\d{2}$/;
10
+ function fmtLocal(d) {
11
+ const y = d.getFullYear();
12
+ const m = String(d.getMonth() + 1).padStart(2, '0');
13
+ const dd = String(d.getDate()).padStart(2, '0');
14
+ return `${y}-${m}-${dd}`;
15
+ }
16
+ function shiftDays(iso, days) {
17
+ const [y, m, d] = iso.split('-').map(Number);
18
+ const dt = new Date(y, m - 1, d + days);
19
+ return fmtLocal(dt);
20
+ }
21
+ /** Built-in period pairs. `now` is a local YYYY-MM-DD anchor (injected). */
22
+ export function resolvePeriodPair(kind, today) {
23
+ if (!DATE.test(today))
24
+ throw new Error(`bad anchor date: ${today}`);
25
+ switch (kind) {
26
+ case 'day':
27
+ return {
28
+ a: { from: today, to: today, label: 'today' },
29
+ b: { from: shiftDays(today, -1), to: shiftDays(today, -1), label: 'yesterday' },
30
+ };
31
+ case 'week':
32
+ return {
33
+ a: { from: shiftDays(today, -6), to: today, label: 'last 7 days' },
34
+ b: { from: shiftDays(today, -13), to: shiftDays(today, -7), label: 'prior 7 days' },
35
+ };
36
+ case 'month': {
37
+ const [y, m] = today.split('-').map(Number);
38
+ const thisFrom = `${today.slice(0, 7)}-01`;
39
+ const prev = new Date(y, m - 2, 1);
40
+ const prevFrom = fmtLocal(prev);
41
+ const prevTo = fmtLocal(new Date(y, m - 1, 0)); // last day of previous month
42
+ return {
43
+ a: { from: thisFrom, to: today, label: today.slice(0, 7) },
44
+ b: { from: prevFrom, to: prevTo, label: prevFrom.slice(0, 7) },
45
+ };
46
+ }
47
+ default:
48
+ throw new Error(`unknown period kind "${kind}" (expected day|week|month)`);
49
+ }
50
+ }
51
+ /** Parse an explicit "YYYY-MM-DD:YYYY-MM-DD" range. */
52
+ export function parseRange(raw, label) {
53
+ const [from, to] = String(raw).split(':');
54
+ if (!DATE.test(from ?? '') || !DATE.test(to ?? '')) {
55
+ throw new Error(`bad range "${raw}" (expected YYYY-MM-DD:YYYY-MM-DD)`);
56
+ }
57
+ if (from > to)
58
+ throw new Error(`range "${raw}" is reversed (from > to)`);
59
+ return { from, to, label: label ?? `${from}..${to}` };
60
+ }
61
+ const ZERO = { costUsd: 0, inputTokens: 0, outputTokens: 0, cacheReadTokens: 0, cacheWriteTokens: 0, totalTokens: 0 };
62
+ function addTotals(a, b) {
63
+ return {
64
+ costUsd: a.costUsd + b.costUsd,
65
+ inputTokens: a.inputTokens + b.inputTokens,
66
+ outputTokens: a.outputTokens + b.outputTokens,
67
+ cacheReadTokens: a.cacheReadTokens + b.cacheReadTokens,
68
+ cacheWriteTokens: a.cacheWriteTokens + b.cacheWriteTokens,
69
+ totalTokens: a.totalTokens + b.totalTokens,
70
+ };
71
+ }
72
+ /** Sum day rows falling inside a period (inclusive bounds, string compare). */
73
+ export function sumPeriod(rows, p) {
74
+ return rows.filter((r) => r.key >= p.from && r.key <= p.to).reduce((acc, r) => addTotals(acc, r.totals), { ...ZERO });
75
+ }
76
+ export function metricDelta(a, b) {
77
+ return { a, b, delta: a - b, pct: b === 0 ? (a === 0 ? 0 : null) : (a - b) / b };
78
+ }
79
+ export function diffPeriods(rows, a, b) {
80
+ const ta = sumPeriod(rows, a);
81
+ const tb = sumPeriod(rows, b);
82
+ const daysIn = (p) => rows.filter((r) => r.key >= p.from && r.key <= p.to && r.totals.totalTokens > 0).length;
83
+ return {
84
+ a, b,
85
+ cost: metricDelta(ta.costUsd, tb.costUsd),
86
+ totalTokens: metricDelta(ta.totalTokens, tb.totalTokens),
87
+ inputTokens: metricDelta(ta.inputTokens, tb.inputTokens),
88
+ outputTokens: metricDelta(ta.outputTokens, tb.outputTokens),
89
+ cacheReadTokens: metricDelta(ta.cacheReadTokens, tb.cacheReadTokens),
90
+ activeDays: metricDelta(daysIn(a), daysIn(b)),
91
+ };
92
+ }
93
+ /** Per-model cost deltas sorted by |delta| desc. `modelDayRows` carries one
94
+ * row per (model, day) — the shape aggregateUsage(events,'model-day') style
95
+ * callers flatten to. */
96
+ export function modelMovers(modelDayRows, a, b, limit = 8) {
97
+ const per = new Map();
98
+ for (const r of modelDayRows) {
99
+ const slot = per.get(r.key) ?? { a: 0, b: 0 };
100
+ if (r.day >= a.from && r.day <= a.to)
101
+ slot.a += r.totals.costUsd;
102
+ if (r.day >= b.from && r.day <= b.to)
103
+ slot.b += r.totals.costUsd;
104
+ per.set(r.key, slot);
105
+ }
106
+ return [...per.entries()]
107
+ .map(([model, v]) => ({ model, cost: metricDelta(v.a, v.b) }))
108
+ .filter((m) => m.cost.a !== 0 || m.cost.b !== 0)
109
+ .sort((x, y) => Math.abs(y.cost.delta) - Math.abs(x.cost.delta))
110
+ .slice(0, limit);
111
+ }
112
+ //# sourceMappingURL=diff.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmdo/cli",
3
- "version": "1.4.8",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "description": "Swarmdo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",
@@ -83,7 +83,7 @@
83
83
  "test:pattern-store": "npx tsx src/transfer/store/tests/standalone-test.ts",
84
84
  "postinstall": "node ./scripts/postinstall.cjs",
85
85
  "build:standalone": "node scripts/build-standalone.mjs",
86
- "prepublishOnly": "node -e \"console.error('\\n@swarmdo/cli must be published from the self-contained staging dir (file:../ siblings do not ship from here):\\n\\n npm run build && npm run build:standalone && npm publish dist-standalone/\\n'); process.exit(1)\""
86
+ "prepublishOnly": "node -e \"if (process.env.npm_command === 'publish') { console.error('\\n@swarmdo/cli must be published from the self-contained staging dir (file:../ siblings do not ship from here):\\n\\n npm run build && npm run build:standalone && npm publish dist-standalone/\\n'); process.exit(1); } // pnpm runs prepublishOnly when packing local directory deps during install \u2014 that path must not fail\""
87
87
  },
88
88
  "devDependencies": {
89
89
  "@types/better-sqlite3": "^7.6.0",
@@ -117,8 +117,8 @@
117
117
  "@swarmvector/swarmllm": "file:../../@swarmvector/swarmllm",
118
118
  "@swarmvector/sona": "file:../../@swarmvector/sona",
119
119
  "@swarmvector/tiny-dancer": "file:../../@swarmvector/tiny-dancer",
120
- "agentdb": "^3.0.0-alpha.17",
121
- "agentic-flow": "^2.0.0",
120
+ "agentdb": "file:../../vendor/agentdb",
121
+ "agentic-flow": "file:../../vendor/agentic-flow",
122
122
  "better-sqlite3": "^12.9.0",
123
123
  "metaharness": "~0.2.6",
124
124
  "swarmvector": "file:../../vendor/swarmvector",
@@ -103,7 +103,7 @@ Storage:
103
103
  Programmatic use:
104
104
  import { JsonMemoryBackend, runMemoryCommand } from '@swarmdo/cli-core';
105
105
 
106
- Track progress: https://github.com/ruvnet/swarmdo/issues/1760`);
106
+ Track progress: the upstream project (see NOTICE)`);
107
107
  process.exit(0);
108
108
  }
109
109
  console.error(`@swarmdo/cli-core: command "${args[0]}" not yet wired into cli-core.
File without changes
File without changes
@@ -5,7 +5,7 @@
5
5
  * Provides real-time progress, metrics, and status information.
6
6
  *
7
7
  * Format matches the working .claude/statusline.sh output:
8
- * ▊ Swarmdo V3 ● ruvnet │ ⎇ v3 │ Opus 4.5
8
+ * ▊ Swarmdo V3 ● upstream │ ⎇ v3 │ Opus 4.5
9
9
  * ─────────────────────────────────────────────────────
10
10
  * 🏗️ DDD Domains [●●●●●] 5/5 ⚡ 1.0x → 2.49x-7.47x
11
11
  * 🤖 Swarm ◉ [58/15] 👥 0 🟢 CVE 3/3 💾 22282MB 📂 47% 🧠 10%
@@ -76,7 +76,7 @@ export declare class StatuslineGenerator {
76
76
  * This avoids the multi-line collision bug where Claude Code's internal status
77
77
  * (written at absolute terminal coordinates ~cols 15-25) bleeds into conversation
78
78
  *
79
- * @see https://github.com/ruvnet/claude-flow/issues/985
79
+ * @see the upstream project (see NOTICE)
80
80
  */
81
81
  generateSingleLine(): string;
82
82
  /**
@@ -84,7 +84,7 @@ export declare class StatuslineGenerator {
84
84
  * The collision zone is columns 15-25 on the SECOND-TO-LAST line
85
85
  * We restructure output so that line has minimal/no content in that zone
86
86
  *
87
- * @see https://github.com/ruvnet/claude-flow/issues/985
87
+ * @see the upstream project (see NOTICE)
88
88
  */
89
89
  generateSafeStatusline(): string;
90
90
  /**
@@ -5,7 +5,7 @@
5
5
  * Provides real-time progress, metrics, and status information.
6
6
  *
7
7
  * Format matches the working .claude/statusline.sh output:
8
- * ▊ Swarmdo V3 ● ruvnet │ ⎇ v3 │ Opus 4.5
8
+ * ▊ Swarmdo V3 ● upstream │ ⎇ v3 │ Opus 4.5
9
9
  * ─────────────────────────────────────────────────────
10
10
  * 🏗️ DDD Domains [●●●●●] 5/5 ⚡ 1.0x → 2.49x-7.47x
11
11
  * 🤖 Swarm ◉ [58/15] 👥 0 🟢 CVE 3/3 💾 22282MB 📂 47% 🧠 10%
@@ -189,7 +189,7 @@ export class StatuslineGenerator {
189
189
  * This avoids the multi-line collision bug where Claude Code's internal status
190
190
  * (written at absolute terminal coordinates ~cols 15-25) bleeds into conversation
191
191
  *
192
- * @see https://github.com/ruvnet/claude-flow/issues/985
192
+ * @see the upstream project (see NOTICE)
193
193
  */
194
194
  generateSingleLine() {
195
195
  if (!this.config.enabled) {
@@ -212,7 +212,7 @@ export class StatuslineGenerator {
212
212
  * The collision zone is columns 15-25 on the SECOND-TO-LAST line
213
213
  * We restructure output so that line has minimal/no content in that zone
214
214
  *
215
- * @see https://github.com/ruvnet/claude-flow/issues/985
215
+ * @see the upstream project (see NOTICE)
216
216
  */
217
217
  generateSafeStatusline() {
218
218
  if (!this.config.enabled) {
@@ -55,7 +55,10 @@ describe('AgenticFlowAgent', () => {
55
55
  });
56
56
  expect(result.success).toBe(true);
57
57
  expect(result.taskId).toBe('task-1');
58
- expect(result.duration).toBeGreaterThan(0);
58
+ // ≥0, not >0: a mocked task can complete inside one Date.now() tick on
59
+ // fast runners — the intent is "duration was measured", not "took time"
60
+ expect(result.duration).toBeGreaterThanOrEqual(0);
61
+ expect(typeof result.duration).toBe('number');
59
62
  expect(agent.metrics?.tasksCompleted).toBe(1);
60
63
  });
61
64
  it('should update status during task execution', async () => {
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * Target: 2-5x speedup on CPU vs naive attention
14
14
  *
15
- * Created with love by ruv.io
15
+ * Created with love by swarmdo.com
16
16
  */
17
17
  export interface FlashAttentionConfig {
18
18
  /** Block size for tiling (32-64 optimal for CPU L1 cache) */
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * Target: 2-5x speedup on CPU vs naive attention
14
14
  *
15
- * Created with love by ruv.io
15
+ * Created with love by swarmdo.com
16
16
  */
17
17
  // ============================================================================
18
18
  // Flash Attention Implementation
@@ -20,7 +20,7 @@ import { PolicyEngine } from './application/policy-engine.js';
20
20
  import { getTrustLevelLabel } from './domain/entities/trust-level.js';
21
21
  // ADR-104: real wire transport via agentic-flow loader pattern.
22
22
  // ADR-120: midstream-aware loader wraps the agentic-flow loader so
23
- // when `midstreamer` (ruvnet/midstream) ships its production QUIC
23
+ // when `midstreamer` (upstream/midstream) ships its production QUIC
24
24
  // build (Step 1 of ADR-120) and operators opt in with
25
25
  // MIDSTREAMER_QUIC_NATIVE=1, the federation transport auto-upgrades.
26
26
  // Until then, the wrapper transparently defers to the agentic-flow
@@ -83,7 +83,7 @@ async function probeMidstreamerTransport(config) {
83
83
  try {
84
84
  // Lazy + indirect so bundlers don't try to resolve at compile time.
85
85
  // Prefer the `midstreamer/quic` sub-path (added in midstreamer@0.3.1
86
- // per upstream ruvnet/midstream#81) which exposes
86
+ // per upstream upstream/midstream#81) which exposes
87
87
  // `loadQuicTransport` directly without WASM init. Fall back to the
88
88
  // root `midstreamer` package for older versions that put the QUIC
89
89
  // surface on the default export.
@@ -112,7 +112,7 @@ async function probeMidstreamerTransport(config) {
112
112
  // QuicMultistream as a counter-tracking stub with no real UDP, TLS,
113
113
  // or protocol — using it would silently downgrade the federation
114
114
  // path. midstreamer@0.3.1+ ships a real QUIC transport via
115
- // `midstreamer/quic` (ADR-120, Step 1 — upstream PR ruvnet/midstream#81)
115
+ // `midstreamer/quic` (ADR-120, Step 1 — upstream PR upstream/midstream#81)
116
116
  // and reports `isNative() === true`. Older versions either expose
117
117
  // `isStub()` returning true or omit both probes.
118
118
  if (typeof surface.isStub === 'function' && surface.isStub()) {
@@ -34,7 +34,7 @@ export declare class SwarmVectorProvider extends BaseProvider {
34
34
  protected doHealthCheck(): Promise<HealthCheckResult>;
35
35
  /**
36
36
  * Build swarmLLM native API query format
37
- * See: https://github.com/ruvnet/swarmvector/tree/main/examples/swarmLLM
37
+ * See: the upstream project (see NOTICE)
38
38
  */
39
39
  private buildSwarmvectorQuery;
40
40
  private buildRequest;
@@ -410,7 +410,7 @@ export class SwarmVectorProvider extends BaseProvider {
410
410
  }
411
411
  /**
412
412
  * Build swarmLLM native API query format
413
- * See: https://github.com/ruvnet/swarmvector/tree/main/examples/swarmLLM
413
+ * See: the upstream project (see NOTICE)
414
414
  */
415
415
  buildSwarmvectorQuery(request) {
416
416
  // swarmLLM uses simple query format, not OpenAI-compatible
@@ -159,14 +159,14 @@ export declare const SpawnAgentSchema: z.ZodObject<{
159
159
  timeout: z.ZodOptional<z.ZodNumber>;
160
160
  }, "strip", z.ZodTypeAny, {
161
161
  type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
162
- id?: string | undefined;
163
162
  config?: Record<string, unknown> | undefined;
164
163
  timeout?: number | undefined;
164
+ id?: string | undefined;
165
165
  }, {
166
166
  type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
167
- id?: string | undefined;
168
167
  config?: Record<string, unknown> | undefined;
169
168
  timeout?: number | undefined;
169
+ id?: string | undefined;
170
170
  }>;
171
171
  /**
172
172
  * Task input schema
@@ -181,13 +181,13 @@ export declare const TaskInputSchema: z.ZodObject<{
181
181
  taskId: string;
182
182
  content: string;
183
183
  agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
184
- priority?: "low" | "medium" | "high" | "critical" | undefined;
184
+ priority?: "critical" | "high" | "medium" | "low" | undefined;
185
185
  metadata?: Record<string, unknown> | undefined;
186
186
  }, {
187
187
  taskId: string;
188
188
  content: string;
189
189
  agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
190
- priority?: "low" | "medium" | "high" | "critical" | undefined;
190
+ priority?: "critical" | "high" | "medium" | "low" | undefined;
191
191
  metadata?: Record<string, unknown> | undefined;
192
192
  }>;
193
193
  /**
@@ -234,16 +234,16 @@ export declare const ExecutorConfigSchema: z.ZodObject<{
234
234
  cwd: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
235
235
  allowSudo: z.ZodDefault<z.ZodBoolean>;
236
236
  }, "strip", z.ZodTypeAny, {
237
- timeout: number;
238
237
  allowedCommands: string[];
238
+ timeout: number;
239
239
  maxBuffer: number;
240
240
  allowSudo: boolean;
241
241
  blockedPatterns?: string[] | undefined;
242
242
  cwd?: string | undefined;
243
243
  }, {
244
244
  allowedCommands: string[];
245
- timeout?: number | undefined;
246
245
  blockedPatterns?: string[] | undefined;
246
+ timeout?: number | undefined;
247
247
  maxBuffer?: number | undefined;
248
248
  cwd?: string | undefined;
249
249
  allowSudo?: boolean | undefined;
@@ -135,7 +135,7 @@ export class GitCommitHook {
135
135
  const result = await this.processCommitMessage(message, branchName);
136
136
  // Modify the command with the new message
137
137
  if (result.success && result.modifiedMessage !== message) {
138
- const modifiedCommand = command.replace(/-m\s+["'][^"']+["']/, `-m "${result.modifiedMessage.replace(/"/g, '\\"')}"`);
138
+ const modifiedCommand = command.replace(/-m\s+["'][^"']+["']/, `-m "${result.modifiedMessage.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`);
139
139
  return {
140
140
  ...result,
141
141
  data: {
@@ -161,7 +161,14 @@ export class HttpTransport extends EventEmitter {
161
161
  setupMiddleware() {
162
162
  // Security headers
163
163
  this.app.use(helmet({
164
- contentSecurityPolicy: false, // Allow for flexibility
164
+ // JSON-RPC API serves no HTML, so a strict CSP is inert for responses but
165
+ // satisfies js/insecure-helmet-configuration (disabling CSP is flagged).
166
+ contentSecurityPolicy: {
167
+ directives: {
168
+ defaultSrc: ["'none'"],
169
+ frameAncestors: ["'none'"],
170
+ },
171
+ },
165
172
  }));
166
173
  // CORS - Secure defaults (no wildcard in production)
167
174
  if (this.config.corsEnabled !== false) {
@@ -60,7 +60,6 @@
60
60
  "build:napi": "bash scripts/optimize-napi.sh",
61
61
  "build:wasm": "bash scripts/optimize-wasm.sh",
62
62
  "build:optimized": "npm run build:napi && npm run build:wasm && npm run build",
63
- "postinstall": "node scripts/postinstall.cjs || true",
64
63
  "dev": "tsx src/cli/agentdb-cli.ts",
65
64
  "test": "vitest",
66
65
  "test:unit": "vitest --run",
@@ -27,7 +27,6 @@
27
27
  "./transport/loader": "./dist/transport/quic-loader.js"
28
28
  },
29
29
  "scripts": {
30
- "postinstall": "node scripts/postinstall.js || true",
31
30
  "start": "node --enable-source-maps dist/index.js",
32
31
  "build": "(npm run build:wasm || true) && (tsc -p config/tsconfig.json --skipLibCheck || true) && mkdir -p dist/reasoningbank && (cp -r src/reasoningbank/prompts dist/reasoningbank/ 2>/dev/null || true) && (cp -r src/reasoningbank/config dist/reasoningbank/ 2>/dev/null || true)",
33
32
  "build:wasm": "cd ../reasoningbank && wasm-pack build --target bundler --out-dir pkg/bundler crates/reasoningbank-wasm && wasm-pack build --target web --out-dir pkg/web crates/reasoningbank-wasm && mkdir -p ../agentic-flow/wasm/reasoningbank && cp -r crates/reasoningbank-wasm/pkg/bundler/* ../agentic-flow/wasm/reasoningbank/ && cp -r crates/reasoningbank-wasm/pkg/web ../agentic-flow/wasm/reasoningbank/",
@@ -1 +0,0 @@
1
- {"sessionId":"1721b33b-8a0d-478b-b149-32452e9ed21e","pid":68057,"procStart":"Sun Jul 5 14:56:32 2026","acquiredAt":1783263800767}
@@ -1,2 +0,0 @@
1
- export { IoTCoordinator, type IoTCoordinatorConfig, type IoTCoordinatorCallbacks, } from './iot-coordinator.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export { IoTCoordinator, } from './iot-coordinator.js';
2
- //# sourceMappingURL=index.js.map