opencode-swarm 7.186.8 → 7.187.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 (108) 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 +1 -1
  4. package/dist/cli/{auto-checkpoint-hw4rttv4.js → auto-checkpoint-r69e82bh.js} +10 -11
  5. package/dist/cli/{checkpoint-fdkh943k.js → checkpoint-1sqwbgra.js} +18 -19
  6. package/dist/cli/{coder-settlement-91r5s8ar.js → coder-settlement-b9qx0732.js} +14 -15
  7. package/dist/cli/{config-doctor-nzds5xzf.js → config-doctor-s4fr5qwr.js} +34 -4
  8. package/dist/cli/{core-w0gq7vwa.js → core-bezezjy9.js} +5 -6
  9. package/dist/cli/{curation-policy-kw6x1cba.js → curation-policy-2x2w3b57.js} +7 -8
  10. package/dist/cli/{curator-drift-svnc70x4.js → curator-drift-785xnxdv.js} +10 -11
  11. package/dist/cli/curator-llm-factory-p0wwyswg.js +80 -0
  12. package/dist/cli/{curator-gkrn8wz3.js → curator-w4hp7a10.js} +44 -45
  13. package/dist/cli/{dispatch-0ejzwb45.js → dispatch-qvcztbpf.js} +222 -48
  14. package/dist/cli/{evidence-summary-service-a2tx8tbn.js → evidence-summary-service-33qcm9xc.js} +21 -22
  15. package/dist/cli/{gate-evidence-28bys0r0.js → gate-evidence-9ehj968e.js} +9 -10
  16. package/dist/cli/guardrail-explain-5715fdzv.js +81 -0
  17. package/dist/cli/guardrail-log-k1dfzfzm.js +22 -0
  18. package/dist/cli/{guardrail-reset-w5kpwfxb.js → guardrail-reset-nt88n9dm.js} +44 -45
  19. package/dist/cli/hive-promoter-c8fjn186.js +95 -0
  20. package/dist/cli/{index-mr86ywsj.js → index-0yj79yk1.js} +1 -1
  21. package/dist/cli/{index-mtb763x4.js → index-1vvr69ka.js} +1 -1
  22. package/dist/cli/{index-b9zqye89.js → index-2s8wdagg.js} +44 -45
  23. package/dist/cli/{index-e47fhj4k.js → index-2wgvjwpr.js} +5 -5
  24. package/dist/cli/{index-cvwkjnr5.js → index-469xmpd6.js} +1 -1
  25. package/dist/cli/{index-0ghn241n.js → index-4g6sw4eq.js} +1 -1
  26. package/dist/cli/{index-2nbws8bd.js → index-5m56c5r6.js} +5 -5
  27. package/dist/cli/{index-e6tjg7t9.js → index-6ersmqjd.js} +9 -9
  28. package/dist/cli/{index-0k283qtq.js → index-9hag235h.js} +2 -2
  29. package/dist/cli/{index-sjwpvte3.js → index-a8gvszr2.js} +2 -2
  30. package/dist/cli/{index-qc1x5vvb.js → index-akt0arnt.js} +2695 -2589
  31. package/dist/cli/{index-kg4yp11g.js → index-b2je0z0t.js} +4 -4
  32. package/dist/cli/{index-ha4r51k4.js → index-bbqxt1p5.js} +28 -11
  33. package/dist/cli/{index-znc71e1c.js → index-bejxkee0.js} +2 -2
  34. package/dist/cli/{index-06pcq86m.js → index-c8ffgcvz.js} +3 -3
  35. package/dist/cli/{index-n1szkmbz.js → index-cc1vzq4m.js} +1 -1
  36. package/dist/cli/{index-c12cz80m.js → index-cppqxjw9.js} +2 -2
  37. package/dist/cli/{index-d21545hp.js → index-cx4s7cak.js} +46 -47
  38. package/dist/cli/{index-xgsy3hzf.js → index-d6kvatwp.js} +12 -12
  39. package/dist/cli/{index-k55ep5se.js → index-df2p0k0s.js} +2 -2
  40. package/dist/cli/{index-x5mkva6s.js → index-dypmvvga.js} +1 -1
  41. package/dist/cli/{index-7ae4sgp4.js → index-ectvhv8e.js} +5 -5
  42. package/dist/cli/{index-whk4027k.js → index-en7vzpeq.js} +4 -4
  43. package/dist/cli/{index-4y6pndcf.js → index-evy5yrsw.js} +4 -4
  44. package/dist/cli/{index-mc72pk74.js → index-fzpt2djt.js} +32 -1
  45. package/dist/cli/{index-5dgg9vhz.js → index-hvr82s1t.js} +565 -76
  46. package/dist/cli/{index-xdjwefa5.js → index-jtncfvhe.js} +1 -1
  47. package/dist/cli/{index-c5x4yzt6.js → index-knbjtqwt.js} +5 -5
  48. package/dist/cli/{index-pntrhnj8.js → index-krqq8kbq.js} +7 -7
  49. package/dist/cli/{index-extgtmxm.js → index-m1qy7f1e.js} +1 -1
  50. package/dist/cli/{index-84wt7q5y.js → index-mf19yqss.js} +3 -3
  51. package/dist/cli/{index-7pstt3w2.js → index-pfpnzf6w.js} +1 -1
  52. package/dist/cli/{index-144jx1jn.js → index-pts38j6x.js} +5 -5
  53. package/dist/cli/{index-dbwpcjhw.js → index-pymr99as.js} +8 -8
  54. package/dist/cli/{index-616pp1nq.js → index-qzgfheb4.js} +3 -3
  55. package/dist/cli/{index-e4hy4des.js → index-r6e8syr3.js} +1 -1
  56. package/dist/cli/{index-t6na8zpb.js → index-r7gt2w1b.js} +4 -4
  57. package/dist/cli/{index-gsqmefdg.js → index-rm676s0p.js} +2 -2
  58. package/dist/cli/{index-n5ekzhad.js → index-sztx0vyt.js} +5 -5
  59. package/dist/cli/{index-227te5a7.js → index-t3hcd6zz.js} +2 -2
  60. package/dist/cli/{index-prksynjw.js → index-ta48pe8j.js} +3 -3
  61. package/dist/cli/{index-q8dj8b88.js → index-v08ksq0b.js} +2 -2
  62. package/dist/cli/{index-7bxssqaf.js → index-vx8a8w3b.js} +142 -2
  63. package/dist/cli/{index-zcpd36zm.js → index-ww8payq9.js} +2 -2
  64. package/dist/cli/{index-tw513bvn.js → index-xs96nry2.js} +8 -8
  65. package/dist/cli/{index-0qpa53jg.js → index-ycz8z2db.js} +8 -8
  66. package/dist/cli/{index-gapyat7s.js → index-yf0cc6c5.js} +2 -2
  67. package/dist/cli/{index-03z05sbb.js → index-yw1g78v9.js} +2 -2
  68. package/dist/cli/{index-agm6hegf.js → index-zzxnssy3.js} +4 -4
  69. package/dist/cli/index.js +45 -46
  70. package/dist/cli/{knowledge-escalator-0dj3bvh2.js → knowledge-escalator-qttydcx2.js} +15 -16
  71. package/dist/cli/{knowledge-events-zwhb8jnb.js → knowledge-events-4vf0vj82.js} +13 -14
  72. package/dist/cli/{knowledge-link-pmbyqe3b.js → knowledge-link-p2c8agc8.js} +6 -7
  73. package/dist/cli/{knowledge-store-67n0qbhg.js → knowledge-store-bw1dk2eb.js} +7 -8
  74. package/dist/cli/{knowledge-validator-b58w129y.js → knowledge-validator-gefcc36h.js} +9 -10
  75. package/dist/cli/{mcp-ayc74bm2.js → mcp-d5p0k3p1.js} +1 -1
  76. package/dist/cli/{model-preflight-nvjb3bv5.js → model-preflight-fmx49pwy.js} +44 -45
  77. package/dist/cli/{pending-delegations-yvh7b951.js → pending-delegations-8333cb3y.js} +13 -14
  78. package/dist/cli/{pr-subscriptions-pkj5mmra.js → pr-subscriptions-p42ny2sn.js} +13 -14
  79. package/dist/cli/{pr-workflow-gate-zg6tg3c0.js → pr-workflow-gate-csy32z8w.js} +44 -45
  80. package/dist/cli/{runner-jev9vea3.js → runner-cbpr45cs.js} +7 -8
  81. package/dist/cli/{scan-cursor-8nkt0n1b.js → scan-cursor-14mwymtz.js} +8 -9
  82. package/dist/cli/{schema-ahy4ps8z.js → schema-6426g0gw.js} +2 -2
  83. package/dist/cli/{scope-persistence-h8b2hcy9.js → scope-persistence-avkv3s4m.js} +17 -18
  84. package/dist/cli/{server-14wr2fz2.js → server-d9rk2zeb.js} +45 -47
  85. package/dist/cli/{skill-generator-2pk8fvfz.js → skill-generator-epdvdsh5.js} +17 -18
  86. package/dist/cli/{snapshot-coordination-init-keeqdwph.js → snapshot-coordination-init-35f7wrqb.js} +44 -45
  87. package/dist/cli/{speckit-checkoff-yf09ctgv.js → speckit-checkoff-erwa7fbj.js} +5 -5
  88. package/dist/cli/{telemetry-rb8hrvbx.js → telemetry-2vwb3n42.js} +2 -3
  89. package/dist/cli/{workspace-snapshot-28p0ekng.js → workspace-snapshot-y60ay5eq.js} +4 -5
  90. package/dist/cli/{worktree-collision-ownership-7ctmpqx6.js → worktree-collision-ownership-3tqkw81h.js} +14 -15
  91. package/dist/cli/{worktree-isolation-2c1hvct4.js → worktree-isolation-0rrjqypt.js} +44 -45
  92. package/dist/commands/registry.d.ts +4 -4
  93. package/dist/commands/reset-backup.d.ts +20 -5
  94. package/dist/commands/rollback-gate.d.ts +73 -0
  95. package/dist/index.js +612 -597
  96. package/dist/lang/backends/java.d.ts +76 -0
  97. package/dist/lang/java-extraction.d.ts +88 -0
  98. package/dist/services/config-doctor.d.ts +19 -1
  99. package/dist/services/preflight-integration.d.ts +8 -1
  100. package/dist/state.d.ts +13 -0
  101. package/dist/tools/symbols.d.ts +18 -0
  102. package/opencode-swarm.schema.json +1 -1
  103. package/package.json +1 -1
  104. package/dist/cli/curator-llm-factory-j51cttb2.js +0 -81
  105. package/dist/cli/guardrail-explain-qjyz300y.js +0 -82
  106. package/dist/cli/guardrail-log-rw25bt8g.js +0 -23
  107. package/dist/cli/hive-promoter-qzz0veev.js +0 -96
  108. package/dist/cli/index-c1ggtmpm.js +0 -33
@@ -6,38 +6,37 @@ import {
6
6
  WORKTREE_PROVISIONING_OWNER_LEASE_MS,
7
7
  removeWorktreeProvisioningOwner,
8
8
  scanWorktreeProvisioningOwnersForRecovery
9
- } from "./index-sjwpvte3.js";
9
+ } from "./index-a8gvszr2.js";
10
10
  import {
11
11
  scanWorktreeMergeFailuresForRecovery
12
12
  } from "./index-zsrtt42s.js";
13
13
  import {
14
14
  scanDelegationFallbacksForRecovery,
15
15
  scanDelegationsForRecovery
16
- } from "./index-tw513bvn.js";
17
- import"./index-znc71e1c.js";
16
+ } from "./index-xs96nry2.js";
17
+ import"./index-bejxkee0.js";
18
18
  import"./index-2s7dvzff.js";
19
- import"./index-extgtmxm.js";
20
- import"./index-n1szkmbz.js";
21
- import"./index-0k283qtq.js";
19
+ import"./index-m1qy7f1e.js";
20
+ import"./index-cc1vzq4m.js";
21
+ import"./index-9hag235h.js";
22
22
  import"./index-ry16d01s.js";
23
23
  import"./index-rdm3px0g.js";
24
24
  import"./index-7pmbnjvj.js";
25
- import"./index-06pcq86m.js";
26
- import"./index-pntrhnj8.js";
25
+ import"./index-c8ffgcvz.js";
26
+ import"./index-krqq8kbq.js";
27
27
  import"./index-vzm6zre7.js";
28
28
  import"./index-ae75rja9.js";
29
- import"./index-gsqmefdg.js";
30
- import"./index-227te5a7.js";
31
- import"./index-mr86ywsj.js";
29
+ import"./index-rm676s0p.js";
30
+ import"./index-t3hcd6zz.js";
31
+ import"./index-0yj79yk1.js";
32
32
  import"./index-t7hmqgjy.js";
33
- import"./index-xdjwefa5.js";
33
+ import"./index-jtncfvhe.js";
34
34
  import {
35
35
  canonicalRootKeyFresh
36
- } from "./index-mc72pk74.js";
37
- import"./index-c1ggtmpm.js";
36
+ } from "./index-fzpt2djt.js";
38
37
  import"./index-ejhxgyvm.js";
39
38
  import"./index-7g4c7s5r.js";
40
- import"./index-e4hy4des.js";
39
+ import"./index-r6e8syr3.js";
41
40
  import"./index-zxdawwc7.js";
42
41
  import"./index-bk5tah7q.js";
43
42
  import"./index-gknz3bv1.js";
@@ -21,76 +21,75 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-qc1x5vvb.js";
25
- import"./index-kg4yp11g.js";
26
- import"./index-ha4r51k4.js";
27
- import"./index-n5ekzhad.js";
28
- import"./index-7bxssqaf.js";
29
- import"./index-x5mkva6s.js";
30
- import"./index-k55ep5se.js";
24
+ } from "./index-akt0arnt.js";
25
+ import"./index-b2je0z0t.js";
26
+ import"./index-bbqxt1p5.js";
27
+ import"./index-sztx0vyt.js";
28
+ import"./index-vx8a8w3b.js";
29
+ import"./index-dypmvvga.js";
30
+ import"./index-df2p0k0s.js";
31
31
  import"./index-txdagbh7.js";
32
- import"./index-q8dj8b88.js";
32
+ import"./index-v08ksq0b.js";
33
33
  import"./index-rdec0y3z.js";
34
- import"./index-t6na8zpb.js";
35
- import"./index-dbwpcjhw.js";
36
- import"./index-e47fhj4k.js";
37
- import"./index-c5x4yzt6.js";
38
- import"./index-84wt7q5y.js";
39
- import"./index-0qpa53jg.js";
34
+ import"./index-r7gt2w1b.js";
35
+ import"./index-pymr99as.js";
36
+ import"./index-2wgvjwpr.js";
37
+ import"./index-knbjtqwt.js";
38
+ import"./index-mf19yqss.js";
39
+ import"./index-ycz8z2db.js";
40
40
  import"./index-cjapb4hy.js";
41
- import"./index-sjwpvte3.js";
41
+ import"./index-a8gvszr2.js";
42
42
  import"./index-pt7h91zc.js";
43
43
  import"./index-q7sjgr1y.js";
44
- import"./index-5dgg9vhz.js";
45
- import"./index-xgsy3hzf.js";
44
+ import"./index-hvr82s1t.js";
45
+ import"./index-d6kvatwp.js";
46
46
  import"./index-6b295cas.js";
47
47
  import"./index-9nyqt3kb.js";
48
- import"./index-mtb763x4.js";
48
+ import"./index-1vvr69ka.js";
49
49
  import"./index-zsrtt42s.js";
50
- import"./index-c12cz80m.js";
51
- import"./index-4y6pndcf.js";
52
- import"./index-144jx1jn.js";
50
+ import"./index-cppqxjw9.js";
51
+ import"./index-evy5yrsw.js";
52
+ import"./index-pts38j6x.js";
53
53
  import"./index-g4fs6z4e.js";
54
- import"./index-tw513bvn.js";
55
- import"./index-e6tjg7t9.js";
56
- import"./index-znc71e1c.js";
54
+ import"./index-xs96nry2.js";
55
+ import"./index-6ersmqjd.js";
56
+ import"./index-bejxkee0.js";
57
57
  import"./index-2s7dvzff.js";
58
- import"./index-agm6hegf.js";
59
- import"./index-7pstt3w2.js";
58
+ import"./index-zzxnssy3.js";
59
+ import"./index-pfpnzf6w.js";
60
60
  import"./index-rtry5xyf.js";
61
61
  import {
62
62
  resolveWorktreeIsolationConfig
63
- } from "./index-prksynjw.js";
63
+ } from "./index-ta48pe8j.js";
64
64
  import"./index-kbkk7vnh.js";
65
65
  import"./index-0725jpp7.js";
66
- import"./index-7ae4sgp4.js";
67
- import"./index-2nbws8bd.js";
68
- import"./index-zcpd36zm.js";
69
- import"./index-extgtmxm.js";
70
- import"./index-n1szkmbz.js";
71
- import"./index-0k283qtq.js";
66
+ import"./index-ectvhv8e.js";
67
+ import"./index-5m56c5r6.js";
68
+ import"./index-ww8payq9.js";
69
+ import"./index-m1qy7f1e.js";
70
+ import"./index-cc1vzq4m.js";
71
+ import"./index-9hag235h.js";
72
72
  import"./index-ry16d01s.js";
73
73
  import"./index-rdm3px0g.js";
74
74
  import"./index-7pmbnjvj.js";
75
- import"./index-06pcq86m.js";
76
- import"./index-pntrhnj8.js";
75
+ import"./index-c8ffgcvz.js";
76
+ import"./index-krqq8kbq.js";
77
77
  import"./index-vzm6zre7.js";
78
78
  import"./index-ae75rja9.js";
79
- import"./index-gsqmefdg.js";
80
- import"./index-227te5a7.js";
81
- import"./index-mr86ywsj.js";
79
+ import"./index-rm676s0p.js";
80
+ import"./index-t3hcd6zz.js";
81
+ import"./index-0yj79yk1.js";
82
82
  import"./index-t7hmqgjy.js";
83
- import"./index-xdjwefa5.js";
84
- import"./index-mc72pk74.js";
85
- import"./index-c1ggtmpm.js";
83
+ import"./index-jtncfvhe.js";
84
+ import"./index-fzpt2djt.js";
86
85
  import"./index-ejhxgyvm.js";
87
86
  import"./index-7g4c7s5r.js";
88
- import"./index-e4hy4des.js";
87
+ import"./index-r6e8syr3.js";
89
88
  import"./index-gx2vp8gx.js";
90
- import"./index-cvwkjnr5.js";
89
+ import"./index-469xmpd6.js";
91
90
  import"./index-zxdawwc7.js";
92
- import"./index-616pp1nq.js";
93
- import"./index-03z05sbb.js";
91
+ import"./index-qzgfheb4.js";
92
+ import"./index-yw1g78v9.js";
94
93
  import"./index-bk5tah7q.js";
95
94
  import"./index-gknz3bv1.js";
96
95
  import"./index-zpsr8rpc.js";
@@ -1093,8 +1093,8 @@ export declare const COMMAND_REGISTRY: {
1093
1093
  readonly rollback: {
1094
1094
  readonly handler: (ctx: CommandContext) => Promise<string>;
1095
1095
  readonly description: "Restore swarm state or project files to a checkpoint";
1096
- readonly details: "Restores legacy .swarm/ phase checkpoints from checkpoints/phase-<N> when present. Otherwise restores named git checkpoints from .swarm/checkpoints.json by label or list number. Writes rollback event to events.jsonl. Without an argument, lists available checkpoints.";
1097
- readonly args: "<phase-number|label|list-number>";
1096
+ readonly details: "Restores legacy .swarm/ phase checkpoints from checkpoints/phase-<N> when present; otherwise named git checkpoints from .swarm/checkpoints.json. SAFETY (#2946): a restore that would DESTROY uncommitted work previews first and issues a 15-minute --confirm token; re-run with that token (or --yes) to execute. Every executing restore backs up the destroyed bytes to .swarm/rollback-backups/ (newest 5). Clean trees stay single-call. Bare invocation lists checkpoints.";
1097
+ readonly args: "<phase-number|label|list-number> [--confirm <token>] [--yes]";
1098
1098
  readonly category: "utility";
1099
1099
  readonly toolPolicy: "restricted";
1100
1100
  };
@@ -1353,8 +1353,8 @@ export declare const COMMAND_REGISTRY: {
1353
1353
  readonly checkpoint: {
1354
1354
  readonly handler: (ctx: CommandContext) => Promise<string>;
1355
1355
  readonly description: "Manage project checkpoints [save|restore|delete|list] <label>";
1356
- readonly details: "save: creates named git checkpoint. restore: hard-resets tracked files to the checkpoint. delete: removes named checkpoint metadata. list: shows all checkpoints with timestamps. All subcommands require a label except list.";
1357
- readonly args: "<save|restore|delete|list> <label>";
1356
+ readonly details: "save: creates named git checkpoint. restore: hard-resets tracked files to the checkpoint; when uncommitted tracked work would be destroyed it previews first and requires the --confirm token from that preview (or --yes to confirm in one step); destroyed bytes are backed up to .swarm/rollback-backups/ (#2946). delete: removes checkpoint metadata. list: shows all checkpoints with timestamps. All subcommands require a label except list.";
1357
+ readonly args: "<save|restore|delete|list> <label> [--confirm <token>] [--yes]";
1358
1358
  readonly category: "utility";
1359
1359
  readonly clashesWithNativeCcCommand: "/checkpoint";
1360
1360
  readonly toolPolicy: "restricted";
@@ -13,11 +13,14 @@ export interface ResetBackupResult {
13
13
  }
14
14
  /** How many backup directories to retain under .swarm/reset-backups/. */
15
15
  export declare const RESET_BACKUP_RETENTION = 5;
16
+ /** Which `.swarm/` subdirectory a backup family lands under (#2946). */
17
+ export type ResetBackupsRoot = 'reset-backups' | 'rollback-backups';
16
18
  /**
17
19
  * Copy the swarm-state entries a reset is about to delete into a durable,
18
- * timestamped directory under `.swarm/reset-backups/` BEFORE deletion, so the
19
- * user can recover by copying the files back. The backup directory is not part
20
- * of any reset deletion set, so it survives the reset.
20
+ * timestamped directory under `.swarm/reset-backups/` (or
21
+ * `.swarm/rollback-backups/` for rollback restores, #2946) BEFORE deletion,
22
+ * so the user can recover by copying the files back. The backup directory is
23
+ * not part of any reset deletion set, so it survives the reset.
21
24
  *
22
25
  * This deliberately does NOT use the git checkpoint tool: that tool excludes
23
26
  * `.swarm/` (`git add ... :!.swarm/`) — i.e. it excludes exactly the state a
@@ -26,7 +29,19 @@ export declare const RESET_BACKUP_RETENTION = 5;
26
29
  * non-surprising backup. (#1692)
27
30
  *
28
31
  * @param directory project root (contains `.swarm/`)
29
- * @param kind backup label prefix ('reset' | 'reset-session')
32
+ * @param kind backup label prefix ('reset' | 'reset-session' | 'rollback')
30
33
  * @param relEntries entries relative to `.swarm/` to back up (files or dirs)
34
+ * @param opts backups root override (rollback restores use 'rollback-backups')
31
35
  */
32
- export declare function backupSwarmStateBeforeReset(directory: string, kind: 'reset' | 'reset-session', relEntries: string[]): ResetBackupResult;
36
+ export declare function backupSwarmStateBeforeReset(directory: string, kind: 'reset' | 'reset-session' | 'rollback', relEntries: string[], opts?: {
37
+ backupsRoot?: ResetBackupsRoot;
38
+ }): ResetBackupResult;
39
+ /**
40
+ * Back up the current bytes of each dirty tracked file a git-checkpoint
41
+ * rollback is about to destroy via `git reset --hard` (#2946). Files are
42
+ * copied by their REPO-RELATIVE paths into
43
+ * `.swarm/rollback-backups/rollback-git-<ISO>/tracked/<repo-rel-path>`, so a
44
+ * confirmed rollback is recoverable by copying the files back. Fail-open by
45
+ * contract (same as the swarm-state backup): per-entry failures are warnings.
46
+ */
47
+ export declare function backupTrackedChangesBeforeRollback(directory: string, repoRelPaths: string[]): ResetBackupResult;
@@ -0,0 +1,73 @@
1
+ import type { PurgeCandidate } from './destructive-purge';
2
+ /** Destructive-surface kind for the git checkpoint restore path. */
3
+ export declare const ROLLBACK_GIT_KIND = "swarm-rollback-git";
4
+ /** Destructive-surface kind for the legacy phase-overwrite restore path. */
5
+ export declare const ROLLBACK_PHASE_KIND = "swarm-rollback-phase";
6
+ /**
7
+ * Test seam for the rollback gate (simulate git-status read failures without
8
+ * spawning real git). Mirrors `_closeGateInternals.runGit`.
9
+ */
10
+ export declare const _rollbackGateInternals: {
11
+ runGit: (args: string[], cwd: string) => string | null;
12
+ runGitBuffered: (args: string[], cwd: string) => string | null;
13
+ };
14
+ /**
15
+ * A real git repository root: `.git` is a linked-worktree/submodule pointer
16
+ * file, or a directory carrying the HEAD ref every repository has. Bare
17
+ * `.git` marker directories — accepted project roots per #2127 — are not
18
+ * repositories; git tracks nothing there.
19
+ */
20
+ export declare function isRealGitRepository(directory: string): boolean;
21
+ /**
22
+ * Parse `git status --porcelain -z` output into repo-relative tracked-dirty
23
+ * paths. The -z form is NUL-terminated and NEVER quotes paths (core.quotepath
24
+ * quoting — which mangles non-ASCII names into C-escaped octal and would
25
+ * silently break both the preview and the pre-restore backup — does not
26
+ * apply). Untracked ('??') entries survive `git reset --hard`; every other
27
+ * porcelain code is tracked work the reset would discard. Rename/copy
28
+ * records carry the ORIG_PATH as the next NUL token (#2508: both sides at
29
+ * risk), so each side is listed. R/C may sit in EITHER status column — the
30
+ * second column for worktree-only renames created via `git add -N`
31
+ * (intent-to-add) — so the test must not anchor to the first column, or the
32
+ * ORIG_PATH token of an R/C-initial file (README.md, CHANGELOG.md, …) is
33
+ * misread as the start of a new record and swallows the next real entry.
34
+ */
35
+ export declare function parseTrackedDirtyPaths(statusOutput: string): string[];
36
+ /**
37
+ * Paths that live in the restore TARGET tree but are NOT in the current
38
+ * index while a file sits on disk at that path. `git reset --hard` silently
39
+ * overwrites exactly these untracked (or since-ignored) files when it
40
+ * materializes the target tree, so they belong in the destruction scope
41
+ * alongside tracked-dirty paths (#2976 review F-1). Returns [] when either
42
+ * listing cannot be read — the tracked-dirty gate above still applies, and
43
+ * the caller's unreadable-status refusal covers real-repo failures.
44
+ */
45
+ export declare function untrackedPathsInTargetTree(directory: string, targetSha: string): string[];
46
+ /**
47
+ * The git-kind candidate set: the absolute paths of tracked-dirty files that
48
+ * `git reset --hard` would destroy. This is the ONLY derivation for
49
+ * ROLLBACK_GIT_KIND — the tool sink re-derives it from {label, directory}
50
+ * alone, so the command layer must not add anything to the set.
51
+ */
52
+ export declare function trackedDirtyCandidates(directory: string, dirtyRelPaths: string[]): PurgeCandidate[];
53
+ /**
54
+ * The legacy-phase-kind candidate set: absolute paths of live `.swarm/`
55
+ * entries the checkpoint copy loop would overwrite.
56
+ */
57
+ export declare function swarmOverwriteCandidates(directory: string, overwriteRelPaths: string[]): PurgeCandidate[];
58
+ /**
59
+ * Measure the destruction scope for a git checkpoint restore. When
60
+ * `targetSha` is provided, files that are untracked (or since-ignored) on
61
+ * disk but tracked in the TARGET tree are included: `git reset --hard`
62
+ * overwrites them silently, so they are part of the destruction set
63
+ * (#2976 review F-1). `unreadable` means git status could not be read
64
+ * inside a real repository — callers must fail closed on it (never treat
65
+ * it as a clean tree). A non-git or bare-marker root returns an empty
66
+ * dirty set: nothing tracked to destroy.
67
+ */
68
+ export declare function measureGitDestruction(directory: string, targetSha?: string): {
69
+ kind: 'ok';
70
+ dirtyRelPaths: string[];
71
+ } | {
72
+ kind: 'unreadable';
73
+ };