opencode-swarm 7.177.1 → 7.178.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.
Files changed (125) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/agents/architect.d.ts +8 -0
  4. package/dist/cli/{capability-probe-pdwwz8gs.js → capability-probe-8k8ebeyp.js} +2 -2
  5. package/dist/cli/{coder-settlement-c0kysest.js → coder-settlement-m03dfyec.js} +13 -13
  6. package/dist/cli/{config-doctor-bqwse4pd.js → config-doctor-x8b260sh.js} +4 -4
  7. package/dist/cli/{core-e6vtme4x.js → core-2d0xcyby.js} +4 -4
  8. package/dist/cli/{curation-policy-d8s9w1z8.js → curation-policy-7am15ht9.js} +5 -5
  9. package/dist/cli/{curator-2xb1d80j.js → curator-5kfkqzc9.js} +41 -41
  10. package/dist/cli/{curator-drift-4m984tvy.js → curator-drift-d93pwt8h.js} +5 -5
  11. package/dist/cli/curator-llm-factory-rgdb2ee5.js +72 -0
  12. package/dist/cli/{evidence-summary-service-9yxm6jkq.js → evidence-summary-service-959pwbwb.js} +20 -20
  13. package/dist/cli/{gate-evidence-43bnst3v.js → gate-evidence-66kjx6zj.js} +8 -8
  14. package/dist/cli/guardrail-explain-rre9ntq3.js +73 -0
  15. package/dist/cli/{guardrail-log-j7cj3rjy.js → guardrail-log-t0ydqz5s.js} +9 -9
  16. package/dist/cli/{guardrail-reset-jcsyfvf4.js → guardrail-reset-6gad352a.js} +41 -41
  17. package/dist/cli/hive-promoter-zgnagx67.js +87 -0
  18. package/dist/cli/{index-tbswvz8s.js → index-0pmh1kks.js} +2 -2
  19. package/dist/cli/{index-fnq5ac3f.js → index-1hgqs8j8.js} +5 -5
  20. package/dist/cli/{index-bc4x76z7.js → index-1jcy4gc6.js} +41 -41
  21. package/dist/cli/{index-epsy1rh1.js → index-1qnykdaw.js} +43 -43
  22. package/dist/cli/{index-7c24bb1r.js → index-1zrrerev.js} +2 -2
  23. package/dist/cli/{index-5d2avnj9.js → index-2b0ktpbf.js} +2 -2
  24. package/dist/cli/{index-67amf4my.js → index-2e6txjp7.js} +3 -3
  25. package/dist/cli/{index-634pjhe4.js → index-2pyba37z.js} +7 -7
  26. package/dist/cli/{index-7nsvszwn.js → index-3pzwsesm.js} +2 -2
  27. package/dist/cli/{index-bqmxxbrw.js → index-4e4zsj2g.js} +7 -7
  28. package/dist/cli/{index-fpbcxykc.js → index-6b295cas.js} +87 -1
  29. package/dist/cli/{index-1042jnb9.js → index-6e8fpjdg.js} +7 -3
  30. package/dist/cli/{index-822hhbkc.js → index-7kty6f59.js} +9 -9
  31. package/dist/cli/{index-k6bjkqw8.js → index-7n4dtzk4.js} +1 -1
  32. package/dist/cli/{index-yzjaj53h.js → index-9rwhas09.js} +1 -1
  33. package/dist/cli/{index-yrs4wwfq.js → index-b50qevsm.js} +4 -4
  34. package/dist/cli/{index-v2he8xfj.js → index-bb148vht.js} +2 -2
  35. package/dist/cli/{index-hp5eet6g.js → index-byfrearz.js} +4 -4
  36. package/dist/cli/{index-fnw6zfh0.js → index-eq1n57tg.js} +1 -1
  37. package/dist/cli/{index-4ygb35m1.js → index-h0kyy9rd.js} +95 -229
  38. package/dist/cli/{index-eefz8ghz.js → index-h4nh6s8b.js} +1 -1
  39. package/dist/cli/{index-j82xdrqp.js → index-j7w16s92.js} +4 -4
  40. package/dist/cli/{index-t6q73twc.js → index-kj599831.js} +2 -2
  41. package/dist/cli/{index-drgt81xf.js → index-ksq6cqg0.js} +14 -7
  42. package/dist/cli/{index-tj0sdxg9.js → index-kz9pcqn9.js} +2 -2
  43. package/dist/cli/{index-n7nzwz0q.js → index-m2n1rhgv.js} +8 -0
  44. package/dist/cli/{index-yhaxn5r7.js → index-ne9zamcs.js} +9 -9
  45. package/dist/cli/{index-vfp9hjgv.js → index-nrfjjqm4.js} +1 -1
  46. package/dist/cli/{index-xnednxvm.js → index-nzekzzs2.js} +4 -4
  47. package/dist/cli/{index-2jtmevrr.js → index-pk97v7b8.js} +6 -6
  48. package/dist/cli/{index-7ntcak58.js → index-pyxs697r.js} +34 -9
  49. package/dist/cli/{index-m0cdjvtv.js → index-qbs49vge.js} +30 -2
  50. package/dist/cli/{index-qgf5xexz.js → index-r78kphsr.js} +4 -4
  51. package/dist/cli/{index-exhm2ztr.js → index-s4bkey0q.js} +1 -1
  52. package/dist/cli/{index-en0p0hqp.js → index-t8dqe4ns.js} +1 -1
  53. package/dist/cli/{index-t2nf57mv.js → index-w1b5qqnp.js} +2 -2
  54. package/dist/cli/{index-yepxmq4f.js → index-wajcx84s.js} +3418 -2893
  55. package/dist/cli/{index-1bq6hkw5.js → index-whjrhatw.js} +1 -1
  56. package/dist/cli/{index-76qm2c2y.js → index-wvghb3x6.js} +4 -4
  57. package/dist/cli/{index-fgv6qp10.js → index-x1m1nnry.js} +37 -6
  58. package/dist/cli/{index-k330631a.js → index-x54339yd.js} +5 -5
  59. package/dist/cli/{index-cv191ybt.js → index-xr3eye3f.js} +8 -8
  60. package/dist/cli/{index-wemtrnch.js → index-xr9n0vjv.js} +2 -2
  61. package/dist/cli/{index-eya03h5m.js → index-yew23624.js} +7 -7
  62. package/dist/cli/{index-e48h8m73.js → index-zv3j0v08.js} +9 -5
  63. package/dist/cli/index.js +42 -42
  64. package/dist/cli/{knowledge-escalator-j4jcpver.js → knowledge-escalator-5r6mww64.js} +13 -13
  65. package/dist/cli/{knowledge-events-fcpzfp2m.js → knowledge-events-typjw0sd.js} +11 -11
  66. package/dist/cli/{knowledge-link-9z3fha35.js → knowledge-link-mvykydxg.js} +4 -4
  67. package/dist/cli/{knowledge-store-6evy197p.js → knowledge-store-9qcf3emn.js} +5 -5
  68. package/dist/cli/{knowledge-validator-s28b1ddg.js → knowledge-validator-k6ydsxzy.js} +7 -7
  69. package/dist/cli/{mcp-9kqsnehc.js → mcp-tedxsgey.js} +48 -7
  70. package/dist/cli/mcp.d.ts +9 -0
  71. package/dist/cli/{model-preflight-1pp1a4yf.js → model-preflight-kh9dwts2.js} +1 -1
  72. package/dist/cli/{pending-delegations-e15f26e0.js → pending-delegations-d20fnrzv.js} +12 -12
  73. package/dist/cli/{pr-subscriptions-mqv51zvm.js → pr-subscriptions-awwhg139.js} +12 -12
  74. package/dist/cli/{pr-workflow-gate-fj31btdv.js → pr-workflow-gate-ke79bb9c.js} +41 -41
  75. package/dist/cli/{runner-yhfmejzb.js → runner-y3sydwtj.js} +5 -5
  76. package/dist/cli/{scan-cursor-tpnq7e56.js → scan-cursor-16s6dp7f.js} +6 -6
  77. package/dist/cli/{schema-1wwcyaxp.js → schema-nqjp43vq.js} +4 -2
  78. package/dist/cli/{scope-persistence-332nvn9b.js → scope-persistence-8z1hwdr2.js} +21 -17
  79. package/dist/cli/{server-19bpfaps.js → server-x16hp9aq.js} +2062 -741
  80. package/dist/cli/{skill-generator-gn1k4yxj.js → skill-generator-xadg43ph.js} +15 -15
  81. package/dist/cli/{snapshot-coordination-init-6ztt4v99.js → snapshot-coordination-init-3yyzb2c4.js} +41 -41
  82. package/dist/cli/{telemetry-w774xb8g.js → telemetry-c9wv2cfw.js} +1 -1
  83. package/dist/cli/{workspace-snapshot-9gqna7gq.js → workspace-snapshot-rfnn80dg.js} +3 -3
  84. package/dist/cli/{worktree-collision-ownership-q2ydb0ph.js → worktree-collision-ownership-drqhmmtd.js} +13 -13
  85. package/dist/cli/{worktree-isolation-fsqe1qdv.js → worktree-isolation-aebdyb1m.js} +41 -41
  86. package/dist/commands/dashboard.d.ts +15 -0
  87. package/dist/commands/registry.d.ts +7 -0
  88. package/dist/config/plan-schema.d.ts +23 -0
  89. package/dist/config/schema.d.ts +16 -0
  90. package/dist/dashboard/assets.d.ts +12 -0
  91. package/dist/dashboard/index.d.ts +74 -0
  92. package/dist/dashboard/server.d.ts +94 -0
  93. package/dist/dashboard/views.d.ts +131 -0
  94. package/dist/evidence/phase-participation.d.ts +3 -2
  95. package/dist/hooks/delegation-gate.d.ts +1 -1
  96. package/dist/hooks/extractors.d.ts +5 -1
  97. package/dist/hooks/index.d.ts +1 -1
  98. package/dist/hooks/tool-summarizer.d.ts +7 -2
  99. package/dist/index.js +676 -513
  100. package/dist/mcp/adapters/knowledge-add.d.ts +19 -0
  101. package/dist/mcp/adapters/receipt-status.d.ts +3 -0
  102. package/dist/mcp/adapters/scope-validation.d.ts +3 -0
  103. package/dist/mcp/registry.d.ts +26 -14
  104. package/dist/mcp/server.d.ts +5 -0
  105. package/dist/mcp/write-receipts.d.ts +168 -0
  106. package/dist/memory/index.d.ts +1 -0
  107. package/dist/memory/memory-family-migration.d.ts +35 -3
  108. package/dist/plan/ledger.d.ts +14 -0
  109. package/dist/plan/manager.d.ts +0 -2
  110. package/dist/plan/parallel-verdict.d.ts +28 -14
  111. package/dist/scope/scope-persistence.d.ts +41 -0
  112. package/dist/summaries/index.d.ts +1 -1
  113. package/dist/summaries/manager.d.ts +27 -1
  114. package/dist/tools/index.d.ts +2 -0
  115. package/dist/tools/knowledge-receipt-status.d.ts +8 -0
  116. package/dist/tools/manifest.d.ts +2 -0
  117. package/dist/tools/plan-conflict-check.d.ts +7 -6
  118. package/dist/tools/scope-validate.d.ts +55 -0
  119. package/dist/tools/tool-metadata.d.ts +8 -0
  120. package/dist/utils/path-security.d.ts +21 -0
  121. package/opencode-swarm.schema.json +14 -0
  122. package/package.json +1 -1
  123. package/dist/cli/curator-llm-factory-fywmb8jh.js +0 -72
  124. package/dist/cli/guardrail-explain-gm69b76w.js +0 -73
  125. package/dist/cli/hive-promoter-hc0r0z9h.js +0 -87
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Read-only dashboard data layer (issue #2509).
3
+ *
4
+ * Every view composes the repo's existing bounded read APIs — this module
5
+ * holds no authoritative state and performs no durable writes of its own;
6
+ * the one exception is shared plumbing: on a legacy-telemetry-only project,
7
+ * the observability coverage read (same call `/swarm report` makes) may
8
+ * materialize `.swarm/swarm.db` via its rebuildable-import path
9
+ * (observability-event-store, issue #2482). Design rules (AGENTS invariants
10
+ * 4/5, issue #2509 AC4/AC6/AC7):
11
+ *
12
+ * - DB reads go through the sanctioned read-only surface
13
+ * (`withProjectDbReadOnly`) or store readers that already fail closed on an
14
+ * absent DB; anything that would open the shared writer handle is guarded
15
+ * by `projectDbExists` so a read-only view can never materialize a
16
+ * `.swarm/` tree that does not exist yet.
17
+ * - Every string rendered into a payload passes through
18
+ * `sanitizeFailureEvidenceDisplay` (the house no-secrets posture —
19
+ * src/failures/invocation-failure.ts, kin to the src/commands/_shared/
20
+ * url-security.ts standard named by the issue) plus the URL-credential and
21
+ * filesystem-path prescrubs below — no field class is exempt; plain
22
+ * identifiers simply survive it.
23
+ * - Row counts and per-field lengths are capped so responses stay bounded
24
+ * against very large stores (AC7).
25
+ */
26
+ import { type SwarmDbHealthSnapshot } from '../db/health.js';
27
+ interface GateProfileSummaryRow {
28
+ planId: string;
29
+ enabledGates: string[];
30
+ }
31
+ interface CircuitSummaryRow {
32
+ label: string;
33
+ state: string;
34
+ generation: number | null;
35
+ since: string | null;
36
+ }
37
+ export interface GatesView {
38
+ available: boolean;
39
+ unavailableReason?: string;
40
+ profileCount: number;
41
+ profiles: GateProfileSummaryRow[];
42
+ enabledCounts: Record<string, number>;
43
+ circuits: CircuitSummaryRow[];
44
+ }
45
+ export interface DelegationBandRow {
46
+ band: string;
47
+ count: number;
48
+ oldestAgeMs: number | null;
49
+ }
50
+ export interface DelegationRow {
51
+ correlationId: string;
52
+ agent: string;
53
+ status: string;
54
+ planTaskId: string;
55
+ ageMinutes: number | null;
56
+ }
57
+ export interface DelegationsView {
58
+ available: boolean;
59
+ unavailableReason?: string;
60
+ total: number;
61
+ bands: DelegationBandRow[];
62
+ recent: DelegationRow[];
63
+ }
64
+ export interface LaneRow {
65
+ correlationId: string;
66
+ laneId: string;
67
+ batchId: string;
68
+ workflowLane: string;
69
+ status: string;
70
+ pendingMinutes: number | null;
71
+ staleSuspect: boolean;
72
+ }
73
+ export interface LanesView {
74
+ available: boolean;
75
+ unavailableReason?: string;
76
+ lanes: LaneRow[];
77
+ staleSuspectCount: number;
78
+ }
79
+ export interface TaskRow {
80
+ id: string;
81
+ phase: number;
82
+ status: string;
83
+ description: string;
84
+ }
85
+ export interface TasksView {
86
+ available: boolean;
87
+ unavailableReason?: string;
88
+ title: string;
89
+ currentPhase: number | null;
90
+ tasks: TaskRow[];
91
+ }
92
+ export interface TimelineEventRow {
93
+ occurredAt: string;
94
+ kind: string;
95
+ severity: string;
96
+ taskId: string;
97
+ sessionId: string;
98
+ payload: string;
99
+ }
100
+ export interface TimelineView {
101
+ available: boolean;
102
+ unavailableReason?: string;
103
+ totalMatching: number;
104
+ truncated: boolean;
105
+ events: TimelineEventRow[];
106
+ }
107
+ export interface OverviewView {
108
+ dbHealth: SwarmDbHealthSnapshot;
109
+ gates: GatesView;
110
+ delegations: DelegationsView;
111
+ lanes: LanesView;
112
+ tasks: TasksView;
113
+ timeline: TimelineView;
114
+ }
115
+ export declare function renderGatesView(directory: string): GatesView;
116
+ export declare function renderDelegationsView(directory: string): DelegationsView;
117
+ export declare function renderLanesView(directory: string): LanesView;
118
+ export declare function renderTasksView(directory: string): Promise<TasksView>;
119
+ export declare function renderTimelineView(directory: string): TimelineView;
120
+ export interface DashboardStatusView {
121
+ dbHealth: SwarmDbHealthSnapshot;
122
+ observabilityCoverage: {
123
+ available: boolean;
124
+ totalRows?: number;
125
+ earliestOccurredAt?: string | null;
126
+ latestOccurredAt?: string | null;
127
+ };
128
+ }
129
+ export declare function renderStatusView(directory: string): DashboardStatusView;
130
+ export declare function renderOverviewView(directory: string): Promise<OverviewView>;
131
+ export {};
@@ -42,8 +42,9 @@ export declare function completeBackgroundPhaseParticipation(input: {
42
42
  }): Promise<boolean>;
43
43
  export declare function readPhaseParticipation(directory: string, plan: Plan, phase: number, role: string): Promise<ParticipationReadResult>;
44
44
  /**
45
- * Re-stamp receipts that were tagged with the plan's static `current_phase`
46
- * cursor (issue #2702) to the phase whose completion is being recorded. Called
45
+ * Re-stamp receipts that were tagged with the plan's `current_phase` cursor
46
+ * at dispatch time (issue #2702 origin; the cursor is live since #2532) to
47
+ * the phase whose completion is being recorded. Called
47
48
  * from the phase_complete success path so a cursor-mistagged receipt, once it
48
49
  * has satisfied the completing phase's gate, cannot also satisfy a later
49
50
  * phase — per-phase docs participation stays enforced. Idempotent: a second
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
8
8
  import type { PluginConfig } from '../config';
9
- import type { Plan } from '../config/plan-schema';
9
+ import { type Plan } from '../config/plan-schema';
10
10
  import { type QaGates } from '../db/qa-gate-profile.js';
11
11
  import { loadPlanJsonOnly } from '../plan/manager';
12
12
  import type { AgentSessionState } from '../state';
@@ -1,4 +1,4 @@
1
- import type { Plan } from '../config/plan-schema';
1
+ import { type Plan } from '../config/plan-schema';
2
2
  /**
3
3
  * Swarm File Extractors
4
4
  *
@@ -36,6 +36,10 @@ export declare function extractIncompleteTasks(planContent: string, maxChars?: n
36
36
  export declare function extractPatterns(contextContent: string, maxChars?: number): string | null;
37
37
  /**
38
38
  * Extracts current phase info from a Plan object.
39
+ *
40
+ * #2532: resolves the phase through the canonical active-phase resolver so a
41
+ * stale stored cursor (legacy plans whose current_phase never advanced) can
42
+ * never suppress the summary — the honest active phase is reported instead.
39
43
  */
40
44
  export declare function extractCurrentPhaseFromPlan(plan: Plan): string | null;
41
45
  /**
@@ -19,5 +19,5 @@ export { createPipelineTrackerHook } from './pipeline-tracker';
19
19
  export { createRepoGraphBuilderHook, type RepoGraphBuilderHook, } from './repo-graph-builder';
20
20
  export { buildApprovedReceipt, buildReceiptContextForDrift, buildRejectedReceipt, persistReviewReceipt, readAllReceipts, readReceiptsByScopeHash, } from './review-receipt';
21
21
  export { createSystemEnhancerHook } from './system-enhancer';
22
- export { createToolSummarizerHook, resetSummaryIdCounter, } from './tool-summarizer';
22
+ export { createToolSummarizerHook } from './tool-summarizer';
23
23
  export { composeBlockingHandlers, composeHandlers, estimateTokens, readSwarmFileAsync, safeHook, validateSwarmPath, } from './utils';
@@ -6,10 +6,15 @@
6
6
  * the output with a compact summary containing a retrieval ID.
7
7
  */
8
8
  import type { SummaryConfig } from '../config/schema';
9
+ import { allocateSummaryId, storeSummary } from '../summaries/manager';
9
10
  /**
10
- * Reset the summary ID counter. Used for testing.
11
+ * Dependency seam for tests (repo `_internals` DI convention) so the
12
+ * collision-retry path is unit-testable without `mock.module`.
11
13
  */
12
- export declare function resetSummaryIdCounter(): void;
14
+ export declare const _internals: {
15
+ allocateSummaryId: typeof allocateSummaryId;
16
+ storeSummary: typeof storeSummary;
17
+ };
13
18
  /**
14
19
  * Creates a tool.execute.after hook that summarizes oversized tool outputs.
15
20
  *