@salesforce/metadata-core-sdk 1.6.0 → 1.8.0

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 (45) hide show
  1. package/dist/index.d.ts +3 -3
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/sdk/contracts/core/IMetadataParser.d.ts +17 -0
  6. package/dist/sdk/contracts/core/IMetadataParser.d.ts.map +1 -1
  7. package/dist/sdk/contracts/types/MetadataPluginInfo.d.ts +39 -9
  8. package/dist/sdk/contracts/types/MetadataPluginInfo.d.ts.map +1 -1
  9. package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.css +5 -0
  10. package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.d.ts.map +1 -1
  11. package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js +39 -2
  12. package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js.map +1 -1
  13. package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.d.ts.map +1 -1
  14. package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js +3 -6
  15. package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js.map +1 -1
  16. package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.css +460 -0
  17. package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.d.ts +65 -0
  18. package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.d.ts.map +1 -0
  19. package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.js +456 -0
  20. package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.js.map +1 -0
  21. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.d.ts +19 -0
  22. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.d.ts.map +1 -0
  23. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.js +23 -0
  24. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.js.map +1 -0
  25. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.d.ts +8 -0
  26. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.d.ts.map +1 -0
  27. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.js +33 -0
  28. package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.js.map +1 -0
  29. package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.d.ts +12 -0
  30. package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.d.ts.map +1 -0
  31. package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.js +29 -0
  32. package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.js.map +1 -0
  33. package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts +10 -0
  34. package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts.map +1 -1
  35. package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js +154 -9
  36. package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js.map +1 -1
  37. package/dist/sdk/utils/HostCommunicationUtils.d.ts +30 -1
  38. package/dist/sdk/utils/HostCommunicationUtils.d.ts.map +1 -1
  39. package/dist/sdk/utils/HostCommunicationUtils.js +78 -3
  40. package/dist/sdk/utils/HostCommunicationUtils.js.map +1 -1
  41. package/dist/sdk/webviewMessageTypes.d.ts +69 -12
  42. package/dist/sdk/webviewMessageTypes.d.ts.map +1 -1
  43. package/dist/sdk/webviewMessageTypes.js +4 -0
  44. package/dist/sdk/webviewMessageTypes.js.map +1 -1
  45. package/package.json +1 -1
@@ -14,6 +14,8 @@ export declare const WebviewMessageType: {
14
14
  readonly PLUGIN_ERROR: "PLUGIN_ERROR";
15
15
  /** Retry visualization after error */
16
16
  readonly RETRY_VISUALIZATION: "RETRY_VISUALIZATION";
17
+ /** Close the correlated visualizer panel */
18
+ readonly CLOSE_VISUALIZER: "CLOSE_VISUALIZER";
17
19
  /** Copy stack trace to clipboard */
18
20
  readonly COPY_STACK_TRACE: "COPY_STACK_TRACE";
19
21
  /** Open settings panel */
@@ -31,6 +33,8 @@ export declare const WebviewMessageType: {
31
33
  * platform embeds.
32
34
  */
33
35
  readonly SUBMIT_EDIT: "SUBMIT_EDIT";
36
+ /** Host reports the outcome of a correlated VS Code edit submission. */
37
+ readonly SUBMIT_EDIT_RESULT: "SUBMIT_EDIT_RESULT";
34
38
  };
35
39
  export type WebviewMessageTypeValue = (typeof WebviewMessageType)[keyof typeof WebviewMessageType];
36
40
  /**
@@ -41,16 +45,26 @@ export type WebviewMessageTypeValue = (typeof WebviewMessageType)[keyof typeof W
41
45
  * call sites that don't know the shape (host-side message routing, etc.)
42
46
  * keep working unchanged.
43
47
  */
48
+ export type PluginDataContext = {
49
+ kind: 'file';
50
+ filePath: string;
51
+ fileName: string;
52
+ } | {
53
+ kind: 'payload';
54
+ pluginId: string;
55
+ };
44
56
  export interface PluginDataResponse<T = unknown> {
45
57
  /** Plugin data */
46
58
  data: T;
47
- /** Plugin context (file path, file name) */
48
- context: {
49
- filePath: string;
50
- fileName: string;
51
- };
59
+ /** Source-aware plugin context. Payloads never expose a synthetic file path. */
60
+ context: PluginDataContext;
52
61
  /** Unique file ID for tracking file changes */
53
62
  fileId: string;
63
+ /**
64
+ * Monotonic within one render and reset when a new render starts. Consumers
65
+ * must use the surrounding message's renderId as the outer ordering key.
66
+ */
67
+ revision?: number;
54
68
  /**
55
69
  * SelectionGraph (C1): the flat, normalized selectable nodes for this file,
56
70
  * emitted by the parser's optional `getSelectableNodes()`. Optional — absent
@@ -96,6 +110,21 @@ export interface SpatialContext {
96
110
  xpath?: string;
97
111
  };
98
112
  }
113
+ /**
114
+ * Where a vibe edit should land in the agent chat: a brand-new conversation, or
115
+ * a continuation of the current one. The webview composer's routing control
116
+ * produces this; the host maps it onto the Agentforce Vibes conversation
117
+ * lifecycle (a `new` target resets the session so a fresh conversation opens;
118
+ * `existing` reuses the remembered conversationId). `id`/`label` are the
119
+ * composer's own display handles — the host branches only on `kind`.
120
+ */
121
+ export type ChatTarget = {
122
+ kind: 'new';
123
+ } | {
124
+ kind: 'existing';
125
+ id: string;
126
+ label: string;
127
+ };
99
128
  /**
100
129
  * Payload for SUBMIT_EDIT: the user's instruction plus one SpatialContext per
101
130
  * selected element. The host assembles this into an agent prompt.
@@ -105,21 +134,38 @@ export interface EditRequest {
105
134
  prompt: string;
106
135
  /** Spatial context for each selected element (one entry per element). */
107
136
  attachments: SpatialContext[];
137
+ /**
138
+ * Optional chat routing for this edit. Omitted by the classic panel (web /
139
+ * Builder Central), so those hosts keep the pre-existing shape byte-for-byte;
140
+ * the VS Code composer sets it to drive new-vs-current conversation routing.
141
+ */
142
+ chatTarget?: ChatTarget;
143
+ /** Stable SelectionGraph ids for host-side reconstruction in trusted hosts. */
144
+ selectionIds?: string[];
108
145
  }
109
146
  /**
110
147
  * Result of a host's attempt to deliver an EditRequest to the embedded agent.
111
148
  *
112
- * `channel` records which delivery mechanism actually fired (see the fallback
113
- * chain in the design doc): the Agentforce Vibes inject command, the standard
114
- * chat command, or the universal clipboard floor.
149
+ * Delivery is a single stream channel — an auto-run Agentforce Vibes submission
150
+ * (`vibes.submit`). There is no fallback: `channel` is `'vibes.submit'` on
151
+ * success, or `'none'` when the edit could not be delivered (Vibes unavailable
152
+ * after retries, or a terminal rejection) — in which case the host surfaces an
153
+ * error to the user.
115
154
  */
116
155
  export interface EditHandoffResult {
117
- /** Whether the request was delivered to (or staged for) the agent. */
156
+ /** Whether the request was delivered to (or durably queued for) the agent. */
118
157
  delivered: boolean;
119
- /** Which delivery channel was used. */
120
- channel: 'vibes.inject' | 'chat.open' | 'clipboard' | 'none';
121
- /** Optional human-readable detail (e.g. why a channel was skipped). */
158
+ /** Which delivery channel was used (`'none'` when delivery failed). */
159
+ channel: 'vibes.submit' | 'none';
160
+ /** Optional human-readable detail (e.g. why delivery failed). */
122
161
  detail?: string;
162
+ /** Conversation created or continued by a typed Vibes acceptance. */
163
+ conversationId?: string;
164
+ }
165
+ /** A correlated VS Code result for one SUBMIT_EDIT request. */
166
+ export interface SubmitEditResult {
167
+ requestId: string;
168
+ result: EditHandoffResult;
123
169
  }
124
170
  /** Set of all valid message types for whitelist validation */
125
171
  export declare const VALID_MESSAGE_TYPES: Set<string>;
@@ -131,5 +177,16 @@ export interface WebviewMessage {
131
177
  type: WebviewMessageTypeValue;
132
178
  /** Optional payload data (type depends on message type) */
133
179
  payload?: unknown;
180
+ /**
181
+ * Host-provided render correlation identifier.
182
+ *
183
+ * Optional in the platform-neutral contract because browser hosts do not yet
184
+ * implement render correlation. The VS Code bootstrap stamps this value onto
185
+ * every outbound message and filters scoped responses against its immutable
186
+ * expected value.
187
+ */
188
+ renderId?: string;
189
+ /** Correlates a request/response pair when the host supports acknowledgements. */
190
+ requestId?: string;
134
191
  }
135
192
  //# sourceMappingURL=webviewMessageTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webviewMessageTypes.d.ts","sourceRoot":"","sources":["../../src/sdk/webviewMessageTypes.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;GAGG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E,eAAO,MAAM,kBAAkB;IAC7B,sEAAsE;;IAEtE,sCAAsC;;IAEtC,oCAAoC;;IAEpC,0BAA0B;;IAG1B,4CAA4C;;IAG5C,qEAAqE;;IAGrE,8EAA8E;;IAG9E;;;;;OAKG;;CAEK,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAEnG;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,OAAO;IAC7C,kBAAkB;IAClB,IAAI,EAAE,CAAC,CAAC;IACR,4CAA4C;IAC5C,OAAO,EAAE;QACP,QAAQ,EAAE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M,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -9,6 +9,8 @@ export const WebviewMessageType = {
9
9
  PLUGIN_ERROR: 'PLUGIN_ERROR',
10
10
  /** Retry visualization after error */
11
11
  RETRY_VISUALIZATION: 'RETRY_VISUALIZATION',
12
+ /** Close the correlated visualizer panel */
13
+ CLOSE_VISUALIZER: 'CLOSE_VISUALIZER',
12
14
  /** Copy stack trace to clipboard */
13
15
  COPY_STACK_TRACE: 'COPY_STACK_TRACE',
14
16
  /** Open settings panel */
@@ -26,6 +28,8 @@ export const WebviewMessageType = {
26
28
  * platform embeds.
27
29
  */
28
30
  SUBMIT_EDIT: 'SUBMIT_EDIT',
31
+ /** Host reports the outcome of a correlated VS Code edit submission. */
32
+ SUBMIT_EDIT_RESULT: 'SUBMIT_EDIT_RESULT',
29
33
  };
30
34
  /** Set of all valid message types for whitelist validation */
31
35
  export const VALID_MESSAGE_TYPES = new Set(Object.values(WebviewMessageType));
@@ -1 +1 @@
1
- {"version":3,"file":"webviewMessageTypes.js","sourceRoot":"","sources":["../../src/sdk/webviewMessageTypes.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAQJ,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,sEAAsE;IACtE,YAAY,EAAE,cAAc;IAC5B,sCAAsC;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,oCAAoC;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B;IAC1B,aAAa,EAAE,cAAc;IAE7B,4CAA4C;IAC5C,mBAAmB,EAAE,qBAAqB;IAE1C,qEAAqE;IACrE,oBAAoB,EAAE,sBAAsB;IAE5C,8EAA8E;IAC9E,kBAAkB,EAAE,oBAAoB;IAExC;;;;;OAKG;IACH,WAAW,EAAE,aAAa;CAClB,CAAC;AAgGX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"webviewMessageTypes.js","sourceRoot":"","sources":["../../src/sdk/webviewMessageTypes.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAQJ,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,sEAAsE;IACtE,YAAY,EAAE,cAAc;IAC5B,sCAAsC;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,4CAA4C;IAC5C,gBAAgB,EAAE,kBAAkB;IACpC,oCAAoC;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B;IAC1B,aAAa,EAAE,cAAc;IAE7B,4CAA4C;IAC5C,mBAAmB,EAAE,qBAAqB;IAE1C,qEAAqE;IACrE,oBAAoB,EAAE,sBAAsB;IAE5C,8EAA8E;IAC9E,kBAAkB,EAAE,oBAAoB;IAExC;;;;;OAKG;IACH,WAAW,EAAE,aAAa;IAC1B,wEAAwE;IACxE,kBAAkB,EAAE,oBAAoB;CAChC,CAAC;AAkIX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/metadata-core-sdk",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Core SDK with shared contracts and platform abstractions for visualization plugins",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",