@tutti-os/agent-gui 0.0.57 → 0.0.58

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.
Files changed (50) hide show
  1. package/dist/agent-conversation/index.js +9 -8
  2. package/dist/agent-conversation/index.js.map +1 -1
  3. package/dist/agent-env/index.d.ts +285 -0
  4. package/dist/agent-env/index.js +360 -0
  5. package/dist/agent-env/index.js.map +1 -0
  6. package/dist/agent-message-center/index.js +11 -11
  7. package/dist/app/renderer/agentactivity.css +8 -33
  8. package/dist/{chunk-RGVVHF7Q.js → chunk-2WUDORCV.js} +2 -2
  9. package/dist/{chunk-Z3AAQQFD.js → chunk-5SRRKWE4.js} +2 -2
  10. package/dist/{chunk-DZ76JPCV.js → chunk-BEFNWUOZ.js} +95 -154
  11. package/dist/chunk-BEFNWUOZ.js.map +1 -0
  12. package/dist/{chunk-IMZBRUP3.js → chunk-BT5WEZO5.js} +7 -7
  13. package/dist/{chunk-HFZOXSSQ.js → chunk-CEMXB7LA.js} +5 -5
  14. package/dist/{chunk-S6PCOX3S.js → chunk-HVU46DDA.js} +1 -1
  15. package/dist/chunk-HVU46DDA.js.map +1 -0
  16. package/dist/{chunk-33LWYV6O.js → chunk-IS6JUDDY.js} +9 -1
  17. package/dist/chunk-IS6JUDDY.js.map +1 -0
  18. package/dist/{chunk-VOXUYDQF.js → chunk-N756UO52.js} +11 -7
  19. package/dist/chunk-N756UO52.js.map +1 -0
  20. package/dist/{chunk-N37A5CJH.js → chunk-NX6T3DDS.js} +3 -3
  21. package/dist/{chunk-KOR6UVUJ.js → chunk-OFMORNBO.js} +5 -5
  22. package/dist/{chunk-QFHR527D.js → chunk-OLI2A3EM.js} +2 -2
  23. package/dist/chunk-PSLAWU25.js +145 -0
  24. package/dist/chunk-PSLAWU25.js.map +1 -0
  25. package/dist/{chunk-2VHP7KQ5.js → chunk-SLT5Q37C.js} +6 -6
  26. package/dist/{chunk-SZ7JGCS3.js → chunk-UCCUIUGK.js} +4 -4
  27. package/dist/context-mention-palette/index.js +7 -7
  28. package/dist/i18n/index.d.ts +8 -0
  29. package/dist/i18n/index.js +2 -2
  30. package/dist/index.d.ts +52 -0
  31. package/dist/index.js +570 -108
  32. package/dist/index.js.map +1 -1
  33. package/dist/workbench/contribution.js +2 -2
  34. package/dist/workbench/index.js +14 -14
  35. package/dist/workbench/sessionTitle.js +3 -3
  36. package/dist/workspace-agent-generated-files.js +3 -3
  37. package/package.json +19 -12
  38. package/dist/chunk-33LWYV6O.js.map +0 -1
  39. package/dist/chunk-DZ76JPCV.js.map +0 -1
  40. package/dist/chunk-S6PCOX3S.js.map +0 -1
  41. package/dist/chunk-VOXUYDQF.js.map +0 -1
  42. /package/dist/{chunk-RGVVHF7Q.js.map → chunk-2WUDORCV.js.map} +0 -0
  43. /package/dist/{chunk-Z3AAQQFD.js.map → chunk-5SRRKWE4.js.map} +0 -0
  44. /package/dist/{chunk-IMZBRUP3.js.map → chunk-BT5WEZO5.js.map} +0 -0
  45. /package/dist/{chunk-HFZOXSSQ.js.map → chunk-CEMXB7LA.js.map} +0 -0
  46. /package/dist/{chunk-N37A5CJH.js.map → chunk-NX6T3DDS.js.map} +0 -0
  47. /package/dist/{chunk-KOR6UVUJ.js.map → chunk-OFMORNBO.js.map} +0 -0
  48. /package/dist/{chunk-QFHR527D.js.map → chunk-OLI2A3EM.js.map} +0 -0
  49. /package/dist/{chunk-2VHP7KQ5.js.map → chunk-SLT5Q37C.js.map} +0 -0
  50. /package/dist/{chunk-SZ7JGCS3.js.map → chunk-UCCUIUGK.js.map} +0 -0
@@ -15,7 +15,12 @@ import {
15
15
  resolveWorkspaceFilePathCandidate,
16
16
  resolveWorkspaceLinkAction,
17
17
  useAgentTargetPresentations
18
- } from "./chunk-2VHP7KQ5.js";
18
+ } from "./chunk-SLT5Q37C.js";
19
+ import {
20
+ classifyFailedAgentMessage,
21
+ openAgentEnvPanel,
22
+ resolveAgentErrorPresentation
23
+ } from "./chunk-PSLAWU25.js";
19
24
  import {
20
25
  AGENT_RICH_TEXT_CARET_ANCHOR,
21
26
  attrsToMentionItem,
@@ -23,7 +28,7 @@ import {
23
28
  formatAgentMentionMarkdown,
24
29
  mentionItemToAttrs,
25
30
  parseAgentMentionMarkdown
26
- } from "./chunk-N37A5CJH.js";
31
+ } from "./chunk-NX6T3DDS.js";
27
32
  import {
28
33
  fileChangeCountFromChanges,
29
34
  fileChangeEntriesFromChanges,
@@ -33,14 +38,14 @@ import {
33
38
  import {
34
39
  getOptionalAgentActivityRuntime,
35
40
  useOptionalAgentHostApi
36
- } from "./chunk-S6PCOX3S.js";
41
+ } from "./chunk-HVU46DDA.js";
37
42
  import {
38
43
  workspaceAgentProviderLabel
39
44
  } from "./chunk-TYGL25EL.js";
40
45
  import {
41
46
  getActiveUiLanguage,
42
47
  translate
43
- } from "./chunk-Z3AAQQFD.js";
48
+ } from "./chunk-5SRRKWE4.js";
44
49
 
45
50
  // shared/imageGenerationTool.ts
46
51
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -6604,133 +6609,6 @@ function hydrateAgentTargetMentionPresentations(node, agentTargets) {
6604
6609
  };
6605
6610
  }
6606
6611
 
6607
- // shared/agentEnv/agentEnvPanelStore.ts
6608
- import { useSnapshot } from "valtio";
6609
- import { proxy } from "valtio/vanilla";
6610
- var agentEnvPanelStore = proxy({
6611
- open: false,
6612
- provider: null,
6613
- focus: null,
6614
- requestSequence: 0
6615
- });
6616
- function openAgentEnvPanel(input) {
6617
- agentEnvPanelStore.open = true;
6618
- agentEnvPanelStore.provider = input?.provider ?? null;
6619
- agentEnvPanelStore.focus = input?.focus ?? null;
6620
- agentEnvPanelStore.requestSequence += 1;
6621
- }
6622
-
6623
- // shared/agentEnv/agentErrorPresentation.ts
6624
- var NO_CTA = { focus: null, actionKey: null };
6625
- var SELF_DETECT = {
6626
- messageKey: null,
6627
- focus: "detect",
6628
- actionKey: "agentHost.agentGui.visibleErrorActionDetect"
6629
- };
6630
- var PRESENTATIONS = {
6631
- // Environment problems the wizard can detect or repair → route to its step.
6632
- auth_required: {
6633
- messageKey: "agentHost.agentGui.visibleErrorAuthRequired",
6634
- focus: "auth",
6635
- actionKey: "agentHost.agentGui.visibleErrorActionRelogin"
6636
- },
6637
- cli_not_found: {
6638
- messageKey: "agentHost.agentGui.visibleErrorCliNotFound",
6639
- focus: "install",
6640
- actionKey: "agentHost.agentGui.visibleErrorActionInstall"
6641
- },
6642
- cli_version_unsupported: {
6643
- messageKey: "agentHost.agentGui.visibleErrorVersionUnsupported",
6644
- focus: "upgrade",
6645
- actionKey: "agentHost.agentGui.visibleErrorActionUpgrade"
6646
- },
6647
- network_error: {
6648
- messageKey: "agentHost.agentGui.visibleErrorNetwork",
6649
- focus: "network",
6650
- actionKey: "agentHost.agentGui.visibleErrorActionCheckNetwork"
6651
- },
6652
- runtime_unavailable: {
6653
- messageKey: "agentHost.agentGui.visibleErrorRuntimeUnavailable",
6654
- focus: "detect",
6655
- actionKey: "agentHost.agentGui.visibleErrorActionDetect"
6656
- },
6657
- // Transient / server-side failures: accurate copy, but no wizard CTA — it
6658
- // cannot fix a rate limit or a dropped stream.
6659
- request_timed_out: {
6660
- messageKey: "agentHost.agentGui.visibleErrorRequestTimedOut",
6661
- ...NO_CTA
6662
- },
6663
- provider_config_timeout: {
6664
- messageKey: "agentHost.agentGui.visibleErrorConfigTimeout",
6665
- ...NO_CTA
6666
- },
6667
- provider_stream_disconnected: {
6668
- messageKey: "agentHost.agentGui.visibleErrorStreamDisconnected",
6669
- ...NO_CTA
6670
- },
6671
- provider_concurrency_limit: {
6672
- messageKey: "agentHost.agentGui.visibleErrorConcurrencyLimit",
6673
- ...NO_CTA
6674
- },
6675
- quota_or_rate_limit: {
6676
- messageKey: "agentHost.agentGui.visibleErrorQuotaOrRateLimit",
6677
- ...NO_CTA
6678
- },
6679
- // Ambiguous hard failures → generic message + self-detect escape hatch.
6680
- process_exited: SELF_DETECT,
6681
- provider_error: SELF_DETECT,
6682
- unknown: SELF_DETECT
6683
- };
6684
- function resolveAgentErrorPresentation(code) {
6685
- if (!code) {
6686
- return null;
6687
- }
6688
- return PRESENTATIONS[code] ?? null;
6689
- }
6690
- var FAILED_MESSAGE_CODE_MARKERS = [
6691
- [
6692
- "auth_required",
6693
- [
6694
- "authentication_failed",
6695
- "invalid authentication credentials",
6696
- "401 invalid authentication",
6697
- "unauthorized",
6698
- "not logged in",
6699
- "please run /login",
6700
- "invalid api key"
6701
- ]
6702
- ],
6703
- [
6704
- "cli_version_unsupported",
6705
- ["requires a newer version", "version is too old", "unsupported version"]
6706
- ],
6707
- [
6708
- "cli_not_found",
6709
- [
6710
- "no such file or directory",
6711
- "command not found",
6712
- "enoent",
6713
- "executable file not found"
6714
- ]
6715
- ],
6716
- [
6717
- "network_error",
6718
- ["enotfound", "econnrefused", "econnreset", "getaddrinfo", "socket hang up"]
6719
- ]
6720
- ];
6721
- function classifyFailedAgentMessage(body) {
6722
- if (!body) {
6723
- return null;
6724
- }
6725
- const lower = body.toLowerCase();
6726
- for (const [code, markers] of FAILED_MESSAGE_CODE_MARKERS) {
6727
- if (markers.some((marker) => lower.includes(marker))) {
6728
- return code;
6729
- }
6730
- }
6731
- return null;
6732
- }
6733
-
6734
6612
  // shared/agentConversation/components/CollapsibleReveal.tsx
6735
6613
  import {
6736
6614
  useCallback as useCallback2,
@@ -7606,6 +7484,8 @@ var CanvasNodeGhostIconButton = forwardRef3(function CanvasNodeGhostIconButton2(
7606
7484
  import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
7607
7485
  var MESSAGE_COPY_FEEDBACK_MS = 1400;
7608
7486
  var CONTEXT_COMPACTION_NOTICE_TITLE = "Context compacted.";
7487
+ var CONTEXT_COMPACTION_IN_PROGRESS_TITLE = "Compacting context.";
7488
+ var CONTEXT_COMPACTION_INTERRUPTED_TITLE = "Context compaction interrupted.";
7609
7489
  var TRANSPORT_RETRY_PROGRESS_PATTERN = /\b(reconnect(?:ing)?(?:\s*(?:\.\.\.|…|[.。]+|:|-))?\s*\(?\d+\s*\/\s*\d+\)?)/i;
7610
7490
  var SYSTEM_NOTICE_WARNING_CLASS_NAME = "border-[color-mix(in_srgb,var(--state-warning)_14%,transparent)] bg-[color-mix(in_srgb,var(--background-fronted)_100%,var(--state-warning)_6%)]";
7611
7491
  var SYSTEM_NOTICE_ERROR_CLASS_NAME = "border-[var(--on-danger-hover)] bg-[var(--on-danger)]";
@@ -7976,29 +7856,27 @@ function AgentSystemNoticeMessage({
7976
7856
  }
7977
7857
  );
7978
7858
  }
7859
+ if (isContextCompactionProgressNotice(message, title)) {
7860
+ return /* @__PURE__ */ jsx12(
7861
+ ContextCompactionProgressDivider,
7862
+ {
7863
+ startedAtUnixMs: message.occurredAtUnixMs
7864
+ }
7865
+ );
7866
+ }
7979
7867
  if (isContextCompactionNotice(message, title)) {
7980
- return /* @__PURE__ */ jsxs7(
7981
- "div",
7868
+ return /* @__PURE__ */ jsx12(
7869
+ ContextCompactionDivider,
7982
7870
  {
7983
- role: "status",
7984
- className: "box-border flex w-full min-w-0 items-center gap-3 py-2 text-[12px] leading-4 text-[var(--text-secondary)]",
7985
- children: [
7986
- /* @__PURE__ */ jsx12(
7987
- "span",
7988
- {
7989
- "aria-hidden": "true",
7990
- className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7991
- }
7992
- ),
7993
- /* @__PURE__ */ jsx12("span", { className: "shrink-0 whitespace-nowrap", children: title }),
7994
- /* @__PURE__ */ jsx12(
7995
- "span",
7996
- {
7997
- "aria-hidden": "true",
7998
- className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7999
- }
8000
- )
8001
- ]
7871
+ text: translate("agentHost.agentGui.contextCompactionCompleted")
7872
+ }
7873
+ );
7874
+ }
7875
+ if (isContextCompactionInterruptedNotice(message, title)) {
7876
+ return /* @__PURE__ */ jsx12(
7877
+ ContextCompactionDivider,
7878
+ {
7879
+ text: translate("agentHost.agentGui.contextCompactionInterrupted")
8002
7880
  }
8003
7881
  );
8004
7882
  }
@@ -8052,6 +7930,70 @@ function isContextCompactionNotice(message, title) {
8052
7930
  const notice = message.systemNotice;
8053
7931
  return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_NOTICE_TITLE;
8054
7932
  }
7933
+ function isContextCompactionProgressNotice(message, title) {
7934
+ const notice = message.systemNotice;
7935
+ return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_IN_PROGRESS_TITLE;
7936
+ }
7937
+ function isContextCompactionInterruptedNotice(message, title) {
7938
+ const notice = message.systemNotice;
7939
+ return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_INTERRUPTED_TITLE;
7940
+ }
7941
+ function ContextCompactionDivider({ text }) {
7942
+ "use memo";
7943
+ return /* @__PURE__ */ jsxs7(
7944
+ "div",
7945
+ {
7946
+ role: "status",
7947
+ className: "box-border flex w-full min-w-0 items-center gap-3 py-2 text-[12px] leading-4 text-[var(--text-secondary)]",
7948
+ children: [
7949
+ /* @__PURE__ */ jsx12(
7950
+ "span",
7951
+ {
7952
+ "aria-hidden": "true",
7953
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7954
+ }
7955
+ ),
7956
+ /* @__PURE__ */ jsx12("span", { className: "shrink-0 whitespace-nowrap", children: text }),
7957
+ /* @__PURE__ */ jsx12(
7958
+ "span",
7959
+ {
7960
+ "aria-hidden": "true",
7961
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7962
+ }
7963
+ )
7964
+ ]
7965
+ }
7966
+ );
7967
+ }
7968
+ function ContextCompactionProgressDivider({
7969
+ startedAtUnixMs
7970
+ }) {
7971
+ "use memo";
7972
+ const elapsedSeconds = useElapsedSeconds(startedAtUnixMs);
7973
+ const label = translate("agentHost.agentGui.contextCompactionInProgress");
7974
+ const text = elapsedSeconds === null ? label : `${label} \xB7 ${formatElapsedSeconds(elapsedSeconds)}`;
7975
+ return /* @__PURE__ */ jsx12(ContextCompactionDivider, { text });
7976
+ }
7977
+ function useElapsedSeconds(startUnixMs) {
7978
+ const [nowUnixMs, setNowUnixMs] = useState5(() => Date.now());
7979
+ useEffect4(() => {
7980
+ if (startUnixMs === null) {
7981
+ return;
7982
+ }
7983
+ const timer = setInterval(() => setNowUnixMs(Date.now()), 1e3);
7984
+ return () => clearInterval(timer);
7985
+ }, [startUnixMs]);
7986
+ if (startUnixMs === null) {
7987
+ return null;
7988
+ }
7989
+ return Math.max(0, Math.floor((nowUnixMs - startUnixMs) / 1e3));
7990
+ }
7991
+ function formatElapsedSeconds(seconds) {
7992
+ if (seconds < 60) {
7993
+ return `${seconds}s`;
7994
+ }
7995
+ return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
7996
+ }
8055
7997
  function AgentPlanCardMessage({
8056
7998
  message,
8057
7999
  workspaceRoot,
@@ -15039,7 +14981,6 @@ export {
15039
14981
  labelForProviderSkill,
15040
14982
  promptForProviderSkills,
15041
14983
  skillDescriptionForDisplay,
15042
- openAgentEnvPanel,
15043
14984
  AgentTranscriptSkeleton,
15044
14985
  plainTextToAgentRichTextDoc,
15045
14986
  plainTextToAgentRichTextInlineContent,
@@ -15050,4 +14991,4 @@ export {
15050
14991
  AgentConversationFlow,
15051
14992
  useProjectedAgentConversation
15052
14993
  };
15053
- //# sourceMappingURL=chunk-DZ76JPCV.js.map
14994
+ //# sourceMappingURL=chunk-BEFNWUOZ.js.map