@wildix/wilma-copilot-sessions-client 1.0.5 → 1.0.6

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.
Files changed (37) hide show
  1. package/dist-cjs/WilmaCopilotSessions.js +14 -4
  2. package/dist-cjs/commands/{GetCopilotSessionEventsCommand.js → AskCommand.js} +6 -6
  3. package/dist-cjs/commands/EnrichCommand.js +20 -0
  4. package/dist-cjs/commands/GetSessionEventsCommand.js +20 -0
  5. package/dist-cjs/commands/ListSessionsCommand.js +20 -0
  6. package/dist-cjs/commands/OpenCommand.js +20 -0
  7. package/dist-cjs/commands/ResolveCommand.js +20 -0
  8. package/dist-cjs/commands/{StreamCopilotSessionEventsCommand.js → StreamSessionEventsCommand.js} +6 -6
  9. package/dist-cjs/commands/index.js +7 -2
  10. package/dist-cjs/models/enums.js +22 -3
  11. package/dist-cjs/schemas/schemas_0.js +187 -33
  12. package/dist-es/WilmaCopilotSessions.js +14 -4
  13. package/dist-es/commands/{GetCopilotSessionEventsCommand.js → AskCommand.js} +5 -5
  14. package/dist-es/commands/{StreamCopilotSessionEventsCommand.js → EnrichCommand.js} +5 -5
  15. package/dist-es/commands/GetSessionEventsCommand.js +16 -0
  16. package/dist-es/commands/ListSessionsCommand.js +16 -0
  17. package/dist-es/commands/OpenCommand.js +16 -0
  18. package/dist-es/commands/ResolveCommand.js +16 -0
  19. package/dist-es/commands/StreamSessionEventsCommand.js +16 -0
  20. package/dist-es/commands/index.js +7 -2
  21. package/dist-es/models/enums.js +21 -2
  22. package/dist-es/schemas/schemas_0.js +185 -32
  23. package/dist-types/WilmaCopilotSessions.d.ts +53 -10
  24. package/dist-types/WilmaCopilotSessionsClient.d.ts +15 -4
  25. package/dist-types/commands/AskCommand.d.ts +87 -0
  26. package/dist-types/commands/EnrichCommand.d.ts +116 -0
  27. package/dist-types/commands/{GetCopilotSessionEventsCommand.d.ts → GetSessionEventsCommand.d.ts} +38 -24
  28. package/dist-types/commands/ListSessionsCommand.d.ts +93 -0
  29. package/dist-types/commands/OpenCommand.d.ts +117 -0
  30. package/dist-types/commands/ResolveCommand.d.ts +110 -0
  31. package/dist-types/commands/{StreamCopilotSessionEventsCommand.d.ts → StreamSessionEventsCommand.d.ts} +23 -23
  32. package/dist-types/commands/index.d.ts +7 -2
  33. package/dist-types/index.d.ts +6 -0
  34. package/dist-types/models/enums.d.ts +79 -6
  35. package/dist-types/models/models_0.d.ts +369 -9
  36. package/dist-types/schemas/schemas_0.d.ts +28 -6
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { Command as $Command } from "@smithy/core/client";
2
2
  import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadOutputTypes } from "@smithy/types";
3
- import type { StreamCopilotSessionEventsInput, StreamCopilotSessionEventsOutput } from "../models/models_0";
3
+ import type { StreamSessionEventsInput, StreamSessionEventsOutput } from "../models/models_0";
4
4
  import type { ServiceInputTypes, ServiceOutputTypes, WilmaCopilotSessionsClientResolvedConfig } from "../WilmaCopilotSessionsClient";
5
5
  /**
6
6
  * @public
@@ -10,56 +10,56 @@ export { $Command };
10
10
  /**
11
11
  * @public
12
12
  *
13
- * The input for {@link StreamCopilotSessionEventsCommand}.
13
+ * The input for {@link StreamSessionEventsCommand}.
14
14
  */
15
- export interface StreamCopilotSessionEventsCommandInput extends StreamCopilotSessionEventsInput {
15
+ export interface StreamSessionEventsCommandInput extends StreamSessionEventsInput {
16
16
  }
17
17
  /**
18
18
  * @public
19
19
  *
20
- * The output of {@link StreamCopilotSessionEventsCommand}.
20
+ * The output of {@link StreamSessionEventsCommand}.
21
21
  */
22
- export interface StreamCopilotSessionEventsCommandOutput extends Omit<StreamCopilotSessionEventsOutput, "events">, __MetadataBearer {
22
+ export interface StreamSessionEventsCommandOutput extends Omit<StreamSessionEventsOutput, "events">, __MetadataBearer {
23
23
  events: StreamingBlobPayloadOutputTypes;
24
24
  }
25
- declare const StreamCopilotSessionEventsCommand_base: {
26
- new (input: StreamCopilotSessionEventsCommandInput): import("@smithy/core/client").CommandImpl<StreamCopilotSessionEventsCommandInput, StreamCopilotSessionEventsCommandOutput, WilmaCopilotSessionsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
- new (input: StreamCopilotSessionEventsCommandInput): import("@smithy/core/client").CommandImpl<StreamCopilotSessionEventsCommandInput, StreamCopilotSessionEventsCommandOutput, WilmaCopilotSessionsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
25
+ declare const StreamSessionEventsCommand_base: {
26
+ new (input: StreamSessionEventsCommandInput): import("@smithy/core/client").CommandImpl<StreamSessionEventsCommandInput, StreamSessionEventsCommandOutput, WilmaCopilotSessionsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ new (input: StreamSessionEventsCommandInput): import("@smithy/core/client").CommandImpl<StreamSessionEventsCommandInput, StreamSessionEventsCommandOutput, WilmaCopilotSessionsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
28
28
  getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
29
29
  };
30
30
  /**
31
- * Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value. Reconnect by passing the last seen index + 1 as `startIndex`. The stream ends after a terminal `lifecycle` event (`ended`, `stopped` or `failed`); for finished sessions the recorded events are replayed and the stream closes.
31
+ * Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value. Reconnect by passing the last seen index + 1 as `startIndex`. The stream closes after a `lifecycle` event that leaves the session dormant (`idle`, `archived`) or `failed`. Dormant sessions can revive on a later event — reconnect with the last seen index + 1 to continue; for dormant sessions the recorded events are replayed and the stream closes.
32
32
  * @example
33
33
  * Use a bare-bones client and the command you need to make an API call.
34
34
  * ```javascript
35
- * import { WilmaCopilotSessionsClient, StreamCopilotSessionEventsCommand } from "@wildix/wilma-copilot-sessions-client"; // ES Modules import
36
- * // const { WilmaCopilotSessionsClient, StreamCopilotSessionEventsCommand } = require("@wildix/wilma-copilot-sessions-client"); // CommonJS import
35
+ * import { WilmaCopilotSessionsClient, StreamSessionEventsCommand } from "@wildix/wilma-copilot-sessions-client"; // ES Modules import
36
+ * // const { WilmaCopilotSessionsClient, StreamSessionEventsCommand } = require("@wildix/wilma-copilot-sessions-client"); // CommonJS import
37
37
  * // import type { WilmaCopilotSessionsClientConfig } from "@wildix/wilma-copilot-sessions-client";
38
38
  * const config = {}; // type is WilmaCopilotSessionsClientConfig
39
39
  * const client = new WilmaCopilotSessionsClient(config);
40
- * const input = { // StreamCopilotSessionEventsInput
40
+ * const input = { // StreamSessionEventsInput
41
41
  * sessionId: "STRING_VALUE", // required
42
42
  * company: "STRING_VALUE",
43
43
  * startIndex: Number("int"),
44
44
  * };
45
- * const command = new StreamCopilotSessionEventsCommand(input);
45
+ * const command = new StreamSessionEventsCommand(input);
46
46
  * const response = await client.send(command);
47
47
  * // consume or destroy the stream to free the socket.
48
48
  * const bytes = await response.events.transformToByteArray();
49
49
  * // const str = await response.events.transformToString();
50
50
  * // response.events.destroy(); // only applicable to Node.js Readable streams.
51
51
  *
52
- * // { // StreamCopilotSessionEventsOutput
52
+ * // { // StreamSessionEventsOutput
53
53
  * // events: "<SdkStream>", // see \@smithy/types -> StreamingBlobPayloadOutputTypes // required
54
54
  * // contentType: "STRING_VALUE", // required
55
55
  * // };
56
56
  *
57
57
  * ```
58
58
  *
59
- * @param StreamCopilotSessionEventsCommandInput - {@link StreamCopilotSessionEventsCommandInput}
60
- * @returns {@link StreamCopilotSessionEventsCommandOutput}
61
- * @see {@link StreamCopilotSessionEventsCommandInput} for command's `input` shape.
62
- * @see {@link StreamCopilotSessionEventsCommandOutput} for command's `response` shape.
59
+ * @param StreamSessionEventsCommandInput - {@link StreamSessionEventsCommandInput}
60
+ * @returns {@link StreamSessionEventsCommandOutput}
61
+ * @see {@link StreamSessionEventsCommandInput} for command's `input` shape.
62
+ * @see {@link StreamSessionEventsCommandOutput} for command's `response` shape.
63
63
  * @see {@link WilmaCopilotSessionsClientResolvedConfig | config} for WilmaCopilotSessionsClient's `config` shape.
64
64
  *
65
65
  * @throws {@link ValidationException} (client fault)
@@ -74,16 +74,16 @@ declare const StreamCopilotSessionEventsCommand_base: {
74
74
  *
75
75
  * @public
76
76
  */
77
- export declare class StreamCopilotSessionEventsCommand extends StreamCopilotSessionEventsCommand_base {
77
+ export declare class StreamSessionEventsCommand extends StreamSessionEventsCommand_base {
78
78
  /** @internal type navigation helper, not in runtime. */
79
79
  protected static __types: {
80
80
  api: {
81
- input: StreamCopilotSessionEventsInput;
82
- output: StreamCopilotSessionEventsOutput;
81
+ input: StreamSessionEventsInput;
82
+ output: StreamSessionEventsOutput;
83
83
  };
84
84
  sdk: {
85
- input: StreamCopilotSessionEventsCommandInput;
86
- output: StreamCopilotSessionEventsCommandOutput;
85
+ input: StreamSessionEventsCommandInput;
86
+ output: StreamSessionEventsCommandOutput;
87
87
  };
88
88
  };
89
89
  }
@@ -1,2 +1,7 @@
1
- export * from "./GetCopilotSessionEventsCommand";
2
- export * from "./StreamCopilotSessionEventsCommand";
1
+ export * from "./AskCommand";
2
+ export * from "./EnrichCommand";
3
+ export * from "./GetSessionEventsCommand";
4
+ export * from "./ListSessionsCommand";
5
+ export * from "./OpenCommand";
6
+ export * from "./ResolveCommand";
7
+ export * from "./StreamSessionEventsCommand";
@@ -10,6 +10,12 @@
10
10
  * lives in the companion wilma-copilot service; this service applies the published profile
11
11
  * versions and streams what copilot detects and shows.
12
12
  *
13
+ * Client surfaces additionally push context events (Open): emails, phones and
14
+ * typed entity references resolved into a relationship — the durable cross-channel view of one
15
+ * customer. Sessions never close: they idle when the conversation ends or goes quiet, archive to
16
+ * cold storage later, and revive on any new event. A new conversation gets a new session linked
17
+ * to the same relationship; the ingest response returns the sessions already associated with it.
18
+ *
13
19
  * @packageDocumentation
14
20
  */
15
21
  export * from "./WilmaCopilotSessionsClient";
@@ -247,27 +247,100 @@ export declare const AssetSeverity: {
247
247
  * @public
248
248
  */
249
249
  export type AssetSeverity = (typeof AssetSeverity)[keyof typeof AssetSeverity];
250
+ /**
251
+ * @public
252
+ * @enum
253
+ */
254
+ export declare const CopilotConversationKind: {
255
+ /**
256
+ * A copilot session opened directly from the app, without an underlying call, chat or conference. The conversation id is server-minted.
257
+ */
258
+ readonly APP: "app";
259
+ readonly CALL: "call";
260
+ readonly CHAT: "chat";
261
+ readonly CONFERENCE: "conference";
262
+ };
263
+ /**
264
+ * @public
265
+ */
266
+ export type CopilotConversationKind = (typeof CopilotConversationKind)[keyof typeof CopilotConversationKind];
267
+ /**
268
+ * @public
269
+ * @enum
270
+ */
271
+ export declare const CopilotIngestedSessionState: {
272
+ /**
273
+ * A new session was created for the event's conversation.
274
+ */
275
+ readonly CREATED: "created";
276
+ /**
277
+ * An existing session for the same conversation accepted the event; idle or archived sessions revive.
278
+ */
279
+ readonly REUSED: "reused";
280
+ };
281
+ /**
282
+ * @public
283
+ */
284
+ export type CopilotIngestedSessionState = (typeof CopilotIngestedSessionState)[keyof typeof CopilotIngestedSessionState];
285
+ /**
286
+ * @public
287
+ * @enum
288
+ */
289
+ export declare const CopilotLifecycleReason: {
290
+ /**
291
+ * The archive timer moved the idle session's state to cold storage.
292
+ */
293
+ readonly ARCHIVE_TIMER: "archive_timer";
294
+ /**
295
+ * The session was created — a matching conversation started or context was ingested for one.
296
+ */
297
+ readonly CREATED: "created";
298
+ /**
299
+ * The conversation ended; the session idles and stays revivable.
300
+ */
301
+ readonly ENDED: "ended";
302
+ /**
303
+ * An unrecoverable processing error.
304
+ */
305
+ readonly ERROR: "error";
306
+ /**
307
+ * No events arrived within the inactivity window; the session idles.
308
+ */
309
+ readonly INACTIVITY: "inactivity";
310
+ /**
311
+ * A new event revived an idle or archived session.
312
+ */
313
+ readonly REVIVED: "revived";
314
+ /**
315
+ * Assistance was stopped before the conversation ended; the session idles.
316
+ */
317
+ readonly STOPPED: "stopped";
318
+ };
319
+ /**
320
+ * @public
321
+ */
322
+ export type CopilotLifecycleReason = (typeof CopilotLifecycleReason)[keyof typeof CopilotLifecycleReason];
250
323
  /**
251
324
  * @public
252
325
  * @enum
253
326
  */
254
327
  export declare const CopilotSessionStatus: {
255
328
  /**
256
- * The conversation is live and being assisted.
329
+ * The session is processing events for its conversation.
257
330
  */
258
331
  readonly ACTIVE: "active";
259
332
  /**
260
- * The conversation ended normally.
333
+ * Session state moved to cold storage. A new event rehydrates and revives the session.
261
334
  */
262
- readonly ENDED: "ended";
335
+ readonly ARCHIVED: "archived";
263
336
  /**
264
- * Assistance failed with an unrecoverable error.
337
+ * Assistance failed with an unrecoverable error. The only terminal status.
265
338
  */
266
339
  readonly FAILED: "failed";
267
340
  /**
268
- * Assistance was stopped before the conversation ended.
341
+ * The conversation ended or went quiet. State is kept; any new event revives the session instantly.
269
342
  */
270
- readonly STOPPED: "stopped";
343
+ readonly IDLE: "idle";
271
344
  };
272
345
  /**
273
346
  * @public