@mgamadeus/ddd-agents 0.5.16 → 0.6.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/README.md +170 -6
- package/boundary.json +13 -0
- package/dist/chat.js +148 -773
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{canvas-title-slot-context-DK4sfhkl.js → ConversationMarkdown-BsCjyhj4.js} +14 -43
- package/dist/chunks/ConversationMarkdown-BsCjyhj4.js.map +1 -0
- package/dist/chunks/{ConversationMessageInputComposerWidgets-B3Zf69rD.js → ConversationMessageInputComposerWidgets-CE8LpyXY.js} +10 -37
- package/dist/chunks/ConversationMessageInputComposerWidgets-CE8LpyXY.js.map +1 -0
- package/dist/chunks/VoiceBarsIcon-BIcURsBF.js +643 -0
- package/dist/chunks/VoiceBarsIcon-BIcURsBF.js.map +1 -0
- package/dist/chunks/{WebSearchResultsConversationWidget-887v8Wen.js → WebSearchResultsConversationWidget-DXhfSikV.js} +2 -2
- package/dist/chunks/{WebSearchResultsConversationWidget-887v8Wen.js.map → WebSearchResultsConversationWidget-DXhfSikV.js.map} +1 -1
- package/dist/chunks/browser-request-interception-BnzFbH0m.js +335 -0
- package/dist/chunks/browser-request-interception-BnzFbH0m.js.map +1 -0
- package/dist/chunks/{canvas-reducers-CwFA3rQ6.js → canvas-reducers-D-YxAR4B.js} +2 -2
- package/dist/chunks/{canvas-reducers-CwFA3rQ6.js.map → canvas-reducers-D-YxAR4B.js.map} +1 -1
- package/dist/chunks/canvas-title-slot-context-D6UXrkdJ.js +36 -0
- package/dist/chunks/canvas-title-slot-context-D6UXrkdJ.js.map +1 -0
- package/dist/chunks/{canvasBodies-C7qqThc9.js → canvasBodies-CQEBkIVw.js} +4 -4
- package/dist/chunks/{canvasBodies-C7qqThc9.js.map → canvasBodies-CQEBkIVw.js.map} +1 -1
- package/dist/chunks/{canvasStorage-i2wKVSBf.js → canvasStorage-BbEI3h-8.js} +2 -2
- package/dist/chunks/{canvasStorage-i2wKVSBf.js.map → canvasStorage-BbEI3h-8.js.map} +1 -1
- package/dist/chunks/format-agent-voice-call-duration-C-3hRc9p.js +10 -0
- package/dist/chunks/format-agent-voice-call-duration-C-3hRc9p.js.map +1 -0
- package/dist/chunks/{link-navigation-CNX8Am2L.js → link-navigation-BUcy5qWW.js} +2 -2
- package/dist/chunks/{link-navigation-CNX8Am2L.js.map → link-navigation-BUcy5qWW.js.map} +1 -1
- package/dist/chunks/{realtime-arrival-BTLE3jjt.js → realtime-arrival-BfsAPwqQ.js} +8 -3
- package/dist/chunks/realtime-arrival-BfsAPwqQ.js.map +1 -0
- package/dist/chunks/use-agents-chat-store-CuIkCz9v.js +34 -0
- package/dist/chunks/use-agents-chat-store-CuIkCz9v.js.map +1 -0
- package/dist/chunks/{widget-name-resolver-BVEuAsW5.js → widget-name-resolver-B9k-s_cF.js} +3 -3
- package/dist/chunks/{widget-name-resolver-BVEuAsW5.js.map → widget-name-resolver-B9k-s_cF.js.map} +1 -1
- package/dist/chunks/withPollingChangeSubscription-CnQnubfK.js.map +1 -1
- package/dist/client-testing.js +4 -4
- package/dist/client.js +14 -3
- package/dist/client.js.map +1 -1
- package/dist/files/i18n-keys.json +1128 -100
- package/dist/image-render.js +65 -38
- package/dist/image-render.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/kit.js +2 -2
- package/dist/preview.js +23 -26
- package/dist/preview.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/renderer.js +25 -24
- package/dist/renderer.js.map +1 -1
- package/dist/styles.css +531 -93
- package/dist/types/client/AgentsConversationClient.d.ts +4 -1
- package/dist/types/client/http/createAgentsHttpConversationClient.d.ts +2 -1
- package/dist/types/entries/voice-admin.d.ts +7 -0
- package/dist/types/entries/voice.d.ts +24 -0
- package/dist/types/image-render/frozen-widget-requests.d.ts +11 -2
- package/dist/types/image-render/widget-image-google-map.d.ts +5 -0
- package/dist/types/image-render/widget-image-static-assets.d.ts +2 -0
- package/dist/types/preview/widget-preview-requests.d.ts +6 -5
- package/dist/types/request-interception/browser-request-interception.d.ts +48 -0
- package/dist/types/request-interception/intercepted-xml-http-request-upload.d.ts +15 -0
- package/dist/types/ui/account-realtime.d.ts +50 -11
- package/dist/types/voice/AgentVoiceCallBand/AgentVoiceCallBand.d.ts +49 -0
- package/dist/types/voice/AgentVoiceCallBand/agent-voice-call-outcome-title-text-key.d.ts +8 -0
- package/dist/types/voice/AgentVoiceCallCaptions/AgentVoiceCallCaptions.d.ts +15 -0
- package/dist/types/voice/AgentVoiceCallCaptions/saved-messages-of-agent-voice-chat.d.ts +12 -0
- package/dist/types/voice/AgentVoiceCallProvider/AgentVoiceCallProvider.d.ts +21 -0
- package/dist/types/voice/AgentVoiceCallProvider/agent-voice-call-context.d.ts +17 -0
- package/dist/types/voice/AgentVoiceChatStartButton/AgentVoiceChatStartButton.d.ts +15 -0
- package/dist/types/voice/AgentVoiceIcons/AgentVoiceIcons.d.ts +10 -0
- package/dist/types/voice/AgentVoiceIncomingCall/AgentVoiceIncomingCall.d.ts +28 -0
- package/dist/types/voice/AgentVoiceInputGlow/AgentVoiceInputGlow.d.ts +11 -0
- package/dist/types/voice/AgentVoiceInputGlow/agent-voice-input-glow-voice.d.ts +8 -0
- package/dist/types/voice/admin/AgentVoiceCallConversationLink/AgentVoiceCallConversationLink.d.ts +10 -0
- package/dist/types/voice/admin/AgentVoiceCallDetailScreen/AgentVoiceCallDetailScreen.d.ts +27 -0
- package/dist/types/voice/admin/AgentVoiceCallStateBadges/AgentVoiceCallStateBadges.d.ts +12 -0
- package/dist/types/voice/admin/AgentVoiceCallsScreen/AgentVoiceCallsScreen.d.ts +33 -0
- package/dist/types/voice/admin/agent-voice-admin-api.d.ts +59 -0
- package/dist/types/voice/admin/agent-voice-admin-format.d.ts +38 -0
- package/dist/types/voice/admin/agent-voice-admin-types.d.ts +110 -0
- package/dist/types/voice/agent-voice-api.d.ts +114 -0
- package/dist/types/voice/call/agent-voice-call-elapsed-seconds.d.ts +6 -0
- package/dist/types/voice/call/agent-voice-call-end-reasons.d.ts +3 -0
- package/dist/types/voice/call/agent-voice-call-store.d.ts +111 -0
- package/dist/types/voice/call/agent-voice-call-turn.d.ts +4 -0
- package/dist/types/voice/call/build-unsaved-agent-voice-call-lines.d.ts +14 -0
- package/dist/types/voice/call/format-agent-voice-call-duration.d.ts +2 -0
- package/dist/types/voice/call/use-agent-voice-call-elapsed-seconds.d.ts +3 -0
- package/dist/types/voice/call/use-agent-voice-call-server-end.d.ts +15 -0
- package/dist/types/voice/call/use-agent-voice-call.d.ts +12 -0
- package/dist/types/voice/call/use-follow-agent-voice-call-conversation.d.ts +9 -0
- package/dist/types/voice/ring/agent-voice-caller-label.d.ts +21 -0
- package/dist/types/voice/ring/agent-voice-incoming-ring-list.d.ts +10 -0
- package/dist/types/voice/ring/agent-voice-incoming-ring-store.d.ts +47 -0
- package/dist/types/voice/ring/agent-voice-ring-source.d.ts +75 -0
- package/dist/types/voice/ring/agent-voice-ring.d.ts +35 -0
- package/dist/types/voice/ring/answer-incoming-agent-voice-call.d.ts +13 -0
- package/dist/types/voice/ring/use-agent-voice-incoming-rings.d.ts +14 -0
- package/dist/types/voice/ring/use-agent-voice-ring-tone.d.ts +6 -0
- package/dist/ui.js +82 -19
- package/dist/ui.js.map +1 -1
- package/dist/voice-admin.js +738 -0
- package/dist/voice-admin.js.map +1 -0
- package/dist/voice.js +1586 -0
- package/dist/voice.js.map +1 -0
- package/dist/widgets.js +4 -4
- package/package.json +23 -4
- package/public-api.json +156 -0
- package/dist/chunks/ConversationMessageInputComposerWidgets-B3Zf69rD.js.map +0 -1
- package/dist/chunks/canvas-title-slot-context-DK4sfhkl.js.map +0 -1
- package/dist/chunks/realtime-arrival-BTLE3jjt.js.map +0 -1
- package/dist/chunks/widget-image-readiness-signal-C58JkCQA.js +0 -25
- package/dist/chunks/widget-image-readiness-signal-C58JkCQA.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentVoiceRing } from "./agent-voice-ring";
|
|
2
|
+
import type { AgentVoiceRingSource } from "./agent-voice-ring-source";
|
|
3
|
+
export interface AgentVoiceIncomingRings {
|
|
4
|
+
/** The rings that arrived and are still inside their deadline, one per call. */
|
|
5
|
+
rings: readonly AgentVoiceRing[];
|
|
6
|
+
/** The clock the deadlines were last read against: ticks every second while a ring is held. */
|
|
7
|
+
nowMs: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Listens for the agent's rings to this client while a ring source is given: a ring that arrives replaces the one of
|
|
11
|
+
* the same call, a cleared one goes at once, and one whose deadline passed goes with the next tick of the clock. No
|
|
12
|
+
* ring source (the application has no ring transport) or no ring: an empty list, and no clock running.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useAgentVoiceIncomingRings: (ringSource: AgentVoiceRingSource | undefined) => AgentVoiceIncomingRings;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A phone-like ring tone while `isRinging`, synthesized with Web Audio (no asset). Browsers block audio until the user
|
|
3
|
+
* has interacted with the page (autoplay policy): without that interaction this plays nothing and the visual ring is
|
|
4
|
+
* the whole signal.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useAgentVoiceRingTone: (isRinging: boolean) => void;
|
package/dist/ui.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c as createAgentUIClientId } from "./chunks/realtime-arrival-BfsAPwqQ.js";
|
|
3
|
+
import { C, b, a, r, d, e } from "./chunks/realtime-arrival-BfsAPwqQ.js";
|
|
2
4
|
import { useRef } from "react";
|
|
3
|
-
import { C, b, a, r, c, d } from "./chunks/realtime-arrival-BTLE3jjt.js";
|
|
4
5
|
const MIN_SECONDS_LEFT_TO_START = 3;
|
|
5
6
|
const MAX_ANSWER_TEXT_CHARS = 24e3;
|
|
6
7
|
const CLIENT_TOOL_OUTCOMES = {
|
|
@@ -73,10 +74,6 @@ const buildTargetRoute = (target, recordIds, tab) => {
|
|
|
73
74
|
if (tab) segments.push(tab);
|
|
74
75
|
return `/${segments.join("/")}`;
|
|
75
76
|
};
|
|
76
|
-
const createAgentUIClientId = () => {
|
|
77
|
-
const randomPart = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
78
|
-
return `ui-${randomPart}`.slice(0, 64);
|
|
79
|
-
};
|
|
80
77
|
const PACKAGE_REQUEST_TYPES = ["READ_SCREEN", "LIST_TARGETS", "OPEN_TARGET", "HIGHLIGHT", "SET_WINDOW_MODE"];
|
|
81
78
|
const STEP_ASIDE_REQUEST_TYPES = ["OPEN_TARGET", "HIGHLIGHT", "READ_SCREEN"];
|
|
82
79
|
const PICTURE_SIZES = ["small", "medium", "large"];
|
|
@@ -1178,32 +1175,97 @@ const createAgentWindowAdapter = (options) => {
|
|
|
1178
1175
|
const ACCOUNT_REALTIME_POLL_INTERVAL_MS = 5e3;
|
|
1179
1176
|
const ACCOUNT_REALTIME_PING_REREAD_DELAY_MS = 400;
|
|
1180
1177
|
const identityOf = (message) => `${message.messageType}\0${message.messageKey}\0${message.payloadJson}`;
|
|
1178
|
+
const placeOf = (message) => `${message.messageType}\0${message.messageKey}`;
|
|
1181
1179
|
const createAccountRealtimePoll = (options) => {
|
|
1182
1180
|
const intervalMs = options.intervalMs ?? ACCOUNT_REALTIME_POLL_INTERVAL_MS;
|
|
1183
1181
|
const rereadDelayMs = options.rereadDelayMs ?? ACCOUNT_REALTIME_PING_REREAD_DELAY_MS;
|
|
1184
|
-
let
|
|
1182
|
+
let knownMessages = /* @__PURE__ */ new Map();
|
|
1183
|
+
const subscriptions = /* @__PURE__ */ new Set([{ subscriber: options }]);
|
|
1184
|
+
let startedReadCount = 0;
|
|
1185
|
+
let newestAnsweredRead = 0;
|
|
1185
1186
|
let stopped = false;
|
|
1186
1187
|
let timer = null;
|
|
1188
|
+
const knownMessageOf = (message, nowMs) => ({
|
|
1189
|
+
message,
|
|
1190
|
+
startedReadCount,
|
|
1191
|
+
expiresAtMs: nowMs + message.secondsLeft * 1e3,
|
|
1192
|
+
handedTo: /* @__PURE__ */ new Set()
|
|
1193
|
+
});
|
|
1194
|
+
const handMessage = (knownMessage, subscription) => {
|
|
1195
|
+
knownMessage.handedTo.add(subscription);
|
|
1196
|
+
subscription.subscriber.onMessage?.(knownMessage.message);
|
|
1197
|
+
};
|
|
1198
|
+
const handToSubscribers = (arrivedMessages, goneMessagesOfClearedPlaces) => {
|
|
1199
|
+
const subscriptionsNow = [...subscriptions];
|
|
1200
|
+
for (const arrivedMessage of arrivedMessages) {
|
|
1201
|
+
for (const subscription of subscriptionsNow) {
|
|
1202
|
+
if (subscriptions.has(subscription)) handMessage(arrivedMessage, subscription);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
for (const goneMessages of goneMessagesOfClearedPlaces) {
|
|
1206
|
+
for (const subscription of subscriptionsNow) {
|
|
1207
|
+
if (!subscriptions.has(subscription)) continue;
|
|
1208
|
+
const handedMessage = goneMessages.filter((goneMessage) => goneMessage.handedTo.has(subscription)).pop();
|
|
1209
|
+
if (handedMessage !== void 0) subscription.subscriber.onMessageCleared?.(handedMessage.message);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1187
1213
|
const acceptArrivedMessage = (message) => {
|
|
1188
1214
|
const identity = identityOf(message);
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1191
|
-
|
|
1215
|
+
if (knownMessages.has(identity)) return false;
|
|
1216
|
+
const knownMessage = knownMessageOf(message, Date.now());
|
|
1217
|
+
knownMessages.set(identity, knownMessage);
|
|
1218
|
+
handToSubscribers([knownMessage], []);
|
|
1192
1219
|
return true;
|
|
1193
1220
|
};
|
|
1194
1221
|
const readNow = async () => {
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1222
|
+
startedReadCount += 1;
|
|
1223
|
+
const readNumber = startedReadCount;
|
|
1224
|
+
const read = await options.readAccountRealtime(options.clientId);
|
|
1225
|
+
if (readNumber < newestAnsweredRead) return 0;
|
|
1226
|
+
newestAnsweredRead = readNumber;
|
|
1227
|
+
const nowMs = Date.now();
|
|
1228
|
+
const knownAfterRead = /* @__PURE__ */ new Map();
|
|
1229
|
+
const openPlaces = /* @__PURE__ */ new Set();
|
|
1230
|
+
const arrivedMessages = [];
|
|
1198
1231
|
for (const message of read.messages) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1232
|
+
const identity = identityOf(message);
|
|
1233
|
+
const knownMessage = knownMessages.get(identity) ?? knownMessageOf(message, nowMs);
|
|
1234
|
+
if (!knownMessages.has(identity)) arrivedMessages.push(knownMessage);
|
|
1235
|
+
knownAfterRead.set(identity, knownMessage);
|
|
1236
|
+
openPlaces.add(placeOf(message));
|
|
1237
|
+
}
|
|
1238
|
+
const goneMessages = [];
|
|
1239
|
+
for (const [identity, knownMessage] of knownMessages) {
|
|
1240
|
+
if (knownAfterRead.has(identity)) continue;
|
|
1241
|
+
if (knownMessage.startedReadCount >= readNumber) {
|
|
1242
|
+
knownAfterRead.set(identity, knownMessage);
|
|
1243
|
+
openPlaces.add(placeOf(knownMessage.message));
|
|
1244
|
+
} else {
|
|
1245
|
+
goneMessages.push(knownMessage);
|
|
1202
1246
|
}
|
|
1203
1247
|
}
|
|
1204
|
-
|
|
1248
|
+
const goneMessagesByClearedPlace = /* @__PURE__ */ new Map();
|
|
1249
|
+
for (const goneMessage of goneMessages) {
|
|
1250
|
+
const place = placeOf(goneMessage.message);
|
|
1251
|
+
if (openPlaces.has(place)) continue;
|
|
1252
|
+
goneMessagesByClearedPlace.set(place, [...goneMessagesByClearedPlace.get(place) ?? [], goneMessage]);
|
|
1253
|
+
}
|
|
1254
|
+
knownMessages = knownAfterRead;
|
|
1255
|
+
handToSubscribers(arrivedMessages, [...goneMessagesByClearedPlace.values()]);
|
|
1205
1256
|
options.onListenerCredential?.(read.listenerCredential);
|
|
1206
|
-
return
|
|
1257
|
+
return arrivedMessages.length;
|
|
1258
|
+
};
|
|
1259
|
+
const subscribe = (subscriber) => {
|
|
1260
|
+
const subscription = { subscriber };
|
|
1261
|
+
subscriptions.add(subscription);
|
|
1262
|
+
const nowMs = Date.now();
|
|
1263
|
+
for (const knownMessage of [...knownMessages.values()]) {
|
|
1264
|
+
if (knownMessage.expiresAtMs > nowMs) handMessage(knownMessage, subscription);
|
|
1265
|
+
}
|
|
1266
|
+
return () => {
|
|
1267
|
+
subscriptions.delete(subscription);
|
|
1268
|
+
};
|
|
1207
1269
|
};
|
|
1208
1270
|
const schedule = () => {
|
|
1209
1271
|
if (stopped) return;
|
|
@@ -1233,6 +1295,7 @@ const createAccountRealtimePoll = (options) => {
|
|
|
1233
1295
|
readNow,
|
|
1234
1296
|
acceptArrivedMessage,
|
|
1235
1297
|
readAfterPing,
|
|
1298
|
+
subscribe,
|
|
1236
1299
|
stop: () => {
|
|
1237
1300
|
stopped = true;
|
|
1238
1301
|
if (timer !== null) clearTimeout(timer);
|
|
@@ -1307,10 +1370,10 @@ export {
|
|
|
1307
1370
|
planHighlightScroll,
|
|
1308
1371
|
prepareScreenCloneForPicture,
|
|
1309
1372
|
r as readClientToolRequestOfRealtimeMessage,
|
|
1310
|
-
|
|
1373
|
+
d as readRunStateAfterClientToolRequestPing,
|
|
1311
1374
|
readScreenTargetOfMark,
|
|
1312
1375
|
rowKeyOf,
|
|
1313
|
-
|
|
1376
|
+
e as runClientToolRequestForDevelopment,
|
|
1314
1377
|
slugOf,
|
|
1315
1378
|
useAgentUIClient
|
|
1316
1379
|
};
|