@flamingo-stack/openframe-frontend-core 0.0.850 → 0.0.851
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/chat-protocol/events.d.ts +4 -1
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +90 -40
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/chat-protocol/nats-decoder.js +5 -1
- package/dist/chat-protocol/policy-review.d.ts +18 -0
- package/dist/chat-protocol/policy-review.d.ts.map +1 -0
- package/dist/chat-protocol/policy-review.js +55 -0
- package/dist/{chunk-ZDSC3GFX.cjs → chunk-2NGW73T2.cjs} +3 -3
- package/dist/{chunk-2QZUTNL3.cjs → chunk-2WZHNMQY.cjs} +67 -67
- package/dist/{chunk-R5JPZ6TY.cjs → chunk-5SEJEBAB.cjs} +8 -8
- package/dist/{chunk-TX4NTH22.cjs → chunk-B6D4WWKD.cjs} +36 -36
- package/dist/{chunk-FXLROQUT.cjs → chunk-CDW6JTAQ.cjs} +442 -459
- package/dist/{chunk-5PIR77V5.cjs → chunk-DN227KZH.cjs} +4 -4
- package/dist/{chunk-QJER2ZNA.cjs → chunk-FGSN5UNY.cjs} +3 -3
- package/dist/{chunk-ZGEWT3SF.cjs → chunk-HXURNKXI.cjs} +3 -3
- package/dist/{chunk-FRG724DU.cjs → chunk-KRTTH3ET.cjs} +4 -4
- package/dist/{chunk-YJZ7R3W5.cjs → chunk-KXFIYO4O.cjs} +8 -8
- package/dist/{chunk-4YBS4HIO.cjs → chunk-LM7EL3UQ.cjs} +444 -27
- package/dist/{chunk-LGYPCUHO.cjs → chunk-NQEPLUUW.cjs} +21 -21
- package/dist/{chunk-OHHDX3Z4.cjs → chunk-ODMZSAIY.cjs} +36 -36
- package/dist/{chunk-VRWBJL7B.cjs → chunk-OUP7L3U5.cjs} +50 -50
- package/dist/{chunk-5CBI2ZYV.cjs → chunk-PJNEBSP5.cjs} +5 -5
- package/dist/{chunk-6AJYGXXS.cjs → chunk-PPCRLSVR.cjs} +11 -11
- package/dist/{chunk-SA2NNWIJ.cjs → chunk-QCSA7GIX.cjs} +17 -62
- package/dist/{chunk-JWIITCVB.cjs → chunk-SPKAXETT.cjs} +42 -42
- package/dist/{chunk-CAGNWDVJ.cjs → chunk-U4RTWH5D.cjs} +42 -42
- package/dist/{chunk-IHY7E4EX.cjs → chunk-UFGPLXH6.cjs} +4 -4
- package/dist/{chunk-7ICHJVAT.cjs → chunk-UQK6J3ZS.cjs} +13 -13
- package/dist/{chunk-S3QXLD4X.cjs → chunk-VCFQHPOO.cjs} +37 -3
- package/dist/{chunk-IPGGSFR7.cjs → chunk-VU6N3NZS.cjs} +6 -6
- package/dist/{chunk-GAYLAA3L.cjs → chunk-VXIZCUNZ.cjs} +61 -61
- package/dist/{chunk-3W4ASAXN.cjs → chunk-WYROOMUZ.cjs} +2 -2
- package/dist/{chunk-XKOL5CNU.cjs → chunk-ZEPEFKHA.cjs} +811 -932
- package/dist/{cloud-tenants-TVB3DT3J.cjs → cloud-tenants-XH6GV4EI.cjs} +12 -13
- package/dist/components/case-studies/index.cjs +24 -25
- package/dist/components/chat/approval-batch-message.d.ts +5 -0
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +36 -10
- package/dist/components/chat/index.cjs +8 -9
- package/dist/components/chat/policy-review.d.ts +27 -0
- package/dist/components/chat/policy-review.d.ts.map +1 -0
- package/dist/components/chat/policy-review.js +67 -0
- package/dist/components/chat/stream/message-mutations.d.ts.map +1 -1
- package/dist/components/chat/stream/message-mutations.js +4 -1
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +16 -5
- package/dist/components/chat/types/message.types.d.ts +40 -2
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.js +2 -0
- package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.js +3 -0
- package/dist/components/chat/utils/process-historical-messages.d.ts +2 -2
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.js +7 -1
- package/dist/components/contact/index.cjs +13 -14
- package/dist/components/docs/index.cjs +16 -17
- package/dist/components/embeds/index.cjs +13 -14
- package/dist/components/faq/index.cjs +14 -15
- package/dist/components/features/approval-level.d.ts +6 -12
- package/dist/components/features/approval-level.d.ts.map +1 -1
- package/dist/components/features/approval-level.js +45 -55
- package/dist/components/features/index.cjs +16 -16
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +71 -48
- package/dist/components/features/notifications/types.d.ts +2 -0
- package/dist/components/features/notifications/types.d.ts.map +1 -1
- package/dist/components/features/notifications/types.js +3 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/features/policy-configuration-panel.js +75 -64
- package/dist/components/help-center-pages/index.cjs +78 -79
- package/dist/components/index.cjs +57 -59
- package/dist/components/meeting-scheduler/index.cjs +61 -61
- package/dist/components/navigation/index.cjs +15 -16
- package/dist/components/onboarding-guides/index.cjs +14 -15
- package/dist/components/product-demo/index.cjs +23 -24
- package/dist/components/tickets/index.cjs +17 -18
- package/dist/components/ui/file-manager/index.cjs +8 -9
- package/dist/components/ui/index.cjs +16 -18
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +8 -2
- package/dist/components/ui/tab-selector.d.ts +7 -1
- package/dist/components/ui/tab-selector.d.ts.map +1 -1
- package/dist/components/ui/tab-selector.js +22 -3
- package/dist/{devices-NGCTSXIU.cjs → devices-7PT6MPJI.cjs} +13 -14
- package/dist/{embeddable-chat-322NDFP5.cjs → embeddable-chat-5NY76K7K.cjs} +84 -85
- package/dist/index.cjs +23 -25
- package/dist/{knowledge-75PO5DYS.cjs → knowledge-J6N7IEVI.cjs} +13 -14
- package/dist/{logs-PZESOAIG.cjs → logs-D6KQP2BX.cjs} +19 -20
- package/dist/{policies-6XNMBFWO.cjs → policies-J7MCOL3C.cjs} +16 -17
- package/dist/{remote-session-Q2FIBCGT.cjs → remote-session-PXHA5KFK.cjs} +8 -9
- package/dist/{scripts-B3JW6TPF.cjs → scripts-VURXIHVS.cjs} +19 -20
- package/dist/{software-update-NWP542J7.cjs → software-update-6SHUBDIE.cjs} +16 -17
- package/dist/{tickets-board-7FLGQEHF.cjs → tickets-board-NLCN7WNX.cjs} +9 -9
- package/package.json +1 -1
- package/src/chat-protocol/events.ts +4 -1
- package/src/chat-protocol/nats-decoder.ts +4 -0
- package/src/chat-protocol/policy-review.ts +71 -0
- package/src/components/chat/approval-batch-message.tsx +47 -10
- package/src/components/chat/policy-review.tsx +90 -0
- package/src/components/chat/stream/message-mutations.ts +4 -0
- package/src/components/chat/tool-execution-display.tsx +23 -4
- package/src/components/chat/types/message.types.ts +42 -2
- package/src/components/chat/utils/extract-incomplete-message-state.ts +2 -0
- package/src/components/chat/utils/message-segment-accumulator.ts +3 -0
- package/src/components/chat/utils/process-historical-messages.ts +14 -3
- package/src/components/features/approval-level.tsx +74 -78
- package/src/components/features/notifications/approval-request-notification-tile.tsx +75 -50
- package/src/components/features/notifications/types.ts +4 -0
- package/src/components/features/policy-configuration-panel.tsx +100 -83
- package/src/components/ui/radio-group.tsx +20 -2
- package/src/components/ui/tab-selector.tsx +26 -3
- package/dist/chunk-N3MBQRCQ.cjs +0 -41
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Server-safe: no React, no browser APIs.
|
|
9
9
|
*/
|
|
10
10
|
import type { ChatRef } from '../components/chat/chat-ref.types';
|
|
11
|
-
import type { AskOptionData, ChatSource } from '../components/chat/types/message.types';
|
|
11
|
+
import type { AskOptionData, ChatSource, PolicyReviewData } from '../components/chat/types/message.types';
|
|
12
12
|
import type { ApprovalRequestField, DecisionResolvedFrame, UsageTelemetry } from './frames';
|
|
13
13
|
/** Optional envelope on every event. `seq` carries the transport's
|
|
14
14
|
* stream sequence (JetStream `streamSeq` on NATS; unused on SSE). */
|
|
@@ -76,6 +76,8 @@ export interface ToolExecutionEvent extends ChatStreamEventBase {
|
|
|
76
76
|
* replay, which is exactly what happened while it was missing here.
|
|
77
77
|
*/
|
|
78
78
|
toolExplanation?: string;
|
|
79
|
+
/** The security policy's review of the call. EXECUTING chunk only, carried onto EXECUTED like the explanation. */
|
|
80
|
+
policyReview?: PolicyReviewData;
|
|
79
81
|
parameters?: Record<string, unknown>;
|
|
80
82
|
result?: string;
|
|
81
83
|
success?: boolean;
|
|
@@ -92,6 +94,7 @@ export interface ApprovalToolCall {
|
|
|
92
94
|
requiresApproval: boolean;
|
|
93
95
|
approvalType?: string | null;
|
|
94
96
|
toolCallArguments?: Record<string, unknown> | null;
|
|
97
|
+
policyReview?: PolicyReviewData;
|
|
95
98
|
}
|
|
96
99
|
/** A tool call awaits user approval. SSE fills `command`/`fields`
|
|
97
100
|
* (card-ready payload); NATS fills `command`/`explanation` or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG1G,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB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CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,4BAA4B,GAC5B,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,UAAU,GACV,gBAAgB,GAChB,iBAAiB,CAAC"}
|
|
@@ -69,8 +69,8 @@ function chatProgressFrame(progress, state, turnId) {
|
|
|
69
69
|
// src/chat-protocol/encode.ts
|
|
70
70
|
var encoder = new TextEncoder();
|
|
71
71
|
var SENTINEL_BYTES_RE = /[\u0000\u001E\u001F]/g;
|
|
72
|
-
function stripSentinelBytes(
|
|
73
|
-
return
|
|
72
|
+
function stripSentinelBytes(text3) {
|
|
73
|
+
return text3.replace(SENTINEL_BYTES_RE, "");
|
|
74
74
|
}
|
|
75
75
|
function encodeLeadingFrame(frame) {
|
|
76
76
|
return encoder.encode(JSON.stringify(frame) + FRAME_TERMINATOR);
|
|
@@ -78,8 +78,8 @@ function encodeLeadingFrame(frame) {
|
|
|
78
78
|
function encodeEndOfLeading() {
|
|
79
79
|
return encoder.encode(END_OF_LEADING);
|
|
80
80
|
}
|
|
81
|
-
function encodeTextDelta(
|
|
82
|
-
return encoder.encode(stripSentinelBytes(
|
|
81
|
+
function encodeTextDelta(text3) {
|
|
82
|
+
return encoder.encode(stripSentinelBytes(text3));
|
|
83
83
|
}
|
|
84
84
|
function encodeTrailingUsageFrame(frame) {
|
|
85
85
|
return encoder.encode(TRAILER_SENTINEL + JSON.stringify(frame));
|
|
@@ -117,6 +117,61 @@ var MESSAGE_TYPE = {
|
|
|
117
117
|
DIALOG_CLOSED: "DIALOG_CLOSED"
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
// src/chat-protocol/wire-narrow.ts
|
|
121
|
+
function isRecord(value) {
|
|
122
|
+
return typeof value === "object" && value !== null;
|
|
123
|
+
}
|
|
124
|
+
function unwrapEnvelope(payload) {
|
|
125
|
+
return isRecord(payload) && "data" in payload ? payload.data : payload;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/chat-protocol/policy-review.ts
|
|
129
|
+
var APPROVAL_LEVELS = /* @__PURE__ */ new Set(["ALLOW", "ASK_USER", "ASK_TECHNICIAN", "DENY"]);
|
|
130
|
+
function text(value) {
|
|
131
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
132
|
+
}
|
|
133
|
+
function level(value) {
|
|
134
|
+
return typeof value === "string" && APPROVAL_LEVELS.has(value) ? value : void 0;
|
|
135
|
+
}
|
|
136
|
+
function rules(raw) {
|
|
137
|
+
if (!Array.isArray(raw)) return [];
|
|
138
|
+
return raw.filter(isRecord).flatMap((rule) => {
|
|
139
|
+
const code = text(rule.code);
|
|
140
|
+
const label = text(rule.label) ?? code;
|
|
141
|
+
return label ? [{ code: code ?? label, label }] : [];
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function codes(raw) {
|
|
145
|
+
if (!Array.isArray(raw)) return [];
|
|
146
|
+
return raw.map(text).filter((code) => !!code);
|
|
147
|
+
}
|
|
148
|
+
function policyReviewField(raw) {
|
|
149
|
+
const policyReview = normalizePolicyReview(raw);
|
|
150
|
+
return policyReview ? { policyReview } : {};
|
|
151
|
+
}
|
|
152
|
+
function normalizePolicyReview(raw) {
|
|
153
|
+
if (!isRecord(raw)) return void 0;
|
|
154
|
+
const source = text(raw.source);
|
|
155
|
+
const decision = text(raw.decision);
|
|
156
|
+
const approvalLevel = level(raw.approvalLevel);
|
|
157
|
+
const policyLevel = level(raw.policyLevel);
|
|
158
|
+
const reason = text(raw.reason);
|
|
159
|
+
const operationCodes = codes(raw.operationCodes);
|
|
160
|
+
const matchedRules = rules(raw.matchedRules);
|
|
161
|
+
if (!decision && !approvalLevel && !policyLevel && !reason && !operationCodes.length && !matchedRules.length) {
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
...source ? { source } : {},
|
|
166
|
+
...decision ? { decision } : {},
|
|
167
|
+
...approvalLevel ? { approvalLevel } : {},
|
|
168
|
+
...policyLevel ? { policyLevel } : {},
|
|
169
|
+
operationCodes,
|
|
170
|
+
matchedRules,
|
|
171
|
+
...reason ? { reason } : {}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
120
175
|
// src/utils/url-safety.ts
|
|
121
176
|
var UNSAFE_URL_CHARS = /[\u0000-\u001f\u007f\u200b-\u200d\u2028\u2029\ufeff]/;
|
|
122
177
|
|
|
@@ -127,10 +182,10 @@ var CARD_REFERENCE = new RegExp(`^\\[card://(${CARD_TYPE}):(${CARD_ID})\\]$`);
|
|
|
127
182
|
function createCardMarkerScanner() {
|
|
128
183
|
return new RegExp(`\\[card://(${CARD_TYPE}):(${CARD_ID})[\\])]`, "g");
|
|
129
184
|
}
|
|
130
|
-
function extractCardReferences(
|
|
185
|
+
function extractCardReferences(text3) {
|
|
131
186
|
const seen = /* @__PURE__ */ new Set();
|
|
132
187
|
const out = [];
|
|
133
|
-
for (const match of
|
|
188
|
+
for (const match of text3.matchAll(createCardMarkerScanner())) {
|
|
134
189
|
const key = `${match[1]}:${match[2]}`;
|
|
135
190
|
if (seen.has(key)) continue;
|
|
136
191
|
seen.add(key);
|
|
@@ -139,27 +194,19 @@ function extractCardReferences(text2) {
|
|
|
139
194
|
return out;
|
|
140
195
|
}
|
|
141
196
|
|
|
142
|
-
// src/chat-protocol/wire-narrow.ts
|
|
143
|
-
function isRecord(value) {
|
|
144
|
-
return typeof value === "object" && value !== null;
|
|
145
|
-
}
|
|
146
|
-
function unwrapEnvelope(payload) {
|
|
147
|
-
return isRecord(payload) && "data" in payload ? payload.data : payload;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
197
|
// src/chat-protocol/source-metadata.ts
|
|
151
198
|
var YOUTUBE_ID = /^[A-Za-z0-9_-]{11}$/;
|
|
152
199
|
var VIDEO_URL_KEYS = ["videoUrl", "highlightVideoUrl", "videoPoster", "highlightVideoPoster"];
|
|
153
|
-
function
|
|
200
|
+
function text2(value) {
|
|
154
201
|
if (typeof value !== "string") return void 0;
|
|
155
202
|
const trimmed = value.trim();
|
|
156
203
|
return trimmed || void 0;
|
|
157
204
|
}
|
|
158
205
|
function nullableText(value) {
|
|
159
|
-
return value === null ? null :
|
|
206
|
+
return value === null ? null : text2(value);
|
|
160
207
|
}
|
|
161
208
|
function httpsUrl(value) {
|
|
162
|
-
const candidate =
|
|
209
|
+
const candidate = text2(value);
|
|
163
210
|
if (!candidate || UNSAFE_URL_CHARS.test(candidate)) return void 0;
|
|
164
211
|
try {
|
|
165
212
|
return new URL(candidate).protocol === "https:" ? candidate : void 0;
|
|
@@ -168,7 +215,7 @@ function httpsUrl(value) {
|
|
|
168
215
|
}
|
|
169
216
|
}
|
|
170
217
|
function youtubeVideoId(value) {
|
|
171
|
-
const candidate =
|
|
218
|
+
const candidate = text2(value);
|
|
172
219
|
if (!candidate) return void 0;
|
|
173
220
|
if (YOUTUBE_ID.test(candidate)) return candidate;
|
|
174
221
|
const url = httpsUrl(candidate);
|
|
@@ -184,11 +231,11 @@ function youtubeVideoId(value) {
|
|
|
184
231
|
function sourceItems(value) {
|
|
185
232
|
if (!Array.isArray(value)) return void 0;
|
|
186
233
|
const items = value.filter(isRecord).flatMap((item) => {
|
|
187
|
-
const id =
|
|
188
|
-
const documentType =
|
|
189
|
-
const name =
|
|
234
|
+
const id = text2(item.id);
|
|
235
|
+
const documentType = text2(item.documentType);
|
|
236
|
+
const name = text2(item.name);
|
|
190
237
|
if (!id || !documentType || !name) return [];
|
|
191
|
-
const externalUrl =
|
|
238
|
+
const externalUrl = text2(item.externalUrl);
|
|
192
239
|
const targetPlatform = nullableText(item.targetPlatform);
|
|
193
240
|
const path = nullableText(item.path);
|
|
194
241
|
return [
|
|
@@ -211,17 +258,17 @@ function sources(value) {
|
|
|
211
258
|
for (const candidate of value) {
|
|
212
259
|
if (!isRecord(candidate)) continue;
|
|
213
260
|
const index = candidate.index;
|
|
214
|
-
const name =
|
|
261
|
+
const name = text2(candidate.name);
|
|
215
262
|
const isUsableIndex = typeof index === "number" && Number.isInteger(index) && index > 0 && !claimed.has(index);
|
|
216
263
|
if (!isUsableIndex || !name) continue;
|
|
217
264
|
claimed.add(index);
|
|
218
|
-
const path =
|
|
219
|
-
const documentType =
|
|
220
|
-
const externalUrl =
|
|
265
|
+
const path = text2(candidate.path);
|
|
266
|
+
const documentType = text2(candidate.documentType);
|
|
267
|
+
const externalUrl = text2(candidate.externalUrl);
|
|
221
268
|
const targetPlatform = nullableText(candidate.targetPlatform);
|
|
222
|
-
const id =
|
|
223
|
-
const sourceRepo =
|
|
224
|
-
const label =
|
|
269
|
+
const id = text2(candidate.id);
|
|
270
|
+
const sourceRepo = text2(candidate.sourceRepo);
|
|
271
|
+
const label = text2(candidate.label);
|
|
225
272
|
const items = sourceItems(candidate.items);
|
|
226
273
|
decoded.push({
|
|
227
274
|
index,
|
|
@@ -269,13 +316,13 @@ function videos(value) {
|
|
|
269
316
|
if (!match || match[1] !== "video") return [];
|
|
270
317
|
const id = match[2];
|
|
271
318
|
const url = httpsUrl(video.url) ?? null;
|
|
272
|
-
const sourceRepo =
|
|
319
|
+
const sourceRepo = text2(video.sourceRepo);
|
|
273
320
|
const metadata = videoMetadata(video.metadata, url);
|
|
274
321
|
return [
|
|
275
322
|
{
|
|
276
323
|
type: "video",
|
|
277
324
|
id,
|
|
278
|
-
title:
|
|
325
|
+
title: text2(video.title) ?? id,
|
|
279
326
|
url,
|
|
280
327
|
...sourceRepo ? { sourceRepo } : {},
|
|
281
328
|
...Object.keys(metadata).length > 0 ? { metadata } : {}
|
|
@@ -288,8 +335,8 @@ function cards(value, decodedSources) {
|
|
|
288
335
|
return value.filter(isRecord).flatMap((card) => {
|
|
289
336
|
const match = typeof card.ref === "string" ? CARD_REFERENCE.exec(card.ref) : null;
|
|
290
337
|
if (!match || match[1] === "video") return [];
|
|
291
|
-
const type =
|
|
292
|
-
const id =
|
|
338
|
+
const type = text2(card.entityType);
|
|
339
|
+
const id = text2(card.entityId);
|
|
293
340
|
if (!type || !id || type !== match[1] || id !== match[2]) return [];
|
|
294
341
|
const source = decodedSources.find((candidate) => candidate.id === id && candidate.documentType === type);
|
|
295
342
|
return [
|
|
@@ -356,7 +403,8 @@ function normalizeToolCalls(raw) {
|
|
|
356
403
|
toolType: typeof item.toolType === "string" ? item.toolType : void 0,
|
|
357
404
|
requiresApproval: item.requiresApproval === true,
|
|
358
405
|
approvalType: typeof item.approvalType === "string" ? item.approvalType : null,
|
|
359
|
-
toolCallArguments: isRecord(item.toolCallArguments) ? item.toolCallArguments : null
|
|
406
|
+
toolCallArguments: isRecord(item.toolCallArguments) ? item.toolCallArguments : null,
|
|
407
|
+
...policyReviewField(item.policyReview)
|
|
360
408
|
}));
|
|
361
409
|
}
|
|
362
410
|
function normalizeAskOptions(raw) {
|
|
@@ -441,6 +489,8 @@ function decodeNatsChunk(chunk) {
|
|
|
441
489
|
// the EXECUTING segment held. Dropping it here therefore blanks the
|
|
442
490
|
// card for the whole lifetime of the run.
|
|
443
491
|
toolExplanation: typeof data.toolExplanation === "string" ? data.toolExplanation : void 0,
|
|
492
|
+
// Rides the EXECUTING chunk only, like the explanation: the merge keeps it on the EXECUTED row.
|
|
493
|
+
...policyReviewField(data.policyReview),
|
|
444
494
|
parameters: isRecord(data.parameters) ? data.parameters : void 0,
|
|
445
495
|
toolExecutionRequestId: typeof data.toolExecutionRequestId === "string" ? data.toolExecutionRequestId : void 0
|
|
446
496
|
},
|
|
@@ -606,8 +656,8 @@ function decodeNatsChunk(chunk) {
|
|
|
606
656
|
}
|
|
607
657
|
|
|
608
658
|
// src/chat-protocol/leading-frames.ts
|
|
609
|
-
function escapeThinkingTags(
|
|
610
|
-
return
|
|
659
|
+
function escapeThinkingTags(text3) {
|
|
660
|
+
return text3.replace(/</g, "<");
|
|
611
661
|
}
|
|
612
662
|
function frameStr(value) {
|
|
613
663
|
return typeof value === "string" ? value : void 0;
|
|
@@ -929,12 +979,12 @@ function chipRunScanner() {
|
|
|
929
979
|
function formatCitationChips(numbers) {
|
|
930
980
|
return [...new Set(numbers)].sort((a, b) => a - b).map((n) => `[${n}]`).join("");
|
|
931
981
|
}
|
|
932
|
-
function stripCitationChips(
|
|
933
|
-
return
|
|
982
|
+
function stripCitationChips(text3) {
|
|
983
|
+
return text3.replace(chipRunScanner(), (_run, lead) => lead === " " || lead === " " ? "" : lead);
|
|
934
984
|
}
|
|
935
|
-
function citedSourceNumbers(
|
|
985
|
+
function citedSourceNumbers(text3) {
|
|
936
986
|
const numbers = [];
|
|
937
|
-
for (const run of
|
|
987
|
+
for (const run of text3.matchAll(chipRunScanner())) {
|
|
938
988
|
for (const digits of run[0].matchAll(/\d+/g)) {
|
|
939
989
|
const n = Number.parseInt(digits[0], 10);
|
|
940
990
|
if (!numbers.includes(n)) numbers.push(n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nats-decoder.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/nats-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"nats-decoder.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/nats-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAC;AA2ClE;;wDAEwD;AACxD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,EAAE,CASjE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CA2StE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MESSAGE_TYPE } from "../components/chat/types/message.types.js";
|
|
2
2
|
import { ESCALATION_STATE, escalationResolvedStatus } from "./events.js";
|
|
3
|
+
import { policyReviewField } from "./policy-review.js";
|
|
3
4
|
import { attachmentsEvent, sourceMetadataEvent } from "./source-metadata.js";
|
|
4
5
|
import { isRecord } from "./wire-narrow.js";
|
|
5
6
|
function str(value) {
|
|
@@ -22,7 +23,8 @@ function normalizeToolCalls(raw) {
|
|
|
22
23
|
toolType: typeof item.toolType === "string" ? item.toolType : void 0,
|
|
23
24
|
requiresApproval: item.requiresApproval === true,
|
|
24
25
|
approvalType: typeof item.approvalType === "string" ? item.approvalType : null,
|
|
25
|
-
toolCallArguments: isRecord(item.toolCallArguments) ? item.toolCallArguments : null
|
|
26
|
+
toolCallArguments: isRecord(item.toolCallArguments) ? item.toolCallArguments : null,
|
|
27
|
+
...policyReviewField(item.policyReview)
|
|
26
28
|
}));
|
|
27
29
|
}
|
|
28
30
|
function normalizeAskOptions(raw) {
|
|
@@ -107,6 +109,8 @@ function decodeNatsChunk(chunk) {
|
|
|
107
109
|
// the EXECUTING segment held. Dropping it here therefore blanks the
|
|
108
110
|
// card for the whole lifetime of the run.
|
|
109
111
|
toolExplanation: typeof data.toolExplanation === "string" ? data.toolExplanation : void 0,
|
|
112
|
+
// Rides the EXECUTING chunk only, like the explanation: the merge keeps it on the EXECUTED row.
|
|
113
|
+
...policyReviewField(data.policyReview),
|
|
110
114
|
parameters: isRecord(data.parameters) ? data.parameters : void 0,
|
|
111
115
|
toolExecutionRequestId: typeof data.toolExecutionRequestId === "string" ? data.toolExecutionRequestId : void 0
|
|
112
116
|
},
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PolicyReviewData } from '../components/chat/types/message.types';
|
|
2
|
+
/** `{ policyReview }` when the wire carries one, else `{}`: the key is additive, so a row without a review keeps its
|
|
3
|
+
* exact shape (history, the live stream and their golden corpora). */
|
|
4
|
+
export declare function policyReviewField(raw: unknown): {
|
|
5
|
+
policyReview?: PolicyReviewData;
|
|
6
|
+
};
|
|
7
|
+
/** The first review of the ones given, as an additive field (see {@link policyReviewField}). */
|
|
8
|
+
export declare function keptPolicyReview(...reviews: Array<PolicyReviewData | undefined>): {
|
|
9
|
+
policyReview?: PolicyReviewData;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The wire's `policyReview` (NATS chunk or history row) as the chat reads it, or `undefined` when there is none.
|
|
13
|
+
* Rules without a name and blank operation codes are dropped; an approval level this build does not know is dropped
|
|
14
|
+
* alone, not the review; a review with nothing left in it is `undefined`. `decision` and `source` stay open strings (the backend is folding the two deny kinds into
|
|
15
|
+
* one `DENY`).
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizePolicyReview(raw: unknown): PolicyReviewData | undefined;
|
|
18
|
+
//# sourceMappingURL=policy-review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-review.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/policy-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,wCAAwC,CAAC;AA4BrG;uEACuE;AACvE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,YAAY,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAGnF;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,gBAAgB,GAAG,SAAS,CAAC,GAAG;IACjF,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC,CAGA;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAqBhF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { isRecord } from "./wire-narrow.js";
|
|
2
|
+
const APPROVAL_LEVELS = /* @__PURE__ */ new Set(["ALLOW", "ASK_USER", "ASK_TECHNICIAN", "DENY"]);
|
|
3
|
+
function text(value) {
|
|
4
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
5
|
+
}
|
|
6
|
+
function level(value) {
|
|
7
|
+
return typeof value === "string" && APPROVAL_LEVELS.has(value) ? value : void 0;
|
|
8
|
+
}
|
|
9
|
+
function rules(raw) {
|
|
10
|
+
if (!Array.isArray(raw)) return [];
|
|
11
|
+
return raw.filter(isRecord).flatMap((rule) => {
|
|
12
|
+
const code = text(rule.code);
|
|
13
|
+
const label = text(rule.label) ?? code;
|
|
14
|
+
return label ? [{ code: code ?? label, label }] : [];
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function codes(raw) {
|
|
18
|
+
if (!Array.isArray(raw)) return [];
|
|
19
|
+
return raw.map(text).filter((code) => !!code);
|
|
20
|
+
}
|
|
21
|
+
function policyReviewField(raw) {
|
|
22
|
+
const policyReview = normalizePolicyReview(raw);
|
|
23
|
+
return policyReview ? { policyReview } : {};
|
|
24
|
+
}
|
|
25
|
+
function keptPolicyReview(...reviews) {
|
|
26
|
+
const policyReview = reviews.find((review) => review !== void 0);
|
|
27
|
+
return policyReview ? { policyReview } : {};
|
|
28
|
+
}
|
|
29
|
+
function normalizePolicyReview(raw) {
|
|
30
|
+
if (!isRecord(raw)) return void 0;
|
|
31
|
+
const source = text(raw.source);
|
|
32
|
+
const decision = text(raw.decision);
|
|
33
|
+
const approvalLevel = level(raw.approvalLevel);
|
|
34
|
+
const policyLevel = level(raw.policyLevel);
|
|
35
|
+
const reason = text(raw.reason);
|
|
36
|
+
const operationCodes = codes(raw.operationCodes);
|
|
37
|
+
const matchedRules = rules(raw.matchedRules);
|
|
38
|
+
if (!decision && !approvalLevel && !policyLevel && !reason && !operationCodes.length && !matchedRules.length) {
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
...source ? { source } : {},
|
|
43
|
+
...decision ? { decision } : {},
|
|
44
|
+
...approvalLevel ? { approvalLevel } : {},
|
|
45
|
+
...policyLevel ? { policyLevel } : {},
|
|
46
|
+
operationCodes,
|
|
47
|
+
matchedRules,
|
|
48
|
+
...reason ? { reason } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
keptPolicyReview,
|
|
53
|
+
normalizePolicyReview,
|
|
54
|
+
policyReviewField
|
|
55
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkZEPEFKHAcjs = require('./chunk-ZEPEFKHA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkCKR42OBKcjs = require('./chunk-CKR42OBK.cjs');
|
|
@@ -69,7 +69,7 @@ function GoogleSheetsViewer({ externalUrl, fileName, height, loading = false })
|
|
|
69
69
|
] });
|
|
70
70
|
}
|
|
71
71
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
72
|
-
|
|
72
|
+
_chunkZEPEFKHAcjs.EmbedViewerFrame,
|
|
73
73
|
{
|
|
74
74
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCKR42OBKcjs.GoogleSheetsIcon, { className: "h-5 w-5 shrink-0" }),
|
|
75
75
|
title: displayName,
|
|
@@ -107,7 +107,7 @@ function PdfViewer({ src, fileName, onPreview, onDownload, height, loading = fal
|
|
|
107
107
|
] });
|
|
108
108
|
}
|
|
109
109
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
110
|
-
|
|
110
|
+
_chunkZEPEFKHAcjs.EmbedViewerFrame,
|
|
111
111
|
{
|
|
112
112
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7ZSKWT3cjs.AdobePdfIcon, { className: "h-5 w-5 shrink-0" }),
|
|
113
113
|
title: displayName,
|