@x12i/graphenix-execute-envelope 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,8 +26,8 @@ Optional package: engines and compilers do not need it; backend hosts and API ga
26
26
  Studio execute request (authoring + input)
27
27
  │ validateStudioExecuteRequest()
28
28
  │ buildRuntimeObject()
29
- compileExecutablePlan()
30
- validateExecutablePlan()
29
+ compileExecutablePlanV2()
30
+ validateExecutablePlanV2()
31
31
 
32
32
  { plan, runtime } → engine
33
33
 
@@ -51,21 +51,36 @@ npm install @x12i/graphenix-execute-envelope
51
51
 
52
52
  ### Studio execute request (shape)
53
53
 
54
+ Use `createContentPipelineReferenceGraph()` for real node ids — not an empty `"graph": {}` placeholder.
55
+
54
56
  ```json
55
57
  {
56
- "authoringGraph": { "id": "graph:content-pipeline", "formatVersion": "2.0.0", "graph": {} },
57
- "input": {
58
- "brief": "Launch campaign for eco-friendly water bottles",
59
- "priority": "normal"
58
+ "mode": "graph",
59
+ "jobId": "job-001",
60
+ "graph": {
61
+ "id": "graph:content-pipeline",
62
+ "formatVersion": "2.0.0",
63
+ "graph": {
64
+ "id": "graph:content-pipeline",
65
+ "nodes": [
66
+ { "id": "node:audience-insights", "type": "task" },
67
+ { "id": "node:competitor-angles", "type": "task" },
68
+ { "id": "node:seo-keywords", "type": "task" },
69
+ { "id": "node:content-package", "type": "finalizer" }
70
+ ]
71
+ }
60
72
  },
61
- "options": {
62
- "jobId": "job-001",
63
- "mode": "live",
64
- "environment": "prod"
73
+ "runtime": {
74
+ "input": {
75
+ "brief": "Launch campaign for eco-friendly water bottles",
76
+ "priority": "normal"
77
+ }
65
78
  }
66
79
  }
67
80
  ```
68
81
 
82
+ Full authoring JSON: `packages/authoring-format/fixtures/graph-content-pipeline.authoring.json`.
83
+
69
84
  Credentials stay on the request boundary — never copied into `GraphRuntimeObject`.
70
85
 
71
86
  ### Runtime object (compile input)
@@ -109,10 +124,20 @@ Embedded normalized graph in the plan has **no** `node.layout` — stripped at c
109
124
  ## Example (API)
110
125
 
111
126
  ```ts
127
+ import { createContentPipelineReferenceGraph } from "@x12i/graphenix-authoring-format";
112
128
  import { buildGraphExecutionRequestFromStudioExecute } from "@x12i/graphenix-execute-envelope";
113
129
 
114
- const { plan, runtime } = buildGraphExecutionRequestFromStudioExecute(request);
115
- // forward to engine engine never sees the raw Studio request
130
+ const authoring = createContentPipelineReferenceGraph();
131
+ const { plan, runtime } = buildGraphExecutionRequestFromStudioExecute(
132
+ {
133
+ mode: "graph",
134
+ jobId: "job-001",
135
+ graph: authoring,
136
+ runtime: { input: { priority: "normal" } }
137
+ },
138
+ { profileRegistry: { version: "3.2.0", registryHash: "sha256:profiles-cp" } }
139
+ );
140
+ // forward { plan, runtime } to engine
116
141
  ```
117
142
 
118
143
  ### Lower-level building blocks
@@ -123,15 +148,17 @@ import {
123
148
  buildRuntimeObject,
124
149
  validateRuntimeObject
125
150
  } from "@x12i/graphenix-execute-envelope";
126
- import { compileExecutablePlan } from "@x12i/graphenix-plan-compiler";
127
- import { validateExecutablePlan } from "@x12i/graphenix-plan-format";
151
+ import { compileExecutablePlanV2 } from "@x12i/graphenix-plan-compiler";
152
+ import { validateExecutablePlanV2 } from "@x12i/graphenix-plan-format";
128
153
 
129
154
  validateStudioExecuteRequest(request);
130
155
  const runtime = buildRuntimeObject(request.input, request.options);
131
156
  validateRuntimeObject(runtime);
132
157
 
133
- const plan = compileExecutablePlan(request.authoringGraph, runtime);
134
- validateExecutablePlan(plan);
158
+ const plan = compileExecutablePlanV2(request.authoringGraph, runtime, {
159
+ profileRegistry: { version: "3.2.0", registryHash: "sha256:profiles-host" }
160
+ });
161
+ validateExecutablePlanV2(plan);
135
162
  ```
136
163
 
137
164
  ---
@@ -158,10 +185,10 @@ validateExecutablePlan(plan);
158
185
 
159
186
  ## Dependencies
160
187
 
161
- - `@x12i/graphenix-authoring-format` ^1.0.0
162
- - `@x12i/graphenix-plan-compiler` ^1.0.0
163
- - `@x12i/graphenix-plan-format` ^1.0.0
164
- - `@x12i/graphenix-executable-contracts` ^1.0.0
188
+ - `@x12i/graphenix-authoring-format` ^1.0.2
189
+ - `@x12i/graphenix-plan-compiler` ^1.1.0
190
+ - `@x12i/graphenix-plan-format` ^1.1.0
191
+ - `@x12i/graphenix-executable-contracts` ^1.1.0
165
192
 
166
193
  ---
167
194
 
@@ -1,6 +1,7 @@
1
- import type { GraphExecutionRequest, StudioGraphExecuteRequest } from "@x12i/graphenix-executable-contracts";
1
+ import type { CompileExecutablePlanV2Options, GraphExecutionRequest, StudioGraphExecuteRequest } from "@x12i/graphenix-executable-contracts";
2
2
  export declare function buildGraphExecutionRequestFromStudioExecute(request: StudioGraphExecuteRequest, options?: {
3
3
  agentId?: string;
4
4
  jobTypeId?: string;
5
+ profileRegistry?: CompileExecutablePlanV2Options["profileRegistry"];
5
6
  }): GraphExecutionRequest;
6
7
  //# sourceMappingURL=build-graph-execution-request-from-studio-execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-graph-execution-request-from-studio-execute.d.ts","sourceRoot":"","sources":["../../src/adapter/build-graph-execution-request-from-studio-execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAM9C,wBAAgB,2CAA2C,CACzD,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,qBAAqB,CAyCvB"}
1
+ {"version":3,"file":"build-graph-execution-request-from-studio-execute.d.ts","sourceRoot":"","sources":["../../src/adapter/build-graph-execution-request-from-studio-execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAM9C,wBAAgB,2CAA2C,CACzD,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,8BAA8B,CAAC,iBAAiB,CAAC,CAAC;CAChE,GACL,qBAAqB,CA8CvB"}
@@ -1,7 +1,7 @@
1
1
  import { validateStudioExecuteRequest } from "../validators/validate-studio-execute-request.js";
2
2
  import { buildRuntimeObject } from "../validators/validate-runtime-object.js";
3
- import { compileExecutablePlan } from "@x12i/graphenix-plan-compiler";
4
- import { validateExecutablePlan } from "@x12i/graphenix-plan-format";
3
+ import { compileExecutablePlanV2 } from "@x12i/graphenix-plan-compiler";
4
+ import { validateExecutablePlanV2 } from "@x12i/graphenix-plan-format";
5
5
  export function buildGraphExecutionRequestFromStudioExecute(request, options = {}) {
6
6
  const validation = validateStudioExecuteRequest(request);
7
7
  if (!validation.valid) {
@@ -22,8 +22,13 @@ export function buildGraphExecutionRequestFromStudioExecute(request, options = {
22
22
  variables: request.runtime?.variables,
23
23
  job: request.runtime?.job
24
24
  }, options);
25
- const plan = compileExecutablePlan(request.graph, runtime);
26
- const planValidation = validateExecutablePlan(plan);
25
+ const plan = compileExecutablePlanV2(request.graph, runtime, {
26
+ profileRegistry: options.profileRegistry ?? {
27
+ version: "3.2.0",
28
+ registryHash: "sha256:profiles-execute-envelope"
29
+ }
30
+ });
31
+ const planValidation = validateExecutablePlanV2(plan);
27
32
  if (!planValidation.valid) {
28
33
  const summary = planValidation.errors
29
34
  .map((error) => `${error.path}: ${error.message}`)
@@ -1 +1 @@
1
- {"version":3,"file":"build-graph-execution-request-from-studio-execute.js","sourceRoot":"","sources":["../../src/adapter/build-graph-execution-request-from-studio-execute.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MA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,cAAc,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM;aAClC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aACjD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"build-graph-execution-request-from-studio-execute.js","sourceRoot":"","sources":["../../src/adapter/build-graph-execution-request-from-studio-execute.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,UAAU,2CAA2C,CACzD,OAAkC,EAClC,UAII,EAAE;IAEN,MAAM,UAAU,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM;aAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aACjD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,CAChC;QACE,KAAK,EAAE,OAAO,CAAC,KAAK;QACp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content-pipeline-envelope.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-pipeline-envelope.test.d.ts","sourceRoot":"","sources":["../../src/test/content-pipeline-envelope.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import { createContentPipelineReferenceGraph } from "@x12i/graphenix-authoring-format";
4
+ import { buildGraphExecutionRequestFromStudioExecute } from "../adapter/build-graph-execution-request-from-studio-execute.js";
5
+ import { EXECUTABLE_PLAN_FORMAT_V2 } from "@x12i/graphenix-executable-contracts";
6
+ const PROFILE_REGISTRY = {
7
+ version: "3.2.0",
8
+ registryHash: "sha256:profiles-cp-envelope"
9
+ };
10
+ describe("execute-envelope content pipeline", () => {
11
+ it("buildGraphExecutionRequestFromStudioExecute compiles CP graph to v2 plan", () => {
12
+ const authoring = createContentPipelineReferenceGraph();
13
+ const { plan, runtime } = buildGraphExecutionRequestFromStudioExecute({
14
+ mode: "graph",
15
+ jobId: "job-cp-envelope",
16
+ graph: authoring,
17
+ runtime: { input: { priority: "normal" } }
18
+ }, { profileRegistry: PROFILE_REGISTRY });
19
+ assert.equal(plan.format, EXECUTABLE_PLAN_FORMAT_V2);
20
+ assert.equal(plan.source.graphId, "graph:content-pipeline");
21
+ assert.equal(runtime.jobId, "job-cp-envelope");
22
+ assert.ok(plan.nodePlans["node:audience-insights"]);
23
+ assert.equal(runtime.input?.priority, "normal");
24
+ });
25
+ });
26
+ //# sourceMappingURL=content-pipeline-envelope.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-pipeline-envelope.test.js","sourceRoot":"","sources":["../../src/test/content-pipeline-envelope.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,2CAA2C,EAAE,MAAM,iEAAiE,CAAC;AAC9H,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,MAAM,gBAAgB,GAAG;IACvB,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,6BAA6B;CAC5C,CAAC;AAEF,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,MAAM,SAAS,GAAG,mCAAmC,EAAE,CAAC;QACxD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,2CAA2C,CACnE;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,iBAAiB;YACxB,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;SAC3C,EACD,EAAE,eAAe,EAAE,gBAAgB,EAAE,CACtC,CAAC;QAEF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;QACrD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;QAC5D,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QAC/C,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/graphenix-execute-envelope",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Execute request envelope: runtime building and graph execution request adaptation.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,7 +15,8 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "tsc -p tsconfig.json",
18
- "clean": "rimraf dist"
18
+ "clean": "rimraf dist",
19
+ "test": "npm run build && node --test dist/test/*.test.js"
19
20
  },
20
21
  "files": [
21
22
  "dist",
@@ -41,10 +42,10 @@
41
42
  "registry": "https://registry.npmjs.org/"
42
43
  },
43
44
  "dependencies": {
44
- "@x12i/graphenix-authoring-format": "^1.0.0",
45
- "@x12i/graphenix-executable-contracts": "^1.0.0",
46
- "@x12i/graphenix-plan-compiler": "^1.0.0",
47
- "@x12i/graphenix-plan-format": "^1.0.0"
45
+ "@x12i/graphenix-authoring-format": "^1.2.1",
46
+ "@x12i/graphenix-executable-contracts": "^1.1.0",
47
+ "@x12i/graphenix-plan-compiler": "^1.1.1",
48
+ "@x12i/graphenix-plan-format": "^1.1.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@types/node": "^22.10.1",