halfcycle 0.4.13 → 0.4.15

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 (79) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/bin.bundle.mjs +6308 -588
  3. package/bin/pre-tool-use-filter.sh +134 -6
  4. package/commands/agent-teams-orchestration.md +1 -1
  5. package/commands/consistency-check.md +1 -1
  6. package/commands/context-update.md +1 -1
  7. package/commands/halfcycle-design.md +1 -1
  8. package/commands/halfcycle-setup.md +1 -1
  9. package/commands/stack-assembly-worker.md +1 -1
  10. package/commands/task-execution.md +1 -1
  11. package/commands/task-graph.md +1 -1
  12. package/commands/write-spec.md +1 -1
  13. package/dist/bin.d.ts +1 -0
  14. package/dist/bin.d.ts.map +1 -1
  15. package/dist/build-record/pair-io.d.ts +49 -0
  16. package/dist/build-record/pair-io.d.ts.map +1 -0
  17. package/dist/build-record/render-change.d.ts +25 -0
  18. package/dist/build-record/render-change.d.ts.map +1 -0
  19. package/dist/build-record/render-v2.d.ts +10 -5
  20. package/dist/build-record/render-v2.d.ts.map +1 -1
  21. package/dist/build-record/write-change.d.ts +63 -0
  22. package/dist/build-record/write-change.d.ts.map +1 -0
  23. package/dist/build-record/write.d.ts +5 -15
  24. package/dist/build-record/write.d.ts.map +1 -1
  25. package/dist/change.d.ts +136 -0
  26. package/dist/change.d.ts.map +1 -0
  27. package/dist/check-tasks.d.ts +71 -0
  28. package/dist/check-tasks.d.ts.map +1 -0
  29. package/dist/claude-plan.d.ts +133 -0
  30. package/dist/claude-plan.d.ts.map +1 -0
  31. package/dist/cli-contract.d.ts +12 -1
  32. package/dist/cli-contract.d.ts.map +1 -1
  33. package/dist/cli.js +9670 -4933
  34. package/dist/cli.js.map +3 -3
  35. package/dist/close-phase.d.ts +53 -1
  36. package/dist/close-phase.d.ts.map +1 -1
  37. package/dist/doctor.d.ts +34 -0
  38. package/dist/doctor.d.ts.map +1 -0
  39. package/dist/folder-refusals.d.ts +27 -0
  40. package/dist/folder-refusals.d.ts.map +1 -0
  41. package/dist/identity.d.ts +31 -1
  42. package/dist/identity.d.ts.map +1 -1
  43. package/dist/index.js +2832 -1324
  44. package/dist/index.js.map +3 -3
  45. package/dist/install-manifest.d.ts +11 -1
  46. package/dist/install-manifest.d.ts.map +1 -1
  47. package/dist/install-plan.d.ts +112 -0
  48. package/dist/install-plan.d.ts.map +1 -0
  49. package/dist/install.d.ts +593 -2
  50. package/dist/install.d.ts.map +1 -1
  51. package/dist/merge-settings.d.ts +21 -2
  52. package/dist/merge-settings.d.ts.map +1 -1
  53. package/dist/open-phase.d.ts +1 -1
  54. package/dist/open-phase.d.ts.map +1 -1
  55. package/dist/pace.d.ts +138 -0
  56. package/dist/pace.d.ts.map +1 -0
  57. package/dist/phase-work.d.ts +37 -0
  58. package/dist/phase-work.d.ts.map +1 -0
  59. package/dist/plan.d.ts +20 -4
  60. package/dist/plan.d.ts.map +1 -1
  61. package/dist/pre-create-checks.d.ts +28 -0
  62. package/dist/pre-create-checks.d.ts.map +1 -1
  63. package/dist/preview.d.ts +40 -0
  64. package/dist/preview.d.ts.map +1 -0
  65. package/dist/prove.d.ts +77 -0
  66. package/dist/prove.d.ts.map +1 -0
  67. package/dist/restore.d.ts +58 -0
  68. package/dist/restore.d.ts.map +1 -0
  69. package/dist/review.d.ts +19 -1
  70. package/dist/review.d.ts.map +1 -1
  71. package/dist/scan.d.ts +11 -0
  72. package/dist/scan.d.ts.map +1 -1
  73. package/dist/setup/discovery.d.ts.map +1 -1
  74. package/dist/setup/rows.d.ts +10 -6
  75. package/dist/setup/rows.d.ts.map +1 -1
  76. package/dist/system-report.d.ts +1 -1
  77. package/dist/system-report.d.ts.map +1 -1
  78. package/dist/uninstall.d.ts.map +1 -1
  79. package/package.json +2 -2
@@ -40,7 +40,13 @@ export type ManifestFile = {
40
40
  * What the installer did to `.claude/settings.json`. `schemaBefore` is present only
41
41
  * when an install changed `$schema`, holding the earlier value, or `null` when there
42
42
  * was none. The three `*Created` flags say whether an install created the `hooks`,
43
- * `permissions` and `permissions.deny` keys.
43
+ * `permissions` and `permissions.deny` keys. `statusLineSha256` is the canonical
44
+ * hash (`canonicalSha256`) of the `statusLine` setting as an install last wrote it,
45
+ * or found it still holding what it writes; absent when no run has written one
46
+ * (`builds-paced-to-plan` AC7). Uninstall takes a `statusLine` out only while its
47
+ * hash is still this one, so a status line the person edited, or set themselves,
48
+ * stays. OPTIONAL, like `mcp.entrySha256`: a record an earlier version wrote has no
49
+ * such key, and it must still parse.
44
50
  */
45
51
  export interface SettingsRecord {
46
52
  readonly created: boolean;
@@ -52,6 +58,7 @@ export interface SettingsRecord {
52
58
  readonly hooksCreated: boolean;
53
59
  readonly permissionsCreated: boolean;
54
60
  readonly denyCreated: boolean;
61
+ readonly statusLineSha256?: string;
55
62
  }
56
63
  /** What the installer did to `.mcp.json`. `entrySha256` is the canonical hash of the
57
64
  * `halfcycle` server entry as last written; absent when no run has written one. */
@@ -196,6 +203,9 @@ export declare function recordCreatedDir(draft: ManifestDraft, path: string): vo
196
203
  * What this run observed about `.claude/settings.json`, merged into the record by the
197
204
  * carry-forward rules: the three lists are unions, and `created`, `adopted`,
198
205
  * `schemaBefore` and each keys-created flag keep the first value recorded.
206
+ * `statusLineSha256` is replaced by a run that wrote the status line (or found its
207
+ * own there), and kept by one that did not, the rule `recordMcp` applies to
208
+ * `entrySha256`.
199
209
  */
200
210
  export declare function recordSettings(draft: ManifestDraft, observed: SettingsRecord): void;
201
211
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"install-manifest.d.ts","sourceRoot":"","sources":["../src/install-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,qCAAqC,CAAC;AAEvE,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,kCAAkC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE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,EAAE,GAAG,IAAI,CAG7G;AAeD,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,CAsBpE"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * The installer plans first and writes second (`setup-preview-and-doctor` AC1).
3
+ *
4
+ * `planInstall` reads the folder and returns an `InstallPlan`: every path setting up
5
+ * would add, change, remove or leave alone, with the bytes it would write. It makes no
6
+ * write, no rename, no `mkdir`, no request and no git command that changes anything; the
7
+ * only git it runs is the read-only set the planning functions it calls already ran
8
+ * (`isTrackedAndClean`'s `ls-files` and `diff`, and the identity's `rev-list` and
9
+ * `remote get-url`). `applyInstallPlan` writes exactly that plan, and builds the
10
+ * install's report from it through `accountInstall` (`install.ts`), the one function
11
+ * that turns a plan's steps into a report, so the report and the plan cannot list
12
+ * different paths. `install()` is the two calls in a row.
13
+ *
14
+ * Each decision lives beside the writer it belongs to, in `install.ts`, `identity.ts`
15
+ * and `scan.ts` (`planSettings`, `planGitignore`, `planProjectIdentity`, …): there is
16
+ * one home for each rule, and this module only puts them in order. A plan made with no
17
+ * project id (the preview) carries `PENDING` bytes where the service's answer is still to
18
+ * come, and cannot be applied.
19
+ *
20
+ * ONE DELIBERATE SECOND DECISION. The pre-T-09 in-tree credential (`.env.local`) is
21
+ * planned against the store the credential write is expected to leave, and decided AGAIN
22
+ * at apply time against the store read back from disk (`applyLegacyMigration`): the
23
+ * tree's copy goes only once a copy demonstrably lives outside it, and a prediction is
24
+ * not a demonstration.
25
+ *
26
+ * Two more things the apply works out from what happened rather than from the plan,
27
+ * both with the same paths: the install record is rebuilt by `accountInstall` from the
28
+ * actual outcomes (it differs from the planned record only when a best-effort step
29
+ * failed), and `writeEngagementEnv` reconciles the machine-level store against the file
30
+ * on disk as it writes, as it always has.
31
+ *
32
+ * INV-001: Node builtins and this package's own modules only.
33
+ */
34
+ import { type EngagementType, type InstallOptions, type InstallResult } from './install.js';
35
+ /** What setting up does to one path. */
36
+ export type PlanAction = 'add' | 'change' | 'remove' | 'leave';
37
+ /**
38
+ * The bytes of a path whose content needs the service's answer first (the project id and
39
+ * method version in the pin, the server address, and the install record that hashes
40
+ * both). Only a preview's plan holds it, and such a plan cannot be applied.
41
+ */
42
+ export declare const PENDING: unique symbol;
43
+ export type PendingBytes = typeof PENDING;
44
+ /**
45
+ * Every kind of file the installer writes, each with its own preview words. Every member
46
+ * of `closedWriteSet()` maps to one (`previewKindOf`), and a test asserts none is
47
+ * missing, so a new installer file cannot ship without words for the preview.
48
+ */
49
+ export declare const PREVIEW_KINDS: readonly ["command", "check-script", "settings", "server-entry", "ignore-list", "line-endings", "halfcycle-folder", "runner", "captured-index", "old-sign-in"];
50
+ export type PreviewKind = (typeof PREVIEW_KINDS)[number];
51
+ /** One path in the plan. `bytes` is `null` for `leave` and `remove`. */
52
+ export interface InstallPlanEntry {
53
+ readonly path: string;
54
+ readonly action: PlanAction;
55
+ readonly kind: PreviewKind;
56
+ readonly bytes: string | null | PendingBytes;
57
+ /** Present only on a `leave` of a file that is not Halfcycle's: a file of yours with the same name. */
58
+ readonly yours?: true;
59
+ }
60
+ /**
61
+ * What setting up does outside this folder: the project's sign-in, kept under the
62
+ * person's home folder (`path` is `null` until the project id is known), and, in a
63
+ * preview of a folder with no project pinned, the new project made at sign-in.
64
+ */
65
+ export type InstallPlanOutside = {
66
+ readonly kind: 'sign-in';
67
+ readonly path: string | null;
68
+ readonly action: 'add' | 'change' | 'leave' | 'pending';
69
+ } | {
70
+ readonly kind: 'new-project';
71
+ };
72
+ /** The installer's plan: what `applyInstallPlan` writes, and what the preview prints. */
73
+ export interface InstallPlan {
74
+ /** Every path, in the order the installer writes them. */
75
+ readonly entries: readonly InstallPlanEntry[];
76
+ readonly outside: readonly InstallPlanOutside[];
77
+ /** Set when setting up would refuse before writing anything; `entries` is then empty. */
78
+ readonly refusal?: string;
79
+ }
80
+ /** The words a preview line uses for one kind of file. */
81
+ export interface PreviewWords {
82
+ readonly add: string;
83
+ readonly change: string;
84
+ readonly leave: string;
85
+ readonly yours: string;
86
+ }
87
+ /**
88
+ * The preview's words per kind (`{what it is}`, `{what changes}`, `{why}`). Plain words
89
+ * for a person deciding whether to trust what setting up does: what the file is for,
90
+ * never how Halfcycle works inside.
91
+ */
92
+ export declare const PREVIEW_WORDS: Readonly<Record<PreviewKind, PreviewWords>>;
93
+ /** The preview kind of an installer path, or `undefined` for a path with none. */
94
+ export declare function previewKindOf(rel: string): PreviewKind | undefined;
95
+ /**
96
+ * `install()`'s options, with the project id optional: without one the plan is a
97
+ * preview, and the service's answer is `PENDING`.
98
+ */
99
+ export interface PlanInstallOptions extends Omit<InstallOptions, 'engagementId' | 'engagementType'> {
100
+ engagementId?: string;
101
+ engagementType?: EngagementType;
102
+ }
103
+ /** Read the folder and decide every path. Writes nothing, anywhere (see the module docblock). */
104
+ export declare function planInstall(options: PlanInstallOptions): InstallPlan;
105
+ /**
106
+ * Write the plan, in the order it lists, and return the install's report. Every write is
107
+ * the planned bytes through the writer that owns that path; no decision is taken here
108
+ * except the legacy migration's second one (the module docblock says why). A plan that
109
+ * refused throws its refusal before anything is written; a preview's plan cannot be applied.
110
+ */
111
+ export declare function applyInstallPlan(plan: InstallPlan): InstallResult;
112
+ //# sourceMappingURL=install-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plan.d.ts","sourceRoot":"","sources":["../src/install-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAYH,OAAO,EA4CL,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,KAAK,aAAa,EAKnB,MAAM,cAAc,CAAC;AAQtB,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,OAAO,MAA0B,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC;A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