@signalwire/sdk 3.6.0 → 3.7.2
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 +95 -0
- package/dist/AgentBase.d.ts +85 -1
- package/dist/AgentBase.js +157 -5
- package/dist/AgentBase.js.map +1 -1
- package/dist/AgentServer.d.ts +30 -6
- package/dist/AgentServer.js +28 -2
- package/dist/AgentServer.js.map +1 -1
- package/dist/ContextBuilder.d.ts +16 -5
- package/dist/ContextBuilder.js +15 -4
- package/dist/ContextBuilder.js.map +1 -1
- package/dist/Logger.d.ts +1 -1
- package/dist/SWMLService.d.ts +54 -9
- package/dist/SWMLService.js +248 -59
- package/dist/SWMLService.js.map +1 -1
- package/dist/SchemaUtils.js +14 -1
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/SemanticGate.d.ts +16 -2
- package/dist/SemanticGate.js +23 -2
- package/dist/SemanticGate.js.map +1 -1
- package/dist/SessionManager.d.ts +17 -6
- package/dist/SessionManager.js +16 -3
- package/dist/SessionManager.js.map +1 -1
- package/dist/SwaigFunction.d.ts +4 -3
- package/dist/SwaigFunction.js +1 -1
- package/dist/SwaigFunction.js.map +1 -1
- package/dist/TypeInference.d.ts +1 -1
- package/dist/TypeInference.js +1 -1
- package/dist/ai-chat/ChatGateway.d.ts +5 -5
- package/dist/ai-chat/HandoffRouter.d.ts +3 -3
- package/dist/cli/tsdocs/api-index.json +1 -1
- package/dist/cli/tsdocs/topics.js +17 -0
- package/dist/cli/tsdocs/topics.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/livewire/index.d.ts +3 -0
- package/dist/livewire/index.js +3 -0
- package/dist/livewire/index.js.map +1 -1
- package/dist/relay/Call.d.ts +1 -1
- package/dist/relay/Call.js +1 -1
- package/dist/relay/Message.d.ts +1 -1
- package/dist/relay/Message.js +1 -1
- package/dist/relay/RelayClient.d.ts +0 -2
- package/dist/relay/RelayClient.js.map +1 -1
- package/dist/relay/RelayEvent.d.ts +3 -3
- package/dist/relay/RelayEvent.js +3 -3
- package/dist/relay/closedSets.d.ts +10 -10
- package/dist/relay/closedSets.js +2 -2
- package/dist/relay/types.d.ts +1 -1
- package/dist/rest/base/CrudResource.d.ts +1 -1
- package/dist/rest/base/CrudResource.js +1 -1
- package/dist/skills/SkillBase.d.ts +2 -2
- package/dist/skills/SkillBase.js +2 -2
- package/docs/agent-guide.md +124 -4
- package/docs/api-reference.md +40 -9
- package/docs/architecture.md +2 -1
- package/docs/contexts-guide.md +2 -1
- package/docs/pgi_agent_guide.md +2 -1
- package/docs/programmatically_governed_inference.md +1 -1
- package/docs/swml_service_guide.md +31 -6
- package/package.json +3 -1
package/dist/relay/types.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ export interface SendMessageOptions {
|
|
|
140
140
|
* The canonical RELAY wire form is `{ type, params }`
|
|
141
141
|
* (`CallingPlayParams['play'][number]`). The SDK also accepts the friendly flat
|
|
142
142
|
* shorthands below (`{ type: 'tts', text }`, etc.), which
|
|
143
|
-
*
|
|
143
|
+
* `normalizePlayItem` expands into `params` before sending. So the
|
|
144
144
|
* accepted-input type is the wire shape OR one of the flat shorthands — exactly
|
|
145
145
|
* the set the normalizer handles, not the post-normalization wire shape alone.
|
|
146
146
|
*/
|
|
@@ -12,7 +12,7 @@ import { ReadResource } from './ReadResource.js';
|
|
|
12
12
|
* the generic types. `_updateMethod` may be overridden to `'PUT'` for APIs that
|
|
13
13
|
* replace instead of patch.
|
|
14
14
|
*
|
|
15
|
-
* Extends
|
|
15
|
+
* Extends `ReadResource` (mirroring Python's `CrudResource(ReadResource)`)
|
|
16
16
|
* so every CRUD resource inherits the `list()`/`get()`/`paginate()` read surface
|
|
17
17
|
* — in particular the async-iterator `paginate()`. A prior version extended
|
|
18
18
|
* `BaseResource` directly and re-declared `list()`/`get()`, which silently left
|
|
@@ -10,7 +10,7 @@ import { ReadResource } from './ReadResource.js';
|
|
|
10
10
|
* the generic types. `_updateMethod` may be overridden to `'PUT'` for APIs that
|
|
11
11
|
* replace instead of patch.
|
|
12
12
|
*
|
|
13
|
-
* Extends
|
|
13
|
+
* Extends `ReadResource` (mirroring Python's `CrudResource(ReadResource)`)
|
|
14
14
|
* so every CRUD resource inherits the `list()`/`get()`/`paginate()` read surface
|
|
15
15
|
* — in particular the async-iterator `paginate()`. A prior version extended
|
|
16
16
|
* `BaseResource` directly and re-declared `list()`/`get()`, which silently left
|
|
@@ -58,14 +58,14 @@ export interface SkillToolDefinition {
|
|
|
58
58
|
/**
|
|
59
59
|
* Build a {@link SkillToolDefinition} whose `handler` args are *inferred* from
|
|
60
60
|
* its `parameters` schema + `required` list — the `getTools()`-level counterpart
|
|
61
|
-
* to {@link
|
|
61
|
+
* to {@link SWMLService.defineTool}'s typed-tool inference.
|
|
62
62
|
*
|
|
63
63
|
* A skill returns its tools as a plain `SkillToolDefinition[]`, and that
|
|
64
64
|
* interface types `handler` as the loose {@link SwaigHandler} (`args:
|
|
65
65
|
* Record<string, unknown>`) — so a hand-written entry's handler sees untyped
|
|
66
66
|
* args and must reach for `args['query'] as string`. Wrapping the entry in
|
|
67
67
|
* `defineSkillTool` captures `parameters` (`P`) and `required` (`R`) via `const`
|
|
68
|
-
* type parameters and feeds them through
|
|
68
|
+
* type parameters and feeds them through `ToolArgs`, so the handler's
|
|
69
69
|
* `args` is precise: a `required` string prop is `args.query: string`, an `enum`
|
|
70
70
|
* prop narrows to its literal union, optional props are `?`. It then erases the
|
|
71
71
|
* typed handler back to {@link SwaigHandler} at a single boundary and returns an
|
package/dist/skills/SkillBase.js
CHANGED
|
@@ -9,14 +9,14 @@ import { getLogger } from '../Logger.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Build a {@link SkillToolDefinition} whose `handler` args are *inferred* from
|
|
11
11
|
* its `parameters` schema + `required` list — the `getTools()`-level counterpart
|
|
12
|
-
* to {@link
|
|
12
|
+
* to {@link SWMLService.defineTool}'s typed-tool inference.
|
|
13
13
|
*
|
|
14
14
|
* A skill returns its tools as a plain `SkillToolDefinition[]`, and that
|
|
15
15
|
* interface types `handler` as the loose {@link SwaigHandler} (`args:
|
|
16
16
|
* Record<string, unknown>`) — so a hand-written entry's handler sees untyped
|
|
17
17
|
* args and must reach for `args['query'] as string`. Wrapping the entry in
|
|
18
18
|
* `defineSkillTool` captures `parameters` (`P`) and `required` (`R`) via `const`
|
|
19
|
-
* type parameters and feeds them through
|
|
19
|
+
* type parameters and feeds them through `ToolArgs`, so the handler's
|
|
20
20
|
* `args` is precise: a `required` string prop is `args.query: string`, an `enum`
|
|
21
21
|
* prop narrows to its literal union, optional props are `?`. It then erases the
|
|
22
22
|
* typed handler back to {@link SwaigHandler} at a single boundary and returns an
|
package/docs/agent-guide.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- [Declarative PROMPT_SECTIONS](#declarative-prompt_sections)
|
|
11
11
|
- [Tools (SWAIG Functions)](#tools-swaig-functions)
|
|
12
12
|
- [Defining Tools](#defining-tools)
|
|
13
|
+
- [Slow tools and the webhook timeout](#slow-tools-and-the-webhook-timeout)
|
|
13
14
|
- [Tool Parameters](#tool-parameters)
|
|
14
15
|
- [Secure Tools](#secure-tools)
|
|
15
16
|
- [FunctionResult](#functionresult)
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
- [Call Flow (5 Phases)](#call-flow-5-phases)
|
|
24
25
|
- [Dynamic Configuration](#dynamic-configuration)
|
|
25
26
|
- [Post-Prompt and Summaries](#post-prompt-and-summaries)
|
|
26
|
-
- [Call End
|
|
27
|
+
- [Call Start and End Hooks](#call-start-and-end-hooks)
|
|
27
28
|
- [Mounting Extra Routes](#mounting-extra-routes)
|
|
28
29
|
- [Multi-Agent Server](#multi-agent-server)
|
|
29
30
|
- [Subclassing AgentBase](#subclassing-agentbase)
|
|
@@ -370,6 +371,51 @@ The handler can return any of these:
|
|
|
370
371
|
|
|
371
372
|
A handler runs on Node's event loop. Synchronous or CPU-heavy work in a handler blocks every other request the process is serving, so await asynchronous calls instead.
|
|
372
373
|
|
|
374
|
+
### Slow tools and the webhook timeout
|
|
375
|
+
|
|
376
|
+
SignalWire waits up to 30 seconds to connect to a SWAIG function's webhook and up to 120 seconds for its reply. When a request fails, times out or gets an error response (5xx), it sends the same request again, up to 3 more times, a second apart. So a slow or failing tool can run more than once, and the caller hears nothing from it in the meantime.
|
|
377
|
+
|
|
378
|
+
Answer within a few seconds. When the work takes longer, start it without awaiting it, return at once with a reply that tells the model the result is on its way, and send the result into the call when it's ready with the REST API's `calling.ai_message` (`calling.aiMessage()` on a `RestClient`):
|
|
379
|
+
|
|
380
|
+
<!-- snippet: no-run illustrative fragment (`slowOrderLookup` is your own helper; sends a live REST request) -->
|
|
381
|
+
```typescript
|
|
382
|
+
import { AgentBase, FunctionResult, RestClient } from '@signalwire/sdk';
|
|
383
|
+
|
|
384
|
+
declare function slowOrderLookup(orderId: string): Promise<string>;
|
|
385
|
+
|
|
386
|
+
const rest = new RestClient(); // SIGNALWIRE_PROJECT_ID, SIGNALWIRE_API_TOKEN, SIGNALWIRE_SPACE
|
|
387
|
+
const agent = new AgentBase({ name: 'orders' });
|
|
388
|
+
|
|
389
|
+
agent.defineTool({
|
|
390
|
+
name: 'check_order',
|
|
391
|
+
description: "Look up an order's shipping status",
|
|
392
|
+
parameters: { order_id: { type: 'string', description: 'The order number' } },
|
|
393
|
+
handler: (args, rawData) => {
|
|
394
|
+
const callId = rawData.call_id as string;
|
|
395
|
+
const orderId = args['order_id'] as string;
|
|
396
|
+
|
|
397
|
+
// Not awaited: the handler returns before the lookup finishes
|
|
398
|
+
void (async () => {
|
|
399
|
+
try {
|
|
400
|
+
const status = await slowOrderLookup(orderId); // may take 30 seconds
|
|
401
|
+
await rest.calling.aiMessage(callId, {
|
|
402
|
+
role: 'system',
|
|
403
|
+
message_text: `Order ${orderId} status: ${status}. Tell the caller.`,
|
|
404
|
+
});
|
|
405
|
+
} catch (err) {
|
|
406
|
+
console.error('check_order failed', err);
|
|
407
|
+
}
|
|
408
|
+
})();
|
|
409
|
+
|
|
410
|
+
return new FunctionResult(
|
|
411
|
+
"The lookup has started. Tell the caller you're checking and will have it shortly.",
|
|
412
|
+
);
|
|
413
|
+
},
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
The message goes into the AI session as the given role (`system`, `user` or `assistant`); `system` keeps the result from reading as something the caller said. Catch errors in the work you don't await: the SDK can't catch them once the handler has returned, and an unhandled rejection can stop the Node process. This pattern is for asynchronous I/O: leaving out `await` doesn't move synchronous or CPU-heavy work off Node's event loop. Because a request can arrive twice, make tools safe to run twice: for example, key work that's already running by `call_id` and arguments, and join it instead of starting it again.
|
|
418
|
+
|
|
373
419
|
### Tool Parameters
|
|
374
420
|
|
|
375
421
|
Parameters follow JSON Schema. You can pass the properties alone, or a full object schema:
|
|
@@ -416,7 +462,7 @@ agent.defineTool({
|
|
|
416
462
|
|
|
417
463
|
When the SDK renders the SWML, it adds a `__token` query parameter to each secure tool's `web_hook_url`. The token is an HMAC over the call ID, the function name and an expiry. On each `/swaig` request, the SDK checks the signature, the call ID and the expiry before it runs the handler. A request with no token, or with no `call_id` in its body, is refused like a wrong token. The refusal is a normal SWAIG response whose text says the token is invalid or expired.
|
|
418
464
|
|
|
419
|
-
The token proves that the request came from SWML this agent rendered for that call. It doesn't replace basic auth or the webhook signature check.
|
|
465
|
+
The token proves that the request came from SWML this agent rendered for that call. It doesn't replace basic auth or the webhook signature check. A chat session fetches its SWML under the conversation's id and can send requests under the chat service's own call id, with the conversation's id as `conversation_id`, so the SDK accepts a token minted for either one.
|
|
420
466
|
|
|
421
467
|
By default, each process generates its own signing secret at startup. A restart then invalidates the tokens of calls in progress, and two replicas can't check each other's tokens. Set the same `swaigSecret`, or `SIGNALWIRE_SWAIG_SECRET`, on every replica and keep it across restarts.
|
|
422
468
|
|
|
@@ -762,6 +808,54 @@ agent.addPerCallConfig((_query, _body, headers, copy) => {
|
|
|
762
808
|
|
|
763
809
|
`setDynamicConfigCallback()` replaces every callback registered so far, including those from `addPerCallConfig()`.
|
|
764
810
|
|
|
811
|
+
### Rejecting a Call
|
|
812
|
+
|
|
813
|
+
The callback can't refuse the request, but it can decide what the call does. To turn away a call the agent shouldn't take, such as one whose caller can't be verified, build the agent so that by default the call hears a message and hangs up, and have the callback undo that only for a call it accepts:
|
|
814
|
+
|
|
815
|
+
1. When you build the agent, add `play` and `hangup` with `addPostAnswerVerb()`. They run after the call is answered and before the `ai` verb, so a call that keeps them hangs up before the AI starts. Define no tools on the agent itself.
|
|
816
|
+
2. In the callback, for an accepted call, add the tools and other configuration to the request's copy, then call `clearPostAnswerVerbs()` last.
|
|
817
|
+
|
|
818
|
+
This fails closed. The callback changes only the request's copy, so the next call starts from the goodbye again. If the callback throws, the SDK logs the error and renders the copy as it stands, and since clearing the verbs is the last step, a failure before it leaves the goodbye in place. With several callbacks, finish every check before the one call to `clearPostAnswerVerbs()`, and make it the last callback registered: a callback that throws stops the ones after it, but doesn't restore verbs an earlier one cleared.
|
|
819
|
+
|
|
820
|
+
The callback runs for every request the call makes: the SWML fetch, and again for each tool call and the post-prompt summary. Only the SWML fetch carries the caller's data, such as the `userVariables` a browser or app client sends with `dial()`; a tool call carries the `call_id` and `global_data`, and `global_data` comes from the call, so it proves nothing. Verify on the SWML fetch, remember the `call_id` (`body.call.call_id` there, `body.call_id` on later requests), and check that on later requests, so a tool call from a call you didn't verify finds no tool to run.
|
|
821
|
+
|
|
822
|
+
<!-- snippet: no-run illustrative fragment (`signatureIsValid` is your own check) -->
|
|
823
|
+
```typescript
|
|
824
|
+
import { AgentBase, FunctionResult, userVariables } from '@signalwire/sdk';
|
|
825
|
+
|
|
826
|
+
declare function signatureIsValid(vars: Record<string, unknown>): boolean;
|
|
827
|
+
|
|
828
|
+
// With more than one process, keep this in a shared store instead.
|
|
829
|
+
const verified = new Set<string>();
|
|
830
|
+
|
|
831
|
+
const agent = new AgentBase({ name: 'gated', route: '/' });
|
|
832
|
+
agent.promptAddSection('Role', { body: 'You are a helpful assistant.' });
|
|
833
|
+
// Fail closed: every call gets this unless the callback accepts it.
|
|
834
|
+
agent.addPostAnswerVerb('play', { url: "say:Sorry, this call can't be verified. Goodbye." });
|
|
835
|
+
agent.addPostAnswerVerb('hangup', {});
|
|
836
|
+
|
|
837
|
+
agent.addPerCallConfig((_query, body, _headers, copy) => {
|
|
838
|
+
let callId: string | undefined;
|
|
839
|
+
if (body.call && typeof body.call === 'object') {
|
|
840
|
+
// The SWML fetch that starts the call
|
|
841
|
+
callId = body.call.call_id;
|
|
842
|
+
if (callId && signatureIsValid(userVariables(body))) verified.add(callId);
|
|
843
|
+
} else {
|
|
844
|
+
// A tool call or the summary
|
|
845
|
+
callId = body.call_id as string | undefined;
|
|
846
|
+
}
|
|
847
|
+
if (!callId || !verified.has(callId)) return; // stays a goodbye with no tools
|
|
848
|
+
copy.defineTool({
|
|
849
|
+
name: 'lookup',
|
|
850
|
+
description: 'Look up an account',
|
|
851
|
+
handler: () => new FunctionResult('...'),
|
|
852
|
+
});
|
|
853
|
+
copy.clearPostAnswerVerbs(); // last: a failure above leaves the goodbye
|
|
854
|
+
});
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
Since the call never reaches the `ai` verb, no tool, `onCallStart()` or `onCallEnd()` handler runs for a rejected call. Forget a verified `call_id` when the call ends (in `onCallEnd()`, for example) or after a time limit.
|
|
858
|
+
|
|
765
859
|
### SWAIG Query Parameters
|
|
766
860
|
|
|
767
861
|
`addSwaigQueryParams()` appends query parameters to the SWAIG webhook URLs:
|
|
@@ -809,7 +903,7 @@ class MyAgent extends AgentBase {
|
|
|
809
903
|
|
|
810
904
|
The SDK takes the summary from `body.summary`, then `body.post_prompt_data.parsed[0]`, then `body.post_prompt_data.raw` parsed as JSON. The second argument is the whole request body. With a dynamic config callback set, `onSummary` runs on the per-request copy.
|
|
811
905
|
|
|
812
|
-
A `POST /post_prompt` needs the `__token` that the SDK put in the SWML's `post_prompt_url` for that call. A missing or wrong token gets `403`.
|
|
906
|
+
A `POST /post_prompt` needs the `__token` that the SDK put in the SWML's `post_prompt_url` for that call. A missing or wrong token gets `403`. A token minted for the request's `conversation_id` is accepted too, since a chat session's summary arrives under the chat service's own call id.
|
|
813
907
|
|
|
814
908
|
### Post-Prompt LLM Parameters
|
|
815
909
|
|
|
@@ -823,7 +917,31 @@ agent.setPostPromptLlmParams({
|
|
|
823
917
|
|
|
824
918
|
---
|
|
825
919
|
|
|
826
|
-
## Call End
|
|
920
|
+
## Call Start and End Hooks
|
|
921
|
+
|
|
922
|
+
`onCallStart()` and `onCallEnd()` register handlers for the platform's two reserved hooks, `startup_hook` and `hangup_hook`. Each takes any number of handlers, which run in registration order, and logs an error a handler throws instead of raising it, so one failing handler doesn't stop the others.
|
|
923
|
+
|
|
924
|
+
### onCallStart()
|
|
925
|
+
|
|
926
|
+
`onCallStart()` registers a handler that runs when the call starts. The handler receives the SWAIG request (`call_id`, `global_data`, `caller_id_num` and the rest) and may return a `FunctionResult` or nothing:
|
|
927
|
+
|
|
928
|
+
```typescript
|
|
929
|
+
agent.onCallStart(async (rawData) => {
|
|
930
|
+
const customer = await lookupCustomer(rawData.caller_id_num as string);
|
|
931
|
+
return new FunctionResult(`The caller is ${customer.name}.`).updateGlobalData({
|
|
932
|
+
customer_name: customer.name,
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
The first registration adds the reserved `startup_hook` function, which the platform runs once, after the call is answered and before the AI's first turn, and doesn't offer to the model. The platform uses its reply:
|
|
938
|
+
|
|
939
|
+
- The actions run at once, such as `updateGlobalData()` to give the call data before the conversation starts. Several handlers' actions run in registration order. `postProcess` isn't used.
|
|
940
|
+
- The response text is added to the conversation as a system message, so the model reads it before it speaks. Several handlers' texts are joined, one per line. Only a plain string response is used; the SDK logs a warning for a structured `tool_result`/`tool_prompt` response, and for a return value that isn't a `FunctionResult`, and ignores it. OpenAI Realtime agents run the hook's actions but don't add its text. `updateGlobalData()` stores data on the call, but doesn't put it in front of the model, so for something a Realtime agent's first greeting needs, add it to the prompt from a per-call configuration callback (see [Dynamic Configuration](#dynamic-configuration)) before the SWML is returned.
|
|
941
|
+
|
|
942
|
+
The platform waits for the hook before the AI starts, so a slow handler delays the greeting; keep it short (see [Slow tools and the webhook timeout](#slow-tools-and-the-webhook-timeout)). Like any function request, the hook's request can be sent again after a timeout or an error, so make the handlers safe to run twice.
|
|
943
|
+
|
|
944
|
+
### onCallEnd()
|
|
827
945
|
|
|
828
946
|
`onCallEnd()` registers a handler that runs when the call ends, with the transcript. Handlers run in registration order with `(callLog, rawData)`:
|
|
829
947
|
|
|
@@ -837,6 +955,8 @@ The first registration adds the platform's reserved `hangup_hook` function, whic
|
|
|
837
955
|
|
|
838
956
|
The SDK ignores a handler's return value. It logs an error a handler throws, and runs the remaining handlers.
|
|
839
957
|
|
|
958
|
+
To write a hook yourself instead, define a tool with the reserved name. Use one or the other for each hook: `onCallStart()` and `onCallEnd()` define `startup_hook` and `hangup_hook` themselves.
|
|
959
|
+
|
|
840
960
|
---
|
|
841
961
|
|
|
842
962
|
## Mounting Extra Routes
|
package/docs/api-reference.md
CHANGED
|
@@ -444,6 +444,7 @@ agent.defineTool({
|
|
|
444
444
|
| `onFail` | `string \| FunctionResult \| Record<string, unknown>` | What the model gets when this is the first gate that fails: the tool result text, a `FunctionResult`, whose response and actions are used, or a data_map output object. It needs a response, and in the `tool_result`/`tool_prompt` form a `tool_result`: a blocked call must never read as a success. The `tool_prompt` becomes a system message after the tool result; OpenAI Realtime agents don't use it, so put what they need in the `tool_result`. The actions run as written, without template expansion |
|
|
445
445
|
| `opts.id` | `string` | 1 to 64 letters, digits or underscores, unique within the function. Default `gate_<n>`, 1-based |
|
|
446
446
|
| `opts.trueMeans`, `opts.falseMeans` | `string` | What yes and no mean, at most 2 KB each |
|
|
447
|
+
| `opts.visualInput` | `boolean \| number` | How many of the caller's newest video frames the decision model sees with this gate, as `visual_input`: `true` is 1, `false` or 0 none, or a whole number up to 5 (`MAX_VISUAL_INPUT`). Name it in the question, as in "Is the caller holding a photo ID up to the camera in `visual_input`?". All of a function's gates share one request, so each sees as many frames as the gate asking for the most. The gate provider must take images; one that doesn't makes the check a configuration error, which blocks the call. Left out by default. A function's own `visual_input`, frames sent to its webhook, is a separate field of the function, set through `extraFields` |
|
|
447
448
|
|
|
448
449
|
Gates are checked by the platform's rules when the tool is defined, and once more when the SWML is rendered. The platform refuses the whole function for an invalid gate, so the SDK throws instead. Gates aren't allowed on the hook names `startup_hook`, `hangup_hook` and `check_for_input`, on `end_call`, or on a built-in function's name. A gated function also needs a description, and a `web_hook_url` or `data_map`; tools the SDK builds always have them. A `gates` given as `null` is refused rather than dropped, since the platform refuses that function too.
|
|
449
450
|
|
|
@@ -957,6 +958,8 @@ setDynamicConfigCallback(cb: DynamicConfigCallback): this
|
|
|
957
958
|
|
|
958
959
|
Add a per-request configuration callback, keeping the ones already registered. The callbacks run in registration order on the same copy, so a later one sees what an earlier one set. When a callback throws, the error is logged, the later callbacks are skipped, and the request continues with the copy as configured so far.
|
|
959
960
|
|
|
961
|
+
To turn a call away, build the agent with `play` and `hangup` post-answer verbs and no tools, and have the callback add the tools and call `clearPostAnswerVerbs()` last, only for a call it accepts. A callback that throws before that step leaves the call rejected; with several callbacks, the one that clears the verbs must run last. See [Rejecting a Call](agent-guide.md#rejecting-a-call) in the agent guide.
|
|
962
|
+
|
|
960
963
|
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
961
964
|
```ts
|
|
962
965
|
addPerCallConfig(cb: DynamicConfigCallback): this
|
|
@@ -980,9 +983,37 @@ support.addPerCallConfig((query, body, headers, copy) => {
|
|
|
980
983
|
});
|
|
981
984
|
```
|
|
982
985
|
|
|
986
|
+
#### `onCallStart(handler)`
|
|
987
|
+
|
|
988
|
+
Register a handler that runs when the call starts, before the AI's first turn, and return it. The first registration defines a tool named `startup_hook`, the platform's reserved hook, which it runs once after the call is answered and doesn't offer to the model. Handlers run in registration order with the whole SWAIG request (`call_id`, `global_data`, `caller_id_num` and the rest), and may return a `FunctionResult` or nothing. The hook replies with the handlers' results combined:
|
|
989
|
+
|
|
990
|
+
- The actions, in registration order, which the platform runs at once. `postProcess` isn't used.
|
|
991
|
+
- The response texts, joined one per line, which the platform adds to the conversation as a system message the model reads before it speaks. Only a plain string response is used: a structured `tool_result`/`tool_prompt` response, and a return value that isn't a `FunctionResult`, are ignored with a warning. OpenAI Realtime agents run the actions but don't add the text; for something their first greeting needs, add it to the prompt from a per-call configuration callback instead.
|
|
992
|
+
|
|
993
|
+
An exception is logged, not raised, and that handler's result is dropped. The platform waits for the hook before the AI starts, so keep handlers short, and it can send the request again after a timeout or an error, so make them safe to run twice. Registering a handler doesn't change `swaig_post_conversation`.
|
|
994
|
+
|
|
995
|
+
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
996
|
+
```ts
|
|
997
|
+
onCallStart(
|
|
998
|
+
handler: (rawData: SwaigRequest) => FunctionResult | null | undefined | void | Promise<FunctionResult | null | undefined | void>,
|
|
999
|
+
): (rawData: SwaigRequest) => FunctionResult | null | undefined | void | Promise<FunctionResult | null | undefined | void>
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
**Example:**
|
|
1003
|
+
|
|
1004
|
+
```ts
|
|
1005
|
+
import { AgentBase, FunctionResult } from '@signalwire/sdk';
|
|
1006
|
+
|
|
1007
|
+
const greeter = new AgentBase({ name: 'greeter' });
|
|
1008
|
+
greeter.onCallStart((rawData) => {
|
|
1009
|
+
const name = (rawData['caller_id_name'] as string | undefined) || 'the caller';
|
|
1010
|
+
return new FunctionResult(`The caller's name is ${name}.`);
|
|
1011
|
+
});
|
|
1012
|
+
```
|
|
1013
|
+
|
|
983
1014
|
#### `onCallEnd(handler)`
|
|
984
1015
|
|
|
985
|
-
Register a handler that runs when the call ends, and return it. The first registration defines a tool named `hangup_hook
|
|
1016
|
+
Register a handler that runs when the call ends, and return it. The first registration defines a tool named `hangup_hook`, the platform's reserved hook, and sets the `swaig_post_conversation` param to `true`, unless that param is explicitly `false`, which logs a warning. Handlers run in registration order with the call log (`call_log`, or `raw_call_log` when that's empty) and the whole SWAIG request. Return values are ignored, and an exception is logged without stopping the other handlers.
|
|
986
1017
|
|
|
987
1018
|
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
988
1019
|
```ts
|
|
@@ -1369,7 +1400,7 @@ Import the class from the package root:
|
|
|
1369
1400
|
import { AgentServer } from '@signalwire/sdk';
|
|
1370
1401
|
```
|
|
1371
1402
|
|
|
1372
|
-
`AgentServer` serves several agents from one HTTP server, each under its own route prefix.
|
|
1403
|
+
`AgentServer` serves several agents from one HTTP server, each under its own route prefix. `AgentServer<T extends SWMLService = AgentBase>` is generic over what it hosts: `new AgentServer<SWMLService>()` hosts plain `SWMLService` call flows next to agents, and its `getAgent()` and `getAgents()` then return `SWMLService`. A plain service answers at its route with or without a trailing slash, under its own basic auth, and serves its `/swaig` endpoint and routing callbacks; the agent endpoints (`/post_prompt`, `/check_for_input`, `/debug`) aren't served for it.
|
|
1373
1404
|
|
|
1374
1405
|
### Constructor
|
|
1375
1406
|
|
|
@@ -1390,10 +1421,10 @@ constructor(opts?: { host?: string; port?: number; logLevel?: string })
|
|
|
1390
1421
|
|
|
1391
1422
|
| Method | Signature | Description |
|
|
1392
1423
|
|--------|-----------|-------------|
|
|
1393
|
-
| `register` | `(agent:
|
|
1424
|
+
| `register` | `(agent: T, route?: string): void` | Mount the agent's (or service's) `asRouter()` at `route` (default its own route). Throws when the route is taken. |
|
|
1394
1425
|
| `unregister` | `(route: string): boolean` | Remove an agent and its routes; returns `false` when none was registered there. |
|
|
1395
|
-
| `getAgents` | `(): Map<string,
|
|
1396
|
-
| `getAgent` | `(route: string):
|
|
1426
|
+
| `getAgents` | `(): Map<string, T>` | Registered agents keyed by route |
|
|
1427
|
+
| `getAgent` | `(route: string): T \| undefined` | The agent at a route |
|
|
1397
1428
|
| `serveStaticFiles` | `(directory: string, route?: string): void` | Serve files from a directory, rejecting paths with `..` |
|
|
1398
1429
|
| `setupSipRouting` | `(route?: string, autoMap?: boolean): void` | Route SIP requests to agents by username at `route` (default `/sip`) |
|
|
1399
1430
|
| `registerSipUsername` | `(username: string, route: string): void` | Map a SIP username to an agent's route |
|
|
@@ -2079,7 +2110,7 @@ The `addStep()` options are shortcuts:
|
|
|
2079
2110
|
| `setUserPrompt` | `(userPrompt: string): this` | Emits `user_prompt` |
|
|
2080
2111
|
| `setIsolated` | `(isolated: boolean): this` | Emits `isolated: true` |
|
|
2081
2112
|
| `setPrompt` | `(prompt: string): this` | Raw `prompt`. Throws when prompt POM sections exist. |
|
|
2082
|
-
| `setHistory` | `(history: string): this` | Default history mode for the context's steps: `keep`, `default` or `
|
|
2113
|
+
| `setHistory` | `(history: string): this` | Default history mode for the context's steps: `keep`, `default`, `hide` or `isolate`. Throws on any other value. |
|
|
2083
2114
|
|
|
2084
2115
|
#### POM Sections
|
|
2085
2116
|
|
|
@@ -2141,7 +2172,7 @@ constructor(name: string)
|
|
|
2141
2172
|
| `setEnd` | `(end: boolean): this` | Emits `end: true`, which leaves step mode after this step. It doesn't end the call. |
|
|
2142
2173
|
| `setSkipUserTurn` | `(skip: boolean): this` | Emits `skip_user_turn: true` |
|
|
2143
2174
|
| `setSkipToNextStep` | `(skip: boolean): this` | Emits `skip_to_next_step: true` |
|
|
2144
|
-
| `setHistory` | `(history: string): this` | History mode when the step is entered: `keep`, `default` or `hide
|
|
2175
|
+
| `setHistory` | `(history: string): this` | History mode when the step is entered: `keep`, `default`, `hide` or `isolate` (like `hide`, but only while the agent is in the step). Throws on any other value. |
|
|
2145
2176
|
|
|
2146
2177
|
#### Gather Info Methods
|
|
2147
2178
|
|
|
@@ -2250,8 +2281,8 @@ The accepted history modes:
|
|
|
2250
2281
|
|
|
2251
2282
|
<!-- snippet: no-compile API signature / type reference, not runnable code -->
|
|
2252
2283
|
```ts
|
|
2253
|
-
const HISTORY_MODES: readonly ['keep', 'default', 'hide']
|
|
2254
|
-
type HistoryMode = 'keep' | 'default' | 'hide'
|
|
2284
|
+
const HISTORY_MODES: readonly ['keep', 'default', 'hide', 'isolate']
|
|
2285
|
+
type HistoryMode = 'keep' | 'default' | 'hide' | 'isolate'
|
|
2255
2286
|
```
|
|
2256
2287
|
|
|
2257
2288
|
---
|
package/docs/architecture.md
CHANGED
|
@@ -135,7 +135,7 @@ SignalWire requests the SWML with a `POST` whose body describes the call. The ag
|
|
|
135
135
|
- **Tool dispatch**: running the handler for a SWAIG request, after checking its per-call token.
|
|
136
136
|
- **Proxy detection**: finding the external URL for the webhook URLs in the SWML.
|
|
137
137
|
- **Per-request configuration**: making a per-request copy of the agent for a dynamic config callback.
|
|
138
|
-
- **Lifecycle hooks**: `onSummary`, `onFunctionCall`, `onSwmlRequest`, `onDebugEvent`, `onCallEnd` and `onError`.
|
|
138
|
+
- **Lifecycle hooks**: `onSummary`, `onFunctionCall`, `onSwmlRequest`, `onDebugEvent`, `onCallStart`, `onCallEnd` and `onError`.
|
|
139
139
|
|
|
140
140
|
`SWMLService` supplies the `SwmlBuilder`, the tool registry, basic-auth resolution, routing callbacks and `handleRequest()`, the framework-free request handler that the agent's SWML routes call.
|
|
141
141
|
|
|
@@ -777,6 +777,7 @@ A subclass can override these methods:
|
|
|
777
777
|
These methods register handlers instead of being overridden:
|
|
778
778
|
|
|
779
779
|
- `onError(handler)`: called when a tool handler throws, after the tool's own `onError`. A `FunctionResult` it returns is sent as the response.
|
|
780
|
+
- `onCallStart(handler)`: registers the reserved `startup_hook` tool, so the handler runs before the AI's first turn; the actions and response text of the `FunctionResult` it returns reach the call.
|
|
780
781
|
- `onCallEnd(handler)`: registers the reserved `hangup_hook` tool and turns on `swaig_post_conversation`, so the handler gets the call log when the call ends.
|
|
781
782
|
|
|
782
783
|
### Dynamic Configuration Callback
|
package/docs/contexts-guide.md
CHANGED
|
@@ -381,11 +381,12 @@ main.setText('Now handle the main request.');
|
|
|
381
381
|
step.setHistory('hide');
|
|
382
382
|
```
|
|
383
383
|
|
|
384
|
-
The
|
|
384
|
+
The modes are these:
|
|
385
385
|
|
|
386
386
|
- `keep`: hide nothing. Earlier steps' instructions and dialogue stay visible.
|
|
387
387
|
- `default`: hide earlier step instructions, and keep the dialogue. This is the behavior when `history` isn't set.
|
|
388
388
|
- `hide`: hide earlier instructions and the earlier dialogue. A `${step_history.*}` reference in this step's text brings back what you choose.
|
|
389
|
+
- `isolate`: like `hide`, but only while the agent is in this step. When the step is left, the earlier dialogue returns and the step's own turns stay; the earlier instructions stay cleared, and what an earlier `hide` step hid stays hidden. Entering the step again isolates it again. Use it for a step that must see nothing else, such as a confirmation read-back. A platform without `isolate` treats it as `default`.
|
|
389
390
|
|
|
390
391
|
`Context.setHistory()` sets the default for every step in the context, and a step's own `setHistory()` overrides it. Any other value throws.
|
|
391
392
|
|
package/docs/pgi_agent_guide.md
CHANGED
|
@@ -311,11 +311,12 @@ List allowed model transitions when the model can choose among safe destinations
|
|
|
311
311
|
|
|
312
312
|
**Solves:** P12-P14. **Use:** `Step.setHistory()`, `Context.setHistory()`, `${step_history.*}` references, context reset settings.
|
|
313
313
|
|
|
314
|
-
`setHistory()` takes one of
|
|
314
|
+
`setHistory()` takes one of these modes:
|
|
315
315
|
|
|
316
316
|
- `keep`: keep prior instructions and dialogue.
|
|
317
317
|
- `default`: remove prior step instructions and keep the dialogue; the behavior when unset.
|
|
318
318
|
- `hide`: remove prior instructions and dialogue from the model's view. Use `${step_history.*}` references in the step's text to bring back selected information.
|
|
319
|
+
- `isolate`: like `hide`, but only while the agent is in this step. When the step is left, the earlier dialogue returns and the step's own turns stay; the earlier instructions stay cleared, and what an earlier `hide` step hid stays hidden. Entering the step again isolates it again. Use it for a step that must see nothing else, such as a confirmation read-back. A platform without `isolate` treats it as `default`.
|
|
319
320
|
|
|
320
321
|
Hidden turns remain in the call log, so don't describe `hide` as deletion. `Context.setIsolated()`, `setSystemPrompt()`, `setUserPrompt()`, `setConsolidate()` and `setFullReset()` add more controls for entering a context. Steps have `setResetSystemPrompt()`, `setResetUserPrompt()`, `setResetConsolidate()` and `setResetFullReset()`. Verify the combination you choose on the runtime rather than treating them all as a memory wipe. [S03]
|
|
321
322
|
|
|
@@ -243,7 +243,7 @@ PGI restores programming to the equation. In PGI, the developer's traditional sk
|
|
|
243
243
|
|
|
244
244
|
A developer building an intake system writes a gather sequence. The platform presents the model with one question at a time and a single submission tool, `gather_submit`. The tool's schema is rebuilt for each question, with that answer's type and, when the question asks for it, a required confirmation. The model does not know how many questions remain or what the full form looks like. When an answer arrives, the platform stores it in `global_data` and silently advances to the next question. When the sequence is complete, the accumulated structured data is handed off to the next phase of the workflow. There, a handler validates the whole record before anything consequential uses it. The model never saw the form. It never had the opportunity to skip ahead, reorder questions, or submit answers to questions that were never asked.
|
|
245
245
|
|
|
246
|
-
Visibility of what came before is itself a dial the developer controls. By default, each new phase withdraws the prior phase's instructions from the model's context while the conversation itself remains visible. At stricter settings, the platform pulls the earlier dialogue out entirely, or hides the answers already collected so the model must ask rather than infer. A hidden phase can also be brought back on purpose. The platform can hand the model a summary of an earlier phase instead of the raw transcript. The summary is one more curated projection in place of the full truth. Reality authoring extends to the past, not only the present. In the SDK, these settings are `setHistory()` on a step or context (`keep`, `default` or `
|
|
246
|
+
Visibility of what came before is itself a dial the developer controls. By default, each new phase withdraws the prior phase's instructions from the model's context while the conversation itself remains visible. At stricter settings, the platform pulls the earlier dialogue out entirely, or hides the answers already collected so the model must ask rather than infer. A hidden phase can also be brought back on purpose. The platform can hand the model a summary of an earlier phase instead of the raw transcript. The summary is one more curated projection in place of the full truth. Reality authoring extends to the past, not only the present. In the SDK, these settings are `setHistory()` on a step or context (`keep`, `default`, `hide`, or `isolate`, which hides the earlier dialogue only while the agent is in that step) and the `isolated` option of `setGatherInfo()` and `addGatherQuestion()`. A `${step_history.*}` reference in a step's text chooses what comes back. The call log keeps every message either way.
|
|
247
247
|
|
|
248
248
|
This is not the same as ordinary backend validation (clamping a quantity with `if (quantity > 20) quantity = 20;`, or rejecting a bad input). Those are single lines of defensive code any backend performs. The gather sequence is reality authoring. The developer constructs what the model believes to be true at each moment, and `global_data` carries the accumulated truth the model never sees.
|
|
249
249
|
|
|
@@ -352,7 +352,7 @@ A routing callback inspects a request at a path you choose, and either redirects
|
|
|
352
352
|
|
|
353
353
|
### Registering a Routing Callback
|
|
354
354
|
|
|
355
|
-
`registerRoutingCallback(callbackFn, path)`
|
|
355
|
+
`registerRoutingCallback(callbackFn, path)` serves `GET` and `POST` at `path` (default `/sip`) under the service's `route`: a service at `/menu` answers at `/menu/sip`. It also answers at `path` itself, where releases before 3.7.2 served it. The callback receives the request's JSON body and its headers, and returns a route string or `null`. A callback can be registered after the service has started serving:
|
|
356
356
|
|
|
357
357
|
<!-- snippet: no-run illustrative fragment: references the assumed `service` object established earlier on the page -->
|
|
358
358
|
```typescript
|
|
@@ -420,17 +420,42 @@ A `POST /sip` whose body has `call.to` set to `sip:sales@example.sip.signalwire.
|
|
|
420
420
|
|
|
421
421
|
### Mounting into a Larger App
|
|
422
422
|
|
|
423
|
-
`
|
|
423
|
+
`asRouter()` returns a router whose routes are relative to the service's route, so you can mount it at any prefix in a larger application:
|
|
424
424
|
|
|
425
425
|
```typescript
|
|
426
426
|
import { Hono } from 'hono';
|
|
427
427
|
|
|
428
428
|
const app = new Hono();
|
|
429
|
-
const service = new SWMLService({ name: 'my-service' });
|
|
430
|
-
app.route('/voice', service.
|
|
429
|
+
const service = new SWMLService({ name: 'my-service', route: '/menu' });
|
|
430
|
+
app.route('/voice', service.asRouter());
|
|
431
431
|
```
|
|
432
432
|
|
|
433
|
-
Mounted this way, the service's routes are under `/voice`: its document at `/voice
|
|
433
|
+
Mounted this way, the service's routes are under `/voice`: its document at `/voice`, its SWAIG route at `/voice/swaig` and its routing callbacks under `/voice`, behind its own basic auth. The router has no middleware for every path, so it leaves the host's other routes alone: the service's own routes and routing callbacks carry its security headers, CORS and basic auth. A route you add to the router, or that a subclass adds in `registerAdditionalRoutes()`, isn't behind them there; check auth in it yourself (for example with Hono's `basicAuth` and the service's `validateBasicAuth()`), as the reference's router handlers do. Routes you add to `getApp()` are behind the service's basic auth. Whether `/voice/` answers as `/voice` is the host app's choice: pass `{ strict: false }` to `new Hono()` for that, as `AgentServer` does. `getApp()` returns the service's own app, whose routes are under the service's `route`.
|
|
434
|
+
|
|
435
|
+
### Hosting a Service Next to Agents
|
|
436
|
+
|
|
437
|
+
An `AgentServer<SWMLService>` registers a plain `SWMLService` as well as agents, so a call flow without AI, such as an IVR menu, can share a server with them. SIP routing can send calls to it like any agent:
|
|
438
|
+
|
|
439
|
+
<!-- snippet: no-run starts a blocking HTTP server (serve/start/run on a fixed port); collides under the concurrent gate and cannot run standalone -->
|
|
440
|
+
```typescript
|
|
441
|
+
import { AgentBase, AgentServer, SWMLService } from '@signalwire/sdk';
|
|
442
|
+
|
|
443
|
+
const support = new AgentBase({ name: 'support', route: '/support' });
|
|
444
|
+
support.promptAddSection('Role', { body: 'You help callers with their accounts.' });
|
|
445
|
+
|
|
446
|
+
const menu = new SWMLService({ name: 'menu', route: '/menu' });
|
|
447
|
+
menu.addVerb('answer', {});
|
|
448
|
+
menu.addVerb('hangup', {});
|
|
449
|
+
|
|
450
|
+
const server = new AgentServer<SWMLService>();
|
|
451
|
+
server.register(support, '/support');
|
|
452
|
+
server.register(menu, '/menu');
|
|
453
|
+
server.setupSipRouting('/sip');
|
|
454
|
+
server.registerSipUsername('menu', '/menu');
|
|
455
|
+
await server.run();
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
The service answers at its route with or without a trailing slash, checks its own basic auth credentials, and serves its `/swaig` endpoint and routing callbacks. The agent endpoints (`/post_prompt`, `/check_for_input` and `/debug`) aren't served for it. A plain `new AgentServer()` hosts agents only, and its `getAgent()` and `getAgents()` return agents; on an `AgentServer<SWMLService>` they return `SWMLService`, so narrow with `instanceof AgentBase` before calling agent methods.
|
|
434
459
|
|
|
435
460
|
### Serving HTTPS
|
|
436
461
|
|
|
@@ -481,7 +506,7 @@ The document methods listed in [Document Methods](#document-methods) are the pub
|
|
|
481
506
|
These methods serve, configure and inspect the service:
|
|
482
507
|
|
|
483
508
|
- `getApp()`: Get the underlying Hono app
|
|
484
|
-
- `asRouter()`: Return the
|
|
509
|
+
- `asRouter()`: Return a router with the service's routes relative to its route, to mount at any prefix in a host app
|
|
485
510
|
- `serve(hostOrOptions?, port?, sslOptions?)`: Start the HTTP or HTTPS server
|
|
486
511
|
- `stop()`: Stop the server
|
|
487
512
|
- `handleRequest(method, url, headers, body?)`: Answer a request without Hono, returning `[status, headers, body]`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalwire/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "SignalWire AI Agents SDK for TypeScript/Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"signalwire",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"test": "vitest run",
|
|
80
80
|
"test:watch": "vitest",
|
|
81
81
|
"test:examples": "tsc --noEmit --project tsconfig.examples.json",
|
|
82
|
+
"docs:reference": "typedoc --options reference/typedoc.json && npx tsx scripts/inject-navbar.ts",
|
|
82
83
|
"dev": "tsc --watch",
|
|
83
84
|
"enumerate:doc-surface": "npx tsx scripts/enumerate-doc-surface.ts",
|
|
84
85
|
"enumerate:signatures": "PORTING_SDK=\"${PORTING_SDK:-../porting-sdk}\" PORTING_SDK_PATH=\"${PORTING_SDK_PATH:-../porting-sdk}\" npx tsx scripts/enumerate-signatures.ts",
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
"libphonenumber-js": "^1.13.14",
|
|
113
114
|
"prettier": "^3.8.4",
|
|
114
115
|
"tsx": "^4.21.0",
|
|
116
|
+
"typedoc": "^0.28.20",
|
|
115
117
|
"typescript": "^6.0.0",
|
|
116
118
|
"typescript-eslint": "^8.61.0",
|
|
117
119
|
"vitest": "^4.1.5"
|