@ouispec/agent-core 0.17.0 → 0.19.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.
- package/dist/approvals/index.d.ts +1 -0
- package/dist/approvals/index.d.ts.map +1 -1
- package/dist/approvals/index.js +1 -0
- package/dist/approvals/index.js.map +1 -1
- package/dist/approvals/pushed.d.ts +18 -0
- package/dist/approvals/pushed.d.ts.map +1 -0
- package/dist/approvals/pushed.js +86 -0
- package/dist/approvals/pushed.js.map +1 -0
- package/dist/approvals/types.d.ts +37 -3
- package/dist/approvals/types.d.ts.map +1 -1
- package/dist/approvals/types.js +33 -1
- package/dist/approvals/types.js.map +1 -1
- package/dist/browser.d.ts +1 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/takeover/index.d.ts +30 -0
- package/dist/takeover/index.d.ts.map +1 -0
- package/dist/takeover/index.js +95 -0
- package/dist/takeover/index.js.map +1 -0
- package/dist/turns/types.d.ts +14 -6
- package/dist/turns/types.d.ts.map +1 -1
- package/dist/turns/types.js +3 -1
- package/dist/turns/types.js.map +1 -1
- package/dist/types/client-config.d.ts +71 -3
- package/dist/types/client-config.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
package/dist/approvals/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SocketLike } from '../types/client-config.js';
|
|
2
|
+
import { type ApprovalClaimResult, type ApprovalDeclinedEvent, type ApprovalGrantedEvent } from './types.js';
|
|
3
|
+
/** How long a tab waits for the store to answer its claim. */
|
|
4
|
+
export declare const APPROVAL_CLAIM_TIMEOUT_MS = 10000;
|
|
5
|
+
/** The pushed grant, or null when the payload is not one. */
|
|
6
|
+
export declare function readApprovalGranted(data: unknown): ApprovalGrantedEvent | null;
|
|
7
|
+
/** The pushed decline, or null when the payload is not one. */
|
|
8
|
+
export declare function readApprovalDeclined(data: unknown): ApprovalDeclinedEvent | null;
|
|
9
|
+
/** Where this tab stands: the conversation it has open, and the rooms it is joined to. */
|
|
10
|
+
export interface ApprovalTabPlace {
|
|
11
|
+
conversationId: string | null;
|
|
12
|
+
rooms: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/** Why a pushed grant is not this tab's, or null when it is. */
|
|
15
|
+
export declare function approvalGrantRefusal(grant: ApprovalGrantedEvent, tab: ApprovalTabPlace, now: number): string | null;
|
|
16
|
+
/** Claims a pushed grant on this tab's socket: the store's answer, or a refusal when it does not answer in time. */
|
|
17
|
+
export declare function claimApprovalGrant(socket: SocketLike, grant: ApprovalGrantedEvent, timeoutMs?: number): Promise<ApprovalClaimResult>;
|
|
18
|
+
//# sourceMappingURL=pushed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushed.d.ts","sourceRoot":"","sources":["../../src/approvals/pushed.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AAEpB,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAIhD,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI,CA2B9E;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,qBAAqB,GAAG,IAAI,CAYhF;AAED,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKnH;AAED,oHAAoH;AACpH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,oBAAoB,EAAE,SAAS,SAA4B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAQvJ"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the approval store pushes to a tab when the person decides an action on
|
|
3
|
+
* their page in a conversation channel: the single-use grant, when
|
|
4
|
+
* they approved it by voice, on the phone or in chat after its verbatim
|
|
5
|
+
* readback; or the decline. Reading, checking and claiming them, browser-safe,
|
|
6
|
+
* so every tab (agent-react's provider, a host's own UI, a scripted tab) does
|
|
7
|
+
* it one way.
|
|
8
|
+
*
|
|
9
|
+
* A grant is the tab's only when it is for the conversation this tab has open
|
|
10
|
+
* and was pushed to a room this tab is in: a tab on another conversation, or
|
|
11
|
+
* one that left the room, is stale and leaves it. A tab that may take it
|
|
12
|
+
* claims it on its own socket (`approval:claim`); the store answers the grant
|
|
13
|
+
* to the first claim only, so of two tabs on one conversation exactly one
|
|
14
|
+
* holds it, and the OUI runtime of that tab runs the action once.
|
|
15
|
+
*/
|
|
16
|
+
import { ARGS_HASH_PATTERN } from 'oui-spec/spec';
|
|
17
|
+
import { APPROVAL_CHANNELS, APPROVAL_CLAIM_EVENT, READBACK_UI_APPROVAL_CHANNELS, } from './types.js';
|
|
18
|
+
/** How long a tab waits for the store to answer its claim. */
|
|
19
|
+
export const APPROVAL_CLAIM_TIMEOUT_MS = 10_000;
|
|
20
|
+
const isText = (v) => typeof v === 'string' && v.length > 0;
|
|
21
|
+
/** The pushed grant, or null when the payload is not one. */
|
|
22
|
+
export function readApprovalGranted(data) {
|
|
23
|
+
if (!data || typeof data !== 'object')
|
|
24
|
+
return null;
|
|
25
|
+
const d = data;
|
|
26
|
+
if (!isText(d.approvalId) ||
|
|
27
|
+
!isText(d.grantId) ||
|
|
28
|
+
!isText(d.conversationId) ||
|
|
29
|
+
!isText(d.room) ||
|
|
30
|
+
typeof d.argsHash !== 'string' ||
|
|
31
|
+
!ARGS_HASH_PATTERN.test(d.argsHash) ||
|
|
32
|
+
typeof d.expiresAt !== 'number' ||
|
|
33
|
+
!Number.isFinite(d.expiresAt) ||
|
|
34
|
+
typeof d.channel !== 'string' ||
|
|
35
|
+
!READBACK_UI_APPROVAL_CHANNELS.has(d.channel)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
approvalId: d.approvalId,
|
|
40
|
+
grantId: d.grantId,
|
|
41
|
+
argsHash: d.argsHash,
|
|
42
|
+
expiresAt: d.expiresAt,
|
|
43
|
+
conversationId: d.conversationId,
|
|
44
|
+
room: d.room,
|
|
45
|
+
channel: d.channel,
|
|
46
|
+
timestamp: typeof d.timestamp === 'number' ? d.timestamp : Date.now(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** The pushed decline, or null when the payload is not one. */
|
|
50
|
+
export function readApprovalDeclined(data) {
|
|
51
|
+
if (!data || typeof data !== 'object')
|
|
52
|
+
return null;
|
|
53
|
+
const d = data;
|
|
54
|
+
if (!isText(d.approvalId) || !isText(d.conversationId) || typeof d.channel !== 'string')
|
|
55
|
+
return null;
|
|
56
|
+
const channel = d.channel;
|
|
57
|
+
if (channel === 'ui' || !APPROVAL_CHANNELS.includes(channel))
|
|
58
|
+
return null;
|
|
59
|
+
return {
|
|
60
|
+
approvalId: d.approvalId,
|
|
61
|
+
conversationId: d.conversationId,
|
|
62
|
+
channel: channel,
|
|
63
|
+
timestamp: typeof d.timestamp === 'number' ? d.timestamp : Date.now(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** Why a pushed grant is not this tab's, or null when it is. */
|
|
67
|
+
export function approvalGrantRefusal(grant, tab, now) {
|
|
68
|
+
if (grant.conversationId !== tab.conversationId)
|
|
69
|
+
return 'it is for a conversation this tab does not have open';
|
|
70
|
+
if (!tab.rooms.includes(grant.room))
|
|
71
|
+
return 'it was pushed to a room this tab is not in';
|
|
72
|
+
if (now >= grant.expiresAt)
|
|
73
|
+
return 'it has expired';
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
/** Claims a pushed grant on this tab's socket: the store's answer, or a refusal when it does not answer in time. */
|
|
77
|
+
export function claimApprovalGrant(socket, grant, timeoutMs = APPROVAL_CLAIM_TIMEOUT_MS) {
|
|
78
|
+
return new Promise((resolve) => {
|
|
79
|
+
const timer = setTimeout(() => resolve({ ok: false, reason: 'invalid', error: 'the server did not answer' }), timeoutMs);
|
|
80
|
+
socket.emit(APPROVAL_CLAIM_EVENT, { approvalId: grant.approvalId, grantId: grant.grantId }, (answer) => {
|
|
81
|
+
clearTimeout(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CAAC;AACJ,CAAC;AAQD,gEAAgE;AAChE,MAAM,UAAU,oBAAoB,CAAC,KAA2B,EAAE,GAAqB,EAAE,GAAW;IAClG,IAAI,KAAK,CAAC,cAAc,KAAK,GAAG,CAAC,cAAc;QAAE,OAAO,sDAAsD,CAAC;IAC/G,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,4CAA4C,CAAC;IACzF,IAAI,GAAG,IAAI,KAAK,CAAC,SAAS;QAAE,OAAO,gBAAgB,CAAC;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,kBAAkB,CAAC,MAAkB,EAAE,KAA2B,EAAE,SAAS,GAAG,yBAAyB;IACvH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;QACzH,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,MAA2B,EAAE,EAAE;YAC1H,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApprovalChannel } from '@ouispec/contract';
|
|
1
|
+
import type { ApprovalChannel, ReadbackUIApprovalChannel } from '@ouispec/contract';
|
|
2
2
|
/**
|
|
3
3
|
* Approvals: the shapes the worker, the approval store in the
|
|
4
4
|
* realtime server, the browser's approval card and a conversation engine
|
|
@@ -7,6 +7,38 @@ import type { ApprovalChannel } from '@ouispec/contract';
|
|
|
7
7
|
*/
|
|
8
8
|
/** The client event a user's socket sends when they click the approval card. */
|
|
9
9
|
export declare const APPROVAL_DECIDE_EVENT = "approval:decide";
|
|
10
|
+
/**
|
|
11
|
+
* What the approval store pushes to the room of the turn that asked, when the
|
|
12
|
+
* person decides an action on their page in a conversation channel: the grant
|
|
13
|
+
* (`ApprovalGrantedEvent`) or the decline (`ApprovalDeclinedEvent`). Only the
|
|
14
|
+
* store sends them; the realtime server's emit API refuses them.
|
|
15
|
+
*/
|
|
16
|
+
export declare const APPROVAL_PUSH_EVENTS: {
|
|
17
|
+
readonly GRANTED: "agent:approval_granted";
|
|
18
|
+
readonly DECLINED: "agent:approval_declined";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The client event a tab's socket sends to take a grant the approval store
|
|
22
|
+
* pushed it (`agent:approval_granted`): only the first claim gets the grant.
|
|
23
|
+
*/
|
|
24
|
+
export declare const APPROVAL_CLAIM_EVENT = "approval:claim";
|
|
25
|
+
/**
|
|
26
|
+
* The conversation channels on which an action on the person's page is
|
|
27
|
+
* approved by its verbatim readback and an affirmative next turn, as well as
|
|
28
|
+
* by its card: a call in the product's page, a call through a
|
|
29
|
+
* carrier, and a chat that sends the readback as text. Never SMS, which has
|
|
30
|
+
* no page beside it, and never `ui`, where a typed yes is a message.
|
|
31
|
+
*/
|
|
32
|
+
export declare const READBACK_UI_APPROVAL_CHANNELS: ReadonlySet<ApprovalChannel>;
|
|
33
|
+
/** Whether a decision on `channel` may approve an action on the person's page by its readback. */
|
|
34
|
+
export declare function approvesUIByReadback(channel: ApprovalChannel): channel is ReadbackUIApprovalChannel;
|
|
35
|
+
/**
|
|
36
|
+
* How long a grant pushed to the tab for an approval given by voice or in
|
|
37
|
+
* chat lasts, at most: long enough for the turn that redeems the token to
|
|
38
|
+
* dispatch the action, short enough that an unclaimed grant does not linger.
|
|
39
|
+
* It never outlasts the approval itself.
|
|
40
|
+
*/
|
|
41
|
+
export declare const APPROVAL_GRANT_TTL_MS: number;
|
|
10
42
|
/**
|
|
11
43
|
* The longest each part of an approval's preview may be, in characters: what
|
|
12
44
|
* the approval store accepts, and what the worker holds a host's own preview
|
|
@@ -81,12 +113,14 @@ export interface ApprovalSettlement {
|
|
|
81
113
|
* Why an approval was expired before its time:
|
|
82
114
|
* - `superseded`: the person sent a new message while the card waited.
|
|
83
115
|
* - `stopped`: the turn that asked for it was stopped as it asked.
|
|
116
|
+
* - `taken_over`: a person on the staff took the conversation over while it
|
|
117
|
+
* waited: the person now answering did not ask for it.
|
|
84
118
|
*
|
|
85
119
|
* A withdrawn approval is expired from that moment: its card is dead and its
|
|
86
120
|
* token answers `used`. What is stored and told to the model says why, so it
|
|
87
121
|
* reads "withdrawn because you sent a new message", not "it timed out".
|
|
88
122
|
*/
|
|
89
|
-
export type ApprovalWithdrawReason = 'superseded' | 'stopped';
|
|
123
|
+
export type ApprovalWithdrawReason = 'superseded' | 'stopped' | 'taken_over';
|
|
90
124
|
export declare const APPROVAL_WITHDRAW_REASONS: readonly ApprovalWithdrawReason[];
|
|
91
125
|
/** The answer to withdrawing an approval (`POST /internal/approvals/:id/settle` with `expire`). */
|
|
92
126
|
export interface ApprovalWithdrawal {
|
|
@@ -103,5 +137,5 @@ export interface ApprovalOwner {
|
|
|
103
137
|
userId: string;
|
|
104
138
|
conversationId: string;
|
|
105
139
|
}
|
|
106
|
-
export type { ActionRequestApproval, ApprovalChannel, ApprovalContinuation, ApprovalDecidePayload, ApprovalDecideResult, ApprovalDecision, ApprovalEffect, ApprovalGrant, ApprovalPreview, ApprovalPreviewArgument, ApprovalRedeemResult, ApprovalRefusal, ApprovalRefusalReason, ApprovalRequiredEvent, ApprovalStatus, ApprovalReceiptClaims, ApprovalTokenClaims, ApprovedCall, PendingApprovalInput, } from '@ouispec/contract';
|
|
140
|
+
export type { ActionRequestApproval, ApprovalChannel, ApprovalClaimPayload, ApprovalClaimResult, ApprovalContinuation, ApprovalDecidePayload, ApprovalDecideResult, ApprovalDecision, ApprovalEffect, ApprovalDeclinedEvent, ApprovalGrant, ApprovalGrantedEvent, ApprovalPreview, ApprovalPreviewArgument, ApprovalRedeemResult, ApprovalRefusal, ApprovalRefusalReason, ApprovalRequiredEvent, ApprovalStatus, ApprovalReceiptClaims, ApprovalTokenClaims, ApprovedCall, PendingApprovalInput, ReadbackUIApprovalChannel, } from '@ouispec/contract';
|
|
107
141
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,eAAe,EAAiB,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE1H;;;;;GAKG;AAEH,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;CAAwB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,eAAe,CAAkE,CAAC;AAE1I,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,IAAI,yBAAyB,CAEnG;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAa,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;CAQ1B,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAClD,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAA4C,CAAC;AAErG;;;;GAIG;AACH,eAAO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/dist/approvals/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AGENT_APPROVAL_EVENTS } from '@ouispec/agent-events';
|
|
1
2
|
/**
|
|
2
3
|
* Approvals: the shapes the worker, the approval store in the
|
|
3
4
|
* realtime server, the browser's approval card and a conversation engine
|
|
@@ -6,6 +7,37 @@
|
|
|
6
7
|
*/
|
|
7
8
|
/** The client event a user's socket sends when they click the approval card. */
|
|
8
9
|
export const APPROVAL_DECIDE_EVENT = 'approval:decide';
|
|
10
|
+
/**
|
|
11
|
+
* What the approval store pushes to the room of the turn that asked, when the
|
|
12
|
+
* person decides an action on their page in a conversation channel: the grant
|
|
13
|
+
* (`ApprovalGrantedEvent`) or the decline (`ApprovalDeclinedEvent`). Only the
|
|
14
|
+
* store sends them; the realtime server's emit API refuses them.
|
|
15
|
+
*/
|
|
16
|
+
export const APPROVAL_PUSH_EVENTS = AGENT_APPROVAL_EVENTS;
|
|
17
|
+
/**
|
|
18
|
+
* The client event a tab's socket sends to take a grant the approval store
|
|
19
|
+
* pushed it (`agent:approval_granted`): only the first claim gets the grant.
|
|
20
|
+
*/
|
|
21
|
+
export const APPROVAL_CLAIM_EVENT = 'approval:claim';
|
|
22
|
+
/**
|
|
23
|
+
* The conversation channels on which an action on the person's page is
|
|
24
|
+
* approved by its verbatim readback and an affirmative next turn, as well as
|
|
25
|
+
* by its card: a call in the product's page, a call through a
|
|
26
|
+
* carrier, and a chat that sends the readback as text. Never SMS, which has
|
|
27
|
+
* no page beside it, and never `ui`, where a typed yes is a message.
|
|
28
|
+
*/
|
|
29
|
+
export const READBACK_UI_APPROVAL_CHANNELS = new Set(['voice', 'phone', 'chat']);
|
|
30
|
+
/** Whether a decision on `channel` may approve an action on the person's page by its readback. */
|
|
31
|
+
export function approvesUIByReadback(channel) {
|
|
32
|
+
return READBACK_UI_APPROVAL_CHANNELS.has(channel);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* How long a grant pushed to the tab for an approval given by voice or in
|
|
36
|
+
* chat lasts, at most: long enough for the turn that redeems the token to
|
|
37
|
+
* dispatch the action, short enough that an unclaimed grant does not linger.
|
|
38
|
+
* It never outlasts the approval itself.
|
|
39
|
+
*/
|
|
40
|
+
export const APPROVAL_GRANT_TTL_MS = 2 * 60_000;
|
|
9
41
|
/**
|
|
10
42
|
* The longest each part of an approval's preview may be, in characters: what
|
|
11
43
|
* the approval store accepts, and what the worker holds a host's own preview
|
|
@@ -38,7 +70,7 @@ export const EXPIRED_APPROVAL_MEMORY_MS = 30 * 24 * 60 * 60_000;
|
|
|
38
70
|
* stored conversation does not say "waiting" for good.
|
|
39
71
|
*/
|
|
40
72
|
export const EXPIRY_CLAIM_LEASE_MS = 2 * 60_000;
|
|
41
|
-
export const APPROVAL_WITHDRAW_REASONS = ['superseded', 'stopped'];
|
|
73
|
+
export const APPROVAL_WITHDRAW_REASONS = ['superseded', 'stopped', 'taken_over'];
|
|
42
74
|
const requestIsOUIs = true;
|
|
43
75
|
const grantIsOUIs = true;
|
|
44
76
|
void requestIsOUIs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;GAKG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAiC,IAAI,GAAG,CAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAA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ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/browser.js
CHANGED
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,yDAAyD;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,yDAAyD;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ConversationHold, ConversationMessage, StaffSpeaker, TakeoverChange } from '@ouispec/contract';
|
|
2
|
+
export type { AnnounceMessageRequest, AnnounceMessageResult, ConversationHandedBackEvent, ConversationHold, ConversationMessage, ConversationMessageEvent, ConversationMessageRole, ConversationRooms, ConversationTakenOverEvent, HandBackCause, HandBackRequest, HandBackResult, StaffSpeaker, TakeoverChange, TakeOverRequest, TakeOverResult, } from '@ouispec/contract';
|
|
3
|
+
/** The conversation's events, as the platform declares them (`@ouispec/agent-events`). */
|
|
4
|
+
export declare const CONVERSATION_EVENTS: {
|
|
5
|
+
readonly TAKEN_OVER: "agent:conversation_taken_over";
|
|
6
|
+
readonly HANDED_BACK: "agent:conversation_handed_back";
|
|
7
|
+
readonly MESSAGE: "agent:conversation_message";
|
|
8
|
+
};
|
|
9
|
+
/** The longest a staff member's name or role reaches the model or a tab: the contract's bound. */
|
|
10
|
+
export declare const MAX_STAFF_LABEL_CHARS = 80;
|
|
11
|
+
/** The stored role of a person's message, and of a take-over or hand-back entry. */
|
|
12
|
+
export declare const STAFF_ROLE = "staff";
|
|
13
|
+
/** "Jordan (Toyota of Quillhaven sales)", or "Jordan" when the speaker has no role. */
|
|
14
|
+
export declare function staffLabel(speaker: Pick<StaffSpeaker, 'displayName' | 'role'>): string;
|
|
15
|
+
/**
|
|
16
|
+
* The line the model reads before a person's message: who wrote it, that the
|
|
17
|
+
* words are theirs, and that they stand.
|
|
18
|
+
*/
|
|
19
|
+
export declare function staffMessageNote(speaker: Pick<StaffSpeaker, 'displayName' | 'role'>): string;
|
|
20
|
+
/** The line the model reads where a person took the conversation over, or handed it back. */
|
|
21
|
+
export declare function takeoverNote(change: TakeoverChange, speaker: Pick<StaffSpeaker, 'displayName' | 'role'>): string;
|
|
22
|
+
/** A staff speaker, when `value` is one; else null. Only the fields the contract names are kept. */
|
|
23
|
+
export declare function readStaffSpeaker(value: unknown): StaffSpeaker | null;
|
|
24
|
+
/** A hold, when `value` is one; else null. */
|
|
25
|
+
export declare function readConversationHold(value: unknown): ConversationHold | null;
|
|
26
|
+
/** A conversation's message, when `value` is one; else null. A `staff` message must name its speaker. */
|
|
27
|
+
export declare function readConversationMessage(value: unknown): ConversationMessage | null;
|
|
28
|
+
/** Whether `value` names a change of hands the platform knows. */
|
|
29
|
+
export declare function isTakeoverChange(value: unknown): value is TakeoverChange;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.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AkE;AAClE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person takes a conversation from the agent, and hands it back: the shapes
|
|
3
|
+
* every party exchanges, and what the model is told.
|
|
4
|
+
*
|
|
5
|
+
* While a person on the product's staff holds a conversation the agent does
|
|
6
|
+
* not answer it. The person's messages and the take-over and hand-back are
|
|
7
|
+
* stored by the product in the conversation, under the person's name, and the
|
|
8
|
+
* agent's next turn reads them as the business's side of the conversation:
|
|
9
|
+
* the person's words, not the agent's, and never the customer's.
|
|
10
|
+
*/
|
|
11
|
+
import { AGENT_CONVERSATION_EVENTS } from '@ouispec/agent-events';
|
|
12
|
+
/** The conversation's events, as the platform declares them (`@ouispec/agent-events`). */
|
|
13
|
+
export const CONVERSATION_EVENTS = AGENT_CONVERSATION_EVENTS;
|
|
14
|
+
/** The longest a staff member's name or role reaches the model or a tab: the contract's bound. */
|
|
15
|
+
export const MAX_STAFF_LABEL_CHARS = 80;
|
|
16
|
+
/** The stored role of a person's message, and of a take-over or hand-back entry. */
|
|
17
|
+
export const STAFF_ROLE = 'staff';
|
|
18
|
+
/**
|
|
19
|
+
* A name or role as it may stand inside a bracketed line the model reads: no
|
|
20
|
+
* brackets, no line breaks, no runs of space, at most 80 characters. A product
|
|
21
|
+
* names its staff, but the line around the name is the platform's.
|
|
22
|
+
*/
|
|
23
|
+
function labelPart(text) {
|
|
24
|
+
return text
|
|
25
|
+
.replace(/[[\]\r\n\t]+/g, ' ')
|
|
26
|
+
.replace(/\s+/g, ' ')
|
|
27
|
+
.trim()
|
|
28
|
+
.slice(0, MAX_STAFF_LABEL_CHARS);
|
|
29
|
+
}
|
|
30
|
+
/** "Jordan (Toyota of Quillhaven sales)", or "Jordan" when the speaker has no role. */
|
|
31
|
+
export function staffLabel(speaker) {
|
|
32
|
+
const name = labelPart(speaker.displayName) || 'A person';
|
|
33
|
+
const role = speaker.role ? labelPart(speaker.role) : '';
|
|
34
|
+
return role ? `${name} (${role})` : name;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The line the model reads before a person's message: who wrote it, that the
|
|
38
|
+
* words are theirs, and that they stand.
|
|
39
|
+
*/
|
|
40
|
+
export function staffMessageNote(speaker) {
|
|
41
|
+
return (`[${staffLabel(speaker)}, a person on the staff, wrote this to the customer while they held the conversation. ` +
|
|
42
|
+
'These are their words, not yours; what they told the customer stands.]');
|
|
43
|
+
}
|
|
44
|
+
/** The line the model reads where a person took the conversation over, or handed it back. */
|
|
45
|
+
export function takeoverNote(change, speaker) {
|
|
46
|
+
return change === 'taken_over'
|
|
47
|
+
? `[${staffLabel(speaker)}, a person on the staff, took this conversation over here. You did not answer while they held it.]`
|
|
48
|
+
: `[${staffLabel(speaker)} handed the conversation back to you here. Answer the customer's next message yourself.]`;
|
|
49
|
+
}
|
|
50
|
+
// ─── Reading what arrives from the wire ─────────────────────────────────────
|
|
51
|
+
const text = (value, max) => typeof value === 'string' && value.trim().length > 0 && value.length <= max ? value : null;
|
|
52
|
+
/** A staff speaker, when `value` is one; else null. Only the fields the contract names are kept. */
|
|
53
|
+
export function readStaffSpeaker(value) {
|
|
54
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
55
|
+
return null;
|
|
56
|
+
const v = value;
|
|
57
|
+
const userId = text(v.userId, 200);
|
|
58
|
+
const displayName = text(v.displayName, MAX_STAFF_LABEL_CHARS);
|
|
59
|
+
if (!userId || !displayName)
|
|
60
|
+
return null;
|
|
61
|
+
const role = text(v.role, MAX_STAFF_LABEL_CHARS);
|
|
62
|
+
return { userId, displayName, ...(role ? { role } : {}) };
|
|
63
|
+
}
|
|
64
|
+
/** A hold, when `value` is one; else null. */
|
|
65
|
+
export function readConversationHold(value) {
|
|
66
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
67
|
+
return null;
|
|
68
|
+
const v = value;
|
|
69
|
+
const conversationId = text(v.conversationId, 200);
|
|
70
|
+
const holder = readStaffSpeaker(v.holder);
|
|
71
|
+
if (!conversationId || !holder || typeof v.since !== 'number' || !Number.isFinite(v.since))
|
|
72
|
+
return null;
|
|
73
|
+
return { conversationId, holder, since: v.since };
|
|
74
|
+
}
|
|
75
|
+
/** A conversation's message, when `value` is one; else null. A `staff` message must name its speaker. */
|
|
76
|
+
export function readConversationMessage(value) {
|
|
77
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
78
|
+
return null;
|
|
79
|
+
const v = value;
|
|
80
|
+
const id = text(v.id, 200);
|
|
81
|
+
const createdAt = text(v.createdAt, 64);
|
|
82
|
+
if (!id || !createdAt || typeof v.content !== 'string')
|
|
83
|
+
return null;
|
|
84
|
+
if (v.role !== 'user' && v.role !== 'assistant' && v.role !== 'staff')
|
|
85
|
+
return null;
|
|
86
|
+
const speaker = v.speaker === undefined ? null : readStaffSpeaker(v.speaker);
|
|
87
|
+
if (v.role === 'staff' && !speaker)
|
|
88
|
+
return null;
|
|
89
|
+
return { id, role: v.role, content: v.content, createdAt, ...(speaker ? { speaker } : {}) };
|
|
90
|
+
}
|
|
91
|
+
/** Whether `value` names a change of hands the platform knows. */
|
|
92
|
+
export function isTakeoverChange(value) {
|
|
93
|
+
return value === 'taken_over' || value === 'handed_back';
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/takeover/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAyBlE,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D,kGAAkG;AAClG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,oFAAoF;AACpF,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AA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Aa,CAAC;AAC3D,CAAC"}
|
package/dist/turns/types.d.ts
CHANGED
|
@@ -16,13 +16,21 @@ export declare const TURN_STOP_EVENT = "agent:turn_stop";
|
|
|
16
16
|
export type TurnStopReason = 'user_stop' | 'superseded';
|
|
17
17
|
export declare const TURN_STOP_REASONS: readonly TurnStopReason[];
|
|
18
18
|
export declare function isTurnStopReason(value: unknown): value is TurnStopReason;
|
|
19
|
+
/**
|
|
20
|
+
* Why a turn's stop record says it must stop: a stop that was asked for
|
|
21
|
+
* (`TurnStopReason`), or a person on the staff holding its conversation
|
|
22
|
+
* (`taken_over`). Nobody asks for `taken_over`: the realtime server answers it
|
|
23
|
+
* from the conversation's hold.
|
|
24
|
+
*/
|
|
25
|
+
export type TurnStopRecordReason = TurnStopReason | 'taken_over';
|
|
19
26
|
/**
|
|
20
27
|
* Why a turn ended on the stop path, keeping what it had produced: a stop that
|
|
21
|
-
* was asked for (`TurnStopReason`),
|
|
22
|
-
*
|
|
23
|
-
*
|
|
28
|
+
* was asked for (`TurnStopReason`), its conversation taken over by a person
|
|
29
|
+
* (`taken_over`), or its own deadline (`deadline`: it ran out of time).
|
|
30
|
+
* Nobody asks for `deadline` either: it is only a stopped
|
|
31
|
+
* turn's reason.
|
|
24
32
|
*/
|
|
25
|
-
export type TurnStoppedReason =
|
|
33
|
+
export type TurnStoppedReason = TurnStopRecordReason | 'deadline';
|
|
26
34
|
export declare const TURN_STOPPED_REASONS: readonly TurnStoppedReason[];
|
|
27
35
|
export declare function isTurnStoppedReason(value: unknown): value is TurnStoppedReason;
|
|
28
36
|
/**
|
|
@@ -50,9 +58,9 @@ export type TurnStopResult = {
|
|
|
50
58
|
/** The stop the realtime server keeps for a turn, written once. */
|
|
51
59
|
export interface TurnStopRecord {
|
|
52
60
|
turnId: string;
|
|
53
|
-
/** The user who asked, or on whose behalf the host asked. */
|
|
61
|
+
/** The user who asked, or on whose behalf the host asked; for `taken_over`, the person who holds the conversation. */
|
|
54
62
|
by: string;
|
|
55
|
-
reason:
|
|
63
|
+
reason: TurnStopRecordReason;
|
|
56
64
|
/** Epoch ms, by the store's clock. */
|
|
57
65
|
at: number;
|
|
58
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/turns/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAgC,CAAC;AAExF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;;;;GAKG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/turns/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAgC,CAAC;AAExF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,YAAY,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,UAAU,CAAC;AAElE,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAAqD,CAAC;AAEnH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAC3C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GAAG,aAAa,CAAA;CAAE,CAAC;AAE1E,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,sHAAsH;IACtH,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,oBAAoB,CAAC;IAC7B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,GAAG,MAAM,CAWjF"}
|
package/dist/turns/types.js
CHANGED
|
@@ -12,7 +12,7 @@ export const TURN_STOP_REASONS = ['user_stop', 'superseded'];
|
|
|
12
12
|
export function isTurnStopReason(value) {
|
|
13
13
|
return typeof value === 'string' && TURN_STOP_REASONS.includes(value);
|
|
14
14
|
}
|
|
15
|
-
export const TURN_STOPPED_REASONS = [...TURN_STOP_REASONS, 'deadline'];
|
|
15
|
+
export const TURN_STOPPED_REASONS = [...TURN_STOP_REASONS, 'taken_over', 'deadline'];
|
|
16
16
|
export function isTurnStoppedReason(value) {
|
|
17
17
|
return typeof value === 'string' && TURN_STOPPED_REASONS.includes(value);
|
|
18
18
|
}
|
|
@@ -33,6 +33,8 @@ export function turnStoppedNote(marker) {
|
|
|
33
33
|
return '[This turn was stopped here because the person sent a new message. Calls marked "not run" did not run.]';
|
|
34
34
|
case 'deadline':
|
|
35
35
|
return '[This turn ran out of time and was stopped here. Calls marked "not run" did not run.]';
|
|
36
|
+
case 'taken_over':
|
|
37
|
+
return '[A person on the staff took this conversation over here, and this turn was stopped. Calls marked "not run" did not run.]';
|
|
36
38
|
default:
|
|
37
39
|
return '[The person stopped this turn here. Calls marked "not run" did not run.]';
|
|
38
40
|
}
|
package/dist/turns/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/turns/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AASjD,MAAM,CAAC,MAAM,iBAAiB,GAA8B,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAExF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,iBAAuC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/F,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/turns/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AASjD,MAAM,CAAC,MAAM,iBAAiB,GAA8B,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAExF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,iBAAuC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/F,CAAC;AAmBD,MAAM,CAAC,MAAM,oBAAoB,GAAiC,CAAC,GAAG,iBAAiB,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAEnH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,oBAA0C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClG,CAAC;AAgCD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,MAAM,CAAC;AAYnD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAyC;IACvE,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,YAAY;YACf,OAAO,yGAAyG,CAAC;QACnH,KAAK,UAAU;YACb,OAAO,uFAAuF,CAAC;QACjG,KAAK,YAAY;YACf,OAAO,0HAA0H,CAAC;QACpI;YACE,OAAO,0EAA0E,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -16,6 +16,7 @@ import type { ApprovalContinuation, ApprovalGrant } from '../approvals/types.js'
|
|
|
16
16
|
import type { TurnStoppedMarker } from '../turns/types.js';
|
|
17
17
|
import type { AttachmentLimits, AttachmentRef } from '../attachments/types.js';
|
|
18
18
|
import type { MessageInput } from '../message-input/index.js';
|
|
19
|
+
import type { ConversationHold, StaffSpeaker, TakeoverChange } from '../takeover/index.js';
|
|
19
20
|
/**
|
|
20
21
|
* Context sent alongside each message. The SDK collects visible annotations
|
|
21
22
|
* and current route automatically; platforms can add custom metadata.
|
|
@@ -141,10 +142,14 @@ export interface AgentConversationChanges {
|
|
|
141
142
|
* A message as the platform stored it. An assistant message that called tools
|
|
142
143
|
* carries them in `toolCalls`; each call's result follows as a `tool` message,
|
|
143
144
|
* in the same order (or matched by `toolCallId` when the platform keeps it).
|
|
145
|
+
*
|
|
146
|
+
* A person on the staff who took the conversation over writes
|
|
147
|
+
* `staff` messages, each with its `speaker`; the take-over and the hand-back
|
|
148
|
+
* are `staff` entries too, with `takeover` and no content.
|
|
144
149
|
*/
|
|
145
150
|
export interface AgentStoredMessage {
|
|
146
151
|
id: string;
|
|
147
|
-
role: 'user' | 'assistant' | 'tool' | (string & {});
|
|
152
|
+
role: 'user' | 'assistant' | 'tool' | 'staff' | (string & {});
|
|
148
153
|
content: string | null;
|
|
149
154
|
toolCalls?: Array<{
|
|
150
155
|
id: string;
|
|
@@ -165,12 +170,54 @@ export interface AgentStoredMessage {
|
|
|
165
170
|
* it: set on a message they spoke. Absent or null when typed.
|
|
166
171
|
*/
|
|
167
172
|
input?: MessageInput | null;
|
|
173
|
+
/** On a `staff` message or entry: the person on the staff. */
|
|
174
|
+
speaker?: StaffSpeaker | null;
|
|
175
|
+
/** On a `staff` entry with no content: the conversation was taken over here, or handed back. */
|
|
176
|
+
takeover?: TakeoverChange | null;
|
|
168
177
|
}
|
|
169
178
|
/** One stored conversation, with its most recent messages in chronological order. */
|
|
170
179
|
export interface AgentStoredConversation {
|
|
171
180
|
conversationId: string;
|
|
172
181
|
title: string | null;
|
|
173
182
|
messages: AgentStoredMessage[];
|
|
183
|
+
/**
|
|
184
|
+
* Who holds the conversation now, as the realtime server
|
|
185
|
+
* says (`GET /internal/conversations/{id}/hold`); null or absent when the
|
|
186
|
+
* agent answers it.
|
|
187
|
+
*/
|
|
188
|
+
hold?: ConversationHold | null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A conversation as a person on the staff sees it: every
|
|
192
|
+
* stored message (the customer's, the agent's and the staff's), who holds it
|
|
193
|
+
* now, and who the viewer would be as its holder.
|
|
194
|
+
*/
|
|
195
|
+
export interface StaffConversation extends AgentStoredConversation {
|
|
196
|
+
hold: ConversationHold | null;
|
|
197
|
+
/** The staff member viewing it, as they would hold it. */
|
|
198
|
+
self: StaffSpeaker;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The staff console's routes, on the product's API: each
|
|
202
|
+
* checks the staff member's permission itself, then calls the realtime
|
|
203
|
+
* server's conversation routes. The SDK never decides staff permissions.
|
|
204
|
+
*/
|
|
205
|
+
export interface StaffConsoleSeam {
|
|
206
|
+
/** The conversation as staff see it. Rejects when this staff member may not see it. */
|
|
207
|
+
getConversation(conversationId: string): Promise<StaffConversation>;
|
|
208
|
+
/**
|
|
209
|
+
* Take it over: the product checks the permission, withdraws a waiting
|
|
210
|
+
* approval, stores the take-over entry and holds the conversation. Resolves
|
|
211
|
+
* with the hold; rejects (with why) when someone else holds it or it is refused.
|
|
212
|
+
*/
|
|
213
|
+
takeOver(conversationId: string): Promise<ConversationHold>;
|
|
214
|
+
/** Hand it back: the product stores the hand-back entry and releases the hold. */
|
|
215
|
+
handBack(conversationId: string): Promise<void>;
|
|
216
|
+
/** Write to the customer as staff: the product stores the message, then announces it. Resolves with it as stored. */
|
|
217
|
+
sendMessage(params: {
|
|
218
|
+
conversationId: string;
|
|
219
|
+
content: string;
|
|
220
|
+
}): Promise<AgentStoredMessage>;
|
|
174
221
|
}
|
|
175
222
|
/**
|
|
176
223
|
* The complete client configuration. A platform provides this and nothing else.
|
|
@@ -248,11 +295,15 @@ export interface AgentClientConfig {
|
|
|
248
295
|
/**
|
|
249
296
|
* Hands the user's approval to this tab's OUI runtime (`runtime.grantApproval`
|
|
250
297
|
* in oui-spec), so the approved UI action runs when the worker dispatches it.
|
|
251
|
-
*
|
|
298
|
+
* Called after the user's click on the approval card is accepted, and when
|
|
299
|
+
* this tab claimed the grant the realtime server pushed because the person
|
|
300
|
+
* approved by voice, on the phone or in chat. Return the
|
|
301
|
+
* runtime's answer: `false` when it refused the grant (one it held or used:
|
|
302
|
+
* a replay), so the card does not say it was approved. Required for
|
|
252
303
|
* approvals of UI actions: without it the tab refuses them. A platform whose
|
|
253
304
|
* assistant has no UI actions may leave it out.
|
|
254
305
|
*/
|
|
255
|
-
grantApproval?: (grant: ApprovalGrant) => void;
|
|
306
|
+
grantApproval?: (grant: ApprovalGrant) => boolean | void;
|
|
256
307
|
/**
|
|
257
308
|
* Platform callback listing the user's conversations, most recent first.
|
|
258
309
|
* With `getConversation`, it lets the user return to an earlier conversation.
|
|
@@ -291,6 +342,23 @@ export interface AgentClientConfig {
|
|
|
291
342
|
* Default: "agent-sdk.activeConversation".
|
|
292
343
|
*/
|
|
293
344
|
activeConversationKey?: string | false;
|
|
345
|
+
/**
|
|
346
|
+
* The conversation's room, and the token to join it: the
|
|
347
|
+
* product's API mints it for the customer whose conversation it is, or for a
|
|
348
|
+
* staff member it lets watch it. With it, the customer's tab follows a
|
|
349
|
+
* take-over, a person's messages and a hand-back as they happen, and the
|
|
350
|
+
* staff console follows the conversation live. Without it, neither does.
|
|
351
|
+
*/
|
|
352
|
+
conversationRoom?: (conversationId: string) => Promise<{
|
|
353
|
+
room: string;
|
|
354
|
+
roomToken?: string;
|
|
355
|
+
}>;
|
|
356
|
+
/**
|
|
357
|
+
* The staff console's routes, for `useStaffConversation`:
|
|
358
|
+
* take a conversation over, write as staff, hand it back. A customer-facing
|
|
359
|
+
* app leaves it out.
|
|
360
|
+
*/
|
|
361
|
+
staff?: StaffConsoleSeam;
|
|
294
362
|
/**
|
|
295
363
|
* Realtime connection config. The SDK creates and manages its own Socket.IO
|
|
296
364
|
* connection using this URL and auth token provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../src/types/client-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../src/types/client-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MA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C,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouispec/agent-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Schema types, entity graph, intent resolution, and protocol definitions for the agent SDK",
|
|
5
5
|
"homepage": "https://github.com/wesreid/oui/tree/main/packages/agent-core#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"ajv": "^8.17.0",
|
|
33
33
|
"yaml": "^2.7.0",
|
|
34
|
-
"@ouispec/agent-events": "^0.
|
|
35
|
-
"@ouispec/contract": "^0.
|
|
36
|
-
"oui-spec": "^0.
|
|
34
|
+
"@ouispec/agent-events": "^0.19.0",
|
|
35
|
+
"@ouispec/contract": "^0.6.0",
|
|
36
|
+
"oui-spec": "^0.12.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.0.0",
|