@nexalab/agent-sdk 0.1.7 → 0.1.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/dist/guided-flows/runtime.d.ts +25 -0
- package/dist/guided-flows/runtime.d.ts.map +1 -1
- package/dist/guided-flows/runtime.js +632 -75
- package/dist/guided-flows/runtime.js.map +1 -1
- package/dist/guided-flows/types.d.ts +23 -0
- package/dist/guided-flows/types.d.ts.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +16 -1
- package/dist/mcp.js.map +1 -1
- package/dist/openai-compatible.d.ts +6 -0
- package/dist/openai-compatible.d.ts.map +1 -1
- package/dist/openai-compatible.js +2 -1
- package/dist/openai-compatible.js.map +1 -1
- package/dist/structured-output.d.ts +15 -1
- package/dist/structured-output.d.ts.map +1 -1
- package/dist/structured-output.js +25 -2
- package/dist/structured-output.js.map +1 -1
- package/package.json +1 -1
|
@@ -92,6 +92,31 @@ export declare class GuidedFlowRuntime {
|
|
|
92
92
|
}): Promise<GuidedFlow | undefined>;
|
|
93
93
|
runTurn(input: GuidedFlowTurnInput): Promise<GuidedFlowTurnOutcome>;
|
|
94
94
|
private driveFlow;
|
|
95
|
+
/** The model-driven reply pass: composes text and may call the active step's tools. Only reached when a step has no `prompt`, or does but still has tools available (e.g. a validation step, which needs the model to react to a tool result/error dynamically). */
|
|
96
|
+
private runReplyPass;
|
|
97
|
+
/**
|
|
98
|
+
* Deterministically calls a step's single applicable tool when its arguments are fully
|
|
99
|
+
* resolvable without asking a model to decide anything. Covers two shapes:
|
|
100
|
+
*
|
|
101
|
+
* 1. A silent tool-only step (no `collect`, exactly one required tool) where every input
|
|
102
|
+
* property already resolves to a known value in `state` (matched by property name,
|
|
103
|
+
* case-insensitively — the generator's convention of lowercase-flattened field names makes
|
|
104
|
+
* this a reliable match in practice).
|
|
105
|
+
* 2. A `collect` step whose only useful action is resolving the user's free text against a
|
|
106
|
+
* dynamic list (an address, a product, a time slot): exactly one tool in `tools.allowed`
|
|
107
|
+
* has a `verbatimTextArg` mapping configured. Which tool to call isn't ambiguous and the
|
|
108
|
+
* argument that matters most — the user's own words — is already pinned to the raw turn
|
|
109
|
+
* text, so there's nothing left for a model to compose either. (Caught live: asked to do
|
|
110
|
+
* the exact same thing, a model sometimes narrates — "voy a consultar..." — instead of
|
|
111
|
+
* actually emitting the tool call, leaving the user with a blank reply.)
|
|
112
|
+
*
|
|
113
|
+
* Returns `undefined` — never partially constructed input — the moment any other required
|
|
114
|
+
* property can't be confidently resolved, so the caller falls back to the model-driven
|
|
115
|
+
* `runReplyPass` exactly as before. Bypasses the harness too: this never asks a model
|
|
116
|
+
* anything, so a custom `ModelHarness` has nothing to intercept here (same reasoning as the
|
|
117
|
+
* `step.prompt` verbatim path).
|
|
118
|
+
*/
|
|
119
|
+
private tryAutoInvokeRequiredTool;
|
|
95
120
|
private applyPatch;
|
|
96
121
|
private announceStepChange;
|
|
97
122
|
private forwardNativeEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/guided-flows/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":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