@tutti-os/agent-gui 0.0.132 → 0.0.134

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 (96) hide show
  1. package/README.md +21 -4
  2. package/dist/{AgentRichTextReadonly-PEKCMRPE.js → AgentRichTextReadonly-HCKTNAYO.js} +7 -6
  3. package/dist/agent-conversation/index.d.ts +4 -6
  4. package/dist/agent-conversation/index.js +10 -10
  5. package/dist/agent-env/index.d.ts +10 -27
  6. package/dist/agent-env/index.js +14 -290
  7. package/dist/agent-env/index.js.map +1 -1
  8. package/dist/agent-gui.d.ts +1118 -20
  9. package/dist/agent-gui.js +18 -18
  10. package/dist/agent-message-center/index.d.ts +42 -7
  11. package/dist/agent-message-center/index.js +7 -7
  12. package/dist/{agentConversationVM-BD0-gg6C.d.ts → agentConversationVM-DWEy7jzx.d.ts} +41 -2
  13. package/dist/{agentFileMentionContracts-CWAeuL7S.d.ts → agentFileMentionContracts-B0yQizXB.d.ts} +5 -0
  14. package/dist/{agentGuiNodeTypes-5TL1hyCN.d.ts → agentGuiNodeTypes-DV7KvZRe.d.ts} +10 -26
  15. package/dist/agents.d.ts +1 -1
  16. package/dist/agents.js +1 -1
  17. package/dist/app/renderer/agentactivity.css +7 -0
  18. package/dist/app/renderer/assets/icons/@-lined.svg +1 -8
  19. package/dist/{chunk-PQJXWXTS.js → chunk-25VMCMAQ.js} +4 -4
  20. package/dist/{chunk-T2NICA5D.js → chunk-5WOCGIXJ.js} +7 -1
  21. package/dist/chunk-5WOCGIXJ.js.map +1 -0
  22. package/dist/chunk-DLCZJKCA.js +1 -0
  23. package/dist/chunk-DLCZJKCA.js.map +1 -0
  24. package/dist/{chunk-QQRTUHCH.js → chunk-EU7DCT4F.js} +2 -2
  25. package/dist/chunk-FM42UN2J.js +462 -0
  26. package/dist/chunk-FM42UN2J.js.map +1 -0
  27. package/dist/{chunk-SZOTLVH6.js → chunk-GIYGO2PB.js} +2 -2
  28. package/dist/{chunk-GCQYN7BR.js → chunk-IN3HXYOO.js} +4 -4
  29. package/dist/{chunk-YWHGCKMT.js → chunk-IYZ4GOSN.js} +10 -10
  30. package/dist/chunk-IYZ4GOSN.js.map +1 -0
  31. package/dist/{chunk-JZS4SWFJ.js → chunk-JI5KND3K.js} +60 -56
  32. package/dist/chunk-JI5KND3K.js.map +1 -0
  33. package/dist/{chunk-J4TTEMRW.js → chunk-KWGMK4IZ.js} +4 -4
  34. package/dist/{chunk-NE6H7S5Z.js → chunk-OFJNIQWR.js} +2 -2
  35. package/dist/{chunk-NE6H7S5Z.js.map → chunk-OFJNIQWR.js.map} +1 -1
  36. package/dist/{chunk-UARZZJJB.js → chunk-OI6BYC7P.js} +4 -4
  37. package/dist/{chunk-OBWM2RFE.js → chunk-QPEO4OQS.js} +308 -8
  38. package/dist/chunk-QPEO4OQS.js.map +1 -0
  39. package/dist/{chunk-XNE2ROCP.js → chunk-UA75CGAG.js} +3 -3
  40. package/dist/{chunk-PVTAFUDS.js → chunk-VGS7S7YT.js} +2 -2
  41. package/dist/{chunk-OQR3HXPF.js → chunk-VUNVGEQG.js} +7 -1
  42. package/dist/chunk-VUNVGEQG.js.map +1 -0
  43. package/dist/{chunk-G75CPIVV.js → chunk-Y5HD6XHP.js} +1040 -797
  44. package/dist/chunk-Y5HD6XHP.js.map +1 -0
  45. package/dist/{chunk-KPMQGPYU.js → chunk-ZVYUTXQJ.js} +1 -1
  46. package/dist/chunk-ZVYUTXQJ.js.map +1 -0
  47. package/dist/context-mention-palette/index.d.ts +1 -1
  48. package/dist/context-mention-palette/index.js +8 -7
  49. package/dist/{contribution-yc4CGJmy.d.ts → contribution-CDdwTppn.d.ts} +54 -1
  50. package/dist/custom-mention.d.ts +4 -2
  51. package/dist/custom-mention.js +1 -0
  52. package/dist/i18n/index.d.ts +17 -6
  53. package/dist/i18n/index.js +2 -2
  54. package/dist/index.d.ts +8026 -33
  55. package/dist/index.js +21 -21
  56. package/dist/index.js.map +1 -1
  57. package/dist/mention-search.d.ts +1 -1
  58. package/dist/mention-search.js +6 -5
  59. package/dist/runtime-Dwf44VKc.d.ts +7 -0
  60. package/dist/{types-BicfRVrV.d.ts → types-ee3zJ6Cc.d.ts} +6 -5
  61. package/dist/workbench/browser-element-context/index.d.ts +37 -0
  62. package/dist/workbench/browser-element-context/index.js +750 -0
  63. package/dist/workbench/browser-element-context/index.js.map +1 -0
  64. package/dist/workbench/contribution.d.ts +1 -2
  65. package/dist/workbench/contribution.js +4 -4
  66. package/dist/workbench/index.d.ts +1 -2
  67. package/dist/workbench/index.js +4 -4
  68. package/dist/workbench/sessionTitle.js +2 -2
  69. package/dist/workbench/tool-sidebar/index.d.ts +189 -0
  70. package/dist/workbench/tool-sidebar/index.js +1492 -0
  71. package/dist/workbench/tool-sidebar/index.js.map +1 -0
  72. package/dist/workspace-agent-generated-files.d.ts +12 -1
  73. package/package.json +28 -13
  74. package/dist/AgentGUI-DxypmD7b.d.ts +0 -1080
  75. package/dist/agentPlanPromptDispatch-C7cCMjve.d.ts +0 -37
  76. package/dist/chunk-G75CPIVV.js.map +0 -1
  77. package/dist/chunk-JZS4SWFJ.js.map +0 -1
  78. package/dist/chunk-KPMQGPYU.js.map +0 -1
  79. package/dist/chunk-OBWM2RFE.js.map +0 -1
  80. package/dist/chunk-OQR3HXPF.js.map +0 -1
  81. package/dist/chunk-T2NICA5D.js.map +0 -1
  82. package/dist/chunk-VMQNG2KI.js +0 -178
  83. package/dist/chunk-VMQNG2KI.js.map +0 -1
  84. package/dist/chunk-YWHGCKMT.js.map +0 -1
  85. package/dist/pastedTextKinds-D-XuInaS.d.ts +0 -4
  86. package/dist/runtime-BBNdWgDU.d.ts +0 -10
  87. package/dist/workspaceAgentActivityListTypes-DZfS_HgG.d.ts +0 -48
  88. /package/dist/{AgentRichTextReadonly-PEKCMRPE.js.map → AgentRichTextReadonly-HCKTNAYO.js.map} +0 -0
  89. /package/dist/{chunk-PQJXWXTS.js.map → chunk-25VMCMAQ.js.map} +0 -0
  90. /package/dist/{chunk-QQRTUHCH.js.map → chunk-EU7DCT4F.js.map} +0 -0
  91. /package/dist/{chunk-SZOTLVH6.js.map → chunk-GIYGO2PB.js.map} +0 -0
  92. /package/dist/{chunk-GCQYN7BR.js.map → chunk-IN3HXYOO.js.map} +0 -0
  93. /package/dist/{chunk-J4TTEMRW.js.map → chunk-KWGMK4IZ.js.map} +0 -0
  94. /package/dist/{chunk-UARZZJJB.js.map → chunk-OI6BYC7P.js.map} +0 -0
  95. /package/dist/{chunk-XNE2ROCP.js.map → chunk-UA75CGAG.js.map} +0 -0
  96. /package/dist/{chunk-PVTAFUDS.js.map → chunk-VGS7S7YT.js.map} +0 -0
@@ -2,17 +2,13 @@ import {
2
2
  AgentRichTextReadonly,
3
3
  promptForProviderSkills,
4
4
  skillTriggerForPrefix
5
- } from "./chunk-XNE2ROCP.js";
5
+ } from "./chunk-UA75CGAG.js";
6
6
  import {
7
7
  classifyRecoverableAgentMessage,
8
8
  isProviderPlanLimitMessage,
9
- openAgentEnvPanel,
10
- resolveAgentErrorPresentation
11
- } from "./chunk-VMQNG2KI.js";
12
- import {
13
- AGENT_PASTED_TEXT_BLOCK_KIND,
14
- AGENT_PASTED_TEXT_MENTION_KIND
15
- } from "./chunk-FGLQZ6I4.js";
9
+ resolveAgentErrorPresentation,
10
+ useOpenAgentEnvPanel
11
+ } from "./chunk-FM42UN2J.js";
16
12
  import {
17
13
  isWorkspaceAgentSyntheticControlMessage
18
14
  } from "./chunk-XJ34OIEQ.js";
@@ -23,6 +19,18 @@ import {
23
19
  resolveImageGenerationPreviewSrc,
24
20
  stripImagePayloadData
25
21
  } from "./chunk-R7AXDQCA.js";
22
+ import {
23
+ agentComposerFileMentionReferences,
24
+ agentPreparedPromptFileToDraftFile,
25
+ agentPromptContentToComposerPrompt,
26
+ agentPromptFileBlocks,
27
+ agentPromptPastedTextBlocks,
28
+ materializeAgentComposerFileMentions
29
+ } from "./chunk-QPEO4OQS.js";
30
+ import {
31
+ AGENT_PASTED_TEXT_BLOCK_KIND,
32
+ AGENT_PASTED_TEXT_MENTION_KIND
33
+ } from "./chunk-FGLQZ6I4.js";
26
34
  import {
27
35
  AgentGUIConversation_styles_default,
28
36
  AgentMessageMarkdown,
@@ -38,15 +46,15 @@ import {
38
46
  resolveWorkspaceFileLinkAction,
39
47
  resolveWorkspaceFilePathCandidate,
40
48
  resolveWorkspaceLinkAction
41
- } from "./chunk-YWHGCKMT.js";
49
+ } from "./chunk-IYZ4GOSN.js";
42
50
  import {
43
51
  cn
44
- } from "./chunk-KPMQGPYU.js";
52
+ } from "./chunk-ZVYUTXQJ.js";
45
53
  import {
46
54
  useOptionalAgentActivityRuntime,
47
55
  useOptionalAgentHostApi,
48
56
  workspaceAgentProviderLabel
49
- } from "./chunk-NE6H7S5Z.js";
57
+ } from "./chunk-OFJNIQWR.js";
50
58
  import {
51
59
  fileChangeCountFromChanges,
52
60
  fileChangeEntriesFromChanges,
@@ -56,7 +64,7 @@ import {
56
64
  getActiveUiLanguage,
57
65
  translate,
58
66
  useTranslation
59
- } from "./chunk-SZOTLVH6.js";
67
+ } from "./chunk-GIYGO2PB.js";
60
68
  import {
61
69
  normalizeAgentTitleText
62
70
  } from "./chunk-MIJXEELH.js";
@@ -3320,10 +3328,27 @@ function updateAgentComposerDraft(draft, update) {
3320
3328
  });
3321
3329
  }
3322
3330
  function agentComposerDraftHasContent(draft) {
3331
+ const prompt = agentComposerDraftPrompt(draft);
3332
+ const references = agentComposerFileMentionReferences(prompt);
3333
+ let cursor = 0;
3334
+ let textWithoutComposerFiles = "";
3335
+ for (const reference of references) {
3336
+ textWithoutComposerFiles += prompt.slice(cursor, reference.start);
3337
+ cursor = reference.end;
3338
+ }
3339
+ textWithoutComposerFiles += prompt.slice(cursor);
3340
+ const referencedFileIds = new Set(
3341
+ references.map((reference) => reference.id)
3342
+ );
3343
+ if (textWithoutComposerFiles.trim() || agentComposerDraftFiles(draft).some(
3344
+ (file) => referencedFileIds.has(file.id)
3345
+ )) {
3346
+ return true;
3347
+ }
3323
3348
  return draft.some((block) => {
3324
- if (block.type === "text") return block.text.trim() !== "";
3349
+ if (block.type === "text") return false;
3325
3350
  if (block.type === "image") return true;
3326
- return block.kind === "file" ? true : block.text.trim() !== "" || Boolean(block.path);
3351
+ return block.kind === "file" ? false : block.text.trim() !== "" || Boolean(block.path);
3327
3352
  });
3328
3353
  }
3329
3354
  function normalizeAgentPromptContentBlocks(content) {
@@ -3357,7 +3382,10 @@ function normalizeAgentPromptContentBlocks(content) {
3357
3382
  if (block.type === "file") {
3358
3383
  const filePath = block.path?.trim();
3359
3384
  const hostPath = block.hostPath?.trim();
3360
- if (!filePath && !hostPath) {
3385
+ const url = block.url?.trim();
3386
+ const uri = block.uri?.trim();
3387
+ const assetId = block.assetId?.trim();
3388
+ if (!filePath && !hostPath && !url && !uri && !assetId) {
3361
3389
  continue;
3362
3390
  }
3363
3391
  result.push({
@@ -3365,10 +3393,11 @@ function normalizeAgentPromptContentBlocks(content) {
3365
3393
  ...block.mimeType?.trim() ? { mimeType: block.mimeType.trim() } : {},
3366
3394
  ...filePath ? { path: filePath } : {},
3367
3395
  ...hostPath ? { hostPath } : {},
3396
+ ...url ? { url } : {},
3368
3397
  ...block.name?.trim() ? { name: block.name.trim() } : {},
3369
- ...block.uri?.trim() ? { uri: block.uri.trim() } : {},
3398
+ ...uri ? { uri } : {},
3370
3399
  ...block.uploadStatus?.trim() ? { uploadStatus: block.uploadStatus.trim() } : {},
3371
- ...block.assetId?.trim() ? { assetId: block.assetId.trim() } : {},
3400
+ ...assetId ? { assetId } : {},
3372
3401
  ...typeof block.sizeBytes === "number" ? { sizeBytes: block.sizeBytes } : {},
3373
3402
  kind: block.kind === AGENT_PASTED_TEXT_BLOCK_KIND ? AGENT_PASTED_TEXT_BLOCK_KIND : "file"
3374
3403
  });
@@ -3408,14 +3437,15 @@ function agentPromptContentToComposerDraft(content, idPrefix) {
3408
3437
  const largeTexts = agentPromptPastedTextBlocks(normalizedContent).map(
3409
3438
  (block) => agentPromptPastedTextBlockToDraftLargeText(block)
3410
3439
  );
3440
+ const files = agentPromptFileBlocks(normalizedContent).map(
3441
+ (file, index) => agentPreparedPromptFileToDraftFile(file, idPrefix, index)
3442
+ );
3411
3443
  return buildAgentComposerDraft({
3412
- prompt: agentPromptContentDisplayText(normalizedContent),
3444
+ prompt: agentPromptContentToComposerPrompt(normalizedContent, files),
3413
3445
  images: agentPromptContentImageBlocks(normalizedContent).slice(0, MAX_AGENT_COMPOSER_DRAFT_IMAGES).map(
3414
3446
  (image, index) => agentPromptImageBlockToDraftImage(image, idPrefix, index)
3415
3447
  ),
3416
- files: agentPromptFileBlocks(normalizedContent).map(
3417
- (file, index) => agentPromptFileBlockToDraftFile(file, idPrefix, index)
3418
- ),
3448
+ files,
3419
3449
  largeTexts
3420
3450
  });
3421
3451
  }
@@ -3429,8 +3459,12 @@ function agentPromptPastedTextBlockToDraftLargeText(block) {
3429
3459
  };
3430
3460
  }
3431
3461
  function agentComposerDraftToPromptContent(input) {
3462
+ const providerPrompt = materializeAgentComposerFileMentions(
3463
+ agentComposerDraftPrompt(input.draft),
3464
+ agentComposerDraftFiles(input.draft)
3465
+ );
3432
3466
  const prompt = promptForProviderSkills({
3433
- prompt: agentComposerDraftPrompt(input.draft),
3467
+ prompt: providerPrompt,
3434
3468
  skills: input.skills
3435
3469
  });
3436
3470
  return normalizeAgentPromptContentBlocks([
@@ -3446,16 +3480,6 @@ function agentComposerDraftToPromptContent(input) {
3446
3480
  ...image.url ? { url: image.url } : image.path ? { path: image.path } : { data: image.data },
3447
3481
  name: image.name
3448
3482
  })),
3449
- ...agentComposerDraftFiles(input.draft).filter((file) => !file.uploading && !file.uploadError).map((file) => ({
3450
- type: "file",
3451
- ...file.mimeType ? { mimeType: file.mimeType } : {},
3452
- ...file.path ? { path: file.path } : {},
3453
- ...!file.path && file.hostPath ? { hostPath: file.hostPath } : {},
3454
- ...file.assetId ? { assetId: file.assetId } : {},
3455
- ...file.sizeBytes ? { sizeBytes: file.sizeBytes } : {},
3456
- name: file.name,
3457
- kind: "file"
3458
- })),
3459
3483
  ...largeTextPromptContent(agentComposerDraftLargeTexts(input.draft))
3460
3484
  ]);
3461
3485
  }
@@ -3492,16 +3516,6 @@ function projectAgentComposerDraftSubmission(input) {
3492
3516
  ...displayPrompt ? { displayPrompt } : {}
3493
3517
  };
3494
3518
  }
3495
- function agentPromptFileBlocks(content) {
3496
- return normalizeAgentPromptContentBlocks(content).filter(
3497
- (block) => block.type === "file" && !isPastedTextPromptBlock(block) && (typeof block.path === "string" || typeof block.hostPath === "string")
3498
- );
3499
- }
3500
- function agentPromptPastedTextBlocks(content) {
3501
- return normalizeAgentPromptContentBlocks(content).filter(
3502
- (block) => isPastedTextPromptBlock(block) && typeof block.path === "string"
3503
- );
3504
- }
3505
3519
  function promptItemBlocksForProviderSkills(input) {
3506
3520
  const result = [];
3507
3521
  for (const skill of input.skills) {
@@ -3630,17 +3644,6 @@ function agentPromptImageBlockToDraftImage(image, idPrefix, index) {
3630
3644
  previewUrl: typeof image.data === "string" && image.data ? `data:${image.mimeType};base64,${image.data}` : image.url ?? image.path ?? ""
3631
3645
  };
3632
3646
  }
3633
- function agentPromptFileBlockToDraftFile(file, idPrefix, index) {
3634
- return {
3635
- id: `${idPrefix}:file:${index}`,
3636
- name: file.name?.trim() || `file-${index + 1}`,
3637
- mimeType: file.mimeType,
3638
- path: file.path,
3639
- hostPath: file.hostPath,
3640
- assetId: file.assetId,
3641
- sizeBytes: file.sizeBytes
3642
- };
3643
- }
3644
3647
 
3645
3648
  // shared/agentConversation/projection/agentConversationUserProjection.ts
3646
3649
  function projectConversationUserRow(message, fallbackTurnId, workspaceId) {
@@ -5743,6 +5746,7 @@ function AgentVisibleErrorMessage({
5743
5746
  onExternalLink
5744
5747
  }) {
5745
5748
  "use memo";
5749
+ const openAgentEnvPanel = useOpenAgentEnvPanel();
5746
5750
  const error = message.visibleError;
5747
5751
  const detail = error?.detail?.trim() ?? "";
5748
5752
  const providerLabel = workspaceAgentProviderLabel(
@@ -5774,7 +5778,7 @@ function AgentVisibleErrorMessage({
5774
5778
  }
5775
5779
  ) : null
5776
5780
  ] }),
5777
- actionKey && (focus || externalUrl && onExternalLink) ? /* @__PURE__ */ jsx8(
5781
+ actionKey && (focus && openAgentEnvPanel || externalUrl && onExternalLink) ? /* @__PURE__ */ jsx8(
5778
5782
  Button,
5779
5783
  {
5780
5784
  type: "button",
@@ -5786,7 +5790,7 @@ function AgentVisibleErrorMessage({
5786
5790
  onExternalLink?.(externalUrl);
5787
5791
  return;
5788
5792
  }
5789
- if (focus) {
5793
+ if (focus && openAgentEnvPanel) {
5790
5794
  openAgentEnvPanel({
5791
5795
  provider: error?.provider ?? null,
5792
5796
  focus
@@ -14500,4 +14504,4 @@ export {
14500
14504
  AgentConversationFlow,
14501
14505
  useProjectedAgentConversation
14502
14506
  };
14503
- //# sourceMappingURL=chunk-JZS4SWFJ.js.map
14507
+ //# sourceMappingURL=chunk-JI5KND3K.js.map