@vetta-org/plugin-sdk 0.0.3 → 0.1.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 (89) hide show
  1. package/dist/activity-tab.d.ts +18 -0
  2. package/dist/activity-tab.d.ts.map +1 -0
  3. package/dist/activity-tab.js +12 -0
  4. package/dist/activity-tab.js.map +1 -0
  5. package/dist/agent.d.ts +211 -0
  6. package/dist/agent.d.ts.map +1 -0
  7. package/dist/agent.js +2 -0
  8. package/dist/agent.js.map +1 -0
  9. package/dist/app-actions.d.ts +63 -0
  10. package/dist/app-actions.d.ts.map +1 -0
  11. package/dist/app-actions.js +12 -0
  12. package/dist/app-actions.js.map +1 -0
  13. package/dist/command.d.ts +25 -0
  14. package/dist/command.d.ts.map +1 -0
  15. package/dist/command.js +2 -0
  16. package/dist/command.js.map +1 -0
  17. package/dist/context.d.ts +47 -0
  18. package/dist/context.d.ts.map +1 -0
  19. package/dist/context.js +4 -0
  20. package/dist/context.js.map +1 -0
  21. package/dist/conversation.d.ts +56 -0
  22. package/dist/conversation.d.ts.map +1 -0
  23. package/dist/conversation.js +2 -0
  24. package/dist/conversation.js.map +1 -0
  25. package/dist/disposable.d.ts +4 -0
  26. package/dist/disposable.d.ts.map +1 -0
  27. package/dist/disposable.js +2 -0
  28. package/dist/disposable.js.map +1 -0
  29. package/dist/fs.d.ts +43 -0
  30. package/dist/fs.d.ts.map +1 -0
  31. package/dist/fs.js +2 -0
  32. package/dist/fs.js.map +1 -0
  33. package/dist/hooks.d.ts +37 -0
  34. package/dist/hooks.d.ts.map +1 -0
  35. package/dist/hooks.js +39 -0
  36. package/dist/hooks.js.map +1 -0
  37. package/dist/host-bridge.d.ts +14 -0
  38. package/dist/host-bridge.d.ts.map +1 -0
  39. package/dist/host-bridge.js +12 -0
  40. package/dist/host-bridge.js.map +1 -0
  41. package/dist/i18n.d.ts +35 -0
  42. package/dist/i18n.d.ts.map +1 -0
  43. package/dist/i18n.js +29 -0
  44. package/dist/i18n.js.map +1 -0
  45. package/dist/images.d.ts +17 -0
  46. package/dist/images.d.ts.map +1 -0
  47. package/dist/images.js +2 -0
  48. package/dist/images.js.map +1 -0
  49. package/dist/index.d.ts +32 -1478
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +12 -99
  52. package/dist/index.js.map +1 -1
  53. package/dist/manifest.d.ts +57 -0
  54. package/dist/manifest.d.ts.map +1 -0
  55. package/dist/manifest.js +2 -0
  56. package/dist/manifest.js.map +1 -0
  57. package/dist/network.d.ts +38 -0
  58. package/dist/network.d.ts.map +1 -0
  59. package/dist/network.js +2 -0
  60. package/dist/network.js.map +1 -0
  61. package/dist/official.d.ts +519 -0
  62. package/dist/official.d.ts.map +1 -0
  63. package/dist/official.js +2 -0
  64. package/dist/official.js.map +1 -0
  65. package/dist/permissions.d.ts +2 -0
  66. package/dist/permissions.d.ts.map +1 -0
  67. package/dist/permissions.js +2 -0
  68. package/dist/permissions.js.map +1 -0
  69. package/dist/prompt-attachment.d.ts +15 -0
  70. package/dist/prompt-attachment.d.ts.map +1 -0
  71. package/dist/prompt-attachment.js +2 -0
  72. package/dist/prompt-attachment.js.map +1 -0
  73. package/dist/scenario.d.ts +9 -0
  74. package/dist/scenario.d.ts.map +1 -0
  75. package/dist/scenario.js +2 -0
  76. package/dist/scenario.js.map +1 -0
  77. package/dist/settings.d.ts +13 -0
  78. package/dist/settings.d.ts.map +1 -0
  79. package/dist/settings.js +2 -0
  80. package/dist/settings.js.map +1 -0
  81. package/dist/storage.d.ts +31 -0
  82. package/dist/storage.d.ts.map +1 -0
  83. package/dist/storage.js +2 -0
  84. package/dist/storage.js.map +1 -0
  85. package/dist/ui.d.ts +368 -0
  86. package/dist/ui.d.ts.map +1 -0
  87. package/dist/ui.js +2 -0
  88. package/dist/ui.js.map +1 -0
  89. package/package.json +1 -1
package/dist/fs.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ export interface PluginFsEntry {
2
+ name: string;
3
+ path: string;
4
+ isDirectory: boolean;
5
+ size: number;
6
+ modifiedAt: number;
7
+ }
8
+ export interface PluginFsFileRef {
9
+ name: string;
10
+ path: string;
11
+ relPath: string;
12
+ }
13
+ export interface PluginFsStatResult {
14
+ size: number;
15
+ modifiedAt: number;
16
+ createdAt: number;
17
+ }
18
+ export interface PluginFsReadResult {
19
+ content: string;
20
+ encoding: "utf8" | "base64";
21
+ }
22
+ export interface PluginFsBinaryReadResult {
23
+ data: string;
24
+ mimeType: string;
25
+ size: number;
26
+ }
27
+ export interface PluginFsApi {
28
+ readDir(dirPath: string): Promise<PluginFsEntry[]>;
29
+ readFile(filePath: string): Promise<PluginFsReadResult>;
30
+ readBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;
31
+ /** Pass `encoding: "base64"` to write binary payloads (decoded from base64 text). */
32
+ writeFile(filePath: string, content: string, encoding?: "utf8" | "base64"): Promise<void>;
33
+ stat(filePath: string): Promise<PluginFsStatResult | null>;
34
+ rename(oldPath: string, newPath: string): Promise<void>;
35
+ delete(targetPath: string): Promise<void>;
36
+ move(sourcePath: string, destDir: string): Promise<void>;
37
+ createDirectory(dirPath: string): Promise<void>;
38
+ listFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;
39
+ /** Watch one directory for host-debounced changes. Requires `fs.read`. */
40
+ watchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;
41
+ }
42
+ import type { Disposable } from "./disposable.js";
43
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACpE,qFAAqF;IACrF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACjE,0EAA0E;IAC1E,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;CACrF;AACD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export interface PluginFsEntry {\n\tname: string;\n\tpath: string;\n\tisDirectory: boolean;\n\tsize: number;\n\tmodifiedAt: number;\n}\n\nexport interface PluginFsFileRef {\n\tname: string;\n\tpath: string;\n\trelPath: string;\n}\n\nexport interface PluginFsStatResult {\n\tsize: number;\n\tmodifiedAt: number;\n\tcreatedAt: number;\n}\n\nexport interface PluginFsReadResult {\n\tcontent: string;\n\tencoding: \"utf8\" | \"base64\";\n}\n\nexport interface PluginFsBinaryReadResult {\n\tdata: string;\n\tmimeType: string;\n\tsize: number;\n}\n\nexport interface PluginFsApi {\n\treadDir(dirPath: string): Promise<PluginFsEntry[]>;\n\treadFile(filePath: string): Promise<PluginFsReadResult>;\n\treadBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;\n\t/** Pass `encoding: \"base64\"` to write binary payloads (decoded from base64 text). */\n\twriteFile(filePath: string, content: string, encoding?: \"utf8\" | \"base64\"): Promise<void>;\n\tstat(filePath: string): Promise<PluginFsStatResult | null>;\n\trename(oldPath: string, newPath: string): Promise<void>;\n\tdelete(targetPath: string): Promise<void>;\n\tmove(sourcePath: string, destDir: string): Promise<void>;\n\tcreateDirectory(dirPath: string): Promise<void>;\n\tlistFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;\n\t/** Watch one directory for host-debounced changes. Requires `fs.read`. */\n\twatchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;\n}\nimport type { Disposable } from \"./disposable.js\";\n"]}
package/dist/fs.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fs.js.map
package/dist/fs.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginFsEntry {\n\tname: string;\n\tpath: string;\n\tisDirectory: boolean;\n\tsize: number;\n\tmodifiedAt: number;\n}\n\nexport interface PluginFsFileRef {\n\tname: string;\n\tpath: string;\n\trelPath: string;\n}\n\nexport interface PluginFsStatResult {\n\tsize: number;\n\tmodifiedAt: number;\n\tcreatedAt: number;\n}\n\nexport interface PluginFsReadResult {\n\tcontent: string;\n\tencoding: \"utf8\" | \"base64\";\n}\n\nexport interface PluginFsBinaryReadResult {\n\tdata: string;\n\tmimeType: string;\n\tsize: number;\n}\n\nexport interface PluginFsApi {\n\treadDir(dirPath: string): Promise<PluginFsEntry[]>;\n\treadFile(filePath: string): Promise<PluginFsReadResult>;\n\treadBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;\n\t/** Pass `encoding: \"base64\"` to write binary payloads (decoded from base64 text). */\n\twriteFile(filePath: string, content: string, encoding?: \"utf8\" | \"base64\"): Promise<void>;\n\tstat(filePath: string): Promise<PluginFsStatResult | null>;\n\trename(oldPath: string, newPath: string): Promise<void>;\n\tdelete(targetPath: string): Promise<void>;\n\tmove(sourcePath: string, destDir: string): Promise<void>;\n\tcreateDirectory(dirPath: string): Promise<void>;\n\tlistFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;\n\t/** Watch one directory for host-debounced changes. Requires `fs.read`. */\n\twatchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;\n}\nimport type { Disposable } from \"./disposable.js\";\n"]}
@@ -0,0 +1,37 @@
1
+ import type { ConversationMessage, ConversationState } from "./conversation.js";
2
+ import type { PluginLocales, PluginTranslate } from "./i18n.js";
3
+ import type { PluginPromptAttachment } from "./prompt-attachment.js";
4
+ export interface PluginI18nContextValue {
5
+ /** This plugin's catalogs, keyed by locale code. */
6
+ locales: PluginLocales;
7
+ /** Fallback locale when a key is missing in the current locale. */
8
+ defaultLocale: string;
9
+ }
10
+ /**
11
+ * Internal: the host wraps plugin-rendered components in this context's Provider,
12
+ * carrying THIS plugin's catalogs. Module Federation shares this single SDK
13
+ * instance, so the value the host provides is visible to {@link useTranslation}.
14
+ */
15
+ export declare const __PluginI18nContext: import("react").Context<PluginI18nContextValue>;
16
+ export interface PluginTranslation {
17
+ /** The host's current locale code (e.g. "zh"). */
18
+ locale: string;
19
+ /** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */
20
+ t: PluginTranslate;
21
+ }
22
+ /**
23
+ * Reactive translation for plugin React components — re-renders when the host
24
+ * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against
25
+ * THIS plugin's catalogs; the host provides them via __PluginI18nContext.
26
+ */
27
+ export declare function useTranslation(): PluginTranslation;
28
+ /** Reactive: the currently-active conversation's state. */
29
+ export declare function useActiveConversation(): ConversationState;
30
+ /** Reactive: the active conversation's messages. */
31
+ export declare function useConversationMessages(): ConversationMessage[];
32
+ /**
33
+ * Reactive: the plugin-owned one-shot context attached to the next prompt.
34
+ * Clears automatically after send, capsule close, or session switch.
35
+ */
36
+ export declare function usePromptAttachment(): PluginPromptAttachment | null;
37
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIrE,MAAM,WAAW,sBAAsB;IACtC,oDAAoD;IACpD,OAAO,EAAE,aAAa,CAAC;IACvB,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iDAG9B,CAAC;AAEH,MAAM,WAAW,iBAAiB;IACjC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,CAAC,EAAE,eAAe,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,CAQlD;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,IAAI,iBAAiB,CAEzD;AAED,oDAAoD;AACpD,wBAAgB,uBAAuB,IAAI,mBAAmB,EAAE,CAE/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,sBAAsB,GAAG,IAAI,CAEnE","sourcesContent":["import { createContext, useCallback, useContext } from \"react\";\nimport type { ConversationMessage, ConversationState } from \"./conversation.js\";\nimport { requireBridge } from \"./host-bridge.js\";\nimport type { PluginLocales, PluginTranslate } from \"./i18n.js\";\nimport { resolveCatalogKey } from \"./i18n.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── i18n context (host-provided, per plugin) ───\n\nexport interface PluginI18nContextValue {\n\t/** This plugin's catalogs, keyed by locale code. */\n\tlocales: PluginLocales;\n\t/** Fallback locale when a key is missing in the current locale. */\n\tdefaultLocale: string;\n}\n\n/**\n * Internal: the host wraps plugin-rendered components in this context's Provider,\n * carrying THIS plugin's catalogs. Module Federation shares this single SDK\n * instance, so the value the host provides is visible to {@link useTranslation}.\n */\nexport const __PluginI18nContext = createContext<PluginI18nContextValue>({\n\tlocales: {},\n\tdefaultLocale: \"zh\",\n});\n\nexport interface PluginTranslation {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\tlocale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n}\n\n/**\n * Reactive translation for plugin React components — re-renders when the host\n * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * THIS plugin's catalogs; the host provides them via __PluginI18nContext.\n */\nexport function useTranslation(): PluginTranslation {\n\tconst locale = requireBridge().useLocale();\n\tconst { locales, defaultLocale } = useContext(__PluginI18nContext);\n\tconst t = useCallback<PluginTranslate>(\n\t\t(key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params),\n\t\t[locales, locale, defaultLocale],\n\t);\n\treturn { locale, t };\n}\n\n/** Reactive: the currently-active conversation's state. */\nexport function useActiveConversation(): ConversationState {\n\treturn requireBridge().useActiveConversation();\n}\n\n/** Reactive: the active conversation's messages. */\nexport function useConversationMessages(): ConversationMessage[] {\n\treturn requireBridge().useConversationMessages();\n}\n\n/**\n * Reactive: the plugin-owned one-shot context attached to the next prompt.\n * Clears automatically after send, capsule close, or session switch.\n */\nexport function usePromptAttachment(): PluginPromptAttachment | null {\n\treturn requireBridge().usePromptAttachment();\n}\n"]}
package/dist/hooks.js ADDED
@@ -0,0 +1,39 @@
1
+ import { createContext, useCallback, useContext } from "react";
2
+ import { requireBridge } from "./host-bridge.js";
3
+ import { resolveCatalogKey } from "./i18n.js";
4
+ /**
5
+ * Internal: the host wraps plugin-rendered components in this context's Provider,
6
+ * carrying THIS plugin's catalogs. Module Federation shares this single SDK
7
+ * instance, so the value the host provides is visible to {@link useTranslation}.
8
+ */
9
+ export const __PluginI18nContext = createContext({
10
+ locales: {},
11
+ defaultLocale: "zh",
12
+ });
13
+ /**
14
+ * Reactive translation for plugin React components — re-renders when the host
15
+ * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against
16
+ * THIS plugin's catalogs; the host provides them via __PluginI18nContext.
17
+ */
18
+ export function useTranslation() {
19
+ const locale = requireBridge().useLocale();
20
+ const { locales, defaultLocale } = useContext(__PluginI18nContext);
21
+ const t = useCallback((key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params), [locales, locale, defaultLocale]);
22
+ return { locale, t };
23
+ }
24
+ /** Reactive: the currently-active conversation's state. */
25
+ export function useActiveConversation() {
26
+ return requireBridge().useActiveConversation();
27
+ }
28
+ /** Reactive: the active conversation's messages. */
29
+ export function useConversationMessages() {
30
+ return requireBridge().useConversationMessages();
31
+ }
32
+ /**
33
+ * Reactive: the plugin-owned one-shot context attached to the next prompt.
34
+ * Clears automatically after send, capsule close, or session switch.
35
+ */
36
+ export function usePromptAttachment() {
37
+ return requireBridge().usePromptAttachment();
38
+ }
39
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAY9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAyB;IACxE,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI;CACnB,CAAC,CAAC;AASH;;;;GAIG;AACH,MAAM,UAAU,cAAc,GAAsB;IACnD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,SAAS,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACnE,MAAM,CAAC,GAAG,WAAW,CACpB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAC/E,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAChC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAAA,CACrB;AAED,2DAA2D;AAC3D,MAAM,UAAU,qBAAqB,GAAsB;IAC1D,OAAO,aAAa,EAAE,CAAC,qBAAqB,EAAE,CAAC;AAAA,CAC/C;AAED,oDAAoD;AACpD,MAAM,UAAU,uBAAuB,GAA0B;IAChE,OAAO,aAAa,EAAE,CAAC,uBAAuB,EAAE,CAAC;AAAA,CACjD;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,GAAkC;IACpE,OAAO,aAAa,EAAE,CAAC,mBAAmB,EAAE,CAAC;AAAA,CAC7C","sourcesContent":["import { createContext, useCallback, useContext } from \"react\";\nimport type { ConversationMessage, ConversationState } from \"./conversation.js\";\nimport { requireBridge } from \"./host-bridge.js\";\nimport type { PluginLocales, PluginTranslate } from \"./i18n.js\";\nimport { resolveCatalogKey } from \"./i18n.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── i18n context (host-provided, per plugin) ───\n\nexport interface PluginI18nContextValue {\n\t/** This plugin's catalogs, keyed by locale code. */\n\tlocales: PluginLocales;\n\t/** Fallback locale when a key is missing in the current locale. */\n\tdefaultLocale: string;\n}\n\n/**\n * Internal: the host wraps plugin-rendered components in this context's Provider,\n * carrying THIS plugin's catalogs. Module Federation shares this single SDK\n * instance, so the value the host provides is visible to {@link useTranslation}.\n */\nexport const __PluginI18nContext = createContext<PluginI18nContextValue>({\n\tlocales: {},\n\tdefaultLocale: \"zh\",\n});\n\nexport interface PluginTranslation {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\tlocale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n}\n\n/**\n * Reactive translation for plugin React components — re-renders when the host\n * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * THIS plugin's catalogs; the host provides them via __PluginI18nContext.\n */\nexport function useTranslation(): PluginTranslation {\n\tconst locale = requireBridge().useLocale();\n\tconst { locales, defaultLocale } = useContext(__PluginI18nContext);\n\tconst t = useCallback<PluginTranslate>(\n\t\t(key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params),\n\t\t[locales, locale, defaultLocale],\n\t);\n\treturn { locale, t };\n}\n\n/** Reactive: the currently-active conversation's state. */\nexport function useActiveConversation(): ConversationState {\n\treturn requireBridge().useActiveConversation();\n}\n\n/** Reactive: the active conversation's messages. */\nexport function useConversationMessages(): ConversationMessage[] {\n\treturn requireBridge().useConversationMessages();\n}\n\n/**\n * Reactive: the plugin-owned one-shot context attached to the next prompt.\n * Clears automatically after send, capsule close, or session switch.\n */\nexport function usePromptAttachment(): PluginPromptAttachment | null {\n\treturn requireBridge().usePromptAttachment();\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { ConversationMessage, ConversationState, PluginConversationApi } from "./conversation.js";
2
+ import type { PluginPromptAttachment } from "./prompt-attachment.js";
3
+ export interface PluginHostBridge {
4
+ useActiveConversation(): ConversationState;
5
+ useConversationMessages(): ConversationMessage[];
6
+ usePromptAttachment(): PluginPromptAttachment | null;
7
+ /** Reactive: the host's current locale code (e.g. "zh"). */
8
+ useLocale(): string;
9
+ conversation: PluginConversationApi;
10
+ }
11
+ export declare function __setPluginHostBridge(bridge: PluginHostBridge): void;
12
+ /** Package-internal: throws if the host has not installed the bridge yet. */
13
+ export declare function requireBridge(): PluginHostBridge;
14
+ //# sourceMappingURL=host-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-bridge.d.ts","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAUrE,MAAM,WAAW,gBAAgB;IAChC,qBAAqB,IAAI,iBAAiB,CAAC;IAC3C,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;IACjD,mBAAmB,IAAI,sBAAsB,GAAG,IAAI,CAAC;IACrD,4DAA4D;IAC5D,SAAS,IAAI,MAAM,CAAC;IACpB,YAAY,EAAE,qBAAqB,CAAC;CACpC;AAID,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,IAAI,gBAAgB,CAKhD","sourcesContent":["import type { ConversationMessage, ConversationState, PluginConversationApi } from \"./conversation.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── Host bridge ───\n//\n// React hooks and conversation state read the host's jotai store. plugin-sdk\n// cannot depend on desktop-app, so the host injects its implementation at\n// startup (installPluginHostShim → __setPluginHostBridge). Module Federation\n// makes host and plugins share this single pluginSdk instance, so the bridge\n// the host sets is visible to the hooks the plugin calls.\n\nexport interface PluginHostBridge {\n\tuseActiveConversation(): ConversationState;\n\tuseConversationMessages(): ConversationMessage[];\n\tusePromptAttachment(): PluginPromptAttachment | null;\n\t/** Reactive: the host's current locale code (e.g. \"zh\"). */\n\tuseLocale(): string;\n\tconversation: PluginConversationApi;\n}\n\nlet hostBridge: PluginHostBridge | undefined;\n\nexport function __setPluginHostBridge(bridge: PluginHostBridge): void {\n\thostBridge = bridge;\n}\n\n/** Package-internal: throws if the host has not installed the bridge yet. */\nexport function requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ let hostBridge;
2
+ export function __setPluginHostBridge(bridge) {
3
+ hostBridge = bridge;
4
+ }
5
+ /** Package-internal: throws if the host has not installed the bridge yet. */
6
+ export function requireBridge() {
7
+ if (!hostBridge) {
8
+ throw new Error("Vetta plugin host bridge is not installed");
9
+ }
10
+ return hostBridge;
11
+ }
12
+ //# sourceMappingURL=host-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-bridge.js","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAoBA,IAAI,UAAwC,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CAAC,MAAwB,EAAQ;IACrE,UAAU,GAAG,MAAM,CAAC;AAAA,CACpB;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,GAAqB;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,UAAU,CAAC;AAAA,CAClB","sourcesContent":["import type { ConversationMessage, ConversationState, PluginConversationApi } from \"./conversation.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── Host bridge ───\n//\n// React hooks and conversation state read the host's jotai store. plugin-sdk\n// cannot depend on desktop-app, so the host injects its implementation at\n// startup (installPluginHostShim → __setPluginHostBridge). Module Federation\n// makes host and plugins share this single pluginSdk instance, so the bridge\n// the host sets is visible to the hooks the plugin calls.\n\nexport interface PluginHostBridge {\n\tuseActiveConversation(): ConversationState;\n\tuseConversationMessages(): ConversationMessage[];\n\tusePromptAttachment(): PluginPromptAttachment | null;\n\t/** Reactive: the host's current locale code (e.g. \"zh\"). */\n\tuseLocale(): string;\n\tconversation: PluginConversationApi;\n}\n\nlet hostBridge: PluginHostBridge | undefined;\n\nexport function __setPluginHostBridge(bridge: PluginHostBridge): void {\n\thostBridge = bridge;\n}\n\n/** Package-internal: throws if the host has not installed the bridge yet. */\nexport function requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n"]}
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ import type { Disposable } from "./disposable.js";
2
+ /** A flat catalog: translation key → localized string. */
3
+ export type PluginLocaleCatalog = Record<string, string>;
4
+ /** Every catalog a plugin ships, keyed by locale code (e.g. "zh", "en"). */
5
+ export type PluginLocales = Record<string, PluginLocaleCatalog>;
6
+ /** Replace `{{name}}` placeholders in a resolved string with `params`. */
7
+ export declare function interpolatePluginText(text: string, params?: Record<string, string | number>): string;
8
+ /**
9
+ * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:
10
+ * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key
11
+ * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.
12
+ */
13
+ export declare function resolveCatalogKey(key: string, locales: PluginLocales, currentLocale: string, defaultLocale: string, params?: Record<string, string | number>): string;
14
+ /**
15
+ * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a
16
+ * catalog key (resolved via {@link resolveCatalogKey}); any other string is a
17
+ * literal and returned unchanged — backwards compatible with bare strings.
18
+ */
19
+ export declare function resolvePluginText(raw: string, locales: PluginLocales, currentLocale: string, defaultLocale: string, params?: Record<string, string | number>): string;
20
+ export type PluginTranslate = (key: string, params?: Record<string, string | number>) => string;
21
+ /**
22
+ * This plugin's i18n surface on the context. `locale` always equals the host's
23
+ * current language; `t` resolves a BARE catalog key (no `%...%` wrapper) against
24
+ * this plugin's catalogs at the current locale. Imperative — for plugin React
25
+ * components prefer the reactive {@link useTranslation} hook.
26
+ */
27
+ export interface PluginI18nApi {
28
+ /** The host's current locale code (e.g. "zh"). */
29
+ readonly locale: string;
30
+ /** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */
31
+ t: PluginTranslate;
32
+ /** Fired when the host language changes. */
33
+ onChange(listener: (locale: string) => void): Disposable;
34
+ }
35
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,4DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACzD,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEhE,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAGpG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,aAAa,EACtB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACtC,MAAM,CAIR;AAID;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,aAAa,EACtB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACtC,MAAM,CAIR;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,CAAC,EAAE,eAAe,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;CACzD","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\n/** A flat catalog: translation key → localized string. */\nexport type PluginLocaleCatalog = Record<string, string>;\n/** Every catalog a plugin ships, keyed by locale code (e.g. \"zh\", \"en\"). */\nexport type PluginLocales = Record<string, PluginLocaleCatalog>;\n\n/** Replace `{{name}}` placeholders in a resolved string with `params`. */\nexport function interpolatePluginText(text: string, params?: Record<string, string | number>): string {\n\tif (!params) return text;\n\treturn text.replace(/\\{\\{(\\w+)\\}\\}/g, (match, name: string) => (name in params ? String(params[name]) : match));\n}\n\n/**\n * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:\n * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key\n * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.\n */\nexport function resolveCatalogKey(\n\tkey: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst fromCurrent = locales[currentLocale]?.[key];\n\tconst fromDefault = locales[defaultLocale]?.[key];\n\treturn interpolatePluginText(fromCurrent ?? fromDefault ?? key, params);\n}\n\nconst I18N_KEY_PATTERN = /^%([^%]+)%$/;\n\n/**\n * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a\n * catalog key (resolved via {@link resolveCatalogKey}); any other string is a\n * literal and returned unchanged — backwards compatible with bare strings.\n */\nexport function resolvePluginText(\n\traw: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst match = I18N_KEY_PATTERN.exec(raw);\n\tif (!match) return raw;\n\treturn resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);\n}\n\nexport type PluginTranslate = (key: string, params?: Record<string, string | number>) => string;\n\n/**\n * This plugin's i18n surface on the context. `locale` always equals the host's\n * current language; `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * this plugin's catalogs at the current locale. Imperative — for plugin React\n * components prefer the reactive {@link useTranslation} hook.\n */\nexport interface PluginI18nApi {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\treadonly locale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n\t/** Fired when the host language changes. */\n\tonChange(listener: (locale: string) => void): Disposable;\n}\n"]}
package/dist/i18n.js ADDED
@@ -0,0 +1,29 @@
1
+ /** Replace `{{name}}` placeholders in a resolved string with `params`. */
2
+ export function interpolatePluginText(text, params) {
3
+ if (!params)
4
+ return text;
5
+ return text.replace(/\{\{(\w+)\}\}/g, (match, name) => (name in params ? String(params[name]) : match));
6
+ }
7
+ /**
8
+ * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:
9
+ * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key
10
+ * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.
11
+ */
12
+ export function resolveCatalogKey(key, locales, currentLocale, defaultLocale, params) {
13
+ const fromCurrent = locales[currentLocale]?.[key];
14
+ const fromDefault = locales[defaultLocale]?.[key];
15
+ return interpolatePluginText(fromCurrent ?? fromDefault ?? key, params);
16
+ }
17
+ const I18N_KEY_PATTERN = /^%([^%]+)%$/;
18
+ /**
19
+ * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a
20
+ * catalog key (resolved via {@link resolveCatalogKey}); any other string is a
21
+ * literal and returned unchanged — backwards compatible with bare strings.
22
+ */
23
+ export function resolvePluginText(raw, locales, currentLocale, defaultLocale, params) {
24
+ const match = I18N_KEY_PATTERN.exec(raw);
25
+ if (!match)
26
+ return raw;
27
+ return resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);
28
+ }
29
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,MAAwC,EAAU;IACrG,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAAA,CAChH;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAChC,GAAW,EACX,OAAsB,EACtB,aAAqB,EACrB,aAAqB,EACrB,MAAwC,EAC/B;IACT,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAClD,OAAO,qBAAqB,CAAC,WAAW,IAAI,WAAW,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC;AAAA,CACxE;AAED,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAChC,GAAW,EACX,OAAsB,EACtB,aAAqB,EACrB,aAAqB,EACrB,MAAwC,EAC/B;IACT,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC;IACvB,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;AAAA,CAClF","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\n/** A flat catalog: translation key → localized string. */\nexport type PluginLocaleCatalog = Record<string, string>;\n/** Every catalog a plugin ships, keyed by locale code (e.g. \"zh\", \"en\"). */\nexport type PluginLocales = Record<string, PluginLocaleCatalog>;\n\n/** Replace `{{name}}` placeholders in a resolved string with `params`. */\nexport function interpolatePluginText(text: string, params?: Record<string, string | number>): string {\n\tif (!params) return text;\n\treturn text.replace(/\\{\\{(\\w+)\\}\\}/g, (match, name: string) => (name in params ? String(params[name]) : match));\n}\n\n/**\n * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:\n * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key\n * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.\n */\nexport function resolveCatalogKey(\n\tkey: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst fromCurrent = locales[currentLocale]?.[key];\n\tconst fromDefault = locales[defaultLocale]?.[key];\n\treturn interpolatePluginText(fromCurrent ?? fromDefault ?? key, params);\n}\n\nconst I18N_KEY_PATTERN = /^%([^%]+)%$/;\n\n/**\n * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a\n * catalog key (resolved via {@link resolveCatalogKey}); any other string is a\n * literal and returned unchanged — backwards compatible with bare strings.\n */\nexport function resolvePluginText(\n\traw: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst match = I18N_KEY_PATTERN.exec(raw);\n\tif (!match) return raw;\n\treturn resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);\n}\n\nexport type PluginTranslate = (key: string, params?: Record<string, string | number>) => string;\n\n/**\n * This plugin's i18n surface on the context. `locale` always equals the host's\n * current language; `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * this plugin's catalogs at the current locale. Imperative — for plugin React\n * components prefer the reactive {@link useTranslation} hook.\n */\nexport interface PluginI18nApi {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\treadonly locale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n\t/** Fired when the host language changes. */\n\tonChange(listener: (locale: string) => void): Disposable;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A reference to an image produced out-of-band by the host (e.g. an image
3
+ * tool's result). The bytes are NOT carried inline — `url` is a host media
4
+ * URL (Range-capable, usable directly as an `<img src>`).
5
+ */
6
+ export interface PluginImageRef {
7
+ id: string;
8
+ url: string;
9
+ mimeType?: string;
10
+ /**
11
+ * The edit-lineage root id this image belongs to (base image + all its edits
12
+ * share one rootId). Lets the host dedup per-message previews — only the
13
+ * latest message producing a given rootId renders the version swiper.
14
+ */
15
+ rootId?: string;
16
+ }
17
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB","sourcesContent":["/**\n * A reference to an image produced out-of-band by the host (e.g. an image\n * tool's result). The bytes are NOT carried inline — `url` is a host media\n * URL (Range-capable, usable directly as an `<img src>`).\n */\nexport interface PluginImageRef {\n\tid: string;\n\turl: string;\n\tmimeType?: string;\n\t/**\n\t * The edit-lineage root id this image belongs to (base image + all its edits\n\t * share one rootId). Lets the host dedup per-message previews — only the\n\t * latest message producing a given rootId renders the version swiper.\n\t */\n\trootId?: string;\n}\n"]}
package/dist/images.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.js","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A reference to an image produced out-of-band by the host (e.g. an image\n * tool's result). The bytes are NOT carried inline — `url` is a host media\n * URL (Range-capable, usable directly as an `<img src>`).\n */\nexport interface PluginImageRef {\n\tid: string;\n\turl: string;\n\tmimeType?: string;\n\t/**\n\t * The edit-lineage root id this image belongs to (base image + all its edits\n\t * share one rootId). Lets the host dedup per-message previews — only the\n\t * latest message producing a given rootId renders the version swiper.\n\t */\n\trootId?: string;\n}\n"]}