@robota-sdk/agent-ui-web 3.0.0-beta.96 → 3.0.0-beta.99
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/CHANGELOG.md +30 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +36 -6
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +36 -6
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +36 -6
- package/dist/node/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/SessionSurfaceChrome.tsx +6 -3
- package/src/hooks/server-message-handling.ts +4 -4
- package/src/hooks/session-client-types.ts +2 -1
- package/src/hooks/useSessionClient.ts +35 -1
package/dist/node/index.cjs
CHANGED
|
@@ -282,8 +282,8 @@ const SERVER_MESSAGE_HANDLING = {
|
|
|
282
282
|
command_result: "reducer-state",
|
|
283
283
|
messages: "reducer-state",
|
|
284
284
|
history: "intentionally-not-rendered",
|
|
285
|
-
history_changed: "
|
|
286
|
-
context: "
|
|
285
|
+
history_changed: "visible-notice",
|
|
286
|
+
context: "reducer-state",
|
|
287
287
|
turn_source: "intentionally-not-rendered",
|
|
288
288
|
commands: "reducer-state",
|
|
289
289
|
session_status: "reducer-state",
|
|
@@ -1455,6 +1455,9 @@ function useSessionClient(makeClient) {
|
|
|
1455
1455
|
settingsOpenRef.current = settingsState.settingsOpen;
|
|
1456
1456
|
const { handleAgentDefinitionsMessage, resolveSwitchResult, openAgentSwitcher, ...agentSwitcherState } = useAgentSwitcherState(send);
|
|
1457
1457
|
const { handleSchedulesMessage, requestSchedules, ...schedulesState } = useSchedulesState(send);
|
|
1458
|
+
const clearCompactionNotices = (0, react.useCallback)(() => {
|
|
1459
|
+
setSessionNotices((previous) => previous.filter((notice) => notice.kind !== "context-compacted"));
|
|
1460
|
+
}, []);
|
|
1458
1461
|
const handleMessage = (0, react.useCallback)((msg) => {
|
|
1459
1462
|
SERVER_MESSAGE_HANDLING[msg.type];
|
|
1460
1463
|
if (handleUsageMessage(msg)) return;
|
|
@@ -1602,6 +1605,7 @@ function useSessionClient(makeClient) {
|
|
|
1602
1605
|
settleSessionChange();
|
|
1603
1606
|
sessionStatusRef.current = null;
|
|
1604
1607
|
setSessionStatus(null);
|
|
1608
|
+
clearCompactionNotices();
|
|
1605
1609
|
streamingTextRef.current = "";
|
|
1606
1610
|
turnSegmentsRef.current = [];
|
|
1607
1611
|
setStreamingText("");
|
|
@@ -1623,6 +1627,7 @@ function useSessionClient(makeClient) {
|
|
|
1623
1627
|
requestSchedules();
|
|
1624
1628
|
break;
|
|
1625
1629
|
case "history_cleared":
|
|
1630
|
+
clearCompactionNotices();
|
|
1626
1631
|
rejectPendingAppRequests("The session history was cleared.");
|
|
1627
1632
|
streamingTextRef.current = "";
|
|
1628
1633
|
turnSegmentsRef.current = [];
|
|
@@ -1709,6 +1714,25 @@ function useSessionClient(makeClient) {
|
|
|
1709
1714
|
setCommandCatalog(catalog);
|
|
1710
1715
|
break;
|
|
1711
1716
|
}
|
|
1717
|
+
case "context":
|
|
1718
|
+
if (sessionStatusRef.current !== null) {
|
|
1719
|
+
const next = {
|
|
1720
|
+
...sessionStatusRef.current,
|
|
1721
|
+
context: msg.state
|
|
1722
|
+
};
|
|
1723
|
+
sessionStatusRef.current = next;
|
|
1724
|
+
setSessionStatus(next);
|
|
1725
|
+
}
|
|
1726
|
+
break;
|
|
1727
|
+
case "history_changed": {
|
|
1728
|
+
const compact = msg.compact;
|
|
1729
|
+
if (compact?.trigger === "auto") setSessionNotices((previous) => [...previous, {
|
|
1730
|
+
id: nextId(),
|
|
1731
|
+
kind: "context-compacted",
|
|
1732
|
+
message: `Auto compacted context: ${Math.round(compact.beforeUsedPercentage)}% → ${Math.round(compact.afterUsedPercentage)}%`
|
|
1733
|
+
}]);
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1712
1736
|
case "session_status":
|
|
1713
1737
|
sessionStatusRef.current = msg.status;
|
|
1714
1738
|
setSessionStatus(msg.status);
|
|
@@ -1762,6 +1786,7 @@ function useSessionClient(makeClient) {
|
|
|
1762
1786
|
appendEntry,
|
|
1763
1787
|
canListSessions,
|
|
1764
1788
|
closeExecutionDetail,
|
|
1789
|
+
clearCompactionNotices,
|
|
1765
1790
|
finishTurn,
|
|
1766
1791
|
handleAgentDefinitionsMessage,
|
|
1767
1792
|
handleAppViewMessage,
|
|
@@ -1800,7 +1825,10 @@ function useSessionClient(makeClient) {
|
|
|
1800
1825
|
const onStatusChange = (next) => {
|
|
1801
1826
|
statusRef.current = next;
|
|
1802
1827
|
setStatus(next);
|
|
1803
|
-
if (next !== "connected")
|
|
1828
|
+
if (next !== "connected") {
|
|
1829
|
+
rejectPendingAppRequests();
|
|
1830
|
+
clearCompactionNotices();
|
|
1831
|
+
}
|
|
1804
1832
|
if (next === "connected") {
|
|
1805
1833
|
commandsInFlightRef.current = 0;
|
|
1806
1834
|
silentCommandRequestIdsRef.current.clear();
|
|
@@ -1829,6 +1857,7 @@ function useSessionClient(makeClient) {
|
|
|
1829
1857
|
}, [
|
|
1830
1858
|
makeClient,
|
|
1831
1859
|
handleMessage,
|
|
1860
|
+
clearCompactionNotices,
|
|
1832
1861
|
requestSessions,
|
|
1833
1862
|
requestSchedules,
|
|
1834
1863
|
armRestore,
|
|
@@ -6940,7 +6969,7 @@ function noticeSentence(notice) {
|
|
|
6940
6969
|
}
|
|
6941
6970
|
}
|
|
6942
6971
|
/**
|
|
6943
|
-
* Session and protocol failures, as dismissible toasts over the top-right corner: they stay until
|
|
6972
|
+
* Session outcomes and protocol failures, as dismissible toasts over the top-right corner: they stay until
|
|
6944
6973
|
* dismissed, and never push the conversation or the composer out of view. Command output is not
|
|
6945
6974
|
* here — it belongs to the conversation. A provider error classified at the wire boundary shows one
|
|
6946
6975
|
* plain sentence with the next step; its raw text sits behind "Details" rather than as the headline.
|
|
@@ -6952,11 +6981,12 @@ function SessionNotices({ state }) {
|
|
|
6952
6981
|
className: "pointer-events-none absolute right-4 top-16 z-40 flex w-[min(400px,calc(100%-32px))] flex-col gap-2",
|
|
6953
6982
|
children: notices.slice(-3).map((notice) => {
|
|
6954
6983
|
const sentence = noticeSentence(notice);
|
|
6984
|
+
const compacted = notice.kind === "context-compacted";
|
|
6955
6985
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6956
|
-
role: "alert",
|
|
6986
|
+
role: compacted ? "status" : "alert",
|
|
6957
6987
|
className: "gui-rise pointer-events-auto flex items-start gap-3 rounded-xl bg-popover px-4 py-3 text-[14px] leading-snug text-popover-foreground shadow-xl shadow-black/30",
|
|
6958
6988
|
children: [
|
|
6959
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className:
|
|
6989
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `mt-[7px] h-2 w-2 flex-shrink-0 rounded-full ${compacted ? "bg-primary" : "bg-destructive"}` }),
|
|
6960
6990
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6961
6991
|
className: "max-h-40 flex-1 overflow-y-auto whitespace-pre-wrap break-words",
|
|
6962
6992
|
children: [sentence ?? notice.message, sentence && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
package/dist/node/index.d.cts
CHANGED
|
@@ -177,7 +177,7 @@ interface ISessionNotice {
|
|
|
177
177
|
* failed — a plain notice rather than a conversation card, since the control's own label is where
|
|
178
178
|
* a successful change confirms itself and the label stays unchanged when it fails.
|
|
179
179
|
*/
|
|
180
|
-
kind: 'session-error' | 'protocol-error' | 'session-change-refused' | 'background-task-control-failed' | 'command-failed';
|
|
180
|
+
kind: 'session-error' | 'protocol-error' | 'session-change-refused' | 'background-task-control-failed' | 'command-failed' | 'context-compacted';
|
|
181
181
|
message: string;
|
|
182
182
|
/**
|
|
183
183
|
* A `session-error` classified at the wire boundary (#3289 §3) — present only when the host could
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/app-view/types.ts","../../src/client/ws-session-client.ts","../../src/hooks/prompt-state.ts","../../src/hooks/session-client-types.ts","../../src/hooks/useSessionClient.ts","../../src/hooks/use-session-directory.ts","../../src/components/composer-attachments.ts","../../src/components/Composer.tsx","../../src/client/runtime-host.ts","../../src/hooks/ui-intent-state.ts","../../src/components/ConversationView.tsx","../../src/components/AgentActivityPanel.tsx","../../src/components/AgentSwitcherSheet.tsx","../../src/components/PermissionPrompt.tsx","../../src/components/personal-usage-dashboard-types.ts","../../src/components/PersonalUsageDashboard.tsx","../../src/components/SessionSurface.tsx","../../src/components/SessionSidebar.tsx","../../src/components/SessionMonitor.tsx","../../src/components/Dialog.tsx","../../src/components/SettingsScreen.tsx","../../src/components/HelpSheet.tsx","../../src/components/Brand.tsx","../../src/product-identity.tsx"],"mappings":";;;;;;;KAEY,WAAW,QAAQ;EAAkB;;KAErC,kBAAkB,KAC5B,QAAQ;EAAkB;;KAIhB,oBAAoB,QAAQ;EAAkB;;;;KCE9C;UAEK;EACf,YAAY,KAAK;EACjB,iBAAiB,QAAQ;;;;;EAKzB;;UAGe;EACf;EACA;EACA,OAAO,KAAK;EACZ,cAAc;;iBAMA,sBACd,aACA,WAAW,4BACV;;;;KCjBS;WACI;IAAuB;WACvB;IAAgB;;;;;;iBAOhB,iBACd,kBAAkB,kBAClB,KAAK,0BACK;;iBA4CI,mBAAmB,YAAY,QAAQ,yBAAyB;;iBAKhE,YAAY,YAAY,UAAU,kBAAkB;;;KC1DxD,uBAAuB,QACjC;EACE;;KAEQ,4BAA4B,QACtC;EACE;;;KAGQ,kBAAkB,KAAK,QAAQ;EAAkB;;;KAEjD,iBAAiB,QAAQ;EAAkB;;;;;;KAM3C,qBAAqB,KAC/B,QAAQ;EAAkB;;;KAKhB,kBAAkB,QAAQ;EAAkB;;;KAE5C,iBAAiB,KAC3B,QAAQ;EAAkB;;KAIhB,6BAA6B,QACvC;EACE;;;;KAKQ,qBAAqB,QAAQ;EAAkB;;KAC/C,mBAAmB,QAAQ;EAAkB;;KAC7C,qBAAqB,QAAQ;EAAkB;;UAE1C;EACf;EACA;EACA;EACA;;EAEA;;;;;;UAOe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA,gBAAgB;;;UAID;EACf;EACA;EACA;EACA,oBAAoB;;;UAIL;EACf;EACA;EACA,gBAAgB;;KAGN,qBACV,uBAAuB,sBAAsB,kBAAkB;UAEhD;EACf;EACA;EACA;EACA;EACA,SAAS;;EAET;;EAEA,qBAAqB;;EAErB;;EAEA;;EAEA,kBAAkB;;EAElB;;EAEA;;EAEA;EAEA,UAAU;;;;;;;UAQK;EACf;EACA;;UAGe;EACf;;;;;;;;EAQA;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/app-view/types.ts","../../src/client/ws-session-client.ts","../../src/hooks/prompt-state.ts","../../src/hooks/session-client-types.ts","../../src/hooks/useSessionClient.ts","../../src/hooks/use-session-directory.ts","../../src/components/composer-attachments.ts","../../src/components/Composer.tsx","../../src/client/runtime-host.ts","../../src/hooks/ui-intent-state.ts","../../src/components/ConversationView.tsx","../../src/components/AgentActivityPanel.tsx","../../src/components/AgentSwitcherSheet.tsx","../../src/components/PermissionPrompt.tsx","../../src/components/personal-usage-dashboard-types.ts","../../src/components/PersonalUsageDashboard.tsx","../../src/components/SessionSurface.tsx","../../src/components/SessionSidebar.tsx","../../src/components/SessionMonitor.tsx","../../src/components/Dialog.tsx","../../src/components/SettingsScreen.tsx","../../src/components/HelpSheet.tsx","../../src/components/Brand.tsx","../../src/product-identity.tsx"],"mappings":";;;;;;;KAEY,WAAW,QAAQ;EAAkB;;KAErC,kBAAkB,KAC5B,QAAQ;EAAkB;;KAIhB,oBAAoB,QAAQ;EAAkB;;;;KCE9C;UAEK;EACf,YAAY,KAAK;EACjB,iBAAiB,Q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BACd,OACA,SACA,sBACA,aACA,WACA,gBACA,sBACA;EAEA,OAAO;EACP;;EAEA;;;;;EAKA,oBAAoB;;EAEpB,kBAAkB,iBAAiB;;EAEnC,kBAAkB,MAAM;;;;;;EAMxB,wBAAwB;EAExB;IACE,MAAM;;;;;;;;iBA2TM,iBACd,MACA;EAEA;EACA,UAAU,MAAM;IACd,MAAM;;;;;;;;;;;;;iBChYM,iBACd,OACA,OACA;EAEA,OAAO;;EAEP,QAAQ,MAAM;EACd;IACE,MAAM;;;UCtDA;;EAER;EACA;;iBAGc,iBAAiB,OAAO,aAAa,uBAAuB,QAAM;;;;;;;;;;;;;;UCnBjE;EACf;;EAEA;EACA;EACA,UAAU,QAAM;;EAEhB;;EAEA;;EAEA;;;;;;;;EAQA,iBAAiB;;;;;;EAMjB;;iBAiBc,SACd,MACA,SACA,OACA,UACA,aACA,gBACA,eACA,gBACA,QACC,eAAe,QAAM;UAqGP;EACf;EACA;EACA,MAAM,QAAM;EACZ;EACA;;EAEA;EACA;EACA;;EAEA,iBAAiB;;;;;;;iBAQH,gBACd,MACA,OACA,MACA,cACA,aACA,aACA,WACA,UACA,kBACC,sBAAsB,QAAM;;;;;;;;;;iBCzJf,iBAAiB;EAAW,OAAO;IAAoB,QAAM;;;;;;;;;;;iBCb7D,YACd,MACA,SACA;EAEA;EACA;EACA,SAAS;IACP,MAAM;;;;iBCrCM,cAAc;EAAe;IAAkB,MAAM;;iBAiBrD,kBAAkB;EAAa;IAAqB,MAAM;;;;UChBzD;WACN;aAAqB;aAA8B;;WACnD;aAAoB;;;iBAKf,0BAA0B,OAAO;WACtC,OAAO;WACP,WAAW;IAClB,MAAM;iBAQM,sBAAsB"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -177,7 +177,7 @@ interface ISessionNotice {
|
|
|
177
177
|
* failed — a plain notice rather than a conversation card, since the control's own label is where
|
|
178
178
|
* a successful change confirms itself and the label stays unchanged when it fails.
|
|
179
179
|
*/
|
|
180
|
-
kind: 'session-error' | 'protocol-error' | 'session-change-refused' | 'background-task-control-failed' | 'command-failed';
|
|
180
|
+
kind: 'session-error' | 'protocol-error' | 'session-change-refused' | 'background-task-control-failed' | 'command-failed' | 'context-compacted';
|
|
181
181
|
message: string;
|
|
182
182
|
/**
|
|
183
183
|
* A `session-error` classified at the wire boundary (#3289 §3) — present only when the host could
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/app-view/types.ts","../../src/client/ws-session-client.ts","../../src/hooks/prompt-state.ts","../../src/hooks/session-client-types.ts","../../src/hooks/useSessionClient.ts","../../src/hooks/use-session-directory.ts","../../src/components/composer-attachments.ts","../../src/components/Composer.tsx","../../src/client/runtime-host.ts","../../src/hooks/ui-intent-state.ts","../../src/components/ConversationView.tsx","../../src/components/AgentActivityPanel.tsx","../../src/components/AgentSwitcherSheet.tsx","../../src/components/PermissionPrompt.tsx","../../src/components/personal-usage-dashboard-types.ts","../../src/components/PersonalUsageDashboard.tsx","../../src/components/SessionSurface.tsx","../../src/components/SessionSidebar.tsx","../../src/components/SessionMonitor.tsx","../../src/components/Dialog.tsx","../../src/components/SettingsScreen.tsx","../../src/components/HelpSheet.tsx","../../src/components/Brand.tsx","../../src/product-identity.tsx"],"mappings":";;;;;;;KAEY,WAAW,QAAQ;EAAkB;;KAErC,kBAAkB,KAC5B,QAAQ;EAAkB;;KAIhB,oBAAoB,QAAQ;EAAkB;;;;KCE9C;UAEK;EACf,YAAY,KAAK;EACjB,iBAAiB,QAAQ;;;;;EAKzB;;UAGe;EACf;EACA;EACA,OAAO,KAAK;EACZ,cAAc;;iBAMA,sBACd,aACA,WAAW,4BACV;;;;KCjBS;WACI;IAAuB;WACvB;IAAgB;;;;;;iBAOhB,iBACd,kBAAkB,kBAClB,KAAK,0BACK;;iBA4CI,mBAAmB,YAAY,QAAQ,yBAAyB;;iBAKhE,YAAY,YAAY,UAAU,kBAAkB;;;KC1DxD,uBAAuB,QACjC;EACE;;KAEQ,4BAA4B,QACtC;EACE;;;KAGQ,kBAAkB,KAAK,QAAQ;EAAkB;;;KAEjD,iBAAiB,QAAQ;EAAkB;;;;;;KAM3C,qBAAqB,KAC/B,QAAQ;EAAkB;;;KAKhB,kBAAkB,QAAQ;EAAkB;;;KAE5C,iBAAiB,KAC3B,QAAQ;EAAkB;;KAIhB,6BAA6B,QACvC;EACE;;;;KAKQ,qBAAqB,QAAQ;EAAkB;;KAC/C,mBAAmB,QAAQ;EAAkB;;KAC7C,qBAAqB,QAAQ;EAAkB;;UAE1C;EACf;EACA;EACA;EACA;;EAEA;;;;;;UAOe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA,gBAAgB;;;UAID;EACf;EACA;EACA;EACA,oBAAoB;;;UAIL;EACf;EACA;EACA,gBAAgB;;KAGN,qBACV,uBAAuB,sBAAsB,kBAAkB;UAEhD;EACf;EACA;EACA;EACA;EACA,SAAS;;EAET;;EAEA,qBAAqB;;EAErB;;EAEA;;EAEA,kBAAkB;;EAElB;;EAEA;;EAEA;EAEA,UAAU;;;;;;;UAQK;EACf;EACA;;UAGe;EACf;;;;;;;;EAQA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/app-view/types.ts","../../src/client/ws-session-client.ts","../../src/hooks/prompt-state.ts","../../src/hooks/session-client-types.ts","../../src/hooks/useSessionClient.ts","../../src/hooks/use-session-directory.ts","../../src/components/composer-attachments.ts","../../src/components/Composer.tsx","../../src/client/runtime-host.ts","../../src/hooks/ui-intent-state.ts","../../src/components/ConversationView.tsx","../../src/components/AgentActivityPanel.tsx","../../src/components/AgentSwitcherSheet.tsx","../../src/components/PermissionPrompt.tsx","../../src/components/personal-usage-dashboard-types.ts","../../src/components/PersonalUsageDashboard.tsx","../../src/components/SessionSurface.tsx","../../src/components/SessionSidebar.tsx","../../src/components/SessionMonitor.tsx","../../src/components/Dialog.tsx","../../src/components/SettingsScreen.tsx","../../src/components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M;iBAQM,sBAAsB"}
|
package/dist/node/index.js
CHANGED
|
@@ -256,8 +256,8 @@ const SERVER_MESSAGE_HANDLING = {
|
|
|
256
256
|
command_result: "reducer-state",
|
|
257
257
|
messages: "reducer-state",
|
|
258
258
|
history: "intentionally-not-rendered",
|
|
259
|
-
history_changed: "
|
|
260
|
-
context: "
|
|
259
|
+
history_changed: "visible-notice",
|
|
260
|
+
context: "reducer-state",
|
|
261
261
|
turn_source: "intentionally-not-rendered",
|
|
262
262
|
commands: "reducer-state",
|
|
263
263
|
session_status: "reducer-state",
|
|
@@ -1429,6 +1429,9 @@ function useSessionClient(makeClient) {
|
|
|
1429
1429
|
settingsOpenRef.current = settingsState.settingsOpen;
|
|
1430
1430
|
const { handleAgentDefinitionsMessage, resolveSwitchResult, openAgentSwitcher, ...agentSwitcherState } = useAgentSwitcherState(send);
|
|
1431
1431
|
const { handleSchedulesMessage, requestSchedules, ...schedulesState } = useSchedulesState(send);
|
|
1432
|
+
const clearCompactionNotices = useCallback(() => {
|
|
1433
|
+
setSessionNotices((previous) => previous.filter((notice) => notice.kind !== "context-compacted"));
|
|
1434
|
+
}, []);
|
|
1432
1435
|
const handleMessage = useCallback((msg) => {
|
|
1433
1436
|
SERVER_MESSAGE_HANDLING[msg.type];
|
|
1434
1437
|
if (handleUsageMessage(msg)) return;
|
|
@@ -1576,6 +1579,7 @@ function useSessionClient(makeClient) {
|
|
|
1576
1579
|
settleSessionChange();
|
|
1577
1580
|
sessionStatusRef.current = null;
|
|
1578
1581
|
setSessionStatus(null);
|
|
1582
|
+
clearCompactionNotices();
|
|
1579
1583
|
streamingTextRef.current = "";
|
|
1580
1584
|
turnSegmentsRef.current = [];
|
|
1581
1585
|
setStreamingText("");
|
|
@@ -1597,6 +1601,7 @@ function useSessionClient(makeClient) {
|
|
|
1597
1601
|
requestSchedules();
|
|
1598
1602
|
break;
|
|
1599
1603
|
case "history_cleared":
|
|
1604
|
+
clearCompactionNotices();
|
|
1600
1605
|
rejectPendingAppRequests("The session history was cleared.");
|
|
1601
1606
|
streamingTextRef.current = "";
|
|
1602
1607
|
turnSegmentsRef.current = [];
|
|
@@ -1683,6 +1688,25 @@ function useSessionClient(makeClient) {
|
|
|
1683
1688
|
setCommandCatalog(catalog);
|
|
1684
1689
|
break;
|
|
1685
1690
|
}
|
|
1691
|
+
case "context":
|
|
1692
|
+
if (sessionStatusRef.current !== null) {
|
|
1693
|
+
const next = {
|
|
1694
|
+
...sessionStatusRef.current,
|
|
1695
|
+
context: msg.state
|
|
1696
|
+
};
|
|
1697
|
+
sessionStatusRef.current = next;
|
|
1698
|
+
setSessionStatus(next);
|
|
1699
|
+
}
|
|
1700
|
+
break;
|
|
1701
|
+
case "history_changed": {
|
|
1702
|
+
const compact = msg.compact;
|
|
1703
|
+
if (compact?.trigger === "auto") setSessionNotices((previous) => [...previous, {
|
|
1704
|
+
id: nextId(),
|
|
1705
|
+
kind: "context-compacted",
|
|
1706
|
+
message: `Auto compacted context: ${Math.round(compact.beforeUsedPercentage)}% → ${Math.round(compact.afterUsedPercentage)}%`
|
|
1707
|
+
}]);
|
|
1708
|
+
break;
|
|
1709
|
+
}
|
|
1686
1710
|
case "session_status":
|
|
1687
1711
|
sessionStatusRef.current = msg.status;
|
|
1688
1712
|
setSessionStatus(msg.status);
|
|
@@ -1736,6 +1760,7 @@ function useSessionClient(makeClient) {
|
|
|
1736
1760
|
appendEntry,
|
|
1737
1761
|
canListSessions,
|
|
1738
1762
|
closeExecutionDetail,
|
|
1763
|
+
clearCompactionNotices,
|
|
1739
1764
|
finishTurn,
|
|
1740
1765
|
handleAgentDefinitionsMessage,
|
|
1741
1766
|
handleAppViewMessage,
|
|
@@ -1774,7 +1799,10 @@ function useSessionClient(makeClient) {
|
|
|
1774
1799
|
const onStatusChange = (next) => {
|
|
1775
1800
|
statusRef.current = next;
|
|
1776
1801
|
setStatus(next);
|
|
1777
|
-
if (next !== "connected")
|
|
1802
|
+
if (next !== "connected") {
|
|
1803
|
+
rejectPendingAppRequests();
|
|
1804
|
+
clearCompactionNotices();
|
|
1805
|
+
}
|
|
1778
1806
|
if (next === "connected") {
|
|
1779
1807
|
commandsInFlightRef.current = 0;
|
|
1780
1808
|
silentCommandRequestIdsRef.current.clear();
|
|
@@ -1803,6 +1831,7 @@ function useSessionClient(makeClient) {
|
|
|
1803
1831
|
}, [
|
|
1804
1832
|
makeClient,
|
|
1805
1833
|
handleMessage,
|
|
1834
|
+
clearCompactionNotices,
|
|
1806
1835
|
requestSessions,
|
|
1807
1836
|
requestSchedules,
|
|
1808
1837
|
armRestore,
|
|
@@ -6914,7 +6943,7 @@ function noticeSentence(notice) {
|
|
|
6914
6943
|
}
|
|
6915
6944
|
}
|
|
6916
6945
|
/**
|
|
6917
|
-
* Session and protocol failures, as dismissible toasts over the top-right corner: they stay until
|
|
6946
|
+
* Session outcomes and protocol failures, as dismissible toasts over the top-right corner: they stay until
|
|
6918
6947
|
* dismissed, and never push the conversation or the composer out of view. Command output is not
|
|
6919
6948
|
* here — it belongs to the conversation. A provider error classified at the wire boundary shows one
|
|
6920
6949
|
* plain sentence with the next step; its raw text sits behind "Details" rather than as the headline.
|
|
@@ -6926,11 +6955,12 @@ function SessionNotices({ state }) {
|
|
|
6926
6955
|
className: "pointer-events-none absolute right-4 top-16 z-40 flex w-[min(400px,calc(100%-32px))] flex-col gap-2",
|
|
6927
6956
|
children: notices.slice(-3).map((notice) => {
|
|
6928
6957
|
const sentence = noticeSentence(notice);
|
|
6958
|
+
const compacted = notice.kind === "context-compacted";
|
|
6929
6959
|
return /* @__PURE__ */ jsxs("div", {
|
|
6930
|
-
role: "alert",
|
|
6960
|
+
role: compacted ? "status" : "alert",
|
|
6931
6961
|
className: "gui-rise pointer-events-auto flex items-start gap-3 rounded-xl bg-popover px-4 py-3 text-[14px] leading-snug text-popover-foreground shadow-xl shadow-black/30",
|
|
6932
6962
|
children: [
|
|
6933
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
6963
|
+
/* @__PURE__ */ jsx("span", { className: `mt-[7px] h-2 w-2 flex-shrink-0 rounded-full ${compacted ? "bg-primary" : "bg-destructive"}` }),
|
|
6934
6964
|
/* @__PURE__ */ jsxs("span", {
|
|
6935
6965
|
className: "max-h-40 flex-1 overflow-y-auto whitespace-pre-wrap break-words",
|
|
6936
6966
|
children: [sentence ?? notice.message, sentence && /* @__PURE__ */ jsxs("details", {
|