@exellix/graph-composer 2.5.2 → 2.5.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"canonicalGraphWarnings.d.ts","sourceRoot":"","sources":["../src/canonicalGraphWarnings.ts"],"names":[],"mappings":"AAyIA;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAwHrE"}
1
+ {"version":3,"file":"canonicalGraphWarnings.d.ts","sourceRoot":"","sources":["../src/canonicalGraphWarnings.ts"],"names":[],"mappings":"AAkIA;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAwHrE"}
@@ -1,5 +1,4 @@
1
1
  import { getCanonicalGraphDocumentViolations, collectAiTasksNodeExtensionIssues, looksLikeConcreteModelId, } from "./graphEngineBridge.js";
2
- import { LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE } from "./graphAiModelConfigCanonicalize.js";
3
2
  import { collectGraphOrchestratorInvokeWarnings } from "./llmCallConfig.js";
4
3
  /** Local-skill execution keys that belong on taskConfiguration (graph-engine parity). */
5
4
  const LOCAL_SKILL_METADATA_KEYS = [
@@ -84,15 +83,11 @@ function collectModelProfileWarnings(graph) {
84
83
  if (typeof v !== "string" || v.trim() === "")
85
84
  continue;
86
85
  if (looksLikeProviderModelId(v)) {
87
- warnings.push(`${path}.${field} looks like a provider model id ("${v}") — graph JSON must use @x12i/ai-profiles profile names (e.g. cheap, balanced, deep).`);
88
- continue;
89
- }
90
- if (v in LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE) {
91
- warnings.push(`${path}.${field} uses legacy alias "${v}" — prefer ai-profile name "${LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE[v]}".`);
86
+ warnings.push(`${path}.${field} looks like a provider model id ("${v}") — graph JSON must use graph-engine profile names (e.g. cheap, balanced, deep).`);
92
87
  }
93
88
  }
94
89
  if ("xynthesisModel" in o) {
95
- warnings.push(`${path}: xynthesisModel was removed in graph-engine 7.1 — use preActionModel, skillModel, and postActionModel.`);
90
+ warnings.push(`${path}: xynthesisModel was removed in graph-engine 7.1 — use preActionModel, skillModel, and postActionModel with profile names (cheap, balanced, deep).`);
96
91
  }
97
92
  };
98
93
  const checkSelection = (selection, path) => {
@@ -1,25 +1,18 @@
1
1
  /**
2
- * Migrate graph JSON modelConfig toward graph-engine 7.1+ ({ preActionModel, skillModel, postActionModel })
3
- * and `@x12i/ai-profiles` profile names.
2
+ * Canonicalize graph JSON modelConfig toward graph-engine 7.1+ shape:
3
+ * `{ cases: [{ modelConfig: { preActionModel, skillModel, postActionModel } }] }`
4
+ * with graph-engine profile names (cheap, balanced, deep, …).
4
5
  */
5
6
  export type GraphAiModelConfigTriple = {
6
7
  preActionModel: string;
7
8
  skillModel: string;
8
9
  postActionModel: string;
9
10
  };
10
- /** Legacy graph-engine 7.0 alias names and old authoring ids → primary ai-profile keys. */
11
- export declare const LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE: Readonly<Record<string, string>>;
12
- export declare function mapLegacyGraphModelProfileName(name: string): string;
13
- /** PRE ← xynthesisModel; POST ← skillModel (7.0 POST reused skill). */
14
- export declare function migrateLegacyTwoSlotGraphAiModelConfig(value: {
15
- xynthesisModel: string;
16
- skillModel: string;
17
- }): GraphAiModelConfigTriple;
18
11
  export declare function canonicalizeGraphAiModelConfigTriple(value: Record<string, unknown>): {
19
12
  config: GraphAiModelConfigTriple;
20
13
  changed: boolean;
21
14
  };
22
- /** Canonicalize `{ cases: [...] }` or legacy flat two-slot pair. Returns whether value changed. */
15
+ /** Canonicalize `{ cases: [...] }` or flat three-slot triple. Returns whether value changed. */
23
16
  export declare function canonicalizeModelConfigSelectionInPlace(holder: Record<string, unknown>, key: "modelConfig"): boolean;
24
17
  export declare function canonicalizeGraphRootModelConfig(graph: Record<string, unknown>): boolean;
25
18
  export declare function canonicalizeTaskNodeModelConfig(node: Record<string, unknown>): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"graphAiModelConfigCanonicalize.d.ts","sourceRoot":"","sources":["../src/graphAiModelConfigCanonicalize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUhF,CAAC;AAaF,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnE;AAyBD,uEAAuE;AACvE,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,wBAAwB,CAM3B;AAED,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,MAAM,EAAE,wBAAwB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA+BxD;AAED,mGAAmG;AACnG,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAoCT;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAExF;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAMtF"}
1
+ {"version":3,"file":"graphAiModelConfigCanonicalize.d.ts","sourceRoot":"","sources":["../src/graphAiModelConfigCanonicalize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAuBF,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,MAAM,EAAE,wBAAwB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAoBxD;AAED,gGAAgG;AAChG,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAgCT;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAExF;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAMtF"}
@@ -1,19 +1,8 @@
1
1
  /**
2
- * Migrate graph JSON modelConfig toward graph-engine 7.1+ ({ preActionModel, skillModel, postActionModel })
3
- * and `@x12i/ai-profiles` profile names.
2
+ * Canonicalize graph JSON modelConfig toward graph-engine 7.1+ shape:
3
+ * `{ cases: [{ modelConfig: { preActionModel, skillModel, postActionModel } }] }`
4
+ * with graph-engine profile names (cheap, balanced, deep, …).
4
5
  */
5
- /** Legacy graph-engine 7.0 alias names and old authoring ids → primary ai-profile keys. */
6
- export const LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE = {
7
- default: "balanced",
8
- weak: "cheap",
9
- strong: "deep",
10
- normal: "balanced",
11
- ultra: "deep",
12
- "xynthesis-default": "cheap",
13
- "skill-default": "balanced",
14
- "xynthesis-deep-analysis": "deep",
15
- "skill-reasoning": "deep",
16
- };
17
6
  function readRecord(v) {
18
7
  if (v === null || v === undefined || typeof v !== "object" || Array.isArray(v)) {
19
8
  return undefined;
@@ -23,19 +12,6 @@ function readRecord(v) {
23
12
  function nonEmptyString(v) {
24
13
  return typeof v === "string" && v.trim().length > 0;
25
14
  }
26
- export function mapLegacyGraphModelProfileName(name) {
27
- const trimmed = name.trim();
28
- return LEGACY_GRAPH_MODEL_ALIAS_TO_PROFILE[trimmed] ?? trimmed;
29
- }
30
- function isLegacyTwoSlotGraphAiModelConfig(value) {
31
- const o = readRecord(value);
32
- if (o === undefined)
33
- return false;
34
- return (nonEmptyString(o.xynthesisModel) &&
35
- nonEmptyString(o.skillModel) &&
36
- !nonEmptyString(o.preActionModel) &&
37
- !nonEmptyString(o.postActionModel));
38
- }
39
15
  function isThreeSlotGraphAiModelConfig(value) {
40
16
  const o = readRecord(value);
41
17
  if (o === undefined)
@@ -44,50 +20,32 @@ function isThreeSlotGraphAiModelConfig(value) {
44
20
  nonEmptyString(o.skillModel) &&
45
21
  nonEmptyString(o.postActionModel));
46
22
  }
47
- /** PRE ← xynthesisModel; POST ← skillModel (7.0 POST reused skill). */
48
- export function migrateLegacyTwoSlotGraphAiModelConfig(value) {
49
- return {
50
- preActionModel: mapLegacyGraphModelProfileName(value.xynthesisModel),
51
- skillModel: mapLegacyGraphModelProfileName(value.skillModel),
52
- postActionModel: mapLegacyGraphModelProfileName(value.skillModel),
53
- };
54
- }
55
23
  export function canonicalizeGraphAiModelConfigTriple(value) {
56
- if (isLegacyTwoSlotGraphAiModelConfig(value)) {
57
- return {
58
- config: migrateLegacyTwoSlotGraphAiModelConfig(value),
59
- changed: true,
60
- };
61
- }
62
24
  if (!isThreeSlotGraphAiModelConfig(value)) {
63
25
  return {
64
26
  config: value,
65
27
  changed: false,
66
28
  };
67
29
  }
68
- const preActionModel = mapLegacyGraphModelProfileName(value.preActionModel);
69
- const skillModel = mapLegacyGraphModelProfileName(value.skillModel);
70
- const postActionModel = mapLegacyGraphModelProfileName(value.postActionModel);
30
+ const preActionModel = value.preActionModel.trim();
31
+ const skillModel = value.skillModel.trim();
32
+ const postActionModel = value.postActionModel.trim();
71
33
  const changed = preActionModel !== value.preActionModel ||
72
34
  skillModel !== value.skillModel ||
73
- postActionModel !== value.postActionModel ||
74
- "xynthesisModel" in value;
75
- const config = {
76
- preActionModel,
77
- skillModel,
78
- postActionModel,
35
+ postActionModel !== value.postActionModel;
36
+ return {
37
+ config: { preActionModel, skillModel, postActionModel },
38
+ changed,
79
39
  };
80
- return { config, changed };
81
40
  }
82
- /** Canonicalize `{ cases: [...] }` or legacy flat two-slot pair. Returns whether value changed. */
41
+ /** Canonicalize `{ cases: [...] }` or flat three-slot triple. Returns whether value changed. */
83
42
  export function canonicalizeModelConfigSelectionInPlace(holder, key) {
84
43
  const raw = holder[key];
85
44
  if (raw === undefined)
86
45
  return false;
87
- if (isLegacyTwoSlotGraphAiModelConfig(raw)) {
88
- holder[key] = {
89
- cases: [{ modelConfig: migrateLegacyTwoSlotGraphAiModelConfig(raw) }],
90
- };
46
+ if (isThreeSlotGraphAiModelConfig(raw)) {
47
+ const { config } = canonicalizeGraphAiModelConfigTriple(readRecord(raw) ?? {});
48
+ holder[key] = { cases: [{ modelConfig: config }] };
91
49
  return true;
92
50
  }
93
51
  const sel = readRecord(raw);
@@ -99,8 +57,7 @@ export function canonicalizeModelConfigSelectionInPlace(holder, key) {
99
57
  if (row === undefined)
100
58
  return item;
101
59
  const mc = row.modelConfig;
102
- if (!isLegacyTwoSlotGraphAiModelConfig(mc) &&
103
- !isThreeSlotGraphAiModelConfig(mc)) {
60
+ if (!isThreeSlotGraphAiModelConfig(mc)) {
104
61
  return item;
105
62
  }
106
63
  const { config, changed: mcChanged } = canonicalizeGraphAiModelConfigTriple(readRecord(mc) ?? {});
@@ -0,0 +1,3 @@
1
+ /** Map a graph modelConfig slot value to input accepted by {@link resolveAIProfile}. */
2
+ export declare function toAiProfilesRegistryInput(profileName: string): string;
3
+ //# sourceMappingURL=graphAiProfileResolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphAiProfileResolve.d.ts","sourceRoot":"","sources":["../src/graphAiProfileResolve.ts"],"names":[],"mappings":"AAYA,wFAAwF;AACxF,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAUrE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Resolve graph JSON profile tokens through @x12i/ai-profiles v2.
3
+ * Graphs store primary profile keys (`cheap`, `balanced`, `deep`) or concrete model ids;
4
+ * registry lookup uses `profile/choice` or bundled shortcuts.
5
+ */
6
+ import { formatProfileChoiceKey, isKnownProfileChoice, isProfileChoiceKeyFormat, } from "@x12i/ai-profiles";
7
+ import { looksLikeConcreteModelId } from "./graphEngineBridge.js";
8
+ /** Map a graph modelConfig slot value to input accepted by {@link resolveAIProfile}. */
9
+ export function toAiProfilesRegistryInput(profileName) {
10
+ const trimmed = profileName.trim();
11
+ if (trimmed === "")
12
+ return trimmed;
13
+ if (looksLikeConcreteModelId(trimmed)) {
14
+ return trimmed;
15
+ }
16
+ if (isProfileChoiceKeyFormat(trimmed) || isKnownProfileChoice(trimmed)) {
17
+ return trimmed;
18
+ }
19
+ return formatProfileChoiceKey(trimmed, "default");
20
+ }
@@ -19,7 +19,7 @@ export type GraphModelLayerStackEntry = {
19
19
  /** True when this layer is the effective winner for the node (model-only or with runtime). */
20
20
  active: boolean;
21
21
  profiles: GraphModelProfilesTriple;
22
- /** Set when `profiles` were resolved through bundled @x12i/ai-profiles. */
22
+ /** Present only when a slot already holds a concrete provider/model id on the graph. */
23
23
  providerIds?: GraphModelProfilesTriple;
24
24
  /** Present when the tier uses conditional cases and no execution context was supplied. */
25
25
  conditionalNote?: string;
@@ -58,7 +58,7 @@ export type AnalyzeGraphModelLayersOptions = {
58
58
  };
59
59
  /**
60
60
  * Where runtime logs the resolved model (for operators debugging failed tasks):
61
- * - `RunTaskRequest.modelConfig` (wire: `xynthesisModel` / `skillModel` per phase)
61
+ * - `RunTaskRequest.modelConfig` (wire: `preActionModel` / `skillModel` / `postActionModel` per phase)
62
62
  * - skill-executions / ai-actions / runTask diagnostics when level is not `basic`
63
63
  * - `resolveCanonicalModelUsed(runTaskResponse)` after the call (authoritative provider id)
64
64
  *
@@ -81,7 +81,7 @@ export declare function graphModelLayerLegend(): Array<{
81
81
  * Does not mutate `runtime` and does not add runtime model overrides.
82
82
  */
83
83
  export declare function stampGraphModelLayersOnGraph<T extends object>(graph: T, options?: AnalyzeGraphModelLayersOptions): Promise<T>;
84
- /** Resolve a single profile name to provider/model id (for docs and explain text). */
84
+ /** Display helper for a graph modelConfig slot (no registry resolution). */
85
85
  export declare function resolveGraphModelProfileName(profileName: string): Promise<{
86
86
  profile: string;
87
87
  provider: string;
@@ -89,7 +89,7 @@ export declare function resolveGraphModelProfileName(profileName: string): Promi
89
89
  formatted: string;
90
90
  }>;
91
91
  export type FormatNodeModelLabelOptions = {
92
- /** When true (default), append resolved provider id when it differs from the profile name. */
92
+ /** When true (default), append concrete provider id when stamped on the graph and it differs from the profile name. */
93
93
  includeProviderIds?: boolean;
94
94
  /**
95
95
  * `main` — one line for canvas badges (MAIN / skillModel only).
@@ -1 +1 @@
1
- {"version":3,"file":"graphModelLayers.d.ts","sourceRoot":"","sources":["../src/graphModelLayers.ts"],"names":[],"mappings":"AAcA,mGAAmG;AACnG,MAAM,MAAM,qBAAqB,GAC7B,2BAA2B,GAC3B,oCAAoC,GACpC,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEvF,yGAAyG;AACzG,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,+CAA+C;IAC/C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,UAAU,EAAE,MAAM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,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CASpF;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,uHAAuH;IACvH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,kBAAkB,CAAC;CAC/C,CAAC;AAsBF,kFAAkF;AAClF,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,OAAO,GACZ,oBAAoB,GAAG,SAAS,CAelC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,OAAO,EACrB,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,GAAG,SAAS,CAkCpB;AAED,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,GAAG,SAAS,CAsBpB"}
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Model resolution map for worox graphs: which @x12i/ai-profiles names apply per AI node,
3
- * which precedence layer wins, and resolved provider ids without forcing runtime overrides.
2
+ * Model resolution map for worox graphs: which graph-engine profile names apply per AI node,
3
+ * which precedence layer wins without registry resolution (execute-time owns provider ids).
4
4
  */
5
- import { resolveAIProfile } from "@x12i/ai-profiles";
6
5
  import { DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG, isGraphAiModelConfig, isModelConfigSelection, looksLikeConcreteModelId, resolveGraphAiModelConfig, } from "./graphEngineBridge.js";
7
6
  import { DEFAULT_LOCAL_SKILL_KEYS } from "./aiTaskProfile.js";
8
7
  const LAYER_META = {
@@ -37,8 +36,6 @@ const PROFILE_ACCENT = {
37
36
  cheap: "#16a34a",
38
37
  balanced: "#2563eb",
39
38
  deep: "#7c3aed",
40
- strong: "#9333ea",
41
- weak: "#84cc16",
42
39
  };
43
40
  function readRecord(v) {
44
41
  if (v === null || v === undefined || typeof v !== "object" || Array.isArray(v)) {
@@ -91,33 +88,25 @@ function describeModelConfigTier(value, basePath) {
91
88
  }
92
89
  return { sourcePath: basePath, conditionalNote: "could not read modelConfig from cases" };
93
90
  }
94
- const profileProviderIdCache = new Map();
95
- async function resolveProfileNameToProviderId(profileName) {
96
- const trimmed = profileName.trim();
97
- if (looksLikeConcreteModelId(trimmed)) {
98
- return trimmed;
99
- }
100
- const cached = profileProviderIdCache.get(trimmed);
101
- if (cached !== undefined)
102
- return cached;
103
- const resolved = await resolveAIProfile(trimmed, {
104
- source: "bundled",
105
- catalogLane: "text",
106
- });
107
- const formatted = resolved.modelId.includes("/")
108
- ? resolved.modelId
109
- : `${resolved.provider}/${resolved.modelId}`;
110
- profileProviderIdCache.set(trimmed, formatted);
111
- return formatted;
91
+ async function normalizeProfilesTriple(profiles, context) {
92
+ return resolveGraphAiModelConfig(profiles, context);
112
93
  }
113
- async function resolveProviderTriple(profiles, context) {
114
- const normalized = await resolveGraphAiModelConfig(profiles, context);
115
- const [preActionModel, skillModel, postActionModel] = await Promise.all([
116
- resolveProfileNameToProviderId(normalized.preActionModel),
117
- resolveProfileNameToProviderId(normalized.skillModel),
118
- resolveProfileNameToProviderId(normalized.postActionModel),
119
- ]);
120
- return { preActionModel, skillModel, postActionModel };
94
+ function providerIdsFromConcreteSlots(profiles) {
95
+ const slots = [
96
+ "preActionModel",
97
+ "skillModel",
98
+ "postActionModel",
99
+ ];
100
+ let any = false;
101
+ const out = { ...profiles };
102
+ for (const slot of slots) {
103
+ const value = profiles[slot].trim();
104
+ if (looksLikeConcreteModelId(value)) {
105
+ out[slot] = value;
106
+ any = true;
107
+ }
108
+ }
109
+ return any ? out : undefined;
121
110
  }
122
111
  function buildStackEntry(source, sourcePath, profiles, active, conditionalNote, providerIds) {
123
112
  if (profiles === undefined)
@@ -153,7 +142,7 @@ async function resolveWinningTier(tiers) {
153
142
  }
154
143
  /**
155
144
  * Where runtime logs the resolved model (for operators debugging failed tasks):
156
- * - `RunTaskRequest.modelConfig` (wire: `xynthesisModel` / `skillModel` per phase)
145
+ * - `RunTaskRequest.modelConfig` (wire: `preActionModel` / `skillModel` / `postActionModel` per phase)
157
146
  * - skill-executions / ai-actions / runTask diagnostics when level is not `basic`
158
147
  * - `resolveCanonicalModelUsed(runTaskResponse)` after the call (authoritative provider id)
159
148
  *
@@ -167,16 +156,17 @@ export async function analyzeGraphModelLayers(graph, options) {
167
156
  const locals = localSkillKeys(options);
168
157
  const graphTier = describeModelConfigTier(g.modelConfig, "graph.modelConfig");
169
158
  const graphDefaultProfiles = graphTier.profiles ?? { ...DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG };
170
- const graphDefaultProviderIds = await resolveProviderTriple(graphDefaultProfiles, {
159
+ const normalizedGraphDefault = await normalizeProfilesTriple(graphDefaultProfiles, {
171
160
  graphId,
172
161
  });
162
+ const graphDefaultProviderIds = providerIdsFromConcreteSlots(normalizedGraphDefault);
173
163
  const nodes = [];
174
164
  const nodeList = g.nodes;
175
165
  if (!Array.isArray(nodeList)) {
176
166
  return {
177
167
  analyzedAt: new Date().toISOString(),
178
168
  runtimeIncluded,
179
- graphDefaultProfiles,
169
+ graphDefaultProfiles: normalizedGraphDefault,
180
170
  graphDefaultProviderIds,
181
171
  nodes,
182
172
  };
@@ -224,29 +214,32 @@ export async function analyzeGraphModelLayers(graph, options) {
224
214
  });
225
215
  }
226
216
  const winning = await resolveWinningTier(tiers);
227
- const winningProviderIds = await resolveProviderTriple(winning.profiles, {
217
+ const winningProfiles = await normalizeProfilesTriple(winning.profiles, {
228
218
  graphId,
229
219
  nodeId,
230
220
  });
221
+ const winningProviderIds = providerIdsFromConcreteSlots(winningProfiles);
231
222
  const stack = [];
232
223
  const pushTier = async (tier) => {
233
224
  const described = describeModelConfigTier(tier.value, tier.basePath);
234
225
  if (described.profiles === undefined)
235
226
  return;
236
- const providerIds = await resolveProviderTriple(described.profiles, {
227
+ const profiles = await normalizeProfilesTriple(described.profiles, {
237
228
  graphId,
238
229
  nodeId,
239
230
  });
240
- const entry = buildStackEntry(tier.source, described.sourcePath, described.profiles, tier.source === winning.source && described.sourcePath === winning.sourcePath, described.conditionalNote, providerIds);
231
+ const providerIds = providerIdsFromConcreteSlots(profiles);
232
+ const entry = buildStackEntry(tier.source, described.sourcePath, profiles, tier.source === winning.source && described.sourcePath === winning.sourcePath, described.conditionalNote, providerIds);
241
233
  if (entry !== undefined)
242
234
  stack.push(entry);
243
235
  };
244
236
  for (const tier of tiers) {
245
237
  await pushTier(tier);
246
238
  }
247
- const defaultEntry = buildStackEntry("graph-engine.default", "@exellix/graph-engine DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG", { ...DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG }, winning.source === "graph-engine.default", tiers.length === 0
239
+ const defaultProfiles = await normalizeProfilesTriple(DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG, { graphId, nodeId });
240
+ const defaultEntry = buildStackEntry("graph-engine.default", "@exellix/graph-engine DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG", defaultProfiles, winning.source === "graph-engine.default", tiers.length === 0
248
241
  ? "no modelConfig on graph or node — engine default applies"
249
- : undefined, await resolveProviderTriple(DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG, { graphId, nodeId }));
242
+ : undefined, providerIdsFromConcreteSlots(defaultProfiles));
250
243
  if (defaultEntry !== undefined) {
251
244
  stack.push(defaultEntry);
252
245
  }
@@ -259,8 +252,8 @@ export async function analyzeGraphModelLayers(graph, options) {
259
252
  sourcePath: winning.sourcePath,
260
253
  layerColor: LAYER_META[winning.source].layerColor,
261
254
  layerOrder: LAYER_META[winning.source].layerOrder,
262
- profiles: winning.profiles,
263
- providerIds: winningProviderIds,
255
+ profiles: winningProfiles,
256
+ ...(winningProviderIds !== undefined ? { providerIds: winningProviderIds } : {}),
264
257
  },
265
258
  stack,
266
259
  });
@@ -268,7 +261,7 @@ export async function analyzeGraphModelLayers(graph, options) {
268
261
  return {
269
262
  analyzedAt: new Date().toISOString(),
270
263
  runtimeIncluded,
271
- graphDefaultProfiles,
264
+ graphDefaultProfiles: normalizedGraphDefault,
272
265
  graphDefaultProviderIds,
273
266
  nodes,
274
267
  };
@@ -325,25 +318,25 @@ export async function stampGraphModelLayersOnGraph(graph, options) {
325
318
  legend: graphModelLayerLegend(),
326
319
  graphDefault: {
327
320
  profiles: analysis.graphDefaultProfiles,
328
- providerIds: analysis.graphDefaultProviderIds,
321
+ ...(analysis.graphDefaultProviderIds !== undefined
322
+ ? { providerIds: analysis.graphDefaultProviderIds }
323
+ : {}),
329
324
  },
330
- note: "Planning overlay only. At execute time @exellix/graph-engine resolves modelConfig (runtime.nodes node runtime graph default), then @x12i/ai-profiles maps profile names to provider ids. Omit runtime.modelConfig unless you intend to override the graph.",
325
+ note: "Planning overlay only. Profile names come from graph JSON and graph-engine defaults; concrete provider ids are resolved at execute time by ai-tasks / xynthesis. Omit runtime.modelConfig unless you intend to override the graph.",
331
326
  };
332
327
  g.metadata = rootMeta;
333
328
  return graph;
334
329
  }
335
- /** Resolve a single profile name to provider/model id (for docs and explain text). */
330
+ /** Display helper for a graph modelConfig slot (no registry resolution). */
336
331
  export async function resolveGraphModelProfileName(profileName) {
337
- const formatted = await resolveProfileNameToProviderId(profileName);
338
- const slash = formatted.indexOf("/");
339
- const provider = slash >= 0 ? formatted.slice(0, slash) : formatted;
340
- const modelId = slash >= 0 ? formatted.slice(slash + 1) : formatted;
341
- return {
342
- profile: profileName.trim(),
343
- provider,
344
- modelId,
345
- formatted,
346
- };
332
+ const profile = profileName.trim();
333
+ if (looksLikeConcreteModelId(profile)) {
334
+ const slash = profile.indexOf("/");
335
+ const provider = slash >= 0 ? profile.slice(0, slash) : profile;
336
+ const modelId = slash >= 0 ? profile.slice(slash + 1) : profile;
337
+ return { profile, provider, modelId, formatted: profile };
338
+ }
339
+ return { profile, provider: "", modelId: "", formatted: profile };
347
340
  }
348
341
  function formatProfileSlot(profiles, providerIds, slot, includeProviderIds) {
349
342
  const name = profiles[slot]?.trim() ?? "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exellix/graph-composer",
3
- "version": "2.5.2",
3
+ "version": "2.5.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  ".env.example"
29
29
  ],
30
30
  "scripts": {
31
- "postinstall": "node -e \"const fs=require('fs'),p=require('path'),cp=require('child_process');const s=p.join('node_modules','nx-config2','bin','nx-config2.js'),d=p.join('node_modules','@x12i','env','bin','nx-config2.js');try{if(fs.existsSync(s)&&!fs.existsSync(d))fs.copyFileSync(s,d);}catch(_){}const patch=p.join('node_modules','@exellix','graph-engine','scripts','patch-ai-tasks-xynthesis-export.mjs');if(fs.existsSync(patch))cp.execFileSync(process.execPath,[patch],{stdio:'inherit'});\"",
31
+ "postinstall": "node -e \"const fs=require('fs'),p=require('path');const s=p.join('node_modules','nx-config2','bin','nx-config2.js'),d=p.join('node_modules','@x12i','env','bin','nx-config2.js');try{if(fs.existsSync(s)&&!fs.existsSync(d))fs.copyFileSync(s,d);}catch(_){}\"",
32
32
  "build": "tsc -p tsconfig.build.json",
33
33
  "prepublishOnly": "npm run build",
34
34
  "start": "x12i-env run --env-file .env -- node dist/cli.js",
@@ -37,7 +37,7 @@
37
37
  "verify:local": "tsx src/verify-local.ts",
38
38
  "verify:catalog-live": "x12i-env run --env-file .env -- tsx scripts/verify-catalog-live.ts",
39
39
  "test": "npm run test:unit && npm run test:live",
40
- "test:unit": "node --import tsx/esm --test --test-force-exit test/unit/explain-shape.test.ts test/unit/graph-concept-patch.test.ts test/unit/graph-concept-story-parse.test.ts test/unit/review-concept-output-validation.test.ts test/unit/review-concept-catalog-alias.test.ts test/unit/redact-for-log.test.ts test/unit/graph-composer-logging.test.ts test/unit/worker-instructions.test.ts test/unit/catalog-output-validation.test.ts test/unit/catalox-catalog-bridge.test.ts test/unit/ai-task-profile.test.ts test/unit/create-modify-output-validation.test.ts test/unit/task-node-task-variable.test.ts test/unit/canonical-graph-document.test.ts test/unit/graph-engine-bridge.test.ts test/unit/graph-model-layers.test.ts test/unit/example-generation.test.ts test/unit/graph-entry-schema.test.ts test/unit/graph-entry-patch-validation.test.ts test/unit/graph-entry-entity-alignment.test.ts test/unit/graph-entry-example-generation.test.ts test/unit/model-config-patch-merge.test.ts test/unit/graph-entry-registry.test.ts test/unit/graph-model-label-format.test.ts test/unit/llm-call-config.test.ts",
40
+ "test:unit": "node --import tsx/esm --test --test-force-exit --test-concurrency=1 test/unit/explain-shape.test.ts test/unit/graph-concept-patch.test.ts test/unit/graph-concept-story-parse.test.ts test/unit/review-concept-output-validation.test.ts test/unit/review-concept-catalog-alias.test.ts test/unit/redact-for-log.test.ts test/unit/graph-composer-logging.test.ts test/unit/worker-instructions.test.ts test/unit/catalog-output-validation.test.ts test/unit/catalox-catalog-bridge.test.ts test/unit/ai-task-profile.test.ts test/unit/create-modify-output-validation.test.ts test/unit/task-node-task-variable.test.ts test/unit/canonical-graph-document.test.ts test/unit/graph-engine-bridge.test.ts test/unit/graph-model-layers.test.ts test/unit/example-generation.test.ts test/unit/graph-entry-schema.test.ts test/unit/graph-entry-patch-validation.test.ts test/unit/graph-entry-entity-alignment.test.ts test/unit/model-config-patch-merge.test.ts test/unit/graph-entry-registry.test.ts test/unit/graph-model-label-format.test.ts test/unit/llm-call-config.test.ts",
41
41
  "test:live": "x12i-env run --env-file .env -- node --import tsx/esm --test test/live/all.ts",
42
42
  "pack:check": "npm pack --dry-run",
43
43
  "suggest-smoke": "x12i-env run --env-file .env -- tsx scripts/run-suggest-concept-smoke.ts"
@@ -64,9 +64,9 @@
64
64
  },
65
65
  "homepage": "https://github.com/woroces/graph-composer#readme",
66
66
  "peerDependencies": {
67
- "@exellix/ai-skills": "^6.1.0",
68
- "@exellix/ai-tasks": "^8.6.0",
69
- "@exellix/graph-engine": "^7.7.3"
67
+ "@exellix/ai-skills": "^6.2.2",
68
+ "@exellix/ai-tasks": "^8.6.2",
69
+ "@exellix/graph-engine": "^7.7.7"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@exellix/graph-engine": {
@@ -80,7 +80,6 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
- "@x12i/ai-profiles": "^2.1.0",
84
83
  "@x12i/catalox": "^5.1.3",
85
84
  "@x12i/env": "^4.0.1",
86
85
  "@x12i/funcx": "^4.4.0",