@deftai/directive-core 0.56.0 → 0.56.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.
@@ -37,7 +37,7 @@
37
37
  * at freeze time. Leave it `null` otherwise. This is the only edit required to
38
38
  * pin the bridge version; the freeze + drift gates pick it up automatically.
39
39
  */
40
- export const LAST_GO_INSTALLER = null;
40
+ export const LAST_GO_INSTALLER = "v0.56.0";
41
41
  /** Returns the frozen final Go-installer tag, or `null` while unfrozen. */
42
42
  export function lastGoInstaller() {
43
43
  return LAST_GO_INSTALLER;
@@ -83,17 +83,17 @@ export type BridgeAssetSelection = {
83
83
  candidates: string[];
84
84
  };
85
85
  /**
86
- * Pick the deft-install bridge binary matching the current host platform/arch.
86
+ * Pick the installer bridge binary matching the current host platform/arch.
87
87
  *
88
- * Go releases publish one asset per OS/arch (e.g. `deft-install-linux-amd64`,
89
- * `deft-install-darwin-arm64`, `deft-install-windows-amd64.exe`). Selecting
90
- * `assets[0]` alphabetically silently picks the wrong binary on a multi-asset
91
- * release (darwin sorts before linux), producing an exec-format failure on a
92
- * non-Darwin runner. This resolves the host-matching asset instead and reports
93
- * a precise outcome when none matches:
94
- * - single deft-install asset -> use it (single-binary releases, back-compat);
95
- * - prefer an asset whose name carries BOTH the GOOS and GOARCH tokens;
96
- * - else fall back to a GOOS-only match (releases that omit the arch suffix);
88
+ * The release publishes one asset per OS (`install-<os>-<arch>`, with macOS as a
89
+ * single `install-macos-universal` fat binary). Selecting `assets[0]`
90
+ * alphabetically silently picks the wrong binary on a multi-asset release,
91
+ * producing an exec-format failure on a mismatched runner. This resolves the
92
+ * host-matching asset instead and reports a precise outcome when none matches:
93
+ * - single installer asset -> use it (single-binary releases, back-compat);
94
+ * - prefer an asset whose name carries BOTH the OS and arch tokens;
95
+ * - else fall back to an OS-only match (e.g. the macOS universal binary, which
96
+ * carries no arch suffix, or releases that omit the arch suffix);
97
97
  * - else `no-platform-match` so the caller fails loudly rather than guessing.
98
98
  */
99
99
  export declare function selectBridgeAsset(fileNames: readonly string[], platform?: NodeJS.Platform, arch?: string): BridgeAssetSelection;
@@ -269,11 +269,21 @@ export function assertNpmHybridMigration(workRoot, agentsTemplatePath, seams = {
269
269
  `directive migrate -> managed_by: '${NPM_MANAGED_SENTINEL_VALUE}', idempotent)`,
270
270
  ];
271
271
  }
272
- /** Map a Node `process.platform` value to the Go release `GOOS` asset token. */
272
+ /**
273
+ * Map a Node `process.platform` value to the published release OS asset token.
274
+ *
275
+ * The release workflow (.github/workflows/release.yml) uploads assets named
276
+ * `install-<os>-<arch>` where <os> is `windows` / `macos` / `linux` -- NOT the Go
277
+ * `GOOS` token. In particular macOS publishes a single `install-macos-universal`
278
+ * binary (the lipo'd fat binary), so a darwin host must look for `macos`, not
279
+ * `darwin`.
280
+ */
273
281
  function goOsToken(platform) {
274
282
  if (platform === "win32")
275
283
  return "windows";
276
- return platform; // "linux" / "darwin" line up with GOOS as-is
284
+ if (platform === "darwin")
285
+ return "macos"; // assets are install-macos-universal
286
+ return platform; // "linux" lines up as-is
277
287
  }
278
288
  /** Map a Node `process.arch` value to the Go release `GOARCH` asset token. */
279
289
  function goArchToken(arch) {
@@ -282,21 +292,29 @@ function goArchToken(arch) {
282
292
  return arch; // "arm64" lines up with GOARCH as-is
283
293
  }
284
294
  /**
285
- * Pick the deft-install bridge binary matching the current host platform/arch.
295
+ * Match an installer binary asset. The release workflow uploads
296
+ * `install-<os>-<arch>` (e.g. `install-linux-amd64`, `install-windows-amd64.exe`,
297
+ * `install-macos-universal`); the legacy single-binary / `deft-install-` naming is
298
+ * also accepted for back-compat. Anchored at the start of the basename so sibling
299
+ * assets like `checksums.txt` / `README.md` are excluded.
300
+ */
301
+ const INSTALLER_ASSET_RE = /^(?:deft-)?install(?:-|\.exe$|$)/i;
302
+ /**
303
+ * Pick the installer bridge binary matching the current host platform/arch.
286
304
  *
287
- * Go releases publish one asset per OS/arch (e.g. `deft-install-linux-amd64`,
288
- * `deft-install-darwin-arm64`, `deft-install-windows-amd64.exe`). Selecting
289
- * `assets[0]` alphabetically silently picks the wrong binary on a multi-asset
290
- * release (darwin sorts before linux), producing an exec-format failure on a
291
- * non-Darwin runner. This resolves the host-matching asset instead and reports
292
- * a precise outcome when none matches:
293
- * - single deft-install asset -> use it (single-binary releases, back-compat);
294
- * - prefer an asset whose name carries BOTH the GOOS and GOARCH tokens;
295
- * - else fall back to a GOOS-only match (releases that omit the arch suffix);
305
+ * The release publishes one asset per OS (`install-<os>-<arch>`, with macOS as a
306
+ * single `install-macos-universal` fat binary). Selecting `assets[0]`
307
+ * alphabetically silently picks the wrong binary on a multi-asset release,
308
+ * producing an exec-format failure on a mismatched runner. This resolves the
309
+ * host-matching asset instead and reports a precise outcome when none matches:
310
+ * - single installer asset -> use it (single-binary releases, back-compat);
311
+ * - prefer an asset whose name carries BOTH the OS and arch tokens;
312
+ * - else fall back to an OS-only match (e.g. the macOS universal binary, which
313
+ * carries no arch suffix, or releases that omit the arch suffix);
296
314
  * - else `no-platform-match` so the caller fails loudly rather than guessing.
297
315
  */
298
316
  export function selectBridgeAsset(fileNames, platform = process.platform, arch = process.arch) {
299
- const candidates = fileNames.filter((name) => /deft-install/i.test(name));
317
+ const candidates = fileNames.filter((name) => INSTALLER_ASSET_RE.test(name));
300
318
  if (candidates.length === 0) {
301
319
  return { kind: "none" };
302
320
  }
@@ -353,14 +371,14 @@ export function downloadAndRunFrozenBridge(pin, fixtureDir, seams = {}) {
353
371
  if (selection.kind === "none") {
354
372
  return [
355
373
  false,
356
- `frozen bridge ${pin} downloaded but no deft-install asset found in ${assetDir} ` +
374
+ `frozen bridge ${pin} downloaded but no installer asset (install-*) found in ${assetDir} ` +
357
375
  `(see ${GO_BRIDGE_RELEASES_URL})`,
358
376
  ];
359
377
  }
360
378
  if (selection.kind === "no-platform-match") {
361
379
  return [
362
380
  false,
363
- `frozen bridge ${pin} downloaded but no deft-install asset matches ` +
381
+ `frozen bridge ${pin} downloaded but no installer asset matches ` +
364
382
  `${goOsToken(process.platform)}/${goArchToken(process.arch)} ` +
365
383
  `(candidates: ${selection.candidates.join(", ")}; see ${GO_BRIDGE_RELEASES_URL})`,
366
384
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-core",
3
- "version": "0.56.0",
3
+ "version": "0.56.1",
4
4
  "description": "TypeScript engine core for the Directive framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -205,8 +205,8 @@
205
205
  "provenance": true
206
206
  },
207
207
  "dependencies": {
208
- "@deftai/directive-content": "^0.56.0",
209
- "@deftai/directive-types": "^0.56.0"
208
+ "@deftai/directive-content": "^0.56.1",
209
+ "@deftai/directive-types": "^0.56.1"
210
210
  },
211
211
  "scripts": {
212
212
  "build": "tsc -b",