@pam-ai/pam-ordo-contracts 3.40.0 → 3.42.0

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.
@@ -59,6 +59,46 @@ export interface paths {
59
59
  patch?: never;
60
60
  trace?: never;
61
61
  };
62
+ "/v1/inbox/reporting/summary": {
63
+ parameters: {
64
+ query?: never;
65
+ header?: never;
66
+ path?: never;
67
+ cookie?: never;
68
+ };
69
+ /**
70
+ * Team reporting figures for one window
71
+ * @description The Reporting page's figures, computed by the service rather than counted off listed rows. Scope is TEAM_INBOX exactly - the same visibility, the same teamId and departments semantics - so a tile can drill into the TEAM_INBOX list it counts and the two agree. live is the queue right now and ignores the window; owners and messages are bounded by the window. include names the sections to compute, so a comparison read of the previous window can ask for messages alone.
72
+ */
73
+ get: operations["getInboxReportingSummary"];
74
+ put?: never;
75
+ post?: never;
76
+ delete?: never;
77
+ options?: never;
78
+ head?: never;
79
+ patch?: never;
80
+ trace?: never;
81
+ };
82
+ "/v1/inbox/reporting/count-snapshots": {
83
+ parameters: {
84
+ query?: never;
85
+ header?: never;
86
+ path?: never;
87
+ cookie?: never;
88
+ };
89
+ /**
90
+ * The live queue counts as they stood at an earlier moment
91
+ * @description Open, overdue and needs-attention counts from the hourly snapshot taken at or before at, no earlier than two hours before it, summed over the same scope /v1/inbox/reporting/summary uses today. Snapshots are kept per owner, so the scope is applied to the people in it now: the comparison is the same people then and now. data is null when no snapshot falls inside that tolerance - before the first capture, after the 31-day retention, or across a missed hour - and a client then shows no comparison rather than a wrong one.
92
+ */
93
+ get: operations["getInboxReportingCountSnapshot"];
94
+ put?: never;
95
+ post?: never;
96
+ delete?: never;
97
+ options?: never;
98
+ head?: never;
99
+ patch?: never;
100
+ trace?: never;
101
+ };
62
102
  "/v1/inbox/realtime-session": {
63
103
  parameters: {
64
104
  query?: never;
@@ -1498,6 +1538,59 @@ export interface components {
1498
1538
  */
1499
1539
  latestUnrespondedInboundPreview?: string | null;
1500
1540
  };
1541
+ /** @description The three queue counts the Reporting page shows, with the same meaning as the matching InboxCounts fields for TEAM_INBOX in the same scope. */
1542
+ ReportingQueueCounts: {
1543
+ open: number;
1544
+ overdue: number;
1545
+ needsAttention: number;
1546
+ };
1547
+ /** @description Time to a first reply. The first unanswered customer inbound in a Conversation starts the clock and the next customer-facing outbound stops it; the gap is credited to whoever sent that outbound, Pam included. A gap counts in the window its outbound falls in. Gaps over 720 minutes are not replies and are left out. Mean and median travel together because the gap between them is the finding. */
1548
+ ReportingReplyStats: {
1549
+ meanMinutes: number | null;
1550
+ medianMinutes: number | null;
1551
+ sampleCount: number;
1552
+ };
1553
+ /** @description One person's line in the Reporting table. Listed when they own open work in scope now, or sent customer-facing outbound in the window. Queue fields are right now; outbound and reply are the window's. */
1554
+ ReportingOwnerRollup: {
1555
+ userId: string;
1556
+ open: number;
1557
+ overdue: number;
1558
+ needsAttention: number;
1559
+ /** @description The longest-waiting unanswered inbound across their open work, or null. */
1560
+ oldestUnrespondedAt: string | null;
1561
+ /** @description Customer-facing outbound this person sent in the window. */
1562
+ outbound: number;
1563
+ reply: components["schemas"]["ReportingReplyStats"];
1564
+ };
1565
+ /** @description Customer-facing outbound in the window - calls and texts, never internal notes or system interactions - and reply time across everyone who answered. */
1566
+ ReportingMessageMetrics: {
1567
+ outbound: number;
1568
+ outboundByPam: number;
1569
+ reply: components["schemas"]["ReportingReplyStats"];
1570
+ };
1571
+ ReportingSummary: {
1572
+ clientOrgId: string;
1573
+ /** Format: date-time */
1574
+ observedAt: string;
1575
+ /** Format: date-time */
1576
+ from: string;
1577
+ /** Format: date-time */
1578
+ to: string;
1579
+ live?: components["schemas"]["ReportingQueueCounts"];
1580
+ owners?: components["schemas"]["ReportingOwnerRollup"][];
1581
+ messages?: components["schemas"]["ReportingMessageMetrics"];
1582
+ };
1583
+ ReportingSummaryResponse: {
1584
+ data: components["schemas"]["ReportingSummary"];
1585
+ };
1586
+ ReportingCountSnapshot: {
1587
+ /** Format: date-time */
1588
+ capturedAt: string;
1589
+ counts: components["schemas"]["ReportingQueueCounts"];
1590
+ };
1591
+ ReportingCountSnapshotResponse: {
1592
+ data: components["schemas"]["ReportingCountSnapshot"] | null;
1593
+ };
1501
1594
  InboxCounts: {
1502
1595
  total: number;
1503
1596
  open: number;
@@ -1565,6 +1658,35 @@ export interface components {
1565
1658
  * @enum {string}
1566
1659
  */
1567
1660
  CallTerminalOutcomeV1: "answered" | "voicemail" | "missed" | "busy" | "no_answer";
1661
+ /** @description One thing the caller wanted, as classified by post-call analysis (pam-postcall `caller_intent`, the source call logs and reporting already use). `key` is the CALLER_INTENT tag, such as SCHEDULE_SERVICE or SPEAK_TO_HUMAN_IN_PARTS; it is an open string because tags are configured outside this contract, so a consumer must render an unknown key gracefully rather than reject it. */
1662
+ CallerIntentV1: {
1663
+ key: string;
1664
+ /**
1665
+ * @description `transfer` when the caller asked for a person or department (the SPEAK_TO_* keys), otherwise `intent`. A call can carry both; consumers show intents before transfers.
1666
+ * @enum {string}
1667
+ */
1668
+ kind: "intent" | "transfer";
1669
+ /** @description The analysis' main reason for the call. At most one entry is primary. */
1670
+ primary: boolean;
1671
+ /** @description Who the caller asked for, on SPEAK_TO_SPECIFIC_HUMAN. Null or absent when the analysis did not name anyone. */
1672
+ requestedPersonName?: string | null;
1673
+ /** @description The department the caller asked for, on a SPEAK_TO_HUMAN_IN_* transfer. */
1674
+ requestedDepartment?: string | null;
1675
+ /** @description Only on SCHEDULE_SERVICE. True when Pam actually called the service-request tool on this call, false when the analysis observed the call's tools and it did not, null when tool calls were not observed. Never derived from `fulfillment`, which is rewritten to service_appointment_request for rooftops without a service integration. */
1676
+ serviceRequestInvoked?: boolean | null;
1677
+ };
1678
+ /** @description The caller intents recorded for one call. `pending` means post-call analysis has not reported yet, which is different from an analyzed call whose only intent is UNCLEAR_INTENT. A pending entry may carry the call summary's primary intent as a provisional item so a reader is not left blank in the seconds before analysis lands. */
1679
+ CallerIntentsV1: {
1680
+ /** @enum {string} */
1681
+ analysis: "pending" | "analyzed";
1682
+ /**
1683
+ * Format: date-time
1684
+ * @description When the analysis that produced `items` ran. Null while pending.
1685
+ */
1686
+ analyzedAt?: string | null;
1687
+ /** @description Producer order with the primary entry first. */
1688
+ items: components["schemas"]["CallerIntentV1"][];
1689
+ };
1568
1690
  InteractionRef: {
1569
1691
  /** Format: uuid */
1570
1692
  id: string;
@@ -1595,6 +1717,8 @@ export interface components {
1595
1717
  * Null for Interactions Ordo itself authored — an internal comment has no external record to point at — and for any source that has not recorded one. Distinct from `sourceLocator`, which is a native partition/sort key and is published only when the source addresses records that way; a source can have one, both, or neither.
1596
1718
  */
1597
1719
  sourceRecordId?: string | null;
1720
+ /** @description What the caller wanted on this call, one entry per intent or transfer request (DASH-378). Present only on an inbound `call` or `voicemail`; absent or null on every other Interaction. Optional so this addition is a minor version. */
1721
+ callerIntents?: components["schemas"]["CallerIntentsV1"] | null;
1598
1722
  /**
1599
1723
  * @description Present only on an Interaction of kind `ro_event`. Before this field a repair-order Interaction arrived with kind `ro_event`, a null body and nothing else, so a reader could tell that SOMETHING had happened to a repair order but neither which one nor whether it had opened or closed.
1600
1724
  * NULL IS POSSIBLE ON AN ro_event, and 3.14.0 wrongly said it was not. There are two reasons for it, and only one of them is historical.
@@ -2116,6 +2240,14 @@ export interface components {
2116
2240
  /** @description Optional same-call current-source assessment. It is omitted when the model abstains; consumers must not derive fresh Attention from cumulative snapshot categories. */
2117
2241
  assessment?: components["schemas"]["ConversationAiAssessmentV1"];
2118
2242
  };
2243
+ /** @description The complete set of caller intents one post-call analysis produced for one call. The consumer replaces the call's previous set when `analyzedAt` is later than the stored one and ignores an equal or earlier analysis, so redelivery and out-of-order delivery cannot restore a stale set. */
2244
+ ProducerCallerIntentsObservedPayloadV1: {
2245
+ /** @description The call, as Ordo already knows it: `pam_call_metadata` and the connection id. The call may not have reached Ordo yet; the consumer keeps the intents until it does. */
2246
+ sourceInteraction: components["schemas"]["ProducerSourceInteractionIdentityV1"];
2247
+ /** Format: date-time */
2248
+ analyzedAt: string;
2249
+ intents: components["schemas"]["CallerIntentV1"][];
2250
+ };
2119
2251
  ProducerReminderFirePayloadV1: {
2120
2252
  /** Format: uuid */
2121
2253
  reminderId: string;
@@ -2203,6 +2335,27 @@ export interface components {
2203
2335
  target: components["schemas"]["ProducerSourceActivityTargetV1"];
2204
2336
  payload: components["schemas"]["ProducerAttentionCategoryObservedPayloadV1"];
2205
2337
  };
2338
+ /** @description Reports the caller intents post-call analysis recorded for one call (DASH-378). Unlike other producer commands it has no target: the producer knows the call, not its Conversation or Customer, and the call's own identity is enough for the consumer to find it. occurredAt is the call's business time. It uses its own FIFO message group per call, so it never delays the call's Conversation. */
2339
+ ProducerCallerIntentsObservedCommandV1: {
2340
+ /** @constant */
2341
+ schemaVersion: 1;
2342
+ operationId: string;
2343
+ /**
2344
+ * @description discriminator enum property added by openapi-typescript
2345
+ * @enum {string}
2346
+ */
2347
+ commandType: "interaction.caller_intents_observed";
2348
+ clientOrgId: string;
2349
+ traceId: string;
2350
+ /** Format: date-time */
2351
+ occurredAt: string;
2352
+ actor: {
2353
+ /** @constant */
2354
+ type: "source";
2355
+ };
2356
+ source: components["schemas"]["ProducerSourceV1"];
2357
+ payload: components["schemas"]["ProducerCallerIntentsObservedPayloadV1"];
2358
+ };
2206
2359
  ProducerReminderFireCommandV1: {
2207
2360
  /** @constant */
2208
2361
  schemaVersion: 1;
@@ -2267,7 +2420,7 @@ export interface components {
2267
2420
  payload: components["schemas"]["ProducerOverdueFirePayloadV1"];
2268
2421
  };
2269
2422
  /** @description Versioned internal FIFO producer command. Serialized SQS bodies are limited to 64 KiB by producers and consumers even though JSON Schema cannot express a byte-size limit. */
2270
- ProducerCommandV1: components["schemas"]["ProducerSourceActivityCommandV1"] | components["schemas"]["ProducerAttentionCommandV1"] | components["schemas"]["ProducerAttentionCategoryObservedCommandV1"] | components["schemas"]["ProducerReminderFireCommandV1"] | components["schemas"]["ProducerSnoozeReturnCommandV1"] | components["schemas"]["ProducerOverdueFireCommandV1"];
2423
+ ProducerCommandV1: components["schemas"]["ProducerSourceActivityCommandV1"] | components["schemas"]["ProducerAttentionCommandV1"] | components["schemas"]["ProducerAttentionCategoryObservedCommandV1"] | components["schemas"]["ProducerCallerIntentsObservedCommandV1"] | components["schemas"]["ProducerReminderFireCommandV1"] | components["schemas"]["ProducerSnoozeReturnCommandV1"] | components["schemas"]["ProducerOverdueFireCommandV1"];
2271
2424
  CommandEnvelope: {
2272
2425
  operationId: string;
2273
2426
  clientOrgId: string;
@@ -3069,6 +3222,14 @@ export interface components {
3069
3222
  ConversationId: string;
3070
3223
  InteractionId: string;
3071
3224
  AttachmentId: string;
3225
+ /** @description Window start, inclusive. */
3226
+ ReportingFrom: string;
3227
+ /** @description Window end, exclusive. Must be after from. */
3228
+ ReportingTo: string;
3229
+ /** @description Same meaning as teamId on GET /v1/inbox/conversations - the caller's own Team, never another. */
3230
+ ReportingTeamId: string;
3231
+ /** @description Same meaning as departments on GET /v1/inbox/conversations with scope TEAM_INBOX, including the attribution of unassigned work to BDC. A service manager's page sends SERVICE. */
3232
+ ReportingDepartments: ("SERVICE" | "BDC")[];
3072
3233
  StaffUserId: string;
3073
3234
  };
3074
3235
  requestBodies: {
@@ -3358,6 +3519,79 @@ export interface operations {
3358
3519
  503: components["responses"]["ServiceUnavailable"];
3359
3520
  };
3360
3521
  };
3522
+ getInboxReportingSummary: {
3523
+ parameters: {
3524
+ query: {
3525
+ /** @description Window start, inclusive. */
3526
+ from: components["parameters"]["ReportingFrom"];
3527
+ /** @description Window end, exclusive. Must be after from. */
3528
+ to: components["parameters"]["ReportingTo"];
3529
+ /** @description Same meaning as teamId on GET /v1/inbox/conversations - the caller's own Team, never another. */
3530
+ teamId?: components["parameters"]["ReportingTeamId"];
3531
+ /** @description Same meaning as departments on GET /v1/inbox/conversations with scope TEAM_INBOX, including the attribution of unassigned work to BDC. A service manager's page sends SERVICE. */
3532
+ departments?: components["parameters"]["ReportingDepartments"];
3533
+ /** @description Sections to compute. Absent computes all three. */
3534
+ include?: ("LIVE" | "OWNERS" | "MESSAGES")[];
3535
+ };
3536
+ header: {
3537
+ /** @description Authorized rooftop context. For commands this value must match body.clientOrgId; neither value is trusted without DASH-233 resolution. */
3538
+ "x-client-org-id": components["parameters"]["ClientOrgId"];
3539
+ };
3540
+ path?: never;
3541
+ cookie?: never;
3542
+ };
3543
+ requestBody?: never;
3544
+ responses: {
3545
+ /** @description The requested sections for the window. */
3546
+ 200: {
3547
+ headers: {
3548
+ [name: string]: unknown;
3549
+ };
3550
+ content: {
3551
+ "application/json": components["schemas"]["ReportingSummaryResponse"];
3552
+ };
3553
+ };
3554
+ 400: components["responses"]["BadRequest"];
3555
+ 401: components["responses"]["Unauthorized"];
3556
+ 403: components["responses"]["Forbidden"];
3557
+ 500: components["responses"]["InternalError"];
3558
+ 503: components["responses"]["ServiceUnavailable"];
3559
+ };
3560
+ };
3561
+ getInboxReportingCountSnapshot: {
3562
+ parameters: {
3563
+ query: {
3564
+ at: string;
3565
+ /** @description Same meaning as teamId on GET /v1/inbox/conversations - the caller's own Team, never another. */
3566
+ teamId?: components["parameters"]["ReportingTeamId"];
3567
+ /** @description Same meaning as departments on GET /v1/inbox/conversations with scope TEAM_INBOX, including the attribution of unassigned work to BDC. A service manager's page sends SERVICE. */
3568
+ departments?: components["parameters"]["ReportingDepartments"];
3569
+ };
3570
+ header: {
3571
+ /** @description Authorized rooftop context. For commands this value must match body.clientOrgId; neither value is trusted without DASH-233 resolution. */
3572
+ "x-client-org-id": components["parameters"]["ClientOrgId"];
3573
+ };
3574
+ path?: never;
3575
+ cookie?: never;
3576
+ };
3577
+ requestBody?: never;
3578
+ responses: {
3579
+ /** @description The snapshot nearest at, or null. */
3580
+ 200: {
3581
+ headers: {
3582
+ [name: string]: unknown;
3583
+ };
3584
+ content: {
3585
+ "application/json": components["schemas"]["ReportingCountSnapshotResponse"];
3586
+ };
3587
+ };
3588
+ 400: components["responses"]["BadRequest"];
3589
+ 401: components["responses"]["Unauthorized"];
3590
+ 403: components["responses"]["Forbidden"];
3591
+ 500: components["responses"]["InternalError"];
3592
+ 503: components["responses"]["ServiceUnavailable"];
3593
+ };
3594
+ };
3361
3595
  createInboxRealtimeSession: {
3362
3596
  parameters: {
3363
3597
  query?: never;