@warlock.js/ai 4.3.0 → 4.4.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to `@warlock.js/ai` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 4.4.0 - 2026-06-21
8
+
9
+ ### Fixed
10
+
11
+ - **Planner: OpenAI strict structured-output 400.** The generated plan schema now lists every property in `required` (the optional `id` / `reason` / `dependsOn` are nullable) and no longer emits `minItems` / `maxItems`, so `ai.planner()` no longer fails with `400 Invalid schema for response_format … 'required' … Missing 'id'` against OpenAI strict `json_schema` mode. `maxSteps` and the non-empty-plan check are enforced at runtime / in `validate()`.
12
+ - **Report / result types no longer collapse to `never` under strict TypeScript.** The narrowing report types (`PlannerReport`, `OrchestratorReport`, `SupervisorReport`, `WorkflowReport`, `ToolCall`) and the two result types that re-declare `report` (`PlannerResult`, `OrchestratorResult`) now override the discriminant via `Omit<BaseReport, "type">` / `Omit<ExecuteResult, "report">` instead of intersecting `BaseReport & { type: "…" }`, so `result.report` no longer types as `never` (*"Property 'plan' does not exist on type 'never'"*). Type-only — no runtime change.
13
+
7
14
  ## 4.3.0 - 2026-06-21
8
15
 
9
16
  ### ⚠ BREAKING
package/cjs/index.cjs CHANGED
@@ -11747,23 +11747,20 @@ function resolvePrefix$1(prompt) {
11747
11747
  * (the planner still truncates the tail to `skipped` defensively).
11748
11748
  */
11749
11749
  function planSchema(capabilityNames, maxSteps) {
11750
- const stepsSchema = {
11751
- type: "array",
11752
- minItems: 1,
11753
- description: "Ordered steps to execute, one capability dispatch each.",
11754
- items: stepItemsSchema(capabilityNames)
11755
- };
11756
- if (maxSteps !== void 0) stepsSchema.maxItems = maxSteps;
11757
11750
  const jsonSchema = {
11758
11751
  type: "object",
11759
11752
  properties: {
11760
11753
  summary: {
11761
- type: "string",
11754
+ type: ["string", "null"],
11762
11755
  description: "One-line summary of the overall strategy."
11763
11756
  },
11764
- steps: stepsSchema
11757
+ steps: {
11758
+ type: "array",
11759
+ description: "Ordered steps to execute, one capability dispatch each.",
11760
+ items: stepItemsSchema(capabilityNames)
11761
+ }
11765
11762
  },
11766
- required: ["steps"],
11763
+ required: ["summary", "steps"],
11767
11764
  additionalProperties: false
11768
11765
  };
11769
11766
  return { "~standard": {
@@ -11794,7 +11791,7 @@ function stepItemsSchema(capabilityNames) {
11794
11791
  type: "object",
11795
11792
  properties: {
11796
11793
  id: {
11797
- type: "string",
11794
+ type: ["string", "null"],
11798
11795
  description: "Stable step id, referenced by dependsOn."
11799
11796
  },
11800
11797
  capability: {
@@ -11807,16 +11804,22 @@ function stepItemsSchema(capabilityNames) {
11807
11804
  description: "Concrete input passed to the capability's execute()."
11808
11805
  },
11809
11806
  reason: {
11810
- type: "string",
11807
+ type: ["string", "null"],
11811
11808
  description: "Why this step exists."
11812
11809
  },
11813
11810
  dependsOn: {
11814
- type: "array",
11811
+ type: ["array", "null"],
11815
11812
  items: { type: "string" },
11816
11813
  description: "Ids of steps this one conceptually follows."
11817
11814
  }
11818
11815
  },
11819
- required: ["capability", "input"],
11816
+ required: [
11817
+ "id",
11818
+ "capability",
11819
+ "input",
11820
+ "reason",
11821
+ "dependsOn"
11822
+ ],
11820
11823
  additionalProperties: false
11821
11824
  };
11822
11825
  }