opencode-swarm 7.167.1 → 7.167.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/project-context.d.ts +12 -8
- package/dist/cli/{coder-settlement-2ye4s5xr.js → coder-settlement-jy9rad28.js} +16 -16
- package/dist/cli/{config-doctor-b0k8eyd6.js → config-doctor-p66vnpy3.js} +3 -3
- package/dist/cli/{core-xgzgjk8s.js → core-tw0wtntz.js} +4 -4
- package/dist/cli/{curation-policy-bvxf5pxv.js → curation-policy-ndp27v0c.js} +7 -7
- package/dist/cli/{curator-jpvzrxcv.js → curator-5nzde80g.js} +45 -45
- package/dist/cli/{curator-drift-20m2ab5w.js → curator-drift-gb651hcw.js} +8 -8
- package/dist/cli/curator-llm-factory-xy96x5x8.js +71 -0
- package/dist/cli/{dispatch-tmb929w8.js → dispatch-8ks9dyk5.js} +244 -70
- package/dist/cli/{evidence-summary-service-74az43cb.js → evidence-summary-service-bzpfaypy.js} +22 -22
- package/dist/cli/{explorer-zvk5kbcb.js → explorer-2cv64zfj.js} +1 -1
- package/dist/cli/{gate-evidence-f26h2gn3.js → gate-evidence-wa8cj8h6.js} +11 -11
- package/dist/cli/guardrail-explain-1ef5he6j.js +72 -0
- package/dist/cli/{guardrail-log-pnye3xw8.js → guardrail-log-7dv73e0q.js} +9 -9
- package/dist/cli/{guardrail-reset-0da7q8ap.js → guardrail-reset-1kng6y8x.js} +44 -44
- package/dist/cli/hive-promoter-87kk2pg5.js +86 -0
- package/dist/cli/{index-fmzz6aw7.js → index-09gv90d7.js} +4 -4
- package/dist/cli/{index-9e6fdz2h.js → index-0mhftbpp.js} +1 -1
- package/dist/cli/{index-t8tw1bhs.js → index-0q839sg6.js} +2 -2
- package/dist/cli/{index-9bhzbwa4.js → index-18rfc7qv.js} +9 -9
- package/dist/cli/{index-7qefgq4j.js → index-1xnse449.js} +11 -1
- package/dist/cli/index-25xeyjfx.js +116 -0
- package/dist/cli/{index-87agfprq.js → index-2b1hd1fx.js} +2 -2
- package/dist/cli/{index-bv8ha57q.js → index-3r6k6qa7.js} +6 -6
- package/dist/cli/{index-69y9p6dh.js → index-3ws11dq0.js} +2 -2
- package/dist/cli/{index-eretcr6t.js → index-5sjq3shs.js} +11 -11
- package/dist/cli/{index-8x4zwk0t.js → index-65s0vgb1.js} +47 -47
- package/dist/cli/{index-es13aqdb.js → index-79234evf.js} +1 -1
- package/dist/cli/{index-5bd84nxc.js → index-83r0v5tn.js} +1 -1
- package/dist/cli/{index-sahf5yz3.js → index-8vbahc4c.js} +1 -1
- package/dist/cli/{index-6d4dc99f.js → index-962qme08.js} +1 -1
- package/dist/cli/{index-9ss2m4rs.js → index-9br68j86.js} +1 -1
- package/dist/cli/{index-4rhhvd1a.js → index-a1w58b47.js} +1 -1
- package/dist/cli/{index-qyr17fbz.js → index-arqv4psy.js} +16 -16
- package/dist/cli/{index-qtd3hrk8.js → index-ce8p9t28.js} +5 -5
- package/dist/cli/{index-q265ytw6.js → index-dme7wvwg.js} +4 -4
- package/dist/cli/{index-54vzqy47.js → index-ehq2vtkq.js} +6 -6
- package/dist/cli/{index-1aex5zd9.js → index-f8cc92g7.js} +2 -2
- package/dist/cli/{index-bzdc4b7t.js → index-f91fhch0.js} +6 -6
- package/dist/cli/{index-70ha9e09.js → index-fyfbpz4f.js} +1 -1
- package/dist/cli/{index-75f9jj3h.js → index-g409c7ke.js} +2 -2
- package/dist/cli/{index-0tc0pcmh.js → index-g5m43paw.js} +37 -2
- package/dist/cli/{index-9wv6a3jx.js → index-gmjg65tm.js} +2 -2
- package/dist/cli/{index-qd726agw.js → index-gs12223x.js} +3 -3
- package/dist/cli/{index-rk10x4zr.js → index-hhkm64wh.js} +5 -5
- package/dist/cli/{index-mgc3c483.js → index-jhd3pmd1.js} +10 -10
- package/dist/cli/{index-m3tx1q9v.js → index-k73ehxa1.js} +1 -1
- package/dist/cli/{index-z5gdgdkp.js → index-m3z83nhs.js} +12 -12
- package/dist/cli/{index-251vrmge.js → index-m7cwnt9r.js} +4 -4
- package/dist/cli/{index-3nm1b3t2.js → index-mtepgqan.js} +8 -8
- package/dist/cli/{index-79wnzc8q.js → index-pdcperq5.js} +3 -3
- package/dist/cli/{index-bf6zx8cq.js → index-rrne6g2m.js} +2 -2
- package/dist/cli/{index-hdsg7yf6.js → index-s7a9dqtb.js} +3 -3
- package/dist/cli/{index-f8xk5q5j.js → index-shrf0wt3.js} +4 -4
- package/dist/cli/{index-zwsbegc1.js → index-sjkg2hc4.js} +7 -7
- package/dist/cli/{index-qww0h314.js → index-syedr4e3.js} +1 -1
- package/dist/cli/{index-f6zgz02s.js → index-tcj8v6my.js} +3 -3
- package/dist/cli/{index-2w0beg3s.js → index-vgpedapd.js} +5 -5
- package/dist/cli/{index-emwezg3y.js → index-wjet7x0a.js} +3 -3
- package/dist/cli/{index-m21x1bkx.js → index-x7pm61wk.js} +2 -0
- package/dist/cli/{index-32bxwzw0.js → index-y1sj2e1n.js} +92719 -90312
- package/dist/cli/{index-qd619x3r.js → index-z6we1abx.js} +2 -2
- package/dist/cli/{index-fenasyvr.js → index-z7z3g5wt.js} +62 -12
- package/dist/cli/index.js +44 -44
- package/dist/cli/{knowledge-escalator-p2a8xh8x.js → knowledge-escalator-5e4zxan5.js} +17 -17
- package/dist/cli/{knowledge-events-jmh28m8d.js → knowledge-events-abzm5vfh.js} +15 -15
- package/dist/cli/{knowledge-link-w1fwqts4.js → knowledge-link-9ga6hyd5.js} +6 -6
- package/dist/cli/{knowledge-store-8gmabtsn.js → knowledge-store-q4a92eq7.js} +7 -7
- package/dist/cli/{knowledge-validator-yk579vs4.js → knowledge-validator-pn3m5r41.js} +9 -9
- package/dist/cli/{model-preflight-b3b5pgsc.js → model-preflight-mw895vgt.js} +1 -1
- package/dist/cli/{pending-delegations-nw7ph53z.js → pending-delegations-3z0xjppd.js} +14 -14
- package/dist/cli/{pr-subscriptions-9815fxbc.js → pr-subscriptions-h7mwnp62.js} +14 -14
- package/dist/cli/{pr-workflow-gate-98a7b6py.js → pr-workflow-gate-fec04fa0.js} +44 -44
- package/dist/cli/{runner-nmrjv7te.js → runner-d9833azt.js} +7 -7
- package/dist/cli/{scan-cursor-6zcs0frg.js → scan-cursor-ymfvzdkz.js} +10 -10
- package/dist/cli/{schema-warvhy9h.js → schema-chc4aez6.js} +2 -2
- package/dist/cli/{scope-persistence-c2ck77cv.js → scope-persistence-3xnr59y8.js} +20 -20
- package/dist/cli/{skill-generator-jamm1cna.js → skill-generator-3mvaghxk.js} +19 -19
- package/dist/cli/{snapshot-coordination-init-st0xsn3f.js → snapshot-coordination-init-arnc77r9.js} +44 -44
- package/dist/cli/{telemetry-ce0tx41h.js → telemetry-g9pppt9e.js} +2 -2
- package/dist/cli/{workspace-snapshot-0kxj2grt.js → workspace-snapshot-hvsjtepd.js} +6 -6
- package/dist/cli/{worktree-collision-ownership-qra7r8pw.js → worktree-collision-ownership-vj8anvb7.js} +17 -17
- package/dist/cli/{worktree-isolation-yr9gnf64.js → worktree-isolation-mt7z75hz.js} +45 -45
- package/dist/commands/close/align-stage.d.ts +10 -0
- package/dist/commands/close/archive-stage.d.ts +34 -0
- package/dist/commands/close/clean-stage.d.ts +2 -0
- package/dist/commands/close/constants.d.ts +122 -0
- package/dist/commands/close/context.d.ts +129 -0
- package/dist/commands/close/db-helpers.d.ts +10 -0
- package/dist/commands/close/dry-run.d.ts +12 -0
- package/dist/commands/close/finalize-stage.d.ts +44 -0
- package/dist/commands/close/fs-helpers.d.ts +17 -0
- package/dist/commands/close/internals.d.ts +55 -0
- package/dist/commands/close/orchestrator.d.ts +32 -0
- package/dist/commands/close/wiring.d.ts +2 -0
- package/dist/commands/close.d.ts +10 -402
- package/dist/index.js +485 -485
- package/dist/lang/dispatch.d.ts +6 -6
- package/dist/utils/canonical-root.d.ts +19 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-zeb0pe2j.js +0 -71
- package/dist/cli/guardrail-explain-5vhveypz.js +0 -72
- package/dist/cli/hive-promoter-2vj54xc4.js +0 -86
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { KnowledgeConfig, PluginConfig } from '../../config/schema';
|
|
2
|
+
import type { SessionReflectionResult } from '../../services/session-reflection';
|
|
3
|
+
import type { SqliteRowCounts } from '../archive-sqlite';
|
|
4
|
+
export interface PlanPhase {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
status: string;
|
|
8
|
+
tasks: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
status: string;
|
|
11
|
+
close_reason?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export interface PlanData {
|
|
15
|
+
title: string;
|
|
16
|
+
phases: PlanPhase[];
|
|
17
|
+
}
|
|
18
|
+
export interface CloseCommandOptions {
|
|
19
|
+
sessionID?: string;
|
|
20
|
+
skillReviewTimeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface CurationCounts {
|
|
23
|
+
stored: number;
|
|
24
|
+
/** Issue #2077: surfaced for the reflection knowledge-delta report. */
|
|
25
|
+
reinforced: number;
|
|
26
|
+
skipped: number;
|
|
27
|
+
rejected: number;
|
|
28
|
+
quarantined: number;
|
|
29
|
+
}
|
|
30
|
+
export interface CloseKnowledgeEntry {
|
|
31
|
+
created_at?: string;
|
|
32
|
+
}
|
|
33
|
+
export type ArchiveRequiredness = 'required' | 'optional';
|
|
34
|
+
export type ArchiveAttempt = 'not_attempted' | 'succeeded' | 'failed';
|
|
35
|
+
export type ArchiveValidation = 'not_applicable' | 'passed' | 'failed';
|
|
36
|
+
export type ArchiveSourceDisposition = 'absent' | 'retained' | 'removed';
|
|
37
|
+
export interface ArtifactArchiveResult {
|
|
38
|
+
artifact: string;
|
|
39
|
+
requiredness: ArchiveRequiredness;
|
|
40
|
+
attempt: ArchiveAttempt;
|
|
41
|
+
validation: ArchiveValidation;
|
|
42
|
+
source_disposition: ArchiveSourceDisposition;
|
|
43
|
+
method: string;
|
|
44
|
+
reason_code: string;
|
|
45
|
+
/** Counts only (no row content), present for validated sqlite snapshots. */
|
|
46
|
+
row_counts?: SqliteRowCounts;
|
|
47
|
+
/** Non-sensitive diagnostic. */
|
|
48
|
+
detail?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ArchiveStageContext {
|
|
51
|
+
directory: string;
|
|
52
|
+
swarmDir: string;
|
|
53
|
+
config: PluginConfig;
|
|
54
|
+
warnings: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface CloseStageContext {
|
|
57
|
+
directory: string;
|
|
58
|
+
swarmDir: string;
|
|
59
|
+
planData: PlanData;
|
|
60
|
+
planExists: boolean;
|
|
61
|
+
planAlreadyDone: boolean;
|
|
62
|
+
config: KnowledgeConfig;
|
|
63
|
+
projectName: string;
|
|
64
|
+
warnings: string[];
|
|
65
|
+
closedPhases: number[];
|
|
66
|
+
closedTasks: string[];
|
|
67
|
+
sessionStart: string | undefined;
|
|
68
|
+
isForced: boolean;
|
|
69
|
+
runSkillReview: boolean;
|
|
70
|
+
options: CloseCommandOptions;
|
|
71
|
+
phases: PlanPhase[];
|
|
72
|
+
inProgressPhases: PlanPhase[];
|
|
73
|
+
curationSucceeded: boolean;
|
|
74
|
+
curationResult: CurationCounts | undefined;
|
|
75
|
+
allLessons: string[];
|
|
76
|
+
explicitLessons: string[];
|
|
77
|
+
retroLessons: string[];
|
|
78
|
+
knowledgeSkillHint: string;
|
|
79
|
+
skillReviewSummary: string;
|
|
80
|
+
postMortemSummary: string;
|
|
81
|
+
sessionReflection: SessionReflectionResult | undefined;
|
|
82
|
+
hivePromoted: number;
|
|
83
|
+
sessionKnowledgeCreated: number;
|
|
84
|
+
fallbackKnowledgeCreated: number;
|
|
85
|
+
/** Issue #2077: FR-015 dedup drop count (retro lessons dropped as already-known). */
|
|
86
|
+
dedupDropped: number;
|
|
87
|
+
/** Issue #2077: false when the dedup knowledge read failed (fail-open). */
|
|
88
|
+
dedupAvailable: boolean;
|
|
89
|
+
/** Issue #2077: total retro lessons before dedup. */
|
|
90
|
+
retroLessonTotal: number;
|
|
91
|
+
/** Issue #2077: full-auto state computed once, reused at reflection + menu render. */
|
|
92
|
+
fullAuto: boolean;
|
|
93
|
+
originalStatuses: Map<string, string>;
|
|
94
|
+
guaranteeResult: {
|
|
95
|
+
closedPhaseIds: number[];
|
|
96
|
+
closedTaskIds: string[];
|
|
97
|
+
};
|
|
98
|
+
terminalizationError?: string;
|
|
99
|
+
archiveResult: string;
|
|
100
|
+
archivedFileCount: number;
|
|
101
|
+
archivedActiveStateFiles: Set<string>;
|
|
102
|
+
archivedActiveStateDirs: Set<string>;
|
|
103
|
+
archiveFailureReasons: Map<string, string>;
|
|
104
|
+
/** Structured per-artifact results — single source of truth (issue #2030). */
|
|
105
|
+
archiveResults: ArtifactArchiveResult[];
|
|
106
|
+
/** True when the archive STAGE threw wholesale (e.g. mkdir EACCES/ENOSPC). */
|
|
107
|
+
archiveStageFailed: boolean;
|
|
108
|
+
timestamp: string;
|
|
109
|
+
archiveDir: string;
|
|
110
|
+
archiveSuffix: string;
|
|
111
|
+
args: string[];
|
|
112
|
+
}
|
|
113
|
+
export interface GitAlignResult {
|
|
114
|
+
gitAlignResult: string;
|
|
115
|
+
prunedBranches: string[];
|
|
116
|
+
}
|
|
117
|
+
export interface CleanStageResult {
|
|
118
|
+
cleanedFiles: string[];
|
|
119
|
+
configBackupsRemoved: number;
|
|
120
|
+
swarmPlanFilesRemoved: number;
|
|
121
|
+
/**
|
|
122
|
+
* Stale atomic-write temp files MOVED into `.swarm/quarantine/<batch>/`
|
|
123
|
+
* (issue #2035). Quarantine is a recoverable move with a manifest — the
|
|
124
|
+
* pre-#2035 blind `.tmp.*` unlink sweep is gone; preserved candidates
|
|
125
|
+
* (recent/active/tracked/ambiguous) are counted in `residuePreserved`.
|
|
126
|
+
*/
|
|
127
|
+
residueQuarantined: number;
|
|
128
|
+
residuePreserved: number;
|
|
129
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove the SQLite WAL sidecars (swarm.db-wal / swarm.db-shm) immediately
|
|
3
|
+
* after the clean stage unlinks swarm.db (#2483, deliberately reversing the
|
|
4
|
+
* #1692 preserve decision): once the main db is unlinked the sidecar paths
|
|
5
|
+
* are meaningless for future opens — no new opener can attach — and live
|
|
6
|
+
* processes keep their already-open fds, so deleting the PATH cannot corrupt
|
|
7
|
+
* them. Best-effort and per-file fail-open: ENOENT (already gone) and EBUSY
|
|
8
|
+
* (Windows open-handle collision) are skipped silently.
|
|
9
|
+
*/
|
|
10
|
+
export declare function removeSqliteSidecarsAfterClose(swarmDir: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlanData } from './context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the `/swarm finalize --dry-run` report. Purely READ-ONLY: inspects the
|
|
4
|
+
* plan and the filesystem and describes what a real finalize WOULD do, without
|
|
5
|
+
* acquiring the finalize lock, creating an archive bundle, deleting any file,
|
|
6
|
+
* running git, or tearing down session state. (#1692)
|
|
7
|
+
*
|
|
8
|
+
* The archive-first guard means the clean stage only removes files it first
|
|
9
|
+
* archived successfully; this report approximates that by listing existing
|
|
10
|
+
* clean-set members as "would remove" and notes the approximation.
|
|
11
|
+
*/
|
|
12
|
+
export declare function runFinalizeDryRun(directory: string, swarmDir: string, planData: PlanData, planExists: boolean): Promise<string>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Plan } from '../../config/plan-schema';
|
|
2
|
+
import { runSessionReflection } from '../../services/session-reflection';
|
|
3
|
+
import { type SkillImproveRequest, type SkillImproveResult } from '../../services/skill-improver';
|
|
4
|
+
import { type CloseTerminalResult } from '../../workflow/close-terminal.js';
|
|
5
|
+
import type { CloseKnowledgeEntry, CloseStageContext, PlanData } from './context.js';
|
|
6
|
+
/**
|
|
7
|
+
* Close-command wrapper around the exact-task terminal reconciliation service.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately NOT named `closePlanTerminalState`: `src/plan/manager.ts` exports a
|
|
10
|
+
* distinct function by that name (ledger-first phase/projection persistence), which
|
|
11
|
+
* `reconcileCloseTerminalState` itself calls downstream. Keeping the two identifiers
|
|
12
|
+
* distinct avoids a same-name collision across close.ts / close-terminal.ts /
|
|
13
|
+
* plan/manager.ts. The `_internals` key below stays `closePlanTerminalState` so the
|
|
14
|
+
* existing test seam is unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export declare function reconcileCloseTerminalStateForPlan(directory: string, targetPlan: Plan, options: {
|
|
17
|
+
actor: string;
|
|
18
|
+
requestedClosedTaskIds: string[];
|
|
19
|
+
closedPhaseIds: number[];
|
|
20
|
+
originalStatuses?: Map<string, string>;
|
|
21
|
+
}): Promise<CloseTerminalResult | undefined>;
|
|
22
|
+
export declare function hardStopTerminalization(ctx: CloseStageContext, message: string): void;
|
|
23
|
+
export declare function runAbortableReflection(input: Parameters<typeof runSessionReflection>[0], timeoutMs: number): Promise<Awaited<ReturnType<typeof runSessionReflection>>>;
|
|
24
|
+
export declare function runAbortableSkillReview(req: SkillImproveRequest, timeoutMs: number): Promise<SkillImproveResult>;
|
|
25
|
+
export declare function normalizeLessonText(text: string): string;
|
|
26
|
+
export declare function countSessionKnowledgeEntries(entries: CloseKnowledgeEntry[], sessionStart: string | undefined, fallbackCount: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Guarantee all phases and tasks in a plan are marked complete/closed.
|
|
29
|
+
* Mutates planData in place. Returns actual IDs of newly closed phases and
|
|
30
|
+
* tasks so the caller can track only genuinely new closures (idempotent).
|
|
31
|
+
*/
|
|
32
|
+
export declare function guaranteeAllPlansComplete(planData: PlanData): {
|
|
33
|
+
closedPhaseIds: number[];
|
|
34
|
+
closedTaskIds: string[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* STAGE 1: FINALIZE
|
|
38
|
+
*
|
|
39
|
+
* Writes retrospectives for in-progress phases (or a session-level retro for
|
|
40
|
+
* plan-free closes), curates lessons, promotes to hive, runs skill review,
|
|
41
|
+
* persists terminal plan state, and runs post-mortem. All state mutations are
|
|
42
|
+
* written back to ctx so the caller can build the close summary.
|
|
43
|
+
*/
|
|
44
|
+
export declare function runFinalizeStage(ctx: CloseStageContext): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function copyDirRecursiveWithFailures(src: string, dest: string): Promise<{
|
|
2
|
+
copied: number;
|
|
3
|
+
failures: string[];
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* Backward-compatible wrapper that returns only the copied count.
|
|
7
|
+
* Direct callers (including tests) that expect a number continue to work.
|
|
8
|
+
* Use copyDirRecursiveWithFailures when per-file failure tracking is needed.
|
|
9
|
+
*/
|
|
10
|
+
export declare function copyDirRecursive(src: string, dest: string): Promise<number>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete one archived active-state artifact, tolerating the short-lived file
|
|
13
|
+
* locks Windows antivirus and SQLite sidecars can retain after handle close.
|
|
14
|
+
* Non-transient errors fail immediately; the retry budget is bounded to
|
|
15
|
+
* 375 ms so `/swarm close` remains responsive.
|
|
16
|
+
*/
|
|
17
|
+
export declare function unlinkActiveStateFileWithRetry(filePath: string): Promise<void>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as fsSync from 'node:fs';
|
|
2
|
+
/** Narrow seam for receipt/plan ordering tests. Wired by the close facade. */
|
|
3
|
+
export declare const closeReceiptLifecycleInternals: {
|
|
4
|
+
recordPhaseCloseIntent: typeof import("../../hooks/knowledge-receipt-ledger.js").recordPhaseCloseIntent;
|
|
5
|
+
reconcilePhaseClose: typeof import("../../hooks/knowledge-receipt-ledger.js").reconcilePhaseClose;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Canonical mutable close-command dependency seam.
|
|
9
|
+
*
|
|
10
|
+
* This module intentionally has no imports from the command, agent, state, or
|
|
11
|
+
* hook graphs. The facade wires concrete implementations after all stage
|
|
12
|
+
* modules have initialized, so a direct stage import cannot re-enter close.ts
|
|
13
|
+
* through the command registry (FB-005/FB-006).
|
|
14
|
+
*/
|
|
15
|
+
export declare const _internals: {
|
|
16
|
+
closeSnapshotCoordinationInitialization: typeof import("../../session/snapshot-coordination-init.js").closeSnapshotCoordinationInitialization;
|
|
17
|
+
closeRepoMemory: typeof import("../../tools/repo-graph/indexed-storage.js").closeRepoMemory;
|
|
18
|
+
unlinkActiveStateFileWithRetry: typeof import("./fs-helpers.js").unlinkActiveStateFileWithRetry;
|
|
19
|
+
unlink: typeof fsSync.promises.unlink;
|
|
20
|
+
unlinkSidecarSync: typeof fsSync.unlinkSync;
|
|
21
|
+
sleep: typeof import("../../utils/bun-compat.js").sleep;
|
|
22
|
+
collectGarbageBestEffort: typeof import("../../utils/bun-compat.js").collectGarbageBestEffort;
|
|
23
|
+
ACTIVE_STATE_DIRS_TO_CLEAN: string[];
|
|
24
|
+
countSessionKnowledgeEntries: typeof import("./finalize-stage.js").countSessionKnowledgeEntries;
|
|
25
|
+
CLOSE_SKILL_REVIEW_TIMEOUT_MS: number;
|
|
26
|
+
CLOSE_REFLECTION_TIMEOUT_MS: number;
|
|
27
|
+
detectFullAuto: typeof import("./orchestrator.js").detectFullAuto;
|
|
28
|
+
guaranteeAllPlansComplete: typeof import("./finalize-stage.js").guaranteeAllPlansComplete;
|
|
29
|
+
getGitRepositoryStatus: typeof import("../../git/branch.js").getGitRepositoryStatus;
|
|
30
|
+
resetToMainAfterMerge: typeof import("../../git/branch.js").resetToMainAfterMerge;
|
|
31
|
+
resetToRemoteBranch: typeof import("../../git/branch.js").resetToRemoteBranch;
|
|
32
|
+
copyDirRecursive: typeof import("./fs-helpers.js").copyDirRecursive;
|
|
33
|
+
loadPluginConfigWithMeta: typeof import("../../config/index.js").loadPluginConfigWithMeta;
|
|
34
|
+
curateAndStoreSwarm: typeof import("../../hooks/knowledge-curator.js").curateAndStoreSwarm;
|
|
35
|
+
checkHivePromotions: typeof import("../../hooks/hive-promoter.js").checkHivePromotions;
|
|
36
|
+
runCuratorPostMortem: typeof import("../../hooks/curator-postmortem.js").runCuratorPostMortem;
|
|
37
|
+
createCuratorLLMDelegate: typeof import("../../hooks/curator-llm-factory.js").createCuratorLLMDelegate;
|
|
38
|
+
resetSwarmStatePreservingSingletons: typeof import("../../state.js").resetSwarmStatePreservingSingletons;
|
|
39
|
+
runFinalizeStage: typeof import("./finalize-stage.js").runFinalizeStage;
|
|
40
|
+
runFinalizeRewardSweep: typeof import("../../memory/finalize-reward-sweep.js").runFinalizeRewardSweep;
|
|
41
|
+
acquireFinalizeLock: typeof import("./orchestrator.js").acquireFinalizeLock;
|
|
42
|
+
runArchiveStage: typeof import("./archive-stage.js").runArchiveStage;
|
|
43
|
+
archiveCloseSummary: typeof import("./orchestrator.js").archiveCloseSummary;
|
|
44
|
+
runArchiveEvidenceRetention: typeof import("./archive-stage.js").runArchiveEvidenceRetention;
|
|
45
|
+
runCleanStage: typeof import("./clean-stage.js").runCleanStage;
|
|
46
|
+
runAlignStage: typeof import("./align-stage.js").runAlignStage;
|
|
47
|
+
runFinalizeDryRun: typeof import("./dry-run.js").runFinalizeDryRun;
|
|
48
|
+
archiveEvidence: typeof import("../../evidence/manager.js").archiveEvidence;
|
|
49
|
+
closePlanTerminalState: typeof import("./finalize-stage.js").reconcileCloseTerminalStateForPlan;
|
|
50
|
+
endAgentSession: typeof import("../../state.js").endAgentSession;
|
|
51
|
+
flushAndDrainTelemetry: () => Promise<void>;
|
|
52
|
+
finalizeContextTelemetry: typeof import("../../context-map/telemetry.js").finalizeContextTelemetry;
|
|
53
|
+
finalizeCoreEvents: typeof import("../../events/core-events.js").finalizeCoreEventsForClose;
|
|
54
|
+
finalizeShellAudit: (directory: string) => void;
|
|
55
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CloseCommandOptions, CloseStageContext } from './context.js';
|
|
2
|
+
export declare function archiveCloseSummary(ctx: Pick<CloseStageContext, 'archiveStageFailed' | 'archiveDir' | 'warnings'>, closeSummaryPath: string, summaryWritten: boolean): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Handles /swarm close command - performs full terminal session finalization:
|
|
5
|
+
* 0. Guarantee: mark all incomplete phases/tasks as closed
|
|
6
|
+
* 1. Finalize: write retrospectives, produce terminal summary
|
|
7
|
+
* 2. Archive: create timestamped bundle of swarm artifacts
|
|
8
|
+
* 3. Clean: clear active-state files that confuse future swarms
|
|
9
|
+
* 4. Align: safe git alignment to main
|
|
10
|
+
*
|
|
11
|
+
* Must be idempotent - safe to run multiple times.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleCloseCommand(directory: string, args: string[], options?: CloseCommandOptions): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Acquire the finalize lock for the close command (FR-012).
|
|
16
|
+
* Wraps tryAcquireLock with a directory-only API.
|
|
17
|
+
*/
|
|
18
|
+
export declare function acquireFinalizeLock(directory: string): Promise<{
|
|
19
|
+
acquired: boolean;
|
|
20
|
+
release?: () => Promise<void>;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Issue #2077: detect full-auto state for the action-menu prompt suppression.
|
|
24
|
+
* Combines the in-memory session flag (hasActiveFullAuto) with the durable
|
|
25
|
+
* run state (isFullAutoRunActive reads .swarm/full-auto-state.json) so a
|
|
26
|
+
* process restart mid-run does not silently re-enable the interactive menu
|
|
27
|
+
* prompt. The durable check is sync and takes a state lock; if it throws,
|
|
28
|
+
* fall back to the in-memory flag alone. Caller MUST guard with a defined
|
|
29
|
+
* sessionID to avoid the cross-session leak (hasActiveFullAuto(undefined)
|
|
30
|
+
* scans all sessions).
|
|
31
|
+
*/
|
|
32
|
+
export declare function detectFullAuto(directory: string, sessionID: string): boolean;
|