@x12i/graphenix-plan-compiler 1.0.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 (66) hide show
  1. package/README.md +192 -0
  2. package/dist/compile/build-deferred-gates.d.ts +8 -0
  3. package/dist/compile/build-deferred-gates.d.ts.map +1 -0
  4. package/dist/compile/build-deferred-gates.js +95 -0
  5. package/dist/compile/build-deferred-gates.js.map +1 -0
  6. package/dist/compile/build-finalizer-plans.d.ts +7 -0
  7. package/dist/compile/build-finalizer-plans.d.ts.map +1 -0
  8. package/dist/compile/build-finalizer-plans.js +54 -0
  9. package/dist/compile/build-finalizer-plans.js.map +1 -0
  10. package/dist/compile/build-node-execution-units-v2.d.ts +6 -0
  11. package/dist/compile/build-node-execution-units-v2.d.ts.map +1 -0
  12. package/dist/compile/build-node-execution-units-v2.js +172 -0
  13. package/dist/compile/build-node-execution-units-v2.js.map +1 -0
  14. package/dist/compile/build-node-execution-units.d.ts +6 -0
  15. package/dist/compile/build-node-execution-units.d.ts.map +1 -0
  16. package/dist/compile/build-node-execution-units.js +112 -0
  17. package/dist/compile/build-node-execution-units.js.map +1 -0
  18. package/dist/compile/build-node-invoke-contract.d.ts +5 -0
  19. package/dist/compile/build-node-invoke-contract.d.ts.map +1 -0
  20. package/dist/compile/build-node-invoke-contract.js +123 -0
  21. package/dist/compile/build-node-invoke-contract.js.map +1 -0
  22. package/dist/compile/build-plan-topology.d.ts +8 -0
  23. package/dist/compile/build-plan-topology.d.ts.map +1 -0
  24. package/dist/compile/build-plan-topology.js +84 -0
  25. package/dist/compile/build-plan-topology.js.map +1 -0
  26. package/dist/compile/compile-executable-plan-v2.d.ts +5 -0
  27. package/dist/compile/compile-executable-plan-v2.d.ts.map +1 -0
  28. package/dist/compile/compile-executable-plan-v2.js +251 -0
  29. package/dist/compile/compile-executable-plan-v2.js.map +1 -0
  30. package/dist/compile/compile-executable-plan.d.ts +5 -0
  31. package/dist/compile/compile-executable-plan.d.ts.map +1 -0
  32. package/dist/compile/compile-executable-plan.js +139 -0
  33. package/dist/compile/compile-executable-plan.js.map +1 -0
  34. package/dist/compile/phase-utility-strategy.d.ts +6 -0
  35. package/dist/compile/phase-utility-strategy.d.ts.map +1 -0
  36. package/dist/compile/phase-utility-strategy.js +22 -0
  37. package/dist/compile/phase-utility-strategy.js.map +1 -0
  38. package/dist/explain/explain-node-inheritance.d.ts +3 -0
  39. package/dist/explain/explain-node-inheritance.d.ts.map +1 -0
  40. package/dist/explain/explain-node-inheritance.js +38 -0
  41. package/dist/explain/explain-node-inheritance.js.map +1 -0
  42. package/dist/index.d.ts +15 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +15 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/resolution/build-deterministic-case-context.d.ts +9 -0
  47. package/dist/resolution/build-deterministic-case-context.d.ts.map +1 -0
  48. package/dist/resolution/build-deterministic-case-context.js +23 -0
  49. package/dist/resolution/build-deterministic-case-context.js.map +1 -0
  50. package/dist/resolution/resolve-graph-model-config.d.ts +12 -0
  51. package/dist/resolution/resolve-graph-model-config.d.ts.map +1 -0
  52. package/dist/resolution/resolve-graph-model-config.js +24 -0
  53. package/dist/resolution/resolve-graph-model-config.js.map +1 -0
  54. package/dist/resolution/resolve-node-ai-plan.d.ts +7 -0
  55. package/dist/resolution/resolve-node-ai-plan.d.ts.map +1 -0
  56. package/dist/resolution/resolve-node-ai-plan.js +60 -0
  57. package/dist/resolution/resolve-node-ai-plan.js.map +1 -0
  58. package/dist/resolution/resolve-node-model-config.d.ts +15 -0
  59. package/dist/resolution/resolve-node-model-config.d.ts.map +1 -0
  60. package/dist/resolution/resolve-node-model-config.js +33 -0
  61. package/dist/resolution/resolve-node-model-config.js.map +1 -0
  62. package/dist/resolution/resolve-node-model-slot.d.ts +7 -0
  63. package/dist/resolution/resolve-node-model-slot.d.ts.map +1 -0
  64. package/dist/resolution/resolve-node-model-slot.js +62 -0
  65. package/dist/resolution/resolve-node-model-slot.js.map +1 -0
  66. package/package.json +58 -0
@@ -0,0 +1,5 @@
1
+ import type { AuthoringGraphDocument } from "@x12i/graphenix-executable-contracts";
2
+ import type { CompileExecutablePlanOptions, ExecutableGraphPlan } from "@x12i/graphenix-executable-contracts";
3
+ import type { GraphRuntimeObject } from "@x12i/graphenix-executable-contracts";
4
+ export declare function compileExecutablePlan(doc: AuthoringGraphDocument, runtime: GraphRuntimeObject, options?: CompileExecutablePlanOptions): ExecutableGraphPlan;
5
+ //# sourceMappingURL=compile-executable-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-executable-plan.d.ts","sourceRoot":"","sources":["../../src/compile/compile-executable-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,KAAK,EACV,4BAA4B,EAC5B,mBAAmB,EAIpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAkG/E,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE,4BAAiC,GACzC,mBAAmB,CAgFrB"}
@@ -0,0 +1,139 @@
1
+ import { validateAuthoringExecutableGraph } from "@x12i/graphenix-authoring-format";
2
+ import { assertNormalizedExecutableGraph } from "@x12i/graphenix-authoring-format";
3
+ import { normalizeExecutableGraph, stripDesignOnlyFieldsFromGraph } from "@x12i/graphenix-authoring-format";
4
+ import { buildDeterministicCaseContext } from "../resolution/build-deterministic-case-context.js";
5
+ import { resolveGraphModelConfig } from "../resolution/resolve-graph-model-config.js";
6
+ import { resolveNodeAiPlan } from "../resolution/resolve-node-ai-plan.js";
7
+ import { buildNodeExecutionUnits } from "./build-node-execution-units.js";
8
+ import { getExecutableProfile, getTaskNodeConfig, isExecutableTaskNode } from "@x12i/graphenix-executable-contracts";
9
+ import { defaultHashFunction } from "@x12i/graphenix-executable-contracts";
10
+ import { EXECUTABLE_PLAN_FORMAT } from "@x12i/graphenix-executable-contracts";
11
+ const AI_MODEL_SLOTS = [
12
+ "preActionModel",
13
+ "skillModel",
14
+ "postActionModel"
15
+ ];
16
+ function buildPlanId(graphId, jobId) {
17
+ const graphSlug = graphId.replace(/^graph:/, "");
18
+ return `plan:${graphSlug}:${jobId}`;
19
+ }
20
+ function toSelectedCase(caseId, matchedConditions) {
21
+ if (matchedConditions.length === 0) {
22
+ return {
23
+ caseId,
24
+ matched: true,
25
+ reason: "default case"
26
+ };
27
+ }
28
+ return {
29
+ caseId,
30
+ matched: true,
31
+ reason: matchedConditions.join("; ")
32
+ };
33
+ }
34
+ function toResolvedNodePlan(doc, nodeId, context) {
35
+ const node = doc.graph.nodes.find((n) => n.id === nodeId);
36
+ if (!node || !isExecutableTaskNode(node)) {
37
+ throw new Error(`Node ${nodeId} is not an executable task node.`);
38
+ }
39
+ const params = getTaskNodeConfig(node);
40
+ if (!params) {
41
+ throw new Error(`Node ${nodeId} is missing task parameters.`);
42
+ }
43
+ const aiPlan = resolveNodeAiPlan(doc, nodeId, context);
44
+ const profile = getExecutableProfile(doc);
45
+ const fallbackPolicy = profile?.modelConfig.fallbackPolicy ?? {
46
+ enabled: false,
47
+ allowedTriggers: []
48
+ };
49
+ const modelSlots = {};
50
+ for (const slot of AI_MODEL_SLOTS) {
51
+ const resolved = aiPlan.slots[slot];
52
+ modelSlots[slot] = {
53
+ selection: resolved.selected,
54
+ source: resolved.source,
55
+ inherited: resolved.inherited,
56
+ graphCaseId: aiPlan.graphCaseId,
57
+ nodeCaseId: aiPlan.nodeCaseId
58
+ };
59
+ }
60
+ return {
61
+ nodeId,
62
+ nodeType: "task",
63
+ skillKey: params.skillKey,
64
+ selectedCases: {
65
+ graphCaseId: aiPlan.graphCaseId,
66
+ nodeCaseId: aiPlan.nodeCaseId
67
+ },
68
+ modelSlots,
69
+ executionUnits: buildNodeExecutionUnits(nodeId, params, modelSlots),
70
+ fallbackPolicy
71
+ };
72
+ }
73
+ export function compileExecutablePlan(doc, runtime, options = {}) {
74
+ const validation = validateAuthoringExecutableGraph(doc);
75
+ if (!validation.valid) {
76
+ const summary = validation.errors
77
+ .map((error) => `${error.path}: ${error.message}`)
78
+ .join("; ");
79
+ throw new Error(`Invalid authoring graph: ${summary}`);
80
+ }
81
+ const hash = options.hash ?? defaultHashFunction;
82
+ const now = options.now ?? (() => new Date());
83
+ const normalized = stripDesignOnlyFieldsFromGraph(normalizeExecutableGraph(doc));
84
+ assertNormalizedExecutableGraph(normalized);
85
+ const context = buildDeterministicCaseContext(normalized, runtime);
86
+ const graphHash = hash(doc);
87
+ const contextHash = hash(context);
88
+ const inputHash = runtime.input !== undefined ? hash(runtime.input) : undefined;
89
+ const profileRegistry = options.profileRegistry ?? {
90
+ version: "3.0.0"
91
+ };
92
+ const taskNodes = normalized.graph.nodes.filter(isExecutableTaskNode);
93
+ const nodePlans = {};
94
+ const nodeCaseSelection = {};
95
+ const graphResolution = resolveGraphModelConfig(normalized, context);
96
+ const graphCaseSelection = toSelectedCase(graphResolution.caseId, graphResolution.selection.matchedConditions);
97
+ for (const node of taskNodes) {
98
+ const aiPlan = resolveNodeAiPlan(normalized, node.id, context);
99
+ nodeCaseSelection[node.id] = aiPlan.nodeCaseId
100
+ ? toSelectedCase(aiPlan.nodeCaseId, aiPlan.caseSelection.node?.matchedConditions ?? [])
101
+ : null;
102
+ nodePlans[node.id] = toResolvedNodePlan(normalized, node.id, context);
103
+ }
104
+ const metadata = doc.graph.metadata;
105
+ return {
106
+ format: EXECUTABLE_PLAN_FORMAT,
107
+ planId: buildPlanId(doc.id, runtime.jobId),
108
+ createdAt: now().toISOString(),
109
+ source: {
110
+ graphId: doc.id,
111
+ graphRevision: doc.revision,
112
+ graphHash,
113
+ formatVersion: doc.formatVersion
114
+ },
115
+ profileRegistry: {
116
+ package: "@x12i/ai-profiles",
117
+ version: profileRegistry.version,
118
+ registryHash: profileRegistry.registryHash
119
+ },
120
+ runtimeBinding: {
121
+ jobId: runtime.jobId,
122
+ mode: runtime.mode,
123
+ environment: options.environment,
124
+ inputHash,
125
+ contextHash
126
+ },
127
+ graph: normalized,
128
+ caseSelection: {
129
+ graph: graphCaseSelection,
130
+ nodes: nodeCaseSelection
131
+ },
132
+ nodePlans,
133
+ contracts: {
134
+ entry: metadata?.graphEntry,
135
+ response: metadata?.graphResponse
136
+ }
137
+ };
138
+ }
139
+ //# sourceMappingURL=compile-executable-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-executable-plan.js","sourceRoot":"","sources":["../../src/compile/compile-executable-plan.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,MAAM,cAAc,GAAkB;IACpC,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;CAClB,CAAC;AAEF,SAAS,WAAW,CAAC,OAAe,EAAE,KAAa;IACjD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACjD,OAAO,QAAQ,SAAS,IAAI,KAAK,EAAE,C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C,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC;IAEpC,OAAO;QACL,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC;QAC1C,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;QAC9B,MAAM,EAAE;YACN,OAAO,EAAE,GAAG,CAAC,EAAE;YACf,aAAa,EAAE,GAAG,CAAC,QAAQ;YAC3B,SAAS;YACT,aAAa,EAAE,GAAG,CAAC,aAAa;SACjC;QACD,eAAe,EAAE;YACf,OAAO,EAAE,mBAAmB;YAC5B,OAAO,EAAE,eAAe,CAAC,OAAO;YAChC,YAAY,EAAE,eAAe,CAAC,YAAY;SAC3C;QACD,cAAc,EAAE;YACd,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS;YACT,WAAW;SACZ;QACD,KAAK,EAAE,UAAU;QACjB,aAAa,EAAE;YACb,KAAK,EAAE,kBAAkB;YACzB,KAAK,EAAE,iBAAiB;SACzB;QACD,SAAS;QACT,SAAS,EAAE;YACT,KAAK,EAAE,QAAQ,EAAE,UAAU;YAC3B,QAAQ,EAAE,QAAQ,EAAE,aAAa;SAClC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { AuthoringActionConfig } from "@x12i/graphenix-executable-contracts";
2
+ /** Read PRE/POST phase utility strategy key from legacy `aiTaskStrategies`. */
3
+ export declare function readPhaseUtilityStrategyKey(aiTaskStrategies: unknown, phase: "pre" | "post"): string | undefined;
4
+ /** Expand design strategy keys only when explicit plan-phase action lists are absent. */
5
+ export declare function shouldExpandPhaseUtilityStrategy(actions: AuthoringActionConfig[] | undefined): boolean;
6
+ //# sourceMappingURL=phase-utility-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-utility-strategy.d.ts","sourceRoot":"","sources":["../../src/compile/phase-utility-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAMlF,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,gBAAgB,EAAE,OAAO,EACzB,KAAK,EAAE,KAAK,GAAG,MAAM,GACpB,MAAM,GAAG,SAAS,CAepB;AAED,yFAAyF;AACzF,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,qBAAqB,EAAE,GAAG,SAAS,GAC3C,OAAO,CAET"}
@@ -0,0 +1,22 @@
1
+ function isRecord(value) {
2
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3
+ }
4
+ /** Read PRE/POST phase utility strategy key from legacy `aiTaskStrategies`. */
5
+ export function readPhaseUtilityStrategyKey(aiTaskStrategies, phase) {
6
+ if (!isRecord(aiTaskStrategies)) {
7
+ return undefined;
8
+ }
9
+ const value = aiTaskStrategies[phase];
10
+ if (typeof value === "string" && value.trim().length > 0) {
11
+ return value;
12
+ }
13
+ if (isRecord(value) && typeof value.strategyKey === "string") {
14
+ return value.strategyKey;
15
+ }
16
+ return undefined;
17
+ }
18
+ /** Expand design strategy keys only when explicit plan-phase action lists are absent. */
19
+ export function shouldExpandPhaseUtilityStrategy(actions) {
20
+ return (actions ?? []).length === 0;
21
+ }
22
+ //# sourceMappingURL=phase-utility-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-utility-strategy.js","sourceRoot":"","sources":["../../src/compile/phase-utility-strategy.ts"],"names":[],"mappings":"AAEA,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,2BAA2B,CACzC,gBAAyB,EACzB,KAAqB;IAErB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC,WAAW,CAAC;IAC3B,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,gCAAgC,CAC9C,OAA4C;IAE5C,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ResolvedNodeAiPlan } from "@x12i/graphenix-executable-contracts";
2
+ export declare function explainNodeInheritance(plan: ResolvedNodeAiPlan): string;
3
+ //# sourceMappingURL=explain-node-inheritance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explain-node-inheritance.d.ts","sourceRoot":"","sources":["../../src/explain/explain-node-inheritance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAiDvE"}
@@ -0,0 +1,38 @@
1
+ import { formatAiModelSelectionLabel } from "@x12i/graphenix-authoring-format";
2
+ export function explainNodeInheritance(plan) {
3
+ const lines = [];
4
+ lines.push(`Graph case selected: ${plan.caseSelection.graph.selectedCaseId}`);
5
+ if (plan.caseSelection.graph.matchedConditions.length > 0) {
6
+ lines.push(`Graph case reason: ${plan.caseSelection.graph.matchedConditions.join(", ")}`);
7
+ }
8
+ if (plan.caseSelection.node) {
9
+ lines.push(`Node case selected: ${plan.caseSelection.node.selectedCaseId}`);
10
+ if (plan.caseSelection.node.matchedConditions.length > 0) {
11
+ lines.push(`Node case reason: ${plan.caseSelection.node.matchedConditions.join(", ")}`);
12
+ }
13
+ }
14
+ lines.push(`Node: ${plan.nodeId}`);
15
+ for (const slot of [
16
+ "preActionModel",
17
+ "skillModel",
18
+ "postActionModel"
19
+ ]) {
20
+ const resolved = plan.slots[slot];
21
+ const label = formatAiModelSelectionLabel(resolved.selected);
22
+ if (resolved.fallback?.attempted) {
23
+ lines.push(`${slot}: fallback to graph case ${plan.graphCaseId} (${label}, trigger=${resolved.fallback.trigger})`);
24
+ continue;
25
+ }
26
+ if (resolved.inherited) {
27
+ lines.push(`${slot}: source=graph case ${plan.graphCaseId}, key=${label}, inherited=true`);
28
+ }
29
+ else {
30
+ const source = plan.nodeCaseId
31
+ ? `node case ${plan.nodeCaseId}`
32
+ : "node override";
33
+ lines.push(`${slot}: source=${source}, key=${label}, inherited=false`);
34
+ }
35
+ }
36
+ return lines.join("\n");
37
+ }
38
+ //# sourceMappingURL=explain-node-inheritance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explain-node-inheritance.js","sourceRoot":"","sources":["../../src/explain/explain-node-inheritance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,MAAM,UAAU,sBAAsB,CAAC,IAAwB;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,K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,GAAG,IAAI,CAAC,UAAU;gBAC5B,CAAC,CAAC,aAAa,IAAI,CAAC,UAAU,EAAE;gBAChC,CAAC,CAAC,eAAe,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,YAAY,MAAM,SAAS,KAAK,mBAAmB,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { compileExecutablePlan } from "./compile/compile-executable-plan.js";
2
+ export { compileExecutablePlanV2 } from "./compile/compile-executable-plan-v2.js";
3
+ export { buildNodeExecutionUnits } from "./compile/build-node-execution-units.js";
4
+ export { buildNodeExecutionUnitsV2 } from "./compile/build-node-execution-units-v2.js";
5
+ export { buildPlanTopology } from "./compile/build-plan-topology.js";
6
+ export { buildDeferredGates } from "./compile/build-deferred-gates.js";
7
+ export { buildNodeInvokeContract } from "./compile/build-node-invoke-contract.js";
8
+ export { buildFinalizerPlans } from "./compile/build-finalizer-plans.js";
9
+ export { resolveGraphModelConfig, selectGraphModelCase } from "./resolution/resolve-graph-model-config.js";
10
+ export { resolveNodeModelConfig, selectNodeModelCase } from "./resolution/resolve-node-model-config.js";
11
+ export { resolveNodeModelSlot } from "./resolution/resolve-node-model-slot.js";
12
+ export { resolveNodeAiPlan, resolveAllNodeAiPlans } from "./resolution/resolve-node-ai-plan.js";
13
+ export { buildDeterministicCaseContext } from "./resolution/build-deterministic-case-context.js";
14
+ export { explainNodeInheritance } from "./explain/explain-node-inheritance.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ export { compileExecutablePlan } from "./compile/compile-executable-plan.js";
2
+ export { compileExecutablePlanV2 } from "./compile/compile-executable-plan-v2.js";
3
+ export { buildNodeExecutionUnits } from "./compile/build-node-execution-units.js";
4
+ export { buildNodeExecutionUnitsV2 } from "./compile/build-node-execution-units-v2.js";
5
+ export { buildPlanTopology } from "./compile/build-plan-topology.js";
6
+ export { buildDeferredGates } from "./compile/build-deferred-gates.js";
7
+ export { buildNodeInvokeContract } from "./compile/build-node-invoke-contract.js";
8
+ export { buildFinalizerPlans } from "./compile/build-finalizer-plans.js";
9
+ export { resolveGraphModelConfig, selectGraphModelCase } from "./resolution/resolve-graph-model-config.js";
10
+ export { resolveNodeModelConfig, selectNodeModelCase } from "./resolution/resolve-node-model-config.js";
11
+ export { resolveNodeModelSlot } from "./resolution/resolve-node-model-slot.js";
12
+ export { resolveNodeAiPlan, resolveAllNodeAiPlans } from "./resolution/resolve-node-ai-plan.js";
13
+ export { buildDeterministicCaseContext } from "./resolution/build-deterministic-case-context.js";
14
+ export { explainNodeInheritance } from "./explain/explain-node-inheritance.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DeterministicCaseContext } from "@x12i/graphenix-executable-contracts";
2
+ import type { ExecutableGraphDocument } from "@x12i/graphenix-executable-contracts";
3
+ import type { GraphRuntimeObject } from "@x12i/graphenix-executable-contracts";
4
+ export declare function buildDeterministicCaseContext(doc: ExecutableGraphDocument, runtime?: Partial<GraphRuntimeObject> & {
5
+ environment?: DeterministicCaseContext["runtime"]["environment"];
6
+ flags?: Record<string, unknown>;
7
+ context?: Record<string, unknown>;
8
+ }): DeterministicCaseContext;
9
+ //# sourceMappingURL=build-deterministic-case-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-deterministic-case-context.d.ts","sourceRoot":"","sources":["../../src/resolution/build-deterministic-case-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,uBAAuB,EAC5B,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG;IACtC,WAAW,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,GACA,wBAAwB,CAqB1B"}
@@ -0,0 +1,23 @@
1
+ export function buildDeterministicCaseContext(doc, runtime) {
2
+ return {
3
+ runtime: {
4
+ mode: runtime?.mode,
5
+ environment: runtime?.environment,
6
+ job: runtime?.job
7
+ ? {
8
+ agentId: runtime.job.agentId,
9
+ jobTypeId: runtime.job.jobTypeId
10
+ }
11
+ : undefined,
12
+ input: runtime?.input,
13
+ variables: runtime?.variables,
14
+ flags: runtime?.flags,
15
+ context: runtime?.context
16
+ },
17
+ graph: {
18
+ id: doc.id,
19
+ revision: doc.revision
20
+ }
21
+ };
22
+ }
23
+ //# sourceMappingURL=build-deterministic-case-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-deterministic-case-context.js","sourceRoot":"","sources":["../../src/resolution/build-deterministic-case-context.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,6BAA6B,CAC3C,GAA4B,EAC5B,OAIC;IAED,OAAO;QACL,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,EAAE,IAAI;YACnB,WAAW,EAAE,OAAO,EAAE,WAAW;YACjC,GAAG,EAAE,OAAO,EAAE,GAAG;gBACf,CAAC,CAAC;oBACE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;oBAC5B,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;iBACjC;gBACH,CAAC,CAAC,SAAS;YACb,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,OAAO,EAAE,OAAO,EAAE,OAAO;SAC1B;QACD,KAAK,EAAE;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ExecutableGraphDocument } from "@x12i/graphenix-executable-contracts";
2
+ import type { GraphModelConfig, RequiredAiModelTriplet } from "@x12i/graphenix-executable-contracts";
3
+ import type { DeterministicCaseContext, SelectedGraphModelCase } from "@x12i/graphenix-executable-contracts";
4
+ import { selectGraphModelCase } from "@x12i/graphenix-case-format";
5
+ export declare function resolveGraphModelConfig(doc: ExecutableGraphDocument, context?: DeterministicCaseContext): {
6
+ caseId: string;
7
+ triplet: RequiredAiModelTriplet;
8
+ modelConfig: GraphModelConfig;
9
+ selection: SelectedGraphModelCase;
10
+ };
11
+ export { selectGraphModelCase };
12
+ //# sourceMappingURL=resolve-graph-model-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-graph-model-config.d.ts","sourceRoot":"","sources":["../../src/resolution/resolve-graph-model-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,uBAAuB,EAC5B,OAAO,CAAC,EAAE,wBAAwB,GACjC;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,sBAAsB,CAAC;IAChC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,SAAS,EAAE,sBAAsB,CAAC;CACnC,CAoBA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { getExecutableProfile } from "@x12i/graphenix-executable-contracts";
2
+ import { validateGraphModelConfig } from "@x12i/graphenix-authoring-format";
3
+ import { selectGraphModelCase } from "@x12i/graphenix-case-format";
4
+ import { buildDeterministicCaseContext } from "./build-deterministic-case-context.js";
5
+ export function resolveGraphModelConfig(doc, context) {
6
+ const profile = getExecutableProfile(doc);
7
+ if (!profile?.modelConfig) {
8
+ throw new Error("Executable graph is missing graph modelConfig.");
9
+ }
10
+ const validationErrors = validateGraphModelConfig(profile.modelConfig);
11
+ if (validationErrors.length > 0) {
12
+ throw new Error(validationErrors[0]?.message ?? "Invalid graph modelConfig.");
13
+ }
14
+ const resolvedContext = context ?? buildDeterministicCaseContext(doc);
15
+ const selection = selectGraphModelCase(profile.modelConfig, resolvedContext);
16
+ return {
17
+ caseId: selection.caseId,
18
+ triplet: selection.triplet,
19
+ modelConfig: profile.modelConfig,
20
+ selection
21
+ };
22
+ }
23
+ export { selectGraphModelCase };
24
+ //# sourceMappingURL=resolve-graph-model-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-graph-model-config.js","sourceRoot":"","sources":["../../src/resolution/resolve-graph-model-config.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAEtF,MAAM,UAAU,uBAAuB,CACrC,GAA4B,EAC5B,OAAkC;IAOlC,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACvE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,4BAA4B,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,IAAI,6BAA6B,CAAC,GAAG,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAE7E,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS;KACV,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ExecutableGraphDocument } from "@x12i/graphenix-executable-contracts";
2
+ import type { ResolvedNodeAiPlan } from "@x12i/graphenix-executable-contracts";
3
+ import type { AiModelSlot } from "@x12i/graphenix-executable-contracts";
4
+ import type { DeterministicCaseContext } from "@x12i/graphenix-executable-contracts";
5
+ export declare function resolveNodeAiPlan(doc: ExecutableGraphDocument, nodeId: string, context?: DeterministicCaseContext, availabilityBySlot?: Partial<Record<AiModelSlot, import("@x12i/graphenix-executable-contracts").AiModelAvailabilityResult>>): ResolvedNodeAiPlan;
6
+ export declare function resolveAllNodeAiPlans(doc: ExecutableGraphDocument, context?: DeterministicCaseContext): ResolvedNodeAiPlan[];
7
+ //# sourceMappingURL=resolve-node-ai-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-node-ai-plan.d.ts","sourceRoot":"","sources":["../../src/resolution/resolve-node-ai-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAQrF,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,uBAAuB,EAC5B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,wBAAwB,EAClC,kBAAkB,CAAC,EAAE,OAAO,CAC1B,MAAM,CAAC,WAAW,EAAE,OAAO,sCAAsC,EAAE,yBAAyB,CAAC,CAC9F,GACA,kBAAkB,CAqDpB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,uBAAuB,EAC5B,OAAO,CAAC,EAAE,wBAAwB,GACjC,kBAAkB,EAAE,CAItB"}
@@ -0,0 +1,60 @@
1
+ import { isExecutableTaskNode } from "@x12i/graphenix-executable-contracts";
2
+ import { resolveGraphModelConfig } from "./resolve-graph-model-config.js";
3
+ import { resolveNodeModelConfig } from "./resolve-node-model-config.js";
4
+ import { resolveNodeModelSlot } from "./resolve-node-model-slot.js";
5
+ import { getExecutableProfile } from "@x12i/graphenix-executable-contracts";
6
+ import { buildDeterministicCaseContext } from "./build-deterministic-case-context.js";
7
+ export function resolveNodeAiPlan(doc, nodeId, context, availabilityBySlot) {
8
+ const node = doc.graph.nodes.find((n) => n.id === nodeId);
9
+ if (!node || !isExecutableTaskNode(node)) {
10
+ throw new Error(`Node ${nodeId} is not an executable task node.`);
11
+ }
12
+ const resolvedContext = context ?? buildDeterministicCaseContext(doc);
13
+ const profile = getExecutableProfile(doc);
14
+ const fallbackPolicy = profile?.modelConfig.fallbackPolicy ?? {
15
+ enabled: false,
16
+ allowedTriggers: []
17
+ };
18
+ const { caseId: graphCaseId, selection: graphSelection } = resolveGraphModelConfig(doc, resolvedContext);
19
+ const nodeResolution = resolveNodeModelConfig(doc, node, resolvedContext);
20
+ const slots = ["preActionModel", "skillModel", "postActionModel"];
21
+ const resolvedSlots = {};
22
+ for (const slot of slots) {
23
+ resolvedSlots[slot] = resolveNodeModelSlot({
24
+ slot,
25
+ graphSelection: graphSelection.triplet[slot],
26
+ nodeSelection: nodeResolution.partial[slot],
27
+ fallbackPolicy,
28
+ availabilityResult: availabilityBySlot?.[slot],
29
+ graphCaseId,
30
+ nodeCaseId: nodeResolution.nodeCaseId,
31
+ nodeId
32
+ });
33
+ }
34
+ return {
35
+ graphId: doc.id,
36
+ graphRevision: doc.revision,
37
+ nodeId,
38
+ graphCaseId,
39
+ nodeCaseId: nodeResolution.nodeCaseId,
40
+ slots: resolvedSlots,
41
+ caseSelection: {
42
+ graph: {
43
+ selectedCaseId: graphCaseId,
44
+ matchedConditions: graphSelection.matchedConditions
45
+ },
46
+ node: nodeResolution.nodeCaseId
47
+ ? {
48
+ selectedCaseId: nodeResolution.nodeCaseId,
49
+ matchedConditions: nodeResolution.nodeMatchedConditions
50
+ }
51
+ : undefined
52
+ }
53
+ };
54
+ }
55
+ export function resolveAllNodeAiPlans(doc, context) {
56
+ return doc.graph.nodes
57
+ .filter(isExecutableTaskNode)
58
+ .map((node) => resolveNodeAiPlan(doc, node.id, context));
59
+ }
60
+ //# sourceMapping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,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { PartialAiModelTriplet, RequiredAiModelTriplet } from "@x12i/graphenix-executable-contracts";
2
+ import type { ExecutableGraphDocument } from "@x12i/graphenix-executable-contracts";
3
+ import type { Node } from "@x12i/graphenix-core";
4
+ import type { DeterministicCaseContext } from "@x12i/graphenix-executable-contracts";
5
+ import { selectNodeModelCase } from "@x12i/graphenix-case-format";
6
+ export declare function resolveNodeModelConfig(doc: ExecutableGraphDocument, node: Node, context?: DeterministicCaseContext): {
7
+ inherit: boolean;
8
+ nodeCaseId?: string;
9
+ partial: PartialAiModelTriplet;
10
+ resolved: RequiredAiModelTriplet;
11
+ graphCaseId: string;
12
+ nodeMatchedConditions: string[];
13
+ };
14
+ export { selectNodeModelCase };
15
+ //# sourceMappingURL=resolve-node-model-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-node-model-config.d.ts","sourceRoot":"","sources":["../../src/resolution/resolve-node-model-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,uBAAuB,EAC5B,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,wBAAwB,GACjC;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAoCA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { getTaskNodeConfig } from "@x12i/graphenix-executable-contracts";
2
+ import { mergeTriplets } from "@x12i/graphenix-authoring-format";
3
+ import { resolveGraphModelConfig } from "./resolve-graph-model-config.js";
4
+ import { selectNodeModelCase } from "@x12i/graphenix-case-format";
5
+ export function resolveNodeModelConfig(doc, node, context) {
6
+ const { caseId: graphCaseId, triplet: graphTriplet } = resolveGraphModelConfig(doc, context);
7
+ const taskConfig = getTaskNodeConfig(node);
8
+ const nodeModelConfig = taskConfig?.taskConfiguration?.modelConfig;
9
+ const inherit = nodeModelConfig?.inherit !== false;
10
+ const resolvedContext = context ?? {
11
+ runtime: {},
12
+ graph: { id: doc.id, revision: doc.revision }
13
+ };
14
+ const nodeCase = selectNodeModelCase(nodeModelConfig, resolvedContext);
15
+ const partial = nodeCase?.partial ??
16
+ nodeModelConfig?.cases?.find((c) => c.id === "default")?.modelConfig ??
17
+ nodeModelConfig?.modelConfig ??
18
+ {};
19
+ const resolved = mergeTriplets(graphTriplet, partial, inherit);
20
+ if (!resolved) {
21
+ throw new Error(`Node ${node.id} could not resolve model inheritance.`);
22
+ }
23
+ return {
24
+ inherit,
25
+ nodeCaseId: nodeCase?.caseId,
26
+ partial,
27
+ resolved,
28
+ graphCaseId,
29
+ nodeMatchedConditions: nodeCase?.matchedConditions ?? []
30
+ };
31
+ }
32
+ export { selectNodeModelCase };
33
+ //# sourceMappingURL=resolve-node-model-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-node-model-config.js","sourceRoot":"","sources":["../../src/resolution/resolve-node-model-config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,C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C;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ResolvedAiModelSlot, ResolveNodeModelSlotArgs } from "@x12i/graphenix-executable-contracts";
2
+ export declare function resolveNodeModelSlot(args: ResolveNodeModelSlotArgs & {
3
+ graphCaseId: string;
4
+ nodeCaseId?: string;
5
+ nodeId: string;
6
+ }): ResolvedAiModelSlot;
7
+ //# sourceMappingURL=resolve-node-model-slot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-node-model-slot.d.ts","sourceRoot":"","sources":["../../src/resolution/resolve-node-model-slot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAS9C,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,wBAAwB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GACA,mBAAmB,CA6ErB"}
@@ -0,0 +1,62 @@
1
+ import { EXECUTABLE_PROFILE_PATH } from "@x12i/graphenix-executable-contracts";
2
+ const DEFAULT_SLOTS = [
3
+ "preActionModel",
4
+ "skillModel",
5
+ "postActionModel"
6
+ ];
7
+ export function resolveNodeModelSlot(args) {
8
+ const { slot, graphSelection, nodeSelection, fallbackPolicy, availabilityResult, graphCaseId, nodeCaseId, nodeId } = args;
9
+ const graphPath = `${EXECUTABLE_PROFILE_PATH}/modelConfig`;
10
+ const nodePath = `/graph/nodes/${nodeId}/parameters/taskConfiguration/modelConfig/modelConfig/${slot}`;
11
+ const provenance = {
12
+ graphPath,
13
+ nodePath: nodeSelection ? nodePath : undefined,
14
+ graphCaseId,
15
+ nodeCaseId
16
+ };
17
+ if (nodeSelection === undefined) {
18
+ return {
19
+ slot,
20
+ selected: graphSelection,
21
+ source: "graphDefault",
22
+ inherited: true,
23
+ provenance
24
+ };
25
+ }
26
+ const available = availabilityResult?.available ?? true;
27
+ if (available) {
28
+ return {
29
+ slot,
30
+ selected: nodeSelection,
31
+ source: nodeCaseId ? "nodeCaseOverride" : "nodeOverride",
32
+ inherited: false,
33
+ provenance
34
+ };
35
+ }
36
+ if (!fallbackPolicy.enabled) {
37
+ throw new Error(`Fallback to graph ${slot} is not allowed for node ${nodeId}: fallback disabled.`);
38
+ }
39
+ const allowedSlots = fallbackPolicy.slots ?? DEFAULT_SLOTS;
40
+ if (!allowedSlots.includes(slot)) {
41
+ throw new Error(`Fallback to graph ${slot} is not allowed for node ${nodeId}: slot not in policy.`);
42
+ }
43
+ const trigger = availabilityResult?.trigger;
44
+ if (trigger && !fallbackPolicy.allowedTriggers.includes(trigger)) {
45
+ throw new Error(`Fallback to graph ${slot} is not allowed for node ${nodeId}: trigger ${trigger} not allowed.`);
46
+ }
47
+ return {
48
+ slot,
49
+ selected: graphSelection,
50
+ source: "fallbackToGraphDefault",
51
+ inherited: true,
52
+ fallback: {
53
+ attempted: true,
54
+ from: nodeSelection,
55
+ to: graphSelection,
56
+ trigger: trigger ?? "nodeModelUnavailable",
57
+ reason: availabilityResult?.reason
58
+ },
59
+ provenance
60
+ };
61
+ }
62
+ //# sourceMappingURL=resolve-node-model-slot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-node-model-slot.js","sourceRoot":"","sources":["../../src/resolution/resolve-node-model-slot.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,MAAM,aAAa,GAAkB;IACnC,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;CAClB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAClC,IAIC;IAED,MAAM,EACJ,IAAI,EACJ,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,MAAM,EACP,GAAG,IAAI,CAAC;IAET,MAAM,SAAS,GAAG,GAAG,uBAAuB,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