@ttsc/unplugin 0.31.0 → 0.31.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/lib/core/bun/bun.d.cts +3 -2
- package/lib/core/bun/bun.d.mts +3 -2
- package/lib/core/bun/bun.d.ts +3 -2
- package/lib/core/bun/bun.js +8 -4
- package/lib/core/bun/bun.js.map +1 -1
- package/lib/core/bun/bun.mjs +8 -4
- package/lib/core/bun/bun.mjs.map +1 -1
- package/lib/core/observer/createInputObserver.js +6 -5
- package/lib/core/observer/createInputObserver.js.map +1 -1
- package/lib/core/observer/createInputObserver.mjs +6 -5
- package/lib/core/observer/createInputObserver.mjs.map +1 -1
- package/lib/core/observer/openIsolatedRecursiveWatch.d.cts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.d.mts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.d.ts +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.js +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.js.map +1 -1
- package/lib/core/observer/openIsolatedRecursiveWatch.mjs +11 -12
- package/lib/core/observer/openIsolatedRecursiveWatch.mjs.map +1 -1
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +12 -3
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +12 -3
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +12 -3
- package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +2 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.js +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
- package/lib/core/transform/deliverCachedTransform.d.cts +36 -0
- package/lib/core/transform/deliverCachedTransform.d.mts +36 -0
- package/lib/core/transform/deliverCachedTransform.d.ts +36 -0
- package/lib/core/transform/deliverCachedTransform.js +73 -0
- package/lib/core/transform/deliverCachedTransform.js.map +1 -0
- package/lib/core/transform/deliverCachedTransform.mjs +71 -0
- package/lib/core/transform/deliverCachedTransform.mjs.map +1 -0
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.cts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.mts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.d.ts +2 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js +6 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.js.map +1 -1
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs +6 -2
- package/lib/core/transform/envelope/selectDeclaredProjectInputKeys.mjs.map +1 -1
- package/lib/core/transform/envelope/selectExternalInputPaths.d.cts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.d.mts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.d.ts +3 -5
- package/lib/core/transform/envelope/selectExternalInputPaths.js +8 -7
- package/lib/core/transform/envelope/selectExternalInputPaths.js.map +1 -1
- package/lib/core/transform/envelope/selectExternalInputPaths.mjs +8 -7
- package/lib/core/transform/envelope/selectExternalInputPaths.mjs.map +1 -1
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.cts +15 -12
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.mts +15 -12
- package/lib/core/transform/filesystem/TtscTransformFilesystemOperations.d.ts +15 -12
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.cts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.mts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.d.ts +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.js +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.js.map +1 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs +3 -1
- package/lib/core/transform/generation/selectTransformAttemptDisposition.mjs.map +1 -1
- package/lib/core/transform/generation/transformProject.d.cts +9 -7
- package/lib/core/transform/generation/transformProject.d.mts +9 -7
- package/lib/core/transform/generation/transformProject.d.ts +9 -7
- package/lib/core/transform/generation/transformProject.js +14 -9
- package/lib/core/transform/generation/transformProject.js.map +1 -1
- package/lib/core/transform/generation/transformProject.mjs +14 -9
- package/lib/core/transform/generation/transformProject.mjs.map +1 -1
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.cts +11 -4
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.mts +11 -4
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.d.ts +11 -4
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.js +44 -7
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.js.map +1 -1
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs +44 -7
- package/lib/core/transform/inputs/preparePluginBuildEnvironments.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/WatchBroker.d.cts +14 -4
- package/lib/core/transform/tracker/broker/WatchBroker.d.mts +14 -4
- package/lib/core/transform/tracker/broker/WatchBroker.d.ts +14 -4
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.cts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.mts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.d.ts +63 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.js +89 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.js.map +1 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs +89 -0
- package/lib/core/transform/tracker/broker/WatchBrokerTransport.mjs.map +1 -0
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.cts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.mts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.d.ts +8 -8
- package/lib/core/transform/tracker/broker/drainWatchBroker.js +12 -13
- package/lib/core/transform/tracker/broker/drainWatchBroker.js.map +1 -1
- package/lib/core/transform/tracker/broker/drainWatchBroker.mjs +12 -13
- package/lib/core/transform/tracker/broker/drainWatchBroker.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/getWatchBroker.d.cts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.d.mts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.d.ts +18 -15
- package/lib/core/transform/tracker/broker/getWatchBroker.js +87 -17
- package/lib/core/transform/tracker/broker/getWatchBroker.js.map +1 -1
- package/lib/core/transform/tracker/broker/getWatchBroker.mjs +87 -17
- package/lib/core/transform/tracker/broker/getWatchBroker.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.cts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.mts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.d.ts +5 -5
- package/lib/core/transform/tracker/broker/openBrokeredWatch.js +11 -14
- package/lib/core/transform/tracker/broker/openBrokeredWatch.js.map +1 -1
- package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs +11 -14
- package/lib/core/transform/tracker/broker/openBrokeredWatch.mjs.map +1 -1
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.cts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.mts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.d.ts +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.js +7 -7
- package/lib/core/transform/tracker/broker/usesWatchBroker.mjs +7 -7
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.cts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.mts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.d.ts +9 -10
- package/lib/core/transform/tracker/broker/watchBrokerSource.js +10 -11
- package/lib/core/transform/tracker/broker/watchBrokerSource.js.map +1 -1
- package/lib/core/transform/tracker/broker/watchBrokerSource.mjs +10 -11
- package/lib/core/transform/tracker/broker/watchBrokerSource.mjs.map +1 -1
- package/lib/core/transform/transformTtsc.d.cts +7 -4
- package/lib/core/transform/transformTtsc.d.mts +7 -4
- package/lib/core/transform/transformTtsc.d.ts +7 -4
- package/lib/core/transform/transformTtsc.js +37 -92
- package/lib/core/transform/transformTtsc.js.map +1 -1
- package/lib/core/transform/transformTtsc.mjs +37 -92
- package/lib/core/transform/transformTtsc.mjs.map +1 -1
- package/lib/core/transform/validation/TtscGenerationProof.d.cts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.d.mts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.d.ts +105 -0
- package/lib/core/transform/validation/TtscGenerationProof.js +149 -0
- package/lib/core/transform/validation/TtscGenerationProof.js.map +1 -0
- package/lib/core/transform/validation/TtscGenerationProof.mjs +149 -0
- package/lib/core/transform/validation/TtscGenerationProof.mjs.map +1 -0
- package/lib/core/transform/validation/matchesCachedSource.d.cts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.d.mts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.d.ts +18 -15
- package/lib/core/transform/validation/matchesCachedSource.js +28 -22
- package/lib/core/transform/validation/matchesCachedSource.js.map +1 -1
- package/lib/core/transform/validation/matchesCachedSource.mjs +28 -22
- package/lib/core/transform/validation/matchesCachedSource.mjs.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.cts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.mts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.ts +3 -2
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js +4 -4
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs +4 -4
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.cts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.mts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.ts +2 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js +2 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs +2 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.cts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.mts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.d.ts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.js +5 -3
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.js.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs +5 -3
- package/lib/core/transform/validation/matchesUniversalHostInputTrees.mjs.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.cts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.mts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.d.ts +3 -2
- package/lib/core/transform/validation/matchesUniversalHostInputs.js +5 -5
- package/lib/core/transform/validation/matchesUniversalHostInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesUniversalHostInputs.mjs +5 -5
- package/lib/core/transform/validation/matchesUniversalHostInputs.mjs.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.cts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.mts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.ts +5 -4
- package/lib/core/transform/validation/nativeInputPredicatesHold.js +31 -12
- package/lib/core/transform/validation/nativeInputPredicatesHold.js.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs +31 -12
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs.map +1 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.cts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.mts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.d.ts +2 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.js +2 -2
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.js.map +1 -1
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs +2 -2
- package/lib/core/transform/validation/notificationsProveProgramUnchanged.mjs.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.js +3 -0
- package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.mjs +3 -0
- package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
- package/lib/core/turbopack/turbopack.js +2 -1
- package/lib/core/turbopack/turbopack.js.map +1 -1
- package/lib/core/turbopack/turbopack.mjs +2 -1
- package/lib/core/turbopack/turbopack.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/bun/bun.ts +8 -4
- package/src/core/observer/createInputObserver.ts +6 -5
- package/src/core/observer/openIsolatedRecursiveWatch.ts +11 -12
- package/src/core/transform/cache/TtscCachedProjectTransform.ts +13 -3
- package/src/core/transform/cache/selectCachedGenerationAction.ts +9 -1
- package/src/core/transform/deliverCachedTransform.ts +97 -0
- package/src/core/transform/envelope/selectDeclaredProjectInputKeys.ts +5 -2
- package/src/core/transform/envelope/selectExternalInputPaths.ts +7 -7
- package/src/core/transform/filesystem/TtscTransformFilesystemOperations.ts +15 -12
- package/src/core/transform/generation/selectTransformAttemptDisposition.ts +3 -1
- package/src/core/transform/generation/transformProject.ts +13 -9
- package/src/core/transform/inputs/preparePluginBuildEnvironments.ts +41 -7
- package/src/core/transform/tracker/broker/WatchBroker.ts +15 -4
- package/src/core/transform/tracker/broker/WatchBrokerTransport.ts +82 -0
- package/src/core/transform/tracker/broker/drainWatchBroker.ts +12 -13
- package/src/core/transform/tracker/broker/getWatchBroker.ts +89 -18
- package/src/core/transform/tracker/broker/openBrokeredWatch.ts +11 -14
- package/src/core/transform/tracker/broker/usesWatchBroker.ts +7 -7
- package/src/core/transform/tracker/broker/watchBrokerSource.ts +10 -11
- package/src/core/transform/transformTtsc.ts +36 -92
- package/src/core/transform/validation/TtscGenerationProof.ts +201 -0
- package/src/core/transform/validation/matchesCachedSource.ts +27 -21
- package/src/core/transform/validation/matchesCompleteInputSnapshot.ts +5 -3
- package/src/core/transform/validation/matchesNarrowPersistentInputs.ts +3 -1
- package/src/core/transform/validation/matchesUniversalHostInputTrees.ts +6 -2
- package/src/core/transform/validation/matchesUniversalHostInputs.ts +6 -4
- package/src/core/transform/validation/nativeInputPredicatesHold.ts +36 -14
- package/src/core/transform/validation/notificationsProveProgramUnchanged.ts +3 -1
- package/src/core/transform/watch/notifyWatchInputs.ts +3 -0
- package/src/core/turbopack/turbopack.ts +2 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { WatchBroker } from "./WatchBroker.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Common lifecycle seam for the native Windows stdio broker and macOS IPC.
|
|
4
|
+
*
|
|
5
|
+
* The transport owns framing and demand references only. Ordered native
|
|
6
|
+
* notifications and per-registration readiness remain backend responsibilities;
|
|
7
|
+
* a successful send cannot certify coverage or cache reuse.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation One transport seam preserves explicit failure and reference ownership for both supported broker backends.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design Callers express send, demand and retirement through this namespace instead of duplicating platform checks or modifying a ChildProcess.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported child streams and IPC APIs are used without replacing runtime methods.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose separates transport completion from native watch authority.
|
|
13
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native selection stays at broker startup; all tracker and observer consumers share these operations.
|
|
14
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Member operations own their delegated cost.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The broker owner selects transport and sharing lifetime.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This namespace itself retains no transport registry.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace WatchBrokerTransport {
|
|
19
|
+
/**
|
|
20
|
+
* Queue a message on the selected transport. False refuses delivery; true
|
|
21
|
+
* only means queued, with actual acknowledgment or failure still
|
|
22
|
+
* outstanding.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Native and IPC transports preserve separate queue acceptance and observed backend replies.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One selection delegates framing to the startup-owned transport.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No queue result is upgraded into readiness or a native drain.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the limited meaning of the returned boolean.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Explicit stdio capability takes precedence over optional IPC.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Transport selection is fixed work; JSON framing, message bytes and pipe backpressure belong to the selected sender.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Sending an effect does not own computation reuse.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selected sender and request owner retain queued bytes and outstanding acknowledgment state.
|
|
32
|
+
*/
|
|
33
|
+
function send(broker: WatchBroker, message: unknown): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Keep the selected reply channel live exactly while caller demand exists.
|
|
36
|
+
* Counts belong to registration/drain owners; native references are flags.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation Outstanding requests retain both process and reply channel, preventing host exit before acknowledgment.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation applies the caller's aggregated demand to either transport.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Optional Bun IPC methods are used as capabilities without installing replacements.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies count ownership and flag semantics.
|
|
42
|
+
* @evidence contracts/portability.md#os-neutral-implementation Optional IPC methods and a selected native pipe capability express runtime differences.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Reference toggling selects no data-processing algorithm.
|
|
44
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effect owns no shared computation.
|
|
45
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller supplies aggregate demand; removing the last demand unreferences process and reply channel without asserting native termination.
|
|
46
|
+
*/
|
|
47
|
+
function reference(broker: WatchBroker, active: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* End this broker's request stream. The last-registration owner separately
|
|
50
|
+
* attempts process termination; closing a channel is not proof of child
|
|
51
|
+
* exit.
|
|
52
|
+
*
|
|
53
|
+
* @evidence contracts/common.md#principled-implementation Channel retirement is distinct from process exit and native resource closure.
|
|
54
|
+
* @evidence contracts/common.md#clear-and-simple-design Startup-owned transport closes its request stream without platform checks in consumers.
|
|
55
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported end/disconnect operations preserve native ownership without synthetic exit acknowledgment.
|
|
56
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the independent termination attempt and limited closure meaning.
|
|
57
|
+
* @evidence contracts/portability.md#os-neutral-implementation Selected stream closure and optional IPC disconnection keep platform details behind the transport seam.
|
|
58
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Closing one channel selects no processing algorithm.
|
|
59
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Retirement owns no computation reuse.
|
|
60
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The selected transport ends its input; process kill and actual native cleanup remain the broker and backend's responsibilities.
|
|
61
|
+
*/
|
|
62
|
+
function close(broker: WatchBroker): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { WatchBroker } from "./WatchBroker.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Common lifecycle seam for the native Windows stdio broker and macOS IPC.
|
|
4
|
+
*
|
|
5
|
+
* The transport owns framing and demand references only. Ordered native
|
|
6
|
+
* notifications and per-registration readiness remain backend responsibilities;
|
|
7
|
+
* a successful send cannot certify coverage or cache reuse.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation One transport seam preserves explicit failure and reference ownership for both supported broker backends.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design Callers express send, demand and retirement through this namespace instead of duplicating platform checks or modifying a ChildProcess.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported child streams and IPC APIs are used without replacing runtime methods.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose separates transport completion from native watch authority.
|
|
13
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native selection stays at broker startup; all tracker and observer consumers share these operations.
|
|
14
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Member operations own their delegated cost.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The broker owner selects transport and sharing lifetime.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This namespace itself retains no transport registry.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace WatchBrokerTransport {
|
|
19
|
+
/**
|
|
20
|
+
* Queue a message on the selected transport. False refuses delivery; true
|
|
21
|
+
* only means queued, with actual acknowledgment or failure still
|
|
22
|
+
* outstanding.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Native and IPC transports preserve separate queue acceptance and observed backend replies.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One selection delegates framing to the startup-owned transport.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No queue result is upgraded into readiness or a native drain.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the limited meaning of the returned boolean.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Explicit stdio capability takes precedence over optional IPC.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Transport selection is fixed work; JSON framing, message bytes and pipe backpressure belong to the selected sender.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Sending an effect does not own computation reuse.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selected sender and request owner retain queued bytes and outstanding acknowledgment state.
|
|
32
|
+
*/
|
|
33
|
+
function send(broker: WatchBroker, message: unknown): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Keep the selected reply channel live exactly while caller demand exists.
|
|
36
|
+
* Counts belong to registration/drain owners; native references are flags.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation Outstanding requests retain both process and reply channel, preventing host exit before acknowledgment.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation applies the caller's aggregated demand to either transport.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Optional Bun IPC methods are used as capabilities without installing replacements.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies count ownership and flag semantics.
|
|
42
|
+
* @evidence contracts/portability.md#os-neutral-implementation Optional IPC methods and a selected native pipe capability express runtime differences.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Reference toggling selects no data-processing algorithm.
|
|
44
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effect owns no shared computation.
|
|
45
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller supplies aggregate demand; removing the last demand unreferences process and reply channel without asserting native termination.
|
|
46
|
+
*/
|
|
47
|
+
function reference(broker: WatchBroker, active: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* End this broker's request stream. The last-registration owner separately
|
|
50
|
+
* attempts process termination; closing a channel is not proof of child
|
|
51
|
+
* exit.
|
|
52
|
+
*
|
|
53
|
+
* @evidence contracts/common.md#principled-implementation Channel retirement is distinct from process exit and native resource closure.
|
|
54
|
+
* @evidence contracts/common.md#clear-and-simple-design Startup-owned transport closes its request stream without platform checks in consumers.
|
|
55
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported end/disconnect operations preserve native ownership without synthetic exit acknowledgment.
|
|
56
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the independent termination attempt and limited closure meaning.
|
|
57
|
+
* @evidence contracts/portability.md#os-neutral-implementation Selected stream closure and optional IPC disconnection keep platform details behind the transport seam.
|
|
58
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Closing one channel selects no processing algorithm.
|
|
59
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Retirement owns no computation reuse.
|
|
60
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The selected transport ends its input; process kill and actual native cleanup remain the broker and backend's responsibilities.
|
|
61
|
+
*/
|
|
62
|
+
function close(broker: WatchBroker): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { WatchBroker } from "./WatchBroker";
|
|
2
|
+
/**
|
|
3
|
+
* Common lifecycle seam for the native Windows stdio broker and macOS IPC.
|
|
4
|
+
*
|
|
5
|
+
* The transport owns framing and demand references only. Ordered native
|
|
6
|
+
* notifications and per-registration readiness remain backend responsibilities;
|
|
7
|
+
* a successful send cannot certify coverage or cache reuse.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation One transport seam preserves explicit failure and reference ownership for both supported broker backends.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design Callers express send, demand and retirement through this namespace instead of duplicating platform checks or modifying a ChildProcess.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported child streams and IPC APIs are used without replacing runtime methods.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose separates transport completion from native watch authority.
|
|
13
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native selection stays at broker startup; all tracker and observer consumers share these operations.
|
|
14
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Member operations own their delegated cost.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The broker owner selects transport and sharing lifetime.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This namespace itself retains no transport registry.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace WatchBrokerTransport {
|
|
19
|
+
/**
|
|
20
|
+
* Queue a message on the selected transport. False refuses delivery; true
|
|
21
|
+
* only means queued, with actual acknowledgment or failure still
|
|
22
|
+
* outstanding.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Native and IPC transports preserve separate queue acceptance and observed backend replies.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One selection delegates framing to the startup-owned transport.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No queue result is upgraded into readiness or a native drain.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the limited meaning of the returned boolean.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Explicit stdio capability takes precedence over optional IPC.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Transport selection is fixed work; JSON framing, message bytes and pipe backpressure belong to the selected sender.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Sending an effect does not own computation reuse.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selected sender and request owner retain queued bytes and outstanding acknowledgment state.
|
|
32
|
+
*/
|
|
33
|
+
function send(broker: WatchBroker, message: unknown): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Keep the selected reply channel live exactly while caller demand exists.
|
|
36
|
+
* Counts belong to registration/drain owners; native references are flags.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation Outstanding requests retain both process and reply channel, preventing host exit before acknowledgment.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation applies the caller's aggregated demand to either transport.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Optional Bun IPC methods are used as capabilities without installing replacements.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies count ownership and flag semantics.
|
|
42
|
+
* @evidence contracts/portability.md#os-neutral-implementation Optional IPC methods and a selected native pipe capability express runtime differences.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Reference toggling selects no data-processing algorithm.
|
|
44
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effect owns no shared computation.
|
|
45
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller supplies aggregate demand; removing the last demand unreferences process and reply channel without asserting native termination.
|
|
46
|
+
*/
|
|
47
|
+
function reference(broker: WatchBroker, active: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* End this broker's request stream. The last-registration owner separately
|
|
50
|
+
* attempts process termination; closing a channel is not proof of child
|
|
51
|
+
* exit.
|
|
52
|
+
*
|
|
53
|
+
* @evidence contracts/common.md#principled-implementation Channel retirement is distinct from process exit and native resource closure.
|
|
54
|
+
* @evidence contracts/common.md#clear-and-simple-design Startup-owned transport closes its request stream without platform checks in consumers.
|
|
55
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported end/disconnect operations preserve native ownership without synthetic exit acknowledgment.
|
|
56
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the independent termination attempt and limited closure meaning.
|
|
57
|
+
* @evidence contracts/portability.md#os-neutral-implementation Selected stream closure and optional IPC disconnection keep platform details behind the transport seam.
|
|
58
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Closing one channel selects no processing algorithm.
|
|
59
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Retirement owns no computation reuse.
|
|
60
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The selected transport ends its input; process kill and actual native cleanup remain the broker and backend's responsibilities.
|
|
61
|
+
*/
|
|
62
|
+
function close(broker: WatchBroker): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Common lifecycle seam for the native Windows stdio broker and macOS IPC.
|
|
5
|
+
*
|
|
6
|
+
* The transport owns framing and demand references only. Ordered native
|
|
7
|
+
* notifications and per-registration readiness remain backend responsibilities;
|
|
8
|
+
* a successful send cannot certify coverage or cache reuse.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation One transport seam preserves explicit failure and reference ownership for both supported broker backends.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design Callers express send, demand and retirement through this namespace instead of duplicating platform checks or modifying a ChildProcess.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported child streams and IPC APIs are used without replacing runtime methods.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose separates transport completion from native watch authority.
|
|
14
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native selection stays at broker startup; all tracker and observer consumers share these operations.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Member operations own their delegated cost.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The broker owner selects transport and sharing lifetime.
|
|
17
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This namespace itself retains no transport registry.
|
|
18
|
+
*/
|
|
19
|
+
exports.WatchBrokerTransport = void 0;
|
|
20
|
+
(function (WatchBrokerTransport) {
|
|
21
|
+
/**
|
|
22
|
+
* Queue a message on the selected transport. False refuses delivery; true
|
|
23
|
+
* only means queued, with actual acknowledgment or failure still
|
|
24
|
+
* outstanding.
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation Native and IPC transports preserve separate queue acceptance and observed backend replies.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design One selection delegates framing to the startup-owned transport.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No queue result is upgraded into readiness or a native drain.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the limited meaning of the returned boolean.
|
|
30
|
+
* @evidence contracts/portability.md#os-neutral-implementation Explicit stdio capability takes precedence over optional IPC.
|
|
31
|
+
* @evidence contracts/performance.md#efficient-algorithms Transport selection is fixed work; JSON framing, message bytes and pipe backpressure belong to the selected sender.
|
|
32
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Sending an effect does not own computation reuse.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selected sender and request owner retain queued bytes and outstanding acknowledgment state.
|
|
34
|
+
*/
|
|
35
|
+
function send(broker, message) {
|
|
36
|
+
return broker.transport === undefined
|
|
37
|
+
? broker.child.send?.(message) === true
|
|
38
|
+
: broker.transport.send(message);
|
|
39
|
+
}
|
|
40
|
+
WatchBrokerTransport.send = send;
|
|
41
|
+
/**
|
|
42
|
+
* Keep the selected reply channel live exactly while caller demand exists.
|
|
43
|
+
* Counts belong to registration/drain owners; native references are flags.
|
|
44
|
+
*
|
|
45
|
+
* @evidence contracts/common.md#principled-implementation Outstanding requests retain both process and reply channel, preventing host exit before acknowledgment.
|
|
46
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation applies the caller's aggregated demand to either transport.
|
|
47
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Optional Bun IPC methods are used as capabilities without installing replacements.
|
|
48
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies count ownership and flag semantics.
|
|
49
|
+
* @evidence contracts/portability.md#os-neutral-implementation Optional IPC methods and a selected native pipe capability express runtime differences.
|
|
50
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Reference toggling selects no data-processing algorithm.
|
|
51
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effect owns no shared computation.
|
|
52
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller supplies aggregate demand; removing the last demand unreferences process and reply channel without asserting native termination.
|
|
53
|
+
*/
|
|
54
|
+
function reference(broker, active) {
|
|
55
|
+
if (broker.transport !== undefined)
|
|
56
|
+
broker.transport.reference(active);
|
|
57
|
+
else if (active) {
|
|
58
|
+
broker.child.ref();
|
|
59
|
+
broker.child.channel?.ref?.();
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
broker.child.unref();
|
|
63
|
+
broker.child.channel?.unref?.();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
WatchBrokerTransport.reference = reference;
|
|
67
|
+
/**
|
|
68
|
+
* End this broker's request stream. The last-registration owner separately
|
|
69
|
+
* attempts process termination; closing a channel is not proof of child
|
|
70
|
+
* exit.
|
|
71
|
+
*
|
|
72
|
+
* @evidence contracts/common.md#principled-implementation Channel retirement is distinct from process exit and native resource closure.
|
|
73
|
+
* @evidence contracts/common.md#clear-and-simple-design Startup-owned transport closes its request stream without platform checks in consumers.
|
|
74
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported end/disconnect operations preserve native ownership without synthetic exit acknowledgment.
|
|
75
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the independent termination attempt and limited closure meaning.
|
|
76
|
+
* @evidence contracts/portability.md#os-neutral-implementation Selected stream closure and optional IPC disconnection keep platform details behind the transport seam.
|
|
77
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Closing one channel selects no processing algorithm.
|
|
78
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Retirement owns no computation reuse.
|
|
79
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The selected transport ends its input; process kill and actual native cleanup remain the broker and backend's responsibilities.
|
|
80
|
+
*/
|
|
81
|
+
function close(broker) {
|
|
82
|
+
if (broker.transport !== undefined)
|
|
83
|
+
broker.transport.close();
|
|
84
|
+
else
|
|
85
|
+
broker.child.disconnect?.();
|
|
86
|
+
}
|
|
87
|
+
WatchBrokerTransport.close = close;
|
|
88
|
+
})(exports.WatchBrokerTransport || (exports.WatchBrokerTransport = {}));
|
|
89
|
+
//# sourceMappingURL=WatchBrokerTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WatchBrokerTransport.js","sources":["../../../../../src/core/transform/tracker/broker/WatchBrokerTransport.ts"],"sourcesContent":[null],"names":["WatchBrokerTransport"],"mappings":";;AAEA;;;;;;;;;;;;;;;AAeG;AACcA;AAAjB,CAAA,UAAiB,oBAAoB,EAAA;AACnC;;;;;;;;;;;;;AAaG;AACH,IAAA,SAAgB,IAAI,CAAC,MAAmB,EAAE,OAAgB,EAAA;AACxD,QAAA,OAAO,MAAM,CAAC,SAAS,KAAK;cACxB,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,OAAiB,CAAC,KAAK;cAC3C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;IACpC;AAJgB,IAAA,oBAAA,CAAA,IAAI,OAInB;AAED;;;;;;;;;;;;AAYG;AACH,IAAA,SAAgB,SAAS,CAAC,MAAmB,EAAE,MAAe,EAAA;AAC5D,QAAA,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;AAAE,YAAA,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;aACjE,IAAI,MAAM,EAAE;AACf,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI;QAC/B;aAAO;AACL,YAAA,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE;YACpB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,IAAI;QACjC;IACF;AATgB,IAAA,oBAAA,CAAA,SAAS,YASxB;AAED;;;;;;;;;;;;;AAaG;IACH,SAAgB,KAAK,CAAC,MAAmB,EAAA;AACvC,QAAA,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;AAAE,YAAA,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;;AACvD,YAAA,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI;IAClC;AAHgB,IAAA,oBAAA,CAAA,KAAK,QAGpB;AACH,CAAC,EA/DgBA,4BAAoB,KAApBA,4BAAoB,GAAA,EAAA,CAAA,CAAA;;"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common lifecycle seam for the native Windows stdio broker and macOS IPC.
|
|
3
|
+
*
|
|
4
|
+
* The transport owns framing and demand references only. Ordered native
|
|
5
|
+
* notifications and per-registration readiness remain backend responsibilities;
|
|
6
|
+
* a successful send cannot certify coverage or cache reuse.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation One transport seam preserves explicit failure and reference ownership for both supported broker backends.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design Callers express send, demand and retirement through this namespace instead of duplicating platform checks or modifying a ChildProcess.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported child streams and IPC APIs are used without replacing runtime methods.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose separates transport completion from native watch authority.
|
|
12
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native selection stays at broker startup; all tracker and observer consumers share these operations.
|
|
13
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Member operations own their delegated cost.
|
|
14
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The broker owner selects transport and sharing lifetime.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources This namespace itself retains no transport registry.
|
|
16
|
+
*/
|
|
17
|
+
var WatchBrokerTransport;
|
|
18
|
+
(function (WatchBrokerTransport) {
|
|
19
|
+
/**
|
|
20
|
+
* Queue a message on the selected transport. False refuses delivery; true
|
|
21
|
+
* only means queued, with actual acknowledgment or failure still
|
|
22
|
+
* outstanding.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Native and IPC transports preserve separate queue acceptance and observed backend replies.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One selection delegates framing to the startup-owned transport.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No queue result is upgraded into readiness or a native drain.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the limited meaning of the returned boolean.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Explicit stdio capability takes precedence over optional IPC.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Transport selection is fixed work; JSON framing, message bytes and pipe backpressure belong to the selected sender.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Sending an effect does not own computation reuse.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selected sender and request owner retain queued bytes and outstanding acknowledgment state.
|
|
32
|
+
*/
|
|
33
|
+
function send(broker, message) {
|
|
34
|
+
return broker.transport === undefined
|
|
35
|
+
? broker.child.send?.(message) === true
|
|
36
|
+
: broker.transport.send(message);
|
|
37
|
+
}
|
|
38
|
+
WatchBrokerTransport.send = send;
|
|
39
|
+
/**
|
|
40
|
+
* Keep the selected reply channel live exactly while caller demand exists.
|
|
41
|
+
* Counts belong to registration/drain owners; native references are flags.
|
|
42
|
+
*
|
|
43
|
+
* @evidence contracts/common.md#principled-implementation Outstanding requests retain both process and reply channel, preventing host exit before acknowledgment.
|
|
44
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation applies the caller's aggregated demand to either transport.
|
|
45
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Optional Bun IPC methods are used as capabilities without installing replacements.
|
|
46
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies count ownership and flag semantics.
|
|
47
|
+
* @evidence contracts/portability.md#os-neutral-implementation Optional IPC methods and a selected native pipe capability express runtime differences.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Reference toggling selects no data-processing algorithm.
|
|
49
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effect owns no shared computation.
|
|
50
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The caller supplies aggregate demand; removing the last demand unreferences process and reply channel without asserting native termination.
|
|
51
|
+
*/
|
|
52
|
+
function reference(broker, active) {
|
|
53
|
+
if (broker.transport !== undefined)
|
|
54
|
+
broker.transport.reference(active);
|
|
55
|
+
else if (active) {
|
|
56
|
+
broker.child.ref();
|
|
57
|
+
broker.child.channel?.ref?.();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
broker.child.unref();
|
|
61
|
+
broker.child.channel?.unref?.();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
WatchBrokerTransport.reference = reference;
|
|
65
|
+
/**
|
|
66
|
+
* End this broker's request stream. The last-registration owner separately
|
|
67
|
+
* attempts process termination; closing a channel is not proof of child
|
|
68
|
+
* exit.
|
|
69
|
+
*
|
|
70
|
+
* @evidence contracts/common.md#principled-implementation Channel retirement is distinct from process exit and native resource closure.
|
|
71
|
+
* @evidence contracts/common.md#clear-and-simple-design Startup-owned transport closes its request stream without platform checks in consumers.
|
|
72
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Supported end/disconnect operations preserve native ownership without synthetic exit acknowledgment.
|
|
73
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the independent termination attempt and limited closure meaning.
|
|
74
|
+
* @evidence contracts/portability.md#os-neutral-implementation Selected stream closure and optional IPC disconnection keep platform details behind the transport seam.
|
|
75
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms Closing one channel selects no processing algorithm.
|
|
76
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Retirement owns no computation reuse.
|
|
77
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The selected transport ends its input; process kill and actual native cleanup remain the broker and backend's responsibilities.
|
|
78
|
+
*/
|
|
79
|
+
function close(broker) {
|
|
80
|
+
if (broker.transport !== undefined)
|
|
81
|
+
broker.transport.close();
|
|
82
|
+
else
|
|
83
|
+
broker.child.disconnect?.();
|
|
84
|
+
}
|
|
85
|
+
WatchBrokerTransport.close = close;
|
|
86
|
+
})(WatchBrokerTransport || (WatchBrokerTransport = {}));
|
|
87
|
+
|
|
88
|
+
export { WatchBrokerTransport };
|
|
89
|
+
//# sourceMappingURL=WatchBrokerTransport.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WatchBrokerTransport.mjs","sources":["../../../../../src/core/transform/tracker/broker/WatchBrokerTransport.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;AAeG;AACG,IAAW;AAAjB,CAAA,UAAiB,oBAAoB,EAAA;AACnC;;;;;;;;;;;;;AAaG;AACH,IAAA,SAAgB,IAAI,CAAC,MAAmB,EAAE,OAAgB,EAAA;AACxD,QAAA,OAAO,MAAM,CAAC,SAAS,KAAK;cACxB,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,OAAiB,CAAC,KAAK;cAC3C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;IACpC;AAJgB,IAAA,oBAAA,CAAA,IAAI,OAInB;AAED;;;;;;;;;;;;AAYG;AACH,IAAA,SAAgB,SAAS,CAAC,MAAmB,EAAE,MAAe,EAAA;AAC5D,QAAA,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;AAAE,YAAA,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;aACjE,IAAI,MAAM,EAAE;AACf,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI;QAC/B;aAAO;AACL,YAAA,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE;YACpB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,IAAI;QACjC;IACF;AATgB,IAAA,oBAAA,CAAA,SAAS,YASxB;AAED;;;;;;;;;;;;;AAaG;IACH,SAAgB,KAAK,CAAC,MAAmB,EAAA;AACvC,QAAA,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;AAAE,YAAA,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;;AACvD,YAAA,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI;IAClC;AAHgB,IAAA,oBAAA,CAAA,KAAK,QAGpB;AACH,CAAC,EA/DgB,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -2,13 +2,13 @@ import type { WatchBroker } from "./WatchBroker.cjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Ask the watch broker to acknowledge, and resolve with whether it did.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* Windows answers after consuming currently queued native completions to an
|
|
6
|
+
* observed empty port. macOS answers once each provable stream has delivered a
|
|
7
|
+
* probe, including the service's latency (#1453). Ordered transport applies
|
|
8
|
+
* every preceding event before the reply. These are current backend frontiers,
|
|
9
|
+
* not atomic timestamp classification of concurrent writes. The optional direct
|
|
10
|
+
* fs.watch program retains its explicit two-turn frontier for protocol tests;
|
|
11
|
+
* it does not supply Windows production proof (#1719).
|
|
12
12
|
*
|
|
13
13
|
* A broker that never answers must not hold a delivery, so the wait gives up
|
|
14
14
|
* after a threshold of twice the probe timeout: the child itself gives up on a
|
|
@@ -48,7 +48,7 @@ import type { WatchBroker } from "./WatchBroker.cjs";
|
|
|
48
48
|
* Native paragraphs and parameters explain ordering, coverage, sharing and
|
|
49
49
|
* false deadlines under the documentation skill.
|
|
50
50
|
* @evidence contracts/portability.md#os-neutral-implementation
|
|
51
|
-
* OS-neutral host delivery delegates Windows
|
|
51
|
+
* OS-neutral host delivery delegates Windows completion-port drainage and macOS stream
|
|
52
52
|
* probing to the native broker rather than applying one universal timing guess.
|
|
53
53
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
54
54
|
* A covering memo query uses fixed identity/id lookup. New requests copy all N
|
|
@@ -2,13 +2,13 @@ import type { WatchBroker } from "./WatchBroker.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Ask the watch broker to acknowledge, and resolve with whether it did.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* Windows answers after consuming currently queued native completions to an
|
|
6
|
+
* observed empty port. macOS answers once each provable stream has delivered a
|
|
7
|
+
* probe, including the service's latency (#1453). Ordered transport applies
|
|
8
|
+
* every preceding event before the reply. These are current backend frontiers,
|
|
9
|
+
* not atomic timestamp classification of concurrent writes. The optional direct
|
|
10
|
+
* fs.watch program retains its explicit two-turn frontier for protocol tests;
|
|
11
|
+
* it does not supply Windows production proof (#1719).
|
|
12
12
|
*
|
|
13
13
|
* A broker that never answers must not hold a delivery, so the wait gives up
|
|
14
14
|
* after a threshold of twice the probe timeout: the child itself gives up on a
|
|
@@ -48,7 +48,7 @@ import type { WatchBroker } from "./WatchBroker.mjs";
|
|
|
48
48
|
* Native paragraphs and parameters explain ordering, coverage, sharing and
|
|
49
49
|
* false deadlines under the documentation skill.
|
|
50
50
|
* @evidence contracts/portability.md#os-neutral-implementation
|
|
51
|
-
* OS-neutral host delivery delegates Windows
|
|
51
|
+
* OS-neutral host delivery delegates Windows completion-port drainage and macOS stream
|
|
52
52
|
* probing to the native broker rather than applying one universal timing guess.
|
|
53
53
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
54
54
|
* A covering memo query uses fixed identity/id lookup. New requests copy all N
|
|
@@ -2,13 +2,13 @@ import type { WatchBroker } from "./WatchBroker";
|
|
|
2
2
|
/**
|
|
3
3
|
* Ask the watch broker to acknowledge, and resolve with whether it did.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* Windows answers after consuming currently queued native completions to an
|
|
6
|
+
* observed empty port. macOS answers once each provable stream has delivered a
|
|
7
|
+
* probe, including the service's latency (#1453). Ordered transport applies
|
|
8
|
+
* every preceding event before the reply. These are current backend frontiers,
|
|
9
|
+
* not atomic timestamp classification of concurrent writes. The optional direct
|
|
10
|
+
* fs.watch program retains its explicit two-turn frontier for protocol tests;
|
|
11
|
+
* it does not supply Windows production proof (#1719).
|
|
12
12
|
*
|
|
13
13
|
* A broker that never answers must not hold a delivery, so the wait gives up
|
|
14
14
|
* after a threshold of twice the probe timeout: the child itself gives up on a
|
|
@@ -48,7 +48,7 @@ import type { WatchBroker } from "./WatchBroker";
|
|
|
48
48
|
* Native paragraphs and parameters explain ordering, coverage, sharing and
|
|
49
49
|
* false deadlines under the documentation skill.
|
|
50
50
|
* @evidence contracts/portability.md#os-neutral-implementation
|
|
51
|
-
* OS-neutral host delivery delegates Windows
|
|
51
|
+
* OS-neutral host delivery delegates Windows completion-port drainage and macOS stream
|
|
52
52
|
* probing to the native broker rather than applying one universal timing guess.
|
|
53
53
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
54
54
|
* A covering memo query uses fixed identity/id lookup. New requests copy all N
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var WATCH_PROBE_TIMEOUT_MS = require('./WATCH_PROBE_TIMEOUT_MS.js');
|
|
4
|
+
var WatchBrokerTransport = require('./WatchBrokerTransport.js');
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Ask the watch broker to acknowledge, and resolve with whether it did.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* Windows answers after consuming currently queued native completions to an
|
|
10
|
+
* observed empty port. macOS answers once each provable stream has delivered a
|
|
11
|
+
* probe, including the service's latency (#1453). Ordered transport applies
|
|
12
|
+
* every preceding event before the reply. These are current backend frontiers,
|
|
13
|
+
* not atomic timestamp classification of concurrent writes. The optional direct
|
|
14
|
+
* fs.watch program retains its explicit two-turn frontier for protocol tests;
|
|
15
|
+
* it does not supply Windows production proof (#1719).
|
|
15
16
|
*
|
|
16
17
|
* A broker that never answers must not hold a delivery, so the wait gives up
|
|
17
18
|
* after a threshold of twice the probe timeout: the child itself gives up on a
|
|
@@ -51,7 +52,7 @@ var WATCH_PROBE_TIMEOUT_MS = require('./WATCH_PROBE_TIMEOUT_MS.js');
|
|
|
51
52
|
* Native paragraphs and parameters explain ordering, coverage, sharing and
|
|
52
53
|
* false deadlines under the documentation skill.
|
|
53
54
|
* @evidence contracts/portability.md#os-neutral-implementation
|
|
54
|
-
* OS-neutral host delivery delegates Windows
|
|
55
|
+
* OS-neutral host delivery delegates Windows completion-port drainage and macOS stream
|
|
55
56
|
* probing to the native broker rather than applying one universal timing guess.
|
|
56
57
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
57
58
|
* A covering memo query uses fixed identity/id lookup. New requests copy all N
|
|
@@ -108,8 +109,7 @@ function startWatchBrokerDrain(broker, timeout, scope) {
|
|
|
108
109
|
broker.drainScopes?.delete(id);
|
|
109
110
|
broker.pendingDrains -= 1;
|
|
110
111
|
if (broker.pendingDrains === 0 && broker.pendingRegistrations === 0) {
|
|
111
|
-
|
|
112
|
-
broker.child.channel?.unref?.();
|
|
112
|
+
WatchBrokerTransport.WatchBrokerTransport.reference(broker, false);
|
|
113
113
|
}
|
|
114
114
|
resolve(answered);
|
|
115
115
|
};
|
|
@@ -119,12 +119,11 @@ function startWatchBrokerDrain(broker, timeout, scope) {
|
|
|
119
119
|
// the reference the loop can empty while a delivery waits here, and the
|
|
120
120
|
// process exits mid-build with nothing to report.
|
|
121
121
|
broker.pendingDrains += 1;
|
|
122
|
-
|
|
123
|
-
broker.child.channel?.ref?.();
|
|
122
|
+
WatchBrokerTransport.WatchBrokerTransport.reference(broker, true);
|
|
124
123
|
const timer = setTimeout(() => release(false), timeout);
|
|
125
124
|
broker.drains.set(id, release);
|
|
126
125
|
(broker.drainScopes ??= new Map()).set(id, scope);
|
|
127
|
-
if (
|
|
126
|
+
if (WatchBrokerTransport.WatchBrokerTransport.send(broker, { id, op: "drain" }) !== true) {
|
|
128
127
|
release(false);
|
|
129
128
|
}
|
|
130
129
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drainWatchBroker.js","sources":["../../../../../src/core/transform/tracker/broker/drainWatchBroker.ts"],"sourcesContent":[null],"names":["WATCH_PROBE_TIMEOUT_MS"],"mappings":"
|
|
1
|
+
{"version":3,"file":"drainWatchBroker.js","sources":["../../../../../src/core/transform/tracker/broker/drainWatchBroker.ts"],"sourcesContent":[null],"names":["WATCH_PROBE_TIMEOUT_MS","WatchBrokerTransport"],"mappings":";;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEG;AACG,SAAU,gBAAgB,CAC9B,MAAmB,EACnB,UAAkB,CAAC,GAAGA,6CAAsB,EAC5C,YAAqB,EAAA;;;AAIrB,IAAA,IACE,MAAM,CAAC,QAAQ,KAAK,SAAS;SAC5B,YAAY,KAAK,SAAS;YACzB,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,EACnD;QACA,OAAO,MAAM,CAAC,QAAQ;IACxB;IACA,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,CAAC,GAAG,MAAM,CAAC,aAAa;AACrB,SAAA,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,KAAK,CAAC,MAAM;SAClC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CACrB;AACD,IAAA,MAAM,QAAQ,GAAqB,qBAAqB,CACtD,MAAM,EACN,OAAO,EACP,KAAK,CACN,CAAC,OAAO,CAAC,MAAK;AACb,QAAA,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;AAChC,YAAA,MAAM,CAAC,QAAQ,GAAG,SAAS;AAC3B,YAAA,MAAM,CAAC,aAAa,GAAG,SAAS;QAClC;AACF,IAAA,CAAC,CAAC;AACF,IAAA,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC1B,IAAA,MAAM,CAAC,aAAa,GAAG,KAAK;AAC5B,IAAA,OAAO,QAAQ;AACjB;AAEA,SAAS,qBAAqB,CAC5B,MAAmB,EACnB,OAAe,EACf,KAA0B,EAAA;AAE1B,IAAA,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,KAAI;AACtC,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE;QAC1B,IAAI,OAAO,GAAG,KAAK;AACnB,QAAA,MAAM,OAAO,GAAG,CAAC,QAAiB,KAAU;AAC1C,YAAA,IAAI,OAAO;gBAAE;YACb,OAAO,GAAG,IAAI;YACd,YAAY,CAAC,KAAK,CAAC;AACnB,YAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AACxB,YAAA,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC;AAC9B,YAAA,MAAM,CAAC,aAAa,IAAI,CAAC;AACzB,YAAA,IAAI,MAAM,CAAC,aAAa,KAAK,CAAC,IAAI,MAAM,CAAC,oBAAoB,KAAK,CAAC,EAAE;AACnE,gBAAAC,yCAAoB,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC;YAC/C;YACA,OAAO,CAAC,QAAQ,CAAC;AACnB,QAAA,CAAC;;;;;;AAMD,QAAA,MAAM,CAAC,aAAa,IAAI,CAAC;AACzB,QAAAA,yCAAoB,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC;AAC5C,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC;AAC9B,QAAA,CAAC,MAAM,CAAC,WAAW,KAAK,IAAI,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC;AACjD,QAAA,IAAIA,yCAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,EAAE;YACnE,OAAO,CAAC,KAAK,CAAC;QAChB;AACF,IAAA,CAAC,CAAC;AACJ;;;;"}
|