diff --git a/CHANGELOG.md b/CHANGELOG.md index 38fd3b8..17990c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,16 @@ platform API version. ### Changed +- **One declaration of the webview's behaviour flags, the command ids and + the in-process chat tool.** `DiagramClientBehavior` (with + `AcpConnectorInfo`), `DiagramCommandIds` and `InProcessChatTool` live in + `@dialogram/shared`; the API re-exports them, the toolkit's + `SidecarClientBehavior`, `SidecarProfileCommandIds` and `RegistryChatTool` + are the shared types (the product-facing behaviour is + `ProductClientBehavior`, the shared type minus the four fields the platform + derives), and the webview reads them instead of its own copy. The test that + kept two hand-written twins in step is gone with the second twin. + `scriptInterpreterCommands` is deprecated: nothing reads it. - **One sidecar transport.** Six places each spawned the sidecar, wrote the request and parsed the answer with their own wording and deadlines: the invoker behind every diagram edit, the chat's `invokeSidecarOp` and diff --git a/packages/diagram-client/src/profile.ts b/packages/diagram-client/src/profile.ts index 7e242f4..7d26ea4 100644 --- a/packages/diagram-client/src/profile.ts +++ b/packages/diagram-client/src/profile.ts @@ -1,94 +1,16 @@ -import type { NodeFamilySpec } from '@dialogram/shared'; +import type { AcpConnectorInfo, DiagramClientBehavior, DiagramCommandIds, DiagramOperationKinds } from '@dialogram/shared'; -type DiagramCommandIds = { - fitToScreen?: string; - runWorkflow?: string; - stopWorkflow?: string; - setQueueTraceVisible?: string; - setAgentToolConfig?: string; - getAgentToolConfig?: string; -}; - -type DiagramOperationKinds = { - createEntityPort?: string; - deleteEntityPort?: string; -}; - -type DiagramClientBehavior = { - graphSourceNavigation?: boolean; - networkPropertySections?: boolean; - networkNavigationLabels?: boolean; - noneSentinel?: string; - scriptInterpreterCommands?: string[]; - paletteIcons?: Record; - nodeFamilies?: NodeFamilySpec[]; - /** Whether the host has a chat backend; derived by the platform. */ - chatBackend?: boolean; - /** The ACP connectors the runtime discovered or the user declared, for an - * agent's `connector` (extension-core `AcpConnectorInfo`). */ - acpConnectors?: AcpConnectorInfo[]; - /** Whether a run can be resumed at a step of its queue trace. */ - resumeAtStep?: boolean; - /** Where a nested workflow defined in another file opens: `in-place` shows it in - * this editor, as a view of the editor's root (one editor per hierarchy); - * `new-editor` (the default) opens the file in its own editor. */ - nestedNavigation?: 'in-place' | 'new-editor'; - /** Whether a double-click on a node that is not a network instance opens the - * source it references in the text editor. Off (the default), such a node - * does nothing on double-click. For a product whose leaves have a body of - * their own that no diagram shows yet: an HDL module or entity of processes - * and assignments lands at its definition. */ - doubleClickOpensSource?: boolean; - /** Whether anything is written on a wire: the carried label (a width, a - * payload type), the queue badge and last-token button of a run, the - * index labels of a list connection. Default true. Off, an edge is its - * line, and the tooltip on hover still says what it carries. 'once': as - * true, but of the edges that leave or reach one port together with the - * same carried label, only the first writes it; the others say it in - * their tooltip (a node with many edges of one type, all on one trunk). */ - edgeCaptions?: boolean | 'once'; - /** Property-panel sections a product does without, each `false` to hide - * it (all shown by default): `ports`, the input and output port lists, for - * a product whose pins carry no meaning; `annotations`, the raw - * definition annotations, for one whose facts already say it all; - * `parameters`, the definition's parameters, for one whose nodes have - * none (its own editable fields still show); `entityType`, Basic Info's - * Type row (task, workflow) and its change-type button, for one whose - * node kinds are its own. */ - propertySections?: { ports?: boolean; annotations?: boolean; parameters?: boolean; entityType?: boolean }; - /** The profile's status source, as the context menu offers it: "Show - *