@agimon-ai/doompi-web-contracts 0.0.1-alpha.2

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 (67) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +28 -0
  3. package/dist/index.cjs +1 -0
  4. package/dist/index.d.cts +6 -0
  5. package/dist/index.d.mts +6 -0
  6. package/dist/index.mjs +1 -0
  7. package/dist/services/define.cjs +2 -0
  8. package/dist/services/define.cjs.map +1 -0
  9. package/dist/services/define.d.cts +20 -0
  10. package/dist/services/define.d.cts.map +1 -0
  11. package/dist/services/define.d.mts +20 -0
  12. package/dist/services/define.d.mts.map +1 -0
  13. package/dist/services/define.mjs +2 -0
  14. package/dist/services/define.mjs.map +1 -0
  15. package/dist/services/sessionStore.cjs +2 -0
  16. package/dist/services/sessionStore.cjs.map +1 -0
  17. package/dist/services/sessionStore.d.cts +15 -0
  18. package/dist/services/sessionStore.d.cts.map +1 -0
  19. package/dist/services/sessionStore.d.mts +15 -0
  20. package/dist/services/sessionStore.d.mts.map +1 -0
  21. package/dist/services/sessionStore.mjs +2 -0
  22. package/dist/services/sessionStore.mjs.map +1 -0
  23. package/dist/services/testing/channels.cjs +2 -0
  24. package/dist/services/testing/channels.cjs.map +1 -0
  25. package/dist/services/testing/channels.d.cts +52 -0
  26. package/dist/services/testing/channels.d.cts.map +1 -0
  27. package/dist/services/testing/channels.d.mts +52 -0
  28. package/dist/services/testing/channels.d.mts.map +1 -0
  29. package/dist/services/testing/channels.mjs +2 -0
  30. package/dist/services/testing/channels.mjs.map +1 -0
  31. package/dist/services/testing/render.cjs +2 -0
  32. package/dist/services/testing/render.cjs.map +1 -0
  33. package/dist/services/testing/render.d.cts +32 -0
  34. package/dist/services/testing/render.d.cts.map +1 -0
  35. package/dist/services/testing/render.d.mts +32 -0
  36. package/dist/services/testing/render.d.mts.map +1 -0
  37. package/dist/services/testing/render.mjs +2 -0
  38. package/dist/services/testing/render.mjs.map +1 -0
  39. package/dist/services/testing/slotProps.cjs +2 -0
  40. package/dist/services/testing/slotProps.cjs.map +1 -0
  41. package/dist/services/testing/slotProps.d.cts +57 -0
  42. package/dist/services/testing/slotProps.d.cts.map +1 -0
  43. package/dist/services/testing/slotProps.d.mts +57 -0
  44. package/dist/services/testing/slotProps.d.mts.map +1 -0
  45. package/dist/services/testing/slotProps.mjs +2 -0
  46. package/dist/services/testing/slotProps.mjs.map +1 -0
  47. package/dist/services/toolResult.cjs +7 -0
  48. package/dist/services/toolResult.cjs.map +1 -0
  49. package/dist/services/toolResult.d.cts +15 -0
  50. package/dist/services/toolResult.d.cts.map +1 -0
  51. package/dist/services/toolResult.d.mts +15 -0
  52. package/dist/services/toolResult.d.mts.map +1 -0
  53. package/dist/services/toolResult.mjs +7 -0
  54. package/dist/services/toolResult.mjs.map +1 -0
  55. package/dist/testing.cjs +1 -0
  56. package/dist/testing.d.cts +4 -0
  57. package/dist/testing.d.mts +4 -0
  58. package/dist/testing.mjs +1 -0
  59. package/dist/types/webHub.d.cts +56 -0
  60. package/dist/types/webHub.d.cts.map +1 -0
  61. package/dist/types/webHub.d.mts +56 -0
  62. package/dist/types/webHub.d.mts.map +1 -0
  63. package/dist/types/webPlugin.d.cts +343 -0
  64. package/dist/types/webPlugin.d.cts.map +1 -0
  65. package/dist/types/webPlugin.d.mts +343 -0
  66. package/dist/types/webPlugin.d.mts.map +1 -0
  67. package/package.json +85 -0
@@ -0,0 +1,57 @@
1
+ import { SlotDataFill, ToolMessageRenderProps, ToolResultView, WebPluginSlotProps } from "../../types/webPlugin.mjs";
2
+ import { ReactNode } from "react";
3
+ //#region src/services/testing/slotProps.d.ts
4
+ /**
5
+ * The props the cockpit hands a plugin's components, built for a test.
6
+ *
7
+ * A plugin component takes fifteen props and reads three of them. Written out
8
+ * by hand in each test, the other twelve are noise that goes stale the moment
9
+ * the contract grows a member; written as a cast, the component compiles
10
+ * against props the host never sends. This builds all of them, records what the
11
+ * component did with the actions, and lets a test override the two or three it
12
+ * cares about.
13
+ */
14
+ interface RecordedSlotAction {
15
+ action: 'openTab' | 'openTransientTab' | 'closeTransientTab' | 'sendSessionFrame';
16
+ /** The tab id, the transient tab's id, or the target session of a frame. */
17
+ target: string | null;
18
+ /** The frame a component sent, for `sendSessionFrame`. */
19
+ frame?: Record<string, unknown>;
20
+ }
21
+ interface SlotPropsFixture {
22
+ props: WebPluginSlotProps;
23
+ /** Everything the component did through its props, in order. */
24
+ readonly actions: readonly RecordedSlotAction[];
25
+ /** Frames the component sent, which is what most assertions want. */
26
+ frames(): readonly Record<string, unknown>[];
27
+ }
28
+ interface SlotPropsOptions {
29
+ sessionId?: string | null;
30
+ statuses?: Readonly<Record<string, string>>;
31
+ /** Component fills this slot owner should see; keyed by slot name. */
32
+ slotContent?: Readonly<Record<string, ReactNode>>;
33
+ /** Data fills this slot owner should read back, keyed by slot name. */
34
+ slotData?: Readonly<Record<string, readonly SlotDataFill[]>>;
35
+ /** What `renderThread` returns for a plugin that renders one. */
36
+ thread?: (threadId: string) => ReactNode;
37
+ }
38
+ declare function slotPropsFixture(options?: SlotPropsOptions): SlotPropsFixture;
39
+ interface ToolMessagePropsOptions extends SlotPropsOptions {
40
+ toolCallId?: string;
41
+ toolName: string;
42
+ args?: Record<string, unknown>;
43
+ /** The newest result; null is what the host sends before any output. */
44
+ result?: ToolResultView | null;
45
+ /** The result's text blocks joined, as the host's own fallback item shows them. */
46
+ output?: string;
47
+ running?: boolean;
48
+ isError?: boolean;
49
+ }
50
+ interface ToolMessagePropsFixture extends Omit<SlotPropsFixture, 'props'> {
51
+ props: ToolMessageRenderProps;
52
+ }
53
+ /** The props a tool's timeline item receives, in any of its four states. */
54
+ declare function toolMessagePropsFixture(options: ToolMessagePropsOptions): ToolMessagePropsFixture;
55
+ //#endregion
56
+ export { RecordedSlotAction, SlotPropsFixture, SlotPropsOptions, ToolMessagePropsFixture, ToolMessagePropsOptions, slotPropsFixture, toolMessagePropsFixture };
57
+ //# sourceMappingURL=slotProps.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slotProps.d.mts","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"mappings":";;;;;;;;;;;;;UAqBiB;EACf;;EAEA;;EAEA,QAAQ;;UAGO;EACf,OAAO;;WAEE,kBAAkB;;EAE3B,mBAAmB;;UAGJ;EACf;EACA,WAAW,SAAS;;EAEpB,cAAc,SAAS,eAAe;;EAEtC,WAAW,SAAS,wBAAwB;;EAE5C,UAAU,qBAAqB;;iBAKjB,iBAAiB,UAAS,mBAAwB;UAgCjD,gCAAgC;EAC/C;EACA;EACA,OAAO;;EAEP,SAAS;;EAET;EACA;EACA;;UAGe,gCAAgC,KAAK;EACpD,OAAO;;;iBAMO,wBAAwB,SAAS,0BAA0B"}
@@ -0,0 +1,2 @@
1
+ function e(e={}){let t=[];return{props:{sessionId:e.sessionId===void 0?`s1`:e.sessionId,statuses:e.statuses??{},openTab:e=>{t.push({action:`openTab`,target:e})},openTransientTab:e=>{t.push({action:`openTransientTab`,target:e.id})},closeTransientTab:e=>{t.push({action:`closeTransientTab`,target:e})},sendSessionFrame:(e,n)=>{t.push({action:`sendSessionFrame`,target:e,frame:n})},renderThread:t=>e.thread?.(t)??null,renderSlot:t=>e.slotContent?.[t]??null,slotData:t=>e.slotData?.[t.slot]??[]},actions:t,frames:()=>t.flatMap(e=>e.frame?[e.frame]:[])}}function t(t){let n=e(t),r=t.result===void 0?null:t.result;return{...n,props:{...n.props,toolCallId:t.toolCallId??`call-1`,toolName:t.toolName,args:t.args??{},result:r,output:t.output??``,running:t.running??!1,isError:t.isError??!1}}}export{e as slotPropsFixture,t as toolMessagePropsFixture};
2
+ //# sourceMappingURL=slotProps.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slotProps.mjs","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n SlotDataFill,\n SlotDeclaration,\n ToolMessageRenderProps,\n ToolResultView,\n TransientTab,\n WebPluginSlotProps,\n} from '../../types/webPlugin.ts';\n\n/**\n * The props the cockpit hands a plugin's components, built for a test.\n *\n * A plugin component takes fifteen props and reads three of them. Written out\n * by hand in each test, the other twelve are noise that goes stale the moment\n * the contract grows a member; written as a cast, the component compiles\n * against props the host never sends. This builds all of them, records what the\n * component did with the actions, and lets a test override the two or three it\n * cares about.\n */\n\nexport interface RecordedSlotAction {\n action: 'openTab' | 'openTransientTab' | 'closeTransientTab' | 'sendSessionFrame';\n /** The tab id, the transient tab's id, or the target session of a frame. */\n target: string | null;\n /** The frame a component sent, for `sendSessionFrame`. */\n frame?: Record<string, unknown>;\n}\n\nexport interface SlotPropsFixture {\n props: WebPluginSlotProps;\n /** Everything the component did through its props, in order. */\n readonly actions: readonly RecordedSlotAction[];\n /** Frames the component sent, which is what most assertions want. */\n frames(): readonly Record<string, unknown>[];\n}\n\nexport interface SlotPropsOptions {\n sessionId?: string | null;\n statuses?: Readonly<Record<string, string>>;\n /** Component fills this slot owner should see; keyed by slot name. */\n slotContent?: Readonly<Record<string, ReactNode>>;\n /** Data fills this slot owner should read back, keyed by slot name. */\n slotData?: Readonly<Record<string, readonly SlotDataFill[]>>;\n /** What `renderThread` returns for a plugin that renders one. */\n thread?: (threadId: string) => ReactNode;\n}\n\nconst DEFAULT_SESSION_ID = 's1';\n\nexport function slotPropsFixture(options: SlotPropsOptions = {}): SlotPropsFixture {\n const actions: RecordedSlotAction[] = [];\n const props: WebPluginSlotProps = {\n sessionId: options.sessionId === undefined ? DEFAULT_SESSION_ID : options.sessionId,\n statuses: options.statuses ?? {},\n openTab: (tabId) => {\n actions.push({ action: 'openTab', target: tabId });\n },\n openTransientTab: (tab: TransientTab) => {\n actions.push({ action: 'openTransientTab', target: tab.id });\n },\n closeTransientTab: (tabId: string) => {\n actions.push({ action: 'closeTransientTab', target: tabId });\n },\n sendSessionFrame: (sessionId, frame) => {\n actions.push({ action: 'sendSessionFrame', target: sessionId, frame });\n },\n renderThread: (threadId) => options.thread?.(threadId) ?? null,\n renderSlot: (slot) => options.slotContent?.[slot] ?? null,\n // The host resolves fills by slot name and hands the owner its own typed\n // view, so a test declares them by name too.\n slotData: <Data>(slot: SlotDeclaration<Data>) =>\n (options.slotData?.[slot.slot] ?? []) as readonly SlotDataFill<Data>[],\n };\n\n return {\n props,\n actions,\n frames: () => actions.flatMap((entry) => (entry.frame ? [entry.frame] : [])),\n };\n}\n\nexport interface ToolMessagePropsOptions extends SlotPropsOptions {\n toolCallId?: string;\n toolName: string;\n args?: Record<string, unknown>;\n /** The newest result; null is what the host sends before any output. */\n result?: ToolResultView | null;\n /** The result's text blocks joined, as the host's own fallback item shows them. */\n output?: string;\n running?: boolean;\n isError?: boolean;\n}\n\nexport interface ToolMessagePropsFixture extends Omit<SlotPropsFixture, 'props'> {\n props: ToolMessageRenderProps;\n}\n\nconst DEFAULT_TOOL_CALL_ID = 'call-1';\n\n/** The props a tool's timeline item receives, in any of its four states. */\nexport function toolMessagePropsFixture(options: ToolMessagePropsOptions): ToolMessagePropsFixture {\n const base = slotPropsFixture(options);\n const result = options.result === undefined ? null : options.result;\n return {\n ...base,\n props: {\n ...base.props,\n toolCallId: options.toolCallId ?? DEFAULT_TOOL_CALL_ID,\n toolName: options.toolName,\n args: options.args ?? {},\n result,\n output: options.output ?? '',\n running: options.running ?? false,\n isError: options.isError ?? false,\n },\n };\n}\n"],"mappings":"AAkDA,SAAgB,EAAiB,EAA4B,CAAC,EAAqB,CACjF,IAAM,EAAgC,CAAC,EAwBvC,MAAO,CACL,MAAA,CAvBA,UAAW,EAAQ,YAAc,IAAA,GAAY,KAAqB,EAAQ,UAC1E,SAAU,EAAQ,UAAY,CAAC,EAC/B,QAAU,GAAU,CAClB,EAAQ,KAAK,CAAE,OAAQ,UAAW,OAAQ,CAAM,CAAC,CACnD,EACA,iBAAmB,GAAsB,CACvC,EAAQ,KAAK,CAAE,OAAQ,mBAAoB,OAAQ,EAAI,EAAG,CAAC,CAC7D,EACA,kBAAoB,GAAkB,CACpC,EAAQ,KAAK,CAAE,OAAQ,oBAAqB,OAAQ,CAAM,CAAC,CAC7D,EACA,kBAAmB,EAAW,IAAU,CACtC,EAAQ,KAAK,CAAE,OAAQ,mBAAoB,OAAQ,EAAW,OAAM,CAAC,CACvE,EACA,aAAe,GAAa,EAAQ,SAAS,CAAQ,GAAK,KAC1D,WAAa,GAAS,EAAQ,cAAc,IAAS,KAGrD,SAAiB,GACd,EAAQ,WAAW,EAAK,OAAS,CAAC,CAIjC,EACJ,UACA,WAAc,EAAQ,QAAS,GAAW,EAAM,MAAQ,CAAC,EAAM,KAAK,EAAI,CAAC,CAAE,CAC7E,CACF,CAqBA,SAAgB,EAAwB,EAA2D,CACjG,IAAM,EAAO,EAAiB,CAAO,EAC/B,EAAS,EAAQ,SAAW,IAAA,GAAY,KAAO,EAAQ,OAC7D,MAAO,CACL,GAAG,EACH,MAAO,CACL,GAAG,EAAK,MACR,WAAY,EAAQ,YAAc,SAClC,SAAU,EAAQ,SAClB,KAAM,EAAQ,MAAQ,CAAC,EACvB,SACA,OAAQ,EAAQ,QAAU,GAC1B,QAAS,EAAQ,SAAW,GAC5B,QAAS,EAAQ,SAAW,EAC9B,CACF,CACF"}
@@ -0,0 +1,7 @@
1
+ function e(e){return typeof e==`object`&&!!e&&e.type===`text`&&typeof e.text==`string`}function t(t){return t.filter(e).map(e=>e.text).join(`
2
+ `)}function n(e){let n=t(e);if(n.length===0)return[];let r=n.replaceAll(`\r
3
+ `,`
4
+ `).replaceAll(`\r`,`
5
+ `).replaceAll(` `,` `).split(`
6
+ `);for(;r.length>0&&r.at(-1)?.trim()===``;)r.pop();return r}exports.toolResultText=t,exports.toolResultTextLines=n;
7
+ //# sourceMappingURL=toolResult.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolResult.cjs","names":[],"sources":["../../src/services/toolResult.ts"],"sourcesContent":["/**\n * The text of a tool result, the way every tool card reads it: the `text`\n * content blocks joined with newlines, non-text blocks (images) dropped.\n */\n\nconst TAB = '\\t';\nconst TAB_WIDTH = ' ';\n\nfunction isTextBlock(block: unknown): block is { type: 'text'; text: string } {\n return (\n typeof block === 'object' &&\n block !== null &&\n (block as { type?: unknown }).type === 'text' &&\n typeof (block as { text?: unknown }).text === 'string'\n );\n}\n\n/** The text blocks of a result's content, joined with newlines. */\nexport function toolResultText(content: readonly unknown[]): string {\n return content\n .filter(isTextBlock)\n .map((block) => block.text)\n .join('\\n');\n}\n\n/**\n * toolResultText as lines a card can count and clip: tabs widened, CRLF\n * folded, trailing blank lines dropped, and no lines at all for no text.\n */\nexport function toolResultTextLines(content: readonly unknown[]): string[] {\n const text = toolResultText(content);\n if (text.length === 0) return [];\n const lines = text.replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll(TAB, TAB_WIDTH).split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return lines;\n}\n"],"mappings":"AAQA,SAAS,EAAY,EAAyD,CAC5E,OACE,OAAO,GAAU,YACjB,GACC,EAA6B,OAAS,QACvC,OAAQ,EAA6B,MAAS,QAElD,CAGA,SAAgB,EAAe,EAAqC,CAClE,OAAO,EACJ,OAAO,CAAW,CAAC,CACnB,IAAK,GAAU,EAAM,IAAI,CAAC,CAC1B,KAAK;CAAI,CACd,CAMA,SAAgB,EAAoB,EAAuC,CACzE,IAAM,EAAO,EAAe,CAAO,EACnC,GAAI,EAAK,SAAW,EAAG,MAAO,CAAC,EAC/B,IAAM,EAAQ,EAAK,WAAW;EAAQ;CAAI,CAAC,CAAC,WAAW,KAAM;CAAI,CAAC,CAAC,WAAW,IAAK,IAAS,CAAC,CAAC,MAAM;CAAI,EACxG,KAAO,EAAM,OAAS,GAAK,EAAM,GAAG,EAAE,CAAC,EAAE,KAAK,IAAM,IAAI,EAAM,IAAI,EAClE,OAAO,CACT"}
@@ -0,0 +1,15 @@
1
+ //#region src/services/toolResult.d.ts
2
+ /**
3
+ * The text of a tool result, the way every tool card reads it: the `text`
4
+ * content blocks joined with newlines, non-text blocks (images) dropped.
5
+ */
6
+ /** The text blocks of a result's content, joined with newlines. */
7
+ declare function toolResultText(content: readonly unknown[]): string;
8
+ /**
9
+ * toolResultText as lines a card can count and clip: tabs widened, CRLF
10
+ * folded, trailing blank lines dropped, and no lines at all for no text.
11
+ */
12
+ declare function toolResultTextLines(content: readonly unknown[]): string[];
13
+ //#endregion
14
+ export { toolResultText, toolResultTextLines };
15
+ //# sourceMappingURL=toolResult.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolResult.d.cts","names":[],"sources":["../../src/services/toolResult.ts"],"mappings":";;;;;;iBAkBgB,eAAe;;;;;iBAWf,oBAAoB"}
@@ -0,0 +1,15 @@
1
+ //#region src/services/toolResult.d.ts
2
+ /**
3
+ * The text of a tool result, the way every tool card reads it: the `text`
4
+ * content blocks joined with newlines, non-text blocks (images) dropped.
5
+ */
6
+ /** The text blocks of a result's content, joined with newlines. */
7
+ declare function toolResultText(content: readonly unknown[]): string;
8
+ /**
9
+ * toolResultText as lines a card can count and clip: tabs widened, CRLF
10
+ * folded, trailing blank lines dropped, and no lines at all for no text.
11
+ */
12
+ declare function toolResultTextLines(content: readonly unknown[]): string[];
13
+ //#endregion
14
+ export { toolResultText, toolResultTextLines };
15
+ //# sourceMappingURL=toolResult.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolResult.d.mts","names":[],"sources":["../../src/services/toolResult.ts"],"mappings":";;;;;;iBAkBgB,eAAe;;;;;iBAWf,oBAAoB"}
@@ -0,0 +1,7 @@
1
+ function e(e){return typeof e==`object`&&!!e&&e.type===`text`&&typeof e.text==`string`}function t(t){return t.filter(e).map(e=>e.text).join(`
2
+ `)}function n(e){let n=t(e);if(n.length===0)return[];let r=n.replaceAll(`\r
3
+ `,`
4
+ `).replaceAll(`\r`,`
5
+ `).replaceAll(` `,` `).split(`
6
+ `);for(;r.length>0&&r.at(-1)?.trim()===``;)r.pop();return r}export{t as toolResultText,n as toolResultTextLines};
7
+ //# sourceMappingURL=toolResult.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolResult.mjs","names":[],"sources":["../../src/services/toolResult.ts"],"sourcesContent":["/**\n * The text of a tool result, the way every tool card reads it: the `text`\n * content blocks joined with newlines, non-text blocks (images) dropped.\n */\n\nconst TAB = '\\t';\nconst TAB_WIDTH = ' ';\n\nfunction isTextBlock(block: unknown): block is { type: 'text'; text: string } {\n return (\n typeof block === 'object' &&\n block !== null &&\n (block as { type?: unknown }).type === 'text' &&\n typeof (block as { text?: unknown }).text === 'string'\n );\n}\n\n/** The text blocks of a result's content, joined with newlines. */\nexport function toolResultText(content: readonly unknown[]): string {\n return content\n .filter(isTextBlock)\n .map((block) => block.text)\n .join('\\n');\n}\n\n/**\n * toolResultText as lines a card can count and clip: tabs widened, CRLF\n * folded, trailing blank lines dropped, and no lines at all for no text.\n */\nexport function toolResultTextLines(content: readonly unknown[]): string[] {\n const text = toolResultText(content);\n if (text.length === 0) return [];\n const lines = text.replaceAll('\\r\\n', '\\n').replaceAll('\\r', '\\n').replaceAll(TAB, TAB_WIDTH).split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return lines;\n}\n"],"mappings":"AAQA,SAAS,EAAY,EAAyD,CAC5E,OACE,OAAO,GAAU,YACjB,GACC,EAA6B,OAAS,QACvC,OAAQ,EAA6B,MAAS,QAElD,CAGA,SAAgB,EAAe,EAAqC,CAClE,OAAO,EACJ,OAAO,CAAW,CAAC,CACnB,IAAK,GAAU,EAAM,IAAI,CAAC,CAC1B,KAAK;CAAI,CACd,CAMA,SAAgB,EAAoB,EAAuC,CACzE,IAAM,EAAO,EAAe,CAAO,EACnC,GAAI,EAAK,SAAW,EAAG,MAAO,CAAC,EAC/B,IAAM,EAAQ,EAAK,WAAW;EAAQ;CAAI,CAAC,CAAC,WAAW,KAAM;CAAI,CAAC,CAAC,WAAW,IAAK,IAAS,CAAC,CAAC,MAAM;CAAI,EACxG,KAAO,EAAM,OAAS,GAAK,EAAM,GAAG,EAAE,CAAC,EAAE,KAAK,IAAM,IAAI,EAAM,IAAI,EAClE,OAAO,CACT"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./services/testing/channels.cjs"),t=require("./services/testing/render.cjs"),n=require("./services/testing/slotProps.cjs");exports.driveChannel=e.driveChannel,exports.hubChannelHarness=e.hubChannelHarness,exports.renderPlugin=t.renderPlugin,exports.slotPropsFixture=n.slotPropsFixture,exports.toolMessagePropsFixture=n.toolMessagePropsFixture;
@@ -0,0 +1,4 @@
1
+ import { ChannelDelivery, HubChannelHarness, HubChannelHarnessOptions, driveChannel, hubChannelHarness } from "./services/testing/channels.cjs";
2
+ import { RenderedPlugin, renderPlugin } from "./services/testing/render.cjs";
3
+ import { RecordedSlotAction, SlotPropsFixture, SlotPropsOptions, ToolMessagePropsFixture, ToolMessagePropsOptions, slotPropsFixture, toolMessagePropsFixture } from "./services/testing/slotProps.cjs";
4
+ export { type ChannelDelivery, type HubChannelHarness, type HubChannelHarnessOptions, type RecordedSlotAction, type RenderedPlugin, type SlotPropsFixture, type SlotPropsOptions, type ToolMessagePropsFixture, type ToolMessagePropsOptions, driveChannel, hubChannelHarness, renderPlugin, slotPropsFixture, toolMessagePropsFixture };
@@ -0,0 +1,4 @@
1
+ import { ChannelDelivery, HubChannelHarness, HubChannelHarnessOptions, driveChannel, hubChannelHarness } from "./services/testing/channels.mjs";
2
+ import { RenderedPlugin, renderPlugin } from "./services/testing/render.mjs";
3
+ import { RecordedSlotAction, SlotPropsFixture, SlotPropsOptions, ToolMessagePropsFixture, ToolMessagePropsOptions, slotPropsFixture, toolMessagePropsFixture } from "./services/testing/slotProps.mjs";
4
+ export { type ChannelDelivery, type HubChannelHarness, type HubChannelHarnessOptions, type RecordedSlotAction, type RenderedPlugin, type SlotPropsFixture, type SlotPropsOptions, type ToolMessagePropsFixture, type ToolMessagePropsOptions, driveChannel, hubChannelHarness, renderPlugin, slotPropsFixture, toolMessagePropsFixture };
@@ -0,0 +1 @@
1
+ import{driveChannel as e,hubChannelHarness as t}from"./services/testing/channels.mjs";import{renderPlugin as n}from"./services/testing/render.mjs";import{slotPropsFixture as r,toolMessagePropsFixture as i}from"./services/testing/slotProps.mjs";export{e as driveChannel,t as hubChannelHarness,n as renderPlugin,r as slotPropsFixture,i as toolMessagePropsFixture};
@@ -0,0 +1,56 @@
1
+ //#region src/types/webHub.d.ts
2
+ /**
3
+ * The wire shape and the hub-server half of the DoomPi web plugin contract.
4
+ *
5
+ * A plugin package's hub entry exports `webHubChannels: readonly
6
+ * WebHubChannel[]`. The cockpit hub imports server contracts type-only, so
7
+ * this module must stay free of runtime values beyond plain types.
8
+ */
9
+ /**
10
+ * Per-plugin session data on the page socket. The channel name IS the frame
11
+ * type; the page routes by registry lookup and drops unknown types.
12
+ */
13
+ interface ChannelFrame {
14
+ type: string;
15
+ sessionId: string;
16
+ payload: unknown;
17
+ }
18
+ interface HubSessionScope {
19
+ sessionId: string;
20
+ /** The session's working directory, for repo-scoped data sources. */
21
+ cwd: string;
22
+ }
23
+ /** What the hub hands a channel when it starts. */
24
+ interface HubChannelHost {
25
+ /** Every session the hub currently manages. */
26
+ sessions(): readonly HubSessionScope[];
27
+ /** Live fan-out to the session's page subscribers. */
28
+ publish(sessionId: string, payload: unknown): void;
29
+ onNotice(message: string): void;
30
+ }
31
+ /**
32
+ * One running data source. `payloadFor` answers the subscribe-time snapshot;
33
+ * undefined means no frame. The optional session hooks cover per-session
34
+ * sources; a hub-wide source may ignore them and filter inside itself.
35
+ */
36
+ interface HubChannelSource {
37
+ /** unknown already admits undefined; a literal undefined result means no frame. */
38
+ payloadFor(scope: HubSessionScope): unknown;
39
+ sessionAdded?(scope: HubSessionScope): void;
40
+ sessionRemoved?(sessionId: string): void;
41
+ /**
42
+ * The Pi session journal (an absolute .jsonl path) behind one thread of a
43
+ * session, such as a subagent run; the hub tails it for the page. Undefined
44
+ * means not this source's thread, or not known yet: the hub keeps asking.
45
+ */
46
+ threadJournal?(scope: HubSessionScope, threadId: string): string | undefined;
47
+ close(): void;
48
+ }
49
+ interface WebHubChannel {
50
+ /** Wire frame type; globally unique across every loaded plugin. */
51
+ frameType: string;
52
+ start(host: HubChannelHost): HubChannelSource;
53
+ }
54
+ //#endregion
55
+ export { ChannelFrame, HubChannelHost, HubChannelSource, HubSessionScope, WebHubChannel };
56
+ //# sourceMappingURL=webHub.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webHub.d.cts","names":[],"sources":["../../src/types/webHub.ts"],"mappings":";;;;;;;;;;;;UAYiB;EACf;EACA;EACA;;UAGe;EACf;;EAEA;;;UAIe;;EAEf,qBAAqB;;EAErB,QAAQ,mBAAmB;EAC3B,SAAS;;;;;;;UAQM;;EAEf,WAAW,OAAO;EAClB,cAAc,OAAO;EACrB,gBAAgB;;;;;;EAMhB,eAAe,OAAO,iBAAiB;EACvC;;UAGe;;EAEf;EACA,MAAM,MAAM,iBAAiB"}
@@ -0,0 +1,56 @@
1
+ //#region src/types/webHub.d.ts
2
+ /**
3
+ * The wire shape and the hub-server half of the DoomPi web plugin contract.
4
+ *
5
+ * A plugin package's hub entry exports `webHubChannels: readonly
6
+ * WebHubChannel[]`. The cockpit hub imports server contracts type-only, so
7
+ * this module must stay free of runtime values beyond plain types.
8
+ */
9
+ /**
10
+ * Per-plugin session data on the page socket. The channel name IS the frame
11
+ * type; the page routes by registry lookup and drops unknown types.
12
+ */
13
+ interface ChannelFrame {
14
+ type: string;
15
+ sessionId: string;
16
+ payload: unknown;
17
+ }
18
+ interface HubSessionScope {
19
+ sessionId: string;
20
+ /** The session's working directory, for repo-scoped data sources. */
21
+ cwd: string;
22
+ }
23
+ /** What the hub hands a channel when it starts. */
24
+ interface HubChannelHost {
25
+ /** Every session the hub currently manages. */
26
+ sessions(): readonly HubSessionScope[];
27
+ /** Live fan-out to the session's page subscribers. */
28
+ publish(sessionId: string, payload: unknown): void;
29
+ onNotice(message: string): void;
30
+ }
31
+ /**
32
+ * One running data source. `payloadFor` answers the subscribe-time snapshot;
33
+ * undefined means no frame. The optional session hooks cover per-session
34
+ * sources; a hub-wide source may ignore them and filter inside itself.
35
+ */
36
+ interface HubChannelSource {
37
+ /** unknown already admits undefined; a literal undefined result means no frame. */
38
+ payloadFor(scope: HubSessionScope): unknown;
39
+ sessionAdded?(scope: HubSessionScope): void;
40
+ sessionRemoved?(sessionId: string): void;
41
+ /**
42
+ * The Pi session journal (an absolute .jsonl path) behind one thread of a
43
+ * session, such as a subagent run; the hub tails it for the page. Undefined
44
+ * means not this source's thread, or not known yet: the hub keeps asking.
45
+ */
46
+ threadJournal?(scope: HubSessionScope, threadId: string): string | undefined;
47
+ close(): void;
48
+ }
49
+ interface WebHubChannel {
50
+ /** Wire frame type; globally unique across every loaded plugin. */
51
+ frameType: string;
52
+ start(host: HubChannelHost): HubChannelSource;
53
+ }
54
+ //#endregion
55
+ export { ChannelFrame, HubChannelHost, HubChannelSource, HubSessionScope, WebHubChannel };
56
+ //# sourceMappingURL=webHub.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webHub.d.mts","names":[],"sources":["../../src/types/webHub.ts"],"mappings":";;;;;;;;;;;;UAYiB;EACf;EACA;EACA;;UAGe;EACf;;EAEA;;;UAIe;;EAEf,qBAAqB;;EAErB,QAAQ,mBAAmB;EAC3B,SAAS;;;;;;;UAQM;;EAEf,WAAW,OAAO;EAClB,cAAc,OAAO;EACrB,gBAAgB;;;;;;EAMhB,eAAe,OAAO,iBAAiB;EACvC;;UAGe;;EAEf;EACA,MAAM,MAAM,iBAAiB"}
@@ -0,0 +1,343 @@
1
+ import { Store } from "@tanstack/store";
2
+ import { ComponentType, ReactNode } from "react";
3
+ //#region src/types/webPlugin.d.ts
4
+ /**
5
+ * The client half of the DoomPi web plugin contract.
6
+ *
7
+ * A plugin package exports one `webPlugin: WebPluginDefinition` from its
8
+ * declared client entry. The cockpit's bundler compiles that entry into the
9
+ * host bundle, so a plugin's client code may import only react,
10
+ * @tanstack/store, @tanstack/react-store, this contract,
11
+ * @agimon-ai/doompi-web-components, and the package's own web/ and src/types
12
+ * modules; never another plugin, a node builtin, or a server framework, which
13
+ * the host bundle would swallow. Per-session state takes the shape
14
+ * defineSessionStore gives it. Tailwind utility classes must appear as
15
+ * complete literal strings so the host's class scanner can see them.
16
+ *
17
+ * Plugins are independent: none depends on another, any of them may be added
18
+ * or removed at the next sync, and every relation between two plugins (a fill
19
+ * into a slot, a section inside an activity group) resolves by name once every
20
+ * plugin is installed. The manifest's registrationOrder is only a tiebreak,
21
+ * and a collision between two plugins is an install diagnostic, never a
22
+ * failure.
23
+ */
24
+ /** Sends one command frame to a session's agent on the page's hub socket. */
25
+ type SessionFrameSender = (sessionId: string, frame: Record<string, unknown>) => void;
26
+ /**
27
+ * A slot a plugin opens inside its own UI for independent plugins to fill.
28
+ * The name is namespaced by its owner, '<pluginId>.<name>', so no two plugins
29
+ * open the same slot. A slot with a parse gate takes data fills, declared as
30
+ * data the owner renders; one without takes component fills the owner places
31
+ * with renderSlot. Either side may be absent: the owner renders with zero
32
+ * fills, and a fill into a slot no installed plugin declares is an install
33
+ * diagnostic, never a failure.
34
+ */
35
+ interface SlotDeclaration<Data = unknown> {
36
+ slot: string;
37
+ /** The gate for data fills, run once at install; null rejects the fill with a diagnostic. */
38
+ parse?(input: unknown): Data | null;
39
+ }
40
+ /** A data fill as its owner reads it back, already through the parse gate. */
41
+ interface SlotDataFill<Data = unknown> {
42
+ pluginId: string;
43
+ id: string;
44
+ order: number;
45
+ data: Data;
46
+ }
47
+ /**
48
+ * A tab a plugin opens at runtime for one session, beside the declared ones:
49
+ * the reader closes it, and it goes with the session or the page. The host
50
+ * keeps the panel it was opened with, so opening the same id again only
51
+ * focuses the tab.
52
+ */
53
+ interface TransientTab {
54
+ /** Unique across plugins and URL-safe: '<pluginId>-<name>-<key>'. */
55
+ id: string;
56
+ label: string;
57
+ panel: ComponentType<WebPluginSlotProps>;
58
+ }
59
+ /** Every slot component receives the focused session; null while nothing is focused. */
60
+ interface WebPluginSlotProps {
61
+ sessionId: string | null;
62
+ /** Host navigation for the focused session; null returns to the conversation tab. */
63
+ openTab: (tabId: string | null) => void;
64
+ /** Opens the tab for the focused session, or focuses it when one with the same id is already open. */
65
+ openTransientTab: (tab: TransientTab) => void;
66
+ closeTransientTab: (tabId: string) => void;
67
+ /**
68
+ * The host's live conversation view of one thread of the focused session,
69
+ * rendered like the session's own timeline and subscribed while mounted. A
70
+ * plugin's hub source names the thread's journal (HubChannelSource.threadJournal).
71
+ */
72
+ renderThread: (threadId: string) => ReactNode;
73
+ /** The same sender palette commands and `start` receive; components act through it. */
74
+ sendSessionFrame: SessionFrameSender;
75
+ /** The component fills of one slot, in slot order; the host resolves them, so this contract holds no state. */
76
+ renderSlot: (slot: string) => ReactNode;
77
+ /** The data fills of one slot, typed by the declaration handle only its owner holds. */
78
+ slotData: <Data>(slot: SlotDeclaration<Data>) => readonly SlotDataFill<Data>[];
79
+ /**
80
+ * The footer statuses the focused session has published, raw, keyed as the
81
+ * publishing extension named them. A package reads its own key: the status
82
+ * line is the only thing some modes report, and a plugin that renders its
83
+ * own surface needs the same facts the host folds into the selection bar.
84
+ */
85
+ statuses: Readonly<Record<string, string>>;
86
+ }
87
+ /**
88
+ * One contribution into a slot, keyed by (pluginId, id): independent plugins
89
+ * never collide on an id. A component fill renders where the owner places the
90
+ * slot; a data fill is what the owner's parse gate reads.
91
+ */
92
+ interface SlotFillContribution {
93
+ slot: string;
94
+ id: string;
95
+ /** Sort position within the slot; lower first, then pluginId, then id. */
96
+ order?: number;
97
+ data?: unknown;
98
+ component?: ComponentType<WebPluginSlotProps>;
99
+ }
100
+ interface TabContribution {
101
+ /** URL segment (/session/:id/:tabId) and testid suffix (tab-<id>, tab-<id>-count). */
102
+ id: string;
103
+ label: string;
104
+ panel: ComponentType<WebPluginSlotProps>;
105
+ /** A React hook, fully typed inside the plugin; 0 hides the badge. */
106
+ useBadge?: (sessionId: string | null) => number;
107
+ }
108
+ interface SurfaceContribution {
109
+ id: string;
110
+ component: ComponentType<WebPluginSlotProps>;
111
+ }
112
+ interface PaletteCommandContext {
113
+ sessionId: string | null;
114
+ /** Host navigation; null returns to the conversation tab. */
115
+ openTab(tabId: string | null): void;
116
+ sendSessionFrame: SessionFrameSender;
117
+ }
118
+ interface PaletteCommandContribution {
119
+ id: string;
120
+ title: string;
121
+ description?: string;
122
+ run(context: PaletteCommandContext): void;
123
+ }
124
+ /**
125
+ * One step of a Leader Space key path: the key pressed and the label the
126
+ * menu shows beside it. Keys are one lowercase letter or digit, the same
127
+ * alphabet the TUI's leader registry accepts.
128
+ */
129
+ interface LeaderKeyContribution {
130
+ key: string;
131
+ label: string;
132
+ detail?: string;
133
+ }
134
+ interface LeaderBindingBase {
135
+ id: string;
136
+ /** The SPC path, group segments first; the last segment is the key that fires. */
137
+ path: LeaderKeyContribution[];
138
+ }
139
+ /**
140
+ * A Leader Space binding, the cockpit's half of the TUI's leader contract.
141
+ *
142
+ * The session's own leader tree never reaches an RPC client, so each package
143
+ * declares here the paths its TUI documents that a browser can honor: a slash
144
+ * command line the host sends through the prompt channel (without the leading
145
+ * slash), or a client action such as opening the plugin's tab. Plugins that
146
+ * share a group prefix (SPC w) word it the same way; the first to register a
147
+ * segment names it, and a later binding on an already-bound leaf takes it
148
+ * over. Either disagreement between two plugins is an install diagnostic.
149
+ */
150
+ type LeaderBindingContribution = (LeaderBindingBase & {
151
+ command: string;
152
+ }) | (LeaderBindingBase & {
153
+ run(context: PaletteCommandContext): void;
154
+ });
155
+ /**
156
+ * A minor mode's presence in the cockpit, declared as data rather than a
157
+ * component: the host's selection bar renders the list, folding in what the
158
+ * session reports. A mode with neither signal key shows as unavailable until
159
+ * its package publishes one.
160
+ */
161
+ interface MinorModeContribution {
162
+ name: string;
163
+ /**
164
+ * The catalog mode this row drives, when the runtime registers it under a
165
+ * different id than the row shows. A package whose leader key drives one of
166
+ * several modes it owns needs this: the row must reach the same mode the
167
+ * key does, not the one that happens to share the row's label.
168
+ */
169
+ modeId?: string;
170
+ /** Leader Space key path, as the TUI documents it. */
171
+ keys: string;
172
+ /** Footer status key whose presence and content report availability and detail. */
173
+ statusKey?: string;
174
+ /** Widget key whose presence reports the mode as installed but off. */
175
+ widgetKey?: string;
176
+ /** Sort position in the selection bar list; lower first, name breaks ties. */
177
+ order?: number;
178
+ }
179
+ /**
180
+ * A selection-bar axis, declared as data: the host renders the chip and
181
+ * routes its click through the axis's slash command. The axis shows only
182
+ * while the session publishes the status key; the content is the current
183
+ * selection, and emptyLabel shows while it is published empty.
184
+ */
185
+ interface SelectionAxisContribution {
186
+ /** Chip identity: testid axis-<name> and the popover menu it claims. */
187
+ name: string;
188
+ /** Slash command the host runs when the chip is clicked. */
189
+ command: string;
190
+ /** Footer status key: absent hides the axis, content is the selection. */
191
+ statusKey: string;
192
+ /** Shown while the status is published with nothing selected. */
193
+ emptyLabel: string;
194
+ /** The status content is a comma-separated list: several selections can be active at once. */
195
+ multi?: boolean;
196
+ /** Sort position in the bar; lower first, name breaks ties. */
197
+ order?: number;
198
+ }
199
+ /**
200
+ * An activity-dock group, declared as data: the host renders the group's
201
+ * frame when the session publishes its signal (the footer status key, or any
202
+ * of the widget keys). The body is the status content as a one-line summary
203
+ * unless some plugin fills the group's slot, `activity.<name>`, with an
204
+ * activity section of the same name, in which case those sections render the
205
+ * body themselves.
206
+ */
207
+ interface ActivityGroupContribution {
208
+ name: string;
209
+ /** Leader Space key path, as the TUI documents it. */
210
+ keys: string;
211
+ /** Footer status key whose presence shows the group and content fills its summary. */
212
+ statusKey?: string;
213
+ /** Widget keys any of which shows the group without a summary. */
214
+ widgetKeys?: string[];
215
+ /** The plugin tab the group's key chip opens; without one the chip is a plain label. */
216
+ tab?: string;
217
+ /** Sort position in the dock; lower first, name breaks ties. */
218
+ order?: number;
219
+ }
220
+ /**
221
+ * One session-scoped data channel: the hub pushes ChannelFrame payloads whose
222
+ * frame type equals `channel`; parse is the validation gate at the boundary
223
+ * (null rejects); drop clears the plugin's per-session state.
224
+ */
225
+ interface SessionChannelContribution<Payload = unknown> {
226
+ channel: string;
227
+ parse(input: unknown): Payload | null;
228
+ apply(sessionId: string, payload: Payload): void;
229
+ drop(sessionId: string): void;
230
+ }
231
+ /** One record per session id; a missing key means the session has reported nothing. */
232
+ type SessionRecords<T> = Partial<Record<string, T>>;
233
+ /** A channel folded straight into a session store: parse gates the wire, reduce folds one payload into the record. */
234
+ interface SessionStoreChannel<T, Payload> {
235
+ channel: string;
236
+ parse(input: unknown): Payload | null;
237
+ /** Folds one payload into the session's record; ephemeral fields (stop requests, dismissals) reconcile here. */
238
+ reduce(current: T, payload: Payload): T;
239
+ }
240
+ /**
241
+ * Per-session plugin state, the shape every plugin's store takes: one record
242
+ * per session, shared by the plugin's tab, badge, sections, and channels.
243
+ * Records are immutable values; updaters and reducers return new ones.
244
+ */
245
+ interface SessionStore<T> {
246
+ readonly store: Store<SessionRecords<T>>;
247
+ /**
248
+ * The session's record, or the one shared empty record for null and unknown
249
+ * sessions: a stable reference, so a useStore selector over it never
250
+ * re-renders on an unchanged session.
251
+ */
252
+ select(state: SessionRecords<T>, sessionId: string | null): T;
253
+ /** Replaces the session's record; an updater returning the current record publishes nothing. */
254
+ update(sessionId: string, updater: (current: T) => T): void;
255
+ drop(sessionId: string): void;
256
+ reset(): void;
257
+ /** A session channel whose apply and drop are already wired to this store. */
258
+ channel<Payload>(options: SessionStoreChannel<T, Payload>): SessionChannelContribution;
259
+ }
260
+ /**
261
+ * A tool result as Pi's tool_execution frames carry it: the content blocks
262
+ * the model sees and the structured `details` the tool attached for its own
263
+ * renderer. Both are wire JSON; the plugin that owns the tool narrows them.
264
+ */
265
+ interface ToolResultView {
266
+ content: unknown[];
267
+ details: unknown;
268
+ }
269
+ /**
270
+ * Everything a tool's timeline item receives: the actions every plugin
271
+ * component gets, plus the call and its newest result. The component owns
272
+ * the whole item, its frame, header, body, and expand state included; the
273
+ * host only wraps it in the timeline row and catches a throw. Compose it
274
+ * from the shared components package's MessageItem so it looks like every
275
+ * other item, the host's own fallback included.
276
+ */
277
+ interface ToolMessageRenderProps extends WebPluginSlotProps {
278
+ toolCallId: string;
279
+ /** The wire name, as registered with Pi (registerTool's `name`). */
280
+ toolName: string;
281
+ args: Record<string, unknown>;
282
+ /** The session's footer statuses at render time, the same picture `matches` saw. */
283
+ statuses: Readonly<Record<string, string>>;
284
+ /** The newest result: partial while the tool runs, final once it ends; null before any output. */
285
+ result: ToolResultView | null;
286
+ /** The result's text blocks joined, which is what the host's fallback item shows. */
287
+ output: string;
288
+ /** True while the tool still runs, so `result` is a partial one. */
289
+ running: boolean;
290
+ isError: boolean;
291
+ }
292
+ /**
293
+ * The timeline item for the tools a package registers, the web half of the
294
+ * TUI's renderCall/renderResult with Pi's renderShell 'self': one `message`
295
+ * component per claimed tool owns the whole item. One tool name belongs to
296
+ * one renderer.
297
+ */
298
+ interface ToolRendererContribution {
299
+ /** Tool names as registered with Pi (registerTool's `name`). */
300
+ tools: string[];
301
+ /**
302
+ * Claims a tool named only at runtime (an MCP server's tools) when no
303
+ * plugin lists the name. The session's footer statuses come along so the
304
+ * plugin can read whatever its session half published, such as the server
305
+ * names; the first renderer to match, in install order, wins.
306
+ */
307
+ matches?(toolName: string, statuses: Readonly<Record<string, string>>): boolean;
308
+ message: ComponentType<ToolMessageRenderProps>;
309
+ }
310
+ /** What a plugin's optional runtime may do; both send on the page's hub socket. */
311
+ interface WebPluginRuntime {
312
+ sendSessionFrame: SessionFrameSender;
313
+ sendHubFrame(frame: Record<string, unknown>): void;
314
+ }
315
+ interface WebPluginDefinition {
316
+ id: string;
317
+ tabs?: TabContribution[];
318
+ channels?: SessionChannelContribution[];
319
+ selectionAxes?: SelectionAxisContribution[];
320
+ minorModes?: MinorModeContribution[];
321
+ activityGroups?: ActivityGroupContribution[];
322
+ overlays?: SurfaceContribution[];
323
+ paletteCommands?: PaletteCommandContribution[];
324
+ leaderBindings?: LeaderBindingContribution[];
325
+ railSections?: SurfaceContribution[];
326
+ selectionBarItems?: SurfaceContribution[];
327
+ toolRenderers?: ToolRendererContribution[];
328
+ /**
329
+ * A section whose id names an activity group any plugin declares renders
330
+ * inside that group's slot, `activity.<id>`, replacing the session's
331
+ * one-line summary; any other section renders after the groups.
332
+ */
333
+ activitySections?: SurfaceContribution[];
334
+ /** The slots this plugin opens for others, each named '<this plugin id>.<name>'. */
335
+ slots?: SlotDeclaration[];
336
+ /** This plugin's contributions into slots other plugins (or the host) declare. */
337
+ fills?: SlotFillContribution[];
338
+ /** Started after the host runtime, for page-lifetime needs such as hub frames; the return value disposes. */
339
+ start?(runtime: WebPluginRuntime): (() => void) | void;
340
+ }
341
+ //#endregion
342
+ export { ActivityGroupContribution, LeaderBindingBase, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ToolMessageRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps };
343
+ //# sourceMappingURL=webPlugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webPlugin.d.cts","names":[],"sources":["../../src/types/webPlugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;KAwBY,sBAAsB,mBAAmB,OAAO;;;;;;;;;;UAU3C,gBAAgB;EAC/B;;EAEA,OAAO,iBAAiB;;;UAGT,aAAa;EAC5B;EACA;EACA;EACA,MAAM;;;;;;;;UAQS;;EAEf;EACA;EACA,OAAO,cAAc;;;UAGN;EACf;;EAEA,UAAU;;EAEV,mBAAmB,KAAK;EACxB,oBAAoB;;;;;;EAMpB,eAAe,qBAAqB;;EAEpC,kBAAkB;;EAElB,aAAa,iBAAiB;;EAE9B,WAAW,MAAM,MAAM,gBAAgB,mBAAmB,aAAa;;;;;;;EAOvE,UAAU,SAAS;;;;;;;UAOJ;EACf;EACA;;EAEA;EACA;EACA,YAAY,cAAc;;UAEX;;EAEf;EACA;EACA,OAAO,cAAc;;EAErB,YAAY;;UAEG;EACf;EACA,WAAW,cAAc;;UAEV;EACf;;EAEA,QAAQ;EACR,kBAAkB;;UAEH;EACf;EACA;EACA;EACA,IAAI,SAAS;;;;;;;UAOE;EACf;EACA;EACA;;UAEe;EACf;;EAEA,MAAM;;;;;;;;;;;;;KAaI,6BACP;EACC;MAED;EACC,IAAI,SAAS;;;;;;;;UAQF;EACf;;;;;;;EAOA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;UAQe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;UAUe;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;UAOe,2BAA2B;EAC1C;EACA,MAAM,iBAAiB;EACvB,MAAM,mBAAmB,SAAS;EAClC,KAAK;;;KAGK,eAAe,KAAK,QAAQ,eAAe;;UAEtC,oBAAoB,GAAG;EACtC;EACA,MAAM,iBAAiB;;EAEvB,OAAO,SAAS,GAAG,SAAS,UAAU;;;;;;;UAOvB,aAAa;WACnB,OAAO,MAAM,eAAe;;;;;;EAMrC,OAAO,OAAO,eAAe,IAAI,2BAA2B;;EAE5D,OAAO,mBAAmB,UAAU,SAAS,MAAM;EACnD,KAAK;EACL;;EAEA,QAAQ,SAAS,SAAS,oBAAoB,GAAG,WAAW;;;;;;;UAO7C;EACf;EACA;;;;;;;;;;UAUe,+BAA+B;EAC9C;;EAEA;EACA,MAAM;;EAEN,UAAU,SAAS;;EAEnB,QAAQ;;EAER;;EAEA;EACA;;;;;;;;UAQe;;EAEf;;;;;;;EAOA,SAAS,kBAAkB,UAAU,SAAS;EAC9C,SAAS,cAAc;;;UAGR;EACf,kBAAkB;EAClB,aAAa,OAAO;;UAEL;EACf;EACA,OAAO;EACP,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,iBAAiB;EACjB,WAAW;EACX,kBAAkB;EAClB,iBAAiB;EACjB,eAAe;EACf,oBAAoB;EACpB,gBAAgB;;;;;;EAMhB,mBAAmB;;EAEnB,QAAQ;;EAER,QAAQ;;EAER,OAAO,SAAS"}