@tutti-os/agent-gui 0.0.133 → 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 (77) hide show
  1. package/README.md +19 -5
  2. package/dist/{AgentRichTextReadonly-PEKCMRPE.js → AgentRichTextReadonly-HCKTNAYO.js} +7 -6
  3. package/dist/agent-conversation/index.d.ts +2 -2
  4. package/dist/agent-conversation/index.js +9 -9
  5. package/dist/agent-gui.d.ts +34 -6
  6. package/dist/agent-gui.js +17 -17
  7. package/dist/agent-message-center/index.js +7 -7
  8. package/dist/{agentFileMentionContracts-CWAeuL7S.d.ts → agentFileMentionContracts-B0yQizXB.d.ts} +5 -0
  9. package/dist/{agentGuiNodeTypes-B57MfwVo.d.ts → agentGuiNodeTypes-DV7KvZRe.d.ts} +6 -5
  10. package/dist/agents.d.ts +1 -1
  11. package/dist/agents.js +1 -1
  12. package/dist/app/renderer/agentactivity.css +6 -0
  13. package/dist/{chunk-GBBNYGL7.js → chunk-25VMCMAQ.js} +4 -4
  14. package/dist/{chunk-VS5BRBY6.js → chunk-5WOCGIXJ.js} +4 -1
  15. package/dist/chunk-5WOCGIXJ.js.map +1 -0
  16. package/dist/chunk-DLCZJKCA.js +1 -0
  17. package/dist/chunk-DLCZJKCA.js.map +1 -0
  18. package/dist/{chunk-QQRTUHCH.js → chunk-EU7DCT4F.js} +2 -2
  19. package/dist/{chunk-SZOTLVH6.js → chunk-GIYGO2PB.js} +2 -2
  20. package/dist/{chunk-HCRROERX.js → chunk-IN3HXYOO.js} +4 -4
  21. package/dist/{chunk-N62NVPHT.js → chunk-IYZ4GOSN.js} +4 -4
  22. package/dist/{chunk-A6NSHCRP.js → chunk-JI5KND3K.js} +54 -51
  23. package/dist/chunk-JI5KND3K.js.map +1 -0
  24. package/dist/{chunk-J4TTEMRW.js → chunk-KWGMK4IZ.js} +4 -4
  25. package/dist/{chunk-NE6H7S5Z.js → chunk-OFJNIQWR.js} +2 -2
  26. package/dist/{chunk-NE6H7S5Z.js.map → chunk-OFJNIQWR.js.map} +1 -1
  27. package/dist/{chunk-UARZZJJB.js → chunk-OI6BYC7P.js} +4 -4
  28. package/dist/{chunk-OBWM2RFE.js → chunk-QPEO4OQS.js} +308 -8
  29. package/dist/chunk-QPEO4OQS.js.map +1 -0
  30. package/dist/{chunk-XNE2ROCP.js → chunk-UA75CGAG.js} +3 -3
  31. package/dist/{chunk-PVTAFUDS.js → chunk-VGS7S7YT.js} +2 -2
  32. package/dist/{chunk-OQR3HXPF.js → chunk-VUNVGEQG.js} +7 -1
  33. package/dist/chunk-VUNVGEQG.js.map +1 -0
  34. package/dist/{chunk-IZ626FDO.js → chunk-Y5HD6XHP.js} +485 -361
  35. package/dist/chunk-Y5HD6XHP.js.map +1 -0
  36. package/dist/{chunk-KPMQGPYU.js → chunk-ZVYUTXQJ.js} +1 -1
  37. package/dist/chunk-ZVYUTXQJ.js.map +1 -0
  38. package/dist/context-mention-palette/index.d.ts +1 -1
  39. package/dist/context-mention-palette/index.js +8 -7
  40. package/dist/{contribution-BbW-kkpi.d.ts → contribution-CDdwTppn.d.ts} +2 -0
  41. package/dist/custom-mention.js +1 -0
  42. package/dist/i18n/index.d.ts +6 -0
  43. package/dist/i18n/index.js +2 -2
  44. package/dist/index.d.ts +53 -9
  45. package/dist/index.js +20 -20
  46. package/dist/index.js.map +1 -1
  47. package/dist/mention-search.d.ts +1 -1
  48. package/dist/mention-search.js +6 -5
  49. package/dist/{types-BeAVr4of.d.ts → types-ee3zJ6Cc.d.ts} +3 -0
  50. package/dist/workbench/browser-element-context/index.d.ts +37 -0
  51. package/dist/workbench/browser-element-context/index.js +750 -0
  52. package/dist/workbench/browser-element-context/index.js.map +1 -0
  53. package/dist/workbench/contribution.d.ts +1 -1
  54. package/dist/workbench/contribution.js +4 -4
  55. package/dist/workbench/index.d.ts +1 -1
  56. package/dist/workbench/index.js +4 -4
  57. package/dist/workbench/sessionTitle.js +2 -2
  58. package/dist/workbench/tool-sidebar/index.d.ts +189 -0
  59. package/dist/workbench/tool-sidebar/index.js +1492 -0
  60. package/dist/workbench/tool-sidebar/index.js.map +1 -0
  61. package/package.json +27 -12
  62. package/dist/chunk-A6NSHCRP.js.map +0 -1
  63. package/dist/chunk-IZ626FDO.js.map +0 -1
  64. package/dist/chunk-KPMQGPYU.js.map +0 -1
  65. package/dist/chunk-OBWM2RFE.js.map +0 -1
  66. package/dist/chunk-OQR3HXPF.js.map +0 -1
  67. package/dist/chunk-VS5BRBY6.js.map +0 -1
  68. /package/dist/{AgentRichTextReadonly-PEKCMRPE.js.map → AgentRichTextReadonly-HCKTNAYO.js.map} +0 -0
  69. /package/dist/{chunk-GBBNYGL7.js.map → chunk-25VMCMAQ.js.map} +0 -0
  70. /package/dist/{chunk-QQRTUHCH.js.map → chunk-EU7DCT4F.js.map} +0 -0
  71. /package/dist/{chunk-SZOTLVH6.js.map → chunk-GIYGO2PB.js.map} +0 -0
  72. /package/dist/{chunk-HCRROERX.js.map → chunk-IN3HXYOO.js.map} +0 -0
  73. /package/dist/{chunk-N62NVPHT.js.map → chunk-IYZ4GOSN.js.map} +0 -0
  74. /package/dist/{chunk-J4TTEMRW.js.map → chunk-KWGMK4IZ.js.map} +0 -0
  75. /package/dist/{chunk-UARZZJJB.js.map → chunk-OI6BYC7P.js.map} +0 -0
  76. /package/dist/{chunk-XNE2ROCP.js.map → chunk-UA75CGAG.js.map} +0 -0
  77. /package/dist/{chunk-PVTAFUDS.js.map → chunk-VGS7S7YT.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  setCurrentAgentGuiI18nRuntime,
7
7
  translate,
8
8
  translateInUiLanguage
9
- } from "./chunk-OQR3HXPF.js";
9
+ } from "./chunk-VUNVGEQG.js";
10
10
 
11
11
  // i18n/index.ts
12
12
  import React, {
@@ -68,4 +68,4 @@ export {
68
68
  AgentGuiI18nProvider,
69
69
  useTranslation
70
70
  };
71
- //# sourceMappingURL=chunk-SZOTLVH6.js.map
71
+ //# sourceMappingURL=chunk-GIYGO2PB.js.map
@@ -9,7 +9,7 @@ import {
9
9
  resolveAgentGUIConversationTitleDisplayPrompt,
10
10
  resolveAgentGuiWorkbenchHeaderTitle,
11
11
  resolveAgentGuiWorkbenchSessionTitle
12
- } from "./chunk-PVTAFUDS.js";
12
+ } from "./chunk-VGS7S7YT.js";
13
13
  import {
14
14
  createAgentGuiWorkbenchNodeStateSource,
15
15
  migrateLegacyAgentGuiWorkbenchState,
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  normalizeAgentGUIAgents,
26
26
  projectAgentGUIAgentsToInternalTargets
27
- } from "./chunk-VS5BRBY6.js";
27
+ } from "./chunk-5WOCGIXJ.js";
28
28
  import {
29
29
  agentGuiDockIconUrls
30
30
  } from "./chunk-DXT4W2SU.js";
@@ -276,7 +276,7 @@ function useAgentGuiWorkbenchBodyRenderError(nodeId) {
276
276
 
277
277
  // workbench/header.ts
278
278
  var LazyAgentRichTextReadonly = lazy(
279
- () => import("./AgentRichTextReadonly-PEKCMRPE.js").then((module) => ({
279
+ () => import("./AgentRichTextReadonly-HCKTNAYO.js").then((module) => ({
280
280
  default: module.AgentRichTextReadonly
281
281
  }))
282
282
  );
@@ -1482,4 +1482,4 @@ export {
1482
1482
  AGENT_GUI_WORKBENCH_OPEN_EXTERNAL_IMPORT_EVENT,
1483
1483
  createAgentGuiWorkbenchContribution
1484
1484
  };
1485
- //# sourceMappingURL=chunk-HCRROERX.js.map
1485
+ //# sourceMappingURL=chunk-IN3HXYOO.js.map
@@ -2,18 +2,18 @@ import {
2
2
  cn,
3
3
  resolveAgentTargetPresentation,
4
4
  useAgentTargetPresentations
5
- } from "./chunk-KPMQGPYU.js";
5
+ } from "./chunk-ZVYUTXQJ.js";
6
6
  import {
7
7
  getOptionalAgentHostApi,
8
8
  useOptionalAgentHostApi
9
- } from "./chunk-NE6H7S5Z.js";
9
+ } from "./chunk-OFJNIQWR.js";
10
10
  import {
11
11
  managedAgentRoundedIconUrl
12
12
  } from "./chunk-EDNJMG5T.js";
13
13
  import {
14
14
  translate,
15
15
  useTranslation
16
- } from "./chunk-SZOTLVH6.js";
16
+ } from "./chunk-GIYGO2PB.js";
17
17
  import {
18
18
  resolveAgentWorkspaceFileVisualKind
19
19
  } from "./chunk-PJP5BUU6.js";
@@ -3729,4 +3729,4 @@ export {
3729
3729
  AgentMessageMarkdown,
3730
3730
  CustomScrollArea
3731
3731
  };
3732
- //# sourceMappingURL=chunk-N62NVPHT.js.map
3732
+ //# sourceMappingURL=chunk-IYZ4GOSN.js.map
@@ -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
9
  resolveAgentErrorPresentation,
10
10
  useOpenAgentEnvPanel
11
11
  } from "./chunk-FM42UN2J.js";
12
- import {
13
- AGENT_PASTED_TEXT_BLOCK_KIND,
14
- AGENT_PASTED_TEXT_MENTION_KIND
15
- } from "./chunk-FGLQZ6I4.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-N62NVPHT.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) {
@@ -14501,4 +14504,4 @@ export {
14501
14504
  AgentConversationFlow,
14502
14505
  useProjectedAgentConversation
14503
14506
  };
14504
- //# sourceMappingURL=chunk-A6NSHCRP.js.map
14507
+ //# sourceMappingURL=chunk-JI5KND3K.js.map