@graftland/plugin-remote 0.0.0-stage → 0.3.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 +202 -0
- package/README.md +76 -2
- package/README.zh-CN.md +71 -0
- package/README.zh-TW.md +71 -0
- package/dist/Auth-BElTC9_X.js +6 -0
- package/dist/Auth.d.ts +49 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +8 -0
- package/dist/Auth.js.map +1 -0
- package/dist/Bootstrap-MCwivGN1.js +9 -0
- package/dist/ConfigDirectory-BCC6q2R4.js +5 -0
- package/dist/Contract-CcpSIJm4.js +121 -0
- package/dist/Contract.d.ts +71 -0
- package/dist/Contract.d.ts.map +1 -0
- package/dist/Contract.js +1 -0
- package/dist/Contract.js.map +1 -0
- package/dist/Errors-oPsTLY7l.js +45 -0
- package/dist/Errors.d.ts +67 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +47 -0
- package/dist/Errors.js.map +1 -0
- package/dist/FailureGroup-BcH0XOBi.js +53 -0
- package/dist/Framing-zaYdOJnT.js +61 -0
- package/dist/Graft-BsYq3F-J.js +985 -0
- package/dist/Instance.d.ts +7 -0
- package/dist/Instance.d.ts.map +1 -0
- package/dist/Instance.js +14 -0
- package/dist/Instance.js.map +1 -0
- package/dist/Packages-B1TPk8pa.js +111 -0
- package/dist/Peer-IJgFK6mD.js +342 -0
- package/dist/ProcessObservation-DEGrEMfP.js +38 -0
- package/dist/ServeLifecycle-CJM0gG5B.js +24 -0
- package/dist/Testing.d.ts +26 -0
- package/dist/Testing.d.ts.map +1 -0
- package/dist/Testing.js +69 -0
- package/dist/Testing.js.map +1 -0
- package/dist/Transport-DULzpsgR.js +6 -0
- package/dist/Transport.d.ts +39 -0
- package/dist/Transport.d.ts.map +1 -0
- package/dist/Transport.js +8 -0
- package/dist/Transport.js.map +1 -0
- package/dist/WatchdogProtocol-BZmVxrBP.js +17 -0
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +28275 -0
- package/dist/bin.js.map +1 -0
- package/dist/childRuntime-DSqtFN9o.js +188 -0
- package/dist/cleanup-BPWr-5U9.js +13 -0
- package/dist/command-9zrHdbwT.js +7 -0
- package/dist/connectionEnded-DUgcobEd.js +9 -0
- package/dist/directTransport-DrexuPSm.js +5 -0
- package/dist/entry-SYsx9VNb.js +708 -0
- package/dist/host/auth/bearer.d.ts +5 -0
- package/dist/host/auth/bearer.d.ts.map +1 -0
- package/dist/host/auth/bearer.js +4 -0
- package/dist/host/auth/bearer.js.map +1 -0
- package/dist/host/auth/jwt.d.ts +5 -0
- package/dist/host/auth/jwt.d.ts.map +1 -0
- package/dist/host/auth/jwt.js +4 -0
- package/dist/host/auth/jwt.js.map +1 -0
- package/dist/host/auth/mtls.d.ts +8 -0
- package/dist/host/auth/mtls.d.ts.map +1 -0
- package/dist/host/auth/mtls.js +34 -0
- package/dist/host/auth/mtls.js.map +1 -0
- package/dist/host/auth/none.d.ts +3 -0
- package/dist/host/auth/none.d.ts.map +1 -0
- package/dist/host/auth/none.js +13 -0
- package/dist/host/auth/none.js.map +1 -0
- package/dist/host/command.d.ts +22 -0
- package/dist/host/command.d.ts.map +1 -0
- package/dist/host/command.js +61 -0
- package/dist/host/command.js.map +1 -0
- package/dist/host/local.d.ts +4 -0
- package/dist/host/local.d.ts.map +1 -0
- package/dist/host/local.js +52 -0
- package/dist/host/local.js.map +1 -0
- package/dist/host/unix.d.ts +11 -0
- package/dist/host/unix.d.ts.map +1 -0
- package/dist/host/unix.js +39 -0
- package/dist/host/unix.js.map +1 -0
- package/dist/host/websocket.d.ts +13 -0
- package/dist/host/websocket.d.ts.map +1 -0
- package/dist/host/websocket.js +36 -0
- package/dist/host/websocket.js.map +1 -0
- package/dist/host/worker.d.ts +4 -0
- package/dist/host/worker.d.ts.map +1 -0
- package/dist/host/worker.js +52 -0
- package/dist/host/worker.js.map +1 -0
- package/dist/importer-D7zSgqxq.js +347 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Certificates.js +182 -0
- package/dist/internal/Certificates.js.map +1 -0
- package/dist/internal/FailureGroup.js +55 -0
- package/dist/internal/FailureGroup.js.map +1 -0
- package/dist/internal/Limits.d.ts +1 -0
- package/dist/internal/Limits.js +17 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Peer.js +6 -0
- package/dist/internal/Peer.js.map +1 -0
- package/dist/internal/ServeLifecycle.js +26 -0
- package/dist/internal/ServeLifecycle.js.map +1 -0
- package/dist/internal/Supervisor.js +7 -0
- package/dist/internal/Supervisor.js.map +1 -0
- package/dist/internal/assembly.d.ts +5 -0
- package/dist/internal/assembly.js +138 -0
- package/dist/internal/assembly.js.map +1 -0
- package/dist/internal/auth/mtls.js +23 -0
- package/dist/internal/auth/mtls.js.map +1 -0
- package/dist/internal/auth/token.js +19 -0
- package/dist/internal/auth/token.js.map +1 -0
- package/dist/internal/auth/tokenCredentials.d.ts +8 -0
- package/dist/internal/auth/tokenCredentials.d.ts.map +1 -0
- package/dist/internal/auth/tokenCredentials.js +33 -0
- package/dist/internal/auth/tokenCredentials.js.map +1 -0
- package/dist/internal/child.js +125 -0
- package/dist/internal/child.js.map +1 -0
- package/dist/internal/childErrors.d.ts +33 -0
- package/dist/internal/childErrors.d.ts.map +1 -0
- package/dist/internal/childErrors.js +29 -0
- package/dist/internal/childErrors.js.map +1 -0
- package/dist/internal/childRuntime.js +59 -0
- package/dist/internal/childRuntime.js.map +1 -0
- package/dist/internal/cleanup.js +15 -0
- package/dist/internal/cleanup.js.map +1 -0
- package/dist/internal/config.js +6 -0
- package/dist/internal/config.js.map +1 -0
- package/dist/internal/control.js +42 -0
- package/dist/internal/control.js.map +1 -0
- package/dist/internal/credentials.d.ts +44 -0
- package/dist/internal/credentials.d.ts.map +1 -0
- package/dist/internal/credentials.js +54 -0
- package/dist/internal/credentials.js.map +1 -0
- package/dist/internal/directTransport.d.ts +3 -0
- package/dist/internal/directTransport.js +7 -0
- package/dist/internal/directTransport.js.map +1 -0
- package/dist/internal/entry.d.ts +9 -0
- package/dist/internal/entry.d.ts.map +1 -0
- package/dist/internal/entry.js +144 -0
- package/dist/internal/entry.js.map +1 -0
- package/dist/internal/entryConfig.d.ts +202 -0
- package/dist/internal/entryConfig.d.ts.map +1 -0
- package/dist/internal/entryConfig.js +176 -0
- package/dist/internal/entryConfig.js.map +1 -0
- package/dist/internal/execution.d.ts +5 -0
- package/dist/internal/execution.js +43 -0
- package/dist/internal/execution.js.map +1 -0
- package/dist/internal/follow.js +11 -0
- package/dist/internal/follow.js.map +1 -0
- package/dist/internal/forkTree.js +7 -0
- package/dist/internal/forkTree.js.map +1 -0
- package/dist/internal/host/local.js +28 -0
- package/dist/internal/host/local.js.map +1 -0
- package/dist/internal/host/runner.js +100 -0
- package/dist/internal/host/runner.js.map +1 -0
- package/dist/internal/host.js +71 -0
- package/dist/internal/host.js.map +1 -0
- package/dist/internal/importer.js +18 -0
- package/dist/internal/importer.js.map +1 -0
- package/dist/internal/listenerStartup.js +17 -0
- package/dist/internal/listenerStartup.js.map +1 -0
- package/dist/internal/loadModule.js +20 -0
- package/dist/internal/loadModule.js.map +1 -0
- package/dist/internal/platform.js +9 -0
- package/dist/internal/platform.js.map +1 -0
- package/dist/internal/port.d.ts +13 -0
- package/dist/internal/port.d.ts.map +1 -0
- package/dist/internal/port.js +275 -0
- package/dist/internal/port.js.map +1 -0
- package/dist/internal/release.js +25 -0
- package/dist/internal/release.js.map +1 -0
- package/dist/internal/runner/Bootstrap.js +11 -0
- package/dist/internal/runner/Bootstrap.js.map +1 -0
- package/dist/internal/runner/Connection.d.ts +11 -0
- package/dist/internal/runner/Connection.js +56 -0
- package/dist/internal/runner/Connection.js.map +1 -0
- package/dist/internal/runner/Execution.js +115 -0
- package/dist/internal/runner/Execution.js.map +1 -0
- package/dist/internal/runner/Framing.d.ts +11 -0
- package/dist/internal/runner/Framing.d.ts.map +1 -0
- package/dist/internal/runner/Framing.js +63 -0
- package/dist/internal/runner/Framing.js.map +1 -0
- package/dist/internal/runner/Local.js +46 -0
- package/dist/internal/runner/Local.js.map +1 -0
- package/dist/internal/runner/Lock.js +25 -0
- package/dist/internal/runner/Lock.js.map +1 -0
- package/dist/internal/runner/Multiplex.d.ts +5 -0
- package/dist/internal/runner/Multiplex.js +49 -0
- package/dist/internal/runner/Multiplex.js.map +1 -0
- package/dist/internal/runner/Packages.d.ts +3 -0
- package/dist/internal/runner/Packages.js +108 -0
- package/dist/internal/runner/Packages.js.map +1 -0
- package/dist/internal/runner/ProcessObservation.js +40 -0
- package/dist/internal/runner/ProcessObservation.js.map +1 -0
- package/dist/internal/runner/Processes.js +83 -0
- package/dist/internal/runner/Processes.js.map +1 -0
- package/dist/internal/runner/Retention.js +13 -0
- package/dist/internal/runner/Retention.js.map +1 -0
- package/dist/internal/runner/Store.js +78 -0
- package/dist/internal/runner/Store.js.map +1 -0
- package/dist/internal/runner/Supervisor.js +375 -0
- package/dist/internal/runner/Supervisor.js.map +1 -0
- package/dist/internal/runner/Watchdog.js +47 -0
- package/dist/internal/runner/Watchdog.js.map +1 -0
- package/dist/internal/runner/WatchdogProtocol.js +19 -0
- package/dist/internal/runner/WatchdogProtocol.js.map +1 -0
- package/dist/internal/runner/Wire.d.ts +5 -0
- package/dist/internal/runner/Wire.js +64 -0
- package/dist/internal/runner/Wire.js.map +1 -0
- package/dist/internal/runner/accept.js +57 -0
- package/dist/internal/runner/accept.js.map +1 -0
- package/dist/internal/runner/command.js +9 -0
- package/dist/internal/runner/command.js.map +1 -0
- package/dist/internal/runner/connectionEnded.js +11 -0
- package/dist/internal/runner/connectionEnded.js.map +1 -0
- package/dist/internal/runner/model.d.ts +17 -0
- package/dist/internal/runner/model.d.ts.map +1 -0
- package/dist/internal/runner/model.js +231 -0
- package/dist/internal/runner/model.js.map +1 -0
- package/dist/internal/serve.js +60 -0
- package/dist/internal/serve.js.map +1 -0
- package/dist/internal/services.d.ts +18 -0
- package/dist/internal/services.d.ts.map +1 -0
- package/dist/internal/services.js +22 -0
- package/dist/internal/services.js.map +1 -0
- package/dist/internal/socketChannel.js +24 -0
- package/dist/internal/socketChannel.js.map +1 -0
- package/dist/internal/stdioChannel.js +23 -0
- package/dist/internal/stdioChannel.js.map +1 -0
- package/dist/internal/supervisorPlugin.js +1 -0
- package/dist/internal/supervisorPlugin.js.map +1 -0
- package/dist/internal/transportOptions.d.ts +18 -0
- package/dist/internal/transportOptions.d.ts.map +1 -0
- package/dist/internal/watchdogMain.d.ts +1 -0
- package/dist/internal/watchdogMain.js +55 -0
- package/dist/internal/watchdogMain.js.map +1 -0
- package/dist/internal/websocket.js +46 -0
- package/dist/internal/websocket.js.map +1 -0
- package/dist/internal/websocketServer.js +61 -0
- package/dist/internal/websocketServer.js.map +1 -0
- package/dist/internal/workerBootstrap.js +9 -0
- package/dist/internal/workerBootstrap.js.map +1 -0
- package/dist/internal/workerChannel.js +24 -0
- package/dist/internal/workerChannel.js.map +1 -0
- package/dist/internal/workerMain.d.ts +1 -0
- package/dist/internal/workerMain.js +18 -0
- package/dist/internal/workerMain.js.map +1 -0
- package/dist/port-Blbh8tms.js +285 -0
- package/dist/release-BY4Mlluy.js +23 -0
- package/dist/rolldown-runtime-DYf_mQCB.js +34 -0
- package/dist/runner/auth/bearer.d.ts +7 -0
- package/dist/runner/auth/bearer.d.ts.map +1 -0
- package/dist/runner/auth/bearer.js +42 -0
- package/dist/runner/auth/bearer.js.map +1 -0
- package/dist/runner/auth/jwt.d.ts +19 -0
- package/dist/runner/auth/jwt.d.ts.map +1 -0
- package/dist/runner/auth/jwt.js +65 -0
- package/dist/runner/auth/jwt.js.map +1 -0
- package/dist/runner/auth/mtls.d.ts +11 -0
- package/dist/runner/auth/mtls.d.ts.map +1 -0
- package/dist/runner/auth/mtls.js +48 -0
- package/dist/runner/auth/mtls.js.map +1 -0
- package/dist/runner/auth/none.d.ts +3 -0
- package/dist/runner/auth/none.d.ts.map +1 -0
- package/dist/runner/auth/none.js +13 -0
- package/dist/runner/auth/none.js.map +1 -0
- package/dist/runner/index.d.ts +3 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/index.js +71 -0
- package/dist/runner/index.js.map +1 -0
- package/dist/runner/stdio.d.ts +7 -0
- package/dist/runner/stdio.d.ts.map +1 -0
- package/dist/runner/stdio.js +39 -0
- package/dist/runner/stdio.js.map +1 -0
- package/dist/runner/unix.d.ts +7 -0
- package/dist/runner/unix.d.ts.map +1 -0
- package/dist/runner/unix.js +42 -0
- package/dist/runner/unix.js.map +1 -0
- package/dist/runner/websocket.d.ts +28 -0
- package/dist/runner/websocket.d.ts.map +1 -0
- package/dist/runner/websocket.js +77 -0
- package/dist/runner/websocket.js.map +1 -0
- package/dist/socketChannel-KmtzF-9G.js +3658 -0
- package/dist/supervisorPlugin-Inb1S5IV.js +737 -0
- package/dist/token-v5ne2I0-.js +17 -0
- package/dist/tokenCredentials-WUJm2AKm.js +31 -0
- package/dist/websocketServer-MXcCJx0v.js +58 -0
- package/dist/workerChannel-P82YdNjh.js +27 -0
- package/package.json +69 -3
- package/src/Auth.ts +62 -0
- package/src/Contract.ts +100 -0
- package/src/Errors.ts +82 -0
- package/src/Instance.ts +12 -0
- package/src/Testing.ts +135 -0
- package/src/Transport.ts +52 -0
- package/src/bin.ts +145 -0
- package/src/host/auth/bearer.ts +10 -0
- package/src/host/auth/jwt.ts +10 -0
- package/src/host/auth/mtls.ts +48 -0
- package/src/host/auth/none.ts +13 -0
- package/src/host/command.ts +131 -0
- package/src/host/local.ts +41 -0
- package/src/host/unix.ts +65 -0
- package/src/host/websocket.ts +66 -0
- package/src/host/worker.ts +90 -0
- package/src/index.ts +115 -0
- package/src/internal/Certificates.ts +330 -0
- package/src/internal/FailureGroup.ts +176 -0
- package/src/internal/Limits.ts +12 -0
- package/src/internal/Peer.ts +4 -0
- package/src/internal/ServeLifecycle.ts +53 -0
- package/src/internal/Supervisor.ts +14 -0
- package/src/internal/assembly.ts +337 -0
- package/src/internal/auth/mtls.ts +40 -0
- package/src/internal/auth/token.ts +26 -0
- package/src/internal/auth/tokenCredentials.ts +65 -0
- package/src/internal/child.ts +323 -0
- package/src/internal/childErrors.ts +44 -0
- package/src/internal/childRuntime.ts +111 -0
- package/src/internal/cleanup.ts +34 -0
- package/src/internal/config.ts +8 -0
- package/src/internal/control.ts +49 -0
- package/src/internal/credentials.ts +112 -0
- package/src/internal/directTransport.ts +38 -0
- package/src/internal/entry.ts +288 -0
- package/src/internal/entryConfig.ts +190 -0
- package/src/internal/execution.ts +121 -0
- package/src/internal/follow.ts +17 -0
- package/src/internal/forkTree.ts +13 -0
- package/src/internal/host/local.ts +53 -0
- package/src/internal/host/runner.ts +187 -0
- package/src/internal/host.ts +209 -0
- package/src/internal/importer.ts +27 -0
- package/src/internal/listenerStartup.ts +55 -0
- package/src/internal/loadModule.ts +23 -0
- package/src/internal/platform.ts +12 -0
- package/src/internal/port.ts +623 -0
- package/src/internal/release.ts +71 -0
- package/src/internal/runner/Bootstrap.ts +9 -0
- package/src/internal/runner/Connection.ts +184 -0
- package/src/internal/runner/Execution.ts +244 -0
- package/src/internal/runner/Framing.ts +122 -0
- package/src/internal/runner/Local.ts +73 -0
- package/src/internal/runner/Lock.ts +29 -0
- package/src/internal/runner/Multiplex.ts +120 -0
- package/src/internal/runner/Packages.ts +178 -0
- package/src/internal/runner/ProcessObservation.ts +63 -0
- package/src/internal/runner/Processes.ts +109 -0
- package/src/internal/runner/Retention.ts +49 -0
- package/src/internal/runner/Store.ts +160 -0
- package/src/internal/runner/Supervisor.ts +901 -0
- package/src/internal/runner/Watchdog.ts +83 -0
- package/src/internal/runner/WatchdogProtocol.ts +12 -0
- package/src/internal/runner/Wire.ts +99 -0
- package/src/internal/runner/accept.ts +103 -0
- package/src/internal/runner/command.ts +15 -0
- package/src/internal/runner/connectionEnded.ts +28 -0
- package/src/internal/runner/model.ts +364 -0
- package/src/internal/serve.ts +117 -0
- package/src/internal/services.ts +74 -0
- package/src/internal/socketChannel.ts +64 -0
- package/src/internal/stdioChannel.ts +25 -0
- package/src/internal/supervisorPlugin.ts +67 -0
- package/src/internal/transportOptions.ts +17 -0
- package/src/internal/watchdogMain.ts +72 -0
- package/src/internal/websocket.ts +81 -0
- package/src/internal/websocketServer.ts +152 -0
- package/src/internal/workerBootstrap.ts +6 -0
- package/src/internal/workerChannel.ts +54 -0
- package/src/internal/workerMain.ts +23 -0
- package/src/runner/auth/bearer.ts +66 -0
- package/src/runner/auth/jwt.ts +114 -0
- package/src/runner/auth/mtls.ts +37 -0
- package/src/runner/auth/none.ts +13 -0
- package/src/runner/index.ts +97 -0
- package/src/runner/stdio.ts +76 -0
- package/src/runner/unix.ts +53 -0
- package/src/runner/websocket.ts +143 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context, Schema } from "effect";
|
|
2
|
+
/** Outside a remote activation the identity is local/0. Local activations use a fresh UUID/1; runners allocate persistent generations. */
|
|
3
|
+
export declare const Instance: Context.Reference<{
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=Instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Instance.d.ts","names":[],"sources":["../src/Instance.ts"],"mappings":";;qBAMa,UAAQ,QAAA"}
|
package/dist/Instance.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context, Schema } from "effect";
|
|
2
|
+
// src/Instance.ts
|
|
3
|
+
const Identity = Schema.Struct({
|
|
4
|
+
id: Schema.String,
|
|
5
|
+
generation: Schema.Int
|
|
6
|
+
});
|
|
7
|
+
/** Outside a remote activation the identity is local/0. Local activations use a fresh UUID/1; runners allocate persistent generations. */
|
|
8
|
+
const Instance = Context.Reference("@graftland/plugin-remote/Instance/Instance", { defaultValue: () => ({
|
|
9
|
+
id: "local",
|
|
10
|
+
generation: 0
|
|
11
|
+
}) });
|
|
12
|
+
export { Identity, Instance };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=Instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Instance.js","names":[],"sources":["../src/Instance.ts"],"sourcesContent":["import { Context, Schema } from \"effect\"\nexport const Identity = Schema.Struct({\n\tid: Schema.String,\n\tgeneration: Schema.Int,\n})\n/** Outside a remote activation the identity is local/0. Local activations use a fresh UUID/1; runners allocate persistent generations. */\nexport const Instance = Context.Reference<typeof Identity.Type>(\n\t\"@graftland/plugin-remote/Instance/Instance\",\n\t{\n\t\tdefaultValue: () => ({ id: \"local\", generation: 0 }),\n\t},\n)\n"],"mappings":";;AACA,MAAa,WAAW,OAAO,OAAO;CACrC,IAAI,OAAO;CACX,YAAY,OAAO;AACpB,CAAC;;AAED,MAAa,WAAW,QAAQ,UAC/B,8CACA,EACC,qBAAqB;CAAE,IAAI;CAAS,YAAY;AAAE,GACnD,CACD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { c as PackageError } from "./Peer-IJgFK6mD.js";
|
|
2
|
+
import { Array, Cause, Context, Duration, Effect, FileSystem, Order, Path, Schema, Stream, String } from "effect";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
// packages/remote/src/internal/config.ts
|
|
8
|
+
const PositiveDuration = Schema.DurationFromString.check(Schema.makeFilter((value) => Duration.isFinite(value) && Duration.toMillis(value) > 0, { expected: "a finite, positive duration" }));
|
|
9
|
+
// packages/remote/src/internal/Supervisor.ts
|
|
10
|
+
/** A listener hands an authenticated byte channel to the supervisor. */
|
|
11
|
+
var Supervisor = class extends Context.Service()("@graftland/plugin-remote/internal/Supervisor") {};
|
|
12
|
+
// packages/remote/src/internal/runner/Packages.ts
|
|
13
|
+
const Manifest = Schema.Struct({
|
|
14
|
+
name: Schema.String,
|
|
15
|
+
version: Schema.String
|
|
16
|
+
});
|
|
17
|
+
const verify = (actual, expected = {}) => expected.version !== void 0 && actual.version !== expected.version ? Effect.fail(PackageError.make({ detail: `Package version mismatch: expected ${expected.version}, received ${actual.version}` })) : expected.digest !== void 0 && actual.digest !== expected.digest ? Effect.fail(PackageError.make({ detail: `Package digest mismatch: expected ${expected.digest}, received ${actual.digest}` })) : Effect.void;
|
|
18
|
+
/** A path-sensitive SHA-256 of sorted entries and bytes, excluding every node_modules subtree. */
|
|
19
|
+
const digest = Effect.fnUntraced(function* (directory) {
|
|
20
|
+
const fs = yield* FileSystem.FileSystem;
|
|
21
|
+
const path = yield* Path.Path;
|
|
22
|
+
const hash = yield* Effect.sync(() => createHash("sha256").update("graft-package-sha256-v1\0"));
|
|
23
|
+
const visit = (relative) => Effect.gen(function* () {
|
|
24
|
+
const filename = path.join(directory, relative);
|
|
25
|
+
const info = yield* fs.stat(filename);
|
|
26
|
+
if (info.type !== "File" && info.type !== "Directory") return yield* PackageError.make({ detail: `Unsupported package entry: ${relative}` });
|
|
27
|
+
const name = new TextEncoder().encode(relative);
|
|
28
|
+
yield* Effect.sync(() => {
|
|
29
|
+
hash.update(`${info.type}:${name.byteLength}:${info.type === "File" ? info.size : 0}:`);
|
|
30
|
+
hash.update(name);
|
|
31
|
+
});
|
|
32
|
+
if (info.type === "File") yield* fs.stream(filename).pipe(Stream.runForEach((bytes) => Effect.sync(() => {
|
|
33
|
+
hash.update(bytes);
|
|
34
|
+
})));
|
|
35
|
+
else {
|
|
36
|
+
const entries = yield* fs.readDirectory(filename);
|
|
37
|
+
for (const entry of Array.sort(entries, Order.String)) {
|
|
38
|
+
if (entry === "node_modules") continue;
|
|
39
|
+
yield* visit(relative === "" ? entry : `${relative}/${entry}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
yield* visit("");
|
|
44
|
+
return yield* Effect.sync(() => hash.digest("hex"));
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Resolve using Node's import conditions without importing executable package code.
|
|
48
|
+
* The helper's cwd is the installation root and it inherits no NODE_OPTIONS/loaders.
|
|
49
|
+
* The installation directory and its package exports are trusted.
|
|
50
|
+
*/
|
|
51
|
+
const resolve = Effect.fnUntraced(function* (root, specifier, includeDigest = false) {
|
|
52
|
+
const segments = String.split(specifier, "/");
|
|
53
|
+
const scoped = String.startsWith("@")(specifier);
|
|
54
|
+
const name = Array.join(Array.take(segments, scoped ? 2 : 1), "/");
|
|
55
|
+
const fs = yield* FileSystem.FileSystem;
|
|
56
|
+
const path = yield* Path.Path;
|
|
57
|
+
const installation = yield* fs.realPath(root);
|
|
58
|
+
const directory = yield* fs.realPath(path.join(installation, "node_modules", name));
|
|
59
|
+
const manifest = yield* fs.readFileString(path.join(directory, "package.json")).pipe(Effect.flatMap(Schema.decodeEffect(Schema.fromJsonString(Manifest))));
|
|
60
|
+
const resolved = yield* resolveEntry(installation, specifier);
|
|
61
|
+
const filename = yield* Effect.try({
|
|
62
|
+
try: () => fileURLToPath(resolved),
|
|
63
|
+
catch: (error) => PackageError.make({
|
|
64
|
+
detail: "The package export is not a file URL",
|
|
65
|
+
cause: Cause.die(error)
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
directory,
|
|
70
|
+
entry: yield* fs.realPath(filename),
|
|
71
|
+
identity: {
|
|
72
|
+
...manifest,
|
|
73
|
+
...includeDigest ? { digest: yield* digest(directory) } : {}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}, Effect.catchTags({
|
|
77
|
+
PlatformError: (error) => Effect.fail(PackageError.make({
|
|
78
|
+
detail: "Reading the installed package failed",
|
|
79
|
+
cause: Cause.fail(error)
|
|
80
|
+
})),
|
|
81
|
+
SchemaError: (error) => Effect.fail(PackageError.make({
|
|
82
|
+
detail: "Reading the package manifest failed",
|
|
83
|
+
cause: Cause.fail(error)
|
|
84
|
+
}))
|
|
85
|
+
}));
|
|
86
|
+
const resolveEntry = (installation, specifier) => Effect.gen(function* () {
|
|
87
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
88
|
+
return yield* Effect.scoped(Effect.gen(function* () {
|
|
89
|
+
const child = yield* spawner.spawn(ChildProcess.make(process.execPath, [
|
|
90
|
+
"--input-type=module",
|
|
91
|
+
"--eval",
|
|
92
|
+
"process.stdout.write(import.meta.resolve(process.argv[1]))",
|
|
93
|
+
"--",
|
|
94
|
+
specifier
|
|
95
|
+
], {
|
|
96
|
+
cwd: installation,
|
|
97
|
+
env: {},
|
|
98
|
+
stdin: "ignore",
|
|
99
|
+
stdout: "pipe",
|
|
100
|
+
stderr: "pipe"
|
|
101
|
+
}));
|
|
102
|
+
const [code, stdout, stderr] = yield* Effect.all([
|
|
103
|
+
child.exitCode,
|
|
104
|
+
child.stdout.pipe(Stream.decodeText(), Stream.mkString),
|
|
105
|
+
child.stderr.pipe(Stream.decodeText(), Stream.mkString)
|
|
106
|
+
], { concurrency: "unbounded" });
|
|
107
|
+
if (code !== 0) return yield* PackageError.make({ detail: `Package resolution failed: ${stderr}` });
|
|
108
|
+
return stdout;
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
export { PositiveDuration as a, Supervisor as i, resolveEntry as n, verify as r, resolve as t };
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { c as TransportError } from "./Errors-oPsTLY7l.js";
|
|
2
|
+
import { i as encode, r as decoder, t as EndOfStream } from "./Framing-zaYdOJnT.js";
|
|
3
|
+
import { t as make$1 } from "./FailureGroup-BcH0XOBi.js";
|
|
4
|
+
import { a as PositiveInt, i as PositiveFinite, r as Limits, t as Priority } from "./port-Blbh8tms.js";
|
|
5
|
+
import { Array, Cause, Context, Data, Duration, Effect, Fiber, Option, Queue, Schema, Sink, Stream, TxQueue } from "effect";
|
|
6
|
+
import { Rpc, RpcGroup } from "effect/rpc";
|
|
7
|
+
// packages/remote/src/Instance.ts
|
|
8
|
+
const Identity = Schema.Struct({
|
|
9
|
+
id: Schema.String,
|
|
10
|
+
generation: Schema.Int
|
|
11
|
+
});
|
|
12
|
+
/** Outside a remote activation the identity is local/0. Local activations use a fresh UUID/1; runners allocate persistent generations. */
|
|
13
|
+
const Instance = Context.Reference("@graftland/plugin-remote/Instance/Instance", { defaultValue: () => ({
|
|
14
|
+
id: "local",
|
|
15
|
+
generation: 0
|
|
16
|
+
}) });
|
|
17
|
+
// packages/remote/src/internal/runner/Multiplex.ts
|
|
18
|
+
/** Ports own admission and ACK backpressure. This layer only frames and separates session/instance bytes. */
|
|
19
|
+
const make = Effect.fnUntraced(function* (channel) {
|
|
20
|
+
const group = yield* make$1();
|
|
21
|
+
const incoming = {
|
|
22
|
+
0: yield* Queue.unbounded(),
|
|
23
|
+
1: yield* Queue.unbounded()
|
|
24
|
+
};
|
|
25
|
+
const outgoing = {
|
|
26
|
+
0: yield* TxQueue.unbounded(),
|
|
27
|
+
1: yield* TxQueue.unbounded()
|
|
28
|
+
};
|
|
29
|
+
const next = Effect.tx(Effect.gen(function* () {
|
|
30
|
+
const session = yield* TxQueue.poll(outgoing[0]);
|
|
31
|
+
if (Option.isSome(session)) return session.value;
|
|
32
|
+
const instance = yield* TxQueue.poll(outgoing[1]);
|
|
33
|
+
if (Option.isSome(instance)) return instance.value;
|
|
34
|
+
if ((yield* TxQueue.isDone(outgoing[0])) && (yield* TxQueue.isDone(outgoing[1]))) return yield* Cause.done();
|
|
35
|
+
return yield* Effect.txRetry;
|
|
36
|
+
}));
|
|
37
|
+
const writing = yield* group.run(Stream.fromEffectRepeat(next).pipe(Stream.run(channel.output), Effect.asVoid));
|
|
38
|
+
const decoder$1 = decoder();
|
|
39
|
+
yield* group.run(channel.input.pipe(Stream.runForEach((bytes) => Effect.fromResult(decoder$1.decode(bytes)).pipe(Effect.flatMap((frames) => Effect.forEach(frames, (frame) => Queue.offer(incoming[frame.channel], frame.payload), { discard: true })))), Effect.andThen(decoder$1.finish), Effect.andThen(Effect.fail(EndOfStream.make({}))), Effect.mapError((error) => error._tag === "TransportError" ? error : TransportError.make({ cause: Cause.fail(error) }))));
|
|
40
|
+
return {
|
|
41
|
+
await: group.await,
|
|
42
|
+
fail: group.fail,
|
|
43
|
+
end: Effect.tx(TxQueue.end(outgoing[0]).pipe(Effect.andThen(TxQueue.end(outgoing[1])))).pipe(Effect.andThen(Fiber.join(writing))),
|
|
44
|
+
send: (id, payload) => group.race(encode({
|
|
45
|
+
channel: id,
|
|
46
|
+
payload
|
|
47
|
+
}).pipe(Effect.flatMap((bytes) => TxQueue.offer(outgoing[id], bytes)), Effect.asVoid)),
|
|
48
|
+
take: (id) => group.race(Queue.take(incoming[id]))
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
Effect.fnUntraced(function* (socket) {
|
|
52
|
+
const reader = yield* socket.reader;
|
|
53
|
+
const writer = yield* socket.writer;
|
|
54
|
+
return yield* make({
|
|
55
|
+
input: Stream.fromEffectRepeat(reader.pull).pipe(Stream.flattenIterable, Stream.map((bytes) => typeof bytes === "string" ? new TextEncoder().encode(bytes) : bytes), Stream.mapError((error) => TransportError.make({ cause: Cause.fail(error) }))),
|
|
56
|
+
output: Sink.forEach((bytes) => writer.write(bytes)).pipe(Sink.mapError((error) => TransportError.make({ cause: Cause.fail(error) })))
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
// packages/remote/src/internal/runner/model.ts
|
|
60
|
+
const diagnosticCause = Schema.Cause(Schema.Defect({ includeStack: true }), Schema.Defect({ includeStack: true }));
|
|
61
|
+
var PackageError = class extends Schema.TaggedError()("PackageError", {
|
|
62
|
+
detail: Schema.String,
|
|
63
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
64
|
+
}) {
|
|
65
|
+
get message() {
|
|
66
|
+
return this.detail;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var SessionAccessDenied = class extends Schema.TaggedError()("SessionAccessDenied", {
|
|
70
|
+
detail: Schema.String,
|
|
71
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
72
|
+
}) {
|
|
73
|
+
get message() {
|
|
74
|
+
return this.detail;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var StaleSession = class extends Schema.TaggedError()("StaleSession", {
|
|
78
|
+
detail: Schema.String,
|
|
79
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
80
|
+
}) {
|
|
81
|
+
get message() {
|
|
82
|
+
return this.detail;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var LeaseExpired = class extends Schema.TaggedError()("LeaseExpired", {
|
|
86
|
+
detail: Schema.String,
|
|
87
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
88
|
+
}) {
|
|
89
|
+
get message() {
|
|
90
|
+
return this.detail;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var SessionStopped = class extends Schema.TaggedError()("SessionStopped", {
|
|
94
|
+
detail: Schema.String,
|
|
95
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
96
|
+
}) {
|
|
97
|
+
get message() {
|
|
98
|
+
return this.detail;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var SessionConflict = class extends Schema.TaggedError()("SessionConflict", {
|
|
102
|
+
detail: Schema.String,
|
|
103
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
104
|
+
}) {
|
|
105
|
+
get message() {
|
|
106
|
+
return this.detail;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var StateStorageError = class extends Schema.TaggedError()("StateStorageError", {
|
|
110
|
+
detail: Schema.String,
|
|
111
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
112
|
+
}) {
|
|
113
|
+
get message() {
|
|
114
|
+
return this.detail;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var ExecutionError = class extends Schema.TaggedError()("ExecutionError", {
|
|
118
|
+
detail: Schema.String,
|
|
119
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
120
|
+
}) {
|
|
121
|
+
get message() {
|
|
122
|
+
return this.detail;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var TerminationUnconfirmed = class extends Schema.TaggedError()("TerminationUnconfirmed", {
|
|
126
|
+
detail: Schema.String,
|
|
127
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
128
|
+
}) {
|
|
129
|
+
get message() {
|
|
130
|
+
return this.detail;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var RunnerClosing = class extends Schema.TaggedError()("RunnerClosing", {
|
|
134
|
+
detail: Schema.String,
|
|
135
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
136
|
+
}) {
|
|
137
|
+
get message() {
|
|
138
|
+
return this.detail;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var StateDirectoryLocked = class extends Schema.TaggedError()("StateDirectoryLocked", {
|
|
142
|
+
detail: Schema.String,
|
|
143
|
+
cause: Schema.optionalKey(diagnosticCause)
|
|
144
|
+
}) {
|
|
145
|
+
get message() {
|
|
146
|
+
return this.detail;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const Key = Schema.Struct({
|
|
150
|
+
identity: Schema.NonEmptyString,
|
|
151
|
+
instance: Schema.NonEmptyString
|
|
152
|
+
});
|
|
153
|
+
/** Structural keys keep identity namespaces separate without delimiter conventions. */
|
|
154
|
+
var SessionKey = class extends Data.Class {};
|
|
155
|
+
const keyOf = (key) => new SessionKey(key);
|
|
156
|
+
const negotiate = (local, peer) => ({
|
|
157
|
+
control: Math.min(local.control, peer.control),
|
|
158
|
+
data: Math.min(local.data, peer.data),
|
|
159
|
+
log: Math.min(local.log, peer.log)
|
|
160
|
+
});
|
|
161
|
+
const Handle = Schema.Struct({
|
|
162
|
+
key: Key,
|
|
163
|
+
token: Schema.NonEmptyString,
|
|
164
|
+
generation: PositiveInt
|
|
165
|
+
});
|
|
166
|
+
const ProcessIdentity = Schema.Struct({
|
|
167
|
+
pid: Schema.Int,
|
|
168
|
+
start: Schema.Struct({ born: Schema.String })
|
|
169
|
+
});
|
|
170
|
+
const ExitStatus = Schema.Struct({
|
|
171
|
+
stderr: Schema.optionalKey(Schema.String),
|
|
172
|
+
cause: Schema.optionalKey(diagnosticCause),
|
|
173
|
+
code: Schema.NullOr(Schema.Int),
|
|
174
|
+
signal: Schema.NullOr(Schema.String)
|
|
175
|
+
});
|
|
176
|
+
const CodeIdentity = Schema.Struct({
|
|
177
|
+
name: Schema.String,
|
|
178
|
+
version: Schema.String,
|
|
179
|
+
digest: Schema.optionalKey(Schema.String)
|
|
180
|
+
});
|
|
181
|
+
const Load = Schema.Struct({
|
|
182
|
+
specifier: Schema.String,
|
|
183
|
+
digest: Schema.optionalKey(Schema.Boolean)
|
|
184
|
+
});
|
|
185
|
+
const Termination = Schema.Struct({
|
|
186
|
+
kind: Schema.Literals(["Exited", "Killed"]),
|
|
187
|
+
exit: ExitStatus,
|
|
188
|
+
cause: diagnosticCause
|
|
189
|
+
});
|
|
190
|
+
const Fields = {
|
|
191
|
+
version: Schema.Literal(1),
|
|
192
|
+
handle: Handle,
|
|
193
|
+
requestId: Schema.String,
|
|
194
|
+
leaseMillis: Schema.Finite,
|
|
195
|
+
limits: Limits
|
|
196
|
+
};
|
|
197
|
+
const OpenRecord = Schema.Struct({
|
|
198
|
+
...Fields,
|
|
199
|
+
phase: Schema.Literal("Open")
|
|
200
|
+
});
|
|
201
|
+
const Launch = Schema.Union([Schema.TaggedStruct("Starting", {}), Schema.TaggedStruct("Registered", { child: ProcessIdentity })]);
|
|
202
|
+
const LoadingRecord = Schema.Struct({
|
|
203
|
+
...Fields,
|
|
204
|
+
phase: Schema.Literal("Loading"),
|
|
205
|
+
load: Load,
|
|
206
|
+
launch: Launch
|
|
207
|
+
});
|
|
208
|
+
const LoadedRecord = Schema.Struct({
|
|
209
|
+
...Fields,
|
|
210
|
+
phase: Schema.Literal("Loaded"),
|
|
211
|
+
load: Load,
|
|
212
|
+
child: ProcessIdentity,
|
|
213
|
+
code: CodeIdentity
|
|
214
|
+
});
|
|
215
|
+
const ActiveRecord = Schema.Union([
|
|
216
|
+
OpenRecord,
|
|
217
|
+
LoadingRecord,
|
|
218
|
+
LoadedRecord
|
|
219
|
+
]);
|
|
220
|
+
const StopReason = Schema.Union([...Array.map([
|
|
221
|
+
"Disposed",
|
|
222
|
+
"Expired",
|
|
223
|
+
"Superseded",
|
|
224
|
+
"Recovery",
|
|
225
|
+
"Shutdown",
|
|
226
|
+
"Exited"
|
|
227
|
+
], (tag) => Schema.TaggedStruct(tag, {})), Schema.TaggedStruct("LoadFailed", { cause: diagnosticCause })]);
|
|
228
|
+
const StoppingRecord = Schema.Struct({
|
|
229
|
+
...Fields,
|
|
230
|
+
phase: Schema.Literal("Stopping"),
|
|
231
|
+
previous: ActiveRecord,
|
|
232
|
+
reason: StopReason
|
|
233
|
+
});
|
|
234
|
+
const StoppedRecord = Schema.Struct({
|
|
235
|
+
...Fields,
|
|
236
|
+
phase: Schema.Literal("Stopped"),
|
|
237
|
+
previous: ActiveRecord,
|
|
238
|
+
reason: StopReason,
|
|
239
|
+
termination: Termination
|
|
240
|
+
});
|
|
241
|
+
const SessionRecord = Schema.Union([
|
|
242
|
+
OpenRecord,
|
|
243
|
+
LoadingRecord,
|
|
244
|
+
LoadedRecord,
|
|
245
|
+
StoppingRecord,
|
|
246
|
+
StoppedRecord
|
|
247
|
+
]);
|
|
248
|
+
const childOf = (record) => {
|
|
249
|
+
switch (record.phase) {
|
|
250
|
+
case "Open": return Option.none();
|
|
251
|
+
case "Loading": return record.launch._tag === "Registered" ? Option.some(record.launch.child) : Option.none();
|
|
252
|
+
case "Loaded": return Option.some(record.child);
|
|
253
|
+
case "Stopping":
|
|
254
|
+
case "Stopped": return childOf(record.previous);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const stoppingRecord = (previous, reason) => ({
|
|
258
|
+
version: previous.version,
|
|
259
|
+
handle: previous.handle,
|
|
260
|
+
requestId: previous.requestId,
|
|
261
|
+
leaseMillis: previous.leaseMillis,
|
|
262
|
+
limits: previous.limits,
|
|
263
|
+
phase: "Stopping",
|
|
264
|
+
previous,
|
|
265
|
+
reason
|
|
266
|
+
});
|
|
267
|
+
const stoppedRecord = (previous, reason, termination) => ({
|
|
268
|
+
...stoppingRecord(previous, reason),
|
|
269
|
+
phase: "Stopped",
|
|
270
|
+
termination
|
|
271
|
+
});
|
|
272
|
+
var Store = class extends Context.Service()("@graftland/plugin-remote/internal/runner/model/Store") {};
|
|
273
|
+
var Execution = class extends Context.Service()("@graftland/plugin-remote/internal/runner/model/Execution") {};
|
|
274
|
+
var RemoteTerminationUnconfirmed = class extends Schema.TaggedError()("RemoteTerminationUnconfirmed", { handle: Handle }) {};
|
|
275
|
+
/** Losing contact never becomes a successful stop merely because a lease duration passed. */
|
|
276
|
+
const awaitTermination = (handle, confirmation, leaseMillis, marginMillis) => Effect.gen(function* () {
|
|
277
|
+
const [elapsed, result] = yield* Effect.exit(Effect.timeoutOption(confirmation, leaseMillis + marginMillis)).pipe(Effect.timed);
|
|
278
|
+
if (result._tag === "Success") {
|
|
279
|
+
if (Option.isSome(result.value)) return result.value.value;
|
|
280
|
+
return yield* RemoteTerminationUnconfirmed.make({ handle });
|
|
281
|
+
}
|
|
282
|
+
yield* Effect.sleep(Math.max(0, leaseMillis + marginMillis - Duration.toMillis(elapsed)));
|
|
283
|
+
return yield* Effect.failCause(Cause.combine(result.cause, Cause.fail(RemoteTerminationUnconfirmed.make({ handle }))));
|
|
284
|
+
});
|
|
285
|
+
// packages/remote/src/internal/runner/Wire.ts
|
|
286
|
+
/** The RPC boundary is the only place that assembles the runner's error schema. */
|
|
287
|
+
const SessionError = Schema.Union([
|
|
288
|
+
SessionAccessDenied,
|
|
289
|
+
StaleSession,
|
|
290
|
+
LeaseExpired,
|
|
291
|
+
SessionStopped,
|
|
292
|
+
SessionConflict,
|
|
293
|
+
StateStorageError,
|
|
294
|
+
ExecutionError,
|
|
295
|
+
PackageError,
|
|
296
|
+
TerminationUnconfirmed,
|
|
297
|
+
RunnerClosing,
|
|
298
|
+
StateDirectoryLocked
|
|
299
|
+
]);
|
|
300
|
+
const Session = RpcGroup.make(Rpc.make("HighWater", {
|
|
301
|
+
payload: { instance: Schema.NonEmptyString },
|
|
302
|
+
success: Schema.NullOr(PositiveInt),
|
|
303
|
+
error: SessionError
|
|
304
|
+
}), Rpc.make("Open", {
|
|
305
|
+
payload: {
|
|
306
|
+
instance: Schema.NonEmptyString,
|
|
307
|
+
requestId: Schema.NonEmptyString,
|
|
308
|
+
expectedGeneration: Schema.NullOr(PositiveInt),
|
|
309
|
+
leaseMillis: Schema.optionalKey(PositiveFinite),
|
|
310
|
+
limits: Limits
|
|
311
|
+
},
|
|
312
|
+
success: SessionRecord,
|
|
313
|
+
error: SessionError
|
|
314
|
+
}), Rpc.make("Load", {
|
|
315
|
+
payload: {
|
|
316
|
+
handle: Handle,
|
|
317
|
+
specifier: Schema.NonEmptyString,
|
|
318
|
+
digest: Schema.optionalKey(Schema.Boolean)
|
|
319
|
+
},
|
|
320
|
+
success: CodeIdentity,
|
|
321
|
+
error: SessionError
|
|
322
|
+
}), Rpc.make("Renew", {
|
|
323
|
+
payload: Handle,
|
|
324
|
+
success: Schema.Finite,
|
|
325
|
+
error: SessionError
|
|
326
|
+
}), Rpc.make("Dispose", {
|
|
327
|
+
payload: Handle,
|
|
328
|
+
success: Termination,
|
|
329
|
+
error: SessionError
|
|
330
|
+
}), Rpc.make("Status", {
|
|
331
|
+
payload: Handle,
|
|
332
|
+
success: SessionRecord,
|
|
333
|
+
error: SessionError
|
|
334
|
+
})).annotateRpcs(Priority, "control");
|
|
335
|
+
/** Preserve the port writer order within each byte channel. */
|
|
336
|
+
const channel = (peer, id) => ({
|
|
337
|
+
input: Stream.fromEffectRepeat(peer.take(id)),
|
|
338
|
+
output: Sink.forEach((bytes) => peer.send(id, bytes).pipe(Effect.mapError((error) => TransportError.make({ cause: Cause.fail(error) }))))
|
|
339
|
+
});
|
|
340
|
+
// packages/remote/src/internal/Peer.ts
|
|
341
|
+
var Peer = class extends Context.Service()("@graftland/plugin-remote/internal/Peer") {};
|
|
342
|
+
export { negotiate as C, Identity as D, make as E, Instance as O, keyOf as S, stoppingRecord as T, StateStorageError as _, ExecutionError as a, awaitTermination as b, PackageError as c, SessionAccessDenied as d, SessionConflict as f, StateDirectoryLocked as g, StaleSession as h, Execution as i, RemoteTerminationUnconfirmed as l, SessionStopped as m, Session as n, Key as o, SessionRecord as p, channel as r, LeaseExpired as s, Peer as t, RunnerClosing as u, Store as v, stoppedRecord as w, childOf as x, TerminationUnconfirmed as y };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as make } from "./FailureGroup-BcH0XOBi.js";
|
|
2
|
+
import { Array, Cause, Effect, Exit, Fiber, Ref, Schedule, Stream, String } from "effect";
|
|
3
|
+
// packages/remote/src/internal/runner/ProcessObservation.ts
|
|
4
|
+
/** Time allowed for a direct execution unit or launcher to exit after input EOF. */
|
|
5
|
+
const stdinExitTimeout = "1 second";
|
|
6
|
+
/** Readers outlive the failure monitor so forced termination still captures its diagnostic tail. */
|
|
7
|
+
const observe = Effect.fnUntraced(function* (child, options = {}) {
|
|
8
|
+
const failures = yield* make();
|
|
9
|
+
const tail = yield* Ref.make("");
|
|
10
|
+
const stdout = yield* (options.drainStdout === false ? Effect.void : Stream.runDrain(child.stdout)).pipe(Effect.forkScoped);
|
|
11
|
+
const stderr = yield* child.stderr.pipe(Stream.decodeText(), Stream.runForEach((text) => Ref.update(tail, (old) => String.takeRight(old + text, 8192))), Effect.forkScoped);
|
|
12
|
+
yield* failures.run(Fiber.join(stdout));
|
|
13
|
+
yield* failures.run(Fiber.join(stderr));
|
|
14
|
+
const exited = yield* Effect.gen(function* () {
|
|
15
|
+
const result = yield* Effect.exit(child.exitCode);
|
|
16
|
+
yield* child.isRunning.pipe(Effect.repeat({
|
|
17
|
+
schedule: Schedule.spaced("25 millis"),
|
|
18
|
+
while: (running) => running
|
|
19
|
+
}));
|
|
20
|
+
const err = yield* Fiber.await(stderr);
|
|
21
|
+
const out = yield* Fiber.await(stdout);
|
|
22
|
+
return {
|
|
23
|
+
code: Exit.isSuccess(result) ? result.value : null,
|
|
24
|
+
signal: null,
|
|
25
|
+
stderr: yield* Ref.get(tail),
|
|
26
|
+
cause: Array.reduce([
|
|
27
|
+
Exit.asVoid(result),
|
|
28
|
+
err,
|
|
29
|
+
out
|
|
30
|
+
], Cause.empty, (cause, exit) => Exit.isFailure(exit) ? Cause.combine(cause, exit.cause) : cause)
|
|
31
|
+
};
|
|
32
|
+
}).pipe(Effect.forkScoped);
|
|
33
|
+
return {
|
|
34
|
+
exited: Fiber.join(exited),
|
|
35
|
+
failure: failures.await
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
export { stdinExitTimeout as n, observe as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { n as close } from "./release-BY4Mlluy.js";
|
|
2
|
+
import { Context, Deferred, Effect, Exit, Option, Schema, Scope } from "effect";
|
|
3
|
+
// packages/remote/src/internal/ServeLifecycle.ts
|
|
4
|
+
var StartupError = class extends Schema.TaggedError()("RunnerStartupError", {
|
|
5
|
+
detail: Schema.String,
|
|
6
|
+
cause: Schema.optionalKey(Schema.Cause(Schema.Unknown, Schema.Defect()))
|
|
7
|
+
}) {
|
|
8
|
+
get message() {
|
|
9
|
+
return this.detail;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var ServeLifecycle = class extends Context.Service()("@graftland/plugin-remote/internal/ServeLifecycle") {};
|
|
13
|
+
const make = Effect.all({
|
|
14
|
+
ended: Deferred.make(),
|
|
15
|
+
released: Deferred.make()
|
|
16
|
+
});
|
|
17
|
+
/** Observe shutdown independently of the loader, which logs child cleanup failures. */
|
|
18
|
+
const resources = Effect.fnUntraced(function* (lifecycle) {
|
|
19
|
+
return yield* Effect.acquireRelease(Scope.make(), (scope, exit) => close(scope, exit).pipe(Effect.onExit((released) => Option.isNone(lifecycle) ? Effect.void : Deferred.done(lifecycle.value.released, Exit.isSuccess(released) ? Exit.void : Exit.fail(StartupError.make({
|
|
20
|
+
detail: "Supervisor shutdown failed",
|
|
21
|
+
cause: released.cause
|
|
22
|
+
}))).pipe(Effect.asVoid))));
|
|
23
|
+
});
|
|
24
|
+
export { resources as i, StartupError as n, make as r, ServeLifecycle as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TransportError } from "./Errors.js";
|
|
2
|
+
import { Channel } from "./Transport.js";
|
|
3
|
+
import { FrameError } from "./internal/runner/Framing.js";
|
|
4
|
+
import { Plugin } from "@graftland/graft";
|
|
5
|
+
import { Effect, Schema } from "effect";
|
|
6
|
+
declare const ConformanceError_base: Schema.Class<ConformanceError, Schema.TaggedStruct<"ConformanceError", {
|
|
7
|
+
readonly message: Schema.String;
|
|
8
|
+
}>, import("effect/Cause").YieldableError & {
|
|
9
|
+
readonly brand: unique symbol;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class ConformanceError extends ConformanceError_base {}
|
|
12
|
+
export interface Capabilities {
|
|
13
|
+
readonly connector: Plugin.Plugin;
|
|
14
|
+
readonly listener: Plugin.Plugin;
|
|
15
|
+
readonly credentials: Plugin.Plugin;
|
|
16
|
+
readonly authenticator: Plugin.Plugin;
|
|
17
|
+
}
|
|
18
|
+
/** The fixture supplies addresses/credentials and an echo session; no full runner is required. */
|
|
19
|
+
export declare const transport: <E, R>(plugins: Capabilities, fixture: (plugins: Capabilities) => Effect.Effect<Channel, E, R>) => {
|
|
20
|
+
chunks: Effect.Effect<void, E | ConformanceError | FrameError | TransportError, R | import("effect/Scope").Scope>;
|
|
21
|
+
eof: Effect.Effect<void, E | ConformanceError | TransportError, R>;
|
|
22
|
+
};
|
|
23
|
+
/** HTTP implementations reject before accepting a session, preserving the challenge. */
|
|
24
|
+
export declare const rejection: <E, R>(response: Effect.Effect<string, E, R>, challenge?: string) => Effect.Effect<string, E | ConformanceError, R>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=Testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Testing.d.ts","names":["Framing.FrameError","_$__Errors0.TransportError"],"sources":["../src/Testing.ts"],"mappings":";;;;;;;;WAgBmB;;qBAFN,yBAAyB;iBAMrB;WACP,WAAW,OAAO;WAClB,UAAU,OAAO;WACjB,aAAa,OAAO;WACpB,eAAe,OAAO;;;qBAGnB,YAAa,GAAG,GAAC,SACpB,cAAY,UACX,SAAS,iBAAiB,OAAO,OAAO,SAAS,GAAG;EAI7D,QAAM,OAAA,aAAA,IAAA,mBAAAA,aAAAC,gBAAA,2BAAA;EA0DN,KAAG,OAAA,aAAA,IAAA,mBAAAA,gBAAA;;;qBAaQ,YAAa,GAAG,GAAC,UACnB,OAAO,eAAe,GAAG,IAAE,uBACnB,OAAA,eAAA,IAAA,kBAAA"}
|
package/dist/Testing.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { decoder, encode } from "./internal/runner/Framing.js";
|
|
2
|
+
import { Array, Deferred, Effect, Equivalence, Fiber, Schema, Stream, String } from "effect";
|
|
3
|
+
// src/Testing.ts
|
|
4
|
+
var ConformanceError = class extends Schema.TaggedError()("ConformanceError", { message: Schema.String }) {};
|
|
5
|
+
const check = (condition, message) => condition ? Effect.void : Effect.fail(ConformanceError.make({ message }));
|
|
6
|
+
/** The fixture supplies addresses/credentials and an echo session; no full runner is required. */
|
|
7
|
+
const transport = (plugins, fixture) => {
|
|
8
|
+
const connect = fixture(plugins);
|
|
9
|
+
return {
|
|
10
|
+
chunks: Effect.gen(function* () {
|
|
11
|
+
const channel = yield* connect;
|
|
12
|
+
const first = yield* encode({
|
|
13
|
+
channel: 0,
|
|
14
|
+
payload: new Uint8Array([
|
|
15
|
+
1,
|
|
16
|
+
2,
|
|
17
|
+
3
|
|
18
|
+
])
|
|
19
|
+
});
|
|
20
|
+
const second = yield* encode({
|
|
21
|
+
channel: 1,
|
|
22
|
+
payload: new Uint8Array([4, 5])
|
|
23
|
+
});
|
|
24
|
+
const combined = new Uint8Array(first.length + second.length);
|
|
25
|
+
combined.set(first);
|
|
26
|
+
combined.set(second, first.length);
|
|
27
|
+
const done = yield* Deferred.make();
|
|
28
|
+
const sending = yield* Stream.make(combined.subarray(0, 2), combined.subarray(2)).pipe(Stream.concat(Stream.fromEffect(Deferred.await(done)).pipe(Stream.drain)), Stream.run(channel.output), Effect.forkScoped);
|
|
29
|
+
const frames = decoder();
|
|
30
|
+
const reply = yield* channel.input.pipe(Stream.mapEffect((chunk) => Effect.fromResult(frames.decode(chunk))), Stream.flattenIterable, Stream.zipWithIndex, Stream.tap(([, index]) => index === 1 ? Deferred.succeed(done, void 0) : Effect.void), Stream.map(([frame]) => frame), Stream.runCollect);
|
|
31
|
+
yield* frames.finish;
|
|
32
|
+
yield* Deferred.succeed(done, void 0);
|
|
33
|
+
yield* Fiber.join(sending);
|
|
34
|
+
yield* check(Array.makeEquivalence(Equivalence.Struct({
|
|
35
|
+
channel: Equivalence.Number,
|
|
36
|
+
payload: Array.makeEquivalence(Equivalence.Number)
|
|
37
|
+
}))(Array.map(reply, (frame) => ({
|
|
38
|
+
channel: frame.channel,
|
|
39
|
+
payload: Array.fromIterable(frame.payload)
|
|
40
|
+
})), [{
|
|
41
|
+
channel: 0,
|
|
42
|
+
payload: [
|
|
43
|
+
1,
|
|
44
|
+
2,
|
|
45
|
+
3
|
|
46
|
+
]
|
|
47
|
+
}, {
|
|
48
|
+
channel: 1,
|
|
49
|
+
payload: [4, 5]
|
|
50
|
+
}]), "The channel changed byte order across split or coalesced chunks");
|
|
51
|
+
}),
|
|
52
|
+
eof: Effect.gen(function* () {
|
|
53
|
+
const channel = yield* connect;
|
|
54
|
+
yield* Stream.empty.pipe(Stream.run(channel.output));
|
|
55
|
+
const remaining = yield* Stream.runCollect(channel.input);
|
|
56
|
+
yield* check(remaining.length === 0, "The channel produced bytes after EOF");
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/** HTTP implementations reject before accepting a session, preserving the challenge. */
|
|
61
|
+
const rejection = (response, challenge) => response.pipe(Effect.tap((response) => Effect.all([
|
|
62
|
+
check(String.includes("HTTP/1.1 401")(response), "Expected HTTP 401"),
|
|
63
|
+
check(!String.includes("101 Switching Protocols")(response), "Rejected credentials opened a WebSocket"),
|
|
64
|
+
check(!String.includes("sec-websocket-accept:")(String.toLowerCase(response)), "Rejected credentials received a WebSocket accept header"),
|
|
65
|
+
check(challenge === void 0 || String.includes("www-authenticate: " + String.toLowerCase(challenge))(String.toLowerCase(response)), "The authentication challenge was lost")
|
|
66
|
+
], { discard: true })));
|
|
67
|
+
export { ConformanceError, rejection, transport };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=Testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Testing.js","names":["Framing.encode","Framing.decoder"],"sources":["../src/Testing.ts"],"sourcesContent":["import type { Plugin } from \"@graftland/graft\"\nimport {\n\tArray,\n\tEquivalence,\n\tDeferred,\n\tEffect,\n\tFiber,\n\tStream,\n\tString,\n\tSchema,\n} from \"effect\"\nimport type { Channel } from \"./Transport\"\nimport * as Framing from \"./internal/runner/Framing\"\n\nexport class ConformanceError extends Schema.TaggedError<\n\tConformanceError,\n\t{ readonly brand: unique symbol }\n>()(\"ConformanceError\", { message: Schema.String }) {}\nconst check = (condition: boolean, message: string) =>\n\tcondition ? Effect.void : Effect.fail(ConformanceError.make({ message }))\nexport interface Capabilities {\n\treadonly connector: Plugin.Plugin\n\treadonly listener: Plugin.Plugin\n\treadonly credentials: Plugin.Plugin\n\treadonly authenticator: Plugin.Plugin\n}\n/** The fixture supplies addresses/credentials and an echo session; no full runner is required. */\nexport const transport = <E, R>(\n\tplugins: Capabilities,\n\tfixture: (plugins: Capabilities) => Effect.Effect<Channel, E, R>,\n) => {\n\tconst connect = fixture(plugins)\n\treturn {\n\t\tchunks: Effect.gen(function* () {\n\t\t\tconst channel = yield* connect\n\t\t\tconst first = yield* Framing.encode({\n\t\t\t\tchannel: 0,\n\t\t\t\tpayload: new Uint8Array([1, 2, 3]),\n\t\t\t})\n\t\t\tconst second = yield* Framing.encode({\n\t\t\t\tchannel: 1,\n\t\t\t\tpayload: new Uint8Array([4, 5]),\n\t\t\t})\n\t\t\tconst combined = new Uint8Array(first.length + second.length)\n\t\t\tcombined.set(first)\n\t\t\tcombined.set(second, first.length)\n\t\t\t// Split the header, then put the remainder and the next frame in one chunk.\n\t\t\tconst done = yield* Deferred.make<void>()\n\t\t\tconst sending = yield* Stream.make(\n\t\t\t\tcombined.subarray(0, 2),\n\t\t\t\tcombined.subarray(2),\n\t\t\t).pipe(\n\t\t\t\tStream.concat(\n\t\t\t\t\tStream.fromEffect(Deferred.await(done)).pipe(Stream.drain),\n\t\t\t\t),\n\t\t\t\tStream.run(channel.output),\n\t\t\t\tEffect.forkScoped,\n\t\t\t)\n\t\t\tconst frames = Framing.decoder()\n\t\t\tconst reply = yield* channel.input.pipe(\n\t\t\t\tStream.mapEffect((chunk) => Effect.fromResult(frames.decode(chunk))),\n\t\t\t\tStream.flattenIterable,\n\t\t\t\tStream.zipWithIndex,\n\t\t\t\tStream.tap(([, index]) =>\n\t\t\t\t\tindex === 1 ? Deferred.succeed(done, undefined) : Effect.void,\n\t\t\t\t),\n\t\t\t\tStream.map(([frame]) => frame),\n\t\t\t\tStream.runCollect,\n\t\t\t)\n\t\t\tyield* frames.finish\n\t\t\tyield* Deferred.succeed(done, undefined)\n\t\t\tyield* Fiber.join(sending)\n\t\t\tyield* check(\n\t\t\t\tArray.makeEquivalence(\n\t\t\t\t\tEquivalence.Struct({\n\t\t\t\t\t\tchannel: Equivalence.Number,\n\t\t\t\t\t\tpayload: Array.makeEquivalence(Equivalence.Number),\n\t\t\t\t\t}),\n\t\t\t\t)(\n\t\t\t\t\tArray.map(reply, (frame) => ({\n\t\t\t\t\t\tchannel: frame.channel,\n\t\t\t\t\t\tpayload: Array.fromIterable(frame.payload),\n\t\t\t\t\t})),\n\t\t\t\t\t[\n\t\t\t\t\t\t{ channel: 0, payload: [1, 2, 3] },\n\t\t\t\t\t\t{ channel: 1, payload: [4, 5] },\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t\t\"The channel changed byte order across split or coalesced chunks\",\n\t\t\t)\n\t\t}),\n\t\teof: Effect.gen(function* () {\n\t\t\tconst channel = yield* connect\n\t\t\tyield* Stream.empty.pipe(Stream.run(channel.output))\n\t\t\tconst remaining = yield* Stream.runCollect(channel.input)\n\t\t\tyield* check(\n\t\t\t\tremaining.length === 0,\n\t\t\t\t\"The channel produced bytes after EOF\",\n\t\t\t)\n\t\t}),\n\t}\n}\n\n/** HTTP implementations reject before accepting a session, preserving the challenge. */\nexport const rejection = <E, R>(\n\tresponse: Effect.Effect<string, E, R>,\n\tchallenge?: string,\n) =>\n\tresponse.pipe(\n\t\tEffect.tap((response) =>\n\t\t\tEffect.all(\n\t\t\t\t[\n\t\t\t\t\tcheck(String.includes(\"HTTP/1.1 401\")(response), \"Expected HTTP 401\"),\n\t\t\t\t\tcheck(\n\t\t\t\t\t\t!String.includes(\"101 Switching Protocols\")(response),\n\t\t\t\t\t\t\"Rejected credentials opened a WebSocket\",\n\t\t\t\t\t),\n\t\t\t\t\tcheck(\n\t\t\t\t\t\t!String.includes(\"sec-websocket-accept:\")(\n\t\t\t\t\t\t\tString.toLowerCase(response),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\"Rejected credentials received a WebSocket accept header\",\n\t\t\t\t\t),\n\t\t\t\t\tcheck(\n\t\t\t\t\t\tchallenge === undefined ||\n\t\t\t\t\t\t\tString.includes(\n\t\t\t\t\t\t\t\t\"www-authenticate: \" + String.toLowerCase(challenge),\n\t\t\t\t\t\t\t)(String.toLowerCase(response)),\n\t\t\t\t\t\t\"The authentication challenge was lost\",\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\t{ discard: true },\n\t\t\t),\n\t\t),\n\t)\n"],"mappings":";;;AAcA,IAAa,mBAAb,cAAsC,OAAO,YAG3C,CAAC,CAAC,oBAAoB,EAAE,SAAS,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,SAAS,WAAoB,YAClC,YAAY,OAAO,OAAO,OAAO,KAAK,iBAAiB,KAAK,EAAE,QAAQ,CAAC,CAAC;;AAQzE,MAAa,aACZ,SACA,YACI;CACJ,MAAM,UAAU,QAAQ,OAAO;CAC/B,OAAO;EACN,QAAQ,OAAO,IAAI,aAAa;GAC/B,MAAM,UAAU,OAAO;GACvB,MAAM,QAAQ,OAAOA,OAAe;IACnC,SAAS;IACT,SAAS,IAAI,WAAW;KAAC;KAAG;KAAG;IAAC,CAAC;GAClC,CAAC;GACD,MAAM,SAAS,OAAOA,OAAe;IACpC,SAAS;IACT,SAAS,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;GAC/B,CAAC;GACD,MAAM,WAAW,IAAI,WAAW,MAAM,SAAS,OAAO,MAAM;GAC5D,SAAS,IAAI,KAAK;GAClB,SAAS,IAAI,QAAQ,MAAM,MAAM;GAEjC,MAAM,OAAO,OAAO,SAAS,KAAW;GACxC,MAAM,UAAU,OAAO,OAAO,KAC7B,SAAS,SAAS,GAAG,CAAC,GACtB,SAAS,SAAS,CAAC,CACpB,CAAC,CAAC,KACD,OAAO,OACN,OAAO,WAAW,SAAS,MAAM,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,CAC1D,GACA,OAAO,IAAI,QAAQ,MAAM,GACzB,OAAO,UACR;GACA,MAAM,SAASC,QAAgB;GAC/B,MAAM,QAAQ,OAAO,QAAQ,MAAM,KAClC,OAAO,WAAW,UAAU,OAAO,WAAW,OAAO,OAAO,KAAK,CAAC,CAAC,GACnE,OAAO,iBACP,OAAO,cACP,OAAO,KAAK,GAAG,WACd,UAAU,IAAI,SAAS,QAAQ,MAAM,KAAA,CAAS,IAAI,OAAO,IAC1D,GACA,OAAO,KAAK,CAAC,WAAW,KAAK,GAC7B,OAAO,UACR;GACA,OAAO,OAAO;GACd,OAAO,SAAS,QAAQ,MAAM,KAAA,CAAS;GACvC,OAAO,MAAM,KAAK,OAAO;GACzB,OAAO,MACN,MAAM,gBACL,YAAY,OAAO;IAClB,SAAS,YAAY;IACrB,SAAS,MAAM,gBAAgB,YAAY,MAAM;GAClD,CAAC,CACF,CAAC,CACA,MAAM,IAAI,QAAQ,WAAW;IAC5B,SAAS,MAAM;IACf,SAAS,MAAM,aAAa,MAAM,OAAO;GAC1C,EAAE,GACF,CACC;IAAE,SAAS;IAAG,SAAS;KAAC;KAAG;KAAG;IAAC;GAAE,GACjC;IAAE,SAAS;IAAG,SAAS,CAAC,GAAG,CAAC;GAAE,CAC/B,CACD,GACA,iEACD;EACD,CAAC;EACD,KAAK,OAAO,IAAI,aAAa;GAC5B,MAAM,UAAU,OAAO;GACvB,OAAO,OAAO,MAAM,KAAK,OAAO,IAAI,QAAQ,MAAM,CAAC;GACnD,MAAM,YAAY,OAAO,OAAO,WAAW,QAAQ,KAAK;GACxD,OAAO,MACN,UAAU,WAAW,GACrB,sCACD;EACD,CAAC;CACF;AACD;;AAGA,MAAa,aACZ,UACA,cAEA,SAAS,KACR,OAAO,KAAK,aACX,OAAO,IACN;CACC,MAAM,OAAO,SAAS,cAAc,CAAC,CAAC,QAAQ,GAAG,mBAAmB;CACpE,MACC,CAAC,OAAO,SAAS,yBAAyB,CAAC,CAAC,QAAQ,GACpD,yCACD;CACA,MACC,CAAC,OAAO,SAAS,uBAAuB,CAAC,CACxC,OAAO,YAAY,QAAQ,CAC5B,GACA,yDACD;CACA,MACC,cAAc,KAAA,KACb,OAAO,SACN,uBAAuB,OAAO,YAAY,SAAS,CACpD,CAAC,CAAC,OAAO,YAAY,QAAQ,CAAC,GAC/B,uCACD;AACD,GACA,EAAE,SAAS,KAAK,CACjB,CACD,CACD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
// packages/remote/src/Transport.ts
|
|
3
|
+
/** Execution and byte-channel capabilities; implementations live in host plugins. */
|
|
4
|
+
var Connector = class extends Context.Service()("@graftland/plugin-remote/Transport/Connector") {};
|
|
5
|
+
var Listener = class extends Context.Service()("@graftland/plugin-remote/Transport/Listener") {};
|
|
6
|
+
export { Listener as n, Connector as t };
|