@processfocus/runtime 0.1.0-next.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.
Files changed (59) hide show
  1. package/LICENSE.md +28 -0
  2. package/README.md +18 -0
  3. package/dist/index.d.ts +14 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +14 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/artifact-inventory.d.ts +34 -0
  8. package/dist/lib/artifact-inventory.d.ts.map +1 -0
  9. package/dist/lib/artifact-inventory.js +96 -0
  10. package/dist/lib/artifact-inventory.js.map +1 -0
  11. package/dist/lib/artifact.d.ts +54 -0
  12. package/dist/lib/artifact.d.ts.map +1 -0
  13. package/dist/lib/artifact.js +90 -0
  14. package/dist/lib/artifact.js.map +1 -0
  15. package/dist/lib/deploy-artifact.d.ts +27 -0
  16. package/dist/lib/deploy-artifact.d.ts.map +1 -0
  17. package/dist/lib/deploy-artifact.js +56 -0
  18. package/dist/lib/deploy-artifact.js.map +1 -0
  19. package/dist/lib/document-store.d.ts +59 -0
  20. package/dist/lib/document-store.d.ts.map +1 -0
  21. package/dist/lib/document-store.js +13 -0
  22. package/dist/lib/document-store.js.map +1 -0
  23. package/dist/lib/executor-host.d.ts +58 -0
  24. package/dist/lib/executor-host.d.ts.map +1 -0
  25. package/dist/lib/executor-host.js +10 -0
  26. package/dist/lib/executor-host.js.map +1 -0
  27. package/dist/lib/file-resolution-host.d.ts +22 -0
  28. package/dist/lib/file-resolution-host.d.ts.map +1 -0
  29. package/dist/lib/file-resolution-host.js +8 -0
  30. package/dist/lib/file-resolution-host.js.map +1 -0
  31. package/dist/lib/job.d.ts +35 -0
  32. package/dist/lib/job.d.ts.map +1 -0
  33. package/dist/lib/job.js +75 -0
  34. package/dist/lib/job.js.map +1 -0
  35. package/dist/lib/notification.d.ts +59 -0
  36. package/dist/lib/notification.d.ts.map +1 -0
  37. package/dist/lib/notification.js +13 -0
  38. package/dist/lib/notification.js.map +1 -0
  39. package/dist/lib/organisation-deploy-manifest.d.ts +66 -0
  40. package/dist/lib/organisation-deploy-manifest.d.ts.map +1 -0
  41. package/dist/lib/organisation-deploy-manifest.js +239 -0
  42. package/dist/lib/organisation-deploy-manifest.js.map +1 -0
  43. package/dist/lib/queue.d.ts +113 -0
  44. package/dist/lib/queue.d.ts.map +1 -0
  45. package/dist/lib/queue.js +66 -0
  46. package/dist/lib/queue.js.map +1 -0
  47. package/dist/lib/runtime.d.ts +51 -0
  48. package/dist/lib/runtime.d.ts.map +1 -0
  49. package/dist/lib/runtime.js +30 -0
  50. package/dist/lib/runtime.js.map +1 -0
  51. package/dist/lib/server-plugin.d.ts +90 -0
  52. package/dist/lib/server-plugin.d.ts.map +1 -0
  53. package/dist/lib/server-plugin.js +142 -0
  54. package/dist/lib/server-plugin.js.map +1 -0
  55. package/dist/lib/walker-plugin.d.ts +23 -0
  56. package/dist/lib/walker-plugin.d.ts.map +1 -0
  57. package/dist/lib/walker-plugin.js +23 -0
  58. package/dist/lib/walker-plugin.js.map +1 -0
  59. package/package.json +35 -0
package/LICENSE.md ADDED
@@ -0,0 +1,28 @@
1
+ # O'Saasy License Agreement
2
+
3
+ Copyright © 2026, Xplain Technology Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ 1. The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+ 2. No licensee or downstream recipient may use the Software (including
16
+ any modified or derivative versions) to directly compete with the
17
+ original Licensor by offering it to third parties as a hosted,
18
+ managed, or Software-as-a-Service (SaaS) product or cloud service
19
+ where the primary value of the service is the functionality of the
20
+ Software itself.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @processfocus/runtime
2
+
3
+ Provider-neutral Process Focus runtime engine and contracts.
4
+
5
+ The package owns the queue contract, shared job dispatch and classification,
6
+ runtime artifact envelope parsing, and the composition operations used by local
7
+ and hosted adapters. Platform startup, storage mechanics, queue transports, and
8
+ deployment policy stay in their adapters.
9
+
10
+ ## Build
11
+
12
+ Run `bun scripts/nx-quiet.ts run @processfocus/runtime:build` from the workspace
13
+ root.
14
+
15
+ ## Test
16
+
17
+ Run `bun scripts/nx-quiet.ts run @processfocus/runtime:test` from the workspace
18
+ root.
@@ -0,0 +1,14 @@
1
+ export * from "./lib/artifact.js";
2
+ export * from "./lib/artifact-inventory.js";
3
+ export * from "./lib/deploy-artifact.js";
4
+ export * from "./lib/document-store.js";
5
+ export * from "./lib/executor-host.js";
6
+ export * from "./lib/file-resolution-host.js";
7
+ export * from "./lib/job.js";
8
+ export * from "./lib/notification.js";
9
+ export * from "./lib/organisation-deploy-manifest.js";
10
+ export * from "./lib/queue.js";
11
+ export * from "./lib/runtime.js";
12
+ export * from "./lib/server-plugin.js";
13
+ export * from "./lib/walker-plugin.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,uCAAuC,CAAA;AACrD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ export * from "./lib/artifact.js";
2
+ export * from "./lib/artifact-inventory.js";
3
+ export * from "./lib/deploy-artifact.js";
4
+ export * from "./lib/document-store.js";
5
+ export * from "./lib/executor-host.js";
6
+ export * from "./lib/file-resolution-host.js";
7
+ export * from "./lib/job.js";
8
+ export * from "./lib/notification.js";
9
+ export * from "./lib/organisation-deploy-manifest.js";
10
+ export * from "./lib/queue.js";
11
+ export * from "./lib/runtime.js";
12
+ export * from "./lib/server-plugin.js";
13
+ export * from "./lib/walker-plugin.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,uCAAuC,CAAA;AACrD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { Effect } from "effect";
2
+ import { type ArtifactProducer, UnsupportedArtifactVersionError } from "./artifact.js";
3
+ /**
4
+ * A versioned inventory of every artifact a build produces, with explicit
5
+ * format ownership, version, and checksum per entry. This is the machine-readable
6
+ * "organisation artifact metadata" a deploy pipeline validates against before
7
+ * trusting the rest of the bundle.
8
+ */
9
+ export declare const ARTIFACT_INVENTORY_FORMAT = "processfocus/artifact-inventory";
10
+ export declare const ARTIFACT_INVENTORY_VERSION = 1;
11
+ export declare const ARTIFACT_INVENTORY_FILENAME = "artifacts.json";
12
+ export interface ArtifactInventoryEntry {
13
+ readonly format: string;
14
+ readonly version: number;
15
+ readonly path: string;
16
+ readonly sha256: string;
17
+ }
18
+ export interface ArtifactInventory {
19
+ readonly format: typeof ARTIFACT_INVENTORY_FORMAT;
20
+ readonly version: typeof ARTIFACT_INVENTORY_VERSION;
21
+ readonly producer?: ArtifactProducer | undefined;
22
+ readonly entries: ReadonlyArray<ArtifactInventoryEntry>;
23
+ }
24
+ declare const ArtifactInventoryParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
25
+ readonly _tag: "ArtifactInventoryParseError";
26
+ } & Readonly<A>;
27
+ export declare class ArtifactInventoryParseError extends ArtifactInventoryParseError_base<{
28
+ readonly message: string;
29
+ readonly cause?: unknown;
30
+ }> {
31
+ }
32
+ export declare const parseArtifactInventory: (value: unknown) => Effect.Effect<ArtifactInventory, ArtifactInventoryParseError | UnsupportedArtifactVersionError>;
33
+ export {};
34
+ //# sourceMappingURL=artifact-inventory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-inventory.d.ts","sourceRoot":"","sources":["../../src/lib/artifact-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EACL,KAAK,gBAAgB,EAErB,+BAA+B,EAEhC,MAAM,eAAe,CAAA;AAEtB;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,oCAAoC,CAAA;AAC1E,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAC3C,eAAO,MAAM,2BAA2B,mBAAmB,CAAA;AAE3D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,yBAAyB,CAAA;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,0BAA0B,CAAA;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAA;CACxD;;;;AAED,qBAAa,2BAA4B,SAAQ,iCAE/C;IACA,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;CAAG;AA4CL,eAAO,MAAM,sBAAsB,UAC1B,OAAO,KACb,MAAM,CAAC,MAAM,CACd,iBAAiB,EACjB,2BAA2B,GAAG,+BAA+B,CA4D3D,CAAA"}
@@ -0,0 +1,96 @@
1
+ import { Data, Effect } from "effect";
2
+ import { UNSUPPORTED_ARTIFACT_UPGRADE_HINT, UnsupportedArtifactVersionError, parseArtifactProducer, } from "./artifact.js";
3
+ /**
4
+ * A versioned inventory of every artifact a build produces, with explicit
5
+ * format ownership, version, and checksum per entry. This is the machine-readable
6
+ * "organisation artifact metadata" a deploy pipeline validates against before
7
+ * trusting the rest of the bundle.
8
+ */
9
+ export const ARTIFACT_INVENTORY_FORMAT = "processfocus/artifact-inventory";
10
+ export const ARTIFACT_INVENTORY_VERSION = 1;
11
+ export const ARTIFACT_INVENTORY_FILENAME = "artifacts.json";
12
+ export class ArtifactInventoryParseError extends Data.TaggedError("ArtifactInventoryParseError") {
13
+ }
14
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
15
+ const isSha256Hex = (value) => typeof value === "string" && /^[0-9a-f]{64}$/.test(value);
16
+ const parseEntry = (value, path) => {
17
+ if (!isRecord(value)) {
18
+ throw new Error(`${path} must be an object`);
19
+ }
20
+ const format = value["format"];
21
+ if (typeof format !== "string" || format.length === 0) {
22
+ throw new Error(`${path}.format must be a non-empty string`);
23
+ }
24
+ const version = value["version"];
25
+ if (typeof version !== "number" ||
26
+ !Number.isInteger(version) ||
27
+ version < 0) {
28
+ throw new Error(`${path}.version must be a non-negative integer`);
29
+ }
30
+ const entryPath = value["path"];
31
+ if (typeof entryPath !== "string" || entryPath.length === 0) {
32
+ throw new Error(`${path}.path must be a non-empty string`);
33
+ }
34
+ if (!isSha256Hex(value["sha256"])) {
35
+ throw new Error(`${path}.sha256 must be a 64-character hex string`);
36
+ }
37
+ return {
38
+ format,
39
+ version,
40
+ path: entryPath,
41
+ sha256: value["sha256"],
42
+ };
43
+ };
44
+ export const parseArtifactInventory = (value) => Effect.gen(function* () {
45
+ if (!isRecord(value)) {
46
+ return yield* new ArtifactInventoryParseError({
47
+ message: "Artifact inventory must be an object",
48
+ });
49
+ }
50
+ const format = value["format"];
51
+ const version = value["version"];
52
+ if (format !== ARTIFACT_INVENTORY_FORMAT ||
53
+ version !== ARTIFACT_INVENTORY_VERSION) {
54
+ return yield* new UnsupportedArtifactVersionError({
55
+ message: `Unsupported artifact inventory ${JSON.stringify(format)}@${JSON.stringify(version)}; this runtime supports ${ARTIFACT_INVENTORY_FORMAT}@${ARTIFACT_INVENTORY_VERSION}.`,
56
+ detectedFormat: format,
57
+ detectedVersion: version,
58
+ supportedFormat: ARTIFACT_INVENTORY_FORMAT,
59
+ supportedVersion: ARTIFACT_INVENTORY_VERSION,
60
+ upgradeHint: UNSUPPORTED_ARTIFACT_UPGRADE_HINT,
61
+ });
62
+ }
63
+ const entriesValue = value["entries"];
64
+ if (!Array.isArray(entriesValue)) {
65
+ return yield* new ArtifactInventoryParseError({
66
+ message: "Artifact inventory entries must be an array",
67
+ });
68
+ }
69
+ let producer;
70
+ try {
71
+ producer = parseArtifactProducer(value["producer"]);
72
+ }
73
+ catch (error) {
74
+ return yield* new ArtifactInventoryParseError({
75
+ message: error instanceof Error ? error.message : String(error),
76
+ cause: error,
77
+ });
78
+ }
79
+ let entries;
80
+ try {
81
+ entries = entriesValue.map((entry, index) => parseEntry(entry, `entries[${index}]`));
82
+ }
83
+ catch (error) {
84
+ return yield* new ArtifactInventoryParseError({
85
+ message: error instanceof Error ? error.message : String(error),
86
+ cause: error,
87
+ });
88
+ }
89
+ return {
90
+ format: ARTIFACT_INVENTORY_FORMAT,
91
+ version: ARTIFACT_INVENTORY_VERSION,
92
+ ...(producer !== undefined ? { producer } : {}),
93
+ entries,
94
+ };
95
+ });
96
+ //# sourceMappingURL=artifact-inventory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-inventory.js","sourceRoot":"","sources":["../../src/lib/artifact-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAEL,iCAAiC,EACjC,+BAA+B,EAC/B,qBAAqB,GACtB,MAAM,eAAe,CAAA;AAEtB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,iCAAiC,CAAA;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAA;AAgB3D,MAAM,OAAO,2BAA4B,SAAQ,IAAI,CAAC,WAAW,CAC/D,6BAA6B,CAI7B;CAAG;AAEL,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,C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AO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,CAAC,IAAI,2BAA2B,CAAC;YAC5C,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC/D,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAiC,CAAA;IACrC,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAC1C,UAAU,CAAC,KAAK,EAAE,WAAW,KAAK,GAAG,CAAC,CACvC,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,CAAC,IAAI,2BAA2B,CAAC;YAC5C,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC/D,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,MAAM,EAAE,yBAAyB;QACjC,OAAO,EAAE,0BAA0B;QACnC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,OAAO;KACR,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { Effect } from "effect";
2
+ export declare const RUNTIME_ARTIFACT_FORMAT = "processfocus/runtime-artifact";
3
+ export declare const RUNTIME_ARTIFACT_VERSION = 1;
4
+ /**
5
+ * Identity of the producer that wrote an artifact. Version ownership lets a
6
+ * reader fail with actionable upgrade guidance rather than silently misreading
7
+ * a newer producer's shape.
8
+ */
9
+ export interface ArtifactProducer {
10
+ readonly name: string;
11
+ readonly version: string;
12
+ }
13
+ export interface RuntimeArtifactEnvelope {
14
+ readonly format: typeof RUNTIME_ARTIFACT_FORMAT;
15
+ readonly version: typeof RUNTIME_ARTIFACT_VERSION;
16
+ readonly organisation: unknown;
17
+ readonly producer?: ArtifactProducer | undefined;
18
+ readonly extensions: Readonly<Record<string, unknown>>;
19
+ }
20
+ declare const ArtifactParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
21
+ readonly _tag: "ArtifactParseError";
22
+ } & Readonly<A>;
23
+ export declare class ArtifactParseError extends ArtifactParseError_base<{
24
+ readonly message: string;
25
+ }> {
26
+ }
27
+ declare const UnsupportedArtifactVersionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
28
+ readonly _tag: "UnsupportedArtifactVersionError";
29
+ } & Readonly<A>;
30
+ /**
31
+ * Raised when an artifact declares a format or version this runtime does not
32
+ * implement. Carries the exact detected/supported values and an actionable
33
+ * upgrade hint so a reader can refuse -- before any mutation -- rather than
34
+ * guessing at a newer producer's shape.
35
+ */
36
+ export declare class UnsupportedArtifactVersionError extends UnsupportedArtifactVersionError_base<{
37
+ readonly message: string;
38
+ readonly detectedFormat: unknown;
39
+ readonly detectedVersion: unknown;
40
+ readonly supportedFormat: string;
41
+ readonly supportedVersion: number;
42
+ readonly upgradeHint: string;
43
+ }> {
44
+ }
45
+ export declare const UNSUPPORTED_ARTIFACT_UPGRADE_HINT = "Update @processfocus/runtime (or rebuild the organisation artifact with a newer producer) so their artifact format and version match.";
46
+ /**
47
+ * Parse an optional producer identity, throwing the shared producer error on a
48
+ * malformed value. Reused by the runtime-artifact, deploy-artifact envelope,
49
+ * and artifact-inventory parsers so the shape is defined in one place.
50
+ */
51
+ export declare const parseArtifactProducer: (value: unknown) => ArtifactProducer | undefined;
52
+ export declare const parseRuntimeArtifact: (value: unknown) => Effect.Effect<RuntimeArtifactEnvelope, ArtifactParseError | UnsupportedArtifactVersionError>;
53
+ export {};
54
+ //# sourceMappingURL=artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../src/lib/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAA;AAErC,eAAO,MAAM,uBAAuB,kCAAkC,CAAA;AACtE,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,uBAAuB,CAAA;IAC/C,QAAQ,CAAC,OAAO,EAAE,OAAO,wBAAwB,CAAA;IACjD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACvD;;;;AAED,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;;;;AAEL;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,qCAEnD;IACA,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B,CAAC;CAAG;AAEL,eAAO,MAAM,iCAAiC,0IAC2F,CAAA;AAUzI;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UACzB,OAAO,KACb,gBAAgB,GAAG,SAoBrB,CAAA;AAED,eAAO,MAAM,oBAAoB,UACxB,OAAO,KACb,MAAM,CAAC,MAAM,CACd,uBAAuB,EACvB,kBAAkB,GAAG,+BAA+B,CAuErD,CAAA"}
@@ -0,0 +1,90 @@
1
+ import { Data, Effect } from "effect";
2
+ export const RUNTIME_ARTIFACT_FORMAT = "processfocus/runtime-artifact";
3
+ export const RUNTIME_ARTIFACT_VERSION = 1;
4
+ export class ArtifactParseError extends Data.TaggedError("ArtifactParseError") {
5
+ }
6
+ /**
7
+ * Raised when an artifact declares a format or version this runtime does not
8
+ * implement. Carries the exact detected/supported values and an actionable
9
+ * upgrade hint so a reader can refuse -- before any mutation -- rather than
10
+ * guessing at a newer producer's shape.
11
+ */
12
+ export class UnsupportedArtifactVersionError extends Data.TaggedError("UnsupportedArtifactVersionError") {
13
+ }
14
+ export const UNSUPPORTED_ARTIFACT_UPGRADE_HINT = "Update @processfocus/runtime (or rebuild the organisation artifact with a newer producer) so their artifact format and version match.";
15
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
16
+ const isNamespacedExtension = (key) => /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?\/[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/.test(key);
17
+ /**
18
+ * Parse an optional producer identity, throwing the shared producer error on a
19
+ * malformed value. Reused by the runtime-artifact, deploy-artifact envelope,
20
+ * and artifact-inventory parsers so the shape is defined in one place.
21
+ */
22
+ export const parseArtifactProducer = (value) => {
23
+ if (value === undefined) {
24
+ return undefined;
25
+ }
26
+ if (!isRecord(value)) {
27
+ throw new Error("producer must be an object");
28
+ }
29
+ const name = value["name"];
30
+ if (typeof name !== "string" || name.length === 0) {
31
+ throw new Error("producer.name must be a non-empty string");
32
+ }
33
+ const version = value["version"];
34
+ if (typeof version !== "string" || version.length === 0) {
35
+ throw new Error("producer.version must be a non-empty string");
36
+ }
37
+ return { name, version };
38
+ };
39
+ export const parseRuntimeArtifact = (value) => {
40
+ if (!isRecord(value)) {
41
+ return Effect.fail(new ArtifactParseError({ message: "Runtime artifact must be an object" }));
42
+ }
43
+ const format = value["format"];
44
+ const version = value["version"];
45
+ if (format !== RUNTIME_ARTIFACT_FORMAT ||
46
+ version !== RUNTIME_ARTIFACT_VERSION) {
47
+ return Effect.fail(new UnsupportedArtifactVersionError({
48
+ message: `Unsupported runtime artifact format/version ${JSON.stringify(format)}@${JSON.stringify(version)}; this runtime supports ${RUNTIME_ARTIFACT_FORMAT}@${RUNTIME_ARTIFACT_VERSION}.`,
49
+ detectedFormat: format,
50
+ detectedVersion: version,
51
+ supportedFormat: RUNTIME_ARTIFACT_FORMAT,
52
+ supportedVersion: RUNTIME_ARTIFACT_VERSION,
53
+ upgradeHint: UNSUPPORTED_ARTIFACT_UPGRADE_HINT,
54
+ }));
55
+ }
56
+ if (!isRecord(value["organisation"])) {
57
+ return Effect.fail(new ArtifactParseError({
58
+ message: "Runtime artifact has no organisation",
59
+ }));
60
+ }
61
+ const extensions = value["extensions"];
62
+ if (extensions !== undefined && !isRecord(extensions)) {
63
+ return Effect.fail(new ArtifactParseError({
64
+ message: "Artifact extensions must be an object",
65
+ }));
66
+ }
67
+ if (extensions !== undefined &&
68
+ Object.keys(extensions).some((key) => !isNamespacedExtension(key))) {
69
+ return Effect.fail(new ArtifactParseError({
70
+ message: "Artifact extension keys must be namespaced",
71
+ }));
72
+ }
73
+ let producer;
74
+ try {
75
+ producer = parseArtifactProducer(value["producer"]);
76
+ }
77
+ catch (error) {
78
+ return Effect.fail(new ArtifactParseError({
79
+ message: error instanceof Error ? error.message : String(error),
80
+ }));
81
+ }
82
+ return Effect.succeed({
83
+ format: RUNTIME_ARTIFACT_FORMAT,
84
+ version: RUNTIME_ARTIFACT_VERSION,
85
+ organisation: value["organisation"],
86
+ ...(producer !== undefined ? { producer } : {}),
87
+ extensions: extensions ?? {},
88
+ });
89
+ };
90
+ //# sourceMappingURL=artifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/lib/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAErC,MAAM,CAAC,MAAM,uBAAuB,GAAG,+BAA+B,CAAA;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAoBzC,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAE3E;CAAG;AAEL;;;;;GAKG;AACH,MAAM,OAAO,+BAAgC,SAAQ,IAAI,CAAC,WAAW,CACnE,iCAAiC,CAQjC;CAAG;AAEL,MAAM,CAAC,MAAM,iCAAiC,GAC5C,uIAAuI,CAAA;AAEzI,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAEtE,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAW,EAAE,CACrD,wEAAwE,CAAC,IAAI,CAC3E,GAAG,CACJ,CAAA;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAAc,EACgB,EAAE;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC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C7B,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { Effect } from "effect";
2
+ import { type ArtifactProducer, UnsupportedArtifactVersionError } from "./artifact.js";
3
+ /**
4
+ * The deployment-upload envelope (`.pf-deploy.json`) that travels inside the
5
+ * deploy zip. It describes, in a provider-neutral way, where the built
6
+ * organisation bundle and its manifests live inside the artifact.
7
+ */
8
+ export declare const DEPLOY_ARTIFACT_FORMAT = "processfocus/deploy-artifact";
9
+ export declare const DEPLOY_ARTIFACT_VERSION = 1;
10
+ export declare const DEPLOY_ARTIFACT_FILENAME = ".pf-deploy.json";
11
+ export interface DeployArtifactEnvelope {
12
+ readonly format: typeof DEPLOY_ARTIFACT_FORMAT;
13
+ readonly version: typeof DEPLOY_ARTIFACT_VERSION;
14
+ readonly orgPath: string;
15
+ readonly producer?: ArtifactProducer | undefined;
16
+ }
17
+ declare const DeployArtifactParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
18
+ readonly _tag: "DeployArtifactParseError";
19
+ } & Readonly<A>;
20
+ export declare class DeployArtifactParseError extends DeployArtifactParseError_base<{
21
+ readonly message: string;
22
+ readonly cause?: unknown;
23
+ }> {
24
+ }
25
+ export declare const parseDeployArtifactEnvelope: (value: unknown) => Effect.Effect<DeployArtifactEnvelope, DeployArtifactParseError | UnsupportedArtifactVersionError>;
26
+ export {};
27
+ //# sourceMappingURL=deploy-artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-artifact.d.ts","sourceRoot":"","sources":["../../src/lib/deploy-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EACL,KAAK,gBAAgB,EAErB,+BAA+B,EAEhC,MAAM,eAAe,CAAA;AAEtB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AACpE,eAAO,MAAM,uBAAuB,IAAI,CAAA;AACxC,eAAO,MAAM,wBAAwB,oBAAoB,CAAA;AAEzD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,OAAO,sBAAsB,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,uBAAuB,CAAA;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;CACjD;;;;AAED,qBAAa,wBAAyB,SAAQ,8BAE5C;IACA,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;CAAG;AAKL,eAAO,MAAM,2BAA2B,UAC/B,OAAO,KACb,MAAM,CAAC,MAAM,CACd,sBAAsB,EACtB,wBAAwB,GAAG,+BAA+B,CAgDxD,CAAA"}
@@ -0,0 +1,56 @@
1
+ import { Data, Effect } from "effect";
2
+ import { UNSUPPORTED_ARTIFACT_UPGRADE_HINT, UnsupportedArtifactVersionError, parseArtifactProducer, } from "./artifact.js";
3
+ /**
4
+ * The deployment-upload envelope (`.pf-deploy.json`) that travels inside the
5
+ * deploy zip. It describes, in a provider-neutral way, where the built
6
+ * organisation bundle and its manifests live inside the artifact.
7
+ */
8
+ export const DEPLOY_ARTIFACT_FORMAT = "processfocus/deploy-artifact";
9
+ export const DEPLOY_ARTIFACT_VERSION = 1;
10
+ export const DEPLOY_ARTIFACT_FILENAME = ".pf-deploy.json";
11
+ export class DeployArtifactParseError extends Data.TaggedError("DeployArtifactParseError") {
12
+ }
13
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
14
+ export const parseDeployArtifactEnvelope = (value) => Effect.gen(function* () {
15
+ if (!isRecord(value)) {
16
+ return yield* new DeployArtifactParseError({
17
+ message: "Deploy artifact envelope must be an object",
18
+ });
19
+ }
20
+ const format = value["format"];
21
+ const version = value["version"];
22
+ if (format !== DEPLOY_ARTIFACT_FORMAT ||
23
+ version !== DEPLOY_ARTIFACT_VERSION) {
24
+ return yield* new UnsupportedArtifactVersionError({
25
+ message: `Unsupported deploy artifact envelope ${JSON.stringify(format)}@${JSON.stringify(version)}; this runtime supports ${DEPLOY_ARTIFACT_FORMAT}@${DEPLOY_ARTIFACT_VERSION}.`,
26
+ detectedFormat: format,
27
+ detectedVersion: version,
28
+ supportedFormat: DEPLOY_ARTIFACT_FORMAT,
29
+ supportedVersion: DEPLOY_ARTIFACT_VERSION,
30
+ upgradeHint: UNSUPPORTED_ARTIFACT_UPGRADE_HINT,
31
+ });
32
+ }
33
+ const orgPath = value["orgPath"];
34
+ if (typeof orgPath !== "string" || orgPath.length === 0) {
35
+ return yield* new DeployArtifactParseError({
36
+ message: "Deploy artifact envelope orgPath must be a non-empty string",
37
+ });
38
+ }
39
+ let producer;
40
+ try {
41
+ producer = parseArtifactProducer(value["producer"]);
42
+ }
43
+ catch (error) {
44
+ return yield* new DeployArtifactParseError({
45
+ message: error instanceof Error ? error.message : String(error),
46
+ cause: error,
47
+ });
48
+ }
49
+ return {
50
+ format: DEPLOY_ARTIFACT_FORMAT,
51
+ version: DEPLOY_ARTIFACT_VERSION,
52
+ orgPath,
53
+ ...(producer !== undefined ? { producer } : {}),
54
+ };
55
+ });
56
+ //# sourceMappingURL=deploy-artifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-artifact.js","sourceRoot":"","sources":["../../src/lib/deploy-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAEL,iCAAiC,EACjC,+BAA+B,EAC/B,qBAAqB,GACtB,MAAM,eAAe,CAAA;AAEtB;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,8BAA8B,CAAA;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC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CAAC;QACxD,OAAO,KAAK,CAAC,CAAC,IAAI,wBAAwB,CAAC;YACzC,OAAO,EAAE,6DAA6D;SACvE,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,QAAsC,CAAA;IAC1C,IAAI,CAAC;QACH,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,CAAC,IAAI,wBAAwB,CAAC;YACzC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC/D,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,MAAM,EAAE,sBAAsB;QAC9B,OAAO,EAAE,uBAAuB;QAChC,OAAO;QACP,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChD,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,59 @@
1
+ import { Context, type Effect, type Stream } from "effect";
2
+ declare const DocumentStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
+ readonly _tag: "DocumentStoreError";
4
+ } & Readonly<A>;
5
+ export declare class DocumentStoreError extends DocumentStoreError_base<{
6
+ readonly message: string;
7
+ readonly cause?: unknown;
8
+ }> {
9
+ }
10
+ declare const FileNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
11
+ readonly _tag: "FileNotFoundError";
12
+ } & Readonly<A>;
13
+ export declare class FileNotFoundError extends FileNotFoundError_base<{
14
+ readonly fileId: string;
15
+ }> {
16
+ }
17
+ declare const DocumentStoreService_base: Context.TagClass<DocumentStoreService, "processfocus:internal-tag/document-store-service/DocumentStoreService", {
18
+ readonly requestUploadUrl: (opts: {
19
+ readonly fileId: string;
20
+ readonly storePrefix: string;
21
+ readonly contentType?: string;
22
+ readonly filename?: string;
23
+ }) => Effect.Effect<{
24
+ fileId: string;
25
+ uploadUrl: string;
26
+ expiresAt: string;
27
+ }, DocumentStoreError>;
28
+ readonly requestDownloadUrl: (fileId: string, storePrefix: string, filename?: string) => Effect.Effect<{
29
+ downloadUrl: string;
30
+ expiresAt: string;
31
+ }, DocumentStoreError | FileNotFoundError>;
32
+ readonly storeFile: (opts: {
33
+ readonly fileId: string;
34
+ readonly storePrefix: string;
35
+ readonly content: Stream.Stream<Uint8Array, unknown, never>;
36
+ readonly contentType: string;
37
+ readonly filename?: string;
38
+ }) => Effect.Effect<{
39
+ fileId: string;
40
+ }, DocumentStoreError>;
41
+ readonly getFileContent: (fileId: string, storePrefix: string) => Effect.Effect<{
42
+ content: Uint8Array;
43
+ contentType: string;
44
+ }, DocumentStoreError | FileNotFoundError>;
45
+ readonly getFileMetadata: (fileId: string, storePrefix: string) => Effect.Effect<{
46
+ byteSize: number;
47
+ contentType: string;
48
+ }, DocumentStoreError | FileNotFoundError>;
49
+ readonly deleteFile: (fileId: string, storePrefix: string) => Effect.Effect<void, DocumentStoreError>;
50
+ }>;
51
+ /**
52
+ * Shared document-store contract used by official plugins.
53
+ * The identifier is stable so workspace implementations and published plugins
54
+ * resolve the same Effect service.
55
+ */
56
+ export declare class DocumentStoreService extends DocumentStoreService_base {
57
+ }
58
+ export {};
59
+ //# sourceMappingURL=document-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-store.d.ts","sourceRoot":"","sources":["../../src/lib/document-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CA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EAAE,kBAAkB,CAAC;6BAElC,CACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,KAChB,MAAM,CAAC,MAAM,CAChB;QAAE,OAAO,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAC5C,kBAAkB,GAAG,iBAAiB,CACvC;8BAEyB,CACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,KAChB,MAAM,CAAC,MAAM,CAChB;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EACzC,kBAAkB,GAAG,iBAAiB,CACvC;yBAEoB,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC;;AAxDhD;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,yBAqDvC;CAAG"}
@@ -0,0 +1,13 @@
1
+ import { Context, Data } from "effect";
2
+ export class DocumentStoreError extends Data.TaggedError("DocumentStoreError") {
3
+ }
4
+ export class FileNotFoundError extends Data.TaggedError("FileNotFoundError") {
5
+ }
6
+ /**
7
+ * Shared document-store contract used by official plugins.
8
+ * The identifier is stable so workspace implementations and published plugins
9
+ * resolve the same Effect service.
10
+ */
11
+ export class DocumentStoreService extends Context.Tag("processfocus:internal-tag/document-store-service/DocumentStoreService")() {
12
+ }
13
+ //# sourceMappingURL=document-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-store.js","sourceRoot":"","sources":["../../src/lib/document-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAA4B,MAAM,QAAQ,CAAA;AAEhE,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAG3E;CAAG;AAEL,MAAM,OAAO,iBAAkB,SAAQ,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAEzE;CAAG;AAEL;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CACnD,iDAAiD,CAClD,EAmDE;CAAG"}
@@ -0,0 +1,58 @@
1
+ import { Context, type Effect } from "effect";
2
+ /**
3
+ * Provider-neutral description of executable source supplied by an
4
+ * organisation-owned plugin.
5
+ */
6
+ export interface ExecutorSource {
7
+ readonly context: string;
8
+ readonly definition: string;
9
+ }
10
+ /**
11
+ * Organisation-declared executor behavior. Hosts interpret only extensions
12
+ * they own and otherwise treat the descriptor as opaque artifact data.
13
+ */
14
+ export interface ExecutorDescriptor {
15
+ readonly id: string;
16
+ readonly extensions: Readonly<Record<string, unknown>>;
17
+ }
18
+ /** Invocation passed from organisation code to a runtime executor adapter. */
19
+ export interface ExecutorInvocation {
20
+ readonly source: ExecutorSource;
21
+ readonly input: unknown;
22
+ readonly descriptor?: ExecutorDescriptor | undefined;
23
+ }
24
+ /** Runtime identifiers for the job that requested execution. */
25
+ export interface ExecutorJobContext {
26
+ readonly todoId: string;
27
+ readonly stepPath: string;
28
+ }
29
+ /**
30
+ * Result understood by the generic system-step engine without depending on
31
+ * an organisation plugin implementation.
32
+ */
33
+ export type ExecutorResult = {
34
+ readonly _tag: "Completed";
35
+ readonly output: Record<string, unknown>;
36
+ } | {
37
+ readonly _tag: "Deferred";
38
+ readonly stateUpdate?: Record<string, unknown>;
39
+ };
40
+ declare const ExecutorError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
41
+ readonly _tag: "ExecutorError";
42
+ } & Readonly<A>;
43
+ export declare class ExecutorError extends ExecutorError_base<{
44
+ readonly message: string;
45
+ readonly cause?: unknown;
46
+ }> {
47
+ }
48
+ declare const ExecutorHost_base: Context.TagClass<ExecutorHost, "@processfocus/runtime/ExecutorHost", {
49
+ readonly run: (invocation: ExecutorInvocation, jobContext: ExecutorJobContext) => Effect.Effect<ExecutorResult, ExecutorError>;
50
+ }>;
51
+ /**
52
+ * Host capability implemented by platform adapters such as local Docker or
53
+ * AWS CodeBuild. Organisation-owned plugins consume only this contract.
54
+ */
55
+ export declare class ExecutorHost extends ExecutorHost_base {
56
+ }
57
+ export {};
58
+ //# sourceMappingURL=executor-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor-host.d.ts","sourceRoot":"","sources":["../../src/lib/executor-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACvD;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAA;CACrD;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACxE;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,WAAW,C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