@opengeni/react 3.8.0-canary.0 → 4.0.1-canary.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 +11 -24
- package/dist/artifacts.js +7 -7
- package/dist/{browser-viewer-SS46LUAC.js → browser-viewer-NTD6UIPR.js} +3 -3
- package/dist/{chunk-VEPNNDNG.js → chunk-24M4YBCL.js} +4 -4
- package/dist/chunk-5M6VTFJ5.js +171 -0
- package/dist/chunk-5M6VTFJ5.js.map +1 -0
- package/dist/{chunk-IOLVN74D.js → chunk-6J56T3MG.js} +15 -1
- package/dist/chunk-6J56T3MG.js.map +1 -0
- package/dist/{chunk-ELIYWBZR.js → chunk-BV5A4OTE.js} +4 -4
- package/dist/{chunk-3HIF5IFC.js → chunk-HO6X4FHG.js} +2597 -1030
- package/dist/chunk-HO6X4FHG.js.map +1 -0
- package/dist/{chunk-BXJOQFCD.js → chunk-HUMIRRYI.js} +84 -221
- package/dist/chunk-HUMIRRYI.js.map +1 -0
- package/dist/{chunk-ZFOFY5ST.js → chunk-NLTS7JHI.js} +16 -31
- package/dist/chunk-NLTS7JHI.js.map +1 -0
- package/dist/chunk-NOSYBS2D.js +208 -0
- package/dist/chunk-NOSYBS2D.js.map +1 -0
- package/dist/chunk-YBM6CQRU.js +292 -0
- package/dist/chunk-YBM6CQRU.js.map +1 -0
- package/dist/{chunk-BQGIXRKV.js → chunk-Z7WBDB4E.js} +416 -290
- package/dist/chunk-Z7WBDB4E.js.map +1 -0
- package/dist/chunk-ZYRGEKWS.js +216 -0
- package/dist/chunk-ZYRGEKWS.js.map +1 -0
- package/dist/components/composer.d.ts +4 -2
- package/dist/components/human-input-form.d.ts +3 -1
- package/dist/components/human-input-surface.d.ts +3 -2
- package/dist/components/message-timeline.d.ts +9 -2
- package/dist/components/session-conversation.d.ts +2 -0
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +1 -1
- package/dist/components/timeline-annotations.d.ts +8 -2
- package/dist/composer.js +3 -4
- package/dist/{computer-viewer-FWEZISW4.js → computer-viewer-7TEZC6Y2.js} +3 -3
- package/dist/hooks/use-codex-accounts.d.ts +11 -1
- package/dist/hooks/use-composer.d.ts +2 -0
- package/dist/hooks/use-session-events.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +50 -37
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +3 -3
- package/dist/machines.js +1 -1
- package/dist/older-history.d.ts +3 -2
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-27LKAWZD.js} +2 -2
- package/dist/platform-activity-row-27LKAWZD.js.map +1 -0
- package/dist/{queue-surface-implementation-XL2A6PBM.js → queue-surface-implementation-LK3S4BIW.js} +5 -2
- package/dist/{queue-surface-implementation-XL2A6PBM.js.map → queue-surface-implementation-LK3S4BIW.js.map} +1 -1
- package/dist/realtime.js +3 -3
- package/dist/session-ui.js +11 -11
- package/dist/session.js +2 -2
- package/dist/timeline/types.d.ts +3 -0
- package/dist/timeline-annotation-markers-DRSTLEM6.js +165 -0
- package/dist/timeline-annotation-markers-DRSTLEM6.js.map +1 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js +236 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js.map +1 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js +262 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +1 -0
- package/package.json +2 -6
- package/src/components/chat-composer.tsx +5 -2
- package/src/components/composer.tsx +40 -5
- package/src/components/copy-button.tsx +1 -0
- package/src/components/human-input-form.tsx +185 -53
- package/src/components/human-input-surface.tsx +3 -0
- package/src/components/machines-dashboard.tsx +1 -16
- package/src/components/message-timeline.tsx +397 -302
- package/src/components/session-commands-panel.tsx +7 -1
- package/src/components/session-conversation.tsx +4 -1
- package/src/components/timeline-annotation-chrome.tsx +183 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +99 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +172 -128
- package/src/components/timeline-annotations.tsx +178 -45
- package/src/hooks/use-codex-accounts.ts +32 -5
- package/src/hooks/use-composer.ts +17 -0
- package/src/hooks/use-session-events.ts +16 -277
- package/src/index.ts +0 -1
- package/src/older-history.ts +22 -4
- package/src/timeline/platform-activity-row.tsx +4 -1
- package/src/timeline/projection.ts +99 -9
- package/src/timeline/types.ts +3 -0
- package/styles/compiled.css +86 -22
- package/dist/chat.d.ts +0 -37
- package/dist/chat.js +0 -315
- package/dist/chat.js.map +0 -1
- package/dist/chunk-3HIF5IFC.js.map +0 -1
- package/dist/chunk-BQGIXRKV.js.map +0 -1
- package/dist/chunk-BXJOQFCD.js.map +0 -1
- package/dist/chunk-F2CFHN3Y.js +0 -1415
- package/dist/chunk-F2CFHN3Y.js.map +0 -1
- package/dist/chunk-HQV2I5HV.js +0 -124
- package/dist/chunk-HQV2I5HV.js.map +0 -1
- package/dist/chunk-IOLVN74D.js.map +0 -1
- package/dist/chunk-W3OUAH6M.js +0 -170
- package/dist/chunk-W3OUAH6M.js.map +0 -1
- package/dist/chunk-ZFOFY5ST.js.map +0 -1
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
- package/src/chat.tsx +0 -393
- /package/dist/{browser-viewer-SS46LUAC.js.map → browser-viewer-NTD6UIPR.js.map} +0 -0
- /package/dist/{chunk-VEPNNDNG.js.map → chunk-24M4YBCL.js.map} +0 -0
- /package/dist/{chunk-ELIYWBZR.js.map → chunk-BV5A4OTE.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → computer-viewer-7TEZC6Y2.js.map} +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// src/components/timeline-annotation-layout.ts
|
|
2
|
+
var ANNOTATION_BADGE_GAP_PX = 32;
|
|
3
|
+
var ANNOTATION_BADGE_MIN_GAP_PX = 12;
|
|
4
|
+
var ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;
|
|
5
|
+
var ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX = 32 * 16;
|
|
6
|
+
var ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;
|
|
7
|
+
var ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;
|
|
8
|
+
var ANNOTATION_REVIEW_MARGIN_PX = 12;
|
|
9
|
+
var ANNOTATION_NOTE_PREVIEW_CHARS = 280;
|
|
10
|
+
var ANNOTATION_CARD_STACK_SCROLL_AT = 4;
|
|
11
|
+
function clampAnnotationAxis(value, min, max) {
|
|
12
|
+
return Math.min(Math.max(value, min), Math.max(min, max));
|
|
13
|
+
}
|
|
14
|
+
function annotationBoxIntersects(a, b) {
|
|
15
|
+
return a.left <= b.right && a.right >= b.left && a.top <= b.bottom && a.bottom >= b.top;
|
|
16
|
+
}
|
|
17
|
+
function annotationViewportBox(viewportWidth, viewportHeight, scroller) {
|
|
18
|
+
const viewport = {
|
|
19
|
+
left: 0,
|
|
20
|
+
top: 0,
|
|
21
|
+
right: Math.max(1, viewportWidth),
|
|
22
|
+
bottom: Math.max(1, viewportHeight)
|
|
23
|
+
};
|
|
24
|
+
if (!scroller || scroller.right - scroller.left <= 0 || scroller.bottom - scroller.top <= 0) {
|
|
25
|
+
return viewport;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
left: Math.max(viewport.left, scroller.left),
|
|
29
|
+
top: Math.max(viewport.top, scroller.top),
|
|
30
|
+
right: Math.min(viewport.right, scroller.right),
|
|
31
|
+
bottom: Math.min(viewport.bottom, scroller.bottom)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function annotationNoteNeedsDisclosure(note) {
|
|
35
|
+
const trimmed = note.trim();
|
|
36
|
+
if (trimmed.length === 0) return false;
|
|
37
|
+
return trimmed.length > ANNOTATION_NOTE_PREVIEW_CHARS || trimmed.split("\n").length > 4;
|
|
38
|
+
}
|
|
39
|
+
function annotationAxisStops(min, max, gap) {
|
|
40
|
+
if (max <= min) return [min];
|
|
41
|
+
const stops = [];
|
|
42
|
+
for (let value = min; value <= max + 1e-6; value += gap) {
|
|
43
|
+
stops.push(value);
|
|
44
|
+
}
|
|
45
|
+
return stops;
|
|
46
|
+
}
|
|
47
|
+
function annotationPointKey(left, top) {
|
|
48
|
+
return `${Math.round(left * 100) / 100},${Math.round(top * 100) / 100}`;
|
|
49
|
+
}
|
|
50
|
+
function annotationPointFree(left, top, placed, gap) {
|
|
51
|
+
return placed.every((other) => Math.hypot(left - other.left, top - other.top) >= gap);
|
|
52
|
+
}
|
|
53
|
+
function annotationBadgePackGap(viewport, count, preferred = ANNOTATION_BADGE_GAP_PX) {
|
|
54
|
+
if (count <= 1) return preferred;
|
|
55
|
+
const width = Math.max(
|
|
56
|
+
1,
|
|
57
|
+
viewport.right - ANNOTATION_REVIEW_MARGIN_PX - (viewport.left + ANNOTATION_REVIEW_MARGIN_PX)
|
|
58
|
+
);
|
|
59
|
+
const height = Math.max(1, viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX - (viewport.top + 8));
|
|
60
|
+
let gap = preferred;
|
|
61
|
+
const capacity = (step) => (Math.floor(width / step) + 1) * (Math.floor(height / step) + 1);
|
|
62
|
+
while (gap > ANNOTATION_BADGE_MIN_GAP_PX && capacity(gap) < count) {
|
|
63
|
+
gap -= 1;
|
|
64
|
+
}
|
|
65
|
+
return gap;
|
|
66
|
+
}
|
|
67
|
+
var ANNOTATION_BADGE_SHIFT_DIRS = [
|
|
68
|
+
[1, 0],
|
|
69
|
+
[1, 1],
|
|
70
|
+
[0, 1],
|
|
71
|
+
[-1, 1],
|
|
72
|
+
[-1, 0],
|
|
73
|
+
[-1, -1],
|
|
74
|
+
[0, -1],
|
|
75
|
+
[1, -1]
|
|
76
|
+
];
|
|
77
|
+
function layoutAnnotationBadges(anchors, viewport, preferredGap = ANNOTATION_BADGE_GAP_PX) {
|
|
78
|
+
const minLeft = viewport.left + ANNOTATION_REVIEW_MARGIN_PX;
|
|
79
|
+
const maxLeft = viewport.right - ANNOTATION_REVIEW_MARGIN_PX;
|
|
80
|
+
const minTop = viewport.top + 8;
|
|
81
|
+
const maxTop = viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX;
|
|
82
|
+
const gap = annotationBadgePackGap(viewport, anchors.length, preferredGap);
|
|
83
|
+
const cells = annotationAxisStops(minLeft, maxLeft, gap).flatMap(
|
|
84
|
+
(left) => annotationAxisStops(minTop, maxTop, gap).map((top) => ({ left, top }))
|
|
85
|
+
);
|
|
86
|
+
const placed = [];
|
|
87
|
+
for (const anchor of [...anchors].sort((left, right) => left.ordinal - right.ordinal)) {
|
|
88
|
+
const originLeft = clampAnnotationAxis(anchor.left, minLeft, maxLeft);
|
|
89
|
+
const originTop = clampAnnotationAxis(anchor.top, minTop, maxTop);
|
|
90
|
+
const seen = /* @__PURE__ */ new Set();
|
|
91
|
+
const candidates = [];
|
|
92
|
+
const pushCandidate = (left, top) => {
|
|
93
|
+
if (left < minLeft || left > maxLeft || top < minTop || top > maxTop) return;
|
|
94
|
+
const key = annotationPointKey(left, top);
|
|
95
|
+
if (seen.has(key)) return;
|
|
96
|
+
seen.add(key);
|
|
97
|
+
candidates.push({ left, top });
|
|
98
|
+
};
|
|
99
|
+
pushCandidate(originLeft, originTop);
|
|
100
|
+
for (const [dx, dy] of ANNOTATION_BADGE_SHIFT_DIRS) {
|
|
101
|
+
const colliders = [...placed].sort(
|
|
102
|
+
(left, right) => right.left * dx + right.top * dy - (left.left * dx + left.top * dy)
|
|
103
|
+
);
|
|
104
|
+
for (const collider of colliders) {
|
|
105
|
+
pushCandidate(collider.left + dx * gap, collider.top + dy * gap);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const maxRadius = Math.ceil(Math.max(maxLeft - minLeft, maxTop - minTop) / Math.max(gap, 1)) + 1;
|
|
109
|
+
for (let radius = 1; radius <= maxRadius; radius++) {
|
|
110
|
+
const ring = [];
|
|
111
|
+
for (let dx = -radius; dx <= radius; dx++) {
|
|
112
|
+
for (let dy = -radius; dy <= radius; dy++) {
|
|
113
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) !== radius) continue;
|
|
114
|
+
ring.push([dx, dy]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
ring.sort((left, right) => {
|
|
118
|
+
const leftDir = (left[0] < 0 ? 2 : 0) + (left[1] < 0 ? 1 : 0);
|
|
119
|
+
const rightDir = (right[0] < 0 ? 2 : 0) + (right[1] < 0 ? 1 : 0);
|
|
120
|
+
if (leftDir !== rightDir) return leftDir - rightDir;
|
|
121
|
+
const hypot = Math.hypot(left[0], left[1]) - Math.hypot(right[0], right[1]);
|
|
122
|
+
if (hypot !== 0) return hypot;
|
|
123
|
+
if (left[0] !== right[0]) return right[0] - left[0];
|
|
124
|
+
return left[1] - right[1];
|
|
125
|
+
});
|
|
126
|
+
for (const [dx, dy] of ring) {
|
|
127
|
+
pushCandidate(originLeft + dx * gap, originTop + dy * gap);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const cell of cells) {
|
|
131
|
+
pushCandidate(cell.left, cell.top);
|
|
132
|
+
}
|
|
133
|
+
const free = candidates.find(
|
|
134
|
+
(point) => annotationPointFree(point.left, point.top, placed, gap)
|
|
135
|
+
);
|
|
136
|
+
let chosen = free ?? candidates[0];
|
|
137
|
+
if (!free && placed.length > 0) {
|
|
138
|
+
let bestMin = Number.NEGATIVE_INFINITY;
|
|
139
|
+
for (const point of candidates) {
|
|
140
|
+
const minDist = placed.reduce(
|
|
141
|
+
(current, other) => Math.min(current, Math.hypot(point.left - other.left, point.top - other.top)),
|
|
142
|
+
Number.POSITIVE_INFINITY
|
|
143
|
+
);
|
|
144
|
+
if (minDist > bestMin) {
|
|
145
|
+
bestMin = minDist;
|
|
146
|
+
chosen = point;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
placed.push({ ...anchor, left: chosen.left, top: chosen.top });
|
|
151
|
+
}
|
|
152
|
+
return placed;
|
|
153
|
+
}
|
|
154
|
+
function scrollAnnotationRowIntoList(list, row) {
|
|
155
|
+
if (!list || !row || !list.contains(row)) return;
|
|
156
|
+
const listRect = list.getBoundingClientRect();
|
|
157
|
+
const rowRect = row.getBoundingClientRect();
|
|
158
|
+
if (rowRect.top < listRect.top) {
|
|
159
|
+
list.scrollTop -= listRect.top - rowRect.top;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (rowRect.bottom > listRect.bottom) {
|
|
163
|
+
list.scrollTop += rowRect.bottom - listRect.bottom;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function clampAnnotationDialogPlacement(input) {
|
|
167
|
+
const margin = ANNOTATION_REVIEW_MARGIN_PX;
|
|
168
|
+
const panelWidth = Math.min(
|
|
169
|
+
input.panelWidth ?? ANNOTATION_REVIEW_DIALOG_WIDTH_PX,
|
|
170
|
+
Math.max(1, input.viewportWidth - margin * 2)
|
|
171
|
+
);
|
|
172
|
+
const left = Math.min(
|
|
173
|
+
Math.max(margin, input.triggerLeft),
|
|
174
|
+
Math.max(margin, input.viewportWidth - panelWidth - margin)
|
|
175
|
+
);
|
|
176
|
+
const spaceBelow = input.viewportHeight - input.triggerBottom - margin;
|
|
177
|
+
const spaceAbove = input.triggerTop - margin;
|
|
178
|
+
const above = spaceBelow < Math.min(input.contentHeight, 200) && spaceAbove > spaceBelow;
|
|
179
|
+
const viewportBudget = Math.max(
|
|
180
|
+
ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX,
|
|
181
|
+
input.viewportHeight - margin * 2
|
|
182
|
+
);
|
|
183
|
+
const available = Math.max(
|
|
184
|
+
Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget),
|
|
185
|
+
above ? spaceAbove : spaceBelow
|
|
186
|
+
);
|
|
187
|
+
let maxHeight = Math.min(
|
|
188
|
+
Math.max(input.contentHeight, Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget)),
|
|
189
|
+
available,
|
|
190
|
+
Math.floor(input.viewportHeight * 0.7) || viewportBudget,
|
|
191
|
+
ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX,
|
|
192
|
+
viewportBudget
|
|
193
|
+
);
|
|
194
|
+
let top = above ? Math.max(margin, input.triggerTop - 8 - maxHeight) : Math.min(
|
|
195
|
+
input.triggerBottom + 8,
|
|
196
|
+
Math.max(margin, input.viewportHeight - margin - maxHeight)
|
|
197
|
+
);
|
|
198
|
+
top = Math.max(margin, top);
|
|
199
|
+
maxHeight = Math.min(
|
|
200
|
+
maxHeight,
|
|
201
|
+
Math.max(ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX, input.viewportHeight - margin - top)
|
|
202
|
+
);
|
|
203
|
+
return { left, top, maxHeight, above };
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
ANNOTATION_REVIEW_DIALOG_WIDTH_PX,
|
|
208
|
+
ANNOTATION_CARD_STACK_SCROLL_AT,
|
|
209
|
+
annotationBoxIntersects,
|
|
210
|
+
annotationViewportBox,
|
|
211
|
+
annotationNoteNeedsDisclosure,
|
|
212
|
+
layoutAnnotationBadges,
|
|
213
|
+
scrollAnnotationRowIntoList,
|
|
214
|
+
clampAnnotationDialogPlacement
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=chunk-ZYRGEKWS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/timeline-annotation-layout.ts"],"sourcesContent":["export type AnnotationBox = {\n left: number;\n right: number;\n top: number;\n bottom: number;\n};\n\nexport type AnnotationBadgeAnchor = {\n id: string;\n ordinal: number;\n left: number;\n top: number;\n incomplete: boolean;\n};\n\nexport const ANNOTATION_BADGE_GAP_PX = 32;\nexport const ANNOTATION_BADGE_MIN_GAP_PX = 12;\nexport const ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;\nexport const ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX = 32 * 16;\nexport const ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;\nexport const ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;\nexport const ANNOTATION_REVIEW_MARGIN_PX = 12;\nexport const ANNOTATION_NOTE_PREVIEW_CHARS = 280;\nexport const ANNOTATION_CARD_STACK_SCROLL_AT = 4;\n\nfunction clampAnnotationAxis(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), Math.max(min, max));\n}\n\nexport function annotationBoxIntersects(a: AnnotationBox, b: AnnotationBox): boolean {\n return a.left <= b.right && a.right >= b.left && a.top <= b.bottom && a.bottom >= b.top;\n}\n\nexport function annotationViewportBox(\n viewportWidth: number,\n viewportHeight: number,\n scroller?: AnnotationBox | null,\n): AnnotationBox {\n const viewport: AnnotationBox = {\n left: 0,\n top: 0,\n right: Math.max(1, viewportWidth),\n bottom: Math.max(1, viewportHeight),\n };\n if (!scroller || scroller.right - scroller.left <= 0 || scroller.bottom - scroller.top <= 0) {\n return viewport;\n }\n return {\n left: Math.max(viewport.left, scroller.left),\n top: Math.max(viewport.top, scroller.top),\n right: Math.min(viewport.right, scroller.right),\n bottom: Math.min(viewport.bottom, scroller.bottom),\n };\n}\n\nexport function annotationNoteNeedsDisclosure(note: string): boolean {\n const trimmed = note.trim();\n if (trimmed.length === 0) return false;\n return trimmed.length > ANNOTATION_NOTE_PREVIEW_CHARS || trimmed.split(\"\\n\").length > 4;\n}\n\nfunction annotationAxisStops(min: number, max: number, gap: number): number[] {\n if (max <= min) return [min];\n const stops: number[] = [];\n for (let value = min; value <= max + 1e-6; value += gap) {\n stops.push(value);\n }\n return stops;\n}\n\nfunction annotationPointKey(left: number, top: number): string {\n return `${Math.round(left * 100) / 100},${Math.round(top * 100) / 100}`;\n}\n\nfunction annotationPointFree(\n left: number,\n top: number,\n placed: readonly AnnotationBadgeAnchor[],\n gap: number,\n): boolean {\n return placed.every((other) => Math.hypot(left - other.left, top - other.top) >= gap);\n}\n\nexport function annotationBadgePackGap(\n viewport: AnnotationBox,\n count: number,\n preferred = ANNOTATION_BADGE_GAP_PX,\n): number {\n if (count <= 1) return preferred;\n const width = Math.max(\n 1,\n viewport.right - ANNOTATION_REVIEW_MARGIN_PX - (viewport.left + ANNOTATION_REVIEW_MARGIN_PX),\n );\n const height = Math.max(1, viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX - (viewport.top + 8));\n let gap = preferred;\n const capacity = (step: number) =>\n (Math.floor(width / step) + 1) * (Math.floor(height / step) + 1);\n while (gap > ANNOTATION_BADGE_MIN_GAP_PX && capacity(gap) < count) {\n gap -= 1;\n }\n return gap;\n}\n\nconst ANNOTATION_BADGE_SHIFT_DIRS: Array<[number, number]> = [\n [1, 0],\n [1, 1],\n [0, 1],\n [-1, 1],\n [-1, 0],\n [-1, -1],\n [0, -1],\n [1, -1],\n];\n\nexport function layoutAnnotationBadges(\n anchors: readonly AnnotationBadgeAnchor[],\n viewport: AnnotationBox,\n preferredGap = ANNOTATION_BADGE_GAP_PX,\n): AnnotationBadgeAnchor[] {\n const minLeft = viewport.left + ANNOTATION_REVIEW_MARGIN_PX;\n const maxLeft = viewport.right - ANNOTATION_REVIEW_MARGIN_PX;\n const minTop = viewport.top + 8;\n const maxTop = viewport.bottom - ANNOTATION_REVIEW_MARGIN_PX;\n const gap = annotationBadgePackGap(viewport, anchors.length, preferredGap);\n const cells = annotationAxisStops(minLeft, maxLeft, gap).flatMap((left) =>\n annotationAxisStops(minTop, maxTop, gap).map((top) => ({ left, top })),\n );\n const placed: AnnotationBadgeAnchor[] = [];\n for (const anchor of [...anchors].sort((left, right) => left.ordinal - right.ordinal)) {\n const originLeft = clampAnnotationAxis(anchor.left, minLeft, maxLeft);\n const originTop = clampAnnotationAxis(anchor.top, minTop, maxTop);\n const seen = new Set<string>();\n const candidates: Array<{ left: number; top: number }> = [];\n const pushCandidate = (left: number, top: number) => {\n if (left < minLeft || left > maxLeft || top < minTop || top > maxTop) return;\n const key = annotationPointKey(left, top);\n if (seen.has(key)) return;\n seen.add(key);\n candidates.push({ left, top });\n };\n pushCandidate(originLeft, originTop);\n for (const [dx, dy] of ANNOTATION_BADGE_SHIFT_DIRS) {\n const colliders = [...placed].sort(\n (left, right) => right.left * dx + right.top * dy - (left.left * dx + left.top * dy),\n );\n for (const collider of colliders) {\n pushCandidate(collider.left + dx * gap, collider.top + dy * gap);\n }\n }\n const maxRadius =\n Math.ceil(Math.max(maxLeft - minLeft, maxTop - minTop) / Math.max(gap, 1)) + 1;\n for (let radius = 1; radius <= maxRadius; radius++) {\n const ring: Array<[number, number]> = [];\n for (let dx = -radius; dx <= radius; dx++) {\n for (let dy = -radius; dy <= radius; dy++) {\n if (Math.max(Math.abs(dx), Math.abs(dy)) !== radius) continue;\n ring.push([dx, dy]);\n }\n }\n ring.sort((left, right) => {\n const leftDir = (left[0] < 0 ? 2 : 0) + (left[1] < 0 ? 1 : 0);\n const rightDir = (right[0] < 0 ? 2 : 0) + (right[1] < 0 ? 1 : 0);\n if (leftDir !== rightDir) return leftDir - rightDir;\n const hypot = Math.hypot(left[0], left[1]) - Math.hypot(right[0], right[1]);\n if (hypot !== 0) return hypot;\n if (left[0] !== right[0]) return right[0] - left[0];\n return left[1] - right[1];\n });\n for (const [dx, dy] of ring) {\n pushCandidate(originLeft + dx * gap, originTop + dy * gap);\n }\n }\n for (const cell of cells) {\n pushCandidate(cell.left, cell.top);\n }\n const free = candidates.find((point) =>\n annotationPointFree(point.left, point.top, placed, gap),\n );\n let chosen = free ?? candidates[0]!;\n if (!free && placed.length > 0) {\n let bestMin = Number.NEGATIVE_INFINITY;\n for (const point of candidates) {\n const minDist = placed.reduce(\n (current, other) =>\n Math.min(current, Math.hypot(point.left - other.left, point.top - other.top)),\n Number.POSITIVE_INFINITY,\n );\n if (minDist > bestMin) {\n bestMin = minDist;\n chosen = point;\n }\n }\n }\n placed.push({ ...anchor, left: chosen.left, top: chosen.top });\n }\n return placed;\n}\n\nexport function scrollAnnotationRowIntoList(\n list: HTMLElement | null | undefined,\n row: HTMLElement | null | undefined,\n): void {\n if (!list || !row || !list.contains(row)) return;\n const listRect = list.getBoundingClientRect();\n const rowRect = row.getBoundingClientRect();\n if (rowRect.top < listRect.top) {\n list.scrollTop -= listRect.top - rowRect.top;\n return;\n }\n if (rowRect.bottom > listRect.bottom) {\n list.scrollTop += rowRect.bottom - listRect.bottom;\n }\n}\n\nexport function clampAnnotationDialogPlacement(input: {\n triggerLeft: number;\n triggerTop: number;\n triggerBottom: number;\n contentHeight: number;\n viewportWidth: number;\n viewportHeight: number;\n panelWidth?: number;\n}): {\n left: number;\n top: number;\n maxHeight: number;\n above: boolean;\n} {\n const margin = ANNOTATION_REVIEW_MARGIN_PX;\n const panelWidth = Math.min(\n input.panelWidth ?? ANNOTATION_REVIEW_DIALOG_WIDTH_PX,\n Math.max(1, input.viewportWidth - margin * 2),\n );\n const left = Math.min(\n Math.max(margin, input.triggerLeft),\n Math.max(margin, input.viewportWidth - panelWidth - margin),\n );\n const spaceBelow = input.viewportHeight - input.triggerBottom - margin;\n const spaceAbove = input.triggerTop - margin;\n const above = spaceBelow < Math.min(input.contentHeight, 200) && spaceAbove > spaceBelow;\n const viewportBudget = Math.max(\n ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX,\n input.viewportHeight - margin * 2,\n );\n const available = Math.max(\n Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget),\n above ? spaceAbove : spaceBelow,\n );\n let maxHeight = Math.min(\n Math.max(input.contentHeight, Math.min(ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX, viewportBudget)),\n available,\n Math.floor(input.viewportHeight * 0.7) || viewportBudget,\n ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX,\n viewportBudget,\n );\n let top = above\n ? Math.max(margin, input.triggerTop - 8 - maxHeight)\n : Math.min(\n input.triggerBottom + 8,\n Math.max(margin, input.viewportHeight - margin - maxHeight),\n );\n top = Math.max(margin, top);\n maxHeight = Math.min(\n maxHeight,\n Math.max(ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX, input.viewportHeight - margin - top),\n );\n return { left, top, maxHeight, above };\n}\n"],"mappings":";AAeO,IAAM,0BAA0B;AAChC,IAAM,8BAA8B;AACpC,IAAM,oCAAoC;AAC1C,IAAM,yCAAyC,KAAK;AACpD,IAAM,yCAAyC;AAC/C,IAAM,2CAA2C;AACjD,IAAM,8BAA8B;AACpC,IAAM,gCAAgC;AACtC,IAAM,kCAAkC;AAE/C,SAAS,oBAAoB,OAAe,KAAa,KAAqB;AAC5E,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,KAAK,IAAI,KAAK,GAAG,CAAC;AAC1D;AAEO,SAAS,wBAAwB,GAAkB,GAA2B;AACnF,SAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE;AACtF;AAEO,SAAS,sBACd,eACA,gBACA,UACe;AACf,QAAM,WAA0B;AAAA,IAC9B,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO,KAAK,IAAI,GAAG,aAAa;AAAA,IAChC,QAAQ,KAAK,IAAI,GAAG,cAAc;AAAA,EACpC;AACA,MAAI,CAAC,YAAY,SA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F;AACA,SAAO,EAAE,MAAM,KAAK,WAAW,MAAM;AACvC;","names":[]}
|
|
@@ -9,7 +9,7 @@ import type { PickerModelRow } from "../model-policy.js";
|
|
|
9
9
|
import { OPEN_WORKSTREAM_CONTROL_EVENT } from "../workstream-control-event.js";
|
|
10
10
|
export { OPEN_WORKSTREAM_CONTROL_EVENT };
|
|
11
11
|
export type { ResponsiveBasis } from "../lib/composer-responsive-context.js";
|
|
12
|
-
export type ComposerDelivery = Pick<ComposerState, "value" | "setValue" | "send" | "steer" | "sending" | "canSend" | "error" | "clearError">;
|
|
12
|
+
export type ComposerDelivery = Pick<ComposerState, "value" | "setValue" | "send" | "steer" | "sending" | "canSend" | "error" | "clearError" | "annotations" | "requestAnnotationReview">;
|
|
13
13
|
export type ComposerDraftState = Pick<ComposerState, "draftConflict" | "draftSaving" | "resolveDraftConflict" | "restoredResources" | "removeRestoredResource">;
|
|
14
14
|
export type ComposerControlState = Pick<ComposerState, "pause" | "pausing" | "resume" | "resumeScope" | "resuming">;
|
|
15
15
|
export type ComposerControlLinks = {
|
|
@@ -32,6 +32,7 @@ export type ChatComposerMessages = {
|
|
|
32
32
|
sendAndResumeAriaLabel: string;
|
|
33
33
|
sendTitle: string;
|
|
34
34
|
sendAndResumeTitle: string;
|
|
35
|
+
annotationNotesRequired: string;
|
|
35
36
|
workspacePaused: string;
|
|
36
37
|
pausedHere: string;
|
|
37
38
|
parentBlocker: string;
|
|
@@ -82,7 +83,7 @@ export type ChatComposerMessages = {
|
|
|
82
83
|
};
|
|
83
84
|
export declare const defaultChatComposerMessages: ChatComposerMessages;
|
|
84
85
|
export type ComposerSubmitMode = "queue" | "steer";
|
|
85
|
-
export type ComposerSubmitBlocker = "disabled" | "attachment" | "sending" | "command" | "empty" | null;
|
|
86
|
+
export type ComposerSubmitBlocker = "disabled" | "attachment" | "sending" | "command" | "annotations" | "empty" | null;
|
|
86
87
|
export type UseChatComposerControllerOptions = {
|
|
87
88
|
delivery: ComposerDelivery;
|
|
88
89
|
draft?: ComposerDraftState | undefined;
|
|
@@ -141,6 +142,7 @@ export declare function useChatComposerController({ delivery, draft, control, ef
|
|
|
141
142
|
sendAndResumeAriaLabel: string;
|
|
142
143
|
sendTitle: string;
|
|
143
144
|
sendAndResumeTitle: string;
|
|
145
|
+
annotationNotesRequired: string;
|
|
144
146
|
workspacePaused: string;
|
|
145
147
|
pausedHere: string;
|
|
146
148
|
parentBlocker: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HumanInputAnswer, HumanInputQuestion, SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
1
|
+
import type { HumanInputAnswer, HumanInputQuestion, SkillRecord, SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
export type HumanInputAnswerDraft = {
|
|
4
4
|
values: string[];
|
|
@@ -28,6 +28,8 @@ export type HumanInputFormMessages = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const defaultHumanInputFormMessages: HumanInputFormMessages;
|
|
30
30
|
export type HumanInputFormProps = {
|
|
31
|
+
/** Scoped immutable revision reader. Saving a Skill fails closed without its full preview. */
|
|
32
|
+
loadSkillReview?: ((reference: NonNullable<HumanInputQuestion["skillReview"]>) => Promise<SkillRecord>) | undefined;
|
|
31
33
|
request: Pick<SessionHumanInputRequest, "id" | "questions" | "allowSkip" | "expiresAt">;
|
|
32
34
|
onSubmit: (response: SubmitHumanInputResponseRequest) => void | Promise<void>;
|
|
33
35
|
submitting?: boolean | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
2
|
-
import { type HumanInputFormMessages } from "./human-input-form.js";
|
|
2
|
+
import { type HumanInputFormMessages, type HumanInputFormProps } from "./human-input-form.js";
|
|
3
3
|
export type HumanInputSurfaceProps = {
|
|
4
|
+
loadSkillReview?: HumanInputFormProps["loadSkillReview"];
|
|
4
5
|
requests: SessionHumanInputRequest[];
|
|
5
6
|
onSubmit: (requestId: string, response: SubmitHumanInputResponseRequest) => void | Promise<void>;
|
|
6
7
|
respondingRequestId?: string | null | undefined;
|
|
@@ -16,4 +17,4 @@ export type HumanInputSurfaceProps = {
|
|
|
16
17
|
* settles the active request and the next remaining set advances automatically
|
|
17
18
|
* when the authoritative pending list updates.
|
|
18
19
|
*/
|
|
19
|
-
export declare function HumanInputSurface({ requests, onSubmit, respondingRequestId, error, messages, className, autoFocus, }: HumanInputSurfaceProps): import("react").JSX.Element | null;
|
|
20
|
+
export declare function HumanInputSurface({ requests, onSubmit, loadSkillReview, respondingRequestId, error, messages, className, autoFocus, }: HumanInputSurfaceProps): import("react").JSX.Element | null;
|
|
@@ -9,6 +9,8 @@ export type MessageTimelineProps = {
|
|
|
9
9
|
items?: TimelineItem[] | undefined;
|
|
10
10
|
/** Current session status (reserved; tip "Working…" chrome removed for now). */
|
|
11
11
|
status?: SessionStatus | null | undefined;
|
|
12
|
+
/** Host-owned controls beside Copy and the timestamp on settled message rows. */
|
|
13
|
+
renderMessageActions?: ((item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
12
14
|
/** Plug a markdown renderer for message bodies (e.g. streamdown). */
|
|
13
15
|
renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
14
16
|
/** Drill into a spawned worker session. */
|
|
@@ -67,6 +69,10 @@ export type MessageTimelineProps = {
|
|
|
67
69
|
autoFollow?: boolean | undefined;
|
|
68
70
|
/** Capture a same-row text selection into the host's canonical composer draft. */
|
|
69
71
|
onAnnotate?: ((annotation: DraftTimelineAnnotation) => void) | undefined;
|
|
72
|
+
/** Composer draft quotes currently attached to the next send. */
|
|
73
|
+
draftAnnotations?: readonly DraftTimelineAnnotation[] | undefined;
|
|
74
|
+
/** Open the composer review list for one numbered draft badge. */
|
|
75
|
+
onDraftAnnotationSelect?: ((id: string) => void) | undefined;
|
|
70
76
|
/** Older durable history exists above the current window (see useSessionEvents). */
|
|
71
77
|
hasOlder?: boolean | undefined;
|
|
72
78
|
/** An older window is being fetched; shows the quiet top shimmer. */
|
|
@@ -103,7 +109,7 @@ export type MessageTimelineProps = {
|
|
|
103
109
|
* cards, goal markers, and status transitions. Owns stick-to-bottom scrolling
|
|
104
110
|
* with a "jump to latest" affordance when the reader scrolls back.
|
|
105
111
|
*/
|
|
106
|
-
export declare function MessageTimeline({ events, items, status: _status, renderMessageText, onOpenSession, onMemoryClick, onReconnect, shouldRenderAuthNeeded, resolveProviderLogo, toolRegistry, loadRetainedScreenshot, loadRetainedArtifact, loadVideoArtifactPlayback, computeLabel, turnSummary, autoFollow, onAnnotate, hasOlder, loadingOlder, onLoadOlder, onJumpToStart, loadingOldest, hasNewer, loadingNewer, onLoadNewer, onJumpToLatest, trailingState, emptyState, className, }: MessageTimelineProps): import("react").JSX.Element;
|
|
112
|
+
export declare function MessageTimeline({ events, items, status: _status, renderMessageActions, renderMessageText, onOpenSession, onMemoryClick, onReconnect, shouldRenderAuthNeeded, resolveProviderLogo, toolRegistry, loadRetainedScreenshot, loadRetainedArtifact, loadVideoArtifactPlayback, computeLabel, turnSummary, autoFollow, onAnnotate, draftAnnotations, onDraftAnnotationSelect, hasOlder, loadingOlder, onLoadOlder, onJumpToStart, loadingOldest, hasNewer, loadingNewer, onLoadNewer, onJumpToLatest, trailingState, emptyState, className, }: MessageTimelineProps): import("react").JSX.Element;
|
|
107
113
|
/**
|
|
108
114
|
* Settled turns lift the final agent answer out as a sibling group. Include it
|
|
109
115
|
* in "Copy turn" when present so the chip copies the full assistant reply.
|
|
@@ -115,8 +121,9 @@ export declare function trailingAgentTextAfterTurn(group: TimelineGroup, next: T
|
|
|
115
121
|
* landmark, notice). Exported so the component demo draws the EXACT same rows as
|
|
116
122
|
* the live app — no forked bubble/goal markup.
|
|
117
123
|
*/
|
|
118
|
-
export declare function TimelineRow({ item, renderMessageText, onReconnect, resolveProviderLogo, onOpenSession, loadVideoArtifactPlayback, }: {
|
|
124
|
+
export declare function TimelineRow({ item, renderMessageActions, renderMessageText, onReconnect, resolveProviderLogo, onOpenSession, loadVideoArtifactPlayback, }: {
|
|
119
125
|
item: TimelineItem;
|
|
126
|
+
renderMessageActions?: ((item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
120
127
|
renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
121
128
|
onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
|
|
122
129
|
resolveProviderLogo?: ((providerDomain: string) => string | null | undefined) | undefined;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
2
|
import { type ClientOverride } from "../session-context.js";
|
|
3
3
|
import { type ChatComposerProps } from "./chat-composer.js";
|
|
4
|
+
import { type HumanInputSurfaceProps } from "./human-input-surface.js";
|
|
4
5
|
export type SessionConversationProps = ClientOverride & {
|
|
5
6
|
sessionId: string;
|
|
7
|
+
loadSkillReview?: HumanInputSurfaceProps["loadSkillReview"];
|
|
6
8
|
className?: string;
|
|
7
9
|
/** Defaults to filling the host. The host owns available height. */
|
|
8
10
|
height?: CSSProperties["height"];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DraftTimelineAnnotation, TimelineAnnotation, TimelineAnnotationSource } from "@opengeni/sdk";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export type TimelineAnnotationLike = DraftTimelineAnnotation | TimelineAnnotation;
|
|
4
|
+
export declare function AnnotationQuoteSourceButton({ annotation, lines, onRevealSource, onUnavailable, }: {
|
|
5
|
+
annotation: TimelineAnnotationLike;
|
|
6
|
+
lines?: 2 | 3;
|
|
7
|
+
onRevealSource?: ((source: TimelineAnnotationSource) => boolean) | undefined;
|
|
8
|
+
onUnavailable: (id: string | null) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function AnnotationAccentRow({ children, className, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function AnnotationNotePreview({ note, annotationId, ordinal, className, }: {
|
|
15
|
+
note: string;
|
|
16
|
+
annotationId: string;
|
|
17
|
+
ordinal: number;
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
}): import("react").JSX.Element | null;
|
|
20
|
+
export declare function AnnotationNoteField({ annotation, inputRef, onUpdate, onCommit, }: {
|
|
21
|
+
annotation: TimelineAnnotationLike;
|
|
22
|
+
inputRef?: ((node: HTMLTextAreaElement | null) => void) | undefined;
|
|
23
|
+
onUpdate: (id: string, note: string) => void;
|
|
24
|
+
onCommit?: (() => void) | undefined;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type AnnotationBox = {
|
|
2
|
+
left: number;
|
|
3
|
+
right: number;
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
};
|
|
7
|
+
export type AnnotationBadgeAnchor = {
|
|
8
|
+
id: string;
|
|
9
|
+
ordinal: number;
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
incomplete: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const ANNOTATION_BADGE_GAP_PX = 32;
|
|
15
|
+
export declare const ANNOTATION_BADGE_MIN_GAP_PX = 12;
|
|
16
|
+
export declare const ANNOTATION_REVIEW_DIALOG_WIDTH_PX = 400;
|
|
17
|
+
export declare const ANNOTATION_REVIEW_DIALOG_MAX_HEIGHT_PX: number;
|
|
18
|
+
export declare const ANNOTATION_REVIEW_DIALOG_MIN_HEIGHT_PX = 160;
|
|
19
|
+
export declare const ANNOTATION_REVIEW_DIALOG_FLOOR_HEIGHT_PX = 80;
|
|
20
|
+
export declare const ANNOTATION_REVIEW_MARGIN_PX = 12;
|
|
21
|
+
export declare const ANNOTATION_NOTE_PREVIEW_CHARS = 280;
|
|
22
|
+
export declare const ANNOTATION_CARD_STACK_SCROLL_AT = 4;
|
|
23
|
+
export declare function annotationBoxIntersects(a: AnnotationBox, b: AnnotationBox): boolean;
|
|
24
|
+
export declare function annotationViewportBox(viewportWidth: number, viewportHeight: number, scroller?: AnnotationBox | null): AnnotationBox;
|
|
25
|
+
export declare function annotationNoteNeedsDisclosure(note: string): boolean;
|
|
26
|
+
export declare function annotationBadgePackGap(viewport: AnnotationBox, count: number, preferred?: number): number;
|
|
27
|
+
export declare function layoutAnnotationBadges(anchors: readonly AnnotationBadgeAnchor[], viewport: AnnotationBox, preferredGap?: number): AnnotationBadgeAnchor[];
|
|
28
|
+
export declare function scrollAnnotationRowIntoList(list: HTMLElement | null | undefined, row: HTMLElement | null | undefined): void;
|
|
29
|
+
export declare function clampAnnotationDialogPlacement(input: {
|
|
30
|
+
triggerLeft: number;
|
|
31
|
+
triggerTop: number;
|
|
32
|
+
triggerBottom: number;
|
|
33
|
+
contentHeight: number;
|
|
34
|
+
viewportWidth: number;
|
|
35
|
+
viewportHeight: number;
|
|
36
|
+
panelWidth?: number;
|
|
37
|
+
}): {
|
|
38
|
+
left: number;
|
|
39
|
+
top: number;
|
|
40
|
+
maxHeight: number;
|
|
41
|
+
above: boolean;
|
|
42
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DraftTimelineAnnotation } from "@opengeni/sdk";
|
|
2
|
+
import { type RefObject } from "react";
|
|
3
|
+
export declare function TimelineAnnotationMarkers({ annotations, onSelect, rootRef, }: {
|
|
4
|
+
annotations: readonly DraftTimelineAnnotation[];
|
|
5
|
+
onSelect?: ((id: string) => void) | undefined;
|
|
6
|
+
rootRef: RefObject<HTMLElement | null>;
|
|
7
|
+
}): import("react").ReactPortal | null;
|
|
8
|
+
export default TimelineAnnotationMarkers;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/** Owning timeline scroller for quote-source navigation. */
|
|
3
|
+
export declare const TimelineAnnotationSourceRootContext: import("react").Context<RefObject<HTMLElement | null> | null>;
|
|
4
|
+
export declare function useTimelineAnnotationSourceRoot(): RefObject<HTMLElement | null> | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TimelineAnnotationSource } from "@opengeni/sdk";
|
|
2
|
+
export declare const ANNOTATION_CHROME_SELECTOR = "[data-og-annotation-chrome], [data-og-annotation-badge], [data-og-annotation-popover]";
|
|
3
|
+
export declare function annotationHasNote(note: string): boolean;
|
|
4
|
+
export declare function annotationDisplayOrdinal(annotation: {
|
|
5
|
+
readonly id?: string;
|
|
6
|
+
readonly ordinal?: number | undefined;
|
|
7
|
+
}, index: number): number;
|
|
8
|
+
export declare function sourceKindLabel(kind: TimelineAnnotationSource["kind"]): string;
|
|
9
|
+
export declare function annotationSourceLabel(source: TimelineAnnotationSource): string;
|
|
10
|
+
export declare function truncateAnnotationQuote(quote: string, maxChars?: number): string;
|
|
11
|
+
export declare function cssEscapeAttribute(value: string): string;
|
|
12
|
+
export declare function isAnnotationChromeNode(node: Node | null): boolean;
|
|
13
|
+
export declare function occurrenceOffsets(text: string, quote: string): number[];
|
|
14
|
+
export declare function matchingQuoteInSource(sourceText: string, quote: string): string | null;
|
|
15
|
+
type AnnotatableSpan = {
|
|
16
|
+
node: Text;
|
|
17
|
+
start: number;
|
|
18
|
+
length: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function annotatableText(root: HTMLElement): {
|
|
21
|
+
text: string;
|
|
22
|
+
spans: AnnotatableSpan[];
|
|
23
|
+
};
|
|
24
|
+
export declare function rangeFromOffsets(spans: AnnotatableSpan[], startOffset: number, endOffset: number): Range | null;
|
|
25
|
+
export declare function buildQuoteRange(sourceEl: HTMLElement, quote: string, occurrenceIndex?: number): Range | null;
|
|
26
|
+
export declare function quoteOccurrenceIndex(sourceEl: HTMLElement, range: Range, quote: string): number;
|
|
27
|
+
export declare function clipRangeToSource(range: Range, sourceEl: HTMLElement): Range | null;
|
|
28
|
+
export declare function visibleClientRect(range: Range): DOMRect | null;
|
|
29
|
+
export declare function resolveAnnotationRevealRoot(from: Element | null | undefined): HTMLElement | null;
|
|
30
|
+
export declare function revealLoadedAnnotationSource(source: TimelineAnnotationSource, root?: ParentNode | null): boolean;
|
|
31
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TimelineAnnotationSource } from "@opengeni/sdk";
|
|
2
2
|
import { type RefObject } from "react";
|
|
3
|
-
import type
|
|
3
|
+
import { type TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
|
|
4
4
|
export declare function TimelineAnnotationsDialog({ annotations, editable, focusAnnotationId, onFocusConsumed, onUpdate, onRemove, onRevealSource, triggerRef, countLabel, onDismiss, }: {
|
|
5
5
|
annotations: readonly TimelineAnnotationLike[];
|
|
6
6
|
editable: boolean;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { TimelineAnnotationSource } from "@opengeni/sdk";
|
|
2
|
+
import { type TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
|
|
3
|
+
export type { TimelineAnnotationLike } from "./timeline-annotation-chrome.js";
|
|
4
|
+
export declare function TimelineAnnotationCards({ annotations, onRevealSource, className, }: {
|
|
5
|
+
annotations: readonly TimelineAnnotationLike[];
|
|
6
|
+
onRevealSource?: ((source: TimelineAnnotationSource) => boolean) | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
3
9
|
export declare function TimelineAnnotationsChip({ annotations, editable, focusAnnotationId, onFocusConsumed, onUpdate, onRemove, onRevealSource, className, }: {
|
|
4
10
|
annotations: readonly TimelineAnnotationLike[];
|
|
5
11
|
editable?: boolean | undefined;
|
package/dist/composer.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
useChatComposer,
|
|
41
41
|
useChatComposerController,
|
|
42
42
|
useVoiceInput
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-Z7WBDB4E.js";
|
|
44
44
|
import {
|
|
45
45
|
BillingClassMark,
|
|
46
46
|
ModelPolicyPicker,
|
|
@@ -49,12 +49,11 @@ import {
|
|
|
49
49
|
PickerNavRow,
|
|
50
50
|
defaultModelPolicyPickerMessages
|
|
51
51
|
} from "./chunk-R4KRSFGA.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-VZTQ73XT.js";
|
|
53
|
+
import "./chunk-6J56T3MG.js";
|
|
53
54
|
import "./chunk-PLYRL5ER.js";
|
|
54
55
|
import "./chunk-KZ73RL76.js";
|
|
55
56
|
import "./chunk-NEXLLTP4.js";
|
|
56
|
-
import "./chunk-HQV2I5HV.js";
|
|
57
|
-
import "./chunk-VZTQ73XT.js";
|
|
58
57
|
import "./chunk-VRBL3F5E.js";
|
|
59
58
|
import "./chunk-22KP6LR5.js";
|
|
60
59
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComputerViewer,
|
|
3
3
|
computerKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BV5A4OTE.js";
|
|
5
5
|
import "./chunk-H5YGYNXS.js";
|
|
6
6
|
import "./chunk-4MDLEHXL.js";
|
|
7
7
|
import "./chunk-5YK2ZDIG.js";
|
|
8
|
+
import "./chunk-JVYQRRC4.js";
|
|
8
9
|
import "./chunk-KZ73RL76.js";
|
|
9
10
|
import "./chunk-NEXLLTP4.js";
|
|
10
|
-
import "./chunk-JVYQRRC4.js";
|
|
11
11
|
import "./chunk-22KP6LR5.js";
|
|
12
12
|
export {
|
|
13
13
|
ComputerViewer,
|
|
14
14
|
computerKey
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=computer-viewer-
|
|
16
|
+
//# sourceMappingURL=computer-viewer-7TEZC6Y2.js.map
|
|
@@ -15,9 +15,14 @@ export type CodexAccountsClientLike = {
|
|
|
15
15
|
getSession?: (workspaceId: string, sessionId: string) => Promise<{
|
|
16
16
|
codexPinnedCredentialId?: string | null;
|
|
17
17
|
codexLastCredentialId?: string | null;
|
|
18
|
+
codexCurrentSelection?: {
|
|
19
|
+
credentialId: string | null;
|
|
20
|
+
waiting: boolean;
|
|
21
|
+
} | null;
|
|
18
22
|
}>;
|
|
19
23
|
pinSessionCodexAccount?: (workspaceId: string, sessionId: string, target: string) => Promise<{
|
|
20
24
|
pinned: string;
|
|
25
|
+
appliedTo?: "waiting_turn" | "next_turn";
|
|
21
26
|
}>;
|
|
22
27
|
/** Optional (absent ⇒ the card hides live refresh): batched live /wham/usage refresh. */
|
|
23
28
|
refreshCodexUsage?: (workspaceId: string) => Promise<{
|
|
@@ -37,8 +42,13 @@ export type UseCodexAccountsResult = {
|
|
|
37
42
|
activeAccountId: string | null;
|
|
38
43
|
/** The session's PINNED account (null ⇒ following workspace active). */
|
|
39
44
|
pinnedAccountId: string | null;
|
|
40
|
-
/**
|
|
45
|
+
/** Current preference only; automatic allocation can choose another account. */
|
|
41
46
|
effectiveAccountId: string | null;
|
|
47
|
+
currentSelection: {
|
|
48
|
+
credentialId: string | null;
|
|
49
|
+
waiting: boolean;
|
|
50
|
+
} | null;
|
|
51
|
+
switchAppliedTo: "waiting_turn" | "next_turn" | null;
|
|
42
52
|
/** The account the session's last turn ACTUALLY ran on (the "Running on:" source). */
|
|
43
53
|
lastAccountId: string | null;
|
|
44
54
|
settings: CodexRotationSettings;
|
|
@@ -59,6 +59,8 @@ export type ComposerState = {
|
|
|
59
59
|
/** Newly captured annotation the review surface should focus. */
|
|
60
60
|
annotationReviewTargetId?: string | null | undefined;
|
|
61
61
|
clearAnnotationReviewTarget?: (() => void) | undefined;
|
|
62
|
+
/** Focus an annotation, or the first incomplete note when omitted. */
|
|
63
|
+
requestAnnotationReview?: ((id?: string) => void) | undefined;
|
|
62
64
|
/** Read the current draft synchronously before a destructive replacement. */
|
|
63
65
|
hasDraftContent: () => boolean;
|
|
64
66
|
/** Append the draft behind prompts already visible in the queue. */
|
|
@@ -65,7 +65,6 @@ export type UseSessionEventsResult = {
|
|
|
65
65
|
};
|
|
66
66
|
export declare const SESSION_EVENT_BROWSER_MAX_BYTES: number;
|
|
67
67
|
export declare const SESSION_EVENT_BROWSER_MAX_COUNT = 10000;
|
|
68
|
-
export declare const SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES: number;
|
|
69
68
|
export declare const SESSION_EVENT_BROWSER_PENDING_MAX_BYTES: number;
|
|
70
69
|
export declare const SESSION_EVENT_BROWSER_PENDING_MAX_COUNT = 256;
|
|
71
70
|
export type BrowserSessionEventWindow = {
|
|
@@ -86,7 +85,8 @@ export declare function useSessionEvents(sessionId: string | null | undefined, o
|
|
|
86
85
|
* deliberately separate from durable history and transport paging: when a
|
|
87
86
|
* backward page evicts the live tail, the hook enters bounded history mode and
|
|
88
87
|
* preserves the highest-ever-observed sequence separately for forward paging.
|
|
89
|
-
* The source event remains durable in PostgreSQL throughout.
|
|
88
|
+
* The source event remains durable in PostgreSQL throughout. An event larger
|
|
89
|
+
* than the byte target is retained alone, never replaced by a lossy preview.
|
|
90
90
|
*/
|
|
91
91
|
export declare function boundBrowserSessionEventWindow(events: readonly SessionEvent[], options?: {
|
|
92
92
|
maxBytes?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { filePathVisibility, visibleFileTree } from "./file-node-visibility.js";
|
|
|
11
11
|
export type { FileNodeVisibilityContext, FileNodeVisibilityPredicate, FilePathVisibility, } from "./file-node-visibility.js";
|
|
12
12
|
export { useSession, isTitleEvent } from "./hooks/use-session.js";
|
|
13
13
|
export type { UseSessionOptions, UseSessionResult } from "./hooks/use-session.js";
|
|
14
|
-
export { SESSION_EVENT_BROWSER_MAX_BYTES, SESSION_EVENT_BROWSER_MAX_COUNT, SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, SESSION_EVENT_BROWSER_PENDING_MAX_COUNT,
|
|
14
|
+
export { SESSION_EVENT_BROWSER_MAX_BYTES, SESSION_EVENT_BROWSER_MAX_COUNT, SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, SESSION_EVENT_BROWSER_PENDING_MAX_COUNT, boundBrowserSessionEventWindow, useSessionEvents, } from "./hooks/use-session-events.js";
|
|
15
15
|
export { createOlderHistoryLoadReceipt } from "./older-history.js";
|
|
16
16
|
export type { BrowserSessionEventWindow, SessionEventsConnectionState, UseSessionEventsOptions, UseSessionEventsResult, } from "./hooks/use-session-events.js";
|
|
17
17
|
export type { OlderHistoryLoader, OlderHistoryLoadReceipt } from "./older-history.js";
|