swarmdo 1.4.8 → 1.5.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 (210) hide show
  1. package/.claude/helpers/statusline.cjs +7 -7
  2. package/README.md +3 -1
  3. package/package.json +5 -3
  4. package/v3/@swarmdo/cli/dist/src/commands/hooks.js +26 -24
  5. package/v3/@swarmdo/cli/dist/src/commands/index.js +4 -0
  6. package/v3/@swarmdo/cli/dist/src/commands/integrations.d.ts +14 -0
  7. package/v3/@swarmdo/cli/dist/src/commands/integrations.js +158 -0
  8. package/v3/@swarmdo/cli/dist/src/commands/memory.js +50 -1
  9. package/v3/@swarmdo/cli/dist/src/commands/providers.js +3 -0
  10. package/v3/@swarmdo/cli/dist/src/commands/release.d.ts +15 -0
  11. package/v3/@swarmdo/cli/dist/src/commands/release.js +224 -0
  12. package/v3/@swarmdo/cli/dist/src/commands/security.js +14 -0
  13. package/v3/@swarmdo/cli/dist/src/commands/transcript.js +82 -1
  14. package/v3/@swarmdo/cli/dist/src/commands/usage.js +80 -1
  15. package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +11 -1
  16. package/v3/@swarmdo/cli/dist/src/init/statusline-generator.js +6 -6
  17. package/v3/@swarmdo/cli/dist/src/integrations/integrations.d.ts +54 -0
  18. package/v3/@swarmdo/cli/dist/src/integrations/integrations.js +162 -0
  19. package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-execute-core.js +25 -3
  20. package/v3/@swarmdo/cli/dist/src/mcp-tools/agentdb-tools.js +8 -8
  21. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.d.ts +12 -0
  22. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.js +32 -1
  23. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.d.ts +32 -0
  24. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.js +66 -0
  25. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.d.ts +91 -0
  26. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.js +186 -0
  27. package/v3/@swarmdo/cli/dist/src/release/release.d.ts +72 -0
  28. package/v3/@swarmdo/cli/dist/src/release/release.js +86 -0
  29. package/v3/@swarmdo/cli/dist/src/resilience/backoff.d.ts +23 -0
  30. package/v3/@swarmdo/cli/dist/src/resilience/backoff.js +30 -0
  31. package/v3/@swarmdo/cli/dist/src/swarmvector/model-router.js +14 -0
  32. package/v3/@swarmdo/cli/dist/src/transcript/search.d.ts +39 -0
  33. package/v3/@swarmdo/cli/dist/src/transcript/search.js +67 -0
  34. package/v3/@swarmdo/cli/dist/src/usage/diff.d.ts +69 -0
  35. package/v3/@swarmdo/cli/dist/src/usage/diff.js +112 -0
  36. package/v3/@swarmdo/cli/package.json +4 -4
  37. package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
  38. package/v3/@swarmdo/codex/dist/cli.js +0 -0
  39. package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
  40. package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
  41. package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
  42. package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +4 -1
  43. package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
  44. package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
  45. package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
  46. package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
  47. package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
  48. package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
  49. package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
  50. package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
  51. package/v3/@swarmdo/shared/dist/mcp/transport/http.js +8 -1
  52. package/v3/vendor/agentdb/package.json +0 -1
  53. package/v3/vendor/agentic-flow/package.json +0 -1
  54. package/.claude/scheduled_tasks.lock +0 -1
  55. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  56. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__main__.cpython-314.pyc +0 -0
  57. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/cli.cpython-314.pyc +0 -0
  58. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/compress.cpython-314.pyc +0 -0
  59. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/detect.cpython-314.pyc +0 -0
  60. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  61. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +0 -2
  62. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +0 -2
  63. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +0 -138
  64. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +0 -418
  65. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +0 -15
  66. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +0 -240
  67. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +0 -7
  68. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +0 -508
  69. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +0 -54
  70. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +0 -2
  71. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +0 -46
  72. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +0 -2
  73. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +0 -18
  74. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +0 -28
  75. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +0 -5
  76. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +0 -2
  77. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +0 -35
  78. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +0 -2
  79. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +0 -11
  80. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +0 -2
  81. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +0 -9
  82. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +0 -2
  83. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +0 -5
  84. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +0 -2
  85. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +0 -12
  86. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +0 -2
  87. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +0 -19
  88. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +0 -2
  89. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +0 -44
  90. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +0 -117
  91. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +0 -70
  92. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +0 -194
  93. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +0 -69
  94. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +0 -139
  95. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +0 -34
  96. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +0 -101
  97. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +0 -10
  98. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +0 -10
  99. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +0 -64
  100. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +0 -70
  101. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +0 -44
  102. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +0 -79
  103. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +0 -37
  104. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +0 -39
  105. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +0 -67
  106. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +0 -58
  107. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +0 -45
  108. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +0 -63
  109. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +0 -26
  110. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +0 -17
  111. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +0 -51
  112. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +0 -110
  113. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +0 -13
  114. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +0 -25
  115. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +0 -11
  116. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +0 -19
  117. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +0 -11
  118. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +0 -27
  119. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +0 -6
  120. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +0 -6
  121. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +0 -41
  122. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +0 -64
  123. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +0 -8
  124. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +0 -703
  125. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +0 -23
  126. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +0 -239
  127. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +0 -17
  128. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +0 -42
  129. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +0 -18
  130. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +0 -45
  131. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +0 -19
  132. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +0 -50
  133. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +0 -19
  134. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +0 -47
  135. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +0 -17
  136. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +0 -40
  137. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +0 -18
  138. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +0 -51
  139. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +0 -214
  140. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +0 -595
  141. package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +0 -76
  142. package/v3/@swarmdo/testing/dist/fixtures/agents.js +0 -158
  143. package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +0 -157
  144. package/v3/@swarmdo/testing/dist/fixtures/configurations.js +0 -337
  145. package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +0 -10
  146. package/v3/@swarmdo/testing/dist/fixtures/index.js +0 -17
  147. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +0 -329
  148. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +0 -714
  149. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +0 -159
  150. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +0 -262
  151. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +0 -290
  152. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +0 -547
  153. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +0 -289
  154. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +0 -534
  155. package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +0 -106
  156. package/v3/@swarmdo/testing/dist/fixtures/tasks.js +0 -229
  157. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +0 -213
  158. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +0 -435
  159. package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +0 -135
  160. package/v3/@swarmdo/testing/dist/helpers/assertions.js +0 -217
  161. package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +0 -96
  162. package/v3/@swarmdo/testing/dist/helpers/create-mock.js +0 -164
  163. package/v3/@swarmdo/testing/dist/helpers/index.d.ts +0 -14
  164. package/v3/@swarmdo/testing/dist/helpers/index.js +0 -22
  165. package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +0 -323
  166. package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +0 -350
  167. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +0 -271
  168. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +0 -446
  169. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +0 -142
  170. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +0 -205
  171. package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +0 -190
  172. package/v3/@swarmdo/testing/dist/helpers/test-application.js +0 -138
  173. package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +0 -274
  174. package/v3/@swarmdo/testing/dist/helpers/test-utils.js +0 -456
  175. package/v3/@swarmdo/testing/dist/index.d.ts +0 -42
  176. package/v3/@swarmdo/testing/dist/index.js +0 -66
  177. package/v3/@swarmdo/testing/dist/mocks/index.d.ts +0 -8
  178. package/v3/@swarmdo/testing/dist/mocks/index.js +0 -10
  179. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +0 -206
  180. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +0 -575
  181. package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +0 -287
  182. package/v3/@swarmdo/testing/dist/mocks/mock-services.js +0 -563
  183. package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +0 -109
  184. package/v3/@swarmdo/testing/dist/regression/api-contract.js +0 -374
  185. package/v3/@swarmdo/testing/dist/regression/index.d.ts +0 -18
  186. package/v3/@swarmdo/testing/dist/regression/index.js +0 -18
  187. package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +0 -67
  188. package/v3/@swarmdo/testing/dist/regression/integration-regression.js +0 -334
  189. package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +0 -106
  190. package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +0 -268
  191. package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +0 -124
  192. package/v3/@swarmdo/testing/dist/regression/regression-runner.js +0 -227
  193. package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +0 -73
  194. package/v3/@swarmdo/testing/dist/regression/security-regression.js +0 -258
  195. package/v3/@swarmdo/testing/dist/setup.d.ts +0 -43
  196. package/v3/@swarmdo/testing/dist/setup.js +0 -91
  197. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +0 -10
  198. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +0 -433
  199. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +0 -10
  200. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +0 -352
  201. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +0 -206
  202. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +0 -839
  203. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +0 -10
  204. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +0 -428
  205. package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +0 -38
  206. package/v3/@swarmdo/testing/dist/v2-compat/index.js +0 -41
  207. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +0 -10
  208. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +0 -419
  209. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +0 -34
  210. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.js +0 -372
@@ -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.5.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 — 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
@@ -1,138 +0,0 @@
1
- import type { WitnessChain, CustodyEpoch } from '@cognitum-one/sdk/seed';
2
- import type { StoreQueryResult, IngestResult, StoreHealthStatus } from '../domain/services/telemetry-service.js';
3
- import type { MeshTopology } from '../domain/services/mesh-service.js';
4
- import type { TelemetryBaseline, AnomalyDetectionConfig } from '../domain/services/anomaly-detection-service.js';
5
- import type { CreateFleetOptions, FleetSummary } from '../domain/services/fleet-topology-service.js';
6
- import type { FirmwareRollout } from '../domain/services/firmware-orchestration-service.js';
7
- import type { WitnessVerificationResult } from '../domain/services/witness-verification-service.js';
8
- import type { SONAClient } from '../domain/services/sona-integration-service.js';
9
- import type { TelemetryRepository } from '../domain/repositories/telemetry-repository.js';
10
- import type { DeviceAgent, DeviceTrustLevel, TelemetryReading, AnomalyDetection, DeviceFleet, FleetTopology, FirmwarePolicy } from '../domain/entities/index.js';
11
- import type { DeviceRepository, TrustHistoryRepository, FleetRepository } from '../domain/repositories/index.js';
12
- export interface IoTCoordinatorConfig {
13
- /** Fleet ID assigned to newly registered devices. */
14
- defaultFleetId: string;
15
- /** IEC 62443 security zone assigned to newly registered devices. */
16
- defaultZoneId: string;
17
- /** TLS defaults forwarded to the underlying SeedClientFactory. */
18
- defaultTls?: {
19
- insecure?: boolean;
20
- ca?: string;
21
- };
22
- /** Active health-probe interval (ms) for each SeedClient. */
23
- healthInterval?: number;
24
- /** Optional device persistence repository. */
25
- deviceRepository?: DeviceRepository;
26
- /** Optional trust history repository. */
27
- trustHistoryRepository?: TrustHistoryRepository;
28
- /** Anomaly detection configuration. */
29
- anomalyDetection?: Partial<AnomalyDetectionConfig>;
30
- /** Optional fleet persistence repository. */
31
- fleetRepository?: FleetRepository;
32
- /** Optional SONA neural learning client. */
33
- sonaClient?: SONAClient;
34
- /** Optional HNSW-indexed telemetry repository. */
35
- telemetryRepository?: TelemetryRepository;
36
- }
37
- export interface IoTCoordinatorCallbacks {
38
- onDeviceRegistered?: (device: DeviceAgent) => void;
39
- onTrustChange?: (deviceId: string, oldLevel: DeviceTrustLevel, newLevel: DeviceTrustLevel) => void;
40
- }
41
- /**
42
- * Application-layer coordinator that wires domain services to the
43
- * Cognitum Seed SDK transport. Every public method resolves a
44
- * {@link SeedClient} from the internal registry and delegates to the
45
- * appropriate domain service.
46
- */
47
- export declare class IoTCoordinator {
48
- private readonly factory;
49
- private readonly devices;
50
- private readonly lifecycle;
51
- private readonly telemetry;
52
- private readonly mesh;
53
- private readonly anomalyDetection;
54
- private readonly ingestion;
55
- private readonly fleet;
56
- private readonly firmware;
57
- private readonly witnessVerification;
58
- private readonly sona;
59
- private readonly telemetryRepo?;
60
- private readonly config;
61
- private readonly deviceRepo?;
62
- private readonly trustRepo?;
63
- constructor(config: IoTCoordinatorConfig, callbacks?: IoTCoordinatorCallbacks);
64
- /**
65
- * Register a Seed device by its HTTP endpoint. Creates a
66
- * {@link SeedClient}, fetches status and identity from the real
67
- * hardware, and returns a fully populated {@link DeviceAgent}.
68
- */
69
- registerDevice(endpoint: string, pairingToken?: string): Promise<DeviceAgent>;
70
- /**
71
- * Refresh a device's state from the real hardware and recalculate
72
- * its trust score.
73
- */
74
- getDeviceStatus(deviceId: string): Promise<DeviceAgent>;
75
- /** Pair a registered device, promoting its trust level. */
76
- pairDevice(deviceId: string, clientName: string): Promise<DeviceAgent>;
77
- /** Unpair a registered device, demoting its trust level. */
78
- unpairDevice(deviceId: string): Promise<DeviceAgent>;
79
- /** Run a k-NN query against a device's on-board vector store. */
80
- queryDeviceVectors(deviceId: string, vector: number[], k: number): Promise<StoreQueryResult>;
81
- /** Ingest raw vectors into a device's vector store. */
82
- ingestDeviceTelemetry(deviceId: string, vectors: Array<{
83
- values: number[];
84
- metadata?: Record<string, unknown>;
85
- }>): Promise<IngestResult>;
86
- /** Retrieve vector store health metrics for a device. */
87
- getDeviceStoreStatus(deviceId: string): Promise<StoreHealthStatus>;
88
- /** Get the aggregated mesh topology snapshot for a device. */
89
- getDeviceMeshTopology(deviceId: string): Promise<MeshTopology>;
90
- /** Retrieve the full witness chain from a device. */
91
- getDeviceWitnessChain(deviceId: string): Promise<WitnessChain>;
92
- /** Retrieve the current custody epoch from a device. */
93
- getDeviceCustodyEpoch(deviceId: string): Promise<CustodyEpoch>;
94
- /** Verify witness chain integrity for a device. */
95
- verifyWitnessChain(deviceId: string): Promise<WitnessVerificationResult>;
96
- /** Detect anomalies in a batch of telemetry readings for a device. */
97
- detectAnomalies(deviceId: string, readings: TelemetryReading[]): {
98
- anomalies: AnomalyDetection[];
99
- total: number;
100
- anomalous: number;
101
- };
102
- /** Compute a telemetry baseline for a device from readings. */
103
- computeBaseline(deviceId: string, readings: TelemetryReading[]): TelemetryBaseline;
104
- /** Get the current baseline for a device, if computed. */
105
- getBaseline(deviceId: string): TelemetryBaseline | undefined;
106
- createFirmwareRollout(fleetId: string, firmwareVersion: string): Promise<FirmwareRollout>;
107
- advanceFirmwareRollout(rolloutId: string): Promise<FirmwareRollout>;
108
- rollbackFirmwareRollout(rolloutId: string): FirmwareRollout;
109
- getFirmwareRollout(rolloutId: string): FirmwareRollout;
110
- listFirmwareRollouts(fleetId?: string): FirmwareRollout[];
111
- createFleet(options: CreateFleetOptions): Promise<DeviceFleet>;
112
- getFleet(fleetId: string): Promise<DeviceFleet>;
113
- listFleets(): Promise<FleetSummary[]>;
114
- addDeviceToFleet(fleetId: string, deviceId: string): Promise<DeviceFleet>;
115
- removeDeviceFromFleet(fleetId: string, deviceId: string): Promise<DeviceFleet>;
116
- updateFleetTopology(fleetId: string, topology: FleetTopology): Promise<DeviceFleet>;
117
- updateFleetFirmwarePolicy(fleetId: string, policy: Partial<FirmwarePolicy>): Promise<DeviceFleet>;
118
- deleteFleet(fleetId: string): Promise<void>;
119
- /** List all registered device agents. */
120
- listDevices(): DeviceAgent[];
121
- /** Remove a device from the coordinator and close its SDK client. */
122
- removeDevice(deviceId: string): Promise<void>;
123
- /** Shut down all SDK clients and clear internal state. */
124
- shutdown(): Promise<void>;
125
- /** Health snapshot of the coordinator. */
126
- getStatus(): {
127
- healthy: boolean;
128
- deviceCount: number;
129
- devices: DeviceAgent[];
130
- };
131
- /**
132
- * Resolve a SeedClient by device ID (or temporary endpoint key).
133
- * Throws when the device has not been registered.
134
- */
135
- private resolveClient;
136
- private requireEntry;
137
- }
138
- //# sourceMappingURL=iot-coordinator.d.ts.map