@tutti-os/agent-gui 0.0.146 → 0.0.147

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/README.md CHANGED
@@ -49,15 +49,20 @@ contract; it is not a pasted-text or external-file capability signal.
49
49
 
50
50
  ## External File Preparation
51
51
 
52
- OS clipboard and drop files use the required workspace
53
- `prepareExternalPromptFiles` host port. AgentGUI owns classification, pending
54
- mentions, and draft reconciliation. The host owns native-path lookup, size
55
- enforcement, persistence, and remote transport.
56
-
57
- The preparer returns one result per input `sourceIndex`. Prepared files require
58
- a provider-readable `path` or `url`; failures require a typed `errorCode`.
59
- Hosts must isolate per-file failures and reject oversized inputs before reading
60
- or persisting their bytes.
52
+ OS clipboard and drop entries first use the optional synchronous workspace
53
+ `resolveExternalPromptEntries` host port. The host classifies every input as a
54
+ live `WorkspaceFileReference` or a snapshot that needs preparation. AgentGUI
55
+ inserts references directly as ordinary file/folder mentions, preserves mixed
56
+ input order, and sends only `prepare` entries to `prepareExternalPromptFiles`.
57
+ Without the resolver, every input uses preparation.
58
+
59
+ Both ports return one result per input `sourceIndex`. The resolver is
60
+ synchronous so paste/drop insertion position remains stable. Prepared files
61
+ require a provider-readable `path` or `url`; failures require a typed
62
+ `errorCode`. Hosts must isolate per-file failures and reject oversized inputs
63
+ before reading or persisting their bytes. A host that resolves path-backed
64
+ entries as references must also reject any such entry that unexpectedly reaches
65
+ preparation, preventing a resolver failure from creating a duplicate snapshot.
61
66
 
62
67
  Slash commands come from the runtime session command snapshot. AgentGUI keeps
63
68
  legacy provider-default slash entries unless the host passes
@@ -492,6 +492,16 @@ interface AgentGUIAccountMenuState {
492
492
  onOpenExternal(url: string): void;
493
493
  }
494
494
 
495
+ type AgentExternalPromptEntryResolution = {
496
+ disposition: "reference";
497
+ reference: WorkspaceFileReference;
498
+ sourceIndex: number;
499
+ } | {
500
+ disposition: "prepare";
501
+ sourceIndex: number;
502
+ };
503
+ type AgentExternalPromptEntryResolver = (files: readonly File[]) => readonly AgentExternalPromptEntryResolution[];
504
+
495
505
  interface AgentPreparedExternalPromptFileMetadata {
496
506
  assetId?: string;
497
507
  mimeType?: string;
@@ -826,6 +836,7 @@ interface AgentComposerProps {
826
836
  }) => void;
827
837
  onLinkAction?: (action: WorkspaceLinkAction) => void;
828
838
  onRequestWorkspaceReferences?: ((entity?: AgentContextMentionItem | null) => Promise<WorkspaceReferencePickResult>) | null;
839
+ resolveExternalPromptEntries?: AgentExternalPromptEntryResolver | null;
829
840
  prepareExternalPromptFiles?: AgentExternalPromptFilePreparer | null;
830
841
  promptAssetLimit?: number | null;
831
842
  selectProjectDirectory?: () => Promise<{
@@ -994,6 +1005,7 @@ interface AgentGUINodeWorkspace {
994
1005
  selectProjectDirectory?: () => Promise<{
995
1006
  path: string;
996
1007
  } | null>;
1008
+ resolveExternalPromptEntries?: AgentComposerProps["resolveExternalPromptEntries"];
997
1009
  prepareExternalPromptFiles?: AgentComposerProps["prepareExternalPromptFiles"];
998
1010
  promptAssetLimit?: number | null;
999
1011
  referenceSourceAggregator?: ReferenceSourceAggregator | null;
package/dist/agent-gui.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AgentGUI
3
- } from "./chunk-4WSWPMV7.js";
3
+ } from "./chunk-LWXHBRDO.js";
4
4
  import "./chunk-A4WCTHWS.js";
5
5
  import "./chunk-ZF65NZ4B.js";
6
6
  import "./chunk-TUWQV2MC.js";