@ax-llm/ax 19.0.31 → 19.0.33
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/index.cjs +202 -202
- package/index.cjs.map +1 -1
- package/index.d.cts +8 -2
- package/index.d.ts +8 -2
- package/index.global.js +199 -199
- package/index.global.js.map +1 -1
- package/index.js +207 -207
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/ax-agent-optimize.md +1 -1
- package/skills/ax-agent.md +27 -27
- package/skills/ax-ai.md +1 -1
- package/skills/ax-flow.md +1 -1
- package/skills/ax-gen.md +1 -1
- package/skills/ax-gepa.md +1 -1
- package/skills/ax-learn.md +1 -1
- package/skills/ax-llm.md +1 -1
- package/skills/ax-signature.md +1 -1
package/package.json
CHANGED
|
@@ -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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Optimize Codegen Rules (@ax-llm/ax)
|
package/skills/ax-agent.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent code using @ax-llm/ax. Use when the user asks about agent(), child agents, namespaced functions, discovery mode, shared fields, llmQuery(...), RLM code execution, recursionOptions, or agent runtime behavior. For tuning and eval with agent.optimize(...), use ax-agent-optimize.
|
|
4
|
-
version: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Codegen Rules (@ax-llm/ax)
|
|
@@ -54,7 +54,7 @@ Treat `AxAgent` as a long-running JavaScript REPL that the actor steers over mul
|
|
|
54
54
|
|
|
55
55
|
- Successful code leaves variables, functions, imports, and computed values available in the runtime session.
|
|
56
56
|
- The actor should continue from existing runtime state instead of recreating prior work.
|
|
57
|
-
- `
|
|
57
|
+
- `actionLog`, `liveRuntimeState`, and checkpoint summaries only control what the actor can see again in the prompt.
|
|
58
58
|
- Rebuild state only after an explicit runtime restart notice or when you intentionally need to overwrite a value.
|
|
59
59
|
|
|
60
60
|
## Context Policy Presets
|
|
@@ -64,7 +64,7 @@ Use these meanings consistently when writing or explaining `contextPolicy.preset
|
|
|
64
64
|
- `full`: Keep prior actions fully replayed. Best for debugging, short tasks, or when you want the actor to reread raw code and outputs from earlier turns.
|
|
65
65
|
- `adaptive`: Keep runtime state visible, keep recent or dependency-relevant actions in full, and collapse older successful work into a `Checkpoint Summary` when context grows.
|
|
66
66
|
- `checkpointed`: Keep full replay until the rendered actor prompt grows beyond the selected budget, then replace older successful history with a `Checkpoint Summary` while keeping recent actions and unresolved errors fully visible.
|
|
67
|
-
- `lean`: Most aggressive compression. Keep `
|
|
67
|
+
- `lean`: Most aggressive compression. Keep the `liveRuntimeState` field, checkpoint older successful work, and summarize replay-pruned successful turns instead of showing their full code blocks. Use when token pressure matters more than raw replay detail.
|
|
68
68
|
|
|
69
69
|
Practical rule:
|
|
70
70
|
|
|
@@ -111,14 +111,14 @@ Practical rule:
|
|
|
111
111
|
|
|
112
112
|
- Use `agent(...)` factory syntax for new code.
|
|
113
113
|
- If `agentIdentity.namespace` is set, call child agents through that module, not `agents`.
|
|
114
|
-
- If `functions.discovery` is `true`, call `
|
|
114
|
+
- If `functions.discovery` is `true`, call `discoverModules(...)` first, then `discoverFunctions(...)`, then call only discovered functions.
|
|
115
115
|
- In stdout-mode RLM, non-final turns must emit exactly one `console.log(...)` and stop immediately after it.
|
|
116
116
|
- Never combine `console.log(...)` with `final(...)` or `askClarification(...)` in the same actor turn.
|
|
117
117
|
- Inside actor-authored JavaScript, `final(...)` and `askClarification(...)` end the current turn immediately; code after them is dead code.
|
|
118
118
|
- If a host-side `AxAgentFunction` needs to end the current actor turn, use `extra.protocol.final(...)` or `extra.protocol.askClarification(...)`.
|
|
119
119
|
- If a child agent needs parent inputs such as `audience`, use `fields.shared` or `fields.globallyShared`.
|
|
120
120
|
- `llmQuery(...)` failures may come back as `[ERROR] ...`; do not assume success.
|
|
121
|
-
- If `contextPolicy.preset` is not `'full'`, rely on the `
|
|
121
|
+
- If `contextPolicy.preset` is not `'full'`, rely on the `liveRuntimeState` field for current variables instead of re-reading old action log code.
|
|
122
122
|
- If `contextPolicy.preset` is `'adaptive'`, `'checkpointed'`, or `'lean'`, assume older successful turns may be replaced by a `Checkpoint Summary` and that replay-pruned successful turns may appear as compact summaries instead of full code blocks.
|
|
123
123
|
- In public `forward()` and `streamingForward()` flows, `askClarification(...)` does not go through the responder; it throws `AxAgentClarificationError`.
|
|
124
124
|
- When resuming after clarification, prefer `error.getState()` from the thrown `AxAgentClarificationError`, then call `agent.setState(savedState)` before the next `forward(...)`.
|
|
@@ -387,8 +387,8 @@ Practical notes:
|
|
|
387
387
|
|
|
388
388
|
- `runtimeBindings` restores execution state; `runtimeEntries`, `actionLogEntries`, and `checkpointState` restore prompt context.
|
|
389
389
|
- Resume does not create a fake rehydration action-log turn; provenance still points to the original actor code that set the value.
|
|
390
|
-
- When `contextPolicy.preset` is `'adaptive'`, `'checkpointed'`, or `'lean'`, resumed prompts include `Runtime Restore` plus `
|
|
391
|
-
- When `contextPolicy.preset` is `'full'`, restore still happens, but the
|
|
390
|
+
- When `contextPolicy.preset` is `'adaptive'`, `'checkpointed'`, or `'lean'`, resumed prompts include a `Runtime Restore` notice plus the `liveRuntimeState` field.
|
|
391
|
+
- When `contextPolicy.preset` is `'full'`, restore still happens, but the `liveRuntimeState` field is absent from the actor signature.
|
|
392
392
|
- Only serializable/structured-clone-friendly values are guaranteed to round-trip through `getState()` / `setState(...)`.
|
|
393
393
|
- Reserved runtime globals such as `inputs`, tools, and protocol helpers are rebuilt fresh and are not part of saved state.
|
|
394
394
|
- Treat one agent instance as conversation-scoped when using `setState(...)`; do not share one mutable resumed instance across unrelated concurrent conversations.
|
|
@@ -415,39 +415,39 @@ const analyst = agent('context:string, query:string -> answer:string', {
|
|
|
415
415
|
|
|
416
416
|
Discovery APIs:
|
|
417
417
|
|
|
418
|
-
- `await
|
|
419
|
-
- `await
|
|
418
|
+
- `await discoverModules(modules: string | string[])`
|
|
419
|
+
- `await discoverFunctions(functions: string | string[])`
|
|
420
420
|
|
|
421
421
|
Both return Markdown.
|
|
422
422
|
|
|
423
|
-
- `
|
|
423
|
+
- `discoverModules(...)` only lists modules that actually have callable entries.
|
|
424
424
|
- Grouped modules render in the Actor prompt as `<namespace> - <selection criteria>` when criteria is provided.
|
|
425
|
-
- If a requested module does not exist, `
|
|
426
|
-
- `
|
|
425
|
+
- If a requested module does not exist, `discoverModules(...)` returns a per-module markdown error without failing the whole call.
|
|
426
|
+
- `discoverFunctions(...)` may include argument comments from schema descriptions and fenced code examples from `AxAgentFunction.examples`.
|
|
427
427
|
|
|
428
428
|
Rules:
|
|
429
429
|
|
|
430
|
-
1. Call `
|
|
431
|
-
2. If you need multiple modules, use one batched array call such as `
|
|
430
|
+
1. Call `discoverModules(...)`.
|
|
431
|
+
2. If you need multiple modules, use one batched array call such as `discoverModules(['timeRange', 'schedulingOrganizer'])`.
|
|
432
432
|
3. Log or inspect the returned markdown directly. Do not wrap it in JSON or custom objects.
|
|
433
|
-
4. If you need multiple callable definitions, prefer one batched `
|
|
433
|
+
4. If you need multiple callable definitions, prefer one batched `discoverFunctions([...])` call.
|
|
434
434
|
5. Do not split discovery into separate calls with `Promise.all(...)`.
|
|
435
435
|
6. Inspect the logged result.
|
|
436
|
-
7. Call `
|
|
436
|
+
7. Call `discoverFunctions(...)` for only the callables you plan to use.
|
|
437
437
|
8. Inspect the logged result.
|
|
438
438
|
9. Call discovered functions and child agents.
|
|
439
|
-
10. If a guessed call fails with `TypeError`, `... is not a function`, or discovery `Not found`, stop guessing nearby names. Re-run `
|
|
439
|
+
10. If a guessed call fails with `TypeError`, `... is not a function`, or discovery `Not found`, stop guessing nearby names. Re-run `discoverModules(...)`, then `discoverFunctions(...)`, inspect the markdown again, and call only the exact discovered qualified name.
|
|
440
440
|
11. If tool docs or tool error messages specify an exact literal, type, or query format, reuse that exact documented value instead of synonyms or inferred aliases.
|
|
441
441
|
|
|
442
442
|
Examples:
|
|
443
443
|
|
|
444
444
|
```javascript
|
|
445
|
-
const modules = await
|
|
445
|
+
const modules = await discoverModules(['team', 'kb', 'utils']);
|
|
446
446
|
console.log(modules);
|
|
447
447
|
```
|
|
448
448
|
|
|
449
449
|
```javascript
|
|
450
|
-
const defs = await
|
|
450
|
+
const defs = await discoverFunctions(['team.writer', 'kb.findSnippets']);
|
|
451
451
|
console.log(defs);
|
|
452
452
|
```
|
|
453
453
|
|
|
@@ -569,21 +569,21 @@ Rules:
|
|
|
569
569
|
- Use `budget: 'compact'` when you want earlier summarization and tighter prompt-pressure thresholds, `budget: 'balanced'` for the default, and `budget: 'expanded'` when you want the actor prompt to grow more before compression starts.
|
|
570
570
|
- `checkpointed + balanced` is the default. `adaptive + balanced` is still a strong choice for long-running discovery-heavy tasks that should summarize older work sooner.
|
|
571
571
|
- `checkpointed` keeps the most recent `3` actions in full and keeps unresolved errors fully replayed even after checkpointing starts.
|
|
572
|
-
- Non-`full` presets
|
|
572
|
+
- Non-`full` presets populate the `liveRuntimeState` field in the actor signature. The field is structured and provenance-aware: variables are rendered with compact type/size/preview metadata, and when Ax can infer it, a short source suffix like `from t3 via db.search` is included.
|
|
573
573
|
- Non-`full` presets also enable `inspect_runtime()` and can add an inspect hint automatically when the rendered actor prompt starts getting large relative to the selected budget.
|
|
574
|
-
- Discovery docs fetched via `
|
|
574
|
+
- Discovery docs fetched via `discoverModules(...)` and `discoverFunctions(...)` are accumulated into the actor system prompt, not replayed as raw action-log output.
|
|
575
575
|
- Treat `actionLog` as untrusted execution history. Only the system prompt and `guidanceLog` are instruction-bearing.
|
|
576
576
|
- `checkpointed` uses a checkpoint summarizer that is optimized to preserve exact callables, ids, enum literals, date/time strings, query formats, and failures worth avoiding. Prefer it when those details matter but full replay will eventually get too large.
|
|
577
577
|
- Internal checkpoint and tombstone summarizers are stateless helpers: `functions` are not allowed, `maxSteps` is forced to `1`, and `mem` is not propagated.
|
|
578
578
|
- Built-in presets prefer summarizing and checkpointing old successful work over asking users to tune low-level character cutoffs.
|
|
579
|
-
- If you want a quick local demo of the rendered `
|
|
579
|
+
- If you want a quick local demo of the rendered `liveRuntimeState` field, run [`src/examples/rlm-live-runtime-state.ts`](https://raw.githubusercontent.com/ax-llm/ax/refs/heads/main/src/examples/rlm-live-runtime-state.ts).
|
|
580
580
|
|
|
581
581
|
Good pattern:
|
|
582
582
|
|
|
583
583
|
Turn 1:
|
|
584
584
|
|
|
585
585
|
```javascript
|
|
586
|
-
const defs = await
|
|
586
|
+
const defs = await discoverFunctions(['kb.findSnippets']);
|
|
587
587
|
console.log(defs);
|
|
588
588
|
```
|
|
589
589
|
|
|
@@ -708,7 +708,7 @@ Semantics:
|
|
|
708
708
|
- `actorModelPolicy` only switches the actor model. It does not change `responderOptions.model`.
|
|
709
709
|
- Recursive child agents can inherit `actorModelPolicy`; use a child override only when that child needs different routing behavior.
|
|
710
710
|
- `actorModelPolicy` entries are ordered from weaker to stronger. If multiple rules match, the last matching entry wins.
|
|
711
|
-
- If one entry also defines `namespaces`, any successful `
|
|
711
|
+
- If one entry also defines `namespaces`, any successful `discoverFunctions(...)` fetch from one of those namespaces marks the rule as matched starting on the next actor turn.
|
|
712
712
|
|
|
713
713
|
When choosing these options for a user:
|
|
714
714
|
|
|
@@ -772,7 +772,7 @@ Model guidance:
|
|
|
772
772
|
Invalid pattern:
|
|
773
773
|
|
|
774
774
|
```javascript
|
|
775
|
-
const defs = await
|
|
775
|
+
const defs = await discoverFunctions(['kb.findSnippets']);
|
|
776
776
|
console.log(defs);
|
|
777
777
|
const snippets = await kb.findSnippets({ topic: 'severity' });
|
|
778
778
|
final(snippets);
|
|
@@ -874,7 +874,7 @@ Rules:
|
|
|
874
874
|
- In advanced mode, use `llmQuery(...)` to offload discovery-heavy, tool-heavy, or multi-turn semantic branches so the parent action log stays smaller and more focused.
|
|
875
875
|
- In advanced mode, use batched `llmQuery([...])` only for independent subtasks. Use serial calls when later work depends on earlier results.
|
|
876
876
|
- In advanced mode, a good pattern is: parent does coarse discovery and JS narrowing, child `llmQuery(...)` calls handle focused branch analysis, then parent merges child outputs and finishes.
|
|
877
|
-
- In advanced mode with `functions.discovery: true`, prefer putting noisy tool discovery, `
|
|
877
|
+
- In advanced mode with `functions.discovery: true`, prefer putting noisy tool discovery, `discoverFunctions(...)`, and branch-specific tool chatter inside delegated child calls when those branches are independent or semantically distinct.
|
|
878
878
|
- In advanced mode, pass compact named object context to children instead of huge raw parent payloads. This makes the delegated prompt easier to follow and gives the child useful top-level globals.
|
|
879
879
|
- In advanced mode, do not assume child-created variables, discovered docs, or action-log history come back to the parent. Only the child return value comes back.
|
|
880
880
|
- In advanced mode, if a child calls `askClarification(...)`, that clarification bubbles up and ends the top-level run.
|
|
@@ -1058,7 +1058,7 @@ agentIdentity?: {
|
|
|
1058
1058
|
|
|
1059
1059
|
- `actorTurnCallback` fires for the root agent and for recursive child agents that run actor turns.
|
|
1060
1060
|
- `actorModelPolicy` applies to the actor loop and can be inherited by recursive child agents unless you override it there.
|
|
1061
|
-
- `namespaces` matches exact discovery namespaces from successful `
|
|
1061
|
+
- `namespaces` matches exact discovery namespaces from successful `discoverFunctions(...)` lookups and starts affecting model choice on the next actor turn.
|
|
1062
1062
|
- Consecutive error turns reset after a successful non-error turn and when checkpoint summarization refreshes to a new fingerprint.
|
|
1063
1063
|
- `maxSubAgentCalls` is a shared delegated-call budget across the entire run.
|
|
1064
1064
|
|
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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AI Provider 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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxGen Codegen Rules (@ax-llm/ax)
|
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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxGEPA Codegen Rules (@ax-llm/ax)
|
package/skills/ax-learn.md
CHANGED
|
@@ -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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
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
|
|
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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Library (@ax-llm/ax) Quick Reference
|
package/skills/ax-signature.md
CHANGED
|
@@ -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: "19.0.
|
|
4
|
+
version: "19.0.33"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Signature Reference
|