@agimon-ai/doompi-web-contracts 0.0.1-alpha.19 → 0.0.1-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/services/testing/slotProps.cjs +1 -1
- package/dist/services/testing/slotProps.cjs.map +1 -1
- package/dist/services/testing/slotProps.d.cts +1 -0
- package/dist/services/testing/slotProps.d.cts.map +1 -1
- package/dist/services/testing/slotProps.d.mts +1 -0
- package/dist/services/testing/slotProps.d.mts.map +1 -1
- package/dist/services/testing/slotProps.mjs +1 -1
- package/dist/services/testing/slotProps.mjs.map +1 -1
- package/dist/types/webPlugin.d.cts +12 -1
- package/dist/types/webPlugin.d.cts.map +1 -1
- package/dist/types/webPlugin.d.mts +12 -1
- package/dist/types/webPlugin.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelContext, ModelContextAbortSignal, ModelContextBinding, ModelContextExecutionOptions, ModelContextRegistrationOptions, ModelContextTool, ModelContextToolChangeEvent, ModelContextToolChangeListener, ModelContextToolDescriptor } from "./types/modelContext.cjs";
|
|
2
|
-
import { ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps } from "./types/webPlugin.cjs";
|
|
2
|
+
import { ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextInventoryItem, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps } from "./types/webPlugin.cjs";
|
|
3
3
|
import { defineSessionChannel, defineSlot, defineWebPlugin } from "./services/define.cjs";
|
|
4
4
|
import { defineGlobalStore } from "./services/globalStore.cjs";
|
|
5
5
|
import { defineSessionStore } from "./services/sessionStore.cjs";
|
|
6
6
|
import { toolResultText, toolResultTextLines } from "./services/toolResult.cjs";
|
|
7
7
|
import { ChannelFrame, ComputerUseHostBinding, ComputerUseHostOperation, ComputerUseHostRequest, HubChannelConnection, HubChannelHost, HubChannelLifecycle, HubChannelSource, HubSessionApiRequest, HubSessionScope, WebHubChannel } from "./types/webHub.cjs";
|
|
8
|
-
export { type ActivityGroupContribution, type ChannelFrame, type ComposerCapture, type ComposerSubmission, type ComputerUseHostBinding, type ComputerUseHostOperation, type ComputerUseHostRequest, type ContextAction, type ContextActionContribution, type ContextActionRunContext, type DockFaceContribution, type FileLinkSource, type GlobalStore, type HubChannelConnection, type HubChannelHost, type HubChannelLifecycle, type HubChannelSource, type HubSessionApiRequest, type HubSessionScope, type LeaderBindingContribution, type LeaderKeyContribution, type MinorModeContribution, type ModelContext, type ModelContextAbortSignal, type ModelContextBinding, type ModelContextExecutionOptions, type ModelContextRegistrationOptions, type ModelContextTool, type ModelContextToolChangeEvent, type ModelContextToolChangeListener, type ModelContextToolDescriptor, type PaletteCommandContext, type PaletteCommandContribution, type RepositorySettingsPanelContribution, type RepositorySettingsPanelProps, type RepositorySettingsRepository, type SelectionAxisContribution, type SessionChannelContribution, type SessionFrameSender, type SessionRecords, type SessionStore, type SessionStoreChannel, type SettingsFieldContribution, type SettingsFieldOption, type SettingsPanelContribution, type SettingsPanelProps, type SettingsSectionContribution, type SlotDataFill, type SlotDeclaration, type SlotFillContribution, type SurfaceContribution, type TabContribution, type ThreadViewOptions, type ToolMessageRenderProps, type ToolPromptContribution, type ToolPromptDialog, type ToolPromptRenderProps, type ToolRendererContribution, type ToolResultView, type TransientTab, type WebHubChannel, type WebPluginContextItem, type WebPluginDefinition, type WebPluginRuntime, type WebPluginSlotProps, defineGlobalStore, defineSessionChannel, defineSessionStore, defineSlot, defineWebPlugin, toolResultText, toolResultTextLines };
|
|
8
|
+
export { type ActivityGroupContribution, type ChannelFrame, type ComposerCapture, type ComposerSubmission, type ComputerUseHostBinding, type ComputerUseHostOperation, type ComputerUseHostRequest, type ContextAction, type ContextActionContribution, type ContextActionRunContext, type DockFaceContribution, type FileLinkSource, type GlobalStore, type HubChannelConnection, type HubChannelHost, type HubChannelLifecycle, type HubChannelSource, type HubSessionApiRequest, type HubSessionScope, type LeaderBindingContribution, type LeaderKeyContribution, type MinorModeContribution, type ModelContext, type ModelContextAbortSignal, type ModelContextBinding, type ModelContextExecutionOptions, type ModelContextRegistrationOptions, type ModelContextTool, type ModelContextToolChangeEvent, type ModelContextToolChangeListener, type ModelContextToolDescriptor, type PaletteCommandContext, type PaletteCommandContribution, type RepositorySettingsPanelContribution, type RepositorySettingsPanelProps, type RepositorySettingsRepository, type SelectionAxisContribution, type SessionChannelContribution, type SessionFrameSender, type SessionRecords, type SessionStore, type SessionStoreChannel, type SettingsFieldContribution, type SettingsFieldOption, type SettingsPanelContribution, type SettingsPanelProps, type SettingsSectionContribution, type SlotDataFill, type SlotDeclaration, type SlotFillContribution, type SurfaceContribution, type TabContribution, type ThreadViewOptions, type ToolMessageRenderProps, type ToolPromptContribution, type ToolPromptDialog, type ToolPromptRenderProps, type ToolRendererContribution, type ToolResultView, type TransientTab, type WebHubChannel, type WebPluginContextInventoryItem, type WebPluginContextItem, type WebPluginDefinition, type WebPluginRuntime, type WebPluginSlotProps, defineGlobalStore, defineSessionChannel, defineSessionStore, defineSlot, defineWebPlugin, toolResultText, toolResultTextLines };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelContext, ModelContextAbortSignal, ModelContextBinding, ModelContextExecutionOptions, ModelContextRegistrationOptions, ModelContextTool, ModelContextToolChangeEvent, ModelContextToolChangeListener, ModelContextToolDescriptor } from "./types/modelContext.mjs";
|
|
2
|
-
import { ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps } from "./types/webPlugin.mjs";
|
|
2
|
+
import { ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextInventoryItem, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps } from "./types/webPlugin.mjs";
|
|
3
3
|
import { defineSessionChannel, defineSlot, defineWebPlugin } from "./services/define.mjs";
|
|
4
4
|
import { defineGlobalStore } from "./services/globalStore.mjs";
|
|
5
5
|
import { defineSessionStore } from "./services/sessionStore.mjs";
|
|
6
6
|
import { toolResultText, toolResultTextLines } from "./services/toolResult.mjs";
|
|
7
7
|
import { ChannelFrame, ComputerUseHostBinding, ComputerUseHostOperation, ComputerUseHostRequest, HubChannelConnection, HubChannelHost, HubChannelLifecycle, HubChannelSource, HubSessionApiRequest, HubSessionScope, WebHubChannel } from "./types/webHub.mjs";
|
|
8
|
-
export { type ActivityGroupContribution, type ChannelFrame, type ComposerCapture, type ComposerSubmission, type ComputerUseHostBinding, type ComputerUseHostOperation, type ComputerUseHostRequest, type ContextAction, type ContextActionContribution, type ContextActionRunContext, type DockFaceContribution, type FileLinkSource, type GlobalStore, type HubChannelConnection, type HubChannelHost, type HubChannelLifecycle, type HubChannelSource, type HubSessionApiRequest, type HubSessionScope, type LeaderBindingContribution, type LeaderKeyContribution, type MinorModeContribution, type ModelContext, type ModelContextAbortSignal, type ModelContextBinding, type ModelContextExecutionOptions, type ModelContextRegistrationOptions, type ModelContextTool, type ModelContextToolChangeEvent, type ModelContextToolChangeListener, type ModelContextToolDescriptor, type PaletteCommandContext, type PaletteCommandContribution, type RepositorySettingsPanelContribution, type RepositorySettingsPanelProps, type RepositorySettingsRepository, type SelectionAxisContribution, type SessionChannelContribution, type SessionFrameSender, type SessionRecords, type SessionStore, type SessionStoreChannel, type SettingsFieldContribution, type SettingsFieldOption, type SettingsPanelContribution, type SettingsPanelProps, type SettingsSectionContribution, type SlotDataFill, type SlotDeclaration, type SlotFillContribution, type SurfaceContribution, type TabContribution, type ThreadViewOptions, type ToolMessageRenderProps, type ToolPromptContribution, type ToolPromptDialog, type ToolPromptRenderProps, type ToolRendererContribution, type ToolResultView, type TransientTab, type WebHubChannel, type WebPluginContextItem, type WebPluginDefinition, type WebPluginRuntime, type WebPluginSlotProps, defineGlobalStore, defineSessionChannel, defineSessionStore, defineSlot, defineWebPlugin, toolResultText, toolResultTextLines };
|
|
8
|
+
export { type ActivityGroupContribution, type ChannelFrame, type ComposerCapture, type ComposerSubmission, type ComputerUseHostBinding, type ComputerUseHostOperation, type ComputerUseHostRequest, type ContextAction, type ContextActionContribution, type ContextActionRunContext, type DockFaceContribution, type FileLinkSource, type GlobalStore, type HubChannelConnection, type HubChannelHost, type HubChannelLifecycle, type HubChannelSource, type HubSessionApiRequest, type HubSessionScope, type LeaderBindingContribution, type LeaderKeyContribution, type MinorModeContribution, type ModelContext, type ModelContextAbortSignal, type ModelContextBinding, type ModelContextExecutionOptions, type ModelContextRegistrationOptions, type ModelContextTool, type ModelContextToolChangeEvent, type ModelContextToolChangeListener, type ModelContextToolDescriptor, type PaletteCommandContext, type PaletteCommandContribution, type RepositorySettingsPanelContribution, type RepositorySettingsPanelProps, type RepositorySettingsRepository, type SelectionAxisContribution, type SessionChannelContribution, type SessionFrameSender, type SessionRecords, type SessionStore, type SessionStoreChannel, type SettingsFieldContribution, type SettingsFieldOption, type SettingsPanelContribution, type SettingsPanelProps, type SettingsSectionContribution, type SlotDataFill, type SlotDeclaration, type SlotFillContribution, type SurfaceContribution, type TabContribution, type ThreadViewOptions, type ToolMessageRenderProps, type ToolPromptContribution, type ToolPromptDialog, type ToolPromptRenderProps, type ToolRendererContribution, type ToolResultView, type TransientTab, type WebHubChannel, type WebPluginContextInventoryItem, type WebPluginContextItem, type WebPluginDefinition, type WebPluginRuntime, type WebPluginSlotProps, defineGlobalStore, defineSessionChannel, defineSessionStore, defineSlot, defineWebPlugin, toolResultText, toolResultTextLines };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e={}){let t=[],n={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})},fileTabFor:t=>e.fileTab?.(t),appendComposerDraft:e=>{t.push({action:`appendComposerDraft`,target:n.sessionId,text:e})},attachComposerContext:e=>{t.push({action:`attachComposerContext`,target:n.sessionId,context:e})},attachComposerCapture:e=>{t.push({action:`attachComposerCapture`,target:n.sessionId,capture:e})},contextActionsFor:t=>e.contextActions?.(t)??[],sendSessionFrame:(e,n)=>{t.push({action:`sendSessionFrame`,target:e,frame:n})},renderThread:(t,n)=>e.thread?.(t,n)??null,renderSlot:t=>e.slotContent?.[t]??null,slotData:t=>e.slotData?.[t.slot]??[]};return{props:n,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}}}exports.slotPropsFixture=e,exports.toolMessagePropsFixture=t;
|
|
1
|
+
function e(e={}){let t=[],n={sessionId:e.sessionId===void 0?`s1`:e.sessionId,statuses:e.statuses??{},contextInventory:e.contextInventory??[],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})},fileTabFor:t=>e.fileTab?.(t),appendComposerDraft:e=>{t.push({action:`appendComposerDraft`,target:n.sessionId,text:e})},attachComposerContext:e=>{t.push({action:`attachComposerContext`,target:n.sessionId,context:e})},attachComposerCapture:e=>{t.push({action:`attachComposerCapture`,target:n.sessionId,capture:e})},contextActionsFor:t=>e.contextActions?.(t)??[],sendSessionFrame:(e,n)=>{t.push({action:`sendSessionFrame`,target:e,frame:n})},renderThread:(t,n)=>e.thread?.(t,n)??null,renderSlot:t=>e.slotContent?.[t]??null,slotData:t=>e.slotData?.[t.slot]??[]};return{props:n,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}}}exports.slotPropsFixture=e,exports.toolMessagePropsFixture=t;
|
|
2
2
|
//# sourceMappingURL=slotProps.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotProps.cjs","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n ComposerCapture,\n ContextAction,\n SlotDataFill,\n SlotDeclaration,\n ThreadViewOptions,\n ToolMessageRenderProps,\n ToolResultView,\n TransientTab,\n WebPluginContextItem,\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:\n | 'appendComposerDraft'\n | 'attachComposerCapture'\n | 'attachComposerContext'\n | 'openTab'\n | 'openTransientTab'\n | 'closeTransientTab'\n | 'sendSessionFrame';\n /** The tab id, the transient tab's id, or the target session of a frame or composer action. */\n target: string | null;\n /** The text passed to `appendComposerDraft`. */\n text?: string;\n /** The structured item passed to `attachComposerContext`. */\n context?: WebPluginContextItem;\n /** The atomic screenshot and context passed to `attachComposerCapture`. */\n capture?: ComposerCapture;\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, options?: ThreadViewOptions) => ReactNode;\n /** The tab a path opens; by default no path opens one, as with no file plugin installed. */\n fileTab?: (path: string) => TransientTab | undefined;\n /** Context actions installed plugins should offer for the item under test. */\n contextActions?: (item: WebPluginContextItem) => readonly ContextAction[];\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 fileTabFor: (path: string) => options.fileTab?.(path),\n appendComposerDraft: (text) => {\n actions.push({ action: 'appendComposerDraft', target: props.sessionId, text });\n },\n attachComposerContext: (context) => {\n actions.push({ action: 'attachComposerContext', target: props.sessionId, context });\n },\n attachComposerCapture: (capture) => {\n actions.push({ action: 'attachComposerCapture', target: props.sessionId, capture });\n },\n contextActionsFor: (item) => options.contextActions?.(item) ?? [],\n sendSessionFrame: (sessionId, frame) => {\n actions.push({ action: 'sendSessionFrame', target: sessionId, frame });\n },\n renderThread: (threadId, threadOptions) => options.thread?.(threadId, threadOptions) ?? 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":"
|
|
1
|
+
{"version":3,"file":"slotProps.cjs","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n ComposerCapture,\n ContextAction,\n SlotDataFill,\n SlotDeclaration,\n ThreadViewOptions,\n ToolMessageRenderProps,\n ToolResultView,\n TransientTab,\n WebPluginContextItem,\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:\n | 'appendComposerDraft'\n | 'attachComposerCapture'\n | 'attachComposerContext'\n | 'openTab'\n | 'openTransientTab'\n | 'closeTransientTab'\n | 'sendSessionFrame';\n /** The tab id, the transient tab's id, or the target session of a frame or composer action. */\n target: string | null;\n /** The text passed to `appendComposerDraft`. */\n text?: string;\n /** The structured item passed to `attachComposerContext`. */\n context?: WebPluginContextItem;\n /** The atomic screenshot and context passed to `attachComposerCapture`. */\n capture?: ComposerCapture;\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 contextInventory?: WebPluginSlotProps['contextInventory'];\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, options?: ThreadViewOptions) => ReactNode;\n /** The tab a path opens; by default no path opens one, as with no file plugin installed. */\n fileTab?: (path: string) => TransientTab | undefined;\n /** Context actions installed plugins should offer for the item under test. */\n contextActions?: (item: WebPluginContextItem) => readonly ContextAction[];\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 contextInventory: options.contextInventory ?? [],\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 fileTabFor: (path: string) => options.fileTab?.(path),\n appendComposerDraft: (text) => {\n actions.push({ action: 'appendComposerDraft', target: props.sessionId, text });\n },\n attachComposerContext: (context) => {\n actions.push({ action: 'attachComposerContext', target: props.sessionId, context });\n },\n attachComposerCapture: (capture) => {\n actions.push({ action: 'attachComposerCapture', target: props.sessionId, capture });\n },\n contextActionsFor: (item) => options.contextActions?.(item) ?? [],\n sendSessionFrame: (sessionId, frame) => {\n actions.push({ action: 'sendSessionFrame', target: sessionId, frame });\n },\n renderThread: (threadId, threadOptions) => options.thread?.(threadId, threadOptions) ?? 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":"AAwEA,SAAgB,EAAiB,EAA4B,CAAC,EAAqB,CACjF,IAAM,EAAgC,CAAC,EACjC,EAA4B,CAChC,UAAW,EAAQ,YAAc,IAAA,GAAY,KAAqB,EAAQ,UAC1E,SAAU,EAAQ,UAAY,CAAC,EAC/B,iBAAkB,EAAQ,kBAAoB,CAAC,EAC/C,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,WAAa,GAAiB,EAAQ,UAAU,CAAI,EACpD,oBAAsB,GAAS,CAC7B,EAAQ,KAAK,CAAE,OAAQ,sBAAuB,OAAQ,EAAM,UAAW,MAAK,CAAC,CAC/E,EACA,sBAAwB,GAAY,CAClC,EAAQ,KAAK,CAAE,OAAQ,wBAAyB,OAAQ,EAAM,UAAW,SAAQ,CAAC,CACpF,EACA,sBAAwB,GAAY,CAClC,EAAQ,KAAK,CAAE,OAAQ,wBAAyB,OAAQ,EAAM,UAAW,SAAQ,CAAC,CACpF,EACA,kBAAoB,GAAS,EAAQ,iBAAiB,CAAI,GAAK,CAAC,EAChE,kBAAmB,EAAW,IAAU,CACtC,EAAQ,KAAK,CAAE,OAAQ,mBAAoB,OAAQ,EAAW,OAAM,CAAC,CACvE,EACA,cAAe,EAAU,IAAkB,EAAQ,SAAS,EAAU,CAAa,GAAK,KACxF,WAAa,GAAS,EAAQ,cAAc,IAAS,KAGrD,SAAiB,GACd,EAAQ,WAAW,EAAK,OAAS,CAAC,CACvC,EAEA,MAAO,CACL,QACA,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"}
|
|
@@ -34,6 +34,7 @@ interface SlotPropsFixture {
|
|
|
34
34
|
interface SlotPropsOptions {
|
|
35
35
|
sessionId?: string | null;
|
|
36
36
|
statuses?: Readonly<Record<string, string>>;
|
|
37
|
+
contextInventory?: WebPluginSlotProps['contextInventory'];
|
|
37
38
|
/** Component fills this slot owner should see; keyed by slot name. */
|
|
38
39
|
slotContent?: Readonly<Record<string, ReactNode>>;
|
|
39
40
|
/** Data fills this slot owner should read back, keyed by slot name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotProps.d.cts","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"mappings":";;;;;;;;;;;;;UAyBiB;EACf;;EASA;;EAEA;;EAEA,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;UAGO;EACf,OAAO;;WAEE,kBAAkB;;EAE3B,mBAAmB;;UAGJ;EACf;EACA,WAAW,SAAS;;
|
|
1
|
+
{"version":3,"file":"slotProps.d.cts","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"mappings":";;;;;;;;;;;;;UAyBiB;EACf;;EASA;;EAEA;;EAEA,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;UAGO;EACf,OAAO;;WAEE,kBAAkB;;EAE3B,mBAAmB;;UAGJ;EACf;EACA,WAAW,SAAS;EACpB,mBAAmB;;EAEnB,cAAc,SAAS,eAAe;;EAEtC,WAAW,SAAS,wBAAwB;;EAE5C,UAAU,kBAAkB,UAAU,sBAAsB;;EAE5D,WAAW,iBAAiB;;EAE5B,kBAAkB,MAAM,kCAAkC;;iBAK5C,iBAAiB,UAAS,mBAAwB;UA4CjD,gCAAgC;EAC/C;EACA;EACA,OAAO;;EAEP,SAAS;;EAET;EACA;EACA;;UAGe,gCAAgC,KAAK;EACpD,OAAO;;;iBAMO,wBAAwB,SAAS,0BAA0B"}
|
|
@@ -34,6 +34,7 @@ interface SlotPropsFixture {
|
|
|
34
34
|
interface SlotPropsOptions {
|
|
35
35
|
sessionId?: string | null;
|
|
36
36
|
statuses?: Readonly<Record<string, string>>;
|
|
37
|
+
contextInventory?: WebPluginSlotProps['contextInventory'];
|
|
37
38
|
/** Component fills this slot owner should see; keyed by slot name. */
|
|
38
39
|
slotContent?: Readonly<Record<string, ReactNode>>;
|
|
39
40
|
/** Data fills this slot owner should read back, keyed by slot name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotProps.d.mts","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"mappings":";;;;;;;;;;;;;UAyBiB;EACf;;EASA;;EAEA;;EAEA,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;UAGO;EACf,OAAO;;WAEE,kBAAkB;;EAE3B,mBAAmB;;UAGJ;EACf;EACA,WAAW,SAAS;;
|
|
1
|
+
{"version":3,"file":"slotProps.d.mts","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"mappings":";;;;;;;;;;;;;UAyBiB;EACf;;EASA;;EAEA;;EAEA,UAAU;;EAEV,UAAU;;EAEV,QAAQ;;UAGO;EACf,OAAO;;WAEE,kBAAkB;;EAE3B,mBAAmB;;UAGJ;EACf;EACA,WAAW,SAAS;EACpB,mBAAmB;;EAEnB,cAAc,SAAS,eAAe;;EAEtC,WAAW,SAAS,wBAAwB;;EAE5C,UAAU,kBAAkB,UAAU,sBAAsB;;EAE5D,WAAW,iBAAiB;;EAE5B,kBAAkB,MAAM,kCAAkC;;iBAK5C,iBAAiB,UAAS,mBAAwB;UA4CjD,gCAAgC;EAC/C;EACA;EACA,OAAO;;EAEP,SAAS;;EAET;EACA;EACA;;UAGe,gCAAgC,KAAK;EACpD,OAAO;;;iBAMO,wBAAwB,SAAS,0BAA0B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e={}){let t=[],n={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})},fileTabFor:t=>e.fileTab?.(t),appendComposerDraft:e=>{t.push({action:`appendComposerDraft`,target:n.sessionId,text:e})},attachComposerContext:e=>{t.push({action:`attachComposerContext`,target:n.sessionId,context:e})},attachComposerCapture:e=>{t.push({action:`attachComposerCapture`,target:n.sessionId,capture:e})},contextActionsFor:t=>e.contextActions?.(t)??[],sendSessionFrame:(e,n)=>{t.push({action:`sendSessionFrame`,target:e,frame:n})},renderThread:(t,n)=>e.thread?.(t,n)??null,renderSlot:t=>e.slotContent?.[t]??null,slotData:t=>e.slotData?.[t.slot]??[]};return{props:n,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};
|
|
1
|
+
function e(e={}){let t=[],n={sessionId:e.sessionId===void 0?`s1`:e.sessionId,statuses:e.statuses??{},contextInventory:e.contextInventory??[],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})},fileTabFor:t=>e.fileTab?.(t),appendComposerDraft:e=>{t.push({action:`appendComposerDraft`,target:n.sessionId,text:e})},attachComposerContext:e=>{t.push({action:`attachComposerContext`,target:n.sessionId,context:e})},attachComposerCapture:e=>{t.push({action:`attachComposerCapture`,target:n.sessionId,capture:e})},contextActionsFor:t=>e.contextActions?.(t)??[],sendSessionFrame:(e,n)=>{t.push({action:`sendSessionFrame`,target:e,frame:n})},renderThread:(t,n)=>e.thread?.(t,n)??null,renderSlot:t=>e.slotContent?.[t]??null,slotData:t=>e.slotData?.[t.slot]??[]};return{props:n,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
2
|
//# sourceMappingURL=slotProps.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotProps.mjs","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n ComposerCapture,\n ContextAction,\n SlotDataFill,\n SlotDeclaration,\n ThreadViewOptions,\n ToolMessageRenderProps,\n ToolResultView,\n TransientTab,\n WebPluginContextItem,\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:\n | 'appendComposerDraft'\n | 'attachComposerCapture'\n | 'attachComposerContext'\n | 'openTab'\n | 'openTransientTab'\n | 'closeTransientTab'\n | 'sendSessionFrame';\n /** The tab id, the transient tab's id, or the target session of a frame or composer action. */\n target: string | null;\n /** The text passed to `appendComposerDraft`. */\n text?: string;\n /** The structured item passed to `attachComposerContext`. */\n context?: WebPluginContextItem;\n /** The atomic screenshot and context passed to `attachComposerCapture`. */\n capture?: ComposerCapture;\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, options?: ThreadViewOptions) => ReactNode;\n /** The tab a path opens; by default no path opens one, as with no file plugin installed. */\n fileTab?: (path: string) => TransientTab | undefined;\n /** Context actions installed plugins should offer for the item under test. */\n contextActions?: (item: WebPluginContextItem) => readonly ContextAction[];\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 fileTabFor: (path: string) => options.fileTab?.(path),\n appendComposerDraft: (text) => {\n actions.push({ action: 'appendComposerDraft', target: props.sessionId, text });\n },\n attachComposerContext: (context) => {\n actions.push({ action: 'attachComposerContext', target: props.sessionId, context });\n },\n attachComposerCapture: (capture) => {\n actions.push({ action: 'attachComposerCapture', target: props.sessionId, capture });\n },\n contextActionsFor: (item) => options.contextActions?.(item) ?? [],\n sendSessionFrame: (sessionId, frame) => {\n actions.push({ action: 'sendSessionFrame', target: sessionId, frame });\n },\n renderThread: (threadId, threadOptions) => options.thread?.(threadId, threadOptions) ?? 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":"
|
|
1
|
+
{"version":3,"file":"slotProps.mjs","names":[],"sources":["../../../src/services/testing/slotProps.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n ComposerCapture,\n ContextAction,\n SlotDataFill,\n SlotDeclaration,\n ThreadViewOptions,\n ToolMessageRenderProps,\n ToolResultView,\n TransientTab,\n WebPluginContextItem,\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:\n | 'appendComposerDraft'\n | 'attachComposerCapture'\n | 'attachComposerContext'\n | 'openTab'\n | 'openTransientTab'\n | 'closeTransientTab'\n | 'sendSessionFrame';\n /** The tab id, the transient tab's id, or the target session of a frame or composer action. */\n target: string | null;\n /** The text passed to `appendComposerDraft`. */\n text?: string;\n /** The structured item passed to `attachComposerContext`. */\n context?: WebPluginContextItem;\n /** The atomic screenshot and context passed to `attachComposerCapture`. */\n capture?: ComposerCapture;\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 contextInventory?: WebPluginSlotProps['contextInventory'];\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, options?: ThreadViewOptions) => ReactNode;\n /** The tab a path opens; by default no path opens one, as with no file plugin installed. */\n fileTab?: (path: string) => TransientTab | undefined;\n /** Context actions installed plugins should offer for the item under test. */\n contextActions?: (item: WebPluginContextItem) => readonly ContextAction[];\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 contextInventory: options.contextInventory ?? [],\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 fileTabFor: (path: string) => options.fileTab?.(path),\n appendComposerDraft: (text) => {\n actions.push({ action: 'appendComposerDraft', target: props.sessionId, text });\n },\n attachComposerContext: (context) => {\n actions.push({ action: 'attachComposerContext', target: props.sessionId, context });\n },\n attachComposerCapture: (capture) => {\n actions.push({ action: 'attachComposerCapture', target: props.sessionId, capture });\n },\n contextActionsFor: (item) => options.contextActions?.(item) ?? [],\n sendSessionFrame: (sessionId, frame) => {\n actions.push({ action: 'sendSessionFrame', target: sessionId, frame });\n },\n renderThread: (threadId, threadOptions) => options.thread?.(threadId, threadOptions) ?? 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":"AAwEA,SAAgB,EAAiB,EAA4B,CAAC,EAAqB,CACjF,IAAM,EAAgC,CAAC,EACjC,EAA4B,CAChC,UAAW,EAAQ,YAAc,IAAA,GAAY,KAAqB,EAAQ,UAC1E,SAAU,EAAQ,UAAY,CAAC,EAC/B,iBAAkB,EAAQ,kBAAoB,CAAC,EAC/C,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,WAAa,GAAiB,EAAQ,UAAU,CAAI,EACpD,oBAAsB,GAAS,CAC7B,EAAQ,KAAK,CAAE,OAAQ,sBAAuB,OAAQ,EAAM,UAAW,MAAK,CAAC,CAC/E,EACA,sBAAwB,GAAY,CAClC,EAAQ,KAAK,CAAE,OAAQ,wBAAyB,OAAQ,EAAM,UAAW,SAAQ,CAAC,CACpF,EACA,sBAAwB,GAAY,CAClC,EAAQ,KAAK,CAAE,OAAQ,wBAAyB,OAAQ,EAAM,UAAW,SAAQ,CAAC,CACpF,EACA,kBAAoB,GAAS,EAAQ,iBAAiB,CAAI,GAAK,CAAC,EAChE,kBAAmB,EAAW,IAAU,CACtC,EAAQ,KAAK,CAAE,OAAQ,mBAAoB,OAAQ,EAAW,OAAM,CAAC,CACvE,EACA,cAAe,EAAU,IAAkB,EAAQ,SAAS,EAAU,CAAa,GAAK,KACxF,WAAa,GAAS,EAAQ,cAAc,IAAS,KAGrD,SAAiB,GACd,EAAQ,WAAW,EAAK,OAAS,CAAC,CACvC,EAEA,MAAO,CACL,QACA,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"}
|
|
@@ -139,6 +139,15 @@ interface ContextAction {
|
|
|
139
139
|
detail?: string;
|
|
140
140
|
run(): void;
|
|
141
141
|
}
|
|
142
|
+
/** Compact live inventory row exposed to Context slot components. */
|
|
143
|
+
interface WebPluginContextInventoryItem {
|
|
144
|
+
name: string;
|
|
145
|
+
itemKind: 'tool' | 'skill';
|
|
146
|
+
source: 'extension' | 'mcp' | 'plugin' | 'core';
|
|
147
|
+
owner: string;
|
|
148
|
+
tokens: number | null;
|
|
149
|
+
active: boolean;
|
|
150
|
+
}
|
|
142
151
|
/** Every slot component receives the focused session; null while nothing is focused. */
|
|
143
152
|
interface WebPluginSlotProps {
|
|
144
153
|
sessionId: string | null;
|
|
@@ -181,6 +190,8 @@ interface WebPluginSlotProps {
|
|
|
181
190
|
* own surface needs the same facts the host folds into the selection bar.
|
|
182
191
|
*/
|
|
183
192
|
statuses: Readonly<Record<string, string>>;
|
|
193
|
+
/** Runtime inventory used by Context section owners to place their own rows. */
|
|
194
|
+
contextInventory?: readonly WebPluginContextInventoryItem[];
|
|
184
195
|
/** Names of minor modes currently active in the session catalog. */
|
|
185
196
|
activeMinorModes?: readonly string[];
|
|
186
197
|
}
|
|
@@ -707,5 +718,5 @@ interface WebPluginDefinition {
|
|
|
707
718
|
start?(runtime: WebPluginRuntime): (() => void) | void;
|
|
708
719
|
}
|
|
709
720
|
//#endregion
|
|
710
|
-
export { ActivityGroupActiveSource, ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingBase, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps };
|
|
721
|
+
export { ActivityGroupActiveSource, ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingBase, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextInventoryItem, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps };
|
|
711
722
|
//# sourceMappingURL=webPlugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webPlugin.d.cts","names":[],"sources":["../../src/types/webPlugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BY,sBAAsB,mBAAmB,OAAO;;;;;;;;;;UAU3C,gBAAgB;EAC/B;;EAEA,OAAO,iBAAiB;;;UAGT,aAAa;EAC5B;EACA;EACA;EACA,MAAM;;;;;;;;UAQS;;EAEf;EACA;EACA,OAAO,cAAc;;EAErB;;;;;;;;;;;;UAYe;;EAEf,UAAU;;EAEV,YAAY;;EAEZ,QAAQ,0BAA0B,eAAe;;;;;;;;;;EAUjD,UAAU,0BAA0B,eAAe;;;;;;;UAOpC;;EAEf;;EAEA;;;UAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;EACA;;EAEA,SAAS;;;UAIM;EACf;EACA;EACA;EACA;EACA,uBAAuB;;;UAGR;;EAEf;EACA;EACA;EACA;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cAAc;;EAEvB,SAAS;;;UAGM;EACf,kBAAkB;EAClB,aAAa,OAAO;EACpB,eAAe;;EAEf,wBAAwB,QAAQ;;EAEhC,qBAAqB,WAAW,YAAY;;UAE7B;EACf;EACA,OAAO;;EAEP,YAAY;EACZ,WAAW;EACX,gBAAgB;EAChB,aAAa;EACb,iBAAiB;EACjB,WAAW;EACX,kBAAkB;;EAElB,iBAAiB;EACjB,iBAAiB;EACjB,eAAe;;EAEf,kBAAkB;EAClB,oBAAoB;;EAEpB,kBAAkB;EAClB,gBAAgB;;;;;;EAMhB,mBAAmB;;;;;EAKnB,mBAAmB;;;;;;EAMnB,iBAAiB;;;;;EAKjB,0BAA0B;;EAE1B,QAAQ;;;EAGR,QAAQ;;EAER,YAAY;;EAEZ,OAAO,SAAS"}
|
|
@@ -139,6 +139,15 @@ interface ContextAction {
|
|
|
139
139
|
detail?: string;
|
|
140
140
|
run(): void;
|
|
141
141
|
}
|
|
142
|
+
/** Compact live inventory row exposed to Context slot components. */
|
|
143
|
+
interface WebPluginContextInventoryItem {
|
|
144
|
+
name: string;
|
|
145
|
+
itemKind: 'tool' | 'skill';
|
|
146
|
+
source: 'extension' | 'mcp' | 'plugin' | 'core';
|
|
147
|
+
owner: string;
|
|
148
|
+
tokens: number | null;
|
|
149
|
+
active: boolean;
|
|
150
|
+
}
|
|
142
151
|
/** Every slot component receives the focused session; null while nothing is focused. */
|
|
143
152
|
interface WebPluginSlotProps {
|
|
144
153
|
sessionId: string | null;
|
|
@@ -181,6 +190,8 @@ interface WebPluginSlotProps {
|
|
|
181
190
|
* own surface needs the same facts the host folds into the selection bar.
|
|
182
191
|
*/
|
|
183
192
|
statuses: Readonly<Record<string, string>>;
|
|
193
|
+
/** Runtime inventory used by Context section owners to place their own rows. */
|
|
194
|
+
contextInventory?: readonly WebPluginContextInventoryItem[];
|
|
184
195
|
/** Names of minor modes currently active in the session catalog. */
|
|
185
196
|
activeMinorModes?: readonly string[];
|
|
186
197
|
}
|
|
@@ -707,5 +718,5 @@ interface WebPluginDefinition {
|
|
|
707
718
|
start?(runtime: WebPluginRuntime): (() => void) | void;
|
|
708
719
|
}
|
|
709
720
|
//#endregion
|
|
710
|
-
export { ActivityGroupActiveSource, ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingBase, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps };
|
|
721
|
+
export { ActivityGroupActiveSource, ActivityGroupContribution, ComposerCapture, ComposerSubmission, ContextAction, ContextActionContribution, ContextActionRunContext, DockFaceContribution, FileLinkSource, GlobalStore, LeaderBindingBase, LeaderBindingContribution, LeaderKeyContribution, MinorModeContribution, PaletteCommandContext, PaletteCommandContribution, RepositorySettingsPanelContribution, RepositorySettingsPanelProps, RepositorySettingsRepository, SelectionAxisContribution, SessionChannelContribution, SessionFrameSender, SessionRecords, SessionStore, SessionStoreChannel, SettingsFieldContribution, SettingsFieldOption, SettingsPanelContribution, SettingsPanelProps, SettingsSectionContribution, SlotDataFill, SlotDeclaration, SlotFillContribution, SurfaceContribution, TabContribution, ThreadViewOptions, ToolMessageRenderProps, ToolPromptContribution, ToolPromptDialog, ToolPromptRenderProps, ToolRendererContribution, ToolResultView, TransientTab, WebPluginContextInventoryItem, WebPluginContextItem, WebPluginDefinition, WebPluginRuntime, WebPluginSlotProps };
|
|
711
722
|
//# sourceMappingURL=webPlugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webPlugin.d.mts","names":[],"sources":["../../src/types/webPlugin.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BY,sBAAsB,mBAAmB,OAAO;;;;;;;;;;UAU3C,gBAAgB;EAC/B;;EAEA,OAAO,iBAAiB;;;UAGT,aAAa;EAC5B;EACA;EACA;EACA,MAAM;;;;;;;;UAQS;;EAEf;EACA;EACA,OAAO,cAAc;;EAErB;;;;;;;;;;;;UAYe;;EAEf,UAAU;;EAEV,YAAY;;EAEZ,QAAQ,0BAA0B,eAAe;;;;;;;;;;EAUjD,UAAU,0BAA0B,eAAe;;;;;;;UAOpC;;EAEf;;EAEA;;;UAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;EACA;;EAEA,SAAS;;;UAIM;EACf;EACA;EACA;EACA;EACA,uBAAuB;;;UAGR;;EAEf;EACA;EACA;EACA;;;UAIe;EACf;;EAEA,UAAU;;EAEV,mBAAmB,KAAK;EACxB,oBAAoB;;;;;;;EAOpB,aAAa,iBAAiB;;;;;;EAM9B,eAAe,kBAAkB,UAAU,sBAAsB;;EAEjE,sBAAsB;;EAEtB,wBAAwB,MAAM;;EAE9B,wBAAwB,SAAS;;EAEjC,oBAAoB,MAAM,kCAAkC;;EAE5D,kBAAkB;;EAElB,aAAa,iBAAiB;;EAE9B,WAAW,MAAM,MAAM,gBAAgB,mBAAmB,aAAa;;;;;;;EAOvE,UAAU,SAAS;;EAEnB;;;;;;;UAOe;EACf;EACA;;EAEA;EACA;EACA,YAAY,cAAc;;UAEX;;EAEf;EACA;EACA,OAAO,cAAc;;EAErB;;EAEA,YAAY;;;;;;;;;;;UAWG;;EAEf;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA,mBAAmB;;;;;;EAMnB;;UAEe;EACf;EACA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name": "@agimon-ai/doompi-web-contracts",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.20",
|
|
4
4
|
"description": "Web cockpit plugin contracts for DoomPi: plugin definitions, slot contributions, session data channels, and hub channel sources.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|