hankweave 0.6.2 → 0.7.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.
@@ -32,7 +32,7 @@
32
32
  "self-test": "node index.js --self-test"
33
33
  },
34
34
  "dependencies": {
35
- "@mariozechner/pi-coding-agent": "^0.57.1",
35
+ "@earendil-works/pi-coding-agent": "^0.79.1",
36
36
  "@shims/common": "file:./common"
37
37
  },
38
38
  "devDependencies": {
@@ -47,7 +47,7 @@
47
47
  "hankweave"
48
48
  ],
49
49
  "engines": {
50
- "node": ">=20.0.0",
50
+ "node": ">=22.19.0",
51
51
  "bun": ">=1.1.0"
52
52
  }
53
53
  }
@@ -176,6 +176,17 @@ export interface TokenUsage {
176
176
  /** Tokens read from existing cache */
177
177
  cacheReadTokens: number;
178
178
  }
179
+ /**
180
+ * Classification of a failed shim self-test, used to route actionable guidance.
181
+ *
182
+ * - `launch`: the harness failed to start (spawn/module-load crash, version
183
+ * preflight failure). NOT an auth/config problem.
184
+ * - `auth`: the harness ran but credentials/API keys are missing or invalid.
185
+ * - `binary-missing`: the underlying agent binary was not found.
186
+ * - `check`: the harness ran a check and it failed for some other reason.
187
+ * - `unknown`: could not be classified.
188
+ */
189
+ export type SelfTestFailureCategory = "launch" | "auth" | "binary-missing" | "check" | "unknown";
179
190
  /**
180
191
  * Individual check result from a shim's self-test.
181
192
  * Each check verifies a specific aspect of the environment setup.
package/dist/utils.d.ts CHANGED
@@ -38,6 +38,28 @@ export declare function buildFileTree(projectPath: string, pattern: string): Pro
38
38
  * Replaces single quotes with '\'' and wraps in single quotes.
39
39
  */
40
40
  export declare function escapeShellArg(arg: string): string;
41
+ /**
42
+ * Decide whether an environment variable's value should be masked based on its
43
+ * NAME. Secrets are conventionally named with markers like SECRET/TOKEN/KEY/
44
+ * PASSWORD, while readable config (URLs, public keys, hosts) is not.
45
+ *
46
+ * Default is to show the value; we only mask names that look secret. The
47
+ * `PUBLIC`/`PUBLISHABLE` markers explicitly override the generic `KEY` rule, so
48
+ * e.g. `LANGFUSE_PUBLIC_KEY` is shown but `LANGFUSE_SECRET_KEY` is masked.
49
+ */
50
+ export declare function isSensitiveEnvKey(key: string): boolean;
51
+ /**
52
+ * Mask an environment-variable value for display in validation output.
53
+ *
54
+ * Reveals only the last 4 characters of sufficiently long values (enough to
55
+ * sanity-check which secret is loaded) and fully masks short ones.
56
+ */
57
+ export declare function maskSecretValue(value: string): string;
58
+ /**
59
+ * Format an env var for the validation listing: secret-named values are masked,
60
+ * everything else is shown verbatim.
61
+ */
62
+ export declare function formatEnvVarForDisplay(key: string, value: string): string;
41
63
  /**
42
64
  * Supported JavaScript runtimes.
43
65
  */
@@ -154,8 +176,63 @@ export interface StartupInfo {
154
176
  * Render the execution info section after the startup banner.
155
177
  */
156
178
  export declare function renderStartupInfo(info: StartupInfo): void;
179
+ /**
180
+ * Minimum Node.js version required to run the pi shim on PATH.
181
+ *
182
+ * The pi shim bundles @earendil-works/pi-coding-agent (→ undici), which needs a
183
+ * modern Node. Keep this in sync with shims/pi/package.json engines.node and the
184
+ * root package.json engines.node.
185
+ */
186
+ export declare const MIN_PI_NODE = "22.19.0";
187
+ /**
188
+ * Thrown when the PATH `node` required by the pi shim is missing or too old.
189
+ *
190
+ * Carries the resolved node path/version (when known) so callers can classify
191
+ * the failure as a launch failure and surface actionable diagnostics rather
192
+ * than a generic "check your API keys" message.
193
+ */
194
+ export declare class PiRuntimeError extends Error {
195
+ readonly diagnostics?: {
196
+ nodePath?: string;
197
+ nodeVersion?: string;
198
+ } | undefined;
199
+ constructor(message: string, diagnostics?: {
200
+ nodePath?: string;
201
+ nodeVersion?: string;
202
+ } | undefined);
203
+ }
204
+ /** Parse a semver-ish string ("v22.19.0", "22.19.0-nightly") to [major, minor, patch]. */
205
+ export declare function parseNodeVersion(version: string): [number, number, number] | null;
206
+ /** Compare two parsed versions: -1 if a < b, 0 if equal, 1 if a > b. */
207
+ export declare function compareVersions(a: [number, number, number], b: [number, number, number]): number;
208
+ /**
209
+ * Pure core of the pi Node preflight, separated from process spawning for
210
+ * testability. Returns a PiRuntimeError to throw, or `null` when the runtime is
211
+ * acceptable.
212
+ *
213
+ * - node not on PATH → missing-node error.
214
+ * - `node --version` unparseable → `null` (fail open; a parse quirk shouldn't
215
+ * block a possibly-fine runtime).
216
+ * - parsed version < MIN_PI_NODE → too-old error carrying path/version.
217
+ */
218
+ export declare function checkPiNodeRuntime(located: {
219
+ found: boolean;
220
+ path?: string;
221
+ }, rawVersion: string): PiRuntimeError | null;
222
+ /**
223
+ * Verify that the `node` on PATH satisfies the pi shim's minimum version.
224
+ *
225
+ * The pi shim is always spawned via `["node", scriptPath]`, so we must check the
226
+ * PATH `node` (the binary that will actually run pi) — NOT `process.version`,
227
+ * since the current runtime is usually Bun. Uses node:child_process spawnSync so
228
+ * it works under both Bun and plain Node (Bun.spawnSync is absent under Node).
229
+ *
230
+ * Hard-fails (throws PiRuntimeError) when node is missing or too old.
231
+ */
232
+ export declare function assertPiNodeRuntime(): void;
157
233
  /**
158
234
  * Get the appropriate command array to run a script in the current runtime.
235
+ *
159
236
  * This ensures shims and other scripts are executed with the correct runtime.
160
237
  *
161
238
  * For compiled executables, we check if 'bun' is available on PATH and use it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hankweave",
3
- "version": "0.6.2",
3
+ "version": "0.7.2",
4
4
  "description": "Orchestration runtime for antibrittle agentic workflows",
5
5
  "author": {
6
6
  "name": "Southbridge AI",
@@ -36,7 +36,7 @@
36
36
  "schemas"
37
37
  ],
38
38
  "engines": {
39
- "node": ">=20.0.0"
39
+ "node": ">=22.19.0"
40
40
  },
41
41
  "scripts": {
42
42
  "generate-schemas": "bun scripts/generate-schemas.ts",
@@ -53,7 +53,7 @@
53
53
  "test": "bun tests/utils/check-test-ready.ts && bun test tests/unit tests/integration tests/e2e/happy-path-e2e.test.ts tests/e2e/rollback-improved-1-e2e.test.ts && bun tests/unit/cleanup-after-tests.ts",
54
54
  "test:long": "LONG_TESTS=true bun test tests/long-running",
55
55
  "test:unit": "bun tests/unit/cleanup-after-tests.ts && bun test tests/unit && bun tests/unit/cleanup-after-tests.ts",
56
- "test:integration": "bun tests/integration",
56
+ "test:integration": "bun test tests/integration",
57
57
  "test:e2e:check": "bun tests/utils/check-test-ready.ts",
58
58
  "test:e2e:init": "bun scripts/e2e/init.ts normal",
59
59
  "test:e2e:init:npx": "bun scripts/e2e/init.ts npx",
@@ -90,9 +90,9 @@
90
90
  "@ai-sdk/google": "^2.0.7",
91
91
  "@ai-sdk/groq": "^2.0.11",
92
92
  "@ai-sdk/openai": "^2.0.18",
93
- "@anthropic-ai/claude-agent-sdk": "^0.1.70",
93
+ "@anthropic-ai/claude-agent-sdk": "0.3.170",
94
94
  "@clack/prompts": "^1.0.0",
95
- "@openai/codex-sdk": "0.104.0",
95
+ "@openai/codex-sdk": "0.139.0",
96
96
  "ai": "^5.0.15",
97
97
  "crossws": "^0.4.1",
98
98
  "eta": "^3.5.0",