@exellix/ai-tasks 8.0.0 → 8.0.7

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 (70) hide show
  1. package/BREAKING-CHANGES.md +17 -2
  2. package/CHANGELOG.md +16 -0
  3. package/README.md +51 -6
  4. package/dist/core/task-sdk.d.ts.map +1 -1
  5. package/dist/core/task-sdk.js +25 -9
  6. package/dist/core/task-sdk.js.map +1 -1
  7. package/dist/execution-strategies/constants.d.ts +2 -3
  8. package/dist/execution-strategies/constants.d.ts.map +1 -1
  9. package/dist/execution-strategies/constants.js +2 -3
  10. package/dist/execution-strategies/constants.js.map +1 -1
  11. package/dist/execution-strategies/genericExecutionFuncxEnvelope.d.ts +1 -1
  12. package/dist/execution-strategies/genericExecutionFuncxEnvelope.js +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +2 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/internal/buildXynthesisWorkScopeIdentity.d.ts +20 -0
  18. package/dist/internal/buildXynthesisWorkScopeIdentity.d.ts.map +1 -0
  19. package/dist/internal/buildXynthesisWorkScopeIdentity.js +46 -0
  20. package/dist/internal/buildXynthesisWorkScopeIdentity.js.map +1 -0
  21. package/dist/internal/runPostStepLlmCall.d.ts +3 -0
  22. package/dist/internal/runPostStepLlmCall.d.ts.map +1 -1
  23. package/dist/internal/runPostStepLlmCall.js +10 -3
  24. package/dist/internal/runPostStepLlmCall.js.map +1 -1
  25. package/dist/post-steps/audit/runAudit.d.ts.map +1 -1
  26. package/dist/post-steps/audit/runAudit.js +14 -0
  27. package/dist/post-steps/audit/runAudit.js.map +1 -1
  28. package/dist/post-steps/audit/runAuditCall.d.ts +2 -0
  29. package/dist/post-steps/audit/runAuditCall.d.ts.map +1 -1
  30. package/dist/post-steps/audit/runAuditCall.js +2 -1
  31. package/dist/post-steps/audit/runAuditCall.js.map +1 -1
  32. package/dist/post-steps/polish/runPolish.d.ts +7 -0
  33. package/dist/post-steps/polish/runPolish.d.ts.map +1 -1
  34. package/dist/post-steps/polish/runPolish.js +13 -0
  35. package/dist/post-steps/polish/runPolish.js.map +1 -1
  36. package/dist/post-steps/polish/runPolishCall.d.ts +2 -0
  37. package/dist/post-steps/polish/runPolishCall.d.ts.map +1 -1
  38. package/dist/post-steps/polish/runPolishCall.js +2 -1
  39. package/dist/post-steps/polish/runPolishCall.js.map +1 -1
  40. package/dist/strategies/direct-execution-strategy.d.ts.map +1 -1
  41. package/dist/strategies/direct-execution-strategy.js +14 -2
  42. package/dist/strategies/direct-execution-strategy.js.map +1 -1
  43. package/dist/types/model-config.d.ts +3 -5
  44. package/dist/types/model-config.d.ts.map +1 -1
  45. package/dist/types/model-config.js +3 -32
  46. package/dist/types/model-config.js.map +1 -1
  47. package/dist/utilities/runUtility.d.ts.map +1 -1
  48. package/dist/utilities/runUtility.js +5 -1
  49. package/dist/utilities/runUtility.js.map +1 -1
  50. package/dist/utils/concreteModelId.d.ts +3 -0
  51. package/dist/utils/concreteModelId.d.ts.map +1 -0
  52. package/dist/utils/concreteModelId.js +22 -0
  53. package/dist/utils/concreteModelId.js.map +1 -0
  54. package/dist/utils/resolveAiProfileModel.d.ts +21 -0
  55. package/dist/utils/resolveAiProfileModel.d.ts.map +1 -0
  56. package/dist/utils/resolveAiProfileModel.js +146 -0
  57. package/dist/utils/resolveAiProfileModel.js.map +1 -0
  58. package/dist/utils/resolveRunTaskModelReferences.d.ts +7 -0
  59. package/dist/utils/resolveRunTaskModelReferences.d.ts.map +1 -0
  60. package/dist/utils/resolveRunTaskModelReferences.js +172 -0
  61. package/dist/utils/resolveRunTaskModelReferences.js.map +1 -0
  62. package/dist/utils/routeModelConfigSlots.d.ts +2 -0
  63. package/dist/utils/routeModelConfigSlots.d.ts.map +1 -1
  64. package/dist/utils/routeModelConfigSlots.js +2 -0
  65. package/dist/utils/routeModelConfigSlots.js.map +1 -1
  66. package/dist/validation/helpers.d.ts +1 -1
  67. package/dist/validation/helpers.d.ts.map +1 -1
  68. package/dist/validation/helpers.js +5 -11
  69. package/dist/validation/helpers.js.map +1 -1
  70. package/package.json +6 -5
@@ -26,9 +26,24 @@ See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-
26
26
 
27
27
  ## Unreleased (synced runtime model)
28
28
 
29
+ ### `@x12i/ai-profiles` — in-package model alias resolution
30
+
31
+ - **`@x12i/ai-profiles`** is a dependency. Profile aliases on `modelConfig` (`xynthesisModel`, `skillModel`), `llmCall.model`, and pipeline step configs are **resolved inside ai-tasks** before xynthesis (`executeXynthesisAction`) and ai-skills (`runSkill`) calls.
32
+ - **Concrete provider model ids are unchanged** — pass-through, no migration for callers already using `openrouter/...`, `anthropic/...`, etc.
33
+ - **New capability:** send ai-profiles names (`cheap`, `balanced`, `pro`, `cheapest`, …) or legacy tiers (`weak`, `strong`, `default`) directly on `RunTaskRequest`; graph-engine pre-resolution is optional.
34
+ - **Validation:** alias tokens on `modelConfig` slots are **accepted** (replaces 8.0.0 behavior that rejected `weak` / `strong` / `default` with `MODEL_CONFIG_NOT_RESOLVED`).
35
+ - **Exports:** `resolveModelReference`, `resolveRunTaskModelReferences`, `isResolvableModelAlias`, `formatResolvedProfileModelId`.
36
+
37
+ See [README — Model profile aliases](./README.md#model-profile-aliases-x12iai-profiles) and [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
38
+
39
+ ### `@exellix/xynthesis` ≥ 4.0 and `@exellix/ai-skills` ≥ 5.8
40
+
41
+ - Requires **`@exellix/xynthesis` ≥ 4.0.1** and **`@exellix/ai-skills` ≥ 5.8.1** (see `package.json`).
42
+ - **`executeXynthesisAction`** (xynthesis 4.x) accepts **ai-profiles aliases only** (`balanced`, `cheapest`, `json`, …) — not concrete `provider/model` ids. ai-tasks keeps **`modelConfig.xynthesisModel`** and xynthesis **`llmCall.model`** as aliases; **`skillModel`** / MAIN gateway models still resolve to concrete ids for **`@exellix/ai-skills`**.
43
+ - Optional upstream entry **`runXynthesisAiAction`** (Catalox-backed templates) is not used by ai-tasks yet; this package still materializes prompts and calls **`executeXynthesisAction`**.
44
+
29
45
  ### `@exellix/xynthesis` ≥ 3.6: `runSynthesisCall` removed
30
46
 
31
- - Requires **`@exellix/xynthesis` ≥ 3.6.4** (see `package.json`).
32
47
  - **`runSynthesisCall`** and **`RunSynthesisCallOpts`** are **removed** upstream. Use **`executeXynthesisAction`** with **`ExecuteXynthesisActionRequest`** (`gateway`, `prompts`, `workScope`, plus optional `model`, `maxTokens`, `timeoutMs`, …).
33
48
  - **`@exellix/ai-tasks`** no longer re-exports a `runSynthesisCall` alias. Public exports: **`executeXynthesisAction`**, **`setSynthesisInvoker`**, **`getSynthesisInvoker`**, plus type **`ExecuteXynthesisActionRequest`** (result type: import from **`@exellix/xynthesis`** or **`@exellix/xynthesis/ai-actions`**).
34
49
  - Post-step LLM helpers (`runPostStepLlmCall`, audit, polish, scoping) call **`executeXynthesisAction`** internally. Tests still mock via **`setSynthesisInvoker`**.
@@ -37,7 +52,7 @@ See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-
37
52
 
38
53
  - **`RunTaskRequest.executionStrategies`** is **required**: an array of `{ strategyKey: "planner" \| "optimizer", phase: "before" \| "after", priority: number, maxIterations?, args? }`. Use **`[]`** for plain MAIN (same behavior as the former default `executionStrategyKey: "direct"`).
39
54
  - **`executionStrategyKey`** has been **removed** from types, schema, and metadata. **`response.metadata.executionStrategiesSummary`** replaces it (before/after key lists and optional `primaryOptimizerMaxIterations`).
40
- - Default FuncX function ids for planner/optimizer (**generic envelope**, **`run()`** from `@x12i/funcx/functions`): **`execution/plan`**, **`execution/evaluate-result`**. Use **`@x12i/funcx` ≥ 3.8.2** so **`getRunJsonResult`** matches planner/optimizer unwrap behavior (normalization fixes landed in **3.8.2**). Export constants: **`FUNCX_EXECUTION_PLAN_FUNCTION_ID`**, **`FUNCX_EXECUTION_EVALUATE_RESULT_FUNCTION_ID`**. Override via each invocation’s `args.functionId` only when the target accepts the **same** envelope (`goal`, `input`, `context`, `result?`, `args`, `attribution`).
55
+ - Default FuncX function ids for planner/optimizer (**generic envelope**, **`run()`** from `@x12i/funcx/functions`): **`execution/plan`**, **`execution/evaluate-result`**. Use **`@x12i/funcx` ≥ 4.2.0** (re-exports **`getRunJsonResult`**, **`buildAskAttribution`**, and **`FUNCX_*_FUNCTION_ID`** constants from `@x12i/funcx/functions`). Override via each invocation’s `args.functionId` only when the target accepts the **same** envelope (`goal`, `input`, `context`, `result?`, `args`, `attribution`).
41
56
 
42
57
  ### `runTask` ordering: Narrix before pipeline PRE
43
58
 
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to `@exellix/ai-tasks` are documented here.
4
4
 
5
5
  The published **npm version** always matches **`version`** in [`package.json`](package.json). If this file skips a semver, treat [`BREAKING-CHANGES.md`](BREAKING-CHANGES.md) and [`RUNTASK_REQUEST.md`](RUNTASK_REQUEST.md) as the source of truth for cross-version upgrades.
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+
11
+ - **Model profile aliases (`@x12i/ai-profiles`):** Resolve ai-profiles profile/shortcut names and legacy tiers (`weak`, `strong`, `default`) to concrete provider model ids for **ai-skills MAIN** (`skillModel` / `llmCall.model`). Keep **ai-profiles aliases** on **xynthesis** paths (`modelConfig.xynthesisModel`, POST/PRE/scoping `llmCall.model`). Exports: `resolveModelReference`, `resolveModelReferenceForXynthesis`, `normalizeXynthesisModelAlias`, `resolveRunTaskModelReferences`, `isResolvableModelAlias`, `formatResolvedProfileModelId`.
12
+
13
+ ### Changed
14
+
15
+ - **`@exellix/xynthesis` ^4.0.1:** Xynthesis LLM calls use alias-only model resolution (`resolveModelReferenceForXynthesis`); default post-step model is **`balanced`** when omitted. **`skillModel`** resolution for **`@exellix/ai-skills` ^5.8.1** unchanged.
16
+ - **`@x12i/funcx` ^4.2.0:** Execution-strategy function ids are re-exported from `@x12i/funcx/functions` (`FUNCX_EXECUTION_PLAN_FUNCTION_ID`, etc.). Runtime integration unchanged: `createClient` + `run()` + `getRunJsonResult` / `unwrapFuncxRunValue` for planner, optimizer, and optional `research/plan-questions`.
17
+ - **Validation:** `modelConfig` slots accept known profile aliases (no longer `MODEL_CONFIG_NOT_RESOLVED` for `weak` / `strong` / `default`).
18
+
19
+ ### Documentation
20
+
21
+ - README — [Model profile aliases](#model-profile-aliases-x12iai-profiles); [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
22
+
7
23
  ## [7.7.1] - 2026-05-25
8
24
 
9
25
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Private Git/npm package for executing **tasks** using the Woreces execution stack.
4
4
 
5
- **Breaking — `executionStrategies` (required):** Every `runTask` request must include **`executionStrategies`**: an array of FuncX MAIN wrappers or **`[]`** for plain gateway MAIN. The old **`executionStrategyKey`** field is removed. See [BREAKING-CHANGES.md](BREAKING-CHANGES.md) and [RUNTASK_REQUEST.md](RUNTASK_REQUEST.md). Supported MAIN execution is exactly: **direct** via **`executionStrategies: []`**, **planner** before MAIN, **optimizer** after MAIN, or planner + optimizer together. Default FuncX function ids (generic envelope via **`run()`**, **`@x12i/funcx` ≥ 3.8.2** recommended): **`execution/plan`**, **`execution/evaluate-result`** (overridable via each row’s `args.functionId` when the alternate implementation uses the **same** envelope). Planner/optimizer responses are normalized with **`getRunJsonResult`** from `@x12i/funcx/functions` (also re-exported from this package as **`unwrapFuncxRunValue`** → **`getRunJsonResult`**).
5
+ **Breaking — `executionStrategies` (required):** Every `runTask` request must include **`executionStrategies`**: an array of FuncX MAIN wrappers or **`[]`** for plain gateway MAIN. The old **`executionStrategyKey`** field is removed. See [BREAKING-CHANGES.md](BREAKING-CHANGES.md) and [RUNTASK_REQUEST.md](RUNTASK_REQUEST.md). Supported MAIN execution is exactly: **direct** via **`executionStrategies: []`**, **planner** before MAIN, **optimizer** after MAIN, or planner + optimizer together. Default FuncX function ids (generic envelope via **`run()`**, **`@x12i/funcx` ≥ 4.2.0** recommended): **`execution/plan`**, **`execution/evaluate-result`** (overridable via each row’s `args.functionId` when the alternate implementation uses the **same** envelope). Planner/optimizer responses are normalized with **`getRunJsonResult`** from `@x12i/funcx/functions` (also re-exported from this package as **`unwrapFuncxRunValue`** → **`getRunJsonResult`**).
6
6
 
7
7
  **FuncX catalog / hosting:** Those function ids must exist in your FuncX content resolver for live **`run()`** calls — see [`documenations/funcx-catalog-hosting-checklist.md`](documenations/funcx-catalog-hosting-checklist.md).
8
8
 
@@ -1077,13 +1077,58 @@ The legacy `llmCall.maxTokens` field is still accepted as an alias for `maxToken
1077
1077
 
1078
1078
  ---
1079
1079
 
1080
+ ## Model profile aliases (`@x12i/ai-profiles`)
1081
+
1082
+ `@exellix/ai-tasks` resolves **profile aliases** to concrete provider model ids via [`@x12i/ai-profiles`](https://www.npmjs.com/package/@x12i/ai-profiles) at execution time. This applies to **both** execution paths:
1083
+
1084
+ | Path | Slot / field | Resolved before |
1085
+ |------|----------------|-----------------|
1086
+ | **Xynthesis** (PRE synthesis, POST audit/polish, AI scoping, utilities) | `xynthesisModel`, `SynthesisConfig.llmCall.model`, `AuditConfig.llmCall.*`, `PolishConfig.llmCall`, `RunUtilityRequest.exec.model`, env fallbacks (`SYNTHESIS_MODEL`, `AUDIT_MODEL`, …) | `executeXynthesisAction` / `runPostStepLlmCall` |
1087
+ | **ai-skills MAIN** | `skillModel`, `RunTaskRequest.llmCall.model` | `runSkill` (via `DirectExecutionStrategy`) |
1088
+
1089
+ **Accepted alias shapes:**
1090
+
1091
+ - **ai-profiles profiles:** `cheap`, `fast`, `balanced`, `deep`, `pro`, `json`, `agentic`, `research`
1092
+ - **ai-profiles shortcuts:** `cheapest`, `default`, `best`, `standard`, `thinking`, `schema`, `agent`, `web-research`, … (see `@x12i/ai-profiles` README)
1093
+ - **Legacy graph tiers:** `weak` → `cheap`, `strong` → `pro`, `default` → `balanced`
1094
+
1095
+ **Example (aliases on the request — resolved inside `runTask`):**
1096
+
1097
+ ```typescript
1098
+ await runTask({
1099
+ skillKey: "tasks/analysis",
1100
+ agentId: "agent-1",
1101
+ jobTypeId: "analysis-job",
1102
+ taskTypeId: "analysis-task",
1103
+ executionStrategies: [],
1104
+ input: { topic: "Q1 risks" },
1105
+ modelConfig: {
1106
+ xynthesisModel: "cheap", // PRE synthesis → e.g. google/gemini-2.5-flash-lite
1107
+ skillModel: "balanced", // MAIN skill → e.g. openai/gpt-5.4
1108
+ },
1109
+ });
1110
+ ```
1111
+
1112
+ Concrete ids (`openrouter/...`, `anthropic/claude-sonnet-4`, `openai/gpt-5`, …) pass through unchanged.
1113
+
1114
+ **Client impact:**
1115
+
1116
+ - **No change** if you already send concrete provider model ids.
1117
+ - **New:** you may send ai-profiles aliases on `modelConfig`, `llmCall.model`, and pipeline step configs — graph-engine no longer has to pre-resolve every alias before `runTask` (hosts that already resolve can keep doing so; double resolution is a no-op for concrete ids).
1118
+ - **Validation:** alias tokens on `modelConfig` slots are accepted; unknown aliases fail at resolution with a clear error.
1119
+ - **Optional helpers** (for hosts/tests): `resolveModelReference`, `resolveRunTaskModelReferences`, `isResolvableModelAlias`.
1120
+
1121
+ Resolution uses the ai-profiles registry (`auto`: remote refresh with bundled fallback). See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
1122
+
1123
+ ---
1124
+
1080
1125
  ## LLM call configuration (`LlmCallConfig`)
1081
1126
 
1082
1127
  `LlmCallConfig` is the per-stage override knob set. On MAIN it composes with `RunTaskRequest.modelConfig` slots (`skillModel` / `xynthesisModel`) — when both are set, `llmCall.*` wins.
1083
1128
 
1084
1129
  ```typescript
1085
1130
  type LlmCallConfig = {
1086
- model?: string; // provider/model id
1131
+ model?: string; // provider/model id or @x12i/ai-profiles alias (resolved at call time)
1087
1132
  maxTokensCap?: number; // HARD CEILING for resolveMaxTokens (does NOT disable automation)
1088
1133
  maxTokens?: number; // alias for maxTokensCap (backward compat)
1089
1134
  temperature?: number;
@@ -2080,11 +2125,11 @@ interface ModelConfig {
2080
2125
  }
2081
2126
  ```
2082
2127
 
2083
- **Example:**
2128
+ **Example (concrete ids or aliases):**
2084
2129
  ```typescript
2085
2130
  const modelConfig = {
2086
- xynthesisModel: "openai/gpt-5-nano",
2087
- skillModel: "openai/gpt-5",
2131
+ xynthesisModel: "cheap", // or "openai/gpt-5-nano"
2132
+ skillModel: "balanced", // or "openai/gpt-5"
2088
2133
  temperature: 0.7,
2089
2134
  maxTokens: 2000,
2090
2135
  topP: 0.9
@@ -2098,7 +2143,7 @@ const result = await runTask({
2098
2143
  });
2099
2144
  ```
2100
2145
 
2101
- **Note:** Root `RunTaskRequest.modelConfig` uses canonical slots (`RunTaskModelConfig`). See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
2146
+ **Note:** Root `RunTaskRequest.modelConfig` uses canonical slots (`RunTaskModelConfig`: `xynthesisModel` + `skillModel`). Profile aliases are resolved via `@x12i/ai-profiles` at `runTask` entry and on each xynthesis / ai-skills call boundary. See [Model profile aliases](#model-profile-aliases-x12iai-profiles) and [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
2102
2147
 
2103
2148
  ### `JobHistory`, `TaskHistory`, and `ExecutionHistory`
2104
2149
 
@@ -1 +1 @@
1
- {"version":3,"file":"task-sdk.d.ts","sourceRoot":"","sources":["../../src/core/task-sdk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAazD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AAiQzF,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IAEzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADN,YAAY,EAAE,iBAAiB,EACjC,QAAQ,EAAE;QACzB,OAAO,CAAC,OAAO,GAAG,GAAG,EACnB,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;KACtC;IAGG,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAghDtF;;OAEG;YACW,6BAA6B;IAqgB3C;;;;;OAKG;YACW,cAAc;CAuR7B"}
1
+ {"version":3,"file":"task-sdk.d.ts","sourceRoot":"","sources":["../../src/core/task-sdk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAazD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AAyPzF,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IAEzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADN,YAAY,EAAE,iBAAiB,EACjC,QAAQ,EAAE;QACzB,OAAO,CAAC,OAAO,GAAG,GAAG,EACnB,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;KACtC;IAGG,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAuhDtF;;OAEG;YACW,6BAA6B;IAmhB3C;;;;;OAKG;YACW,cAAc;CAuR7B"}
@@ -35,7 +35,9 @@ import { createDebugTraceCollector, traceWrap } from "../observability/debugTrac
35
35
  import { loadSynthesisTemplates, buildSynthesisSystemPrompt, buildSynthesisUserPrompt, resolveSourceMaterial, resolveSourceMaterialParts, getRenderedTemplates, buildSynthesizedContextMarkdown, resolveSynthesisQuestion, runStructuredSynthesisGatewayCallRobust, getContextSynthesizer, normalizeAndValidateSynthesizedPayload, discoverTemplateCores, } from "../synthesis/index.js";
36
36
  import { resolveOutputExpectation as resolveOutputExpectationXynthesis } from "@exellix/xynthesis/ai-actions";
37
37
  import { llmCallEnvPrefix, resolveLlmCall } from "../post-steps/resolvePostStepConfig.js";
38
+ import { buildXynthesisWorkScopeIdentity } from "../internal/buildXynthesisWorkScopeIdentity.js";
38
39
  import { getSkillModelFromSlots, resolveXynthesisModelForPre } from "../utils/routeModelConfigSlots.js";
40
+ import { resolveRunTaskModelReferences } from "../utils/resolveRunTaskModelReferences.js";
39
41
  import { runPostStepLlmCall } from "../internal/runPostStepLlmCall.js";
40
42
  registerBuiltInLocalTasks();
41
43
  const DEFAULT_SYNTH_INPUT_MAX_CHARS = 200_000;
@@ -131,13 +133,6 @@ function withDefaultDecisionValidation(request) {
131
133
  },
132
134
  };
133
135
  }
134
- /** Runtime `request.identity` forwarded to xynthesis synthesis calls (not from step config). */
135
- function synthesisIdentityFromRequest(request) {
136
- const id = request.identity;
137
- if (id == null || typeof id !== "object")
138
- return undefined;
139
- return id;
140
- }
141
136
  /** When the skills client has no `enrichMemoriesWithScoping` (semver drift), pass memory through unchanged. */
142
137
  async function passthroughEnrichMemories(_id, _level, bundle) {
143
138
  return {
@@ -442,7 +437,7 @@ export class WorexClientTasks {
442
437
  }
443
438
  async runTask(input) {
444
439
  const compiled = compileTaskConfigurationOnRunTaskRequest(input);
445
- input = compiled.request;
440
+ input = await resolveRunTaskModelReferences(compiled.request);
446
441
  emitRunTaskRequestWarnings(input);
447
442
  assertRequiredRunSkillCorrelation(input);
448
443
  assertValidSmartInputConfig(input.smartInput, input.skillKey);
@@ -1667,6 +1662,13 @@ export class WorexClientTasks {
1667
1662
  jobId: request.jobId,
1668
1663
  taskId: request.taskId,
1669
1664
  skillKey: request.skillKey,
1665
+ agentId: request.agentId,
1666
+ graphId: request.graphId,
1667
+ nodeId: request.nodeId,
1668
+ prevNodeId: request.prevNodeId,
1669
+ coreSkillId: request.coreSkillId,
1670
+ masterSkillId: request.masterSkillId,
1671
+ identity: request.identity,
1670
1672
  }),
1671
1673
  onSuccessUpdates: (polishResult) => ({
1672
1674
  totalPasses: polishResult.metadata?.totalPasses,
@@ -1833,7 +1835,7 @@ export class WorexClientTasks {
1833
1835
  };
1834
1836
  const synthLlmCall = resolveLlmCall(synthLlmCallInput, llmCallEnvPrefix("SYNTHESIS"), {}, {
1835
1837
  outputExpectation: resolveOutputExpectationXynthesis("synthesis"),
1836
- model: "gpt-5-nano",
1838
+ model: "balanced",
1837
1839
  timeoutMs: 30_000,
1838
1840
  });
1839
1841
  const model = synthLlmCall.model;
@@ -1847,6 +1849,17 @@ export class WorexClientTasks {
1847
1849
  synthLlmCalls.push(obs);
1848
1850
  }
1849
1851
  : undefined;
1852
+ const workScopeIdentity = buildXynthesisWorkScopeIdentity({
1853
+ jobId: request.jobId,
1854
+ taskId: request.taskId,
1855
+ agentId: request.agentId,
1856
+ graphId: request.graphId,
1857
+ nodeId: request.nodeId,
1858
+ prevNodeId: request.prevNodeId,
1859
+ coreSkillId: request.coreSkillId,
1860
+ masterSkillId: request.masterSkillId,
1861
+ identity: request.identity,
1862
+ });
1850
1863
  if (config.questionDriven === true) {
1851
1864
  const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1852
1865
  const nonEmptyString = (v) => {
@@ -1974,6 +1987,7 @@ export class WorexClientTasks {
1974
1987
  jobId: request.jobId,
1975
1988
  taskId: request.taskId,
1976
1989
  agentId: request.agentId,
1990
+ workScopeIdentity,
1977
1991
  traceCollector,
1978
1992
  traceTask: traceCollector
1979
1993
  ? {
@@ -2091,6 +2105,7 @@ export class WorexClientTasks {
2091
2105
  jobId: request.jobId,
2092
2106
  taskId: request.taskId,
2093
2107
  agentId: request.agentId,
2108
+ identity: workScopeIdentity,
2094
2109
  });
2095
2110
  }
2096
2111
  const contextMarkdown = buildSynthesizedContextMarkdown(payload);
@@ -2132,6 +2147,7 @@ export class WorexClientTasks {
2132
2147
  jobId: request.jobId,
2133
2148
  taskId: request.taskId,
2134
2149
  agentId: request.agentId,
2150
+ workScopeIdentity,
2135
2151
  traceCollector,
2136
2152
  traceTask: traceCollector
2137
2153
  ? {