@exellix/ai-tasks 8.4.0 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +81 -68
  2. package/dist/core/task-sdk.d.ts.map +1 -1
  3. package/dist/core/task-sdk.js +1 -0
  4. package/dist/core/task-sdk.js.map +1 -1
  5. package/dist/invocation/defaultAiProfilesResolveOptions.d.ts.map +1 -1
  6. package/dist/invocation/defaultAiProfilesResolveOptions.js +5 -4
  7. package/dist/invocation/defaultAiProfilesResolveOptions.js.map +1 -1
  8. package/dist/invocation/resolveProfileInvocationRouting.d.ts.map +1 -1
  9. package/dist/invocation/resolveProfileInvocationRouting.js +7 -16
  10. package/dist/invocation/resolveProfileInvocationRouting.js.map +1 -1
  11. package/dist/utils/aiProfileModelFormat.d.ts +13 -5
  12. package/dist/utils/aiProfileModelFormat.d.ts.map +1 -1
  13. package/dist/utils/aiProfileModelFormat.js +34 -22
  14. package/dist/utils/aiProfileModelFormat.js.map +1 -1
  15. package/dist/utils/concreteModelId.d.ts.map +1 -1
  16. package/dist/utils/concreteModelId.js +4 -2
  17. package/dist/utils/concreteModelId.js.map +1 -1
  18. package/dist/utils/resolveAiProfileModel.d.ts +1 -1
  19. package/dist/utils/resolveAiProfileModel.d.ts.map +1 -1
  20. package/dist/utils/resolveAiProfileModel.js +1 -6
  21. package/dist/utils/resolveAiProfileModel.js.map +1 -1
  22. package/documenations/upstream-feature-requests/README.md +4 -3
  23. package/documenations/upstream-feature-requests/ai-skills-orchestrator-invoke-contract-5.9.md +6 -7
  24. package/documenations/upstream-feature-requests/ai-tasks-wrap-up-after-upstream.md +1 -1
  25. package/documenations/upstream-feature-requests/xynthesis-orchestrator-invoke-contract-4.2.md +16 -7
  26. package/package.json +4 -4
package/README.md CHANGED
@@ -4,6 +4,18 @@ Private Git/npm package for executing **tasks** using the Woreces execution stac
4
4
 
5
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
+ **Breaking — 8.4+ LLM invoke contract (no legacy):** Every `runTask` requires **`modelConfig.preActionModel`**, **`modelConfig.skillModel`**, and **`modelConfig.postActionModel`**. Do **not** send `xynthesisModel`, root `modelConfig.model`, `maxTokens`, `maxTokensCap`, or graph-era tier names (`weak` / `strong`). Token budgets are owned by **Optimixer** in `@exellix/ai-skills` (MAIN) and `@exellix/xynthesis` (PRE/POST). Send **`outputExpectation`** (xynthesis) and optional **`reasoningEffort`**, **`temperature`**, **`topP`**. See [How completion budgets work](#how-completion-budgets-work-84) and [Model profile aliases](#model-profile-aliases-x12iai-profiles).
8
+
9
+ ### Stack alignment (8.4+)
10
+
11
+ | Package | Role in `runTask` | Minimum |
12
+ |---------|-------------------|---------|
13
+ | `@x12i/ai-profiles` | Profile/shortcut → wire model (`catalogLane` required on resolve) | **2.1.0** |
14
+ | `@exellix/xynthesis` | PRE synthesis, POST audit/polish, scoping, utilities (`executeXynthesisAction`) | **4.3.0** |
15
+ | `@exellix/ai-skills` | MAIN `runSkill` (Optimixer caps, `ModelConfig.reasoningEffort`) | **6.0.0** |
16
+
17
+ Use explicit **ai-profiles** profile keys (`cheap`, `pro`, `cyber`, …) or **shortcuts** (`cheapest`, `default`, …) or **`profile/choice`** keys — not removed sync helpers or legacy tier aliases.
18
+
7
19
  **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
20
 
9
21
  **Execution pipeline (optional):** You can use `executionPipeline` (array of pre/main/post steps) instead of a single `executionType`. PRE steps include `synthesized-context`; POST steps include `audit` (quality-gate loop) and `polish` (refinement checklist). See [BREAKING-CHANGES.md](BREAKING-CHANGES.md) for migration. When `executionPipeline` is omitted, existing `executionType` behavior is unchanged.
@@ -313,11 +325,11 @@ const res = await tasks.runTask({
313
325
  // optional
314
326
  variables: { orgName: "Acme" },
315
327
  modelConfig: {
316
- preActionModel: "balanced",
317
- postActionModel: "balanced",
328
+ preActionModel: "cheap",
329
+ postActionModel: "cheap",
318
330
  skillModel: "openai/gpt-5",
319
331
  temperature: 0.7,
320
- maxTokens: 2000
332
+ topP: 0.9,
321
333
  },
322
334
  jobId: "job-1",
323
335
  agentId: "agent-1",
@@ -447,7 +459,7 @@ const expected = await analyzeExpectedRunTaskInput({
447
459
  });
448
460
  ```
449
461
 
450
- Each issue has **`code`**, **`severity`** (`error` \| `warning`), **`message`**, and optional **`path`** (e.g. `smartInput.paths[0].path`, `llmCall.maxTokensCap`). See [`.docs/flow-io/`](.docs/flow-io/flow-README.md) for flow-level wiring.
462
+ Each issue has **`code`**, **`severity`** (`error` \| `warning`), **`message`**, and optional **`path`** (e.g. `smartInput.paths[0].path`, `modelConfig.preActionModel`). See [`.docs/flow-io/`](.docs/flow-io/flow-README.md) for flow-level wiring.
451
463
 
452
464
  ### Skill request analysis (`@exellix/ai-skills` 5.6+)
453
465
 
@@ -1053,28 +1065,20 @@ Use **`RunTaskResponseWithSteps<TParsed>`** when you expect steps; it extends `R
1053
1065
 
1054
1066
  ---
1055
1067
 
1056
- ## How max tokens are resolved (automation + caller controls)
1068
+ ## How completion budgets work (8.4+)
1057
1069
 
1058
- `@exellix/xynthesis` 3.1+ ships `resolveMaxTokens` a deterministic function that picks the right `maxTokens` for any LLM call from `(inputText, outputExpectation, modelId, callerMaxTokens?, structuredOutput?)`. `@exellix/ai-tasks` invokes it on **every** xynthesis-backed call (PRE synthesis, AI scoping, POST audit, POST polish, structured-repair fallback) so callers don't have to pick a number.
1070
+ Orchestrators send **model** + **sampling** + **`reasoningEffort`** + (for xynthesis) **`outputExpectation`**. They do **not** send completion token counts.
1059
1071
 
1060
- **The pipeline is:**
1072
+ | Phase | Package | Caller sends | Package owns |
1073
+ |-------|---------|--------------|--------------|
1074
+ | **MAIN** | `@exellix/ai-skills` ≥6 | `modelConfig` → `{ model, temperature, topP, reasoningEffort, … }` | Optimixer + Catalox skill catalog (`maxTokens` on `ModelConfig` is rejected) |
1075
+ | **PRE / POST / scoping / utility** | `@exellix/xynthesis` ≥4.3 | `outputExpectation` (required on every hop), optional `reasoningEffort`, `temperature`, `topP` | `resolveEffectiveMaxTokens` inside `executeXynthesisAction` |
1061
1076
 
1062
- 1. **Estimate input tokens** from `inputText` (system + user + extra material) using `xynthesis.estimateTokens`.
1063
- 2. **Resolve the effective `OutputExpectation`** = caller's `llmCall.outputExpectation` → per-action default (`xynthesis.resolveOutputExpectation('synthesis' | 'audit' | 'fix' | 'pick-best' | 'craft-final')`) → stage-local default (e.g. AI scoping uses `{ size: { mode: "absolute", minWords: 5, maxWords: 200 }, density: "concise" }`) → xynthesis package fallback.
1064
- 3. **Compute estimated output tokens** from the expectation (absolute words → tokens; relative → ratio × input tokens), multiplied by `headroomMultiplier(density)` and (if `structuredOutput`) the structured-output factor.
1065
- 4. **Cap at the model's `maxOutputTokens`** from `getModelCapabilities(modelId)` (unknown models fall back to `{ contextWindow: 128_000, maxOutputTokens: 4_096, completionTokenCost: "medium" }`).
1066
- 5. **Honor the caller's `maxTokensCap`** as a HARD CEILING — the auto-sizer can pick a smaller number, but never larger.
1067
- 6. The `resolveMaxTokens` result (`{ maxTokens, reason: "computed" | "caller-override" | "model-ceiling" | "fallback", diagnostics: { … } }`) is forwarded to xynthesis as `tokenResolutionMetadata` and surfaced in trace mode as `LlmCallObservation.request.tokenResolution`.
1077
+ **Xynthesis `outputExpectation`** is sizing/density **intent** for Optimixer not a literal token count. ai-tasks resolves a per-stage default when the caller omits it (`resolveOutputExpectation` / `resolveLlmOutputExpectationForXynthesis`).
1068
1078
 
1069
- **To adjust per-call dynamically** (without losing the automation):
1079
+ **Rejected on the wire (validation):** `modelConfig.maxTokens`, `llmCall.maxTokens`, `llmCall.maxTokensCap`, deprecated `xynthesisModel`, root `modelConfig.model`.
1070
1080
 
1071
- - Set `llmCall.outputExpectation` to bias the auto-sizer toward smaller / larger / denser output.
1072
- - Set `llmCall.maxTokensCap` to bound the upper limit (e.g. for cost ceilings).
1073
- - Leave both unset to get the per-stage / per-action default.
1074
-
1075
- **MAIN skill (`runSkill`):** completion token budget is set **only** by `@exellix/ai-skills` (Optimixer + Catalox catalog). Do **not** put `maxTokens` on `modelConfig` — ai-skills ≥5.9 rejects caller `modelConfig.maxTokens`. `RunTaskRequest.llmCall.maxTokensCap` does **not** override MAIN today; it applies to xynthesis-backed stages (PRE synthesis, POST audit/polish, scoping, utilities) via `resolveMaxTokens`.
1076
-
1077
- **Xynthesis-backed stages:** use `llmCall.outputExpectation` and optional `llmCall.maxTokensCap` (hard ceiling on the auto-sizer). See [`documenations/upstream-feature-requests/ai-skills-llm-observability.md`](documenations/upstream-feature-requests/ai-skills-llm-observability.md) for parity requests (e.g. `outputExpectation` on `RunSkillRequest`).
1081
+ **Trace:** use `usage.maxTokensRequested` / `invokeSummary` diagnostics after invoke not pre-set caps on the request.
1078
1082
 
1079
1083
  ---
1080
1084
 
@@ -1084,14 +1088,16 @@ Use **`RunTaskResponseWithSteps<TParsed>`** when you expect steps; it extends `R
1084
1088
 
1085
1089
  | Path | Slot / field | Resolved before |
1086
1090
  |------|----------------|-----------------|
1087
- | **Xynthesis** (PRE synthesis, POST audit/polish, AI scoping, utilities) | `preActionModel`, `postActionModel`, `SynthesisConfig.llmCall.model`, `AuditConfig.llmCall.*`, `PolishConfig.llmCall`, `RunUtilityRequest.exec.model`, env fallbacks (`SYNTHESIS_MODEL`, `AUDIT_MODEL`, …) | `executeXynthesisAction` / `runPostStepLlmCall` |
1091
+ | **Xynthesis** (PRE synthesis, POST audit/polish, AI scoping, utilities) | `preActionModel`, `postActionModel`, step `llmCall.model`, `RunUtilityRequest.exec.model` | `executeXynthesisAction` / `runPostStepLlmCall` |
1088
1092
  | **ai-skills MAIN** | `skillModel`, `RunTaskRequest.llmCall.model` | `runSkill` (via `DirectExecutionStrategy`) |
1089
1093
 
1090
- **Accepted alias shapes:**
1094
+ **Accepted alias shapes** (`@x12i/ai-profiles` v2.1+):
1095
+
1096
+ - **Profile keys:** `cheap`, `fast`, `balanced`, `deep`, `pro`, `json`, `agentic`, `research`, `cyber`, …
1097
+ - **Shortcuts:** `cheapest`, `default`, `best`, `standard`, `thinking`, `schema`, …
1098
+ - **Explicit choice:** `cheap/default`, `pro@default`, …
1091
1099
 
1092
- - **ai-profiles profiles:** `cheap`, `fast`, `balanced`, `deep`, `pro`, `json`, `agentic`, `research`
1093
- - **ai-profiles shortcuts:** `cheapest`, `default`, `best`, `standard`, `thinking`, `schema`, `agent`, `web-research`, … (see `@x12i/ai-profiles` README)
1094
- - **Legacy graph tiers:** `weak` → `cheap`, `strong` → `pro`, `default` → `balanced`
1100
+ **Not accepted:** legacy graph tiers (`weak`, `strong`), deprecated `xynthesisModel`, or sync-only alias guessing removed in ai-profiles 2.1. Unknown keys fail at **`resolveAIProfile`** with a clear error.
1095
1101
 
1096
1102
  **Example (aliases on the request — resolved inside `runTask`):**
1097
1103
 
@@ -1118,7 +1124,7 @@ Concrete ids (`openrouter/...`, `anthropic/claude-sonnet-4`, `openai/gpt-5`, …
1118
1124
  - **No change** if you already send concrete provider model ids.
1119
1125
  - **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).
1120
1126
  - **Validation:** alias tokens on `modelConfig` slots are accepted; unknown aliases fail at resolution with a clear error.
1121
- - **Optional helpers** (for hosts/tests): `resolveModelReference`, `resolveRunTaskModelReferences`, `isResolvableModelAlias`.
1127
+ - **Helpers:** `resolveModelReference`, `resolveRunTaskModelReferences`, `isResolvableModelAlias` (true only for **`profile/choice`** keys and **shortcuts** — bare profile keys are resolved at invoke, not sync-listed).
1122
1128
 
1123
1129
  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).
1124
1130
 
@@ -1130,14 +1136,13 @@ Resolution uses the ai-profiles registry (`auto`: remote refresh with bundled fa
1130
1136
 
1131
1137
  ```typescript
1132
1138
  type LlmCallConfig = {
1133
- model?: string; // provider/model id or @x12i/ai-profiles alias (resolved at call time)
1134
- maxTokensCap?: number; // HARD CEILING for resolveMaxTokens (does NOT disable automation)
1135
- maxTokens?: number; // alias for maxTokensCap (backward compat)
1139
+ model?: string; // provider/model id or ai-profiles alias (resolved at call time)
1136
1140
  temperature?: number;
1137
1141
  topP?: number;
1138
- maxOutputLength?: number; // post-call character truncation
1142
+ reasoningEffort?: OptimixerReasoningEffort; // overrides Catalox default when set
1143
+ maxOutputLength?: number; // post-call character truncation
1139
1144
  timeoutMs?: number;
1140
- outputExpectation?: OutputExpectation; // drives resolveMaxTokens auto-sizing
1145
+ outputExpectation?: OutputExpectation; // xynthesis Optimixer intent (not a token count)
1141
1146
  };
1142
1147
  ```
1143
1148
 
@@ -1152,7 +1157,7 @@ type LlmCallConfig = {
1152
1157
  | POST audit (evaluator) | `AuditConfig.llmCall` or `AuditConfig.audit.llmCall` |
1153
1158
  | POST audit (synthesis-merge) | `AuditConfig.audit.synthesis.llmCall` |
1154
1159
  | POST polish | `PolishConfig.llmCall` |
1155
- | Utility (xynthesis-finalize) | `RunUtilityRequest.exec.{model, maxTokensCap, temperature, topP, outputExpectation, ...}` |
1160
+ | Utility (xynthesis-finalize) | `RunUtilityRequest.exec.{model, temperature, topP, reasoningEffort, outputExpectation, ...}` |
1156
1161
 
1157
1162
  **Builder helpers (`TaskRequestBuilder`):**
1158
1163
 
@@ -1170,7 +1175,6 @@ type LlmCallConfig = {
1170
1175
  |---------------------|--------|
1171
1176
  | `AUDIT_MODEL`, `POLISH_MODEL`, `SYNTHESIS_MODEL`, `AI_SCOPING_MODEL` | Model override for that stage |
1172
1177
  | `AUDIT_TIMEOUT_MS`, `POLISH_TIMEOUT_MS`, `SYNTHESIS_TIMEOUT_MS`, `AI_SCOPING_TIMEOUT_MS` | Per-call timeout override |
1173
- | `AUDIT_MAX_TOKENS_CAP`, `POLISH_MAX_TOKENS_CAP`, `SYNTHESIS_MAX_TOKENS_CAP` | Hard ceiling override |
1174
1178
  | `AUDIT_TEMPERATURE`, `POLISH_TEMPERATURE`, `SYNTHESIS_TEMPERATURE` | Temperature override |
1175
1179
  | `AUDIT_TOP_P`, `POLISH_TOP_P`, `SYNTHESIS_TOP_P` | Top-P override |
1176
1180
  | `AUDIT_MAX_OUTPUT_LENGTH`, `POLISH_MAX_OUTPUT_LENGTH`, `SYNTHESIS_MAX_OUTPUT_LENGTH` | Post-call char truncation override |
@@ -1209,7 +1213,7 @@ When `RunTaskRequest.executionMode === "trace"` (or `RunUtilityRequest.exec.exec
1209
1213
  type LlmCallObservation =
1210
1214
  | {
1211
1215
  source: "xynthesis"; stage: LlmCallStage; stepId?: string;
1212
- request: LlmCallRequestSnapshot; // includes resolved tokenResolution from resolveMaxTokens
1216
+ request: LlmCallRequestSnapshot;
1213
1217
  summary?: InvokeAttemptSummary; // from executeXynthesisAction on success / typed errors on failure
1214
1218
  debugTrace?: XynthesisDebugTrace; // present when executionMode: "trace" was forwarded
1215
1219
  durationMs: number; ok: boolean; error?: { name: string; message: string };
@@ -1249,7 +1253,6 @@ import {
1249
1253
  type LlmCallConfig,
1250
1254
  type InvokeAttemptSummary,
1251
1255
  type RunSkillDiagnostics,
1252
- resolveMaxTokens,
1253
1256
  resolveOutputExpectation,
1254
1257
  ACTION_OUTPUT_DEFAULTS,
1255
1258
  getModelCapabilities,
@@ -1263,17 +1266,26 @@ import { runTask, type LlmCallConfig } from "@exellix/ai-tasks";
1263
1266
 
1264
1267
  const llmCall: LlmCallConfig = {
1265
1268
  model: "gpt-5-mini",
1266
- maxTokensCap: 4096, // hard ceiling
1267
1269
  outputExpectation: { size: { kind: "absolute", maxWords: 600 }, density: "default" },
1268
1270
  temperature: 0.4,
1271
+ reasoningEffort: "medium",
1269
1272
  };
1270
1273
 
1271
1274
  const result = await runTask({
1272
1275
  skillKey: "tasks/security-risk-summary",
1276
+ agentId: "agent-1",
1277
+ jobTypeId: "security-job",
1278
+ taskTypeId: "security-task",
1279
+ executionStrategies: [],
1280
+ modelConfig: {
1281
+ preActionModel: "cheap",
1282
+ postActionModel: "cheap",
1283
+ skillModel: "balanced",
1284
+ },
1273
1285
  input: { assetId: "a-123" },
1274
1286
  executionMode: "trace",
1275
1287
  llmCall,
1276
- aiScopingOptions: { llmCall: { model: "gpt-5-nano", maxTokensCap: 512 } },
1288
+ aiScopingOptions: { llmCall: { model: "cheap", outputExpectation: { size: { kind: "absolute", maxWords: 200 }, density: "concise" } } },
1277
1289
  // executionPipeline: [{ phase: "pre", type: "synthesized-context", config: { llmCall } }, { phase: "main", type: "direct" }],
1278
1290
  });
1279
1291
 
@@ -1864,7 +1876,7 @@ Builder class for constructing task requests with a fluent API.
1864
1876
  - `withGraphId(graphId: string): this` - Set graph identifier
1865
1877
  - `withNodeId(nodeId: string): this` - Set node identifier
1866
1878
  - `withPrevNodeId(prevNodeId: string): this` - Set previous node identifier
1867
- - `withModelConfig(modelConfig: ModelConfig): this` - Set model configuration (model, temperature, maxTokens, etc.)
1879
+ - `withModelConfig(modelConfig: RunTaskModelConfig): this` - Set the required 3-slot model triplet + tuning
1868
1880
  - `withTemplateRenderOptions(templateRenderOptions: TemplateRenderOptions): this` - Per-task gateway / parser template overrides (v4)
1869
1881
  - `withTemplateTokens(templateTokens: GatewayTemplateTokens): this` - Per-task `templateTokens` overlay
1870
1882
  - `withTimeout(timeoutMs: number): this` - Set timeout
@@ -1886,9 +1898,10 @@ const request = new TaskRequestBuilder()
1886
1898
  .withAiSkillsCorrelation("my-agent", "my-job-type", "my-task-type")
1887
1899
  .withExecutionStrategies([]) // [] = plain MAIN; omit only if you rely on build() defaulting strategies to []
1888
1900
  .withModelConfig({
1889
- model: "gpt-5",
1901
+ preActionModel: "cheap",
1902
+ postActionModel: "cheap",
1903
+ skillModel: "gpt-5",
1890
1904
  temperature: 0.7,
1891
- maxTokens: 2000
1892
1905
  })
1893
1906
  .withJobMemory(jobMemory)
1894
1907
  .withTaskMemory(taskMemory)
@@ -1947,7 +1960,7 @@ interface RunTaskRequest {
1947
1960
  jobMemory?: JobHistory; // History of previous task results
1948
1961
  taskMemory?: TaskHistory; // History of skills executed
1949
1962
  executionMemory?: ExecutionHistory; // History of execution context (execution-level memory)
1950
- modelConfig?: ModelConfig; // Model configuration (model, temperature, maxTokens, etc.)
1963
+ modelConfig: RunTaskModelConfig; // Required 3-slot triplet + optional tuning
1951
1964
  jobId?: string;
1952
1965
 
1953
1966
  // Graph execution context (optional)
@@ -2106,36 +2119,34 @@ Exported type for **`RunTaskRequest.narrix`**. Includes **`datasetId`**, optiona
2106
2119
  import type { NarrixPreProcessorConfig } from "@exellix/ai-tasks";
2107
2120
  ```
2108
2121
 
2109
- ### `ModelConfig`
2122
+ ### `RunTaskModelConfig`
2110
2123
 
2111
- Model configuration for per-request model selection and generation parameters:
2124
+ Required on every `runTask()` three slots plus optional tuning (no `maxTokens`, no legacy `model` / `xynthesisModel`):
2112
2125
 
2113
2126
  ```typescript
2114
- import type { ModelConfig } from "@exellix/ai-tasks";
2115
-
2116
- interface ModelConfig {
2117
- model?: string; // Model identifier (e.g., "gpt-5")
2118
- modelId?: string; // Provider-specific model ID
2119
- provider?: string; // Provider name (e.g., "openai", "anthropic")
2120
- temperature?: number; // 0.0 to 2.0 - Controls randomness
2121
- maxTokens?: number; // Maximum tokens to generate
2122
- topP?: number; // 0.0 to 1.0 - Nucleus sampling
2123
- frequencyPenalty?: number; // -2.0 to 2.0
2124
- presencePenalty?: number; // -2.0 to 2.0
2125
- stop?: string[]; // Stop sequences
2126
- [key: string]: any; // Additional provider-specific parameters
2127
+ import type { RunTaskModelConfig } from "@exellix/ai-tasks";
2128
+
2129
+ interface RunTaskModelConfig {
2130
+ preActionModel: string; // ai-profiles alias (xynthesis PRE)
2131
+ skillModel: string; // alias or concrete id (ai-skills MAIN)
2132
+ postActionModel: string; // ai-profiles alias (xynthesis POST)
2133
+ temperature?: number;
2134
+ topP?: number;
2135
+ reasoningEffort?: OptimixerReasoningEffort;
2136
+ frequencyPenalty?: number;
2137
+ presencePenalty?: number;
2127
2138
  }
2128
2139
  ```
2129
2140
 
2130
- **Example (concrete ids or aliases):**
2141
+ **Example:**
2131
2142
  ```typescript
2132
- const modelConfig = {
2143
+ const modelConfig: RunTaskModelConfig = {
2133
2144
  preActionModel: "cheap",
2134
2145
  postActionModel: "cheap",
2135
- skillModel: "balanced",
2146
+ skillModel: "cyber",
2136
2147
  temperature: 0.7,
2137
- maxTokens: 2000,
2138
- topP: 0.9
2148
+ topP: 0.9,
2149
+ reasoningEffort: "medium",
2139
2150
  };
2140
2151
 
2141
2152
  const result = await runTask({
@@ -2334,11 +2345,12 @@ const result = await tasks.runTask({
2334
2345
  executionType: ExecutionType.DIRECT,
2335
2346
  input: { data: "analyze this" },
2336
2347
  modelConfig: {
2337
- model: "gpt-5",
2348
+ preActionModel: "cheap",
2349
+ postActionModel: "cheap",
2350
+ skillModel: "gpt-5",
2338
2351
  temperature: 0.7,
2339
- maxTokens: 2000,
2340
- topP: 0.9
2341
- }
2352
+ topP: 0.9,
2353
+ },
2342
2354
  });
2343
2355
 
2344
2356
  // Or using the builder
@@ -2350,9 +2362,10 @@ const request = new TaskRequestBuilder()
2350
2362
  .withAiSkillsCorrelation("agent-1", "analysis-job", "analysis-task")
2351
2363
  .withExecutionStrategies([])
2352
2364
  .withModelConfig({
2353
- model: "gpt-5",
2365
+ preActionModel: "cheap",
2366
+ postActionModel: "cheap",
2367
+ skillModel: "gpt-5",
2354
2368
  temperature: 0.5,
2355
- maxTokens: 4000
2356
2369
  })
2357
2370
  .build();
2358
2371
 
@@ -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;AA2BzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA2OxD,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAEF,qBAAa,gBAAgB;IAIzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;gBAGjC,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,EACD,OAAO,CAAC,EAAE,uBAAuB;IAQ7B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IA6kDtF;;OAEG;YACW,6BAA6B;IAqhB3C;;;;;OAKG;YACW,cAAc;CAyR7B"}
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;AA2BzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA2OxD,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAEF,qBAAa,gBAAgB;IAIzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;gBAGjC,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,EACD,OAAO,CAAC,EAAE,uBAAuB;IAQ7B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IA6kDtF;;OAEG;YACW,6BAA6B;IAshB3C;;;;;OAKG;YACW,cAAc;CAyR7B"}
@@ -2152,6 +2152,7 @@ export class WorexClientTasks {
2152
2152
  // Caller-supplied outputExpectation overrides the per-action default in the structured-repair path.
2153
2153
  outputExpectation: synthLlmCall.outputExpectation,
2154
2154
  reasoningEffort: synthLlmCall.reasoningEffort,
2155
+ topP: synthLlmCall.topP,
2155
2156
  // Forward trace mode so the structured gateway returns a `debugTrace` (lifted into observations elsewhere).
2156
2157
  executionMode: traceCollector ? "trace" : undefined,
2157
2158
  jobId: request.jobId,