halfcycle 0.4.1 → 0.4.3

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/dist/install.d.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  * Halfcycle's scaffold contents.
23
23
  */
24
24
  import { BUNDLE_PIN_REL, MCP_REGISTRATION_REL, MCP_SERVER_KEY, SETTINGS_REL, WRITE_CAPABLE_TOOLS } from '@halfcycle/core';
25
+ import { type ManifestFile } from './install-manifest.js';
25
26
  import { type ClaudeSettings } from './merge-settings.js';
26
27
  export type EngagementType = 'self-build' | 'client';
27
28
  export interface BundlePin {
@@ -36,7 +37,15 @@ export interface BundlePin {
36
37
  */
37
38
  installedAt: string;
38
39
  /**
39
- * The account this install acted as (W-8, #812) — the id, and never the email.
40
+ * The account that CREATED this project (W-8, #812; renamed from `accountId` by
41
+ * onboarding fix wave 2, E1 — #1598) — the id, and never the email.
42
+ *
43
+ * WRITTEN ONCE, BY THE CREATE STEP ONLY. Every other install — a re-run, a join from
44
+ * a clone, a refused join — carries the previous pin's value forward unchanged and
45
+ * never supplies one of its own, so the committed file names the owner rather than
46
+ * whoever installed last, and a second clone's tree stays clean. Read it through
47
+ * `pinCreatedByAccountId`, never off this field directly: pins written before the
48
+ * rename hold it as `accountId`.
40
49
  *
41
50
  * WHY IT IS ON DISK AT ALL. The installer names the acting account on stdout before it
42
51
  * creates anything, which is the interruption a person at a terminal gets. A run with
@@ -60,6 +69,12 @@ export interface BundlePin {
60
69
  * `HALFCYCLE_TOKEN` that carries no id of its own). Nothing derives access, ownership
61
70
  * or entitlement from it — the plane owns those and answers them from the credential.
62
71
  */
72
+ createdByAccountId?: string;
73
+ /**
74
+ * The same fact under its name before E1. Only ever READ — by `pinCreatedByAccountId`,
75
+ * the one reader — and never written: the next install rewrites it as
76
+ * `createdByAccountId`, so an old pin changes once.
77
+ */
63
78
  accountId?: string;
64
79
  /**
65
80
  * The project's page on the dashboard — where the person sees how the project
@@ -69,7 +84,7 @@ export interface BundlePin {
69
84
  * SAFE TO COMMIT, and this field does not churn: it is built from the engagement id and
70
85
  * a constant (`projectPageUrl`), so every clone of the same engagement writes the same
71
86
  * value, unlike a per-run value. It is rebuilt on every write, never carried forward
72
- * from the previous pin the way `installedAt` and `accountId` are. It carries no
87
+ * from the previous pin the way `installedAt` and `createdByAccountId` are. It carries no
73
88
  * credential and never the installer's first-visit code. The dashboard decides what a
74
89
  * visitor sees: someone signed in to Halfcycle in that browser reaches the project, and
75
90
  * someone who is not is refused.
@@ -85,7 +100,7 @@ export interface BundlePin {
85
100
  * follow-ups), so `checkDrift` can report it without asking the plane again.
86
101
  *
87
102
  * CARRIED FORWARD within the same engagement, on the same terms as
88
- * `accountId` above: a re-install that resolves no fresh create/join answer
103
+ * `createdByAccountId` above: a re-install that resolves no fresh create/join answer
89
104
  * (the commonest run of all) must not overwrite what an earlier run learned.
90
105
  * A different engagement installed into this repository carries nothing
91
106
  * forward — see `writeBundlePin`.
@@ -195,12 +210,13 @@ export interface InstallOptions {
195
210
  */
196
211
  home?: string;
197
212
  /**
198
- * The account this run acted as, for the pin (W-8, #812). Supplied by `bin.ts` from
199
- * `confirmActingIdentity`'s answer — this module never resolves an identity of its
200
- * own, and an install driven without one (the mechanics-only tests, an offline
201
- * install) simply records none. See `BundlePin.accountId`.
213
+ * The account that created the project, for the pin (W-8, #812; E1, #1598). `bin.ts`
214
+ * supplies it on the CREATE arm only, from `confirmActingIdentity`'s answer; every
215
+ * other arm leaves it out and the previous pin's value is carried. A value already
216
+ * recorded for this engagement is never replaced — see `writeBundlePin`. This module
217
+ * never resolves an identity of its own. See `BundlePin.createdByAccountId`.
202
218
  */
203
- accountId?: string;
219
+ createdByAccountId?: string;
204
220
  }
205
221
  export interface InstallResult {
206
222
  version: string;
@@ -215,6 +231,17 @@ export interface InstallResult {
215
231
  * overwritten. `nothing they already had is changed` holds because of this list.
216
232
  */
217
233
  collidedPaths: string[];
234
+ /**
235
+ * A SUBSET of `collidedPaths` (E8, the wording batch): a collided path
236
+ * the PREVIOUS install's own manifest already listed as one of ours. The header
237
+ * line that would normally prove ownership (`bytesAreOurs`) no longer matches —
238
+ * that is what makes this a collision rather than a replace — but the manifest
239
+ * still says this name was Halfcycle's on the run before this one, which a
240
+ * developer's own, never-ours file at that name cannot be. So this is not "a name
241
+ * you already use"; it is the user's own edit of a file an older Halfcycle wrote,
242
+ * and the report names it as that instead.
243
+ */
244
+ editedCollidedPaths: string[];
218
245
  /**
219
246
  * Files THIS INSTALLER had written before, which existed, differed, and were
220
247
  * overwritten. A SUBSET of `writtenPaths`, never a separate bucket — a consumer
@@ -334,6 +361,8 @@ export interface ClosedWriteSet {
334
361
  readonly hookCommands: ReadonlySet<string>;
335
362
  /** The SHA-256 of every deny rule the installer adds. */
336
363
  readonly denyRuleSha256: ReadonlySet<string>;
364
+ /** The `$schema` value the installer writes into `.claude/settings.json`. */
365
+ readonly settingsSchema: string;
337
366
  /** Every line the installer appends to `.gitignore`. */
338
367
  readonly gitignoreLines: ReadonlySet<string>;
339
368
  /** Every line the installer appends to `.gitattributes`, retired scripts' included. */
@@ -372,13 +401,31 @@ export interface ClosedWriteSet {
372
401
  * directory with it. The writer and the remover therefore cannot hold two lists.
373
402
  */
374
403
  export declare function closedWriteSet(): ClosedWriteSet;
404
+ /**
405
+ * THE ONE DEFINITION OF "THESE BYTES ARE OURS" for a whole file outside
406
+ * `.halfcycle/` (FW-3, #1569). True when the bytes hash to what the install record
407
+ * holds for that path, or to what this version writes there (`generatedSha256`).
408
+ *
409
+ * Uninstall removes a file only when this holds; install replaces a differing
410
+ * command file only when this holds. One predicate, so the two verbs cannot
411
+ * disagree about which files are Halfcycle's. A file the developer wrote, or one of
412
+ * ours they edited, matches neither hash and is kept.
413
+ *
414
+ * The record arm is what carries an UPGRADE: every version that writes a record
415
+ * (0.3.28 on) hashed each file it wrote, so an earlier version's untouched file
416
+ * matches its own recorded hash. A tree installed before the record existed has no
417
+ * such hash and keeps its older file, named; there is no table of historical hashes.
418
+ * `recorded` must come from a record already filtered to the closed write set
419
+ * (`startManifest`), so a committed record cannot vouch for a path that is not ours.
420
+ */
421
+ export declare function bytesAreOurs(path: string, bytes: Uint8Array, recorded: ManifestFile | undefined, writeSet: ClosedWriteSet): boolean;
375
422
  /**
376
423
  * The write outcome for one target path under the copy set.
377
424
  * - `written` — the file did not exist and was created.
378
425
  * - `skipped` — the file exists and is already byte-identical to what we write
379
426
  * (an idempotent re-install of our own content).
380
- * - `collided` — the file exists with DIFFERENT content: a name the developer
381
- * already uses. Reported, never overwritten. This is the guarantee
427
+ * - `collided` — the file exists with DIFFERENT content that is not ours: a name
428
+ * the developer already uses. Reported, never overwritten. This is the guarantee
382
429
  * that makes `nothing they already had is changed` true of the whole
383
430
  * tree, not one file (client-install-surface.md criterion 5).
384
431
  */
@@ -463,6 +510,13 @@ export declare class SettingsParseRefused extends Error {
463
510
  constructor(message: string);
464
511
  }
465
512
  export declare function settingsParseRefusal(targetRepo: string, err: unknown): string;
513
+ /**
514
+ * The `$schema` value the installer writes into `.claude/settings.json`. One home:
515
+ * `generateSettingsJson` writes it and uninstall puts the earlier value back only
516
+ * while the file still holds this one (E7, onboarding-fix-wave-2; #1587), so a value
517
+ * the developer set after install is theirs and stays.
518
+ */
519
+ export declare const SETTINGS_SCHEMA = "https://json.schemastore.org/claude-code-settings.json";
466
520
  /**
467
521
  * Generate the .claude/settings.json hook entries + permissions for the target
468
522
  * repo.
@@ -642,13 +696,31 @@ export declare const GITIGNORE_HEADER = "# Halfcycle \u2014 machine-local secret
642
696
  *
643
697
  * It claims `header` and, under it (up to the next blank line), only lines in
644
698
  * `claimable` — never another line under that header, because a developer may have
645
- * added their own there. The claimed lines are taken verbatim and in file order. When
699
+ * added their own there. Each line is compared without its trailing `\r` (`lineKey`),
700
+ * so a CRLF clone's block is claimed too. The claimed lines are taken verbatim, `\r`
701
+ * included, and in file order. When
646
702
  * a developer line sits between them the recorded text does not occur in the file as
647
703
  * one block, and uninstall falls back to removing the claimed lines one by one. A
648
704
  * blank line directly above a header is the separator the earlier run wrote, and is
649
705
  * claimed with the header.
650
706
  */
651
707
  export declare function adoptBlockUnderHeader(before: string, header: string, claimable: ReadonlySet<string>): string;
708
+ /**
709
+ * A LINE OF OURS IS THE SAME LINE WHATEVER ITS LINE ENDING (E7, onboarding-fix-wave-2;
710
+ * #1587). A file split on `\n` alone leaves a CRLF file's `\r` on each line, and a
711
+ * clone made with `core.autocrlf=true` turns every LF line this installer wrote into
712
+ * one. So every comparison of a line against ours — here, in the reconciles and in
713
+ * uninstall's trim — is made on the line without that one trailing `\r`. ONE RULE,
714
+ * one home: uninstall imports this rather than spelling its own.
715
+ */
716
+ export declare function lineKey(line: string): string;
717
+ /**
718
+ * The line ending a line break inserted into `text` takes: the file's own, read from
719
+ * its first line — `\r\n` when that line ends so, else `\n` (E7, #1586). Both the
720
+ * installer's appends and uninstall's re-joined lines use it, so neither leaves a
721
+ * CRLF file with mixed endings.
722
+ */
723
+ export declare function lineEndingOf(text: string): '\n' | '\r\n';
652
724
  /**
653
725
  * The header line every `.gitattributes` block this installer appends opens with
654
726
  * (`windows-install-hygiene.md`, AC1). Git for Windows usually clones with
@@ -664,6 +736,12 @@ export declare const GITATTRIBUTES_HEADER = "# Halfcycle \u2014 generated script
664
736
  * the installed version differs from the bundle version the operator intends
665
737
  * to run — reusing the mirror-diff/header-strip posture with no new mechanism.
666
738
  */
739
+ /**
740
+ * Who created the project, per the pin — THE ONE READER of that field (E1, #1598).
741
+ * Takes `createdByAccountId`, falling back to `accountId`, the field's name in a pin
742
+ * written before the rename. `undefined` when neither holds a non-empty string.
743
+ */
744
+ export declare function pinCreatedByAccountId(pin: BundlePin | null | undefined): string | undefined;
667
745
  export declare function readBundlePin(targetRepoRoot: string): BundlePin | null;
668
746
  /**
669
747
  * Read back the engagement this repo is ALREADY installed against, if any — the
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mapp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AAa,CAAC,CA8c7E"}
@@ -9,12 +9,15 @@
9
9
  * here: it has grown twice (`UserPromptSubmit` at W8-T-05b, `Stop` at G-01) and a
10
10
  * number in this comment goes stale silently while the code stays right.
11
11
  *
12
- * The merge is UPSERT-BY-IDENTITY, not append: every Halfcycle-authored entry
13
- * already present for an event is dropped and the generated ones re-added, so a
14
- * second install does not fire the guard twice per edit. Identity is decided by the
15
- * hook command string, which is the stable, generated marker of a Halfcycle-authored
16
- * entry (each of our commands is a distinct invocation of a script under
17
- * `.claude/hooks/`).
12
+ * The merge is UPSERT-BY-IDENTITY, not append: every command of ours already present
13
+ * for an event is taken out of the entry holding it and the generated entries
14
+ * re-added, so a second install does not fire the guard twice per edit. Identity is
15
+ * decided by the hook command string, which is the stable, generated marker of a
16
+ * Halfcycle-authored command (each of ours is a distinct invocation of a script under
17
+ * `.claude/hooks/`). **OURS ARE TAKEN OUT COMMAND BY COMMAND, NEVER ENTRY BY ENTRY**
18
+ * (E7, onboarding-fix-wave-2; #1586): an entry is dropped only when ours were all it
19
+ * held, so a developer's command grouped into the same entry as one of ours keeps its
20
+ * entry and matcher (`withoutHalfcycleCommands`, the rule uninstall applies too).
18
21
  *
19
22
  * **"OURS" IS EVERY COMMAND WE HAVE EVER WRITTEN, not only what this version
20
23
  * generates** (#1556). The commands' form changed from `bash ./<script>` to
@@ -70,17 +73,33 @@ export interface ClaudeSettings {
70
73
  [key: string]: unknown;
71
74
  }
72
75
  /**
73
- * True iff `entry` is Halfcycle-authored — i.e. it carries a hook command that
74
- * matches one of ours. This is how a re-install replaces our entry in place
75
- * rather than appending a duplicate. A developer's own entry (any other command
76
- * string) is never matched, so it is never touched.
77
- *
78
- * Exported because it is THE rule for recognising a Halfcycle hook entry, and the
79
- * installer's manifest (deciding whether a pre-manifest settings file is adopted)
80
- * and the uninstaller (deciding which entries to take apart) ask the same question.
81
- * A second predicate beside either of them would be a second answer to it.
76
+ * True iff `hook` — one element of an entry's `hooks` list, as parsed — is a command
77
+ * of ours. THE PER-COMMAND TEST, and the only one: the merge and uninstall both take
78
+ * out exactly the commands it matches, and nothing else in an entry.
79
+ */
80
+ export declare function isHalfcycleCommand(hook: unknown, halfcycleCommands: ReadonlySet<string>): boolean;
81
+ /**
82
+ * True iff `entry` holds a command of ours (`isHalfcycleCommand`). This is how a
83
+ * re-install recognises our wiring, and how the installer's manifest decides whether a
84
+ * pre-manifest settings file is adopted. It says the entry HOLDS ours, not that the
85
+ * entry IS ours: a developer may group their own command into the same entry, so what
86
+ * the merge and uninstall take out is decided command by command
87
+ * (`withoutHalfcycleCommands`), never entry by entry.
88
+ */
89
+ export declare function isHalfcycleEntry(entry: {
90
+ hooks: readonly unknown[];
91
+ }, halfcycleCommands: ReadonlySet<string>): boolean;
92
+ /**
93
+ * `entry` with our commands taken out — THE ONE RULE both the merge and uninstall
94
+ * apply to a hook entry (E7, onboarding-fix-wave-2; #1586): an entry holding none of
95
+ * ours comes back as it is (the same object); one holding ours comes back with only
96
+ * the developer's commands, its `matcher` and every other key kept; and `null` only
97
+ * when taking ours out left it with no command at all. A developer's command in an
98
+ * entry beside ours therefore survives both install and uninstall.
82
99
  */
83
- export declare function isHalfcycleEntry(entry: HookEntry, halfcycleCommands: Set<string>): boolean;
100
+ export declare function withoutHalfcycleCommands<E extends {
101
+ hooks: readonly unknown[];
102
+ }>(entry: E, halfcycleCommands: ReadonlySet<string>): E | null;
84
103
  /**
85
104
  * Merge Halfcycle's generated hook entries into an existing settings object.
86
105
  *
@@ -1 +1 @@
1
- {"version":3,"file":"merge-settings.d.ts","sourceRoot":"","sources":["../src/merge-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,6DAA6D;AAC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AAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAIjG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAEtH;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EAC9E,KAAK,EAAE,CAAC,EACR,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GACrC,CAAC,GAAG,IAAI,CAIV;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,GAAG,cAAc,CA0CjG"}
@@ -32,10 +32,11 @@ export type OwnEngagementDeps = ConfirmIdentityDeps;
32
32
  *
33
33
  * `actingAccountId` is not part of the plane's response and is not read from one: it is
34
34
  * the account `confirmActingIdentity` settled on for this run, carried out to `bin.ts`
35
- * so it can be written into the committed `.halfcycle/bundle.json`. Naming the account
36
- * on stdout leaves the fact in scrollback and in nothing else — an agent-run install
37
- * puts it in a transcript, not in front of a person — so the id travels to disk with
38
- * the engagement id it belongs beside.
35
+ * for the report's "Signed in as" line and, on a CREATE only, for the committed
36
+ * `.halfcycle/bundle.json` as `createdByAccountId` (E1, #1598). Naming the account on
37
+ * stdout leaves the fact in scrollback and in nothing else — an agent-run install puts
38
+ * it in a transcript, not in front of a person — so the creator's id travels to disk
39
+ * with the engagement id it belongs beside. A join writes nothing there.
39
40
  *
40
41
  * THE ID AND NEVER THE EMAIL. That file is committed into the client's repository, so
41
42
  * the identity read's `email` stops at the terminal; what is recorded is the value the
@@ -78,9 +79,9 @@ export interface OutcomeBRefusal {
78
79
  readonly message: string;
79
80
  /**
80
81
  * The account this run confirmed before the plane refused it, when known — the
81
- * same value `OwnedEngagement.actingAccountId` carries on success, so `bin.ts`
82
- * can write ONE `.halfcycle/bundle.json` field regardless of which shape came
83
- * back.
82
+ * same value `OwnedEngagement.actingAccountId` carries on success, for the
83
+ * report's "Signed in as" line. Never written to `.halfcycle/bundle.json`: only
84
+ * a create records an account there (E1, #1598).
84
85
  */
85
86
  readonly actingAccountId?: string;
86
87
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"own-engagement.d.ts","sourceRoot":"","sources":["../src/own-engagement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGxF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;;OAMG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AEjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,eAAe,GAAG,qBAAqB,CAAC,CAwDlD;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC,CAoF5C"}
@@ -24,6 +24,26 @@
24
24
  * id is judged by `projectIdSchema` — the same schema control uses to answer `400` —
25
25
  * so this package holds no second idea of what a usable id looks like.
26
26
  */
27
+ /**
28
+ * THE ONE SENTENCE A STOPPED INSTALL ENDS WITH when this folder has a usable id
29
+ * (onboarding fix wave FW-1, the macOS and Linux walks' C14/C4).
30
+ *
31
+ * The folder id is written before any request and kept on purpose
32
+ * (`project-identity-reuse` AC1/AC2): it is what makes a re-run ask for the same
33
+ * project instead of a second one. So a refusal that then said "Nothing was created"
34
+ * or "This folder was not set up" was false the moment the reader looked, and
35
+ * each refusal had its own version of the falsehood. They now say only their cause,
36
+ * and `bin.ts` adds this sentence once, after any install that stops while the folder has
37
+ * a usable id (`readFolderId`) — one rule, keyed on the very fact the sentence states.
38
+ * A file with no usable id gets no such line: its own refusal says to delete it.
39
+ *
40
+ * Why "needs undoing" and not "nothing was set up on the service": a create whose
41
+ * reply was lost may have made the project after all (`createEngagementForProject`),
42
+ * and an install that broke after the create certainly did. In every case the re-run
43
+ * gets that same project back, so nothing needs undoing — which is true on every arm
44
+ * this line is printed on, where "nothing was set up" is not.
45
+ */
46
+ export declare const KEPT_FOLDER_ID_LINE: string;
27
47
  /** A local check refused the install. `message` is the sentence to print. */
28
48
  export declare class PreCreateRefused extends Error {
29
49
  constructor(message: string);
@@ -58,4 +78,11 @@ export declare function refuseSystemFolder(targetRepo: string, platform?: NodeJS
58
78
  export declare function refuseInsideProject(targetRepo: string): void;
59
79
  /** The one install command the offer runs and the refusal names (#1557, decision D2). */
60
80
  export declare const GIT_INSTALL_ARGS: readonly string[];
81
+ /**
82
+ * The usable id in this folder's `project.json`, or `undefined` when the file is
83
+ * missing, does not parse, or holds no id control would accept. ONE home for the
84
+ * judgement, read by `claimFolderId` above and by `bin.ts`, which ends a stopped
85
+ * install with `KEPT_FOLDER_ID_LINE` exactly when this answers an id.
86
+ */
87
+ export declare function readFolderId(targetRepo: string): string | undefined;
61
88
  //# sourceMappingURL=pre-create-checks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pre-create-checks.d.ts","sourceRoot":"","sources":["../src/pre-create-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAUH,6EAA6E;AAC7E,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC,CAKpG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI7D;AA0BD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,IAAI,CAWzG;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU5D;AAUD,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAA+D,CAAC"}
1
+ {"version":3,"file":"pre-create-checks.d.ts","sourceRoot":"","sources":["../src/pre-create-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,QAEgC,CAAC;AAEjE,6EAA6E;AAC7E,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC,CAKpG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI7D;AA0BD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,IAAI,CAWzG;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU5D;AAUD,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAA+D,CAAC;AAsF9G;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../src/uninstall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AA2CH,2BAA2B;AAC3B,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CA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AC,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAmEhH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halfcycle",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Your coding agents are the engineers. Halfcycle is the rest of the team: product owner, architect, planner and independent reviewer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",