@flyingrobots/bijou-node 3.0.0 → 4.0.0

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/LICENSE CHANGED
@@ -1,21 +1,159 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Flying Robots
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
13
+ owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with that entity.
17
+ For the purposes of this definition, "control" means (i) the power, direct or
18
+ indirect, to cause the direction or management of such entity, whether by
19
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications, including
26
+ but not limited to software source code, documentation source, and configuration
27
+ files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object code,
31
+ generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
34
+ available under the License, as indicated by a copyright notice that is included
35
+ in or attached to the work (an example is provided in the Appendix below).
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on (or derived from) the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship. For the purposes of this License, Derivative Works
41
+ shall not include works that remain separable from, or merely link (or bind by
42
+ name) to the interfaces of, the Work and Derivative Works thereof.
43
+
44
+ "Contribution" shall mean any work of authorship, including the original version
45
+ of the Work and any modifications or additions to that Work or Derivative Works
46
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
47
+ by the copyright owner or by an individual or Legal Entity authorized to submit
48
+ on behalf of the copyright owner. For the purposes of this definition,
49
+ "submitted" means any form of electronic, verbal, or written communication sent
50
+ to the Licensor or its representatives, including but not limited to
51
+ communication on electronic mailing lists, source code control systems, and
52
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
53
+ the purpose of discussing and improving the Work, but excluding communication
54
+ that is conspicuously marked or otherwise designated in writing by the copyright
55
+ owner as "Not a Contribution."
56
+
57
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58
+ of whom a Contribution has been received by Licensor and subsequently
59
+ incorporated within the Work.
60
+
61
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
62
+ License, each Contributor hereby grants to You a perpetual, worldwide,
63
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
64
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
65
+ sublicense, and distribute the Work and such Derivative Works in Source or
66
+ Object form.
67
+
68
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
69
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
70
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
71
+ license to make, have made, use, offer to sell, sell, import, and otherwise
72
+ transfer the Work, where such license applies only to those patent claims
73
+ licensable by such Contributor that are necessarily infringed by their
74
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
75
+ to which such Contribution(s) was submitted. If You institute patent litigation
76
+ against any entity (including a cross-claim or counterclaim in a lawsuit)
77
+ alleging that the Work or a Contribution incorporated within the Work
78
+ constitutes direct or contributory patent infringement, then any patent licenses
79
+ granted to You under this License for that Work shall terminate as of the date
80
+ such litigation is filed.
81
+
82
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
83
+ Derivative Works thereof in any medium, with or without modifications, and in
84
+ Source or Object form, provided that You meet the following conditions:
85
+
86
+ (a) You must give any other recipients of the Work or Derivative Works a copy of
87
+ this License; and
88
+
89
+ (b) You must cause any modified files to carry prominent notices stating that You
90
+ changed the files; and
91
+
92
+ (c) You must retain, in the Source form of any Derivative Works that You
93
+ distribute, all copyright, patent, trademark, and attribution notices from the
94
+ Source form of the Work, excluding those notices that do not pertain to any part
95
+ of the Derivative Works; and
96
+
97
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
98
+ any Derivative Works that You distribute must include a readable copy of the
99
+ attribution notices contained within such NOTICE file, excluding those notices
100
+ that do not pertain to any part of the Derivative Works, in at least one of the
101
+ following places: within a NOTICE text file distributed as part of the
102
+ Derivative Works; within the Source form or documentation, if provided along
103
+ with the Derivative Works; or, within a display generated by the Derivative
104
+ Works, if and wherever such third-party notices normally appear. The contents of
105
+ the NOTICE file are for informational purposes only and do not modify the
106
+ License. You may add Your own attribution notices within Derivative Works that
107
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
108
+ provided that such additional attribution notices cannot be construed as
109
+ modifying the License.
110
+
111
+ You may add Your own copyright statement to Your modifications and may provide
112
+ additional or different license terms and conditions for use, reproduction, or
113
+ distribution of Your modifications, or for any such Derivative Works as a whole,
114
+ provided Your use, reproduction, and distribution of the Work otherwise complies
115
+ with the conditions stated in this License.
116
+
117
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
118
+ Contribution intentionally submitted for inclusion in the Work by You to the
119
+ Licensor shall be under the terms and conditions of this License, without any
120
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
121
+ supersede or modify the terms of any separate license agreement you may have
122
+ executed with Licensor regarding such Contributions.
123
+
124
+ 6. Trademarks. This License does not grant permission to use the trade names,
125
+ trademarks, service marks, or product names of the Licensor, except as required
126
+ for reasonable and customary use in describing the origin of the Work and
127
+ reproducing the content of the NOTICE file.
128
+
129
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
130
+ writing, Licensor provides the Work (and each Contributor provides its
131
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
132
+ KIND, either express or implied, including, without limitation, any warranties
133
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
134
+ PARTICULAR PURPOSE. You are solely responsible for determining the
135
+ appropriateness of using or redistributing the Work and assume any risks
136
+ associated with Your exercise of permissions under this License.
137
+
138
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
139
+ tort (including negligence), contract, or otherwise, unless required by
140
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
141
+ writing, shall any Contributor be liable to You for damages, including any
142
+ direct, indirect, special, incidental, or consequential damages of any
143
+ character arising as a result of this License or out of the use or inability to
144
+ use the Work (including but not limited to damages for loss of goodwill, work
145
+ stoppage, computer failure or malfunction, or any and all other commercial
146
+ damages or losses), even if such Contributor has been advised of the
147
+ possibility of such damages.
148
+
149
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
150
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
151
+ acceptance of support, warranty, indemnity, or other liability obligations
152
+ and/or rights consistent with this License. However, in accepting such
153
+ obligations, You may act only on Your own behalf and on Your sole
154
+ responsibility, not on behalf of any other Contributor, and only if You agree to
155
+ indemnify, defend, and hold each Contributor harmless for any liability incurred
156
+ by, or claims asserted against, such Contributor by reason of your accepting any
157
+ such warranty or additional liability.
158
+
159
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -68,7 +68,7 @@ initDefaultContext();
68
68
  If you need to replace the default context later in-process, call `setDefaultContext(createNodeContext())` from `@flyingrobots/bijou`.
69
69
 
70
70
  See [ARCHITECTURE.md](./ARCHITECTURE.md) for how the adapter maps to Node.js APIs, and [GUIDE.md](./GUIDE.md) for usage patterns.
71
- For upgrading existing apps, see [`../../docs/MIGRATING_TO_V3.md`](../../docs/MIGRATING_TO_V3.md).
71
+ For upgrading existing apps, see [`../../docs/MIGRATING_TO_V4.md`](../../docs/MIGRATING_TO_V4.md).
72
72
 
73
73
  ## Related Packages
74
74
 
@@ -77,7 +77,7 @@ For upgrading existing apps, see [`../../docs/MIGRATING_TO_V3.md`](../../docs/MI
77
77
 
78
78
  ## License
79
79
 
80
- MIT
80
+ Apache-2.0
81
81
 
82
82
  ---
83
83
 
package/dist/io.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import type { IOPort } from '@flyingrobots/bijou';
1
+ import { type ClockPort, type IOPort } from '@flyingrobots/bijou';
2
+ /** Optional overrides for {@link nodeIO}. */
3
+ export interface NodeIOOptions {
4
+ /** Clock override for deterministic timer scheduling in tests. */
5
+ clock?: ClockPort;
6
+ }
2
7
  /**
3
8
  * Create an {@link IOPort} backed by Node.js I/O primitives.
4
9
  *
@@ -7,7 +12,8 @@ import type { IOPort } from '@flyingrobots/bijou';
7
12
  * `rawInput`, `onResize`, and `setInterval` clean up their underlying
8
13
  * resources when `dispose()` is called.
9
14
  *
15
+ * @param options - Optional runtime overrides such as a deterministic clock for tests.
10
16
  * @returns An {@link IOPort} bound to the current Node.js process.
11
17
  */
12
- export declare function nodeIO(): IOPort;
18
+ export declare function nodeIO(options?: NodeIOOptions): IOPort;
13
19
  //# sourceMappingURL=io.d.ts.map
package/dist/io.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;;;GASG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAuJ/B"}
1
+ {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,SAAS,EAAE,KAAK,MAAM,EAAyC,MAAM,qBAAqB,CAAC;AAEvH,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAkJ1D"}
package/dist/io.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as readline from 'readline';
2
2
  import { readFileSync, readdirSync } from 'fs';
3
3
  import { join } from 'path';
4
+ import { resolveClock } from '@flyingrobots/bijou';
4
5
  /**
5
6
  * Create an {@link IOPort} backed by Node.js I/O primitives.
6
7
  *
@@ -9,9 +10,11 @@ import { join } from 'path';
9
10
  * `rawInput`, `onResize`, and `setInterval` clean up their underlying
10
11
  * resources when `dispose()` is called.
11
12
  *
13
+ * @param options - Optional runtime overrides such as a deterministic clock for tests.
12
14
  * @returns An {@link IOPort} bound to the current Node.js process.
13
15
  */
14
- export function nodeIO() {
16
+ export function nodeIO(options = {}) {
17
+ const clock = resolveClock(options.clock);
15
18
  return {
16
19
  /**
17
20
  * Write a string directly to `process.stdout`.
@@ -109,13 +112,7 @@ export function nodeIO() {
109
112
  * @returns A {@link TimerHandle} that cancels the timer on disposal.
110
113
  */
111
114
  setInterval(callback, ms) {
112
- const id = globalThis.setInterval(callback, ms);
113
- return {
114
- /** Cancel the repeating timer. */
115
- dispose() {
116
- clearInterval(id);
117
- },
118
- };
115
+ return clock.setInterval(callback, ms);
119
116
  },
120
117
  /**
121
118
  * Read an entire file synchronously as a UTF-8 string.
package/dist/io.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO;QACL;;;;WAIG;QACH,KAAK,CAAC,IAAY;YAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAED;;;;WAIG;QACH,UAAU,CAAC,IAAY;YACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAED;;;;;;;;;;;WAWG;QACH,QAAQ,CAAC,MAAc;YACrB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;YACH,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;gBACrC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;oBAC7B,EAAE,CAAC,KAAK,EAAE,CAAC;oBACX,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAED;;;;;;;;;WASG;QACH,QAAQ,CAAC,KAA4B;YACnC,OAAO,CAAC,KAAK,CAAC,UAA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AC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrC,OAAO;gBACL,wDAAwD;gBACxD,OAAO;oBACL,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACnD,CAAC;aACF,CAAC;QACJ,CAAC;QAED;;;;;;WAMG;QACH,WAAW,CAAC,QAAoB,EAAE,EAAU;YAC1C,OAAO,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACzC,CAAC;QAED;;;;;;WAMG;QACH,QAAQ,CAAC,IAAY;YACnB,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpC,CAAC;QAED;;;;;;;;;;;WAWG;QACH,OAAO,CAAC,OAAe;YACrB,OAAO,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACjE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CACpD,CAAC;QACJ,CAAC;QAED;;;;;WAKG;QACH,QAAQ,CAAC,GAAG,QAAkB;YAC5B,OAAO,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,5 +1,24 @@
1
- import type { BijouContext } from '@flyingrobots/bijou';
2
- import type { App } from '@flyingrobots/bijou-tui';
1
+ import { type BijouContext } from '@flyingrobots/bijou';
2
+ import type { App, RunOptions } from '@flyingrobots/bijou-tui';
3
+ interface WorkerInstance {
4
+ postMessage(message: unknown): void;
5
+ on(event: string, handler: (value: any) => void): void;
6
+ terminate(): Promise<number>;
7
+ }
8
+ interface WorkerParentPort {
9
+ on(event: string, listener: (msg: any) => void): void;
10
+ off(event: string, listener: (msg: any) => void): void;
11
+ postMessage(message: unknown): void;
12
+ }
13
+ interface WorkerThreadBindings {
14
+ isMainThread: boolean;
15
+ parentPort: WorkerParentPort | null;
16
+ workerData: unknown;
17
+ createWorker(entry: string, options: Record<string, unknown>): WorkerInstance;
18
+ createNodeContext(): BijouContext;
19
+ runApp<Model, M>(app: App<Model, M>, options: RunOptions<M>): Promise<void>;
20
+ scheduleTimeout(callback: () => void, ms: number): ReturnType<typeof setTimeout>;
21
+ }
3
22
  export type WorkerMessage = {
4
23
  type: 'io:data';
5
24
  data: string;
@@ -74,7 +93,7 @@ export interface WorkerHandle {
74
93
  * @param options - Configuration including the path to the worker entry file.
75
94
  * @returns A handle to the running worker.
76
95
  */
77
- export declare function runInWorker(options: RunWorkerOptions): WorkerHandle;
96
+ export declare function runInWorker(options: RunWorkerOptions, bindings?: WorkerThreadBindings): WorkerHandle;
78
97
  /**
79
98
  * The entry point for the worker thread. Must be called in the file
80
99
  * specified by `options.entry` in `runInWorker()`.
@@ -83,5 +102,6 @@ export declare function runInWorker(options: RunWorkerOptions): WorkerHandle;
83
102
  *
84
103
  * @param app - The TEA app to run.
85
104
  */
86
- export declare function startWorkerApp<Model, M>(app: App<Model, M>): Promise<void>;
105
+ export declare function startWorkerApp<Model, M>(app: App<Model, M>, bindings?: WorkerThreadBindings): Promise<void>;
106
+ export {};
87
107
  //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/worker/worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,GAAG,EAAc,MAAM,yBAAyB,CAAC;AAQ/D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpD;I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AAC;IACpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAsBD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,+CAA+C;IAC/C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,GAAE,oBAAoD,GAC7D,YAAY,CA0Gd;AAMD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,CAAC,EAC3C,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAClB,QAAQ,GAAE,oBAAoD,GAC7D,OAAO,CAAC,IAAI,CAAC,CA2Ef"}
@@ -1,7 +1,23 @@
1
1
  import { Worker, isMainThread, parentPort, workerData } from 'node:worker_threads';
2
2
  import { resolve as resolvePath } from 'node:path';
3
+ import { installRuntimeViewportOverlay, readRuntimeViewport, updateRuntimeViewport, } from '@flyingrobots/bijou';
3
4
  import { run } from '@flyingrobots/bijou-tui';
4
5
  import { createNodeContext } from '../index.js';
6
+ function defaultWorkerThreadBindings() {
7
+ return {
8
+ isMainThread,
9
+ parentPort,
10
+ workerData,
11
+ createWorker(entry, options) {
12
+ return new Worker(entry, options);
13
+ },
14
+ createNodeContext,
15
+ runApp: run,
16
+ scheduleTimeout(callback, ms) {
17
+ return setTimeout(callback, ms);
18
+ },
19
+ };
20
+ }
5
21
  // ---------------------------------------------------------------------------
6
22
  // Worker Environment API
7
23
  // ---------------------------------------------------------------------------
@@ -9,15 +25,17 @@ import { createNodeContext } from '../index.js';
9
25
  * Checks if the current environment is running inside a Bijou Worker.
10
26
  */
11
27
  export function isBijouWorker() {
12
- return !isMainThread && workerData?.isBijouWorker === true;
28
+ const bindings = defaultWorkerThreadBindings();
29
+ return !bindings.isMainThread && bindings.workerData?.isBijouWorker === true;
13
30
  }
14
31
  /**
15
32
  * Sends a custom data message from the worker to the main thread.
16
33
  * This will be received via the `onMessage` callback in `runInWorker`.
17
34
  */
18
35
  export function sendToMain(payload) {
19
- if (parentPort) {
20
- parentPort.postMessage({ type: 'data', payload });
36
+ const bindings = defaultWorkerThreadBindings();
37
+ if (bindings.parentPort) {
38
+ bindings.parentPort.postMessage({ type: 'data', payload });
21
39
  }
22
40
  }
23
41
  /**
@@ -28,12 +46,12 @@ export function sendToMain(payload) {
28
46
  * @param options - Configuration including the path to the worker entry file.
29
47
  * @returns A handle to the running worker.
30
48
  */
31
- export function runInWorker(options) {
32
- if (!isMainThread) {
49
+ export function runInWorker(options, bindings = defaultWorkerThreadBindings()) {
50
+ if (!bindings.isMainThread) {
33
51
  throw new Error('runInWorker must be called from the main thread.');
34
52
  }
35
- const ctx = options.ctx ?? createNodeContext();
36
- installRuntimeOverlay(ctx);
53
+ const ctx = options.ctx ?? bindings.createNodeContext();
54
+ installRuntimeViewportOverlay(ctx);
37
55
  const useAltScreen = options.altScreen ?? true;
38
56
  const useHideCursor = options.hideCursor ?? true;
39
57
  const useMouse = options.mouse ?? false;
@@ -53,14 +71,11 @@ export function runInWorker(options) {
53
71
  mouse: options.mouse,
54
72
  css: options.css,
55
73
  };
56
- const worker = new Worker(resolvePath(options.entry), {
74
+ const worker = bindings.createWorker(resolvePath(options.entry), {
57
75
  workerData: {
58
76
  isBijouWorker: true,
59
77
  options: serializableOptions,
60
- runtime: {
61
- columns: sanitizeDimension(ctx.runtime.columns),
62
- rows: sanitizeDimension(ctx.runtime.rows),
63
- },
78
+ runtime: readRuntimeViewport(ctx.runtime),
64
79
  },
65
80
  execArgv: options.execArgv,
66
81
  // Pipe stdout/stderr so we can capture logs if needed, but primarily use IPC
@@ -70,11 +85,8 @@ export function runInWorker(options) {
70
85
  worker.postMessage({ type: 'io:data', data });
71
86
  });
72
87
  const resizeHandle = ctx.io.onResize((columns, rows) => {
73
- const nextColumns = sanitizeDimension(columns);
74
- const nextRows = sanitizeDimension(rows);
75
- ctx.runtime.columns = nextColumns;
76
- ctx.runtime.rows = nextRows;
77
- worker.postMessage({ type: 'io:resize', columns: nextColumns, rows: nextRows });
88
+ const nextViewport = updateRuntimeViewport(ctx.runtime, columns, rows);
89
+ worker.postMessage({ type: 'io:resize', ...nextViewport });
78
90
  });
79
91
  const onExit = new Promise((resolve, reject) => {
80
92
  let requestedQuit = false;
@@ -96,7 +108,7 @@ export function runInWorker(options) {
96
108
  }
97
109
  else if (msg.type === 'quit') {
98
110
  requestedQuit = true;
99
- setTimeout(() => {
111
+ bindings.scheduleTimeout(() => {
100
112
  if (requestedQuit) {
101
113
  forcedTerminate = true;
102
114
  void worker.terminate();
@@ -149,24 +161,23 @@ export function runInWorker(options) {
149
161
  *
150
162
  * @param app - The TEA app to run.
151
163
  */
152
- export async function startWorkerApp(app) {
153
- if (isMainThread || !parentPort) {
164
+ export async function startWorkerApp(app, bindings = defaultWorkerThreadBindings()) {
165
+ if (bindings.isMainThread || !bindings.parentPort) {
154
166
  throw new Error('startWorkerApp must be called from within a worker thread.');
155
167
  }
156
- const initData = workerData;
168
+ const initData = bindings.workerData;
157
169
  // Create a proxy Context that speaks IPC instead of true I/O
158
- const proxyCtx = createNodeContext();
159
- installRuntimeOverlay(proxyCtx);
170
+ const proxyCtx = bindings.createNodeContext();
171
+ installRuntimeViewportOverlay(proxyCtx);
160
172
  const { setDefaultContext } = await import('@flyingrobots/bijou');
161
173
  setDefaultContext(proxyCtx);
162
- proxyCtx.runtime.columns = sanitizeDimension(initData.runtime?.columns ?? proxyCtx.runtime.columns);
163
- proxyCtx.runtime.rows = sanitizeDimension(initData.runtime?.rows ?? proxyCtx.runtime.rows);
174
+ updateRuntimeViewport(proxyCtx.runtime, initData.runtime?.columns ?? proxyCtx.runtime.columns, initData.runtime?.rows ?? proxyCtx.runtime.rows);
164
175
  // Hijack the WritePort to send frames back to main thread
165
176
  proxyCtx.io.write = (data) => {
166
- parentPort.postMessage({ type: 'render:frame', output: data });
177
+ bindings.parentPort.postMessage({ type: 'render:frame', output: data });
167
178
  };
168
179
  proxyCtx.io.writeError = (data) => {
169
- parentPort.postMessage({ type: 'error', message: data });
180
+ bindings.parentPort.postMessage({ type: 'error', message: data });
170
181
  };
171
182
  // We need to bypass the standard run() setup since the main thread
172
183
  // already handled alt screen and mouse modes. We tell run() to do nothing.
@@ -183,22 +194,21 @@ export async function startWorkerApp(app) {
183
194
  if (msg.type === 'io:data')
184
195
  handler(msg.data);
185
196
  };
186
- parentPort.on('message', listener);
197
+ bindings.parentPort.on('message', listener);
187
198
  return {
188
- dispose: () => parentPort.off('message', listener)
199
+ dispose: () => bindings.parentPort.off('message', listener)
189
200
  };
190
201
  };
191
202
  proxyCtx.io.onResize = (handler) => {
192
203
  const listener = (msg) => {
193
204
  if (msg.type === 'io:resize') {
194
- proxyCtx.runtime.columns = sanitizeDimension(msg.columns);
195
- proxyCtx.runtime.rows = sanitizeDimension(msg.rows);
196
- handler(proxyCtx.runtime.columns, proxyCtx.runtime.rows);
205
+ const nextViewport = updateRuntimeViewport(proxyCtx.runtime, msg.columns, msg.rows);
206
+ handler(nextViewport.columns, nextViewport.rows);
197
207
  }
198
208
  };
199
- parentPort.on('message', listener);
209
+ bindings.parentPort.on('message', listener);
200
210
  return {
201
- dispose: () => parentPort.off('message', listener)
211
+ dispose: () => bindings.parentPort.off('message', listener)
202
212
  };
203
213
  };
204
214
  proxyCtx.io.onData = (handler) => {
@@ -206,54 +216,14 @@ export async function startWorkerApp(app) {
206
216
  if (msg.type === 'data')
207
217
  handler(msg.payload);
208
218
  };
209
- parentPort.on('message', listener);
219
+ bindings.parentPort.on('message', listener);
210
220
  return {
211
- dispose: () => parentPort.off('message', listener)
221
+ dispose: () => bindings.parentPort.off('message', listener)
212
222
  };
213
223
  };
214
224
  // Run the app using the proxy context
215
- await run(app, proxyOptions);
225
+ await bindings.runApp(app, proxyOptions);
216
226
  // Signal main thread to shut down
217
- parentPort.postMessage({ type: 'quit' });
218
- }
219
- function sanitizeDimension(value) {
220
- if (!Number.isFinite(value))
221
- return 0;
222
- return Math.max(0, Math.floor(value));
223
- }
224
- function installRuntimeOverlay(ctx) {
225
- const baseRuntime = ctx.runtime;
226
- const state = {
227
- columns: sanitizeDimension(baseRuntime.columns),
228
- rows: sanitizeDimension(baseRuntime.rows),
229
- };
230
- const runtime = {
231
- env(key) {
232
- return baseRuntime.env(key);
233
- },
234
- get stdoutIsTTY() {
235
- return baseRuntime.stdoutIsTTY;
236
- },
237
- get stdinIsTTY() {
238
- return baseRuntime.stdinIsTTY;
239
- },
240
- get columns() {
241
- return state.columns;
242
- },
243
- set columns(value) {
244
- state.columns = sanitizeDimension(value);
245
- },
246
- get rows() {
247
- return state.rows;
248
- },
249
- set rows(value) {
250
- state.rows = sanitizeDimension(value);
251
- },
252
- get refreshRate() {
253
- return baseRuntime.refreshRate;
254
- },
255
- };
256
- ctx.runtime = runtime;
257
- return runtime;
227
+ bindings.parentPort.postMessage({ type: 'quit' });
258
228
  }
259
229
  //# sourceMappingURL=worker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EAAE,GAAG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AAE,QAAQ,CAAC,CAAC;QAC7C,OAAO;YACL,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAW,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;SAC7D,CAAC;IACJ,CAAC,CAAC;IAEF,sCAAsC;IACtC,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAEzC,kCAAkC;IAClC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAwB,CAAC,CAAC;AAC1E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flyingrobots/bijou-node",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Node.js adapter for bijou — chalk styling, readline I/O, process runtime.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,13 +24,13 @@
24
24
  "lint": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@flyingrobots/bijou-tui": "3.0.0",
27
+ "@flyingrobots/bijou-tui": "4.0.0",
28
28
  "chalk": "^5.6.2",
29
29
  "gifenc": "^1.0.3",
30
30
  "oled-font-5x7": "^1.0.3"
31
31
  },
32
32
  "peerDependencies": {
33
- "@flyingrobots/bijou": "3.0.0"
33
+ "@flyingrobots/bijou": "4.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^22.0.0",
@@ -45,7 +45,7 @@
45
45
  "chalk"
46
46
  ],
47
47
  "author": "James Ross <james@flyingrobots.dev>",
48
- "license": "MIT",
48
+ "license": "Apache-2.0",
49
49
  "repository": {
50
50
  "type": "git",
51
51
  "url": "git+https://github.com/flyingrobots/bijou.git",