@wildix/wilma-copilot-client 1.0.19 → 1.0.20

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, AssetContentType, AssetIcon, AssetSeverity, AutomationOutputMode, ContextualKnowledgeMode, ContextualKnowledgeSource, CopilotChannel, CopilotVariableMode, CopilotVisibility, EvaluationWindow, IntentTextMatchMode, ProfileResourceType, ProfileStatus, SmartActionHandoverVariant, SmartActionResultMode } from "./enums";
2
+ import type { ActorType, AssetContentType, AssetIcon, AssetSeverity, AutomationOutputMode, ContextualKnowledgeMode, ContextualKnowledgeSource, CopilotAudienceKind, CopilotChannel, CopilotSpeaker, CopilotStage, CopilotVariableMode, EvaluationWindow, IntentTextMatchMode, ProfileResourceType, ProfileStatus, SmartActionHandoverVariant, SmartActionResultMode } from "./enums";
3
3
  /**
4
4
  * Who performed an action: an interactive user, an API key or an internal service.
5
5
  * @public
@@ -910,57 +910,27 @@ export interface AttachProfileResourceInput {
910
910
  resource: ProfileResource;
911
911
  }
912
912
  /**
913
- * A user or group access is granted to.
913
+ * One audience entry: a kind, and the values of that kind the profile assists. An entry with no values does not narrow anything.
914
914
  * @public
915
915
  */
916
- export type CopilotGrantPrincipal = CopilotGrantPrincipal.GroupIdMember | CopilotGrantPrincipal.UserIdMember | CopilotGrantPrincipal.$UnknownMember;
917
- /**
918
- * @public
919
- */
920
- export declare namespace CopilotGrantPrincipal {
921
- interface UserIdMember {
922
- userId: string;
923
- groupId?: never;
924
- $unknown?: never;
925
- }
926
- interface GroupIdMember {
927
- userId?: never;
928
- groupId: string;
929
- $unknown?: never;
930
- }
916
+ export interface CopilotAudienceEntry {
931
917
  /**
932
- * @public
933
- */
934
- interface $UnknownMember {
935
- userId?: never;
936
- groupId?: never;
937
- $unknown: [string, any];
938
- }
939
- /**
940
- * @deprecated unused in schema-serde mode.
918
+ * The kind of thing a profile is aimed at.
941
919
  *
942
- */
943
- interface Visitor<T> {
944
- userId: (value: string) => T;
945
- groupId: (value: string) => T;
946
- _: (name: string, value: any) => T;
947
- }
948
- }
949
- /**
950
- * Who the profile assists. There is no view/edit dimension — editing is gated by API auth scopes.
951
- * @public
952
- */
953
- export interface CopilotAccess {
954
- /**
955
- * Usage scope. Defaults to `organization`.
956
- * @public
957
- */
958
- visibility?: CopilotVisibility | undefined;
959
- /**
960
- * Users and groups assisted by the profile. Applies when visibility is `explicit`.
920
+ * Two families, and the difference decides which stages the entry can constrain.
921
+ * `user`, `group`, `department` and `agent` name **who is assisted** - a person for the first
922
+ * three, a Wilma AI agent for the last - and in the `before` stage the assisted party is
923
+ * whoever opened copilot, so they constrain every stage. `queue`, `service` and `trunk`
924
+ * describe a **live conversation**, which does not exist in `before` - so an entry of those
925
+ * kinds says nothing there.
926
+ *
927
+ * Values are the tenant's own routing objects: user emails for `user`, Wilma agent ids for
928
+ * `agent`, PBX group and department ids, queue and trunk names as `wda-stream` reports them,
929
+ * and x-bees service uris for `service`.
961
930
  * @public
962
931
  */
963
- grants?: CopilotGrantPrincipal[] | undefined;
932
+ kind: CopilotAudienceKind;
933
+ values: string[];
964
934
  }
965
935
  /**
966
936
  * The complete configuration of a profile, including draft lifecycle state. Referenced library resources are listed by id; a published version resolves them into an immutable snapshot.
@@ -970,20 +940,34 @@ export interface Profile {
970
940
  name: string;
971
941
  description?: string | undefined;
972
942
  /**
973
- * The conversation surface a copilot resource applies to. `calls` targets voice calls, `chats` targets chat conversations, `any` targets both.
943
+ * Who this profile assists - queues, groups, departments, users, AI agents, chat services
944
+ * and trunks. Empty or absent means everyone in the company. This is the profile's primary
945
+ * scope: an administrator reaches for "my refunds team", not for a conversation medium,
946
+ * and a queue already carries the medium, the skill and the line of business.
974
947
  * @public
975
948
  */
976
- channel: CopilotChannel;
949
+ audience?: CopilotAudienceEntry[] | undefined;
977
950
  /**
978
- * Conditions under which the profile matches a conversation. An empty tree always matches.
951
+ * Stages of a conversation this profile applies in. Empty or absent means every stage.
979
952
  * @public
980
953
  */
981
- conditions?: __DocumentType | undefined;
954
+ stages?: CopilotStage[] | undefined;
982
955
  /**
983
- * Who the profile assists. Defaults to organization-wide.
956
+ * Conversation channels this profile applies to. Empty or absent means every channel.
957
+ *
958
+ * Only constrains the `during` and `after` stages - nothing is a call, a conference or a
959
+ * chat before it starts - so a profile whose `stages` are `before` alone applies whatever
960
+ * this says.
984
961
  * @public
985
962
  */
986
- access?: CopilotAccess | undefined;
963
+ channels?: CopilotChannel[] | undefined;
964
+ /**
965
+ * Conditions under which the profile matches a conversation. An empty tree always matches. Deprecated - see the deprecation note.
966
+ *
967
+ * @deprecated (since 2026-08) Profile conditions are resolved once, on the session's first event, so a rule over anything copilot has yet to detect never activates the profile. Use `audience` / `stages` / `channels` for what is known at that moment, and put everything conditional on the assets, intents and automations the profile carries, where conditions are re-evaluated as state changes. Still read for profiles authored before those members existed.
968
+ * @public
969
+ */
970
+ conditions?: __DocumentType | undefined;
987
971
  /**
988
972
  * Copilot features enabled for this profile. Each list item is a typed feature and its configuration.
989
973
  * @public
@@ -1646,7 +1630,6 @@ export interface CreateEvaluationOutput {
1646
1630
  * @public
1647
1631
  */
1648
1632
  export interface IntentAiMatch {
1649
- enabled: boolean;
1650
1633
  /**
1651
1634
  * Prompt describing when this intent applies.
1652
1635
  * @public
@@ -1679,11 +1662,13 @@ export interface IntentTextMatchOption {
1679
1662
  * @public
1680
1663
  */
1681
1664
  export interface IntentTextMatch {
1682
- enabled: boolean;
1683
1665
  options?: IntentTextMatchOption[] | undefined;
1684
1666
  }
1685
1667
  /**
1686
1668
  * The detection handlers for an intent. Text matching is attempted first, then AI matching.
1669
+ *
1670
+ * An absent handler is a matcher that is off - which is what the `enabled` flag on each
1671
+ * handler used to say. An intent with neither handler set is never detected.
1687
1672
  * @public
1688
1673
  */
1689
1674
  export interface IntentHandlers {
@@ -1691,12 +1676,19 @@ export interface IntentHandlers {
1691
1676
  * Literal-text matching. Checked before AI matching; a text hit short-circuits semantic evaluation.
1692
1677
  * @public
1693
1678
  */
1694
- textMatch: IntentTextMatch;
1679
+ textMatch?: IntentTextMatch | undefined;
1695
1680
  /**
1696
1681
  * Semantic (AI) matching. Detects the intent from meaning and extracts structured fields into `intent.<name>.<field>`.
1697
1682
  * @public
1698
1683
  */
1699
- aiMatch: IntentAiMatch;
1684
+ aiMatch?: IntentAiMatch | undefined;
1685
+ /**
1686
+ * Whose lines both matchers read. Absent means `anyone`, which is how every intent
1687
+ * behaved before this member existed - matching over the whole transcript, so an intent
1688
+ * written about the customer also fires on the agent's own paraphrase of it.
1689
+ * @public
1690
+ */
1691
+ saidBy?: CopilotSpeaker | undefined;
1700
1692
  }
1701
1693
  /**
1702
1694
  * The editable definition of an intent.
@@ -1711,6 +1703,9 @@ export interface CreateIntentInput {
1711
1703
  description?: string | undefined;
1712
1704
  /**
1713
1705
  * The detection handlers for an intent. Text matching is attempted first, then AI matching.
1706
+ *
1707
+ * An absent handler is a matcher that is off - which is what the `enabled` flag on each
1708
+ * handler used to say. An intent with neither handler set is never detected.
1714
1709
  * @public
1715
1710
  */
1716
1711
  handlers: IntentHandlers;
@@ -1734,6 +1729,9 @@ export interface Intent {
1734
1729
  description?: string | undefined;
1735
1730
  /**
1736
1731
  * The detection handlers for an intent. Text matching is attempted first, then AI matching.
1732
+ *
1733
+ * An absent handler is a matcher that is off - which is what the `enabled` flag on each
1734
+ * handler used to say. An intent with neither handler set is never detected.
1737
1735
  * @public
1738
1736
  */
1739
1737
  handlers: IntentHandlers;
@@ -1787,20 +1785,34 @@ export interface CreateProfileInput {
1787
1785
  name: string;
1788
1786
  description?: string | undefined;
1789
1787
  /**
1790
- * The conversation surface a copilot resource applies to. `calls` targets voice calls, `chats` targets chat conversations, `any` targets both.
1788
+ * Who this profile assists - queues, groups, departments, users, AI agents, chat services
1789
+ * and trunks. Empty or absent means everyone in the company. This is the profile's primary
1790
+ * scope: an administrator reaches for "my refunds team", not for a conversation medium,
1791
+ * and a queue already carries the medium, the skill and the line of business.
1791
1792
  * @public
1792
1793
  */
1793
- channel: CopilotChannel;
1794
+ audience?: CopilotAudienceEntry[] | undefined;
1794
1795
  /**
1795
- * Conditions under which the profile matches a conversation. An empty tree always matches.
1796
+ * Stages of a conversation this profile applies in. Empty or absent means every stage.
1796
1797
  * @public
1797
1798
  */
1798
- conditions?: __DocumentType | undefined;
1799
+ stages?: CopilotStage[] | undefined;
1799
1800
  /**
1800
- * Who the profile assists. Defaults to organization-wide.
1801
+ * Conversation channels this profile applies to. Empty or absent means every channel.
1802
+ *
1803
+ * Only constrains the `during` and `after` stages - nothing is a call, a conference or a
1804
+ * chat before it starts - so a profile whose `stages` are `before` alone applies whatever
1805
+ * this says.
1801
1806
  * @public
1802
1807
  */
1803
- access?: CopilotAccess | undefined;
1808
+ channels?: CopilotChannel[] | undefined;
1809
+ /**
1810
+ * Conditions under which the profile matches a conversation. An empty tree always matches. Deprecated - see the deprecation note.
1811
+ *
1812
+ * @deprecated (since 2026-08) Profile conditions are resolved once, on the session's first event, so a rule over anything copilot has yet to detect never activates the profile. Use `audience` / `stages` / `channels` for what is known at that moment, and put everything conditional on the assets, intents and automations the profile carries, where conditions are re-evaluated as state changes. Still read for profiles authored before those members existed.
1813
+ * @public
1814
+ */
1815
+ conditions?: __DocumentType | undefined;
1804
1816
  /**
1805
1817
  * Copilot features enabled for this profile. Each list item is a typed feature and its configuration.
1806
1818
  * @public
@@ -2141,6 +2153,9 @@ export interface IntentSnapshot {
2141
2153
  description?: string | undefined;
2142
2154
  /**
2143
2155
  * The detection handlers for an intent. Text matching is attempted first, then AI matching.
2156
+ *
2157
+ * An absent handler is a matcher that is off - which is what the `enabled` flag on each
2158
+ * handler used to say. An intent with neither handler set is never detected.
2144
2159
  * @public
2145
2160
  */
2146
2161
  handlers: IntentHandlers;
@@ -2159,20 +2174,34 @@ export interface ProfileDefinitionSnapshot {
2159
2174
  name: string;
2160
2175
  description?: string | undefined;
2161
2176
  /**
2162
- * The conversation surface a copilot resource applies to. `calls` targets voice calls, `chats` targets chat conversations, `any` targets both.
2177
+ * Who this profile assists - queues, groups, departments, users, AI agents, chat services
2178
+ * and trunks. Empty or absent means everyone in the company. This is the profile's primary
2179
+ * scope: an administrator reaches for "my refunds team", not for a conversation medium,
2180
+ * and a queue already carries the medium, the skill and the line of business.
2163
2181
  * @public
2164
2182
  */
2165
- channel: CopilotChannel;
2183
+ audience?: CopilotAudienceEntry[] | undefined;
2166
2184
  /**
2167
- * Conditions under which the profile matches a conversation. An empty tree always matches.
2185
+ * Stages of a conversation this profile applies in. Empty or absent means every stage.
2168
2186
  * @public
2169
2187
  */
2170
- conditions?: __DocumentType | undefined;
2188
+ stages?: CopilotStage[] | undefined;
2171
2189
  /**
2172
- * Who the profile assists. Defaults to organization-wide.
2190
+ * Conversation channels this profile applies to. Empty or absent means every channel.
2191
+ *
2192
+ * Only constrains the `during` and `after` stages - nothing is a call, a conference or a
2193
+ * chat before it starts - so a profile whose `stages` are `before` alone applies whatever
2194
+ * this says.
2173
2195
  * @public
2174
2196
  */
2175
- access?: CopilotAccess | undefined;
2197
+ channels?: CopilotChannel[] | undefined;
2198
+ /**
2199
+ * Conditions under which the profile matches a conversation. An empty tree always matches. Deprecated - see the deprecation note.
2200
+ *
2201
+ * @deprecated (since 2026-08) Profile conditions are resolved once, on the session's first event, so a rule over anything copilot has yet to detect never activates the profile. Use `audience` / `stages` / `channels` for what is known at that moment, and put everything conditional on the assets, intents and automations the profile carries, where conditions are re-evaluated as state changes. Still read for profiles authored before those members existed.
2202
+ * @public
2203
+ */
2204
+ conditions?: __DocumentType | undefined;
2176
2205
  /**
2177
2206
  * Copilot features enabled for this profile at publish time, including their type-specific configuration.
2178
2207
  * @public
@@ -2274,12 +2303,12 @@ export interface IntentInfo {
2274
2303
  name: string;
2275
2304
  description?: string | undefined;
2276
2305
  /**
2277
- * Whether literal text matching is enabled.
2306
+ * Whether literal text matching is enabled, i.e. whether `handlers.textMatch` is set.
2278
2307
  * @public
2279
2308
  */
2280
2309
  textMatchEnabled: boolean;
2281
2310
  /**
2282
- * Whether semantic AI matching is enabled.
2311
+ * Whether semantic AI matching is enabled, i.e. whether `handlers.aiMatch` is set.
2283
2312
  * @public
2284
2313
  */
2285
2314
  aiMatchEnabled: boolean;
@@ -2422,10 +2451,15 @@ export interface ListProfilesInput {
2422
2451
  */
2423
2452
  status?: ProfileStatus | undefined;
2424
2453
  /**
2425
- * Filter by the conversation surface the profile applies to.
2454
+ * Filter by a conversation channel the profile applies to. A profile with no channels applies to every one, so it matches whatever is asked for here.
2426
2455
  * @public
2427
2456
  */
2428
2457
  channel?: CopilotChannel | undefined;
2458
+ /**
2459
+ * Filter by a stage the profile applies in. A profile with no stages applies in every one, so it matches whatever is asked for here.
2460
+ * @public
2461
+ */
2462
+ stage?: CopilotStage | undefined;
2429
2463
  /**
2430
2464
  * Filter by name or description.
2431
2465
  * @public
@@ -2467,10 +2501,24 @@ export interface ProfileInfo {
2467
2501
  name: string;
2468
2502
  description?: string | undefined;
2469
2503
  /**
2470
- * The conversation surface a copilot resource applies to. `calls` targets voice calls, `chats` targets chat conversations, `any` targets both.
2504
+ * The profile's targeting, so a list row can say what it applies to without reading the definition.
2505
+ * @public
2506
+ */
2507
+ audience?: CopilotAudienceEntry[] | undefined;
2508
+ /**
2509
+ * Stages a resource applies in. An empty or absent list means every stage.
2510
+ * @public
2511
+ */
2512
+ stages?: CopilotStage[] | undefined;
2513
+ /**
2514
+ * Conversation channels a resource applies to. An empty or absent list means every channel.
2515
+ *
2516
+ * A channel filter only constrains the `during` and `after` stages: in `before` there is
2517
+ * nothing to be a call, a conference or a chat, so a resource covering only `before` applies
2518
+ * whatever this list says.
2471
2519
  * @public
2472
2520
  */
2473
- channel: CopilotChannel;
2521
+ channels?: CopilotChannel[] | undefined;
2474
2522
  status: ProfileStatus;
2475
2523
  live: boolean;
2476
2524
  /**
@@ -2817,6 +2865,9 @@ export interface UpdateIntentInput {
2817
2865
  description?: string | undefined;
2818
2866
  /**
2819
2867
  * The detection handlers for an intent. Text matching is attempted first, then AI matching.
2868
+ *
2869
+ * An absent handler is a matcher that is off - which is what the `enabled` flag on each
2870
+ * handler used to say. An intent with neither handler set is never detected.
2820
2871
  * @public
2821
2872
  */
2822
2873
  handlers: IntentHandlers;
@@ -2851,20 +2902,34 @@ export interface UpdateProfileInput {
2851
2902
  name: string;
2852
2903
  description?: string | undefined;
2853
2904
  /**
2854
- * The conversation surface a copilot resource applies to. `calls` targets voice calls, `chats` targets chat conversations, `any` targets both.
2905
+ * Who this profile assists - queues, groups, departments, users, AI agents, chat services
2906
+ * and trunks. Empty or absent means everyone in the company. This is the profile's primary
2907
+ * scope: an administrator reaches for "my refunds team", not for a conversation medium,
2908
+ * and a queue already carries the medium, the skill and the line of business.
2855
2909
  * @public
2856
2910
  */
2857
- channel: CopilotChannel;
2911
+ audience?: CopilotAudienceEntry[] | undefined;
2858
2912
  /**
2859
- * Conditions under which the profile matches a conversation. An empty tree always matches.
2913
+ * Stages of a conversation this profile applies in. Empty or absent means every stage.
2860
2914
  * @public
2861
2915
  */
2862
- conditions?: __DocumentType | undefined;
2916
+ stages?: CopilotStage[] | undefined;
2863
2917
  /**
2864
- * Who the profile assists. Defaults to organization-wide.
2918
+ * Conversation channels this profile applies to. Empty or absent means every channel.
2919
+ *
2920
+ * Only constrains the `during` and `after` stages - nothing is a call, a conference or a
2921
+ * chat before it starts - so a profile whose `stages` are `before` alone applies whatever
2922
+ * this says.
2865
2923
  * @public
2866
2924
  */
2867
- access?: CopilotAccess | undefined;
2925
+ channels?: CopilotChannel[] | undefined;
2926
+ /**
2927
+ * Conditions under which the profile matches a conversation. An empty tree always matches. Deprecated - see the deprecation note.
2928
+ *
2929
+ * @deprecated (since 2026-08) Profile conditions are resolved once, on the session's first event, so a rule over anything copilot has yet to detect never activates the profile. Use `audience` / `stages` / `channels` for what is known at that moment, and put everything conditional on the assets, intents and automations the profile carries, where conditions are re-evaluated as state changes. Still read for profiles authored before those members existed.
2930
+ * @public
2931
+ */
2932
+ conditions?: __DocumentType | undefined;
2868
2933
  company?: string | undefined;
2869
2934
  profileId: string;
2870
2935
  /**
@@ -34,7 +34,7 @@ export declare var CardStaticContent$: StaticStructureSchema;
34
34
  export declare var CompareProfileVersionsInput$: StaticStructureSchema;
35
35
  export declare var CompareProfileVersionsOutput$: StaticStructureSchema;
36
36
  export declare var ContextualKnowledgeAnswersFeatureConfiguration$: StaticStructureSchema;
37
- export declare var CopilotAccess$: StaticStructureSchema;
37
+ export declare var CopilotAudienceEntry$: StaticStructureSchema;
38
38
  export declare var CopilotField$: StaticStructureSchema;
39
39
  export declare var CopilotMultilineParameter$: StaticStructureSchema;
40
40
  export declare var CopilotNumberParameter$: StaticStructureSchema;
@@ -138,7 +138,6 @@ export declare var AutomationHandler$: StaticUnionSchema;
138
138
  export declare var CardContent$: StaticUnionSchema;
139
139
  export declare var CopilotFeature$: StaticUnionSchema;
140
140
  export declare var CopilotFieldParameter$: StaticUnionSchema;
141
- export declare var CopilotGrantPrincipal$: StaticUnionSchema;
142
141
  export declare var PlaybookCompletionCriteria$: StaticUnionSchema;
143
142
  export declare var ProfileResource$: StaticUnionSchema;
144
143
  export declare var SmartAction$: StaticUnionSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wilma-copilot-client",
3
3
  "description": "@wildix/wilma-copilot-client client",
4
- "version": "1.0.19",
4
+ "version": "1.0.20",
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",