@tutti-os/agent-gui 0.0.25 → 0.0.27

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/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  skillDescriptionForDisplay,
37
37
  skillTriggerForPrefix,
38
38
  useProjectedAgentConversation
39
- } from "./chunk-3QDLVPMJ.js";
39
+ } from "./chunk-MLHARLOS.js";
40
40
  import {
41
41
  AgentMessageMarkdown,
42
42
  ZoomableImage,
@@ -17059,6 +17059,7 @@ var MENTION_PALETTE_MIN_HEIGHT_PX = 280;
17059
17059
  var MENTION_PALETTE_MAX_HEIGHT_PX = 320;
17060
17060
  var MENTION_PALETTE_GAP_PX = 8;
17061
17061
  var MENTION_PALETTE_VIEWPORT_PADDING_PX = 8;
17062
+ var promptFileUploadUnsupportedError = "Prompt file uploads are not supported by this agent runtime.";
17062
17063
  var EMPTY_CONTEXT_MENTION_PROVIDERS = [];
17063
17064
  var EMPTY_PROMPT_TIPS = [];
17064
17065
  var EMPTY_PROVIDER_SKILLS = [];
@@ -17585,7 +17586,9 @@ function AgentComposer({
17585
17586
  const canSubmitWhileSending = canQueueWhileBusy && isSendingTurn;
17586
17587
  const hasUploadingImages = draftImages.some((image) => image.uploading);
17587
17588
  const hasFailedImages = draftImages.some((image) => image.uploadError);
17588
- if (isSelectedProjectMissing || submitDisabled || hasUploadingImages || hasFailedImages || disabled && !canQueueWhileBusy || isSendingTurn && !canSubmitWhileSending) {
17589
+ const hasUploadingFiles = draftFiles.some((file) => file.uploading);
17590
+ const hasFailedFiles = draftFiles.some((file) => file.uploadError);
17591
+ if (isSelectedProjectMissing || submitDisabled || hasUploadingImages || hasFailedImages || hasUploadingFiles || hasFailedFiles || disabled && !canQueueWhileBusy || isSendingTurn && !canSubmitWhileSending) {
17589
17592
  return;
17590
17593
  }
17591
17594
  const nextPrompt = draftPromptRef.current;
@@ -18053,7 +18056,8 @@ function AgentComposer({
18053
18056
  name: attachment.name,
18054
18057
  mimeType: attachment.mimeType?.trim() || "application/octet-stream",
18055
18058
  hostPath: attachment.hostPath,
18056
- uploading: Boolean(uploadPromptContent)
18059
+ uploading: Boolean(uploadPromptContent),
18060
+ ...uploadPromptContent ? {} : { uploadError: promptFileUploadUnsupportedError }
18057
18061
  }));
18058
18062
  const nextDraftFiles = [...draftFilesRef.current, ...nextFiles];
18059
18063
  draftFilesRef.current = nextDraftFiles;
@@ -18405,6 +18409,8 @@ function AgentComposer({
18405
18409
  const hasDraftContent = agentComposerDraftHasContent(draftContent);
18406
18410
  const hasUploadingDraftImages = draftImages.some((image) => image.uploading);
18407
18411
  const hasFailedDraftImages = draftImages.some((image) => image.uploadError);
18412
+ const hasUploadingDraftFiles = draftFiles.some((file) => file.uploading);
18413
+ const hasFailedDraftFiles = draftFiles.some((file) => file.uploadError);
18408
18414
  const isQueueMode = canQueueWhileBusy && hasDraftContent;
18409
18415
  const shouldShowStopButton = showStopButton && !isQueueMode;
18410
18416
  const sendButtonState = isQueueMode ? "queue" : shouldShowStopButton ? isInterrupting ? "stopping" : "interrupt" : isSendingTurn ? "loading" : "send";
@@ -19043,7 +19049,7 @@ function AgentComposer({
19043
19049
  type: "submit",
19044
19050
  className: AgentGUINode_styles_default.composerSendButton,
19045
19051
  "data-state": sendButtonState,
19046
- disabled: isSelectedProjectMissing || submitDisabled || !hasDraftContent || hasUploadingDraftImages || hasFailedDraftImages || sendButtonBusy,
19052
+ disabled: isSelectedProjectMissing || submitDisabled || !hasDraftContent || hasUploadingDraftImages || hasFailedDraftImages || hasUploadingDraftFiles || hasFailedDraftFiles || sendButtonBusy,
19047
19053
  "aria-label": labels.send,
19048
19054
  title: labels.send,
19049
19055
  "aria-busy": sendButtonBusy,
@@ -19739,10 +19745,17 @@ function AgentGUINodeView({
19739
19745
  displayName: hostLocalFileLabel,
19740
19746
  hasChildren: true
19741
19747
  };
19748
+ let hostProvidedLocalFileSource = false;
19742
19749
  return {
19743
19750
  ...referenceSourceAggregator,
19744
19751
  async listSources(scope) {
19745
19752
  const sources = await referenceSourceAggregator.listSources(scope);
19753
+ hostProvidedLocalFileSource = sources.some(
19754
+ (source) => source.sourceId === sourceId
19755
+ );
19756
+ if (hostProvidedLocalFileSource) {
19757
+ return sources;
19758
+ }
19746
19759
  return [
19747
19760
  ...sources,
19748
19761
  {
@@ -19761,16 +19774,19 @@ function AgentGUINodeView({
19761
19774
  },
19762
19775
  async listRoot(scope) {
19763
19776
  const root = await referenceSourceAggregator.listRoot(scope);
19777
+ if (hostProvidedLocalFileSource) {
19778
+ return root;
19779
+ }
19764
19780
  return [...root, rootNode];
19765
19781
  },
19766
19782
  async listChildren(scope, node, input) {
19767
- if (node.sourceId === sourceId) {
19783
+ if (node.sourceId === sourceId && !hostProvidedLocalFileSource) {
19768
19784
  return { entries: [actionNode], nextCursor: null };
19769
19785
  }
19770
19786
  return await referenceSourceAggregator.listChildren(scope, node, input);
19771
19787
  },
19772
19788
  async search(scope, currentSourceId, input) {
19773
- if (currentSourceId === sourceId) {
19789
+ if (currentSourceId === sourceId && !hostProvidedLocalFileSource) {
19774
19790
  return { entries: [], nextCursor: null };
19775
19791
  }
19776
19792
  return await referenceSourceAggregator.search(
@@ -19780,19 +19796,19 @@ function AgentGUINodeView({
19780
19796
  );
19781
19797
  },
19782
19798
  async open(scope, node) {
19783
- if (node.ref.sourceId === sourceId) {
19799
+ if (node.ref.sourceId === sourceId && !hostProvidedLocalFileSource) {
19784
19800
  return;
19785
19801
  }
19786
19802
  await referenceSourceAggregator.open(scope, node);
19787
19803
  },
19788
19804
  async readPreview(scope, node) {
19789
- if (node.ref.sourceId === sourceId) {
19805
+ if (node.ref.sourceId === sourceId && !hostProvidedLocalFileSource) {
19790
19806
  return null;
19791
19807
  }
19792
19808
  return await referenceSourceAggregator.readPreview(scope, node);
19793
19809
  },
19794
19810
  resolveSelection(node) {
19795
- if (node.ref.sourceId === sourceId) {
19811
+ if (node.ref.sourceId === sourceId && !hostProvidedLocalFileSource) {
19796
19812
  return {
19797
19813
  path: hostLocalFileActionPath,
19798
19814
  kind: "file",
@@ -19802,7 +19818,7 @@ function AgentGUINodeView({
19802
19818
  return referenceSourceAggregator.resolveSelection(node);
19803
19819
  },
19804
19820
  async locateTarget(scope, currentSourceId, params) {
19805
- if (currentSourceId === sourceId) {
19821
+ if (currentSourceId === sourceId && !hostProvidedLocalFileSource) {
19806
19822
  return null;
19807
19823
  }
19808
19824
  return await referenceSourceAggregator.locateTarget(
@@ -19812,7 +19828,7 @@ function AgentGUINodeView({
19812
19828
  );
19813
19829
  },
19814
19830
  getLoadedSource(currentSourceId) {
19815
- if (currentSourceId === sourceId) {
19831
+ if (currentSourceId === sourceId && !hostProvidedLocalFileSource) {
19816
19832
  return void 0;
19817
19833
  }
19818
19834
  return referenceSourceAggregator.getLoadedSource(currentSourceId);