@wildix/wilma-agents-client 1.0.27 → 1.0.28

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.
@@ -1,5 +1,5 @@
1
1
  import type { DocumentType as __DocumentType } from "@smithy/types";
2
- import type { ActorType, AgentHandoverPipelineType, AgentHandoverVariant, AgentHangupPipelineType, AgentStatus, AgentToolPipelineType, AgentTransferPipelineType, AgentTransferVariant, AgentVariableType, AgentVisibility, AgentWorkflowEntryBehavior, AgentWorkflowFailureKind, AgentWorkflowLayout, AgentWorkflowMessageButtonVariant, ChannelType, SandboxNetworkAccess, SandboxSize, WebSearchContextSize } from "./enums";
2
+ import type { ActorType, AgentGuardrailErrorMode, AgentGuardrailMode, AgentGuardrailPreset, AgentGuardrailSensitivity, AgentGuardrailWindow, AgentHandoverPipelineType, AgentHandoverVariant, AgentHangupPipelineType, AgentStatus, AgentToolPipelineType, AgentTransferPipelineType, AgentTransferVariant, AgentVariableType, AgentVisibility, AgentWorkflowEntryBehavior, AgentWorkflowFailureKind, AgentWorkflowLayout, AgentWorkflowMessageButtonVariant, ChannelType, SandboxNetworkAccess, SandboxSize, WebSearchContextSize } from "./enums";
3
3
  /**
4
4
  * A user or group that access is granted to.
5
5
  * @public
@@ -1332,6 +1332,295 @@ export declare namespace AgentCapability {
1332
1332
  _: (name: string, value: any) => T;
1333
1333
  }
1334
1334
  }
1335
+ /**
1336
+ * Refuse the turn. The agent's model is never called, no tool runs, and the caller is answered with `message` instead. The session stays alive and the conversation continues, so on a check meant to redirect rather than stop — 'let me take a few details first' — the message is doing the work.
1337
+ * @public
1338
+ */
1339
+ export interface AgentGuardrailBlockAction {
1340
+ /**
1341
+ * Said to the caller in place of the agent's reply. Falls back to a channel default when unset.
1342
+ * @public
1343
+ */
1344
+ message?: string | undefined;
1345
+ }
1346
+ /**
1347
+ * End the session. It lands in SessionStatus TERMINATED — not STOPPED, which is what a user asking to stop means — so a refused session is never read back as a clean finish. On voice this hangs up the call; on the other channels the session simply accepts no further turns.
1348
+ * @public
1349
+ */
1350
+ export interface AgentGuardrailEndAction {
1351
+ /**
1352
+ * Said to the caller before the session ends.
1353
+ * @public
1354
+ */
1355
+ message?: string | undefined;
1356
+ }
1357
+ /**
1358
+ * Record the verdict and let the turn through. The rollout mode: every guardrail should run here first, against real traffic, until its trips are read and its sensitivity is tuned. A tripped check still emits GuardrailTrippedEvent and still appears in the trace, which is what makes this a tuning tool rather than a switched-off check.
1359
+ * @public
1360
+ */
1361
+ export interface AgentGuardrailObserveAction {
1362
+ }
1363
+ /**
1364
+ * Mask the matched spans and let the turn continue. The mask is chosen by the platform and is not configurable — a tenant-authored placeholder that collides with real text, or that the model reads as an instruction, is worse than having no choice. Only valid on checks that return spans (PII, SECRETS).
1365
+ * @public
1366
+ */
1367
+ export interface AgentGuardrailRedactAction {
1368
+ }
1369
+ /**
1370
+ * What happens when a check trips. Exactly one member is set.
1371
+ *
1372
+ * Ordered by severity: observe < redact < block < end. When more than one check trips in the same call the
1373
+ * most severe action wins and ties break on the order of `checks`, so a set can mix an observed check with
1374
+ * an enforced one without the observation weakening the enforcement.
1375
+ *
1376
+ * There is no hand-over member yet. Handing a session to a human is a different mechanism on every channel
1377
+ * — a voice transfer, a chat assignment, an assistant with no human behind it — and wiring a guardrail into
1378
+ * all of them is out of proportion to the rest of this feature. Until AgentHandoverCapability has a runtime
1379
+ * on more than one channel, the crisis path is a block whose message routes the caller.
1380
+ * @public
1381
+ */
1382
+ export type AgentGuardrailAction = AgentGuardrailAction.BlockMember | AgentGuardrailAction.EndMember | AgentGuardrailAction.ObserveMember | AgentGuardrailAction.RedactMember | AgentGuardrailAction.$UnknownMember;
1383
+ /**
1384
+ * @public
1385
+ */
1386
+ export declare namespace AgentGuardrailAction {
1387
+ /**
1388
+ * Record the verdict and let the turn through. The rollout mode: every guardrail should run here first, against real traffic, until its trips are read and its sensitivity is tuned. A tripped check still emits GuardrailTrippedEvent and still appears in the trace, which is what makes this a tuning tool rather than a switched-off check.
1389
+ * @public
1390
+ */
1391
+ interface ObserveMember {
1392
+ observe: AgentGuardrailObserveAction;
1393
+ redact?: never;
1394
+ block?: never;
1395
+ end?: never;
1396
+ $unknown?: never;
1397
+ }
1398
+ /**
1399
+ * Mask the matched spans and let the turn continue. The mask is chosen by the platform and is not configurable — a tenant-authored placeholder that collides with real text, or that the model reads as an instruction, is worse than having no choice. Only valid on checks that return spans (PII, SECRETS).
1400
+ * @public
1401
+ */
1402
+ interface RedactMember {
1403
+ observe?: never;
1404
+ redact: AgentGuardrailRedactAction;
1405
+ block?: never;
1406
+ end?: never;
1407
+ $unknown?: never;
1408
+ }
1409
+ /**
1410
+ * Refuse the turn. The agent's model is never called, no tool runs, and the caller is answered with `message` instead. The session stays alive and the conversation continues, so on a check meant to redirect rather than stop — 'let me take a few details first' — the message is doing the work.
1411
+ * @public
1412
+ */
1413
+ interface BlockMember {
1414
+ observe?: never;
1415
+ redact?: never;
1416
+ block: AgentGuardrailBlockAction;
1417
+ end?: never;
1418
+ $unknown?: never;
1419
+ }
1420
+ /**
1421
+ * End the session. It lands in SessionStatus TERMINATED — not STOPPED, which is what a user asking to stop means — so a refused session is never read back as a clean finish. On voice this hangs up the call; on the other channels the session simply accepts no further turns.
1422
+ * @public
1423
+ */
1424
+ interface EndMember {
1425
+ observe?: never;
1426
+ redact?: never;
1427
+ block?: never;
1428
+ end: AgentGuardrailEndAction;
1429
+ $unknown?: never;
1430
+ }
1431
+ /**
1432
+ * @public
1433
+ */
1434
+ interface $UnknownMember {
1435
+ observe?: never;
1436
+ redact?: never;
1437
+ block?: never;
1438
+ end?: never;
1439
+ $unknown: [string, any];
1440
+ }
1441
+ /**
1442
+ * @deprecated unused in schema-serde mode.
1443
+ *
1444
+ */
1445
+ interface Visitor<T> {
1446
+ observe: (value: AgentGuardrailObserveAction) => T;
1447
+ redact: (value: AgentGuardrailRedactAction) => T;
1448
+ block: (value: AgentGuardrailBlockAction) => T;
1449
+ end: (value: AgentGuardrailEndAction) => T;
1450
+ _: (name: string, value: any) => T;
1451
+ }
1452
+ }
1453
+ /**
1454
+ * A check written by the tenant. A name and a prompt is the whole surface: no category enum can express the rules customers actually buy, such as refusing to quote a price before qualifying.
1455
+ * @public
1456
+ */
1457
+ export interface AgentGuardrailCustomCheck {
1458
+ /**
1459
+ * Natural-language description of what a custom check looks for. Describe the *content* to be caught, not an instruction to the checker: 'The caller is asking about cryptocurrency investments' works, 'Block all content about crypto' does not, and a negative definition ('anything except billing questions') reliably misfires.
1460
+ * @public
1461
+ */
1462
+ instructions: string;
1463
+ /**
1464
+ * Up to five turns that should trip this check. They steer the model's judgement and are NOT matched literally — a description plus examples catches the plural, the typo and the paraphrase that a term list misses.
1465
+ * @public
1466
+ */
1467
+ examples?: string[] | undefined;
1468
+ }
1469
+ /**
1470
+ * A check backed by one of the platform's prebuilt prompts.
1471
+ * @public
1472
+ */
1473
+ export interface AgentGuardrailPresetCheck {
1474
+ /**
1475
+ * A prebuilt check. Each preset is a platform-maintained prompt shipped in code and versioned with the
1476
+ * platform, not a tenant row — so a support question about what a preset caught has one answer. A preset
1477
+ * check is otherwise an ordinary AgentGuardrailCheck: its sensitivity and action are the tenant's to set,
1478
+ * and `notes` narrows its prompt without replacing it.
1479
+ * @public
1480
+ */
1481
+ preset: AgentGuardrailPreset;
1482
+ /**
1483
+ * Appended to the preset's prompt. For narrowing, not redefining — 'ignore card numbers read back after our own IVR prompts for them' — so the preset keeps its maintenance while fitting a tenant whose product would otherwise fight it.
1484
+ * @public
1485
+ */
1486
+ notes?: string | undefined;
1487
+ }
1488
+ /**
1489
+ * What a check is: one of the platform's presets, or a prompt the tenant wrote. Exactly one member is set.
1490
+ * @public
1491
+ */
1492
+ export type AgentGuardrailCheckKind = AgentGuardrailCheckKind.CustomMember | AgentGuardrailCheckKind.PresetMember | AgentGuardrailCheckKind.$UnknownMember;
1493
+ /**
1494
+ * @public
1495
+ */
1496
+ export declare namespace AgentGuardrailCheckKind {
1497
+ /**
1498
+ * A check backed by one of the platform's prebuilt prompts.
1499
+ * @public
1500
+ */
1501
+ interface PresetMember {
1502
+ preset: AgentGuardrailPresetCheck;
1503
+ custom?: never;
1504
+ $unknown?: never;
1505
+ }
1506
+ /**
1507
+ * A check written by the tenant. A name and a prompt is the whole surface: no category enum can express the rules customers actually buy, such as refusing to quote a price before qualifying.
1508
+ * @public
1509
+ */
1510
+ interface CustomMember {
1511
+ preset?: never;
1512
+ custom: AgentGuardrailCustomCheck;
1513
+ $unknown?: never;
1514
+ }
1515
+ /**
1516
+ * @public
1517
+ */
1518
+ interface $UnknownMember {
1519
+ preset?: never;
1520
+ custom?: never;
1521
+ $unknown: [string, any];
1522
+ }
1523
+ /**
1524
+ * @deprecated unused in schema-serde mode.
1525
+ *
1526
+ */
1527
+ interface Visitor<T> {
1528
+ preset: (value: AgentGuardrailPresetCheck) => T;
1529
+ custom: (value: AgentGuardrailCustomCheck) => T;
1530
+ _: (name: string, value: any) => T;
1531
+ }
1532
+ }
1533
+ /**
1534
+ * One thing the checker is asked about a turn. There is deliberately no `enabled` flag: a check that
1535
+ * should not run is removed, so a published version never carries a switched-off check that reads like
1536
+ * policy.
1537
+ * @public
1538
+ */
1539
+ export interface AgentGuardrailCheck {
1540
+ /**
1541
+ * Name of a check, unique within a guardrail set. Stable and machine-facing: session events and trace spans report a verdict by this name, so a reader needs no copy of the agent definition to tell which check fired.
1542
+ * @public
1543
+ */
1544
+ name: string;
1545
+ description?: string | undefined;
1546
+ /**
1547
+ * What a check is: one of the platform's presets, or a prompt the tenant wrote. Exactly one member is set.
1548
+ * @public
1549
+ */
1550
+ kind: AgentGuardrailCheckKind;
1551
+ /**
1552
+ * How much confidence a verdict needs before it counts as tripped. The checker reports a confidence per
1553
+ * check and this is the threshold against it, so raising sensitivity catches more and costs more false
1554
+ * positives without changing the prompt or the model: `low` trips only on high confidence, `medium` on
1555
+ * high and medium, `high` on anything but a clear pass. Defaults to MEDIUM.
1556
+ * @public
1557
+ */
1558
+ sensitivity?: AgentGuardrailSensitivity | undefined;
1559
+ /**
1560
+ * Overrides AgentGuardrailInput.action for this check alone.
1561
+ * @public
1562
+ */
1563
+ action?: AgentGuardrailAction | undefined;
1564
+ }
1565
+ /**
1566
+ * Screening applied to what reaches the model.
1567
+ *
1568
+ * There is deliberately no bundle or preset-group member. A named group that expands to a set of checks
1569
+ * reads like convenience and behaves like version skew: the same agent definition would mean different
1570
+ * things before and after a platform release, invisibly to the tenant who published it. Listing the checks
1571
+ * costs a few lines in a document the console writes anyway, and the published version then states exactly
1572
+ * what it enforces.
1573
+ * @public
1574
+ */
1575
+ export interface AgentGuardrailInput {
1576
+ /**
1577
+ * The checks to run, evaluated together in one call. Absent or empty means no screening.
1578
+ * @public
1579
+ */
1580
+ checks?: AgentGuardrailCheck[] | undefined;
1581
+ /**
1582
+ * The model that runs the checks. Defaults to the platform's guardrail model — deliberately small and fast, and deliberately not the agent's own, whose cost and latency are what this exists to avoid spending on a bad turn.
1583
+ * @public
1584
+ */
1585
+ model?: string | undefined;
1586
+ /**
1587
+ * Action for checks that declare none. Defaults to a block.
1588
+ * @public
1589
+ */
1590
+ action?: AgentGuardrailAction | undefined;
1591
+ /**
1592
+ * Runs the checker before the agent's model (BLOCKING) or alongside it (PARALLEL). Blocking costs the checker's latency on every turn but guarantees that a refused turn spent no tokens and fired no tool; parallel adds no latency and is the right trade on voice, where the delay is audible, at the risk that part of a reply reaches the caller and that a tool has already run before the cancellation lands. Defaults to BLOCKING.
1593
+ * @public
1594
+ */
1595
+ mode?: AgentGuardrailMode | undefined;
1596
+ /**
1597
+ * What happens when the checker itself errors or times out. OPEN lets the turn through unscreened and records GuardrailFailedEvent, so an unscreened turn is a fact in the log rather than an absence; CLOSED refuses it. Defaults to OPEN: an agent that stops answering because a small model had a bad minute is a worse and far likelier outage than the rare turn that goes unscreened. Background tasks, where nobody is waiting and a retry is free, are the case for CLOSED.
1598
+ * @public
1599
+ */
1600
+ errorMode?: AgentGuardrailErrorMode | undefined;
1601
+ /**
1602
+ * How much of the conversation the checker sees. Defaults to LAST_WITH_PRIOR, because the jailbreaks worth catching are built across several turns — establish a fiction, then cash it in — and a checker shown only the last turn sees an innocuous sentence. There is no full-transcript option: screening a whole call on every turn would make the guardrail dearer than the agent.
1603
+ * @public
1604
+ */
1605
+ window?: AgentGuardrailWindow | undefined;
1606
+ }
1607
+ /**
1608
+ * Turn screening, by side. Only `input` exists: it guards what reaches the model, and output screening is a separate policy with different actions, added here when it is built.
1609
+ * @public
1610
+ */
1611
+ export interface AgentGuardrails {
1612
+ /**
1613
+ * Screening applied to what reaches the model.
1614
+ *
1615
+ * There is deliberately no bundle or preset-group member. A named group that expands to a set of checks
1616
+ * reads like convenience and behaves like version skew: the same agent definition would mean different
1617
+ * things before and after a platform release, invisibly to the tenant who published it. Listing the checks
1618
+ * costs a few lines in a document the console writes anyway, and the published version then states exactly
1619
+ * what it enforces.
1620
+ * @public
1621
+ */
1622
+ input?: AgentGuardrailInput | undefined;
1623
+ }
1335
1624
  /**
1336
1625
  * Reference to a skill attached to an agent.
1337
1626
  * @public
@@ -2298,15 +2587,12 @@ export interface AgentWorkflowStep {
2298
2587
  */
2299
2588
  id: string;
2300
2589
  /**
2301
- * Human readable name of a step, shown in the builder and in traces. Never a routing key — see AgentWorkflowStepId — but it is read by the model as the fallback preview of an exit that leads here when the step carries no `summary`.
2590
+ * Human readable name of a step, e.g. 'Transfer to the sales desk'. Shown in the builder and in traces, and
2591
+ * read by the model too: when this step is an exit of the live step, the label is the preview offered alongside
2592
+ * the exit's condition. Never a routing key — see AgentWorkflowStepId — so renaming one never unwires a graph.
2302
2593
  * @public
2303
2594
  */
2304
2595
  label: string;
2305
- /**
2306
- * One line saying what happens here, shown to the model as the preview of any exit that leads to this step.
2307
- * @public
2308
- */
2309
- summary?: string | undefined;
2310
2596
  /**
2311
2597
  * The phase this step belongs to. Inherited by steps downstream, so a handful of tags organise a long graph.
2312
2598
  * @public
@@ -2425,6 +2711,15 @@ export interface AgentAiEngine {
2425
2711
  * @public
2426
2712
  */
2427
2713
  workflow?: AgentWorkflow | undefined;
2714
+ /**
2715
+ * Screening applied to a turn before this agent's model sees it. Sits next to `instructions` and
2716
+ * `workflow` because it is the third thing that governs a session, and it is enforced outside the prompt
2717
+ * on purpose: a refusal written into `instructions` is one the caller can argue the agent out of.
2718
+ * Optional — absent means no screening, which is what every agent authored before guardrails existed
2719
+ * keeps doing. See AgentGuardrails.
2720
+ * @public
2721
+ */
2722
+ guardrails?: AgentGuardrails | undefined;
2428
2723
  /**
2429
2724
  * Defaults to the platform default model when omitted.
2430
2725
  * @public
@@ -22,6 +22,15 @@ export declare var AgentConnectorCapability$: StaticStructureSchema;
22
22
  export declare var AgentDefinitionSnapshot$: StaticStructureSchema;
23
23
  export declare var AgentDelegationCapability$: StaticStructureSchema;
24
24
  export declare var AgentDeploymentRoute$: StaticStructureSchema;
25
+ export declare var AgentGuardrailBlockAction$: StaticStructureSchema;
26
+ export declare var AgentGuardrailCheck$: StaticStructureSchema;
27
+ export declare var AgentGuardrailCustomCheck$: StaticStructureSchema;
28
+ export declare var AgentGuardrailEndAction$: StaticStructureSchema;
29
+ export declare var AgentGuardrailInput$: StaticStructureSchema;
30
+ export declare var AgentGuardrailObserveAction$: StaticStructureSchema;
31
+ export declare var AgentGuardrailPresetCheck$: StaticStructureSchema;
32
+ export declare var AgentGuardrailRedactAction$: StaticStructureSchema;
33
+ export declare var AgentGuardrails$: StaticStructureSchema;
25
34
  export declare var AgentHandoverCapability$: StaticStructureSchema;
26
35
  export declare var AgentHandoverPipeline$: StaticStructureSchema;
27
36
  export declare var AgentHangupCapability$: StaticStructureSchema;
@@ -138,6 +147,8 @@ export declare var AgentSkillReference$: StaticStructureSchema;
138
147
  export declare var AgentCapability$: StaticUnionSchema;
139
148
  export declare var AgentEngine$: StaticUnionSchema;
140
149
  export declare var AgentGrantPrincipal$: StaticUnionSchema;
150
+ export declare var AgentGuardrailAction$: StaticUnionSchema;
151
+ export declare var AgentGuardrailCheckKind$: StaticUnionSchema;
141
152
  export declare var AgentSandboxCapability$: StaticUnionSchema;
142
153
  export declare var AgentToolAnnotation$: StaticUnionSchema;
143
154
  export declare var AgentToolFieldHandler$: StaticUnionSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wilma-agents-client",
3
3
  "description": "@wildix/wilma-agents-client client",
4
- "version": "1.0.27",
4
+ "version": "1.0.28",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",