halfcycle 0.3.40 → 0.4.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.
@@ -41,4 +41,36 @@ export interface ClaudeVersionProbeDeps {
41
41
  * callers' degradation (say nothing) depends on that.
42
42
  */
43
43
  export declare function probeClaudeCodeVersion(timeoutMs: number, deps?: ClaudeVersionProbeDeps): string | undefined;
44
+ /** The four install methods `npx halfcycle`'s own download page names, and the one
45
+ * command that upgrades each. */
46
+ export type ClaudeInstallMethod = 'winget' | 'npm' | 'brew' | 'native';
47
+ export declare const CLAUDE_CODE_INSTALL_PAGE = "https://claude.com/claude-code";
48
+ export declare const UPGRADE_COMMANDS: Readonly<Record<ClaudeInstallMethod, string>>;
49
+ export interface ClaudeInstallMethodDeps {
50
+ /** Defaults to `process.env`. */
51
+ readonly env?: NodeJS.ProcessEnv;
52
+ /** Defaults to `process.platform`. */
53
+ readonly platform?: NodeJS.Platform;
54
+ /** Defaults to `existsSync`. Inject so a test can name which files exist without a real PATH. */
55
+ readonly exists?: (file: string) => boolean;
56
+ /** Defaults to `realpathSync`, falling back to its own argument on failure. Inject to assert a
57
+ * symlink target without creating a real one. */
58
+ readonly realpath?: (file: string) => string;
59
+ }
60
+ /**
61
+ * BEST-EFFORT: which of the four install methods put `claude` on this PATH, or
62
+ * `undefined` when it cannot be told — `claude` is not on PATH at all (the caller
63
+ * already has its own answer for "not found"), or it is there but resolves to a
64
+ * real path none of the four patterns match (a developer's own symlink, a
65
+ * corporate image, an install layout this probe has never seen). The caller's own
66
+ * rule for that case is "give the one generic line rather than guessing" — this
67
+ * function does not guess either, and returns `undefined` rather than defaulting
68
+ * to any one method.
69
+ *
70
+ * Scans PATH for `claude`, or `claude.cmd`/`claude.exe` on Windows (an npm install
71
+ * puts the former on PATH, the native installer the latter — same asymmetry
72
+ * `probeClaudeCodeVersion`'s own header documents), the same way `hasGitBash`
73
+ * (`pre-create-checks.ts`) scans it for `git.exe`. Spawns nothing.
74
+ */
75
+ export declare function probeClaudeCodeInstallMethod(deps?: ClaudeInstallMethodDeps): ClaudeInstallMethod | undefined;
44
76
  //# sourceMappingURL=claude-version-probe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-version-probe.d.ts","sourceRoot":"","sources":["../src/claude-version-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;0DAC0D;AAC1D,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IACP,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CAC7C,KACE,MAAM,CAAC;AAEZ,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IACpC,sFAAsF;IACtF,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,sBAA2B,GAAG,MAAM,GAAG,SAAS,CAqB/G"}
1
+ {"version":3,"file":"claude-version-probe.d.ts","sourceRoot":"","sources":["../src/claude-version-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;0DAC0D;AAC1D,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IACP,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,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