@ax-llm/ax 21.0.8 → 21.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ax-llm/ax",
3
- "version": "21.0.8",
3
+ "version": "21.0.9",
4
4
  "type": "module",
5
5
  "description": "The best library to work with LLMs",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent-memory-skills
3
3
  description: This skill helps an LLM generate correct AxAgent memory retrieval and dynamic skill-loading code using @ax-llm/ax. Use when the user asks about onMemoriesSearch, recall(...), inputs.memories, onLoadedMemories, onUsedMemories, onSkillsSearch, discover({ skills }), onLoadedSkills, onUsedSkills, preloaded skills, loaded memory/skill IDs, or carrying memories across forward() calls.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent Memory And Skills Rules (@ax-llm/ax)
@@ -138,7 +138,12 @@ import type { AxAgentSkillsSearchFn } from '@ax-llm/ax';
138
138
  // Each result is { id?: string; name: string; content: string }.
139
139
  // If id is omitted, Ax falls back to name.
140
140
  const onSkillsSearch: AxAgentSkillsSearchFn = async (searches) => {
141
- return mySkillStore.searchBatch(searches, { topK: 2 });
141
+ return mySkillStore.resolveBatch(searches, {
142
+ // Recommended backend order: exact id, exact name, then broader search.
143
+ // This lets the actor pass one simple string and keeps lookup policy host-side.
144
+ strategy: ['id', 'name', 'search'],
145
+ topK: 2,
146
+ });
142
147
  };
143
148
 
144
149
  const myAgent = agent('task:string -> answer:string', {
@@ -170,6 +175,7 @@ await discover({ skills: ['release-checklist', 'incident-response'] });
170
175
  Rules:
171
176
 
172
177
  - `discover({ skills })` invokes `onSkillsSearch` with the raw search strings and returns `void`.
178
+ - Resolve each raw string backend-side: prefer an exact `id` match, then an exact `name` match, then fuzzy/full-text search. The actor should not have to choose `id:` vs `name:` syntax.
173
179
  - Matched skills land under "Loaded Skills" for the next turn.
174
180
  - Entries are deduped by `id` (last-write-wins) and sorted by `id` for prefix-cache stability.
175
181
  - If a skill result omits `id`, its trimmed `name` is used as the id for backwards compatibility.
@@ -192,7 +198,7 @@ const releaseAgent = agent('task:string -> answer:string', {
192
198
  contextFields: [],
193
199
  skills: [
194
200
  {
195
- id: 'skill:release-checklist',
201
+ id: 'release-checklist',
196
202
  name: 'release-checklist',
197
203
  content: '...',
198
204
  },
@@ -205,7 +211,7 @@ await releaseAgent.forward(
205
211
  {
206
212
  skills: [
207
213
  {
208
- id: 'skill:incident-response',
214
+ id: 'incident-response',
209
215
  name: 'incident-response',
210
216
  content: '...',
211
217
  },
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent-observability
3
3
  description: This skill helps an LLM generate correct AxAgent observability code using @ax-llm/ax. Use when the user asks about actorTurnCallback, executorTurnCallback, onContextEvent, agentStatusCallback, onFunctionCall, reportSuccess, reportFailure, getChatLog(), getUsage(), resetUsage(), debug traces, progress updates, or telemetry for AxAgent runs.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent Observability Rules (@ax-llm/ax)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent-optimize
3
3
  description: This skill helps an LLM generate correct AxAgent tuning and evaluation code using @ax-llm/ax. Use when the user asks about agent.optimize(...), judgeOptions, eval datasets, optimization targets, saved optimizedProgram artifacts, or recursive optimization guidance.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent Optimize Codegen Rules (@ax-llm/ax)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent-rlm
3
3
  description: This skill helps an LLM generate correct AxAgent RLM/runtime code using @ax-llm/ax. Use when the user asks about RLM code execution, AxJSRuntime, contextFields, contextPolicy, liveRuntimeState, promptLevel, stage prompt controls, executorModelPolicy, maxRuntimeChars, agent.test(...), llmQuery(...), mode: 'advanced', recursionOptions, or long-running agent runtime behavior.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent RLM Runtime Rules (@ax-llm/ax)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent
3
3
  description: This skill helps an LLM generate correct core AxAgent code using @ax-llm/ax. Use when the user asks about agent(), child agents, namespaced functions, discovery mode, clarification, bubbleErrors, host-side final/clarification protocol, or ordinary agent runtime behavior. For RLM/code-runtime work use ax-agent-rlm; for callbacks and telemetry use ax-agent-observability; for recall/memory/skill loading use ax-agent-memory-skills; for agent.optimize(...) use ax-agent-optimize.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent Codegen Rules (@ax-llm/ax)
package/skills/ax-ai.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-ai
3
3
  description: This skill helps an LLM generate correct AI provider setup and configuration code using @ax-llm/ax. Use when the user asks about ai(), providers, models, presets, embeddings, extended thinking, context caching, or mentions OpenAI/Anthropic/Google/Azure/Groq/DeepSeek/Mistral/Cohere/Together/Ollama/HuggingFace/Reka/OpenRouter with @ax-llm/ax.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AI Provider Codegen Rules (@ax-llm/ax)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-audio
3
3
  description: This skill helps an LLM generate correct conversational audio I/O code with @ax-llm/ax. Use when the user asks about .chat() audio input, audio output, OpenAI gpt-audio or realtime models, Gemini Live native audio, Grok Voice Agent models, voices, formats, transcripts, or how audio fits with signatures and structured outputs.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # Audio I/O Codegen Rules (@ax-llm/ax)
package/skills/ax-flow.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-flow
3
3
  description: This skill helps an LLM generate correct AxFlow workflow code using @ax-llm/ax. Use when the user asks about flow(), AxFlow, workflow orchestration, parallel execution, DAG workflows, conditional routing, map/reduce patterns, or multi-node AI pipelines.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxFlow Codegen Rules (@ax-llm/ax)
package/skills/ax-gen.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-gen
3
3
  description: This skill helps an LLM generate correct AxGen code using @ax-llm/ax. Use when the user asks about ax(), AxGen, generators, forward(), streamingForward(), assertions, field processors, step hooks, self-tuning, or structured outputs.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxGen Codegen Rules (@ax-llm/ax)
@@ -264,6 +264,23 @@ Rules:
264
264
  - `thinkingTokenBudget` can be `'low'`, `'medium'`, `'high'`, or a number.
265
265
  - Set `showThoughts: true` to include the model's reasoning in `result.thought`.
266
266
 
267
+ ## Structured Outputs
268
+
269
+ ```typescript
270
+ const sig = f()
271
+ .input('text', f.string())
272
+ .output('summary', f.string())
273
+ .output('metadata', f.json().optional())
274
+ .useStructured()
275
+ .build();
276
+ ```
277
+
278
+ Rules:
279
+
280
+ - `.useStructured()` asks providers with native support, including OpenAI, Anthropic, and Gemini, for schema-constrained JSON.
281
+ - Native structured-output schemas list every object property in `required`, set `additionalProperties: false` on objects, and express optional fields as nullable types.
282
+ - Flexible `json` fields and unshaped `object` fields are sent as JSON-encoded strings for native structured outputs, then parsed back into normal JavaScript values.
283
+
267
284
  ## Step Hooks
268
285
 
269
286
  ```typescript
package/skills/ax-gepa.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-gepa
3
3
  description: This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Use when the user asks about AxGEPA, GEPA, Pareto optimization, multi-objective prompt tuning, reflective prompt evolution, validationExamples, maxMetricCalls, or optimizing a generator, flow, or agent tree.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxGEPA Codegen Rules (@ax-llm/ax)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-learn
3
3
  description: This skill helps an LLM generate correct AxLearn code using @ax-llm/ax. Use when the user asks about self-improving agents, trace-backed learning, feedback-aware updates, or AxLearn modes.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # AxLearn Codegen Rules (@ax-llm/ax)
package/skills/ax-llm.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-llm
3
3
  description: This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications. Use when the user asks about ax(), ai(), f(), s(), agent(), flow(), AxGen, AxAgent, AxFlow, signatures, streaming, or mentions @ax-llm/ax.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # Ax Library (@ax-llm/ax) Quick Reference
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-signature
3
3
  description: This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.
4
- version: "21.0.8"
4
+ version: "21.0.9"
5
5
  ---
6
6
 
7
7
  # Ax Signature Reference