@smthrs/control 1.0.0-rc.3 → 1.0.0-rc.4
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/dist/cjs/ControlLive.d.ts.map +1 -1
- package/dist/cjs/ControlLive.js +21 -8
- package/dist/cjs/ControlLive.js.map +2 -2
- package/dist/cjs/ControlRuntime.d.ts.map +1 -1
- package/dist/cjs/ControlRuntime.js +64 -60
- package/dist/cjs/ControlRuntime.js.map +2 -2
- package/dist/cjs/SqlControlRuntime.d.ts.map +1 -1
- package/dist/cjs/SqlControlRuntime.js +3 -2
- package/dist/cjs/SqlControlRuntime.js.map +2 -2
- package/dist/esm/ControlLive.d.ts.map +1 -1
- package/dist/esm/ControlLive.js +5 -1
- package/dist/esm/ControlLive.js.map +1 -1
- package/dist/esm/ControlRuntime.d.ts.map +1 -1
- package/dist/esm/ControlRuntime.js +2 -1
- package/dist/esm/ControlRuntime.js.map +1 -1
- package/dist/esm/SqlControlRuntime.d.ts.map +1 -1
- package/dist/esm/SqlControlRuntime.js +2 -2
- package/dist/esm/SqlControlRuntime.js.map +1 -1
- package/docs/guides/postgres-tests.md +2 -0
- package/package.json +17 -17
- package/src/ControlLive.ts +22 -8
- package/src/ControlRuntime.ts +66 -62
- package/src/SqlControlRuntime.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlLive.d.ts","sourceRoot":"","sources":["../../src/ControlLive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAiC,KAAK,EAAqC,MAAM,QAAQ,CAAA;AAEhG,OAAO,EAEL,OAAO,EAOR,MAAM,cAAc,CAAA;AAoBrB,OAAO,EAAE,cAAc,EAAoE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"ControlLive.d.ts","sourceRoot":"","sources":["../../src/ControlLive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAiC,KAAK,EAAqC,MAAM,QAAQ,CAAA;AAEhG,OAAO,EAEL,OAAO,EAOR,MAAM,cAAc,CAAA;AAoBrB,OAAO,EAAE,cAAc,EAAoE,MAAM,qBAAqB,CAAA;AA6RtH;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAC7B,OAAO,EACP,KAAK,EACL,cAAc,GAAG,OAAO,CAAC,OAAO,GAAG,iBAAiB,CAAC,iBAAiB,GAAG,QAAQ,CAAC,QAAQ,CAwvD3F,CAAA"}
|
package/dist/cjs/ControlLive.js
CHANGED
|
@@ -99,7 +99,11 @@ const AttributedResumeInput = import_effect.Schema.Struct({
|
|
|
99
99
|
principal: import_effect.Schema.optional(import_ControlSchema.Principal)
|
|
100
100
|
});
|
|
101
101
|
const AttributedRunInput = import_effect.Schema.Union([
|
|
102
|
-
import_effect.Schema.Struct({
|
|
102
|
+
import_effect.Schema.Struct({
|
|
103
|
+
...import_ControlSchema.RunInputSchema.members[0].fields,
|
|
104
|
+
principal: import_effect.Schema.optional(import_ControlSchema.Principal),
|
|
105
|
+
reservedRunId: import_effect.Schema.optional(import_effect.Schema.NonEmptyString)
|
|
106
|
+
}),
|
|
103
107
|
import_effect.Schema.Struct({ ...import_ControlSchema.RunInputSchema.members[1].fields, principal: import_effect.Schema.optional(import_ControlSchema.Principal) })
|
|
104
108
|
]);
|
|
105
109
|
const AttributedSignalInput = import_effect.Schema.Struct({
|
|
@@ -512,12 +516,15 @@ const layer = import_effect.Layer.effect(
|
|
|
512
516
|
// A detached live host keeps its fence. Delegate the admitted event
|
|
513
517
|
// wake to it, just as a node decision does, instead of leaving an idle
|
|
514
518
|
// retained module with input it will never get a boundary to drain.
|
|
515
|
-
import_effect.Effect.catchTag(
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
import_effect.Effect.catchTag(
|
|
520
|
+
"/control/ClaimLost",
|
|
521
|
+
(refusal) => refusal.parkedBy === void 0 ? import_effect.Effect.void : import_effect.Effect.gen(function* () {
|
|
522
|
+
const delegated = yield* runtime.requestResume(run.runId).pipe(
|
|
523
|
+
import_effect.Effect.catchTag("/control/InvalidInput", () => import_effect.Effect.succeed(void 0))
|
|
524
|
+
);
|
|
525
|
+
if (delegated !== void 0) yield* emit(run.runId, "control.run.resumed", { runId: run.runId });
|
|
526
|
+
})
|
|
527
|
+
),
|
|
521
528
|
import_effect.Effect.catchTag("/control/RunNotFound", () => import_effect.Effect.void),
|
|
522
529
|
import_effect.Effect.catchTag(
|
|
523
530
|
"/control/CodeDrift",
|
|
@@ -1012,7 +1019,13 @@ const layer = import_effect.Layer.effect(
|
|
|
1012
1019
|
principal,
|
|
1013
1020
|
fingerprint("run", principal, input),
|
|
1014
1021
|
import_effect.Effect.gen(function* () {
|
|
1015
|
-
const launched = yield* runtime.launch(
|
|
1022
|
+
const launched = yield* runtime.launch(
|
|
1023
|
+
input.planId,
|
|
1024
|
+
input.digest,
|
|
1025
|
+
input.envelope,
|
|
1026
|
+
principal,
|
|
1027
|
+
input.reservedRunId
|
|
1028
|
+
);
|
|
1016
1029
|
if (launched._tag === "Parked") {
|
|
1017
1030
|
return { ...launched.receipt, receiptId: input.idempotencyKey };
|
|
1018
1031
|
}
|