@akai-workflow-builder/cli-sdk 0.15.0 → 0.15.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to `@akai-workflow-builder/cli-sdk` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [0.15.1](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.15.0...cli-sdk-v0.15.1) (2026-10-26)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **ctx:** open the file before returning ctx.readFileStream's stream ([b137dfd](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/b137dfdfe71cdb258f6d20524bcabde23bad25bf))
13
+ * **deps:** pin Node to 24.22.1 for Node2Shell (CVE-2026-111497) ([f279e26](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/f279e2662dbce2286ae018dda519826dd45e62ca))
14
+
7
15
  ## [0.15.0](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.14.0...cli-sdk-v0.15.0) (2026-10-22)
8
16
 
9
17
 
@@ -16,11 +16,15 @@ export interface CreateReadFileStreamOptions {
16
16
  *
17
17
  * - `http://` / `https://` → `fetch()` body as a `Readable` (no egress allowlist;
18
18
  * the URL was minted by a trusted runtime).
19
- * - bare path (or `file://`) → `createReadStream(safePath(value))`.
19
+ * - bare path (or `file://`) → open `safePath(value)`, then stream it.
20
20
  *
21
21
  * `safePath` escape attempts surface as `AkaiPathError`; HTTP failures as `Error`
22
- * with the status text + URL. Read errors after the stream is returned surface as
23
- * `'error'` events on the stream, as usual for Node streams.
22
+ * with the status text + URL. A local file is opened before the stream is
23
+ * returned, so a missing or unreadable path (ENOENT, EACCES) rejects here, the
24
+ * way `ctx.readFile` does, rather than as a late
25
+ * `'error'` event that a consumer which never listens for one (exceljs
26
+ * `WorkbookReader`) turns into an uncaught exception. Read errors after the
27
+ * stream is returned still surface as `'error'` events, as usual for Node streams.
24
28
  */
25
29
  export declare function createReadFileStream(opts: CreateReadFileStreamOptions): (value: string) => Promise<Readable>;
26
30
  //# sourceMappingURL=read-file-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-file-stream.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,2BAA2B;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAiC5G"}
1
+ {"version":3,"file":"read-file-stream.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,2BAA2B;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAmC5G"}
@@ -1,4 +1,4 @@
1
- import { createReadStream } from 'node:fs';
1
+ import { open } from 'node:fs/promises';
2
2
  import { Readable } from 'node:stream';
3
3
  /**
4
4
  * Build a `ctx.readFileStream(value)` implementation — the streaming twin of
@@ -11,11 +11,15 @@ import { Readable } from 'node:stream';
11
11
  *
12
12
  * - `http://` / `https://` → `fetch()` body as a `Readable` (no egress allowlist;
13
13
  * the URL was minted by a trusted runtime).
14
- * - bare path (or `file://`) → `createReadStream(safePath(value))`.
14
+ * - bare path (or `file://`) → open `safePath(value)`, then stream it.
15
15
  *
16
16
  * `safePath` escape attempts surface as `AkaiPathError`; HTTP failures as `Error`
17
- * with the status text + URL. Read errors after the stream is returned surface as
18
- * `'error'` events on the stream, as usual for Node streams.
17
+ * with the status text + URL. A local file is opened before the stream is
18
+ * returned, so a missing or unreadable path (ENOENT, EACCES) rejects here, the
19
+ * way `ctx.readFile` does, rather than as a late
20
+ * `'error'` event that a consumer which never listens for one (exceljs
21
+ * `WorkbookReader`) turns into an uncaught exception. Read errors after the
22
+ * stream is returned still surface as `'error'` events, as usual for Node streams.
19
23
  */
20
24
  export function createReadFileStream(opts) {
21
25
  const { safePath, signal } = opts;
@@ -47,6 +51,8 @@ export function createReadFileStream(opts) {
47
51
  return Readable.fromWeb(response.body);
48
52
  }
49
53
  const resolved = safePath(value);
50
- return createReadStream(resolved);
54
+ const handle = await open(resolved, 'r');
55
+ // The stream owns the handle and closes it on end, error or destroy.
56
+ return handle.createReadStream();
51
57
  };
52
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akai-workflow-builder/cli-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Authoring SDK for atomic, agent-executable CLIs and tools.",
5
5
  "keywords": [
6
6
  "akai",