@ai-matrx/context-menu 0.1.9 → 0.1.11
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/CHANGELOG.md +12 -0
- package/dist/builder.cjs +17 -18
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.js +2 -3
- package/dist/builder.js.map +1 -1
- package/dist/{chunk-ECKA474B.js → chunk-2B37SXQW.js} +21 -12
- package/dist/chunk-2B37SXQW.js.map +1 -0
- package/dist/{chunk-TSOUI723.cjs → chunk-7TIZAANU.cjs} +26 -11
- package/dist/chunk-7TIZAANU.cjs.map +1 -0
- package/dist/{chunk-A24SBKSA.js → chunk-EG23Y2KW.js} +14 -13
- package/dist/{chunk-A24SBKSA.js.map → chunk-EG23Y2KW.js.map} +1 -1
- package/dist/{chunk-7VDSMZWI.cjs → chunk-ERFH2RZC.cjs} +18 -17
- package/dist/chunk-ERFH2RZC.cjs.map +1 -0
- package/dist/{chunk-EIP5YS4Y.js → chunk-HJU3RU2B.js} +27 -12
- package/dist/chunk-HJU3RU2B.js.map +1 -0
- package/dist/{chunk-SWEWOUHK.cjs → chunk-IH5WN5JP.cjs} +31 -26
- package/dist/chunk-IH5WN5JP.cjs.map +1 -0
- package/dist/{chunk-QXHLM7SS.cjs → chunk-LDMYNYFC.cjs} +42 -33
- package/dist/chunk-LDMYNYFC.cjs.map +1 -0
- package/dist/{chunk-ANJYKQAA.cjs → chunk-MBU4Y22O.cjs} +3 -3
- package/dist/{chunk-ANJYKQAA.cjs.map → chunk-MBU4Y22O.cjs.map} +1 -1
- package/dist/{chunk-L6DPISFT.js → chunk-NBEXJ25Z.js} +24 -19
- package/dist/{chunk-L6DPISFT.js.map → chunk-NBEXJ25Z.js.map} +1 -1
- package/dist/{chunk-LE6ZUVCO.js → chunk-PB3PMDKV.js} +2 -2
- package/dist/{chunk-NOYMFNSU.js → chunk-SJWKMZEJ.js} +33 -12
- package/dist/chunk-SJWKMZEJ.js.map +1 -0
- package/dist/{chunk-XERD2YCJ.cjs → chunk-WROBL3DR.cjs} +32 -11
- package/dist/chunk-WROBL3DR.cjs.map +1 -0
- package/dist/design-store.cjs +0 -1
- package/dist/design-store.cjs.map +1 -1
- package/dist/design-store.js +0 -1
- package/dist/design-store.js.map +1 -1
- package/dist/engine.cjs +64 -96
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +7 -7
- package/dist/engine.d.ts +7 -7
- package/dist/engine.js +72 -104
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/menu-content.cjs +18 -19
- package/dist/menu-content.cjs.map +1 -1
- package/dist/menu-content.js +4 -5
- package/dist/menu-content.js.map +1 -1
- package/dist/menu-inspect.cjs +0 -1
- package/dist/menu-inspect.cjs.map +1 -1
- package/dist/menu-inspect.js +0 -1
- package/dist/menu-inspect.js.map +1 -1
- package/dist/model.cjs +4 -5
- package/dist/model.cjs.map +1 -1
- package/dist/model.js +3 -4
- package/dist/react.cjs +52 -44
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +30 -22
- package/dist/react.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-7VDSMZWI.cjs.map +0 -1
- package/dist/chunk-CUODNUAD.cjs +0 -24
- package/dist/chunk-CUODNUAD.cjs.map +0 -1
- package/dist/chunk-ECKA474B.js.map +0 -1
- package/dist/chunk-EIP5YS4Y.js.map +0 -1
- package/dist/chunk-NOYMFNSU.js.map +0 -1
- package/dist/chunk-PE3ZHHM5.js +0 -24
- package/dist/chunk-PE3ZHHM5.js.map +0 -1
- package/dist/chunk-QXHLM7SS.cjs.map +0 -1
- package/dist/chunk-SWEWOUHK.cjs.map +0 -1
- package/dist/chunk-TSOUI723.cjs.map +0 -1
- package/dist/chunk-XERD2YCJ.cjs.map +0 -1
- /package/dist/{chunk-LE6ZUVCO.js.map → chunk-PB3PMDKV.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/menu-content.cjs","../src/engine/components/AlchemyMenuContent.tsx","../src/designed/EngineDesignedMenu.tsx","../src/designed/DesignedMenu.tsx","../src/designed/bindings.ts","../src/designed/global.menu.ts","../src/designed/rows.ts","../src/engine/components/ShortcutKeyRunner.tsx"],"names":["drawn","jsx"],"mappings":"AAAA,+8BAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACjBA,2EAAuB;AACvB,oDAAkC;AAClC,oDAAkC;AAClC,oDAAiC;AACjC,sDAA4B;AAC5B,0DAA8B;AAC9B,iFAA4D;AAC5D,+GAAwC;ADmBxC;AACA;AEtCA;AFwCA;AACA;AGnCA;AACA,qCAA6B;AAC7B,wCAA6B;AHqC7B;AACA;AIPO,IAAM,aAAA,EAAyD;AAAA;AAAA,EAEpE,SAAA,EAAW,EAAE,IAAA,EAAM,CAAC,MAAA,EAAQ,WAAW,EAAE,CAAA;AAAA,EACzC,QAAA,EAAU,EAAE,IAAA,EAAM,CAAC,KAAK,EAAE,CAAA;AAAA,EAC1B,UAAA,EAAY,EAAE,IAAA,EAAM,CAAC,OAAO,EAAE,CAAA;AAAA,EAC9B,SAAA,EAAW,EAAE,IAAA,EAAM,CAAC,MAAM,EAAE,CAAA;AAAA,EAC5B,SAAA,EAAW,EAAE,IAAA,EAAM,CAAC,MAAM,EAAE,CAAA;AAAA,EAC5B,SAAA,EAAW,EAAE,IAAA,EAAM,CAAC,MAAM,EAAE,CAAA;AAAA,EAC5B,eAAA,EAAiB,EAAE,IAAA,EAAM,CAAC,YAAY,EAAE,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EAAA;AACT;APuhEoC;AACA;AACA;AACA;AACA","file":"/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/menu-content.cjs","sourcesContent":[null,"\"use client\";\n\n// features/context-menu-v3/components/AlchemyMenuContent.tsx\n//\n// T1 + T1e for the right-click, the floating selection icon, the phone's\n// long-press sheet and the action palette — loaded by the shell through\n// next/dynamic on first open only (static import is still an eslint error).\n//\n// It runs the ONE engine hook (`useContextMenuActions` — every handler, the\n// single deduped agent fetch) and `buildMenuModel`, hands the result to the\n// Alchemy registry as this instance's provider (`alchemy-provider.ts`), and\n// renders the PACKAGE layout for the mode: `ContextMenuPanel` (desktop),\n// `ActionSheet` (phone), `ActionPalette` (palette). The click target is\n// composite, so the rich-document provider contributes the registry rows from\n// the same target — the bar, its ⋯ and this menu show one set of actions.\n\nimport { compact } from \"../utils/compact\";\nimport type { ChatRootState as RootState } from \"@ai-matrx/chat/store/root-state\";\nimport * as React from \"react\";\nimport { createClickTarget } from \"@ai-matrx/alchemy/actions\";\nimport { useAlchemyActions } from \"@ai-matrx/alchemy/react/host\";\nimport { ContextMenuPanel } from \"@ai-matrx/alchemy/react/menu\";\nimport { ActionSheet } from \"@ai-matrx/alchemy/react/sheet\";\nimport { ActionPalette } from \"@ai-matrx/alchemy/react/palette\";\nimport { SOURCE_WRITE_TARGET, richDocumentTargetHost } from \"@ai-matrx/rich-content/rich-document/actions/provider\";\nimport { useRichDocumentProvider } from \"@ai-matrx/rich-content/rich-document/actions/useRichDocumentProvider\";\nimport { useContextMenuActions } from \"../hooks/useContextMenuActions\";\nimport { buildMenuModel } from \"../model/menu-model\";\nimport { chatMessageSubject, namedHeader, contextMenuActionsFromModel, contextMenuProvider, menuEngineRevision, menuHeader, modelRevision } from \"../alchemy-provider\";\nimport { MenuRegroupContext, RegroupBoundary } from \"../regroup/RegroupContext\";\nimport type { MenuContentProps } from \"../types\";\nimport { EngineDesignedMenu } from \"../../designed/EngineDesignedMenu\";\n\nexport type AlchemyMenuMode = \"context\" | \"sheet\" | \"palette\";\n\n/**\n * Registry rows that belong to reading or editing text, not to a record: every\n * listen / read-aloud row (\"Read aloud selection\"), Compare, and Find. A\n * record-actions-only menu (a list row, a folder) leaves them out.\n */\nconst EDITOR_ONLY_RICH_IDS = new Set([\n \"compare-with-clipboard\",\n \"set-compare-base\",\n \"compare-with-base\",\n \"conversation-find\",\n]);\nexport function editorOnlyRichActionIds(actions: ReadonlyArray<{ id: string; category?: string }>): string[] {\n return actions.filter((a) => a.category === \"listen\" || EDITOR_ONLY_RICH_IDS.has(a.id)).map((a) => a.id);\n}\n\nexport interface AlchemyMenuContentProps extends Omit<MenuContentProps, \"variant\"> {\n mode: AlchemyMenuMode;\n /** Viewport point for the desktop menu (pointer, ⋯ button or floating icon). */\n point: { x: number; y: number };\n open: boolean;\n onOpenChange(open: boolean): void;\n}\n\nexport default function AlchemyMenuContent(props: AlchemyMenuContentProps): React.ReactElement {\n const { mode, point, open, onOpenChange, ...menuProps } = props;\n const m = useContextMenuActions(menuProps);\n // No fold under an invented heading (\"More…\" was removed, ALC-15 chair ruling 7): a grid's\n // own sections come first by the primary-section law; every other row keeps its own name.\n const model = buildMenuModel(m, menuProps);\n const { registry } = useAlchemyActions();\n useRichDocumentProvider();\n\n // This menu instance's provider: registered while mounted, reads the latest\n // model through a ref (handlers rebind every render).\n const instanceId = React.useId();\n // A library still loading (the first agent fetch) waits for the NEXT model\n // that changes what the menu draws, instead of vanishing (ALC-15 round 2).\n const waitersRef = React.useRef<((next: typeof model) => void)[]>([]);\n const nextModel = () => new Promise<typeof model>((resolve) => waitersRef.current.push(resolve));\n const actionsRef = React.useRef(contextMenuActionsFromModel(model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) }));\n const drawnRef = React.useRef(\"\");\n const drawn = modelRevision(model);\n React.useLayoutEffect(() => {\n actionsRef.current = contextMenuActionsFromModel(model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) });\n if (drawnRef.current !== drawn) {\n drawnRef.current = drawn;\n const waiters = waitersRef.current;\n waitersRef.current = [];\n for (const wake of waiters) wake(model);\n }\n });\n React.useEffect(\n () =>\n registry.register(contextMenuProvider(instanceId, () => actionsRef.current)),\n [registry, instanceId],\n );\n\n // A record-actions-only menu over no record source (a folder: its name is the\n // only text) contributes no document rows — no Copy as, Export, Save to or\n // agent handoff of a folder's name (page-pass /notes, 2026-09-28).\n const hasRichDocument =\n m.registryActions.length > 0 &&\n !(menuProps.recordActionsOnly && m.richDocCtx.source.type === \"raw\");\n // The source can be written back only when its adapter can save, or the\n // menu itself edits the field. A raw source (a table row's words, rendered\n // text) is read-only by definition — marking it writable put \"Open in\n // full-screen editor\" on every table row (live 2026-09-27).\n const sourceWritable =\n hasRichDocument &&\n !m.richDocCtx.source.readOnly &&\n (Boolean(m.richDocCtx.sourceAdapter.edit) || Boolean(menuProps.isEditable));\n const makeTarget = (withRich: boolean) =>\n createClickTarget({\n // The declared item under the pointer (a table row), as itemSources resolved it.\n item: menuProps.item ?? null,\n readOnly: hasRichDocument ? !sourceWritable : !menuProps.isEditable,\n writable: sourceWritable ? [SOURCE_WRITE_TARGET] : [],\n // The strip's Copy IS the registry's one-tap copy here — one row, not two.\n excludedActionIds: [\n ...m.excludedRichActionIds,\n ...(hasRichDocument ? [\"copy\"] : []),\n ...(menuProps.recordActionsOnly ? editorOnlyRichActionIds(m.registryActions) : []),\n ],\n organizationId: m.richDocCtx.organizationId,\n auth: {\n authenticated: m.richDocCtx.isAuthenticated,\n admin: m.richDocCtx.isAdmin,\n creator: m.richDocCtx.isCreator,\n },\n selection: menuProps.selectedText\n ? {\n text: menuProps.selectedText,\n type: menuProps.selectionRange?.type ?? \"non-editable\",\n start: menuProps.selectionRange?.start ?? 0,\n end: menuProps.selectionRange?.end ?? 0,\n handle: menuProps.selectionRange,\n }\n : null,\n payloadKinds: [\"markdown\"],\n host: {\n contextMenu: { kind: \"context-menu\", instanceId },\n ...(hasRichDocument && withRich\n ? {\n richDocument: richDocumentTargetHost(m.richDocCtx, {\n extra: menuProps.extraRichActions ?? [],\n }),\n }\n : {}),\n },\n });\n const [target] = React.useState(() => makeTarget(true));\n // In a field the header names the field (\"Body\"), never its raw text.\n // The message the menu opened on: its role and time, from the transcript store.\n // Either this menu IS the message's, or it is the transcript's and the\n // right-click resolved the message under the pointer — same subject.\n const chatMessage = chatMessageSubject({\n state: m.richDocCtx.getState() as unknown as RootState,\n source: m.richDocCtx.source,\n ...compact({\n extensions: m.richDocCtx.extensions,\n contextData: menuProps.contextData,\n }),\n });\n // A row (or any target) that NAMES itself wins over the generic header —\n // \"Quiz: Unit 2 review\", never \"Content: <agent context>\". A selection\n // still shows itself.\n const { content, contentLabel } =\n namedHeader(menuProps.heading, m.actionText) ?? menuHeader(m.actionText, m.fieldLabel, chatMessage);\n // Re-resolve when what the menu would draw moves (agents finish loading, a\n // toggle flips, the record is renamed) — the target object itself stays one\n // per open.\n const revision = menuEngineRevision(drawn, { content, contentLabel });\n const engine = { revision, content, contentLabel };\n\n // A pass-through everywhere except under a MenuRegroupContext (the regroup\n // demo): there it reports what resolved and may draw a proposed grouping.\n const close = () => onOpenChange(false);\n // Only under a MenuRegroupContext (the proposed-menu demo): its size and header choice.\n const regroup = React.useContext(MenuRegroupContext);\n const panelLook = { size: regroup?.size ?? \"standard\", hideHeader: regroup?.hideHeader ?? false } as const;\n // THE DESIGNED MENU (opt-in: `menuDesign` on the wrapper): the published design, bound to this\n // open's rows, drawn on the desktop right-click. Phones keep the sheet, the palette stays.\n if (menuProps.menuDesign && mode === \"context\") {\n return (\n <EngineDesignedMenu\n name={menuProps.menuDesign}\n m={m}\n model={model}\n menuProps={menuProps}\n excludedRichIds={[\n ...m.excludedRichActionIds,\n ...(menuProps.recordActionsOnly ? editorOnlyRichActionIds(m.registryActions) : []),\n ]}\n point={point}\n onClose={close}\n />\n );\n }\n if (mode === \"sheet\") {\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ActionSheet {...engine} target={target} open={open} onOpenChange={onOpenChange} />\n </RegroupBoundary>\n );\n }\n if (mode === \"palette\") {\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ActionPalette {...engine} target={target} open={open} onOpenChange={onOpenChange} />\n </RegroupBoundary>\n );\n }\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ContextMenuPanel\n {...engine}\n target={target}\n point={point}\n open={open}\n onOpenChange={onOpenChange}\n arrangement={menuProps.menuLayout}\n density={menuProps.menuDensity}\n // A control over a container of the thing (a note tab's \"…\"): its own\n // rows first, the rest under one \"<subject> ▸\" (alchemy 0.8.28).\n {...compact({ subjectFold: menuProps.subjectFold })}\n {...panelLook}\n />\n </RegroupBoundary>\n );\n}\n","\"use client\";\n// src/designed/EngineDesignedMenu.tsx — the designed menu inside TODAY's engine (phase 1).\n//\n// The small adapter the brief asks for: it takes what AlchemyMenuContent already has (the engine\n// hook's result, the built model, the props) and hands DesignedMenu plain rows and a context. A\n// later trigger replaces THIS file; DesignedMenu, MenuPanel and the bindings carry over unchanged.\n\nimport { useLayoutEffect, useRef } from \"react\";\nimport type { ContextMenuActions } from \"../engine/hooks/useContextMenuActions\";\nimport type { MenuModel } from \"../engine/model/menu-model\";\nimport type { MenuContentProps } from \"../engine/types\";\nimport { getContextMenuHost } from \"../engine/host/port\";\nimport { DesignedMenu, MENU_OPEN_MARK, MENU_PAINT_MARK } from \"./DesignedMenu\";\nimport { globalMenuDesign, globalMenuSource } from \"./global.menu\";\nimport { rowsFromEngineModel, surfaceLabelOf } from \"./rows\";\nimport { menuCounts, menuTimings, recordFetches, type FetchRecord, type InspectData } from \"./inspect-data\";\nimport type { MenuDesignName } from \"./menu-design-prop\";\nimport type { ResolvedMenu } from \"./types\";\n\nexport const PUBLISHED_DESIGNS = {\n global: { design: globalMenuDesign, source: globalMenuSource },\n} as const satisfies Record<MenuDesignName, unknown>;\n\nexport interface EngineDesignedMenuProps {\n name: MenuDesignName;\n m: ContextMenuActions;\n model: MenuModel;\n menuProps: Omit<MenuContentProps, \"variant\">;\n /** Rich-document ids the menu must not draw (surface exclusions, editor-only rows on a record). */\n excludedRichIds: readonly string[];\n point: { x: number; y: number };\n onClose: () => void;\n}\n\nexport function EngineDesignedMenu({ name, m, model, menuProps, excludedRichIds, point, onClose }: EngineDesignedMenuProps) {\n const published = PUBLISHED_DESIGNS[name];\n const rows = rowsFromEngineModel(model, { excludedRichIds, editable: Boolean(menuProps.isEditable) });\n const isAdmin = Boolean(m.isAdmin);\n\n // Admins: record what the menu fetches while it is open (layout effect: before the engine\n // hook's own fetch effect runs). Nobody else's fetch is ever wrapped.\n const fetches = useRef<FetchRecord[]>([]);\n useLayoutEffect(() => {\n if (!isAdmin) return;\n const rec = recordFetches();\n fetches.current = rec.records;\n return rec.stop;\n }, [isAdmin]);\n\n const getInspectData = (menu: ResolvedMenu): InspectData => {\n const surfaceName = menuProps.surfaceName ?? null;\n return {\n title: `${published.design.name === \"Untitled menu\" ? name : published.design.name} · ${surfaceName ?? menuProps.sourceFeature}`,\n surface: { name: surfaceName, manifest: surfaceName ? (getContextMenuHost().getSurfaceManifest(surfaceName) ?? null) : null },\n context: {\n surfaceName,\n sourceFeature: menuProps.sourceFeature,\n menuVersion: menuProps.menuVersion,\n contextData: menuProps.contextData,\n applicationScope: m.scope,\n editable: Boolean(menuProps.isEditable),\n recordActionsOnly: Boolean(menuProps.recordActionsOnly),\n selection: menuProps.selectedText\n ? { text: menuProps.selectedText, type: menuProps.selectionRange?.type ?? null, start: menuProps.selectionRange?.start ?? null, end: menuProps.selectionRange?.end ?? null }\n : null,\n actionText: m.actionText,\n fieldLabel: m.fieldLabel,\n entity: menuProps.entity ?? null,\n item: menuProps.item ?? null,\n heading: menuProps.heading ?? null,\n contentSource: menuProps.contentSource ?? null,\n flags: { isAdmin, isDebugMode: m.isDebugMode, isAdminIndicatorOpen: m.isAdminIndicatorOpen, hasCompareBase: m.hasCompareBase, canNativeUndo: m.canNativeUndo },\n },\n menu: {\n design: { designId: published.source.designId, name: published.design.name, version: published.source.version, savedAt: published.source.savedAt },\n items: menu.report.items,\n orphans: menu.report.orphans,\n duplicates: menu.report.duplicates,\n feature: menu.report.feature,\n counts: menuCounts(menu),\n },\n fetches: {\n recorded: fetches.current,\n engine: {\n libraries: { loading: m.loading, error: m.librariesError, categoryGroups: m.categoryGroups },\n boundAgents: { loading: m.boundAgentsLoading, error: m.boundAgentsError, sections: m.boundAgentSections },\n surfaceSection: m.surfaceSection,\n },\n },\n state: m.richDocCtx.getState(),\n performance: menuTimings(MENU_OPEN_MARK, MENU_PAINT_MARK),\n };\n };\n\n return (\n <DesignedMenu\n design={published.design}\n rows={rows}\n context={{\n surfaceName: menuProps.surfaceName ?? null,\n isAdmin,\n featureTitle: menuProps.menuFeatureTitle ?? null,\n surfaceLabel: surfaceLabelOf(model),\n }}\n point={point}\n onClose={onClose}\n {...(isAdmin ? { getInspectData } : {})}\n />\n );\n}\n","\"use client\";\n// src/designed/DesignedMenu.tsx — @ai-matrx/context-menu: THE DESIGNED MENU, LIVE.\n//\n// Arman's published design, bound to the rows of the menu that just opened, drawn at the pointer\n// through THE ONE menu renderer (MenuPanel — the builder draws through it too). Knows nothing of the\n// engine: it takes ModelRows (any trigger can make them) and a close callback.\n//\n// • at the pointer, in a portal; flips at the screen's edges; scrolls when taller than the window\n// • click outside, Esc, a window blur or resize closes; focus returns where it was\n// • a chosen row runs its own handler, then the menu closes (Retry-style rows keep it open)\n// • Super Admin › Inspect (admins only) loads its panel through ONE dynamic import, reached only\n// from the admin branch — a non-admin open never fetches it\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconResolver } from \"@ai-matrx/icons\";\nimport type { MenuDesign } from \"../design/model\";\nimport { resolveDesign, searchResolved, type ResolveContext } from \"./bindings\";\nimport { MenuPanel, type MenuPanelEnv } from \"./MenuPanel\";\nimport type { ModelRow, ResolvedItem, ResolvedMenu } from \"./types\";\nimport type { InspectData } from \"./inspect-data\";\n\nexport const MENU_OPEN_MARK = \"ai-matrx.context-menu.open\";\nexport const MENU_PAINT_MARK = \"ai-matrx.context-menu.painted\";\n\nexport interface DesignedMenuProps {\n design: MenuDesign;\n rows: readonly ModelRow[];\n /** surface name, admin flag, feature title, surface label. */\n context: Omit<ResolveContext, \"onInspect\">;\n /** Viewport point the menu opens at. */\n point: { x: number; y: number };\n onClose: () => void;\n /** Admins: everything Inspect shows, read when Inspect opens. */\n getInspectData?: ((menu: ResolvedMenu) => InspectData) | undefined;\n}\n\n/** The design's icons by lucide name: the static set at once, any other through the ONE lazy set. */\nfunction renderIcon(name: string, className?: string): ReactNode {\n return <IconResolver iconName={name} className={className} fallbackIcon=\"Circle\" />;\n}\n\n/** Where the menu sits: at the point, flipped left / up when it would leave the screen, then clamped. */\nexport function placeMenu(point: { x: number; y: number }, size: { width: number; height: number }, view: { width: number; height: number }) {\n const m = 8;\n let left = point.x;\n let top = point.y;\n if (left + size.width > view.width - m) left = point.x - size.width >= m ? point.x - size.width : Math.max(m, view.width - m - size.width);\n if (top + size.height > view.height - m) top = point.y - size.height >= m ? point.y - size.height : Math.max(m, view.height - m - size.height);\n return { left, top };\n}\n\nexport function DesignedMenu({ design, rows, context, point, onClose, getInspectData }: DesignedMenuProps) {\n const [query, setQuery] = useState(\"\");\n const [inspecting, setInspecting] = useState(false);\n const [at, setAt] = useState<{ left: number; top: number } | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef(onClose);\n closeRef.current = onClose;\n const isAdmin = context.isAdmin;\n\n const menu = useMemo(\n () => resolveDesign(design, rows, { ...context, ...(isAdmin && getInspectData ? { onInspect: () => setInspecting(true) } : {}) }),\n [design, rows, context, isAdmin, getInspectData],\n );\n\n // Focus returns where it was when the menu closes.\n useEffect(() => {\n const before = document.activeElement as HTMLElement | null;\n return () => {\n if (before && before.isConnected && typeof before.focus === \"function\") before.focus({ preventScroll: true });\n };\n }, []);\n\n // On screen at the pointer; the first paint is marked for Inspect's timing.\n useLayoutEffect(() => {\n const el = rootRef.current;\n if (!el || inspecting) return;\n const r = el.getBoundingClientRect();\n setAt(placeMenu(point, { width: r.width, height: r.height }, { width: window.innerWidth, height: window.innerHeight }));\n if (!el.contains(document.activeElement)) el.focus({ preventScroll: true });\n const raf = requestAnimationFrame(() => {\n try {\n performance.mark(MENU_PAINT_MARK);\n } catch {\n /* marks are best-effort */\n }\n });\n return () => cancelAnimationFrame(raf);\n }, [point, inspecting]);\n\n // Outside click, window blur or resize closes (not while Inspect is open).\n useEffect(() => {\n if (inspecting) return;\n const down = (e: PointerEvent) => {\n if (rootRef.current?.contains(e.target as Node)) return;\n closeRef.current();\n };\n const close = () => closeRef.current();\n document.addEventListener(\"pointerdown\", down, true);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n document.removeEventListener(\"pointerdown\", down, true);\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [inspecting]);\n\n const activate = (item: ResolvedItem) => {\n if (item.disabled) return;\n if (item.href) {\n if (item.target === \"_blank\") window.open(item.href, \"_blank\", \"noopener\");\n else window.location.assign(item.href);\n }\n item.run?.();\n if (!item.keepsMenuOpen) closeRef.current();\n };\n\n const env: MenuPanelEnv = {\n look: design.look,\n renderIcon,\n flyout: \"fixed\",\n onActivate: activate,\n query,\n setQuery,\n search: (q) => searchResolved(menu.nodes, q),\n onEscape: () => closeRef.current(),\n };\n\n if (typeof document === \"undefined\") return null;\n if (inspecting && isAdmin && getInspectData) {\n return createPortal(<InspectHost data={getInspectData(menu)} onClose={() => closeRef.current()} />, document.body);\n }\n return createPortal(\n <MenuPanel\n nodes={menu.nodes}\n env={env}\n className=\"cm-live\"\n style={{ left: at?.left ?? point.x, top: at?.top ?? point.y, visibility: at ? \"visible\" : \"hidden\" }}\n panelRef={(el) => {\n rootRef.current = el;\n }}\n rootProps={{\n \"data-designed-menu\": design.designId,\n onContextMenu: (e: MouseEvent) => e.preventDefault(),\n }}\n />,\n document.body,\n );\n}\n\n// ── Inspect: the admin branch's ONE dynamic edge ─────────────────────────────\n\ntype InspectModule = typeof import(\"@ai-matrx/context-menu/menu-inspect\");\n\nfunction InspectHost({ data, onClose }: { data: InspectData; onClose: () => void }) {\n const [mod, setMod] = useState<InspectModule | null>(null);\n const [failed, setFailed] = useState<string | null>(null);\n useEffect(() => {\n let live = true;\n import(\"@ai-matrx/context-menu/menu-inspect\").then(\n (m) => live && setMod(m),\n (e: unknown) => live && setFailed(e instanceof Error ? e.message : String(e)),\n );\n return () => {\n live = false;\n };\n }, []);\n if (failed) {\n return (\n <div className=\"cm-inspect\" role=\"dialog\" aria-label=\"Inspect\" onClick={onClose}>\n <div className=\"cm-inspect-body\">Inspect could not load: {failed}</div>\n </div>\n );\n }\n return mod ? <mod.InspectPanel data={data} onClose={onClose} /> : null;\n}\n","// src/designed/bindings.ts — @ai-matrx/context-menu: THE DESIGN, BOUND TO THE ROWS THAT RUN IT.\n//\n// Pure. `resolveDesign(design, rows, ctx)` walks the published design and, for every entry, finds the\n// live row that runs it — or says honestly why there is none:\n// works bound; the row's own handler runs\n// partial bound, but a variant or condition is missing (the reason says which)\n// unmatched no row runs it, or its catalog id is a stand-in used for a different meaning\n// needs-arman what it should do is unclear; nothing is guessed\n// Rows no entry binds are ORPHANS — never dropped: the page's own rows go to the feature section\n// (and \"Feature orphans\"), every other row to \"Global orphans\"; both are drawn for admins only.\n//\n// Binding order for one entry: the surface override (by design id, then by catalog id) → the\n// design rule (by design id) → the generic catalog table. A list of candidates is a list of\n// SYNONYMS (the same action under different hosts): the first one on the menu runs, the others are\n// drawn once, here, and reported as duplicates.\n\nimport {\n type MenuDesign,\n type MenuItemNode,\n type MenuNode,\n type MenuSectionNode,\n type MenuSlotNode,\n type MenuSubmenuNode,\n} from \"../design/model\";\nimport type {\n BindingStatus,\n BindingVerdict,\n ModelRow,\n OrphanVerdict,\n ResolvedItem,\n ResolvedMenu,\n ResolvedNode,\n ResolvedSection,\n ResolvedSubmenu,\n ResolveReport,\n} from \"./types\";\n\n// ── the generic table: catalog id → the rows that ARE that action ─────────────\n\nexport interface CatalogBinding {\n /** Synonyms, in preference order. Empty = no live row exists. */\n rows: readonly string[];\n status?: \"partial\" | undefined;\n reason?: string | undefined;\n}\n\nexport const CATALOG_ROWS: Readonly<Record<string, CatalogBinding>> = {\n // clipboard\n \"cm:copy\": { rows: [\"copy\", \"rich:copy\"] },\n \"cm:cut\": { rows: [\"cut\"] },\n \"cm:paste\": { rows: [\"paste\"] },\n \"cm:undo\": { rows: [\"undo\"] },\n \"cm:redo\": { rows: [\"redo\"] },\n \"cm:find\": { rows: [\"find\"] },\n \"cm:select-all\": { rows: [\"select-all\"] },\n \"cm:copy-as\": { rows: [\"copy-as\"] },\n \"cm:json\": { rows: [\"json\"] },\n \"copy-html-page\": { rows: [\"rich:copy-html-page\"] },\n \"cm:insert-reference\": { rows: [\"insert-reference\"] },\n // edit\n \"cm:save\": { rows: [\"save\"] },\n duplicate: { rows: [\"rich:conversation-duplicate\"] },\n rename: { rows: [\"rich:conversation-rename\"] },\n edit: { rows: [\"edit-in-place\", \"rich:edit\"] },\n \"cm:delete\": { rows: [\"delete\", \"rich:delete-message\"] },\n archive: { rows: [] },\n favorite: { rows: [] },\n // AI\n \"cm:chat\": { rows: [\"chat\"] },\n \"cm:quick-actions\": { rows: [\"quick-actions\"] },\n \"cm:placement:ai-action\": { rows: [\"placement:ai-action\"] },\n \"cm:placement:content-block\": { rows: [\"placement:content-block\"] },\n \"cm:placement:organization-tool\": { rows: [\"placement:organization-tool\"] },\n \"cm:placement:user-tool\": { rows: [\"placement:user-tool\"] },\n \"cm:placement:quick-action\": { rows: [\"quick-actions\"] },\n \"cm:placement:bound-agent\": { rows: [\"placement:bound-agent\"] },\n \"send-to-agent\": { rows: [\"rich:send-to-agent\"] },\n \"continue-in-chat\": { rows: [\"rich:continue-in-chat\"] },\n \"regenerate-response\": { rows: [\"rich:regenerate-response\"] },\n \"code-block-chart\": { rows: [\"rich:code-block-chart\"] },\n \"ai-improve\": { rows: [] },\n \"ai-summarize\": { rows: [] },\n \"ai-explain\": { rows: [] },\n \"ai-translate\": { rows: [] },\n // save & export\n \"cm:export\": { rows: [\"export\"], status: \"partial\", reason: \"The Export formats submenu (drawn only where there is no document); no custom export exists\" },\n \"cm:convert\": { rows: [\"convert\"] },\n \"save-as-file\": { rows: [\"rich:save-as-file\"] },\n \"download-pdf\": { rows: [\"rich:download-pdf\"] },\n \"download-docx\": { rows: [\"rich:download-docx\"] },\n \"download-html\": { rows: [\"rich:download-html\"] },\n print: { rows: [\"rich:print\"] },\n // share & publish\n \"cm:share\": { rows: [\"share\", \"rich:conversation-share\"] },\n \"share-link\": { rows: [\"rich:conversation-copy-link\"] },\n \"send-google-doc\": { rows: [\"rich:send-google-doc\"] },\n \"email-to-me\": { rows: [\"rich:email-to-me\"] },\n \"html-preview\": { rows: [\"rich:html-preview\"] },\n \"share-webpage\": { rows: [\"rich:share-webpage\"] },\n // organize\n \"cm:attach\": { rows: [\"attach\"] },\n \"set-context-value\": { rows: [\"rich:set-context-value\"] },\n \"pin-message\": { rows: [\"rich:pin-message\"] },\n \"notes-and-comments\": { rows: [\"rich:notes-and-comments\"] },\n move: { rows: [] },\n tags: { rows: [] },\n // history & compare\n \"cm:view-history\": { rows: [\"view-history\"] },\n \"edit-history\": { rows: [\"rich:edit-history\"] },\n \"fork-at-message\": { rows: [\"rich:fork-at-message\"] },\n \"cm:compare\": {\n rows: [\"rich:compare-with-base\", \"compare:with-base\", \"compare\"],\n status: \"partial\",\n reason: \"Opens Compare against the saved base; there is no blank compare window\",\n },\n \"compare-with-clipboard\": { rows: [\"rich:compare-with-clipboard\", \"compare:clipboard\"] },\n \"set-compare-base\": { rows: [\"rich:set-compare-base\", \"compare:set-base\"] },\n // listen\n \"cm:speak\": { rows: [\"speak\", \"rich:tts-play\"] },\n \"cm:listen\": { rows: [\"listen\"] },\n \"tts-voice-settings\": { rows: [\"rich:tts-voice-settings\"] },\n // notes page rows\n \"notes:close-tab\": { rows: [\"extra:notes-ops/close-tab\"] },\n \"notes:close-others\": { rows: [\"extra:notes-ops/close-others\"] },\n \"notes:export-md\": { rows: [\"extra:notes-ops/export\", \"extra:note-actions/export-markdown\", \"rich:save-as-file\"] },\n \"notes:share-clipboard\": { rows: [\"extra:notes-ops/share-clipboard\"] },\n \"notes:convert-artifacts\": { rows: [\"extra:notes-ops/convert-artifacts\"] },\n \"notes:trash\": { rows: [\"extra:notes-ops/delete\", \"extra:note-actions/delete\"] },\n // chat message rows\n \"regenerate-latest\": { rows: [\"rich:regenerate-latest\"] },\n \"fork-and-regenerate\": { rows: [\"rich:fork-and-regenerate\"] },\n \"feedback-up\": { rows: [\"rich:thumbs-up\"] },\n \"feedback-down\": { rows: [\"rich:thumbs-down\"] },\n // tools & admin\n \"cm:x:surface\": { rows: [\"surface/surface\"] },\n \"cm:admin\": { rows: [\"admin\"] },\n feedback: { rows: [\"rich:submit-feedback\"] },\n \"keyboard-shortcuts\": { rows: [] },\n // audit rows that have a live row\n \"audit:114\": { rows: [\"rich:add-to-rulebook\"] },\n};\n\n// ── per surface: the same catalog id is a different row on that page ─────────\n\nexport interface SurfaceOverride {\n id: string;\n /** Matches when the menu's surface name starts with one of these… */\n surfaceNames: readonly string[];\n /** …or when the menu carries one of these host sections. */\n sections: readonly string[];\n /** catalog id, or `#<design id>` for one entry, → synonyms (prepended to the generic rows). */\n rows: Readonly<Record<string, readonly string[]>>;\n}\n\nexport const SURFACE_OVERRIDES: readonly SurfaceOverride[] = [\n {\n id: \"notes\",\n surfaceNames: [\"matrx-user/notes\"],\n sections: [\"extra:notes-ops\", \"extra:note-actions\"],\n rows: {\n \"cm:save\": [\"extra:notes-ops/save\"],\n duplicate: [\"extra:notes-ops/duplicate\", \"extra:note-actions/duplicate\"],\n rename: [\"extra:note-actions/rename\"],\n move: [\"extra:notes-ops/move\", \"extra:note-actions/move-to-folder\"],\n \"cm:view-history\": [\"extra:note-actions/version-history\"],\n \"cm:share\": [\"extra:note-actions/share\"],\n \"share-link\": [\"extra:notes-ops/share-link\"],\n \"cm:delete\": [\"extra:notes-ops/delete\", \"extra:note-actions/delete\"],\n print: [\"rich:print\", \"extra:note-actions/print-document\"],\n // Send & Convert › Add to knowledge base — the note's own knowledge row.\n \"#i_4b63cb20\": [\"extra:note-actions/knowledge\"],\n },\n },\n];\n\n// ── per design entry: what the catalog id cannot say ─────────────────────────\n\nexport interface DesignRule {\n /** The entry's label when the rule was written (a test flags a republished design that moved it). */\n label: string;\n /** Replaces the catalog synonyms. */\n rows?: readonly string[];\n status?: \"partial\" | \"unmatched\" | \"needs-arman\";\n reason?: string;\n /** A submenu or item filled from a live row's children (`append`: after the design's own items). */\n fill?: { from: string; mode: \"children\" | \"append\" | \"inline\" };\n /** This entry is drawn by the entry named here (one fill stands for several mock rows). */\n mergedInto?: string;\n orphans?: \"feature\" | \"global\";\n /** Drawn only for admins; Inspect lives here. */\n superAdmin?: boolean;\n}\n\nconst PROPOSED = \"Proposed option — no live row runs it yet\";\n\n/** THE GLOBAL MENU's rules (design d_0707ad42). Keyed by design node id. */\nexport const GLOBAL_DESIGN_RULES: Readonly<Record<string, DesignRule>> = {\n i_82154a6b: { label: \"Archive\", status: \"unmatched\", reason: \"No archive row exists on any menu; notes offer Move to Trash (Content › Delete)\" },\n // Intelligence\n i_f9319837: { label: \"Create Agent for this\", status: \"needs-arman\", reason: \"Dragged from Chat; no create-agent row exists — what should it open?\" },\n m_294ffd3a: { label: \"AI Actions\", fill: { from: \"placement:ai-action\", mode: \"append\" } },\n i_ec0a5001: { label: \"Improve writing\", status: \"unmatched\", reason: PROPOSED },\n i_41dc4c76: { label: \"Summarize\", status: \"unmatched\", reason: PROPOSED },\n i_65ebe1a4: { label: \"Explain\", status: \"unmatched\", reason: PROPOSED },\n i_29261564: { label: \"Translate…\", status: \"unmatched\", reason: PROPOSED },\n m_e157dbc8: { label: \"Agents\", fill: { from: \"placement:bound-agent\", mode: \"children\" } },\n s_c3e45d72: {\n label: \"Surface Intelligence\",\n status: \"needs-arman\",\n reason: \"Empty in the design; the page's surface submenu (location, context, agents) is the likely fill — it sits in Feature orphans until placed\",\n },\n i_56c420c8: { label: \"Kind Shapes\", status: \"needs-arman\", reason: \"No catalog option; what should Kind Shapes list or open?\" },\n i_35f46721: { label: \"Artifacts\", status: \"needs-arman\", reason: \"No catalog option; what should Artifacts list or open?\" },\n // My Intelligence\n i_e6795a3d: { label: \"My custom agent 1\", fill: { from: \"placement:user-tool\", mode: \"inline\" } },\n i_17e1a01b: { label: \"My custom agent 2\", mergedInto: \"i_e6795a3d\" },\n i_77e75862: { label: \"My custom agent 3, 4 ...\", mergedInto: \"i_e6795a3d\" },\n m_5838209d: { label: \"My custom folder\", status: \"needs-arman\", reason: \"Your categories already arrive with the live My Items rows; is a folder a category?\" },\n m_a5717277: { label: \"My custom folder\", status: \"needs-arman\", reason: \"Your categories already arrive with the live My Items rows; is a folder a category?\" },\n s_b6b6e037: { label: \"Organizations\", status: \"needs-arman\", reason: \"Org Items (organization tools) is the likely fill — in Global orphans until ruled\" },\n s_333c203b: { label: \"Shared with me\", status: \"unmatched\", reason: \"No shared-with-me rows reach the menu\" },\n i_e4f67cb6: { label: \"Customize\", status: \"needs-arman\", reason: \"No row; what should Customize open?\" },\n // Content\n i_b95bebe0: { label: \"Refresh\", status: \"needs-arman\", reason: \"Dragged from Edit; what should Refresh do?\" },\n i_97bfd2a2: { label: \"Cleanup\", status: \"needs-arman\", reason: \"Dragged from Edit; Clean up (rich:text-cleanup) is the likely row — in Global orphans until ruled\" },\n i_eeb51a1e: { label: \"Outline\", status: \"needs-arman\", reason: \"Dragged from Edit; no outline row exists — what should Outline do?\" },\n i_0c67e994: { label: \"Search with AI\", status: \"unmatched\", reason: \"Dragged from Find & Replace; no AI search row exists\" },\n i_a69ba340: { label: \"Improve writing\", status: \"unmatched\", reason: PROPOSED },\n i_3c09ec12: { label: \"Summarize\", status: \"unmatched\", reason: PROPOSED },\n i_02a7fbac: { label: \"Expand content\", status: \"unmatched\", reason: \"Dragged from Summarize (proposed); no expand row exists\" },\n i_5b3f6d51: { label: \"Make a table\", status: \"unmatched\", reason: \"Dragged from Summarize (proposed); no make-a-table row exists\" },\n // Copy\n i_1f2dd157: { label: \"Raw Text\", status: \"partial\", reason: \"Runs plain Copy: the text as written, markdown included\" },\n i_4958860f: { label: \"Strip markdown\", rows: [\"rich:copy-plain-text\"] },\n i_b8fa8de1: { label: \"For Google Docs & Gmail\", status: \"partial\", reason: \"Runs plain Copy; no rich-text (HTML clipboard) copy row exists\" },\n i_68b385a6: { label: \"For Microsoft Office\", status: \"partial\", reason: \"Runs plain Copy; no Office-formatted copy row exists\" },\n i_6f508d32: { label: \"Structured For AI\", status: \"partial\", reason: \"Runs plain Copy; no structured-for-AI copy row exists\" },\n i_a4ce9583: { label: \"With Context\", status: \"partial\", reason: \"Runs plain Copy; no copy-with-context row exists\" },\n i_834c201b: { label: \"With Prompt\", status: \"partial\", reason: \"Runs plain Copy; no copy-with-prompt row exists\" },\n i_c1ceed9d: { label: \"Copy reference\", status: \"partial\", reason: \"The reference row inserts the reference in an editable field and copies it elsewhere\" },\n i_84d0d88a: { label: \"Custom edit\", status: \"unmatched\", reason: \"Dragged from Copy as…; no custom-edit row exists\" },\n // feature orphans\n s_1abf26db: { label: \"Feature orphans\", orphans: \"feature\" },\n // Export & Download\n i_66ee72ce: { label: \"Download with AI\", status: \"needs-arman\", reason: \"Dragged from Find & Replace; what should Download with AI do?\" },\n // Send & Convert\n i_720df996: { label: \"Add to Active Context\", status: \"unmatched\", reason: \"Dragged from Convert; no row adds to the active context (Set Context Value sets one value)\" },\n i_4b63cb20: { label: \"Add to knowledge base\", status: \"unmatched\", reason: \"Only notes have a knowledge-base row; elsewhere nothing runs it\" },\n i_fdaa2e24: { label: \"Open in Canvas\", status: \"unmatched\", reason: \"Dragged from Convert; no open-in-canvas row exists\" },\n i_a207c217: { label: \"Notes\", rows: [\"rich:save-to-notes\"] },\n i_18eb28c6: { label: \"Document\", rows: [\"rich:add-to-docs\"] },\n i_5f78991d: { label: \"File\", rows: [\"rich:save-to-files\"] },\n i_bed92d83: { label: \"Task\", rows: [\"rich:save-to-task\"] },\n i_c86ed71c: { label: \"Project\", status: \"unmatched\", reason: \"Dragged from Convert; no save-to-project row exists\" },\n i_dbdcad1a: { label: \"Custom data\", status: \"unmatched\", reason: \"Dragged from Convert; only a table can be saved as data (rich:save-table-as-data)\" },\n i_07b55ba5: { label: \"Send via DM\", status: \"needs-arman\", reason: \"Dragged from Email to me; no direct-message row exists — to whom, through what?\" },\n i_eca3b31b: { label: \"Convert with AI\", status: \"needs-arman\", reason: \"Dragged from Find & Replace; what should Convert with AI do?\" },\n i_73a06d6f: { label: \"Custom convert\", status: \"needs-arman\", reason: \"Dragged from Convert; what is a custom convert?\" },\n i_16ae6cf2: { label: \"To any connection...\", status: \"needs-arman\", reason: \"Dragged from Convert; which connections, and what is sent?\" },\n // Listen & Speak\n i_f65633d0: { label: \"Dictate\", status: \"unmatched\", reason: \"cm:listen is Listen (spoken summary), not dictation; Quick Actions › Voice Input opens the voice pad\" },\n i_733fc812: { label: \"Condense & Read\", rows: [\"rich:summarize-and-listen\", \"spoken-summary-live\"] },\n // Help\n i_ab248359: { label: \"Help me with this\", status: \"needs-arman\", reason: \"No catalog option; Help with this… (rich:text-help) edits the text — is that it?\" },\n i_fbdcca01: { label: \"I found a bug\", status: \"needs-arman\", reason: \"No catalog option; Submit feedback (rich:submit-feedback) is the likely row\" },\n i_9c46db53: { label: \"Request a feature\", status: \"needs-arman\", reason: \"No catalog option; Submit feedback (rich:submit-feedback) is the likely row\" },\n i_12784f2c: { label: \"Info\", status: \"needs-arman\", reason: \"No catalog option; notes have About this note — what should Info show elsewhere?\" },\n // Organize\n i_d8e4c6b9: { label: \"Tags…\", status: \"unmatched\", reason: \"No tags row exists on any menu\" },\n // Admin\n m_74072d95: { label: \"Creator Options\", status: \"unmatched\", reason: \"No creator rows reach the menu yet\" },\n m_32f84a2e: { label: \"Org Admin\", status: \"unmatched\", reason: \"The host gives the menu no org-admin flag and no org-admin rows\" },\n s_888d81ec: { label: \"Super Admin\", fill: { from: \"admin\", mode: \"children\" }, superAdmin: true },\n m_54111c0a: { label: \"Global orphans\", orphans: \"global\" },\n};\n\n/** The rules for each published design. */\nexport const DESIGN_RULES: Readonly<Record<string, Readonly<Record<string, DesignRule>>>> = {\n d_0707ad42: GLOBAL_DESIGN_RULES,\n};\n\n// ── resolution ───────────────────────────────────────────────────────────────\n\nexport interface ResolveContext {\n surfaceName?: string | null | undefined;\n /** Admin per the host's Redux admin flag: orphans and Super Admin draw only then. */\n isAdmin: boolean;\n /** The host's own name for the feature section; else the surface's display label. */\n featureTitle?: string | null | undefined;\n surfaceLabel?: string | null | undefined;\n /** Super Admin › Inspect (admins only). */\n onInspect?: (() => void) | undefined;\n}\n\nexport function indexRows(rows: readonly ModelRow[], out = new Map<string, ModelRow>()): Map<string, ModelRow> {\n for (const r of rows) {\n if (!out.has(r.key)) out.set(r.key, r);\n if (r.children) indexRows(r.children, out);\n }\n return out;\n}\n\nexport function activeOverrides(rows: ReadonlyMap<string, ModelRow>, ctx: Pick<ResolveContext, \"surfaceName\">): SurfaceOverride[] {\n const sections = new Set([...rows.values()].map((r) => r.section));\n return SURFACE_OVERRIDES.filter(\n (o) =>\n (ctx.surfaceName && o.surfaceNames.some((n) => (ctx.surfaceName as string).startsWith(n))) ||\n o.sections.some((s) => sections.has(s)),\n );\n}\n\ninterface Candidates {\n rows: readonly string[];\n status?: BindingStatus | undefined;\n reason?: string | undefined;\n /** The rows came from a surface override (it outranks a rule's status). */\n fromSurface?: boolean;\n}\n\nfunction candidatesFor(node: MenuNode, rule: DesignRule | undefined, overrides: readonly SurfaceOverride[]): Candidates | null {\n for (const o of overrides) {\n const byId = o.rows[`#${node.id}`];\n if (byId) return { rows: byId, fromSurface: true };\n }\n if (rule?.status === \"needs-arman\" || rule?.status === \"unmatched\") {\n return { rows: [], status: rule.status, reason: rule.reason };\n }\n const generic = node.catalogId ? CATALOG_ROWS[node.catalogId] : undefined;\n const surface = node.catalogId ? overrides.flatMap((o) => o.rows[node.catalogId as string] ?? []) : [];\n const rows = [...surface, ...(rule?.rows ?? generic?.rows ?? [])];\n if (!rule?.rows && !generic && surface.length === 0) return null;\n const status = rule?.status ?? (rule?.rows ? undefined : generic?.status);\n const reason = rule?.reason ?? (rule?.rows ? undefined : generic?.reason);\n return { rows, ...(status ? { status } : {}), ...(reason ? { reason } : {}) };\n}\n\ninterface Walk {\n rows: ReadonlyMap<string, ModelRow>;\n rules: Readonly<Record<string, DesignRule>>;\n overrides: readonly SurfaceOverride[];\n ctx: ResolveContext;\n /** Row keys a design entry placed (with their descendants). */\n consumed: Set<string>;\n duplicates: ResolveReport[\"duplicates\"];\n verdicts: BindingVerdict[];\n /** Filled after the walk (orphans and the feature section need every binding first). */\n late: Array<() => void>;\n /** The top-level rows, in the engine's order. */\n tops: readonly ModelRow[];\n report: ResolveReport;\n}\n\nfunction consume(row: ModelRow, w: Walk): void {\n w.consumed.add(row.key);\n row.children?.forEach((c) => consume(c, w));\n}\n\nfunction iconOf(row: ModelRow | undefined, name: string | undefined) {\n if (row?.icon) return { component: row.icon, ...(row.iconClassName ? { className: row.iconClassName } : {}), ...(row.iconStyle ? { style: row.iconStyle } : {}) };\n return name ? { name } : undefined;\n}\n\n/** A live row as a drawn node (fills, the feature section, orphans). */\nexport function rowNode(row: ModelRow, idPrefix: string): ResolvedNode {\n const id = `${idPrefix}${row.key}`;\n const keywords = [row.hint, row.description, row.sectionLabel].filter((x): x is string => Boolean(x));\n if (row.kind === \"submenu\") {\n const children: ResolvedNode[] = [];\n for (const c of row.children ?? []) {\n if (c.startsGroup && children.length > 0) children.push({ kind: \"divider\", id: `${idPrefix}${c.key}:sep` });\n children.push(rowNode(c, idPrefix));\n }\n return {\n kind: \"submenu\",\n id,\n label: row.label,\n icon: iconOf(row, undefined),\n binding: row.key,\n disabled: row.disabled,\n ...(row.reason ? { disabledReason: row.reason } : {}),\n ...(row.loading ? { loading: true } : {}),\n keywords,\n children,\n };\n }\n return {\n kind: \"item\",\n id,\n label: row.label,\n icon: iconOf(row, undefined),\n binding: row.key,\n disabled: row.disabled,\n ...(row.reason ? { disabledReason: row.reason } : {}),\n ...(row.hint ? { shortcut: row.hint } : {}),\n ...(row.description ? { hint: row.description } : {}),\n keywords,\n ...(row.destructive ? { danger: true } : {}),\n ...(row.kind === \"checkbox\" ? { toggle: true, checked: Boolean(row.checked) } : {}),\n ...(row.href ? { href: row.href, ...(row.target ? { target: row.target } : {}) } : {}),\n ...(row.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n ...(row.run ? { run: row.run } : {}),\n };\n}\n\nfunction availabilityOf(row: ModelRow | undefined): BindingVerdict[\"availability\"] {\n return row ? (row.disabled ? \"disabled\" : \"here\") : \"absent\";\n}\n\n/** Apply the design's unavailable rule. Returns null when the entry is to be left out. */\nfunction applyUnavailable<T extends ResolvedItem | ResolvedSubmenu>(node: T, design: MenuNode, row: ModelRow | undefined): T | null {\n const unavailable = !row || row.disabled;\n if (!unavailable) return node;\n const mode = design.unavailable ?? \"disable\";\n if (mode === \"hide\") return null;\n if (mode === \"required\" && !row) {\n return { ...node, disabled: true, missingRequired: true, disabledReason: \"Required here, but missing\" };\n }\n return { ...node, disabled: true, disabledReason: row?.reason ?? design.unavailableWhen ?? \"Not available here\" };\n}\n\nfunction verdict(w: Walk, node: MenuNode, path: string[], v: Omit<BindingVerdict, \"designId\" | \"label\" | \"path\" | \"catalogId\">): void {\n w.verdicts.push({\n designId: node.id,\n label: \"label\" in node ? node.label : \"\",\n path: path.join(\" › \"),\n ...(node.catalogId ? { catalogId: node.catalogId } : {}),\n ...v,\n });\n}\n\n/** Bind one design item (or a submenu bound as a whole). */\nfunction bindEntry(node: MenuItemNode | MenuSubmenuNode, w: Walk, path: string[]): { row?: ModelRow; status: BindingStatus; reason?: string; binding?: string } {\n const rule = w.rules[node.id];\n const c = candidatesFor(node, rule, w.overrides);\n if (!c) {\n const reason = node.catalogId ? `No live row for ${node.catalogId}` : \"Not dragged from the catalog; nothing runs it\";\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return { status: \"unmatched\", reason };\n }\n if (c.status === \"needs-arman\" || c.status === \"unmatched\") {\n verdict(w, node, path, { status: c.status, ...(c.reason ? { reason: c.reason } : {}), availability: \"none\" });\n return { status: c.status, ...(c.reason ? { reason: c.reason } : {}) };\n }\n if (c.rows.length === 0) {\n const reason = node.catalogId?.startsWith(\"ai-\") ? PROPOSED : `No live row for ${node.catalogId}`;\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return { status: \"unmatched\", reason };\n }\n const present = c.rows.map((k) => w.rows.get(k)).filter((r): r is ModelRow => Boolean(r));\n const row = present.find((r) => !r.disabled) ?? present[0];\n const status: BindingStatus = c.fromSurface ? \"works\" : (c.status ?? \"works\");\n for (const r of present) {\n if (row && r !== row && !w.consumed.has(r.key)) w.duplicates.push({ key: r.key, label: r.label, duplicateOf: row.key });\n consume(r, w);\n }\n const binding = row?.key ?? c.rows[0];\n verdict(w, node, path, {\n status,\n ...(binding ? { binding } : {}),\n ...(c.reason && !c.fromSurface ? { reason: c.reason } : {}),\n availability: availabilityOf(row),\n });\n return { ...(row ? { row } : {}), status, ...(c.reason && !c.fromSurface ? { reason: c.reason } : {}), ...(binding ? { binding } : {}) };\n}\n\nfunction resolveItem(node: MenuItemNode, w: Walk, path: string[]): ResolvedNode[] {\n const rule = w.rules[node.id];\n if (rule?.mergedInto) return [];\n if (rule?.fill?.mode === \"inline\") {\n const from = w.rows.get(rule.fill.from);\n const kids = from?.children ?? [];\n if (from) consume(from, w);\n verdict(w, node, path, {\n status: \"works\",\n binding: rule.fill.from,\n reason: \"Filled at runtime with the live rows\",\n availability: from ? (kids.length ? \"here\" : \"disabled\") : \"absent\",\n });\n if (kids.length === 0) {\n return [{ kind: \"item\", id: node.id, designId: node.id, label: \"Nothing here yet\", disabled: true, disabledReason: from?.reason ?? \"No rows of this kind for you yet\" }];\n }\n return kids.map((k) => ({ ...rowNode(k, `${node.id}:`), designId: node.id }));\n }\n const b = bindEntry(node, w, path);\n const row = b.row;\n // A design item bound to a submenu row draws as that submenu.\n if (row?.kind === \"submenu\") {\n const sub = rowNode(row, `${node.id}:`) as ResolvedSubmenu;\n const drawn: ResolvedSubmenu = {\n ...sub,\n id: node.id,\n designId: node.id,\n label: node.label,\n icon: iconOf(row, node.icon),\n status: b.status,\n ...(b.reason ? { statusReason: b.reason } : {}),\n keywords: [...(node.keywords ?? []), row.label, ...(sub.keywords ?? [])],\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n };\n const kept = applyUnavailable(drawn, node, row);\n return kept ? [kept] : [];\n }\n const drawn: ResolvedItem = {\n kind: \"item\",\n id: node.id,\n designId: node.id,\n label: node.label,\n icon: iconOf(row, node.icon),\n ...(node.shortcut ? { shortcut: node.shortcut } : row?.hint ? { shortcut: row.hint } : {}),\n ...(node.hint ? { hint: node.hint } : {}),\n keywords: [...(node.keywords ?? []), ...(row ? [row.label, row.description ?? \"\"] : [])].filter(Boolean),\n status: b.status,\n ...(b.reason ? { statusReason: b.reason } : {}),\n ...(b.binding ? { binding: b.binding } : {}),\n disabled: b.status === \"unmatched\" || b.status === \"needs-arman\" ? true : Boolean(row?.disabled),\n ...(row?.reason ? { disabledReason: row.reason } : {}),\n ...(node.danger || row?.destructive ? { danger: true } : {}),\n ...(node.ai ? { ai: true } : {}),\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n ...(node.toggle || row?.kind === \"checkbox\" ? { toggle: true, checked: row?.kind === \"checkbox\" ? Boolean(row.checked) : Boolean(node.defaultOn) } : {}),\n ...(node.switch ? { switch: true, checked: Boolean(row?.checked ?? node.defaultOn) } : {}),\n ...(row?.href ? { href: row.href, ...(row.target ? { target: row.target } : {}) } : {}),\n ...(row?.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n ...(row?.run ? { run: row.run } : {}),\n source: node,\n };\n if (b.status === \"unmatched\" || b.status === \"needs-arman\") return [drawn];\n const kept = applyUnavailable(drawn, node, row);\n return kept ? [kept] : [];\n}\n\nfunction resolveSubmenu(node: MenuSubmenuNode, w: Walk, path: string[]): ResolvedNode[] {\n const rule = w.rules[node.id];\n const here = [...path, node.label];\n const base = {\n kind: \"submenu\" as const,\n id: node.id,\n designId: node.id,\n label: node.label,\n ...(node.icon ? { icon: { name: node.icon } } : {}),\n ...(node.hint ? { hint: node.hint } : {}),\n ...(node.keywords ? { keywords: node.keywords } : {}),\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n };\n if (rule?.superAdmin && !w.ctx.isAdmin) return [];\n if (rule?.orphans) {\n if (!w.ctx.isAdmin) return [];\n const drawn: ResolvedSubmenu = { ...base, disabled: false, children: [] };\n // The rows are known only once every entry has bound.\n w.late.push(() => {\n drawn.children = orphanNodes(rule.orphans as \"feature\" | \"global\", w);\n if (drawn.children.length === 0) {\n drawn.disabled = true;\n drawn.disabledReason = \"Every row of this kind is placed\";\n }\n });\n verdict(w, node, path, { status: \"works\", reason: \"Rows no entry places, for admins\", availability: \"here\" });\n return [drawn];\n }\n if (rule?.status === \"needs-arman\" || rule?.status === \"unmatched\") {\n verdict(w, node, path, { status: rule.status, ...(rule.reason ? { reason: rule.reason } : {}), availability: \"none\" });\n return [{ ...base, status: rule.status, ...(rule.reason ? { statusReason: rule.reason } : {}), disabled: true, children: resolveList(node.children, w, here) }];\n }\n const own = resolveList(node.children, w, here);\n if (rule?.fill) {\n const from = w.rows.get(rule.fill.from);\n if (from) consume(from, w);\n const filled = (from?.children ?? []).flatMap((c, i) => {\n const n = rowNode(c, `${node.id}:`);\n return c.startsGroup && i > 0 ? [{ kind: \"divider\" as const, id: `${node.id}:${c.key}:sep` }, n] : [n];\n });\n const extra: ResolvedNode[] = [];\n if (rule.superAdmin && w.ctx.onInspect) {\n extra.push({ kind: \"item\", id: `${node.id}:inspect`, designId: node.id, label: \"Inspect\", icon: { name: \"ScanSearch\" }, disabled: false, keywords: [\"debug\", \"json\", \"context\"], run: w.ctx.onInspect, keepsMenuOpen: true });\n }\n const children = [...own, ...(own.length && filled.length ? [{ kind: \"divider\" as const, id: `${node.id}:fill-sep` }] : []), ...filled, ...(extra.length && (own.length || filled.length) ? [{ kind: \"divider\" as const, id: `${node.id}:inspect-sep` }] : []), ...extra];\n verdict(w, node, path, {\n status: \"works\",\n binding: rule.fill.from,\n reason: rule.fill.mode === \"append\" ? \"The live rows follow the design's own\" : \"Filled at runtime with the live rows\",\n availability: from ? (filled.length ? \"here\" : \"disabled\") : \"absent\",\n });\n return [\n {\n ...base,\n status: \"works\",\n binding: rule.fill.from,\n disabled: children.length === 0,\n ...(children.length === 0 ? { disabledReason: from?.reason ?? \"Nothing here yet\" } : {}),\n ...(from?.loading ? { loading: true } : {}),\n children,\n },\n ];\n }\n if (node.children.length === 0) {\n // An empty submenu dragged from the catalog binds like an item (Compare, Export…).\n if (node.catalogId) return resolveItem({ ...node, kind: \"item\" } as unknown as MenuItemNode, w, path);\n const reason = \"Empty in the design; nothing is bound to it\";\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return [{ ...base, status: \"unmatched\", statusReason: reason, disabled: true, children: [] }];\n }\n return [{ ...base, disabled: false, children: own }];\n}\n\nfunction resolveSection(node: MenuSectionNode, w: Walk, path: string[]): ResolvedSection {\n const here = node.label ? [...path, node.label] : path;\n return {\n kind: \"section\",\n id: node.id,\n designId: node.id,\n label: node.label,\n layout: node.layout ?? \"list\",\n ...(node.collapsible ? { collapsible: true } : {}),\n children: resolveList(node.children, w, here),\n };\n}\n\n/** THE FEATURE SECTION: the page's own rows — the first N, the rest under \"More\". */\nfunction resolveFeature(node: MenuSlotNode, w: Walk): ResolvedNode[] {\n const holder: ResolvedSection = { kind: \"section\", id: node.id, designId: node.id, label: \"\", layout: \"list\", feature: true, children: [] };\n const out: ResolvedNode[] = [holder];\n // First of the late passes: the feature section claims the page rows before the orphans count.\n w.late.unshift(() => {\n const rows = pageRows(w);\n if (rows.length === 0) {\n out.length = 0;\n return;\n }\n const seen = new Map<string, string>();\n const unique: ModelRow[] = [];\n for (const r of rows) {\n const k = r.label.trim().toLowerCase();\n const first = seen.get(k);\n if (first) {\n w.duplicates.push({ key: r.key, label: r.label, duplicateOf: first });\n consume(r, w);\n continue;\n }\n seen.set(k, r.key);\n unique.push(r);\n }\n unique.forEach((r) => consume(r, w));\n const n = Math.max(0, Math.min(12, node.featureItems ?? 4));\n const first = unique.slice(0, n).map((r) => rowNode(r, `${node.id}:`));\n const rest = unique.slice(n).map((r) => rowNode(r, `${node.id}:`));\n const title = w.ctx.featureTitle || w.ctx.surfaceLabel || unique[0]?.sectionLabel || \"This page\";\n holder.label = title;\n holder.children = rest.length\n ? [...first, { kind: \"submenu\", id: `${node.id}:more`, designId: node.id, label: \"More\", icon: { name: \"Ellipsis\" }, disabled: false, children: rest }]\n : first;\n w.report.feature = { title, rows: unique.map((r) => r.key) };\n });\n return out;\n}\n\n/** The page's own rows no entry placed, at the top level of their sections (host sections first). */\nfunction pageRows(w: Walk): ModelRow[] {\n const top = [...w.rows.values()].filter((r) => r.origin === \"page\" && !w.consumed.has(r.key));\n // Only rows whose parent is not itself a page row (a submenu keeps its children).\n const childKeys = new Set(top.flatMap((r) => (r.children ?? []).map((c) => c.key)));\n return top.filter((r) => !childKeys.has(r.key));\n}\n\n/** The unplaced rows of one bucket, as drawn nodes (a partly placed submenu keeps only the rest). */\nfunction orphanNodes(bucket: \"feature\" | \"global\", w: Walk): ResolvedNode[] {\n const out: ResolvedNode[] = [];\n const prune = (row: ModelRow): ModelRow | null => {\n if (w.consumed.has(row.key)) return null;\n if (!row.children) return row;\n const placedInside = row.children.some((c) => containsConsumed(c, w));\n if (!placedInside) return row;\n const kids = row.children.map(prune).filter((c): c is ModelRow => c !== null && (c.kind !== \"submenu\" || (c.children?.length ?? 0) > 0));\n return kids.length ? { ...row, children: kids } : null;\n };\n for (const row of w.tops) {\n if ((row.page ? \"feature\" : \"global\") !== bucket) continue;\n const kept = prune(row);\n if (!kept) continue;\n out.push(rowNode(kept, `orphan:`));\n collectOrphans(kept, bucket, w);\n }\n return out;\n}\n\nfunction containsConsumed(row: ModelRow, w: Walk): boolean {\n return w.consumed.has(row.key) || Boolean(row.children?.some((c) => containsConsumed(c, w)));\n}\n\nfunction collectOrphans(row: ModelRow, bucket: \"feature\" | \"global\", w: Walk): void {\n w.report.orphans.push({ key: row.key, label: row.label, origin: row.origin, section: row.section, bucket });\n}\n\nfunction resolveList(nodes: readonly MenuNode[], w: Walk, path: string[]): ResolvedNode[] {\n const out: ResolvedNode[] = [];\n for (const n of nodes) {\n if (n.kind === \"divider\") out.push({ kind: \"divider\", id: n.id, designId: n.id });\n else if (n.kind === \"search\") out.push({ kind: \"search\", id: n.id, designId: n.id, placeholder: n.placeholder || \"Type to filter…\", autofocus: n.autofocus });\n else if (n.kind === \"item\") out.push(...resolveItem(n, w, path));\n else if (n.kind === \"submenu\") out.push(...resolveSubmenu(n, w, path));\n else if (n.kind === \"section\") out.push(resolveSection(n, w, path));\n else if (n.kind === \"slot\") {\n if (n.shape === \"feature\") out.push(...resolveFeature(n, w));\n else {\n verdict(w, n, path, { status: \"unmatched\", reason: `Placeholder \"${n.fills}\" (${n.shape}) is drawn only in the builder`, availability: \"none\" });\n }\n }\n }\n return out;\n}\n\n/** The design, bound to this menu's rows. */\nexport function resolveDesign(design: MenuDesign, rows: readonly ModelRow[], ctx: ResolveContext): ResolvedMenu {\n const index = indexRows(rows);\n const report: ResolveReport = { items: [], orphans: [], duplicates: [], feature: null };\n const w: Walk = {\n rows: index,\n rules: DESIGN_RULES[design.designId] ?? {},\n overrides: activeOverrides(index, ctx),\n ctx,\n consumed: new Set(),\n duplicates: report.duplicates,\n verdicts: report.items,\n late: [],\n tops: rows,\n report,\n };\n const nodes = resolveList(design.nodes, w, []);\n // The feature section first (it claims the page rows), then the orphans (what is left).\n for (const fn of w.late) fn();\n // A feature section with no rows was emptied in place: drop the empty holder.\n return { nodes: pruneEmpty(nodes), report };\n}\n\nfunction pruneEmpty(nodes: ResolvedNode[]): ResolvedNode[] {\n return nodes\n .filter((n) => !(n.kind === \"section\" && n.feature && n.children.length === 0))\n .map((n) => (n.kind === \"section\" || n.kind === \"submenu\" ? { ...n, children: pruneEmpty(n.children) } : n));\n}\n\n// ── search ───────────────────────────────────────────────────────────────────\n\nexport interface ResolvedHit {\n node: ResolvedItem | ResolvedSubmenu;\n /** Where it lives (\"Copy › Text\"). */\n path: string;\n}\n\nfunction words(n: ResolvedItem | ResolvedSubmenu, trail: readonly string[]): string {\n return [n.label, n.hint ?? \"\", ...(n.keywords ?? []), ...trail].join(\" \").toLowerCase();\n}\n\n/** Every BOUND entry matching the query (label, hint, keywords, place), wherever it sits. */\nexport function searchResolved(nodes: readonly ResolvedNode[], query: string, trail: string[] = [], out: ResolvedHit[] = []): ResolvedHit[] {\n const ws = query.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n if (ws.length === 0) return out;\n for (const n of nodes) {\n if (n.kind === \"item\") {\n const bound = Boolean(n.run || n.href) && n.status !== \"unmatched\" && n.status !== \"needs-arman\" && !n.placeholder;\n if (bound && ws.every((x) => words(n, trail).includes(x))) out.push({ node: n, path: trail.join(\" › \") });\n } else if (n.kind === \"submenu\") {\n searchResolved(n.children, query, [...trail, n.label], out);\n } else if (n.kind === \"section\") {\n searchResolved(n.children, query, n.label && !n.feature ? [...trail, n.label] : n.feature ? [...trail, n.label] : trail, out);\n }\n }\n return out;\n}\n\n/** Every design entry, for the ledger: path, status, binding, reason. */\nexport function bindingTable(design: MenuDesign, rows: readonly ModelRow[], ctx: ResolveContext): BindingVerdict[] {\n return resolveDesign(design, rows, ctx).report.items;\n}\n\n","// src/designed/global.menu.ts — GENERATED by scripts/menu-publish.mjs. Never hand-edit: change the\n// design in the builder, save, and publish again.\n//\n// design d_0707ad42 (\"Untitled menu\")\n// version 16\n// saved 2026-10-10T22:16:37.417Z\n// record created 2026-10-10 22:16:37.68368+00\n\nimport type { MenuDesign } from \"../design/model\";\n\nfunction deepFreeze<T>(value: T): T {\n if (value && typeof value === \"object\" && !Object.isFrozen(value)) {\n Object.freeze(value);\n for (const v of Object.values(value as Record<string, unknown>)) deepFreeze(v);\n }\n return value;\n}\n\nexport const globalMenuSource = { designId: \"d_0707ad42\", version: 16, savedAt: \"2026-10-10T22:16:37.417Z\" } as const;\n\nexport const globalMenuDesign: MenuDesign = deepFreeze<MenuDesign>({\n \"designId\": \"d_0707ad42\",\n \"name\": \"Untitled menu\",\n \"surface\": \"anywhere\",\n \"look\": {\n \"density\": \"comfortable\",\n \"width\": 280,\n \"showIcons\": true,\n \"showShortcuts\": true,\n \"showHints\": false,\n \"search\": false\n },\n \"nodes\": [\n {\n \"id\": \"s_tmv2q4pofh\",\n \"kind\": \"section\",\n \"label\": \"\",\n \"layout\": \"row\",\n \"children\": [\n {\n \"id\": \"i_tmv2q4pofi\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:cut\",\n \"label\": \"Cut\",\n \"icon\": \"Scissors\",\n \"shortcut\": \"⌘X\"\n },\n {\n \"id\": \"i_tmv2q4pofj\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Copy\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_tmv2q4pofk\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:paste\",\n \"label\": \"Paste\",\n \"icon\": \"ClipboardPaste\",\n \"shortcut\": \"⌘V\"\n },\n {\n \"id\": \"i_tmv2q4pofl\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:undo\",\n \"label\": \"Undo\",\n \"icon\": \"Undo2\",\n \"shortcut\": \"⌘Z\"\n },\n {\n \"id\": \"i_tmv2q4pofm\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:redo\",\n \"label\": \"Redo\",\n \"icon\": \"Redo2\",\n \"shortcut\": \"⇧⌘Z\"\n },\n {\n \"id\": \"i_tmv2q4pofn\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Find & Replace\",\n \"icon\": \"Search\",\n \"shortcut\": \"⌘F\"\n },\n {\n \"id\": \"i_82154a6b\",\n \"kind\": \"item\",\n \"catalogId\": \"archive\",\n \"label\": \"Archive\",\n \"icon\": \"Archive\",\n \"danger\": true,\n \"ai\": false,\n \"toggle\": false\n }\n ]\n },\n {\n \"id\": \"q_b2f517ee\",\n \"kind\": \"search\",\n \"placeholder\": \"Search this menu…\",\n \"autofocus\": true\n },\n {\n \"id\": \"m_tmv2o1wube\",\n \"kind\": \"submenu\",\n \"label\": \"Intelligence\",\n \"icon\": \"Sparkles\",\n \"children\": [\n {\n \"id\": \"i_tmv2o1wubf\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:chat\",\n \"label\": \"Chat about this\",\n \"icon\": \"MessageSquare\",\n \"ai\": true\n },\n {\n \"id\": \"i_tmv2o1wubi\",\n \"kind\": \"item\",\n \"catalogId\": \"send-to-agent\",\n \"label\": \"Send to agent\",\n \"icon\": \"Send\",\n \"ai\": true\n },\n {\n \"id\": \"i_f9319837\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:chat\",\n \"label\": \"Create Agent for this\",\n \"icon\": \"Webhook\",\n \"ai\": true\n },\n {\n \"id\": \"d_71777db1\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_294ffd3a\",\n \"kind\": \"submenu\",\n \"label\": \"AI Actions\",\n \"icon\": \"Stars\",\n \"children\": [\n {\n \"id\": \"i_ec0a5001\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-improve\",\n \"label\": \"Improve writing\",\n \"icon\": \"Wand2\",\n \"ai\": true\n },\n {\n \"id\": \"i_41dc4c76\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Summarize\",\n \"icon\": \"ListCollapse\",\n \"ai\": true\n },\n {\n \"id\": \"i_65ebe1a4\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-explain\",\n \"label\": \"Explain\",\n \"icon\": \"Lightbulb\",\n \"ai\": true\n },\n {\n \"id\": \"i_29261564\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-translate\",\n \"label\": \"Translate…\",\n \"icon\": \"Languages\",\n \"ai\": true\n },\n {\n \"id\": \"i_ebf13d6b\",\n \"kind\": \"item\",\n \"catalogId\": \"code-block-chart\",\n \"label\": \"Make a chart\",\n \"icon\": \"ChartColumn\",\n \"ai\": true\n }\n ]\n },\n {\n \"id\": \"m_e157dbc8\",\n \"kind\": \"submenu\",\n \"label\": \"Agents\",\n \"icon\": \"Bot\",\n \"children\": []\n },\n {\n \"id\": \"s_c3e45d72\",\n \"kind\": \"submenu\",\n \"label\": \"Surface Intelligence\",\n \"icon\": \"BrainCircuit\",\n \"children\": []\n },\n {\n \"id\": \"d_cf79cdb9\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_6f753e67\",\n \"kind\": \"section\",\n \"label\": \"AI Resources\",\n \"children\": []\n },\n {\n \"id\": \"i_56c420c8\",\n \"kind\": \"item\",\n \"label\": \"Kind Shapes\",\n \"icon\": \"Aperture\"\n },\n {\n \"id\": \"i_82b53d0f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:placement:content-block\",\n \"label\": \"Content blocks\",\n \"icon\": \"Blocks\",\n \"ai\": true\n },\n {\n \"id\": \"i_35f46721\",\n \"kind\": \"item\",\n \"label\": \"Artifacts\",\n \"icon\": \"AreaChart\"\n }\n ]\n },\n {\n \"id\": \"m_32ea2013\",\n \"kind\": \"submenu\",\n \"label\": \"My Intelligence\",\n \"icon\": \"BrainCircuit\",\n \"children\": [\n {\n \"id\": \"i_e6795a3d\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 1\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"i_17e1a01b\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 2\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"i_77e75862\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 3, 4 ...\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"m_5838209d\",\n \"kind\": \"submenu\",\n \"label\": \"My custom folder\",\n \"icon\": \"FolderClosed\",\n \"children\": []\n },\n {\n \"id\": \"m_a5717277\",\n \"kind\": \"submenu\",\n \"label\": \"My custom folder\",\n \"icon\": \"FolderClosed\",\n \"children\": []\n },\n {\n \"id\": \"d_dea308cc\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_b6b6e037\",\n \"kind\": \"submenu\",\n \"label\": \"Organizations\",\n \"icon\": \"Building2\",\n \"children\": []\n },\n {\n \"id\": \"s_333c203b\",\n \"kind\": \"submenu\",\n \"label\": \"Shared with me\",\n \"icon\": \"Building2\",\n \"children\": []\n },\n {\n \"id\": \"d_f3f573d1\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_e4f67cb6\",\n \"kind\": \"item\",\n \"label\": \"Customize\",\n \"icon\": \"Settings2\"\n }\n ]\n },\n {\n \"id\": \"m_dde8f0e8\",\n \"kind\": \"submenu\",\n \"label\": \"Content\",\n \"icon\": \"Edit\",\n \"children\": [\n {\n \"id\": \"i_fe613e75\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:save\",\n \"label\": \"Save\",\n \"icon\": \"Save\",\n \"shortcut\": \"⌘S\"\n },\n {\n \"id\": \"i_e09f7461\",\n \"kind\": \"item\",\n \"catalogId\": \"duplicate\",\n \"label\": \"Duplicate\",\n \"icon\": \"CopyPlus\"\n },\n {\n \"id\": \"i_b95bebe0\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Refresh\",\n \"icon\": \"RefreshCcw\"\n },\n {\n \"id\": \"i_tmv2q71icr\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:view-history\",\n \"label\": \"View history\",\n \"icon\": \"History\"\n },\n {\n \"id\": \"m_e55f6e2a\",\n \"kind\": \"submenu\",\n \"label\": \"Compare\",\n \"icon\": \"GitCompareArrows\",\n \"children\": [\n {\n \"id\": \"i_a7e009e7\",\n \"kind\": \"item\",\n \"catalogId\": \"set-compare-base\",\n \"label\": \"Set as compare base\",\n \"icon\": \"Flag\"\n },\n {\n \"id\": \"i_fadfc953\",\n \"kind\": \"item\",\n \"catalogId\": \"compare-with-clipboard\",\n \"label\": \"Compare with clipboard\",\n \"icon\": \"ClipboardList\"\n },\n {\n \"id\": \"i_tmv2q71ics\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:compare\",\n \"label\": \"Open Compare Window\",\n \"icon\": \"GitCompareArrows\"\n }\n ]\n },\n {\n \"id\": \"d_df8a5b92\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_b7486ce8\",\n \"kind\": \"item\",\n \"catalogId\": \"rename\",\n \"label\": \"Rename\",\n \"icon\": \"ClipboardEdit\"\n },\n {\n \"id\": \"i_97bfd2a2\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Cleanup\",\n \"icon\": \"Eraser\"\n },\n {\n \"id\": \"i_eeb51a1e\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Outline\",\n \"icon\": \"LayoutList\"\n },\n {\n \"id\": \"i_ed3edf1c\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Insert reference\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"d_3cceca07\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_8978ede1\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Find & Replace\",\n \"icon\": \"Search\",\n \"shortcut\": \"⌘F\"\n },\n {\n \"id\": \"i_0c67e994\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Search with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"d_55ec427a\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a69ba340\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-improve\",\n \"label\": \"Improve writing\",\n \"icon\": \"Wand2\",\n \"ai\": true\n },\n {\n \"id\": \"i_3c09ec12\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Summarize\",\n \"icon\": \"ListCollapse\",\n \"ai\": true\n },\n {\n \"id\": \"i_02a7fbac\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Expand content\",\n \"icon\": \"ListSortAscending\",\n \"ai\": true\n },\n {\n \"id\": \"i_5b3f6d51\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Make a table\",\n \"icon\": \"Table\",\n \"ai\": true\n },\n {\n \"id\": \"d_037eb185\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_042a5ba7\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:delete\",\n \"label\": \"Delete\",\n \"icon\": \"Trash2\",\n \"danger\": true\n }\n ],\n \"note\": \"Disabled when editable text is not available\"\n },\n {\n \"id\": \"m_ac170388\",\n \"kind\": \"submenu\",\n \"label\": \"Copy\",\n \"icon\": \"CopyCheck\",\n \"children\": [\n {\n \"id\": \"m_24d2c346\",\n \"kind\": \"submenu\",\n \"label\": \"Text\",\n \"icon\": \"LetterText\",\n \"children\": [\n {\n \"id\": \"i_1f2dd157\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Raw Text\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_4958860f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Strip markdown\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_b8fa8de1\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"For Google Docs & Gmail\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_68b385a6\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"For Microsoft Office\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_838adcaa\",\n \"kind\": \"item\",\n \"catalogId\": \"copy-html-page\",\n \"label\": \"As HTML page\",\n \"icon\": \"FileCode\"\n }\n ]\n },\n {\n \"id\": \"m_76fad1b2\",\n \"kind\": \"submenu\",\n \"label\": \"For AI\",\n \"icon\": \"Brain\",\n \"children\": [\n {\n \"id\": \"i_6f508d32\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Structured For AI\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_a4ce9583\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"With Context\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_834c201b\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"With Prompt\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n }\n ]\n },\n {\n \"id\": \"m_8efb66c6\",\n \"kind\": \"submenu\",\n \"label\": \"Data\",\n \"icon\": \"Database\",\n \"children\": [\n {\n \"id\": \"i_ba8dfd96\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:json\",\n \"label\": \"Copy as JSON\",\n \"icon\": \"Braces\"\n }\n ]\n },\n {\n \"id\": \"i_c1ceed9d\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Copy reference\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"i_84d0d88a\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy-as\",\n \"label\": \"Custom edit\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"i_46a4a651\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:select-all\",\n \"label\": \"Select All\",\n \"icon\": \"TextSelect\",\n \"shortcut\": \"⌘A\"\n }\n ]\n },\n {\n \"id\": \"d_3e3ab4cd\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"p_d160894b\",\n \"kind\": \"slot\",\n \"shape\": \"feature\",\n \"fills\": \"page-rows\",\n \"label\": \"THIS FEATURE NAME\",\n \"featureItems\": 4\n },\n {\n \"id\": \"s_1abf26db\",\n \"kind\": \"submenu\",\n \"label\": \"Feature orphans\",\n \"icon\": \"Annoyed\",\n \"children\": []\n },\n {\n \"id\": \"d_27f4678d\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_d02ffc55\",\n \"kind\": \"submenu\",\n \"label\": \"Export & Download\",\n \"icon\": \"Download\",\n \"children\": [\n {\n \"id\": \"i_5c9c1773\",\n \"kind\": \"item\",\n \"catalogId\": \"notes:export-md\",\n \"label\": \"Download Markdown\",\n \"icon\": \"FileDown\"\n },\n {\n \"id\": \"i_d0f17b6f\",\n \"kind\": \"item\",\n \"catalogId\": \"download-docx\",\n \"label\": \"Download Word\",\n \"icon\": \"FileType\"\n },\n {\n \"id\": \"i_a2929b71\",\n \"kind\": \"item\",\n \"catalogId\": \"download-html\",\n \"label\": \"Download HTML\",\n \"icon\": \"FileCode2\"\n },\n {\n \"id\": \"i_9036b52e\",\n \"kind\": \"item\",\n \"catalogId\": \"download-pdf\",\n \"label\": \"Download PDF\",\n \"icon\": \"FileText\"\n },\n {\n \"id\": \"i_66ee72ce\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Download with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"i_396c657e\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:export\",\n \"label\": \"Custom Export\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"i_738a541f\",\n \"kind\": \"item\",\n \"catalogId\": \"print\",\n \"label\": \"Print\",\n \"icon\": \"Printer\",\n \"shortcut\": \"⌘P\"\n }\n ]\n },\n {\n \"id\": \"m_6ead5137\",\n \"kind\": \"submenu\",\n \"label\": \"Share & Publish\",\n \"icon\": \"Share2\",\n \"children\": [\n {\n \"id\": \"i_a618b8d8\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:share\",\n \"label\": \"Share…\",\n \"icon\": \"Share2\"\n },\n {\n \"id\": \"i_aca15807\",\n \"kind\": \"item\",\n \"catalogId\": \"share-link\",\n \"label\": \"Copy share link\",\n \"icon\": \"Link\"\n },\n {\n \"id\": \"i_33be80fa\",\n \"kind\": \"item\",\n \"catalogId\": \"share-webpage\",\n \"label\": \"Publish as web page\",\n \"icon\": \"Globe\"\n },\n {\n \"id\": \"i_6da43b13\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Insert / Copy reference…\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"i_51e8098a\",\n \"kind\": \"item\",\n \"catalogId\": \"print\",\n \"label\": \"Print\",\n \"icon\": \"Printer\",\n \"shortcut\": \"⌘P\"\n }\n ]\n },\n {\n \"id\": \"m_ae1e5be1\",\n \"kind\": \"submenu\",\n \"label\": \"Send & Convert\",\n \"icon\": \"ArrowBigRight\",\n \"children\": [\n {\n \"id\": \"i_720df996\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Add to Active Context\",\n \"icon\": \"Pin\"\n },\n {\n \"id\": \"i_4b63cb20\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Add to knowledge base\",\n \"icon\": \"DatabaseZap\"\n },\n {\n \"id\": \"i_fdaa2e24\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Open in Canvas\",\n \"icon\": \"LayoutPanelLeft\"\n },\n {\n \"id\": \"d_4182de21\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a207c217\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Notes\",\n \"icon\": \"NotebookPen\"\n },\n {\n \"id\": \"i_18eb28c6\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Document\",\n \"icon\": \"NotepadTextDashed\"\n },\n {\n \"id\": \"i_5f78991d\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"File\",\n \"icon\": \"FileCog\"\n },\n {\n \"id\": \"i_bed92d83\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Task\",\n \"icon\": \"ListTodo\"\n },\n {\n \"id\": \"i_c86ed71c\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Project\",\n \"icon\": \"AlignVerticalJustifyCenter\"\n },\n {\n \"id\": \"i_dbdcad1a\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Custom data\",\n \"icon\": \"DatabaseCheck\"\n },\n {\n \"id\": \"d_3aacc05c\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_42e3d208\",\n \"kind\": \"item\",\n \"catalogId\": \"email-to-me\",\n \"label\": \"Email\",\n \"icon\": \"Mail\"\n },\n {\n \"id\": \"i_07b55ba5\",\n \"kind\": \"item\",\n \"catalogId\": \"email-to-me\",\n \"label\": \"Send via DM\",\n \"icon\": \"MessageCircle\"\n },\n {\n \"id\": \"i_75ef8013\",\n \"kind\": \"item\",\n \"catalogId\": \"audit:114\",\n \"label\": \"Add to Rulebook\",\n \"icon\": \"CircleDashed\",\n \"note\": \"From the audit (useful, partial): Add to Rulebook; Set Context Value; Save as Message Template; Save to my Shapes (when the content holds a kind block); Save as contact (when it looks like a contact) — today: rich-document Save/capture rows (matrx-frontend/features/rich-document/actions/handlers/capture.ts:75,113,142,282; handlers/contact.ts:28)\"\n },\n {\n \"id\": \"i_9531a415\",\n \"kind\": \"item\",\n \"catalogId\": \"notes:convert-artifacts\",\n \"label\": \"Convert to artifacts\",\n \"icon\": \"Shapes\"\n },\n {\n \"id\": \"i_eca3b31b\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Convert with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"i_73a06d6f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Custom convert\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"d_9a18d3e3\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a39f4b6a\",\n \"kind\": \"item\",\n \"catalogId\": \"send-google-doc\",\n \"label\": \"To Google Docs or Drive\",\n \"icon\": \"FileUp\"\n },\n {\n \"id\": \"i_16ae6cf2\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"To any connection...\",\n \"icon\": \"Combine\"\n }\n ]\n },\n {\n \"id\": \"m_2406eb8d\",\n \"kind\": \"submenu\",\n \"label\": \"Listen & Speak\",\n \"icon\": \"AudioLines\",\n \"children\": [\n {\n \"id\": \"i_f65633d0\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:listen\",\n \"label\": \"Dictate\",\n \"icon\": \"Mic\"\n },\n {\n \"id\": \"i_a73e3556\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:speak\",\n \"label\": \"Read aloud\",\n \"icon\": \"Volume2\"\n },\n {\n \"id\": \"i_733fc812\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:speak\",\n \"label\": \"Condense & Read\",\n \"icon\": \"Volume1\"\n },\n {\n \"id\": \"i_4466b514\",\n \"kind\": \"item\",\n \"catalogId\": \"tts-voice-settings\",\n \"label\": \"Voice settings\",\n \"icon\": \"AudioLines\"\n }\n ]\n },\n {\n \"id\": \"m_d12b81de\",\n \"kind\": \"submenu\",\n \"label\": \"Help\",\n \"icon\": \"HelpCircle\",\n \"children\": [\n {\n \"id\": \"i_ab248359\",\n \"kind\": \"item\",\n \"label\": \"Help me with this\",\n \"icon\": \"MessageCircleQuestion\"\n },\n {\n \"id\": \"i_fbdcca01\",\n \"kind\": \"item\",\n \"label\": \"I found a bug\",\n \"icon\": \"Bug\"\n },\n {\n \"id\": \"i_9c46db53\",\n \"kind\": \"item\",\n \"label\": \"Request a feature\",\n \"icon\": \"SquareStar\"\n },\n {\n \"id\": \"i_12784f2c\",\n \"kind\": \"item\",\n \"label\": \"Info\",\n \"icon\": \"Info\",\n \"hint\": \"About this item\"\n }\n ]\n },\n {\n \"id\": \"d_4b860471\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_tmv2q71ico\",\n \"kind\": \"submenu\",\n \"label\": \"Organize\",\n \"icon\": \"Tags\",\n \"children\": [\n {\n \"id\": \"i_780d8216\",\n \"kind\": \"item\",\n \"catalogId\": \"notes-and-comments\",\n \"label\": \"Notes & comments\",\n \"icon\": \"StickyNote\"\n },\n {\n \"id\": \"i_e9ad3dd6\",\n \"kind\": \"item\",\n \"catalogId\": \"move\",\n \"label\": \"Move to folder…\",\n \"icon\": \"FolderInput\"\n },\n {\n \"id\": \"i_d8e4c6b9\",\n \"kind\": \"item\",\n \"catalogId\": \"tags\",\n \"label\": \"Tags…\",\n \"icon\": \"Tags\"\n },\n {\n \"id\": \"i_tmv2q71icp\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:attach\",\n \"label\": \"Attach to…\",\n \"icon\": \"Paperclip\"\n },\n {\n \"id\": \"i_tmv2q71icq\",\n \"kind\": \"item\",\n \"catalogId\": \"pin-message\",\n \"label\": \"Pin\",\n \"icon\": \"Pin\"\n }\n ]\n },\n {\n \"id\": \"d_b6212875\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_48f18ecc\",\n \"kind\": \"section\",\n \"label\": \"ADMIN ACTIONS\",\n \"children\": [\n {\n \"id\": \"m_74072d95\",\n \"kind\": \"submenu\",\n \"label\": \"Creator Options\",\n \"icon\": \"Crown\",\n \"children\": [],\n \"note\": \"Disabled when the user is NOT the creator of the intelligence or when there is no intelligence in play\"\n }\n ]\n },\n {\n \"id\": \"m_32f84a2e\",\n \"kind\": \"submenu\",\n \"label\": \"Org Admin\",\n \"icon\": \"ShieldUser\",\n \"children\": [],\n \"note\": \"Disabled when the user is not an admin for their ACTIVE Org\"\n },\n {\n \"id\": \"s_888d81ec\",\n \"kind\": \"submenu\",\n \"label\": \"Super Admin\",\n \"icon\": \"ShieldAlert\",\n \"children\": [],\n \"note\": \"Must be HIDDEN for all non-admins\"\n },\n {\n \"id\": \"m_54111c0a\",\n \"kind\": \"submenu\",\n \"label\": \"Global orphans\",\n \"icon\": \"Annoyed\",\n \"children\": []\n }\n ],\n \"notes\": \"\"\n} as MenuDesign);\n","// src/designed/rows.ts — @ai-matrx/context-menu: THE ADAPTER from today's engine to ModelRows.\n//\n// The ONLY file of the designed menu that knows the engine's MenuModel. Every row keeps the\n// engine's own handler, disabled state and label — nothing is re-implemented here. A later\n// trigger that builds rows another way replaces this file and nothing else.\n\nimport type { MenuModel, MenuNode as EngineNode, MenuSection } from \"../engine/model/menu-model\";\nimport type { ModelRow, RowIconComponent, RowOrigin } from \"./types\";\n\n/** The universal verbs say why they are off (the engine's R1 sentences). */\nconst VERB_REASONS: Record<string, string> = {\n copy: \"Select text, or right-click content, to copy it.\",\n cut: \"Cut works on selected text in an editable field.\",\n paste: \"Paste works in an editable field.\",\n undo: \"Nothing to undo here.\",\n redo: \"Nothing to redo here.\",\n find: \"Find works where there is text.\",\n};\n\n/** Rows that INSERT content into the surface: off on a read-only source. */\nconst INSERTS_CONTENT = new Set([\"placement:content-block\"]);\n\nexport interface EngineRowOptions {\n /** Rich-document action ids this menu must not draw (surface exclusions, already-here). */\n excludedRichIds?: readonly string[] | undefined;\n /** The menu edits its surface (`isEditable`). */\n editable?: boolean | undefined;\n}\n\nfunction originOf(key: string, section: MenuSection): RowOrigin {\n if (section.group === \"surface\") return \"page\";\n if (section.group === \"surface-info\") return \"surface\";\n if (key.startsWith(\"rich\")) return \"rich\";\n if (/^(placement|agent|agents|entry|cat):/.test(key)) return \"agent\";\n return \"engine\";\n}\n\nfunction keyOf(node: EngineNode, section: MenuSection): string {\n const bare = node.id.startsWith(\"x:\") ? node.id.slice(2) : node.id;\n if (section.group === \"surface\") return `${section.id}/${bare}`;\n if (section.group === \"surface-info\") return `surface/${bare}`;\n return node.id;\n}\n\nfunction convert(node: EngineNode, section: MenuSection, opts: EngineRowOptions, startsGroup: boolean): ModelRow | null {\n if (node.kind === \"separator\" || node.kind === \"label\") return null;\n const key = keyOf(node, section);\n const origin = originOf(key, section);\n const page = origin === \"page\" || origin === \"surface\";\n const base = {\n key,\n label: node.label,\n origin,\n page,\n section: section.id,\n ...(section.label ? { sectionLabel: section.label } : {}),\n ...(node.icon ? { icon: node.icon as unknown as RowIconComponent } : {}),\n ...(\"iconClassName\" in node && node.iconClassName ? { iconClassName: node.iconClassName } : {}),\n ...(\"iconStyle\" in node && node.iconStyle ? { iconStyle: node.iconStyle } : {}),\n ...(\"hint\" in node && node.hint ? { hint: node.hint } : {}),\n ...(\"description\" in node && node.description ? { description: node.description } : {}),\n ...(startsGroup ? { startsGroup: true } : {}),\n };\n if (node.kind === \"submenu\") {\n const children = convertList(node.children, section, opts);\n const inserts = INSERTS_CONTENT.has(node.id) && opts.editable === false;\n const empty = !node.loading && children.length === 0;\n return {\n ...base,\n kind: \"submenu\",\n disabled: Boolean(node.disabled) || inserts || empty,\n ...(inserts\n ? { reason: \"Inserts content — this place is read-only\" }\n : empty\n ? { reason: node.emptyLabel ?? \"Nothing here yet\" }\n : {}),\n ...(node.loading ? { loading: true } : {}),\n children,\n };\n }\n const disabled = \"disabled\" in node ? Boolean(node.disabled) : false;\n const reason = disabled ? (VERB_REASONS[node.id] ?? (\"description\" in node ? node.description : undefined)) : undefined;\n if (node.kind === \"link\") {\n return { ...base, kind: \"link\", disabled, href: node.href, ...(node.target ? { target: node.target } : {}), ...(reason ? { reason } : {}) };\n }\n if (node.kind === \"checkbox\") {\n return { ...base, kind: \"checkbox\", disabled, checked: node.checked, run: () => node.onCheckedChange(!node.checked), ...(reason ? { reason } : {}) };\n }\n return {\n ...base,\n kind: \"item\",\n disabled,\n ...(reason ? { reason } : {}),\n ...(node.destructive ? { destructive: true } : {}),\n ...(node.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n run: () => node.onSelect(),\n };\n}\n\nfunction convertList(nodes: readonly EngineNode[], section: MenuSection, opts: EngineRowOptions): ModelRow[] {\n const excluded = new Set(opts.excludedRichIds ?? []);\n const out: ModelRow[] = [];\n let startsGroup = false;\n for (const node of nodes) {\n if (node.kind === \"separator\") {\n startsGroup = out.length > 0;\n continue;\n }\n if (node.id.startsWith(\"rich:\") && excluded.has(node.id.slice(5))) continue;\n const row = convert(node, section, opts, startsGroup);\n if (!row) continue;\n startsGroup = false;\n out.push(row);\n }\n return out;\n}\n\n/** Every row the open menu can run, top level by section, submenus keeping their children. */\nexport function rowsFromEngineModel(model: MenuModel, opts: EngineRowOptions = {}): ModelRow[] {\n const out: ModelRow[] = [];\n for (const section of model.sections) out.push(...convertList(section.nodes, section, opts));\n return out;\n}\n\n/** The surface's display label, as the engine's surface submenu names it. */\nexport function surfaceLabelOf(model: MenuModel): string | null {\n const node = model.roles.surfaceInfo.nodes[0];\n return node && \"label\" in node && node.label ? node.label : null;\n}\n","\"use client\";\n\n// features/context-menu-v3/components/ShortcutKeyRunner.tsx\n//\n// Runs ONE agent shortcut whose advertised key combo was pressed — through the\n// SAME engine and the same launch handler the menu item uses\n// (`useContextMenuActions().handleShortcutExecute`), so a combo and a click\n// launch identically (scope, selection, widget handle, display mode). Renders\n// nothing; the shell mounts it for one press and drops it when done.\n\nimport { useEffect, useRef } from \"react\";\nimport { toast } from \"../utils/notify\";\nimport { useContextMenuActions } from \"../hooks/useContextMenuActions\";\nimport type { AgentMenuCategoryGroup, AgentMenuEntry } from \"../hooks/useUnifiedAgentContextMenu\";\nimport type { MenuContentProps } from \"../types\";\n\ntype ShortcutEntry = Extract<AgentMenuEntry, { entryType: \"agent_shortcut\" }>;\n\nfunction findShortcut(groups: AgentMenuCategoryGroup[], id: string): ShortcutEntry | null {\n for (const group of groups) {\n for (const item of group.items) {\n if (item.entryType === \"agent_shortcut\" && item.id === id) return item;\n }\n const nested = findShortcut(group.children, id);\n if (nested) return nested;\n }\n return null;\n}\n\nexport interface ShortcutKeyRunnerProps extends Omit<MenuContentProps, \"variant\"> {\n shortcutId: string;\n shortcutLabel: string;\n onDone(): void;\n}\n\nexport default function ShortcutKeyRunner(props: ShortcutKeyRunnerProps): null {\n const { shortcutId, shortcutLabel, onDone, ...menuProps } = props;\n const m = useContextMenuActions(menuProps);\n const ran = useRef(false);\n\n useEffect(() => {\n if (ran.current || m.loading) return;\n ran.current = true;\n const entry = findShortcut(m.categoryGroups, shortcutId);\n if (!entry) {\n toast({\n title: m.librariesError\n ? `Couldn't load ${shortcutLabel}`\n : `${shortcutLabel} isn't available here`,\n ...(m.librariesError ? { variant: \"destructive\" as const } : {}),\n });\n onDone();\n return;\n }\n void m.handleShortcutExecute(entry).finally(onDone);\n });\n\n return null;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/menu-content.cjs","../src/engine/components/AlchemyMenuContent.tsx","../src/designed/EngineDesignedMenu.tsx","../src/designed/DesignedMenu.tsx","../src/designed/bindings.ts","../src/designed/global.menu.ts","../src/designed/rows.ts","../src/engine/components/ShortcutKeyRunner.tsx"],"names":["drawn","jsx"],"mappings":"AAAA,+8BAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AChBA,2EAAuB;AACvB,oDAAkC;AAClC,oDAAkC;AAClC,oDAAiC;AACjC,sDAA4B;AAC5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ACS,QAAA;AAAA,MAAA;AACX,IAAA;AAEJ,EAAA;AACsB,EAAA;AAEjB,IAAA;AAIL,EAAA;AACwB,EAAA;AAEnB,IAAA;AAIL,EAAA;AAEG,EAAA;AACE,IAAA;AAAA,IAAA;AACK,MAAA;AACJ,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACuB,MAAA;AACJ,MAAA;AAGQ,MAAA;AACvB,MAAA;AAAA,IAAA;AAER,EAAA;AAEJ;AD+0DoC;AACA;AOtiEhB;AAQsE;AAC5D,EAAA;AACM,IAAA;AACP,MAAA;AACzB,IAAA;AAC4B,IAAA;AACT,IAAA;AACrB,EAAA;AACO,EAAA;AACT;AAQ+E;AACzD,EAAA;AACY,EAAA;AACR,EAAA;AAER,EAAA;AACgB,IAAA;AAChB,IAAA;AACe,IAAA;AACjB,IAAA;AACJ,MAAA;AAEA,QAAA;AAEqB,QAAA;AAC1B,MAAA;AACM,MAAA;AACP,MAAA;AACF,IAAA;AAC6B,IAAA;AAC9B,EAAA;AAEM,EAAA;AACT;APshEoC;AACA;AACA;AACA;AACA","file":"/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/menu-content.cjs","sourcesContent":[null,"\"use client\";\n\n// features/context-menu-v3/components/AlchemyMenuContent.tsx\n//\n// T1 + T1e for the right-click, the floating selection icon, the phone's\n// long-press sheet and the action palette — loaded by the shell through\n// next/dynamic on first open only (static import is still an eslint error).\n//\n// It runs the ONE engine hook (`useContextMenuActions` — every handler, the\n// single deduped agent fetch) and `buildMenuModel`, hands the result to the\n// Alchemy registry as this instance's provider (`alchemy-provider.ts`), and\n// renders the PACKAGE layout for the mode: `ContextMenuPanel` (desktop),\n// `ActionSheet` (phone), `ActionPalette` (palette). The click target is\n// composite, so the rich-document provider contributes the registry rows from\n// the same target — the bar, its ⋯ and this menu show one set of actions.\n\nimport { compact } from \"../utils/compact\";\nimport type { ChatRootState as RootState } from \"@ai-matrx/chat/store/root-state\";\nimport * as React from \"react\";\nimport { createClickTarget } from \"@ai-matrx/alchemy/actions\";\nimport { useAlchemyActions } from \"@ai-matrx/alchemy/react/host\";\nimport { ContextMenuPanel } from \"@ai-matrx/alchemy/react/menu\";\nimport { ActionSheet } from \"@ai-matrx/alchemy/react/sheet\";\nimport { ActionPalette } from \"@ai-matrx/alchemy/react/palette\";\nimport { SOURCE_WRITE_TARGET, richDocumentTargetHost } from \"@ai-matrx/rich-content/rich-document/actions/provider\";\nimport { useRichDocumentProvider } from \"@ai-matrx/rich-content/rich-document/actions/useRichDocumentProvider\";\nimport { useContextMenuActions } from \"../hooks/useContextMenuActions\";\nimport { buildMenuModel } from \"../model/menu-model\";\nimport { chatMessageSubject, namedHeader, contextMenuActionsFromModel, contextMenuProvider, menuEngineRevision, menuHeader, modelRevision } from \"../alchemy-provider\";\nimport { MenuRegroupContext, RegroupBoundary } from \"../regroup/RegroupContext\";\nimport type { MenuContentProps } from \"../types\";\nimport { EngineDesignedMenu } from \"../../designed/EngineDesignedMenu\";\n\nexport type AlchemyMenuMode = \"context\" | \"sheet\" | \"palette\";\n\n/**\n * Registry rows that belong to reading or editing text, not to a record: every\n * listen / read-aloud row (\"Read aloud selection\"), Compare, and Find. A\n * record-actions-only menu (a list row, a folder) leaves them out.\n */\nconst EDITOR_ONLY_RICH_IDS = new Set([\n \"compare-with-clipboard\",\n \"set-compare-base\",\n \"compare-with-base\",\n \"conversation-find\",\n]);\nexport function editorOnlyRichActionIds(actions: ReadonlyArray<{ id: string; category?: string }>): string[] {\n return actions.filter((a) => a.category === \"listen\" || EDITOR_ONLY_RICH_IDS.has(a.id)).map((a) => a.id);\n}\n\nexport interface AlchemyMenuContentProps extends Omit<MenuContentProps, \"variant\"> {\n mode: AlchemyMenuMode;\n /** Viewport point for the desktop menu (pointer, ⋯ button or floating icon). */\n point: { x: number; y: number };\n open: boolean;\n onOpenChange(open: boolean): void;\n}\n\nexport default function AlchemyMenuContent(props: AlchemyMenuContentProps): React.ReactElement {\n const { mode, point, open, onOpenChange, ...menuProps } = props;\n const m = useContextMenuActions(menuProps);\n // No fold under an invented heading (\"More…\" was removed, ALC-15 chair ruling 7): a grid's\n // own sections come first by the primary-section law; every other row keeps its own name.\n const model = buildMenuModel(m, menuProps);\n const { registry } = useAlchemyActions();\n useRichDocumentProvider();\n\n // This menu instance's provider: registered while mounted, reads the latest\n // model through a ref (handlers rebind every render).\n const instanceId = React.useId();\n // A library still loading (the first agent fetch) waits for the NEXT model\n // that changes what the menu draws, instead of vanishing (ALC-15 round 2).\n const waitersRef = React.useRef<((next: typeof model) => void)[]>([]);\n const nextModel = () => new Promise<typeof model>((resolve) => waitersRef.current.push(resolve));\n const actionsRef = React.useRef(contextMenuActionsFromModel(model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) }));\n const drawnRef = React.useRef(\"\");\n const drawn = modelRevision(model);\n React.useLayoutEffect(() => {\n actionsRef.current = contextMenuActionsFromModel(model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) });\n if (drawnRef.current !== drawn) {\n drawnRef.current = drawn;\n const waiters = waitersRef.current;\n waitersRef.current = [];\n for (const wake of waiters) wake(model);\n }\n });\n React.useEffect(\n () =>\n registry.register(contextMenuProvider(instanceId, () => actionsRef.current)),\n [registry, instanceId],\n );\n\n // A record-actions-only menu over no record source (a folder: its name is the\n // only text) contributes no document rows — no Copy as, Export, Save to or\n // agent handoff of a folder's name (page-pass /notes, 2026-09-28).\n const hasRichDocument =\n m.registryActions.length > 0 &&\n !(menuProps.recordActionsOnly && m.richDocCtx.source.type === \"raw\");\n // The source can be written back only when its adapter can save, or the\n // menu itself edits the field. A raw source (a table row's words, rendered\n // text) is read-only by definition — marking it writable put \"Open in\n // full-screen editor\" on every table row (live 2026-09-27).\n const sourceWritable =\n hasRichDocument &&\n !m.richDocCtx.source.readOnly &&\n (Boolean(m.richDocCtx.sourceAdapter.edit) || Boolean(menuProps.isEditable));\n const makeTarget = (withRich: boolean) =>\n createClickTarget({\n // The declared item under the pointer (a table row), as itemSources resolved it.\n item: menuProps.item ?? null,\n readOnly: hasRichDocument ? !sourceWritable : !menuProps.isEditable,\n writable: sourceWritable ? [SOURCE_WRITE_TARGET] : [],\n // The strip's Copy IS the registry's one-tap copy here — one row, not two.\n excludedActionIds: [\n ...m.excludedRichActionIds,\n ...(hasRichDocument ? [\"copy\"] : []),\n ...(menuProps.recordActionsOnly ? editorOnlyRichActionIds(m.registryActions) : []),\n ],\n organizationId: m.richDocCtx.organizationId,\n auth: {\n authenticated: m.richDocCtx.isAuthenticated,\n admin: m.richDocCtx.isAdmin,\n creator: m.richDocCtx.isCreator,\n },\n selection: menuProps.selectedText\n ? {\n text: menuProps.selectedText,\n type: menuProps.selectionRange?.type ?? \"non-editable\",\n start: menuProps.selectionRange?.start ?? 0,\n end: menuProps.selectionRange?.end ?? 0,\n handle: menuProps.selectionRange,\n }\n : null,\n payloadKinds: [\"markdown\"],\n host: {\n contextMenu: { kind: \"context-menu\", instanceId },\n ...(hasRichDocument && withRich\n ? {\n richDocument: richDocumentTargetHost(m.richDocCtx, {\n extra: menuProps.extraRichActions ?? [],\n }),\n }\n : {}),\n },\n });\n const [target] = React.useState(() => makeTarget(true));\n // In a field the header names the field (\"Body\"), never its raw text.\n // The message the menu opened on: its role and time, from the transcript store.\n // Either this menu IS the message's, or it is the transcript's and the\n // right-click resolved the message under the pointer — same subject.\n const chatMessage = chatMessageSubject({\n state: m.richDocCtx.getState() as unknown as RootState,\n source: m.richDocCtx.source,\n ...compact({\n extensions: m.richDocCtx.extensions,\n contextData: menuProps.contextData,\n }),\n });\n // A row (or any target) that NAMES itself wins over the generic header —\n // \"Quiz: Unit 2 review\", never \"Content: <agent context>\". A selection\n // still shows itself.\n const { content, contentLabel } =\n namedHeader(menuProps.heading, m.actionText) ?? menuHeader(m.actionText, m.fieldLabel, chatMessage);\n // Re-resolve when what the menu would draw moves (agents finish loading, a\n // toggle flips, the record is renamed) — the target object itself stays one\n // per open.\n const revision = menuEngineRevision(drawn, { content, contentLabel });\n const engine = { revision, content, contentLabel };\n\n // A pass-through everywhere except under a MenuRegroupContext (the regroup\n // demo): there it reports what resolved and may draw a proposed grouping.\n const close = () => onOpenChange(false);\n // Only under a MenuRegroupContext (the proposed-menu demo): its size and header choice.\n const regroup = React.useContext(MenuRegroupContext);\n const panelLook = { size: regroup?.size ?? \"standard\", hideHeader: regroup?.hideHeader ?? false } as const;\n // THE DESIGNED MENU (opt-in: `menuDesign` on the wrapper): the published design, bound to this\n // open's rows, drawn on the desktop right-click. Phones keep the sheet, the palette stays.\n if (menuProps.menuDesign && mode === \"context\") {\n return (\n <EngineDesignedMenu\n name={menuProps.menuDesign}\n m={m}\n model={model}\n menuProps={menuProps}\n excludedRichIds={[\n ...m.excludedRichActionIds,\n ...(menuProps.recordActionsOnly ? editorOnlyRichActionIds(m.registryActions) : []),\n ]}\n point={point}\n onClose={close}\n />\n );\n }\n if (mode === \"sheet\") {\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ActionSheet {...engine} target={target} open={open} onOpenChange={onOpenChange} />\n </RegroupBoundary>\n );\n }\n if (mode === \"palette\") {\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ActionPalette {...engine} target={target} open={open} onOpenChange={onOpenChange} />\n </RegroupBoundary>\n );\n }\n return (\n <RegroupBoundary arrangement={menuProps.menuLayout} close={close}>\n <ContextMenuPanel\n {...engine}\n target={target}\n point={point}\n open={open}\n onOpenChange={onOpenChange}\n arrangement={menuProps.menuLayout}\n density={menuProps.menuDensity}\n // A control over a container of the thing (a note tab's \"…\"): its own\n // rows first, the rest under one \"<subject> ▸\" (alchemy 0.8.28).\n {...compact({ subjectFold: menuProps.subjectFold })}\n {...panelLook}\n />\n </RegroupBoundary>\n );\n}\n","\"use client\";\n// src/designed/EngineDesignedMenu.tsx — the designed menu inside TODAY's engine (phase 1).\n//\n// The small adapter the brief asks for: it takes what AlchemyMenuContent already has (the engine\n// hook's result, the built model, the props) and hands DesignedMenu plain rows and a context. A\n// later trigger replaces THIS file; DesignedMenu, MenuPanel and the bindings carry over unchanged.\n\nimport { useLayoutEffect, useRef } from \"react\";\nimport type { ContextMenuActions } from \"../engine/hooks/useContextMenuActions\";\nimport type { MenuModel } from \"../engine/model/menu-model\";\nimport type { MenuContentProps } from \"../engine/types\";\nimport { getContextMenuHost } from \"../engine/host/port\";\nimport { DesignedMenu, MENU_OPEN_MARK, MENU_PAINT_MARK } from \"./DesignedMenu\";\nimport { globalMenuDesign, globalMenuSource } from \"./global.menu\";\nimport { rowsFromEngineModel, surfaceLabelOf } from \"./rows\";\nimport { menuCounts, menuTimings, recordFetches, type FetchRecord, type InspectData } from \"./inspect-data\";\nimport type { MenuDesignName } from \"./menu-design-prop\";\nimport type { ResolvedMenu } from \"./types\";\n\nexport const PUBLISHED_DESIGNS = {\n global: { design: globalMenuDesign, source: globalMenuSource },\n} as const satisfies Record<MenuDesignName, unknown>;\n\nexport interface EngineDesignedMenuProps {\n name: MenuDesignName;\n m: ContextMenuActions;\n model: MenuModel;\n menuProps: Omit<MenuContentProps, \"variant\">;\n /** Rich-document ids the menu must not draw (surface exclusions, editor-only rows on a record). */\n excludedRichIds: readonly string[];\n point: { x: number; y: number };\n onClose: () => void;\n}\n\nexport function EngineDesignedMenu({ name, m, model, menuProps, excludedRichIds, point, onClose }: EngineDesignedMenuProps) {\n const published = PUBLISHED_DESIGNS[name];\n const rows = rowsFromEngineModel(model, { excludedRichIds, editable: Boolean(menuProps.isEditable) });\n const isAdmin = Boolean(m.isAdmin);\n\n // Admins: record what the menu fetches while it is open (layout effect: before the engine\n // hook's own fetch effect runs). Nobody else's fetch is ever wrapped.\n const fetches = useRef<FetchRecord[]>([]);\n useLayoutEffect(() => {\n if (!isAdmin) return;\n const rec = recordFetches();\n fetches.current = rec.records;\n return rec.stop;\n }, [isAdmin]);\n\n const getInspectData = (menu: ResolvedMenu): InspectData => {\n const surfaceName = menuProps.surfaceName ?? null;\n return {\n title: `${published.design.name === \"Untitled menu\" ? name : published.design.name} · ${surfaceName ?? menuProps.sourceFeature}`,\n surface: { name: surfaceName, manifest: surfaceName ? (getContextMenuHost().getSurfaceManifest(surfaceName) ?? null) : null },\n context: {\n surfaceName,\n sourceFeature: menuProps.sourceFeature,\n menuVersion: menuProps.menuVersion,\n contextData: menuProps.contextData,\n applicationScope: m.scope,\n editable: Boolean(menuProps.isEditable),\n recordActionsOnly: Boolean(menuProps.recordActionsOnly),\n selection: menuProps.selectedText\n ? { text: menuProps.selectedText, type: menuProps.selectionRange?.type ?? null, start: menuProps.selectionRange?.start ?? null, end: menuProps.selectionRange?.end ?? null }\n : null,\n actionText: m.actionText,\n fieldLabel: m.fieldLabel,\n entity: menuProps.entity ?? null,\n item: menuProps.item ?? null,\n heading: menuProps.heading ?? null,\n contentSource: menuProps.contentSource ?? null,\n flags: { isAdmin, isDebugMode: m.isDebugMode, isAdminIndicatorOpen: m.isAdminIndicatorOpen, hasCompareBase: m.hasCompareBase, canNativeUndo: m.canNativeUndo },\n },\n menu: {\n design: { designId: published.source.designId, name: published.design.name, version: published.source.version, savedAt: published.source.savedAt },\n items: menu.report.items,\n orphans: menu.report.orphans,\n duplicates: menu.report.duplicates,\n feature: menu.report.feature,\n counts: menuCounts(menu),\n },\n fetches: {\n recorded: fetches.current,\n engine: {\n libraries: { loading: m.loading, error: m.librariesError, categoryGroups: m.categoryGroups },\n boundAgents: { loading: m.boundAgentsLoading, error: m.boundAgentsError, sections: m.boundAgentSections },\n surfaceSection: m.surfaceSection,\n },\n },\n state: m.richDocCtx.getState(),\n performance: menuTimings(MENU_OPEN_MARK, MENU_PAINT_MARK),\n };\n };\n\n return (\n <DesignedMenu\n design={published.design}\n rows={rows}\n context={{\n surfaceName: menuProps.surfaceName ?? null,\n isAdmin,\n featureTitle: menuProps.menuFeatureTitle ?? null,\n surfaceLabel: surfaceLabelOf(model),\n }}\n point={point}\n onClose={onClose}\n {...(isAdmin ? { getInspectData } : {})}\n />\n );\n}\n","\"use client\";\n// src/designed/DesignedMenu.tsx — @ai-matrx/context-menu: THE DESIGNED MENU, LIVE.\n//\n// Arman's published design, bound to the rows of the menu that just opened, drawn at the pointer\n// through THE ONE menu renderer (MenuPanel — the builder draws through it too). Knows nothing of the\n// engine: it takes ModelRows (any trigger can make them) and a close callback.\n//\n// • at the pointer, in a portal; flips at the screen's edges; scrolls when taller than the window\n// • click outside, Esc, a window blur or resize closes; focus returns where it was\n// • a chosen row runs its own handler, then the menu closes (Retry-style rows keep it open)\n// • Super Admin › Inspect (admins only) loads its panel through ONE dynamic import, reached only\n// from the admin branch — a non-admin open never fetches it\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconResolver } from \"@ai-matrx/icons\";\nimport type { MenuDesign } from \"../design/model\";\nimport { resolveDesign, searchResolved, type ResolveContext } from \"./bindings\";\nimport { MenuPanel, type MenuPanelEnv } from \"./MenuPanel\";\nimport type { ModelRow, ResolvedItem, ResolvedMenu } from \"./types\";\nimport type { InspectData } from \"./inspect-data\";\n\nexport const MENU_OPEN_MARK = \"ai-matrx.context-menu.open\";\nexport const MENU_PAINT_MARK = \"ai-matrx.context-menu.painted\";\n\nexport interface DesignedMenuProps {\n design: MenuDesign;\n rows: readonly ModelRow[];\n /** surface name, admin flag, feature title, surface label. */\n context: Omit<ResolveContext, \"onInspect\">;\n /** Viewport point the menu opens at. */\n point: { x: number; y: number };\n onClose: () => void;\n /** Admins: everything Inspect shows, read when Inspect opens. */\n getInspectData?: ((menu: ResolvedMenu) => InspectData) | undefined;\n}\n\n/** The design's icons by lucide name: the static set at once, any other through the ONE lazy set. */\nfunction renderIcon(name: string, className?: string): ReactNode {\n return <IconResolver iconName={name} className={className} fallbackIcon=\"Circle\" />;\n}\n\n/** Where the menu sits: at the point, flipped left / up when it would leave the screen, then clamped. */\nexport function placeMenu(point: { x: number; y: number }, size: { width: number; height: number }, view: { width: number; height: number }) {\n const m = 8;\n let left = point.x;\n let top = point.y;\n if (left + size.width > view.width - m) left = point.x - size.width >= m ? point.x - size.width : Math.max(m, view.width - m - size.width);\n if (top + size.height > view.height - m) top = point.y - size.height >= m ? point.y - size.height : Math.max(m, view.height - m - size.height);\n return { left, top };\n}\n\nexport function DesignedMenu({ design, rows, context, point, onClose, getInspectData }: DesignedMenuProps) {\n const [query, setQuery] = useState(\"\");\n const [inspecting, setInspecting] = useState(false);\n const [at, setAt] = useState<{ left: number; top: number } | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef(onClose);\n closeRef.current = onClose;\n const isAdmin = context.isAdmin;\n\n const menu = useMemo(\n () => resolveDesign(design, rows, { ...context, ...(isAdmin && getInspectData ? { onInspect: () => setInspecting(true) } : {}) }),\n [design, rows, context, isAdmin, getInspectData],\n );\n\n // Focus returns where it was when the menu closes.\n useEffect(() => {\n const before = document.activeElement as HTMLElement | null;\n return () => {\n if (before && before.isConnected && typeof before.focus === \"function\") before.focus({ preventScroll: true });\n };\n }, []);\n\n // On screen at the pointer; the first paint is marked for Inspect's timing.\n useLayoutEffect(() => {\n const el = rootRef.current;\n if (!el || inspecting) return;\n const r = el.getBoundingClientRect();\n setAt(placeMenu(point, { width: r.width, height: r.height }, { width: window.innerWidth, height: window.innerHeight }));\n if (!el.contains(document.activeElement)) el.focus({ preventScroll: true });\n const raf = requestAnimationFrame(() => {\n try {\n performance.mark(MENU_PAINT_MARK);\n } catch {\n /* marks are best-effort */\n }\n });\n return () => cancelAnimationFrame(raf);\n }, [point, inspecting]);\n\n // Outside click, window blur or resize closes (not while Inspect is open).\n useEffect(() => {\n if (inspecting) return;\n const down = (e: PointerEvent) => {\n if (rootRef.current?.contains(e.target as Node)) return;\n closeRef.current();\n };\n const close = () => closeRef.current();\n document.addEventListener(\"pointerdown\", down, true);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n document.removeEventListener(\"pointerdown\", down, true);\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [inspecting]);\n\n const activate = (item: ResolvedItem) => {\n if (item.disabled) return;\n if (item.href) {\n if (item.target === \"_blank\") window.open(item.href, \"_blank\", \"noopener\");\n else window.location.assign(item.href);\n }\n item.run?.();\n if (!item.keepsMenuOpen) closeRef.current();\n };\n\n const env: MenuPanelEnv = {\n look: design.look,\n renderIcon,\n flyout: \"fixed\",\n onActivate: activate,\n query,\n setQuery,\n search: (q) => searchResolved(menu.nodes, q),\n onEscape: () => closeRef.current(),\n };\n\n if (typeof document === \"undefined\") return null;\n if (inspecting && isAdmin && getInspectData) {\n return createPortal(<InspectHost data={getInspectData(menu)} onClose={() => closeRef.current()} />, document.body);\n }\n return createPortal(\n <MenuPanel\n nodes={menu.nodes}\n env={env}\n className=\"cm-live\"\n style={{ left: at?.left ?? point.x, top: at?.top ?? point.y, visibility: at ? \"visible\" : \"hidden\" }}\n panelRef={(el) => {\n rootRef.current = el;\n }}\n rootProps={{\n \"data-designed-menu\": design.designId,\n onContextMenu: (e: MouseEvent) => e.preventDefault(),\n }}\n />,\n document.body,\n );\n}\n\n// ── Inspect: the admin branch's ONE dynamic edge ─────────────────────────────\n\ntype InspectModule = typeof import(\"@ai-matrx/context-menu/menu-inspect\");\n\nfunction InspectHost({ data, onClose }: { data: InspectData; onClose: () => void }) {\n const [mod, setMod] = useState<InspectModule | null>(null);\n const [failed, setFailed] = useState<string | null>(null);\n useEffect(() => {\n let live = true;\n import(\"@ai-matrx/context-menu/menu-inspect\").then(\n (m) => live && setMod(m),\n (e: unknown) => live && setFailed(e instanceof Error ? e.message : String(e)),\n );\n return () => {\n live = false;\n };\n }, []);\n if (failed) {\n return (\n <div className=\"cm-inspect\" role=\"dialog\" aria-label=\"Inspect\" onClick={onClose}>\n <div className=\"cm-inspect-body\">Inspect could not load: {failed}</div>\n </div>\n );\n }\n return mod ? <mod.InspectPanel data={data} onClose={onClose} /> : null;\n}\n","// src/designed/bindings.ts — @ai-matrx/context-menu: THE DESIGN, BOUND TO THE ROWS THAT RUN IT.\n//\n// Pure. `resolveDesign(design, rows, ctx)` walks the published design and, for every entry, finds the\n// live row that runs it — or says honestly why there is none:\n// works bound; the row's own handler runs\n// partial bound, but a variant or condition is missing (the reason says which)\n// unmatched no row runs it, or its catalog id is a stand-in used for a different meaning\n// needs-arman what it should do is unclear; nothing is guessed\n// Rows no entry binds are ORPHANS — never dropped: the page's own rows go to the feature section\n// (and \"Feature orphans\"), every other row to \"Global orphans\"; both are drawn for admins only.\n//\n// Binding order for one entry: the surface override (by design id, then by catalog id) → the\n// design rule (by design id) → the generic catalog table. A list of candidates is a list of\n// SYNONYMS (the same action under different hosts): the first one on the menu runs, the others are\n// drawn once, here, and reported as duplicates.\n\nimport {\n type MenuDesign,\n type MenuItemNode,\n type MenuNode,\n type MenuSectionNode,\n type MenuSlotNode,\n type MenuSubmenuNode,\n} from \"../design/model\";\nimport type {\n BindingStatus,\n BindingVerdict,\n ModelRow,\n OrphanVerdict,\n ResolvedItem,\n ResolvedMenu,\n ResolvedNode,\n ResolvedSection,\n ResolvedSubmenu,\n ResolveReport,\n} from \"./types\";\n\n// ── the generic table: catalog id → the rows that ARE that action ─────────────\n\nexport interface CatalogBinding {\n /** Synonyms, in preference order. Empty = no live row exists. */\n rows: readonly string[];\n status?: \"partial\" | undefined;\n reason?: string | undefined;\n}\n\nexport const CATALOG_ROWS: Readonly<Record<string, CatalogBinding>> = {\n // clipboard\n \"cm:copy\": { rows: [\"copy\", \"rich:copy\"] },\n \"cm:cut\": { rows: [\"cut\"] },\n \"cm:paste\": { rows: [\"paste\"] },\n \"cm:undo\": { rows: [\"undo\"] },\n \"cm:redo\": { rows: [\"redo\"] },\n \"cm:find\": { rows: [\"find\"] },\n \"cm:select-all\": { rows: [\"select-all\"] },\n \"cm:copy-as\": { rows: [\"copy-as\"] },\n \"cm:json\": { rows: [\"json\"] },\n \"copy-html-page\": { rows: [\"rich:copy-html-page\"] },\n \"cm:insert-reference\": { rows: [\"insert-reference\"] },\n // edit\n \"cm:save\": { rows: [\"save\"] },\n duplicate: { rows: [\"rich:conversation-duplicate\"] },\n rename: { rows: [\"rich:conversation-rename\"] },\n edit: { rows: [\"edit-in-place\", \"rich:edit\"] },\n \"cm:delete\": { rows: [\"delete\", \"rich:delete-message\"] },\n archive: { rows: [] },\n favorite: { rows: [] },\n // AI\n \"cm:chat\": { rows: [\"chat\"] },\n \"cm:quick-actions\": { rows: [\"quick-actions\"] },\n \"cm:placement:ai-action\": { rows: [\"placement:ai-action\"] },\n \"cm:placement:content-block\": { rows: [\"placement:content-block\"] },\n \"cm:placement:organization-tool\": { rows: [\"placement:organization-tool\"] },\n \"cm:placement:user-tool\": { rows: [\"placement:user-tool\"] },\n \"cm:placement:quick-action\": { rows: [\"quick-actions\"] },\n \"cm:placement:bound-agent\": { rows: [\"placement:bound-agent\"] },\n \"send-to-agent\": { rows: [\"rich:send-to-agent\"] },\n \"continue-in-chat\": { rows: [\"rich:continue-in-chat\"] },\n \"regenerate-response\": { rows: [\"rich:regenerate-response\"] },\n \"code-block-chart\": { rows: [\"rich:code-block-chart\"] },\n \"ai-improve\": { rows: [] },\n \"ai-summarize\": { rows: [] },\n \"ai-explain\": { rows: [] },\n \"ai-translate\": { rows: [] },\n // save & export\n \"cm:export\": { rows: [\"export\"], status: \"partial\", reason: \"The Export formats submenu (drawn only where there is no document); no custom export exists\" },\n \"cm:convert\": { rows: [\"convert\"] },\n \"save-as-file\": { rows: [\"rich:save-as-file\"] },\n \"download-pdf\": { rows: [\"rich:download-pdf\"] },\n \"download-docx\": { rows: [\"rich:download-docx\"] },\n \"download-html\": { rows: [\"rich:download-html\"] },\n print: { rows: [\"rich:print\"] },\n // share & publish\n \"cm:share\": { rows: [\"share\", \"rich:conversation-share\"] },\n \"share-link\": { rows: [\"rich:conversation-copy-link\"] },\n \"send-google-doc\": { rows: [\"rich:send-google-doc\"] },\n \"email-to-me\": { rows: [\"rich:email-to-me\"] },\n \"html-preview\": { rows: [\"rich:html-preview\"] },\n \"share-webpage\": { rows: [\"rich:share-webpage\"] },\n // organize\n \"cm:attach\": { rows: [\"attach\"] },\n \"set-context-value\": { rows: [\"rich:set-context-value\"] },\n \"pin-message\": { rows: [\"rich:pin-message\"] },\n \"notes-and-comments\": { rows: [\"rich:notes-and-comments\"] },\n move: { rows: [] },\n tags: { rows: [] },\n // history & compare\n \"cm:view-history\": { rows: [\"view-history\"] },\n \"edit-history\": { rows: [\"rich:edit-history\"] },\n \"fork-at-message\": { rows: [\"rich:fork-at-message\"] },\n \"cm:compare\": {\n rows: [\"rich:compare-with-base\", \"compare:with-base\", \"compare\"],\n status: \"partial\",\n reason: \"Opens Compare against the saved base; there is no blank compare window\",\n },\n \"compare-with-clipboard\": { rows: [\"rich:compare-with-clipboard\", \"compare:clipboard\"] },\n \"set-compare-base\": { rows: [\"rich:set-compare-base\", \"compare:set-base\"] },\n // listen\n \"cm:speak\": { rows: [\"speak\", \"rich:tts-play\"] },\n \"cm:listen\": { rows: [\"listen\"] },\n \"tts-voice-settings\": { rows: [\"rich:tts-voice-settings\"] },\n // notes page rows\n \"notes:close-tab\": { rows: [\"extra:notes-ops/close-tab\"] },\n \"notes:close-others\": { rows: [\"extra:notes-ops/close-others\"] },\n \"notes:export-md\": { rows: [\"extra:notes-ops/export\", \"extra:note-actions/export-markdown\", \"rich:save-as-file\"] },\n \"notes:share-clipboard\": { rows: [\"extra:notes-ops/share-clipboard\"] },\n \"notes:convert-artifacts\": { rows: [\"extra:notes-ops/convert-artifacts\"] },\n \"notes:trash\": { rows: [\"extra:notes-ops/delete\", \"extra:note-actions/delete\"] },\n // chat message rows\n \"regenerate-latest\": { rows: [\"rich:regenerate-latest\"] },\n \"fork-and-regenerate\": { rows: [\"rich:fork-and-regenerate\"] },\n \"feedback-up\": { rows: [\"rich:thumbs-up\"] },\n \"feedback-down\": { rows: [\"rich:thumbs-down\"] },\n // tools & admin\n \"cm:x:surface\": { rows: [\"surface/surface\"] },\n \"cm:admin\": { rows: [\"admin\"] },\n feedback: { rows: [\"rich:submit-feedback\"] },\n \"keyboard-shortcuts\": { rows: [] },\n // audit rows that have a live row\n \"audit:114\": { rows: [\"rich:add-to-rulebook\"] },\n};\n\n// ── per surface: the same catalog id is a different row on that page ─────────\n\nexport interface SurfaceOverride {\n id: string;\n /** Matches when the menu's surface name starts with one of these… */\n surfaceNames: readonly string[];\n /** …or when the menu carries one of these host sections. */\n sections: readonly string[];\n /** catalog id, or `#<design id>` for one entry, → synonyms (prepended to the generic rows). */\n rows: Readonly<Record<string, readonly string[]>>;\n}\n\nexport const SURFACE_OVERRIDES: readonly SurfaceOverride[] = [\n {\n id: \"notes\",\n surfaceNames: [\"matrx-user/notes\"],\n sections: [\"extra:notes-ops\", \"extra:note-actions\"],\n rows: {\n \"cm:save\": [\"extra:notes-ops/save\"],\n duplicate: [\"extra:notes-ops/duplicate\", \"extra:note-actions/duplicate\"],\n rename: [\"extra:note-actions/rename\"],\n move: [\"extra:notes-ops/move\", \"extra:note-actions/move-to-folder\"],\n \"cm:view-history\": [\"extra:note-actions/version-history\"],\n \"cm:share\": [\"extra:note-actions/share\"],\n \"share-link\": [\"extra:notes-ops/share-link\"],\n \"cm:delete\": [\"extra:notes-ops/delete\", \"extra:note-actions/delete\"],\n print: [\"rich:print\", \"extra:note-actions/print-document\"],\n // Send & Convert › Add to knowledge base — the note's own knowledge row.\n \"#i_4b63cb20\": [\"extra:note-actions/knowledge\"],\n },\n },\n];\n\n// ── per design entry: what the catalog id cannot say ─────────────────────────\n\nexport interface DesignRule {\n /** The entry's label when the rule was written (a test flags a republished design that moved it). */\n label: string;\n /** Replaces the catalog synonyms. */\n rows?: readonly string[];\n status?: \"partial\" | \"unmatched\" | \"needs-arman\";\n reason?: string;\n /** A submenu or item filled from a live row's children (`append`: after the design's own items). */\n fill?: { from: string; mode: \"children\" | \"append\" | \"inline\" };\n /** This entry is drawn by the entry named here (one fill stands for several mock rows). */\n mergedInto?: string;\n orphans?: \"feature\" | \"global\";\n /** Drawn only for admins; Inspect lives here. */\n superAdmin?: boolean;\n}\n\nconst PROPOSED = \"Proposed option — no live row runs it yet\";\n\n/** THE GLOBAL MENU's rules (design d_0707ad42). Keyed by design node id. */\nexport const GLOBAL_DESIGN_RULES: Readonly<Record<string, DesignRule>> = {\n i_82154a6b: { label: \"Archive\", status: \"unmatched\", reason: \"No archive row exists on any menu; notes offer Move to Trash (Content › Delete)\" },\n // Intelligence\n i_f9319837: { label: \"Create Agent for this\", status: \"needs-arman\", reason: \"Dragged from Chat; no create-agent row exists — what should it open?\" },\n m_294ffd3a: { label: \"AI Actions\", fill: { from: \"placement:ai-action\", mode: \"append\" } },\n i_ec0a5001: { label: \"Improve writing\", status: \"unmatched\", reason: PROPOSED },\n i_41dc4c76: { label: \"Summarize\", status: \"unmatched\", reason: PROPOSED },\n i_65ebe1a4: { label: \"Explain\", status: \"unmatched\", reason: PROPOSED },\n i_29261564: { label: \"Translate…\", status: \"unmatched\", reason: PROPOSED },\n m_e157dbc8: { label: \"Agents\", fill: { from: \"placement:bound-agent\", mode: \"children\" } },\n s_c3e45d72: {\n label: \"Surface Intelligence\",\n status: \"needs-arman\",\n reason: \"Empty in the design; the page's surface submenu (location, context, agents) is the likely fill — it sits in Feature orphans until placed\",\n },\n i_56c420c8: { label: \"Kind Shapes\", status: \"needs-arman\", reason: \"No catalog option; what should Kind Shapes list or open?\" },\n i_35f46721: { label: \"Artifacts\", status: \"needs-arman\", reason: \"No catalog option; what should Artifacts list or open?\" },\n // My Intelligence\n i_e6795a3d: { label: \"My custom agent 1\", fill: { from: \"placement:user-tool\", mode: \"inline\" } },\n i_17e1a01b: { label: \"My custom agent 2\", mergedInto: \"i_e6795a3d\" },\n i_77e75862: { label: \"My custom agent 3, 4 ...\", mergedInto: \"i_e6795a3d\" },\n m_5838209d: { label: \"My custom folder\", status: \"needs-arman\", reason: \"Your categories already arrive with the live My Items rows; is a folder a category?\" },\n m_a5717277: { label: \"My custom folder\", status: \"needs-arman\", reason: \"Your categories already arrive with the live My Items rows; is a folder a category?\" },\n s_b6b6e037: { label: \"Organizations\", status: \"needs-arman\", reason: \"Org Items (organization tools) is the likely fill — in Global orphans until ruled\" },\n s_333c203b: { label: \"Shared with me\", status: \"unmatched\", reason: \"No shared-with-me rows reach the menu\" },\n i_e4f67cb6: { label: \"Customize\", status: \"needs-arman\", reason: \"No row; what should Customize open?\" },\n // Content\n i_b95bebe0: { label: \"Refresh\", status: \"needs-arman\", reason: \"Dragged from Edit; what should Refresh do?\" },\n i_97bfd2a2: { label: \"Cleanup\", status: \"needs-arman\", reason: \"Dragged from Edit; Clean up (rich:text-cleanup) is the likely row — in Global orphans until ruled\" },\n i_eeb51a1e: { label: \"Outline\", status: \"needs-arman\", reason: \"Dragged from Edit; no outline row exists — what should Outline do?\" },\n i_0c67e994: { label: \"Search with AI\", status: \"unmatched\", reason: \"Dragged from Find & Replace; no AI search row exists\" },\n i_a69ba340: { label: \"Improve writing\", status: \"unmatched\", reason: PROPOSED },\n i_3c09ec12: { label: \"Summarize\", status: \"unmatched\", reason: PROPOSED },\n i_02a7fbac: { label: \"Expand content\", status: \"unmatched\", reason: \"Dragged from Summarize (proposed); no expand row exists\" },\n i_5b3f6d51: { label: \"Make a table\", status: \"unmatched\", reason: \"Dragged from Summarize (proposed); no make-a-table row exists\" },\n // Copy\n i_1f2dd157: { label: \"Raw Text\", status: \"partial\", reason: \"Runs plain Copy: the text as written, markdown included\" },\n i_4958860f: { label: \"Strip markdown\", rows: [\"rich:copy-plain-text\"] },\n i_b8fa8de1: { label: \"For Google Docs & Gmail\", status: \"partial\", reason: \"Runs plain Copy; no rich-text (HTML clipboard) copy row exists\" },\n i_68b385a6: { label: \"For Microsoft Office\", status: \"partial\", reason: \"Runs plain Copy; no Office-formatted copy row exists\" },\n i_6f508d32: { label: \"Structured For AI\", status: \"partial\", reason: \"Runs plain Copy; no structured-for-AI copy row exists\" },\n i_a4ce9583: { label: \"With Context\", status: \"partial\", reason: \"Runs plain Copy; no copy-with-context row exists\" },\n i_834c201b: { label: \"With Prompt\", status: \"partial\", reason: \"Runs plain Copy; no copy-with-prompt row exists\" },\n i_c1ceed9d: { label: \"Copy reference\", status: \"partial\", reason: \"The reference row inserts the reference in an editable field and copies it elsewhere\" },\n i_84d0d88a: { label: \"Custom edit\", status: \"unmatched\", reason: \"Dragged from Copy as…; no custom-edit row exists\" },\n // feature orphans\n s_1abf26db: { label: \"Feature orphans\", orphans: \"feature\" },\n // Export & Download\n i_66ee72ce: { label: \"Download with AI\", status: \"needs-arman\", reason: \"Dragged from Find & Replace; what should Download with AI do?\" },\n // Send & Convert\n i_720df996: { label: \"Add to Active Context\", status: \"unmatched\", reason: \"Dragged from Convert; no row adds to the active context (Set Context Value sets one value)\" },\n i_4b63cb20: { label: \"Add to knowledge base\", status: \"unmatched\", reason: \"Only notes have a knowledge-base row; elsewhere nothing runs it\" },\n i_fdaa2e24: { label: \"Open in Canvas\", status: \"unmatched\", reason: \"Dragged from Convert; no open-in-canvas row exists\" },\n i_a207c217: { label: \"Notes\", rows: [\"rich:save-to-notes\"] },\n i_18eb28c6: { label: \"Document\", rows: [\"rich:add-to-docs\"] },\n i_5f78991d: { label: \"File\", rows: [\"rich:save-to-files\"] },\n i_bed92d83: { label: \"Task\", rows: [\"rich:save-to-task\"] },\n i_c86ed71c: { label: \"Project\", status: \"unmatched\", reason: \"Dragged from Convert; no save-to-project row exists\" },\n i_dbdcad1a: { label: \"Custom data\", status: \"unmatched\", reason: \"Dragged from Convert; only a table can be saved as data (rich:save-table-as-data)\" },\n i_07b55ba5: { label: \"Send via DM\", status: \"needs-arman\", reason: \"Dragged from Email to me; no direct-message row exists — to whom, through what?\" },\n i_eca3b31b: { label: \"Convert with AI\", status: \"needs-arman\", reason: \"Dragged from Find & Replace; what should Convert with AI do?\" },\n i_73a06d6f: { label: \"Custom convert\", status: \"needs-arman\", reason: \"Dragged from Convert; what is a custom convert?\" },\n i_16ae6cf2: { label: \"To any connection...\", status: \"needs-arman\", reason: \"Dragged from Convert; which connections, and what is sent?\" },\n // Listen & Speak\n i_f65633d0: { label: \"Dictate\", status: \"unmatched\", reason: \"cm:listen is Listen (spoken summary), not dictation; Quick Actions › Voice Input opens the voice pad\" },\n i_733fc812: { label: \"Condense & Read\", rows: [\"rich:summarize-and-listen\", \"spoken-summary-live\"] },\n // Help\n i_ab248359: { label: \"Help me with this\", status: \"needs-arman\", reason: \"No catalog option; Help with this… (rich:text-help) edits the text — is that it?\" },\n i_fbdcca01: { label: \"I found a bug\", status: \"needs-arman\", reason: \"No catalog option; Submit feedback (rich:submit-feedback) is the likely row\" },\n i_9c46db53: { label: \"Request a feature\", status: \"needs-arman\", reason: \"No catalog option; Submit feedback (rich:submit-feedback) is the likely row\" },\n i_12784f2c: { label: \"Info\", status: \"needs-arman\", reason: \"No catalog option; notes have About this note — what should Info show elsewhere?\" },\n // Organize\n i_d8e4c6b9: { label: \"Tags…\", status: \"unmatched\", reason: \"No tags row exists on any menu\" },\n // Admin\n m_74072d95: { label: \"Creator Options\", status: \"unmatched\", reason: \"No creator rows reach the menu yet\" },\n m_32f84a2e: { label: \"Org Admin\", status: \"unmatched\", reason: \"The host gives the menu no org-admin flag and no org-admin rows\" },\n s_888d81ec: { label: \"Super Admin\", fill: { from: \"admin\", mode: \"children\" }, superAdmin: true },\n m_54111c0a: { label: \"Global orphans\", orphans: \"global\" },\n};\n\n/** The rules for each published design. */\nexport const DESIGN_RULES: Readonly<Record<string, Readonly<Record<string, DesignRule>>>> = {\n d_0707ad42: GLOBAL_DESIGN_RULES,\n};\n\n// ── resolution ───────────────────────────────────────────────────────────────\n\nexport interface ResolveContext {\n surfaceName?: string | null | undefined;\n /** Admin per the host's Redux admin flag: orphans and Super Admin draw only then. */\n isAdmin: boolean;\n /** The host's own name for the feature section; else the surface's display label. */\n featureTitle?: string | null | undefined;\n surfaceLabel?: string | null | undefined;\n /** Super Admin › Inspect (admins only). */\n onInspect?: (() => void) | undefined;\n}\n\nexport function indexRows(rows: readonly ModelRow[], out = new Map<string, ModelRow>()): Map<string, ModelRow> {\n for (const r of rows) {\n if (!out.has(r.key)) out.set(r.key, r);\n if (r.children) indexRows(r.children, out);\n }\n return out;\n}\n\nexport function activeOverrides(rows: ReadonlyMap<string, ModelRow>, ctx: Pick<ResolveContext, \"surfaceName\">): SurfaceOverride[] {\n const sections = new Set([...rows.values()].map((r) => r.section));\n return SURFACE_OVERRIDES.filter(\n (o) =>\n (ctx.surfaceName && o.surfaceNames.some((n) => (ctx.surfaceName as string).startsWith(n))) ||\n o.sections.some((s) => sections.has(s)),\n );\n}\n\ninterface Candidates {\n rows: readonly string[];\n status?: BindingStatus | undefined;\n reason?: string | undefined;\n /** The rows came from a surface override (it outranks a rule's status). */\n fromSurface?: boolean;\n}\n\nfunction candidatesFor(node: MenuNode, rule: DesignRule | undefined, overrides: readonly SurfaceOverride[]): Candidates | null {\n for (const o of overrides) {\n const byId = o.rows[`#${node.id}`];\n if (byId) return { rows: byId, fromSurface: true };\n }\n if (rule?.status === \"needs-arman\" || rule?.status === \"unmatched\") {\n return { rows: [], status: rule.status, reason: rule.reason };\n }\n const generic = node.catalogId ? CATALOG_ROWS[node.catalogId] : undefined;\n const surface = node.catalogId ? overrides.flatMap((o) => o.rows[node.catalogId as string] ?? []) : [];\n const rows = [...surface, ...(rule?.rows ?? generic?.rows ?? [])];\n if (!rule?.rows && !generic && surface.length === 0) return null;\n const status = rule?.status ?? (rule?.rows ? undefined : generic?.status);\n const reason = rule?.reason ?? (rule?.rows ? undefined : generic?.reason);\n return { rows, ...(status ? { status } : {}), ...(reason ? { reason } : {}) };\n}\n\ninterface Walk {\n rows: ReadonlyMap<string, ModelRow>;\n rules: Readonly<Record<string, DesignRule>>;\n overrides: readonly SurfaceOverride[];\n ctx: ResolveContext;\n /** Row keys a design entry placed (with their descendants). */\n consumed: Set<string>;\n duplicates: ResolveReport[\"duplicates\"];\n verdicts: BindingVerdict[];\n /** Filled after the walk (orphans and the feature section need every binding first). */\n late: Array<() => void>;\n /** The top-level rows, in the engine's order. */\n tops: readonly ModelRow[];\n report: ResolveReport;\n}\n\nfunction consume(row: ModelRow, w: Walk): void {\n w.consumed.add(row.key);\n row.children?.forEach((c) => consume(c, w));\n}\n\nfunction iconOf(row: ModelRow | undefined, name: string | undefined) {\n if (row?.icon) return { component: row.icon, ...(row.iconClassName ? { className: row.iconClassName } : {}), ...(row.iconStyle ? { style: row.iconStyle } : {}) };\n return name ? { name } : undefined;\n}\n\n/** A live row as a drawn node (fills, the feature section, orphans). */\nexport function rowNode(row: ModelRow, idPrefix: string): ResolvedNode {\n const id = `${idPrefix}${row.key}`;\n const keywords = [row.hint, row.description, row.sectionLabel].filter((x): x is string => Boolean(x));\n if (row.kind === \"submenu\") {\n const children: ResolvedNode[] = [];\n for (const c of row.children ?? []) {\n if (c.startsGroup && children.length > 0) children.push({ kind: \"divider\", id: `${idPrefix}${c.key}:sep` });\n children.push(rowNode(c, idPrefix));\n }\n return {\n kind: \"submenu\",\n id,\n label: row.label,\n icon: iconOf(row, undefined),\n binding: row.key,\n disabled: row.disabled,\n ...(row.reason ? { disabledReason: row.reason } : {}),\n ...(row.loading ? { loading: true } : {}),\n keywords,\n children,\n };\n }\n return {\n kind: \"item\",\n id,\n label: row.label,\n icon: iconOf(row, undefined),\n binding: row.key,\n disabled: row.disabled,\n ...(row.reason ? { disabledReason: row.reason } : {}),\n ...(row.hint ? { shortcut: row.hint } : {}),\n ...(row.description ? { hint: row.description } : {}),\n keywords,\n ...(row.destructive ? { danger: true } : {}),\n ...(row.kind === \"checkbox\" ? { toggle: true, checked: Boolean(row.checked) } : {}),\n ...(row.href ? { href: row.href, ...(row.target ? { target: row.target } : {}) } : {}),\n ...(row.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n ...(row.run ? { run: row.run } : {}),\n };\n}\n\nfunction availabilityOf(row: ModelRow | undefined): BindingVerdict[\"availability\"] {\n return row ? (row.disabled ? \"disabled\" : \"here\") : \"absent\";\n}\n\n/** Apply the design's unavailable rule. Returns null when the entry is to be left out. */\nfunction applyUnavailable<T extends ResolvedItem | ResolvedSubmenu>(node: T, design: MenuNode, row: ModelRow | undefined): T | null {\n const unavailable = !row || row.disabled;\n if (!unavailable) return node;\n const mode = design.unavailable ?? \"disable\";\n if (mode === \"hide\") return null;\n if (mode === \"required\" && !row) {\n return { ...node, disabled: true, missingRequired: true, disabledReason: \"Required here, but missing\" };\n }\n return { ...node, disabled: true, disabledReason: row?.reason ?? design.unavailableWhen ?? \"Not available here\" };\n}\n\nfunction verdict(w: Walk, node: MenuNode, path: string[], v: Omit<BindingVerdict, \"designId\" | \"label\" | \"path\" | \"catalogId\">): void {\n w.verdicts.push({\n designId: node.id,\n label: \"label\" in node ? node.label : \"\",\n path: path.join(\" › \"),\n ...(node.catalogId ? { catalogId: node.catalogId } : {}),\n ...v,\n });\n}\n\n/** Bind one design item (or a submenu bound as a whole). */\nfunction bindEntry(node: MenuItemNode | MenuSubmenuNode, w: Walk, path: string[]): { row?: ModelRow; status: BindingStatus; reason?: string; binding?: string } {\n const rule = w.rules[node.id];\n const c = candidatesFor(node, rule, w.overrides);\n if (!c) {\n const reason = node.catalogId ? `No live row for ${node.catalogId}` : \"Not dragged from the catalog; nothing runs it\";\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return { status: \"unmatched\", reason };\n }\n if (c.status === \"needs-arman\" || c.status === \"unmatched\") {\n verdict(w, node, path, { status: c.status, ...(c.reason ? { reason: c.reason } : {}), availability: \"none\" });\n return { status: c.status, ...(c.reason ? { reason: c.reason } : {}) };\n }\n if (c.rows.length === 0) {\n const reason = node.catalogId?.startsWith(\"ai-\") ? PROPOSED : `No live row for ${node.catalogId}`;\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return { status: \"unmatched\", reason };\n }\n const present = c.rows.map((k) => w.rows.get(k)).filter((r): r is ModelRow => Boolean(r));\n const row = present.find((r) => !r.disabled) ?? present[0];\n const status: BindingStatus = c.fromSurface ? \"works\" : (c.status ?? \"works\");\n for (const r of present) {\n if (row && r !== row && !w.consumed.has(r.key)) w.duplicates.push({ key: r.key, label: r.label, duplicateOf: row.key });\n consume(r, w);\n }\n const binding = row?.key ?? c.rows[0];\n verdict(w, node, path, {\n status,\n ...(binding ? { binding } : {}),\n ...(c.reason && !c.fromSurface ? { reason: c.reason } : {}),\n availability: availabilityOf(row),\n });\n return { ...(row ? { row } : {}), status, ...(c.reason && !c.fromSurface ? { reason: c.reason } : {}), ...(binding ? { binding } : {}) };\n}\n\nfunction resolveItem(node: MenuItemNode, w: Walk, path: string[]): ResolvedNode[] {\n const rule = w.rules[node.id];\n if (rule?.mergedInto) return [];\n if (rule?.fill?.mode === \"inline\") {\n const from = w.rows.get(rule.fill.from);\n const kids = from?.children ?? [];\n if (from) consume(from, w);\n verdict(w, node, path, {\n status: \"works\",\n binding: rule.fill.from,\n reason: \"Filled at runtime with the live rows\",\n availability: from ? (kids.length ? \"here\" : \"disabled\") : \"absent\",\n });\n if (kids.length === 0) {\n return [{ kind: \"item\", id: node.id, designId: node.id, label: \"Nothing here yet\", disabled: true, disabledReason: from?.reason ?? \"No rows of this kind for you yet\" }];\n }\n return kids.map((k) => ({ ...rowNode(k, `${node.id}:`), designId: node.id }));\n }\n const b = bindEntry(node, w, path);\n const row = b.row;\n // A design item bound to a submenu row draws as that submenu.\n if (row?.kind === \"submenu\") {\n const sub = rowNode(row, `${node.id}:`) as ResolvedSubmenu;\n const drawn: ResolvedSubmenu = {\n ...sub,\n id: node.id,\n designId: node.id,\n label: node.label,\n icon: iconOf(row, node.icon),\n status: b.status,\n ...(b.reason ? { statusReason: b.reason } : {}),\n keywords: [...(node.keywords ?? []), row.label, ...(sub.keywords ?? [])],\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n };\n const kept = applyUnavailable(drawn, node, row);\n return kept ? [kept] : [];\n }\n const drawn: ResolvedItem = {\n kind: \"item\",\n id: node.id,\n designId: node.id,\n label: node.label,\n icon: iconOf(row, node.icon),\n ...(node.shortcut ? { shortcut: node.shortcut } : row?.hint ? { shortcut: row.hint } : {}),\n ...(node.hint ? { hint: node.hint } : {}),\n keywords: [...(node.keywords ?? []), ...(row ? [row.label, row.description ?? \"\"] : [])].filter(Boolean),\n status: b.status,\n ...(b.reason ? { statusReason: b.reason } : {}),\n ...(b.binding ? { binding: b.binding } : {}),\n disabled: b.status === \"unmatched\" || b.status === \"needs-arman\" ? true : Boolean(row?.disabled),\n ...(row?.reason ? { disabledReason: row.reason } : {}),\n ...(node.danger || row?.destructive ? { danger: true } : {}),\n ...(node.ai ? { ai: true } : {}),\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n ...(node.toggle || row?.kind === \"checkbox\" ? { toggle: true, checked: row?.kind === \"checkbox\" ? Boolean(row.checked) : Boolean(node.defaultOn) } : {}),\n ...(node.switch ? { switch: true, checked: Boolean(row?.checked ?? node.defaultOn) } : {}),\n ...(row?.href ? { href: row.href, ...(row.target ? { target: row.target } : {}) } : {}),\n ...(row?.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n ...(row?.run ? { run: row.run } : {}),\n source: node,\n };\n if (b.status === \"unmatched\" || b.status === \"needs-arman\") return [drawn];\n const kept = applyUnavailable(drawn, node, row);\n return kept ? [kept] : [];\n}\n\nfunction resolveSubmenu(node: MenuSubmenuNode, w: Walk, path: string[]): ResolvedNode[] {\n const rule = w.rules[node.id];\n const here = [...path, node.label];\n const base = {\n kind: \"submenu\" as const,\n id: node.id,\n designId: node.id,\n label: node.label,\n ...(node.icon ? { icon: { name: node.icon } } : {}),\n ...(node.hint ? { hint: node.hint } : {}),\n ...(node.keywords ? { keywords: node.keywords } : {}),\n ...(node.tone ? { tone: node.tone } : {}),\n ...(node.toneLabel ? { toneLabel: true } : {}),\n };\n if (rule?.superAdmin && !w.ctx.isAdmin) return [];\n if (rule?.orphans) {\n if (!w.ctx.isAdmin) return [];\n const drawn: ResolvedSubmenu = { ...base, disabled: false, children: [] };\n // The rows are known only once every entry has bound.\n w.late.push(() => {\n drawn.children = orphanNodes(rule.orphans as \"feature\" | \"global\", w);\n if (drawn.children.length === 0) {\n drawn.disabled = true;\n drawn.disabledReason = \"Every row of this kind is placed\";\n }\n });\n verdict(w, node, path, { status: \"works\", reason: \"Rows no entry places, for admins\", availability: \"here\" });\n return [drawn];\n }\n if (rule?.status === \"needs-arman\" || rule?.status === \"unmatched\") {\n verdict(w, node, path, { status: rule.status, ...(rule.reason ? { reason: rule.reason } : {}), availability: \"none\" });\n return [{ ...base, status: rule.status, ...(rule.reason ? { statusReason: rule.reason } : {}), disabled: true, children: resolveList(node.children, w, here) }];\n }\n const own = resolveList(node.children, w, here);\n if (rule?.fill) {\n const from = w.rows.get(rule.fill.from);\n if (from) consume(from, w);\n const filled = (from?.children ?? []).flatMap((c, i) => {\n const n = rowNode(c, `${node.id}:`);\n return c.startsGroup && i > 0 ? [{ kind: \"divider\" as const, id: `${node.id}:${c.key}:sep` }, n] : [n];\n });\n const extra: ResolvedNode[] = [];\n if (rule.superAdmin && w.ctx.onInspect) {\n extra.push({ kind: \"item\", id: `${node.id}:inspect`, designId: node.id, label: \"Inspect\", icon: { name: \"ScanSearch\" }, disabled: false, keywords: [\"debug\", \"json\", \"context\"], run: w.ctx.onInspect, keepsMenuOpen: true });\n }\n const children = [...own, ...(own.length && filled.length ? [{ kind: \"divider\" as const, id: `${node.id}:fill-sep` }] : []), ...filled, ...(extra.length && (own.length || filled.length) ? [{ kind: \"divider\" as const, id: `${node.id}:inspect-sep` }] : []), ...extra];\n verdict(w, node, path, {\n status: \"works\",\n binding: rule.fill.from,\n reason: rule.fill.mode === \"append\" ? \"The live rows follow the design's own\" : \"Filled at runtime with the live rows\",\n availability: from ? (filled.length ? \"here\" : \"disabled\") : \"absent\",\n });\n return [\n {\n ...base,\n status: \"works\",\n binding: rule.fill.from,\n disabled: children.length === 0,\n ...(children.length === 0 ? { disabledReason: from?.reason ?? \"Nothing here yet\" } : {}),\n ...(from?.loading ? { loading: true } : {}),\n children,\n },\n ];\n }\n if (node.children.length === 0) {\n // An empty submenu dragged from the catalog binds like an item (Compare, Export…).\n if (node.catalogId) return resolveItem({ ...node, kind: \"item\" } as unknown as MenuItemNode, w, path);\n const reason = \"Empty in the design; nothing is bound to it\";\n verdict(w, node, path, { status: \"unmatched\", reason, availability: \"none\" });\n return [{ ...base, status: \"unmatched\", statusReason: reason, disabled: true, children: [] }];\n }\n return [{ ...base, disabled: false, children: own }];\n}\n\nfunction resolveSection(node: MenuSectionNode, w: Walk, path: string[]): ResolvedSection {\n const here = node.label ? [...path, node.label] : path;\n return {\n kind: \"section\",\n id: node.id,\n designId: node.id,\n label: node.label,\n layout: node.layout ?? \"list\",\n ...(node.collapsible ? { collapsible: true } : {}),\n children: resolveList(node.children, w, here),\n };\n}\n\n/** THE FEATURE SECTION: the page's own rows — the first N, the rest under \"More\". */\nfunction resolveFeature(node: MenuSlotNode, w: Walk): ResolvedNode[] {\n const holder: ResolvedSection = { kind: \"section\", id: node.id, designId: node.id, label: \"\", layout: \"list\", feature: true, children: [] };\n const out: ResolvedNode[] = [holder];\n // First of the late passes: the feature section claims the page rows before the orphans count.\n w.late.unshift(() => {\n const rows = pageRows(w);\n if (rows.length === 0) {\n out.length = 0;\n return;\n }\n const seen = new Map<string, string>();\n const unique: ModelRow[] = [];\n for (const r of rows) {\n const k = r.label.trim().toLowerCase();\n const first = seen.get(k);\n if (first) {\n w.duplicates.push({ key: r.key, label: r.label, duplicateOf: first });\n consume(r, w);\n continue;\n }\n seen.set(k, r.key);\n unique.push(r);\n }\n unique.forEach((r) => consume(r, w));\n const n = Math.max(0, Math.min(12, node.featureItems ?? 4));\n const first = unique.slice(0, n).map((r) => rowNode(r, `${node.id}:`));\n const rest = unique.slice(n).map((r) => rowNode(r, `${node.id}:`));\n const title = w.ctx.featureTitle || w.ctx.surfaceLabel || unique[0]?.sectionLabel || \"This page\";\n holder.label = title;\n holder.children = rest.length\n ? [...first, { kind: \"submenu\", id: `${node.id}:more`, designId: node.id, label: \"More\", icon: { name: \"Ellipsis\" }, disabled: false, children: rest }]\n : first;\n w.report.feature = { title, rows: unique.map((r) => r.key) };\n });\n return out;\n}\n\n/** The page's own rows no entry placed, at the top level of their sections (host sections first). */\nfunction pageRows(w: Walk): ModelRow[] {\n const top = [...w.rows.values()].filter((r) => r.origin === \"page\" && !w.consumed.has(r.key));\n // Only rows whose parent is not itself a page row (a submenu keeps its children).\n const childKeys = new Set(top.flatMap((r) => (r.children ?? []).map((c) => c.key)));\n return top.filter((r) => !childKeys.has(r.key));\n}\n\n/** The unplaced rows of one bucket, as drawn nodes (a partly placed submenu keeps only the rest). */\nfunction orphanNodes(bucket: \"feature\" | \"global\", w: Walk): ResolvedNode[] {\n const out: ResolvedNode[] = [];\n const prune = (row: ModelRow): ModelRow | null => {\n if (w.consumed.has(row.key)) return null;\n if (!row.children) return row;\n const placedInside = row.children.some((c) => containsConsumed(c, w));\n if (!placedInside) return row;\n const kids = row.children.map(prune).filter((c): c is ModelRow => c !== null && (c.kind !== \"submenu\" || (c.children?.length ?? 0) > 0));\n return kids.length ? { ...row, children: kids } : null;\n };\n for (const row of w.tops) {\n if ((row.page ? \"feature\" : \"global\") !== bucket) continue;\n const kept = prune(row);\n if (!kept) continue;\n out.push(rowNode(kept, `orphan:`));\n collectOrphans(kept, bucket, w);\n }\n return out;\n}\n\nfunction containsConsumed(row: ModelRow, w: Walk): boolean {\n return w.consumed.has(row.key) || Boolean(row.children?.some((c) => containsConsumed(c, w)));\n}\n\nfunction collectOrphans(row: ModelRow, bucket: \"feature\" | \"global\", w: Walk): void {\n w.report.orphans.push({ key: row.key, label: row.label, origin: row.origin, section: row.section, bucket });\n}\n\nfunction resolveList(nodes: readonly MenuNode[], w: Walk, path: string[]): ResolvedNode[] {\n const out: ResolvedNode[] = [];\n for (const n of nodes) {\n if (n.kind === \"divider\") out.push({ kind: \"divider\", id: n.id, designId: n.id });\n else if (n.kind === \"search\") out.push({ kind: \"search\", id: n.id, designId: n.id, placeholder: n.placeholder || \"Type to filter…\", autofocus: n.autofocus });\n else if (n.kind === \"item\") out.push(...resolveItem(n, w, path));\n else if (n.kind === \"submenu\") out.push(...resolveSubmenu(n, w, path));\n else if (n.kind === \"section\") out.push(resolveSection(n, w, path));\n else if (n.kind === \"slot\") {\n if (n.shape === \"feature\") out.push(...resolveFeature(n, w));\n else {\n verdict(w, n, path, { status: \"unmatched\", reason: `Placeholder \"${n.fills}\" (${n.shape}) is drawn only in the builder`, availability: \"none\" });\n }\n }\n }\n return out;\n}\n\n/** The design, bound to this menu's rows. */\nexport function resolveDesign(design: MenuDesign, rows: readonly ModelRow[], ctx: ResolveContext): ResolvedMenu {\n const index = indexRows(rows);\n const report: ResolveReport = { items: [], orphans: [], duplicates: [], feature: null };\n const w: Walk = {\n rows: index,\n rules: DESIGN_RULES[design.designId] ?? {},\n overrides: activeOverrides(index, ctx),\n ctx,\n consumed: new Set(),\n duplicates: report.duplicates,\n verdicts: report.items,\n late: [],\n tops: rows,\n report,\n };\n const nodes = resolveList(design.nodes, w, []);\n // The feature section first (it claims the page rows), then the orphans (what is left).\n for (const fn of w.late) fn();\n // A feature section with no rows was emptied in place: drop the empty holder.\n return { nodes: pruneEmpty(nodes), report };\n}\n\nfunction pruneEmpty(nodes: ResolvedNode[]): ResolvedNode[] {\n return nodes\n .filter((n) => !(n.kind === \"section\" && n.feature && n.children.length === 0))\n .map((n) => (n.kind === \"section\" || n.kind === \"submenu\" ? { ...n, children: pruneEmpty(n.children) } : n));\n}\n\n// ── search ───────────────────────────────────────────────────────────────────\n\nexport interface ResolvedHit {\n node: ResolvedItem | ResolvedSubmenu;\n /** Where it lives (\"Copy › Text\"). */\n path: string;\n}\n\nfunction words(n: ResolvedItem | ResolvedSubmenu, trail: readonly string[]): string {\n return [n.label, n.hint ?? \"\", ...(n.keywords ?? []), ...trail].join(\" \").toLowerCase();\n}\n\n/** Every BOUND entry matching the query (label, hint, keywords, place), wherever it sits. */\nexport function searchResolved(nodes: readonly ResolvedNode[], query: string, trail: string[] = [], out: ResolvedHit[] = []): ResolvedHit[] {\n const ws = query.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n if (ws.length === 0) return out;\n for (const n of nodes) {\n if (n.kind === \"item\") {\n const bound = Boolean(n.run || n.href) && n.status !== \"unmatched\" && n.status !== \"needs-arman\" && !n.placeholder;\n if (bound && ws.every((x) => words(n, trail).includes(x))) out.push({ node: n, path: trail.join(\" › \") });\n } else if (n.kind === \"submenu\") {\n searchResolved(n.children, query, [...trail, n.label], out);\n } else if (n.kind === \"section\") {\n searchResolved(n.children, query, n.label && !n.feature ? [...trail, n.label] : n.feature ? [...trail, n.label] : trail, out);\n }\n }\n return out;\n}\n\n/** Every design entry, for the ledger: path, status, binding, reason. */\nexport function bindingTable(design: MenuDesign, rows: readonly ModelRow[], ctx: ResolveContext): BindingVerdict[] {\n return resolveDesign(design, rows, ctx).report.items;\n}\n\n","// src/designed/global.menu.ts — GENERATED by scripts/menu-publish.mjs. Never hand-edit: change the\n// design in the builder, save, and publish again.\n//\n// design d_0707ad42 (\"Untitled menu\")\n// version 16\n// saved 2026-10-10T22:16:37.417Z\n// record created 2026-10-10 22:16:37.68368+00\n\nimport type { MenuDesign } from \"../design/model\";\n\nfunction deepFreeze<T>(value: T): T {\n if (value && typeof value === \"object\" && !Object.isFrozen(value)) {\n Object.freeze(value);\n for (const v of Object.values(value as Record<string, unknown>)) deepFreeze(v);\n }\n return value;\n}\n\nexport const globalMenuSource = { designId: \"d_0707ad42\", version: 16, savedAt: \"2026-10-10T22:16:37.417Z\" } as const;\n\nexport const globalMenuDesign: MenuDesign = deepFreeze<MenuDesign>({\n \"designId\": \"d_0707ad42\",\n \"name\": \"Untitled menu\",\n \"surface\": \"anywhere\",\n \"look\": {\n \"density\": \"comfortable\",\n \"width\": 280,\n \"showIcons\": true,\n \"showShortcuts\": true,\n \"showHints\": false,\n \"search\": false\n },\n \"nodes\": [\n {\n \"id\": \"s_tmv2q4pofh\",\n \"kind\": \"section\",\n \"label\": \"\",\n \"layout\": \"row\",\n \"children\": [\n {\n \"id\": \"i_tmv2q4pofi\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:cut\",\n \"label\": \"Cut\",\n \"icon\": \"Scissors\",\n \"shortcut\": \"⌘X\"\n },\n {\n \"id\": \"i_tmv2q4pofj\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Copy\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_tmv2q4pofk\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:paste\",\n \"label\": \"Paste\",\n \"icon\": \"ClipboardPaste\",\n \"shortcut\": \"⌘V\"\n },\n {\n \"id\": \"i_tmv2q4pofl\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:undo\",\n \"label\": \"Undo\",\n \"icon\": \"Undo2\",\n \"shortcut\": \"⌘Z\"\n },\n {\n \"id\": \"i_tmv2q4pofm\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:redo\",\n \"label\": \"Redo\",\n \"icon\": \"Redo2\",\n \"shortcut\": \"⇧⌘Z\"\n },\n {\n \"id\": \"i_tmv2q4pofn\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Find & Replace\",\n \"icon\": \"Search\",\n \"shortcut\": \"⌘F\"\n },\n {\n \"id\": \"i_82154a6b\",\n \"kind\": \"item\",\n \"catalogId\": \"archive\",\n \"label\": \"Archive\",\n \"icon\": \"Archive\",\n \"danger\": true,\n \"ai\": false,\n \"toggle\": false\n }\n ]\n },\n {\n \"id\": \"q_b2f517ee\",\n \"kind\": \"search\",\n \"placeholder\": \"Search this menu…\",\n \"autofocus\": true\n },\n {\n \"id\": \"m_tmv2o1wube\",\n \"kind\": \"submenu\",\n \"label\": \"Intelligence\",\n \"icon\": \"Sparkles\",\n \"children\": [\n {\n \"id\": \"i_tmv2o1wubf\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:chat\",\n \"label\": \"Chat about this\",\n \"icon\": \"MessageSquare\",\n \"ai\": true\n },\n {\n \"id\": \"i_tmv2o1wubi\",\n \"kind\": \"item\",\n \"catalogId\": \"send-to-agent\",\n \"label\": \"Send to agent\",\n \"icon\": \"Send\",\n \"ai\": true\n },\n {\n \"id\": \"i_f9319837\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:chat\",\n \"label\": \"Create Agent for this\",\n \"icon\": \"Webhook\",\n \"ai\": true\n },\n {\n \"id\": \"d_71777db1\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_294ffd3a\",\n \"kind\": \"submenu\",\n \"label\": \"AI Actions\",\n \"icon\": \"Stars\",\n \"children\": [\n {\n \"id\": \"i_ec0a5001\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-improve\",\n \"label\": \"Improve writing\",\n \"icon\": \"Wand2\",\n \"ai\": true\n },\n {\n \"id\": \"i_41dc4c76\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Summarize\",\n \"icon\": \"ListCollapse\",\n \"ai\": true\n },\n {\n \"id\": \"i_65ebe1a4\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-explain\",\n \"label\": \"Explain\",\n \"icon\": \"Lightbulb\",\n \"ai\": true\n },\n {\n \"id\": \"i_29261564\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-translate\",\n \"label\": \"Translate…\",\n \"icon\": \"Languages\",\n \"ai\": true\n },\n {\n \"id\": \"i_ebf13d6b\",\n \"kind\": \"item\",\n \"catalogId\": \"code-block-chart\",\n \"label\": \"Make a chart\",\n \"icon\": \"ChartColumn\",\n \"ai\": true\n }\n ]\n },\n {\n \"id\": \"m_e157dbc8\",\n \"kind\": \"submenu\",\n \"label\": \"Agents\",\n \"icon\": \"Bot\",\n \"children\": []\n },\n {\n \"id\": \"s_c3e45d72\",\n \"kind\": \"submenu\",\n \"label\": \"Surface Intelligence\",\n \"icon\": \"BrainCircuit\",\n \"children\": []\n },\n {\n \"id\": \"d_cf79cdb9\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_6f753e67\",\n \"kind\": \"section\",\n \"label\": \"AI Resources\",\n \"children\": []\n },\n {\n \"id\": \"i_56c420c8\",\n \"kind\": \"item\",\n \"label\": \"Kind Shapes\",\n \"icon\": \"Aperture\"\n },\n {\n \"id\": \"i_82b53d0f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:placement:content-block\",\n \"label\": \"Content blocks\",\n \"icon\": \"Blocks\",\n \"ai\": true\n },\n {\n \"id\": \"i_35f46721\",\n \"kind\": \"item\",\n \"label\": \"Artifacts\",\n \"icon\": \"AreaChart\"\n }\n ]\n },\n {\n \"id\": \"m_32ea2013\",\n \"kind\": \"submenu\",\n \"label\": \"My Intelligence\",\n \"icon\": \"BrainCircuit\",\n \"children\": [\n {\n \"id\": \"i_e6795a3d\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 1\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"i_17e1a01b\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 2\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"i_77e75862\",\n \"kind\": \"item\",\n \"label\": \"My custom agent 3, 4 ...\",\n \"icon\": \"Circle\"\n },\n {\n \"id\": \"m_5838209d\",\n \"kind\": \"submenu\",\n \"label\": \"My custom folder\",\n \"icon\": \"FolderClosed\",\n \"children\": []\n },\n {\n \"id\": \"m_a5717277\",\n \"kind\": \"submenu\",\n \"label\": \"My custom folder\",\n \"icon\": \"FolderClosed\",\n \"children\": []\n },\n {\n \"id\": \"d_dea308cc\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_b6b6e037\",\n \"kind\": \"submenu\",\n \"label\": \"Organizations\",\n \"icon\": \"Building2\",\n \"children\": []\n },\n {\n \"id\": \"s_333c203b\",\n \"kind\": \"submenu\",\n \"label\": \"Shared with me\",\n \"icon\": \"Building2\",\n \"children\": []\n },\n {\n \"id\": \"d_f3f573d1\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_e4f67cb6\",\n \"kind\": \"item\",\n \"label\": \"Customize\",\n \"icon\": \"Settings2\"\n }\n ]\n },\n {\n \"id\": \"m_dde8f0e8\",\n \"kind\": \"submenu\",\n \"label\": \"Content\",\n \"icon\": \"Edit\",\n \"children\": [\n {\n \"id\": \"i_fe613e75\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:save\",\n \"label\": \"Save\",\n \"icon\": \"Save\",\n \"shortcut\": \"⌘S\"\n },\n {\n \"id\": \"i_e09f7461\",\n \"kind\": \"item\",\n \"catalogId\": \"duplicate\",\n \"label\": \"Duplicate\",\n \"icon\": \"CopyPlus\"\n },\n {\n \"id\": \"i_b95bebe0\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Refresh\",\n \"icon\": \"RefreshCcw\"\n },\n {\n \"id\": \"i_tmv2q71icr\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:view-history\",\n \"label\": \"View history\",\n \"icon\": \"History\"\n },\n {\n \"id\": \"m_e55f6e2a\",\n \"kind\": \"submenu\",\n \"label\": \"Compare\",\n \"icon\": \"GitCompareArrows\",\n \"children\": [\n {\n \"id\": \"i_a7e009e7\",\n \"kind\": \"item\",\n \"catalogId\": \"set-compare-base\",\n \"label\": \"Set as compare base\",\n \"icon\": \"Flag\"\n },\n {\n \"id\": \"i_fadfc953\",\n \"kind\": \"item\",\n \"catalogId\": \"compare-with-clipboard\",\n \"label\": \"Compare with clipboard\",\n \"icon\": \"ClipboardList\"\n },\n {\n \"id\": \"i_tmv2q71ics\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:compare\",\n \"label\": \"Open Compare Window\",\n \"icon\": \"GitCompareArrows\"\n }\n ]\n },\n {\n \"id\": \"d_df8a5b92\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_b7486ce8\",\n \"kind\": \"item\",\n \"catalogId\": \"rename\",\n \"label\": \"Rename\",\n \"icon\": \"ClipboardEdit\"\n },\n {\n \"id\": \"i_97bfd2a2\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Cleanup\",\n \"icon\": \"Eraser\"\n },\n {\n \"id\": \"i_eeb51a1e\",\n \"kind\": \"item\",\n \"catalogId\": \"edit\",\n \"label\": \"Outline\",\n \"icon\": \"LayoutList\"\n },\n {\n \"id\": \"i_ed3edf1c\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Insert reference\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"d_3cceca07\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_8978ede1\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Find & Replace\",\n \"icon\": \"Search\",\n \"shortcut\": \"⌘F\"\n },\n {\n \"id\": \"i_0c67e994\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Search with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"d_55ec427a\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a69ba340\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-improve\",\n \"label\": \"Improve writing\",\n \"icon\": \"Wand2\",\n \"ai\": true\n },\n {\n \"id\": \"i_3c09ec12\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Summarize\",\n \"icon\": \"ListCollapse\",\n \"ai\": true\n },\n {\n \"id\": \"i_02a7fbac\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Expand content\",\n \"icon\": \"ListSortAscending\",\n \"ai\": true\n },\n {\n \"id\": \"i_5b3f6d51\",\n \"kind\": \"item\",\n \"catalogId\": \"ai-summarize\",\n \"label\": \"Make a table\",\n \"icon\": \"Table\",\n \"ai\": true\n },\n {\n \"id\": \"d_037eb185\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_042a5ba7\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:delete\",\n \"label\": \"Delete\",\n \"icon\": \"Trash2\",\n \"danger\": true\n }\n ],\n \"note\": \"Disabled when editable text is not available\"\n },\n {\n \"id\": \"m_ac170388\",\n \"kind\": \"submenu\",\n \"label\": \"Copy\",\n \"icon\": \"CopyCheck\",\n \"children\": [\n {\n \"id\": \"m_24d2c346\",\n \"kind\": \"submenu\",\n \"label\": \"Text\",\n \"icon\": \"LetterText\",\n \"children\": [\n {\n \"id\": \"i_1f2dd157\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Raw Text\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_4958860f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Strip markdown\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_b8fa8de1\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"For Google Docs & Gmail\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_68b385a6\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"For Microsoft Office\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_838adcaa\",\n \"kind\": \"item\",\n \"catalogId\": \"copy-html-page\",\n \"label\": \"As HTML page\",\n \"icon\": \"FileCode\"\n }\n ]\n },\n {\n \"id\": \"m_76fad1b2\",\n \"kind\": \"submenu\",\n \"label\": \"For AI\",\n \"icon\": \"Brain\",\n \"children\": [\n {\n \"id\": \"i_6f508d32\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"Structured For AI\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_a4ce9583\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"With Context\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n },\n {\n \"id\": \"i_834c201b\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy\",\n \"label\": \"With Prompt\",\n \"icon\": \"Copy\",\n \"shortcut\": \"⌘C\"\n }\n ]\n },\n {\n \"id\": \"m_8efb66c6\",\n \"kind\": \"submenu\",\n \"label\": \"Data\",\n \"icon\": \"Database\",\n \"children\": [\n {\n \"id\": \"i_ba8dfd96\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:json\",\n \"label\": \"Copy as JSON\",\n \"icon\": \"Braces\"\n }\n ]\n },\n {\n \"id\": \"i_c1ceed9d\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Copy reference\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"i_84d0d88a\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:copy-as\",\n \"label\": \"Custom edit\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"i_46a4a651\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:select-all\",\n \"label\": \"Select All\",\n \"icon\": \"TextSelect\",\n \"shortcut\": \"⌘A\"\n }\n ]\n },\n {\n \"id\": \"d_3e3ab4cd\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"p_d160894b\",\n \"kind\": \"slot\",\n \"shape\": \"feature\",\n \"fills\": \"page-rows\",\n \"label\": \"THIS FEATURE NAME\",\n \"featureItems\": 4\n },\n {\n \"id\": \"s_1abf26db\",\n \"kind\": \"submenu\",\n \"label\": \"Feature orphans\",\n \"icon\": \"Annoyed\",\n \"children\": []\n },\n {\n \"id\": \"d_27f4678d\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_d02ffc55\",\n \"kind\": \"submenu\",\n \"label\": \"Export & Download\",\n \"icon\": \"Download\",\n \"children\": [\n {\n \"id\": \"i_5c9c1773\",\n \"kind\": \"item\",\n \"catalogId\": \"notes:export-md\",\n \"label\": \"Download Markdown\",\n \"icon\": \"FileDown\"\n },\n {\n \"id\": \"i_d0f17b6f\",\n \"kind\": \"item\",\n \"catalogId\": \"download-docx\",\n \"label\": \"Download Word\",\n \"icon\": \"FileType\"\n },\n {\n \"id\": \"i_a2929b71\",\n \"kind\": \"item\",\n \"catalogId\": \"download-html\",\n \"label\": \"Download HTML\",\n \"icon\": \"FileCode2\"\n },\n {\n \"id\": \"i_9036b52e\",\n \"kind\": \"item\",\n \"catalogId\": \"download-pdf\",\n \"label\": \"Download PDF\",\n \"icon\": \"FileText\"\n },\n {\n \"id\": \"i_66ee72ce\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Download with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"i_396c657e\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:export\",\n \"label\": \"Custom Export\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"i_738a541f\",\n \"kind\": \"item\",\n \"catalogId\": \"print\",\n \"label\": \"Print\",\n \"icon\": \"Printer\",\n \"shortcut\": \"⌘P\"\n }\n ]\n },\n {\n \"id\": \"m_6ead5137\",\n \"kind\": \"submenu\",\n \"label\": \"Share & Publish\",\n \"icon\": \"Share2\",\n \"children\": [\n {\n \"id\": \"i_a618b8d8\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:share\",\n \"label\": \"Share…\",\n \"icon\": \"Share2\"\n },\n {\n \"id\": \"i_aca15807\",\n \"kind\": \"item\",\n \"catalogId\": \"share-link\",\n \"label\": \"Copy share link\",\n \"icon\": \"Link\"\n },\n {\n \"id\": \"i_33be80fa\",\n \"kind\": \"item\",\n \"catalogId\": \"share-webpage\",\n \"label\": \"Publish as web page\",\n \"icon\": \"Globe\"\n },\n {\n \"id\": \"i_6da43b13\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:insert-reference\",\n \"label\": \"Insert / Copy reference…\",\n \"icon\": \"AtSign\"\n },\n {\n \"id\": \"i_51e8098a\",\n \"kind\": \"item\",\n \"catalogId\": \"print\",\n \"label\": \"Print\",\n \"icon\": \"Printer\",\n \"shortcut\": \"⌘P\"\n }\n ]\n },\n {\n \"id\": \"m_ae1e5be1\",\n \"kind\": \"submenu\",\n \"label\": \"Send & Convert\",\n \"icon\": \"ArrowBigRight\",\n \"children\": [\n {\n \"id\": \"i_720df996\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Add to Active Context\",\n \"icon\": \"Pin\"\n },\n {\n \"id\": \"i_4b63cb20\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Add to knowledge base\",\n \"icon\": \"DatabaseZap\"\n },\n {\n \"id\": \"i_fdaa2e24\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Open in Canvas\",\n \"icon\": \"LayoutPanelLeft\"\n },\n {\n \"id\": \"d_4182de21\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a207c217\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Notes\",\n \"icon\": \"NotebookPen\"\n },\n {\n \"id\": \"i_18eb28c6\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Document\",\n \"icon\": \"NotepadTextDashed\"\n },\n {\n \"id\": \"i_5f78991d\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"File\",\n \"icon\": \"FileCog\"\n },\n {\n \"id\": \"i_bed92d83\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Task\",\n \"icon\": \"ListTodo\"\n },\n {\n \"id\": \"i_c86ed71c\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Project\",\n \"icon\": \"AlignVerticalJustifyCenter\"\n },\n {\n \"id\": \"i_dbdcad1a\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Custom data\",\n \"icon\": \"DatabaseCheck\"\n },\n {\n \"id\": \"d_3aacc05c\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_42e3d208\",\n \"kind\": \"item\",\n \"catalogId\": \"email-to-me\",\n \"label\": \"Email\",\n \"icon\": \"Mail\"\n },\n {\n \"id\": \"i_07b55ba5\",\n \"kind\": \"item\",\n \"catalogId\": \"email-to-me\",\n \"label\": \"Send via DM\",\n \"icon\": \"MessageCircle\"\n },\n {\n \"id\": \"i_75ef8013\",\n \"kind\": \"item\",\n \"catalogId\": \"audit:114\",\n \"label\": \"Add to Rulebook\",\n \"icon\": \"CircleDashed\",\n \"note\": \"From the audit (useful, partial): Add to Rulebook; Set Context Value; Save as Message Template; Save to my Shapes (when the content holds a kind block); Save as contact (when it looks like a contact) — today: rich-document Save/capture rows (matrx-frontend/features/rich-document/actions/handlers/capture.ts:75,113,142,282; handlers/contact.ts:28)\"\n },\n {\n \"id\": \"i_9531a415\",\n \"kind\": \"item\",\n \"catalogId\": \"notes:convert-artifacts\",\n \"label\": \"Convert to artifacts\",\n \"icon\": \"Shapes\"\n },\n {\n \"id\": \"i_eca3b31b\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:find\",\n \"label\": \"Convert with AI\",\n \"icon\": \"Wand\",\n \"shortcut\": \"\",\n \"ai\": true\n },\n {\n \"id\": \"i_73a06d6f\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"Custom convert\",\n \"icon\": \"AppWindow\"\n },\n {\n \"id\": \"d_9a18d3e3\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"i_a39f4b6a\",\n \"kind\": \"item\",\n \"catalogId\": \"send-google-doc\",\n \"label\": \"To Google Docs or Drive\",\n \"icon\": \"FileUp\"\n },\n {\n \"id\": \"i_16ae6cf2\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:convert\",\n \"label\": \"To any connection...\",\n \"icon\": \"Combine\"\n }\n ]\n },\n {\n \"id\": \"m_2406eb8d\",\n \"kind\": \"submenu\",\n \"label\": \"Listen & Speak\",\n \"icon\": \"AudioLines\",\n \"children\": [\n {\n \"id\": \"i_f65633d0\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:listen\",\n \"label\": \"Dictate\",\n \"icon\": \"Mic\"\n },\n {\n \"id\": \"i_a73e3556\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:speak\",\n \"label\": \"Read aloud\",\n \"icon\": \"Volume2\"\n },\n {\n \"id\": \"i_733fc812\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:speak\",\n \"label\": \"Condense & Read\",\n \"icon\": \"Volume1\"\n },\n {\n \"id\": \"i_4466b514\",\n \"kind\": \"item\",\n \"catalogId\": \"tts-voice-settings\",\n \"label\": \"Voice settings\",\n \"icon\": \"AudioLines\"\n }\n ]\n },\n {\n \"id\": \"m_d12b81de\",\n \"kind\": \"submenu\",\n \"label\": \"Help\",\n \"icon\": \"HelpCircle\",\n \"children\": [\n {\n \"id\": \"i_ab248359\",\n \"kind\": \"item\",\n \"label\": \"Help me with this\",\n \"icon\": \"MessageCircleQuestion\"\n },\n {\n \"id\": \"i_fbdcca01\",\n \"kind\": \"item\",\n \"label\": \"I found a bug\",\n \"icon\": \"Bug\"\n },\n {\n \"id\": \"i_9c46db53\",\n \"kind\": \"item\",\n \"label\": \"Request a feature\",\n \"icon\": \"SquareStar\"\n },\n {\n \"id\": \"i_12784f2c\",\n \"kind\": \"item\",\n \"label\": \"Info\",\n \"icon\": \"Info\",\n \"hint\": \"About this item\"\n }\n ]\n },\n {\n \"id\": \"d_4b860471\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"m_tmv2q71ico\",\n \"kind\": \"submenu\",\n \"label\": \"Organize\",\n \"icon\": \"Tags\",\n \"children\": [\n {\n \"id\": \"i_780d8216\",\n \"kind\": \"item\",\n \"catalogId\": \"notes-and-comments\",\n \"label\": \"Notes & comments\",\n \"icon\": \"StickyNote\"\n },\n {\n \"id\": \"i_e9ad3dd6\",\n \"kind\": \"item\",\n \"catalogId\": \"move\",\n \"label\": \"Move to folder…\",\n \"icon\": \"FolderInput\"\n },\n {\n \"id\": \"i_d8e4c6b9\",\n \"kind\": \"item\",\n \"catalogId\": \"tags\",\n \"label\": \"Tags…\",\n \"icon\": \"Tags\"\n },\n {\n \"id\": \"i_tmv2q71icp\",\n \"kind\": \"item\",\n \"catalogId\": \"cm:attach\",\n \"label\": \"Attach to…\",\n \"icon\": \"Paperclip\"\n },\n {\n \"id\": \"i_tmv2q71icq\",\n \"kind\": \"item\",\n \"catalogId\": \"pin-message\",\n \"label\": \"Pin\",\n \"icon\": \"Pin\"\n }\n ]\n },\n {\n \"id\": \"d_b6212875\",\n \"kind\": \"divider\"\n },\n {\n \"id\": \"s_48f18ecc\",\n \"kind\": \"section\",\n \"label\": \"ADMIN ACTIONS\",\n \"children\": [\n {\n \"id\": \"m_74072d95\",\n \"kind\": \"submenu\",\n \"label\": \"Creator Options\",\n \"icon\": \"Crown\",\n \"children\": [],\n \"note\": \"Disabled when the user is NOT the creator of the intelligence or when there is no intelligence in play\"\n }\n ]\n },\n {\n \"id\": \"m_32f84a2e\",\n \"kind\": \"submenu\",\n \"label\": \"Org Admin\",\n \"icon\": \"ShieldUser\",\n \"children\": [],\n \"note\": \"Disabled when the user is not an admin for their ACTIVE Org\"\n },\n {\n \"id\": \"s_888d81ec\",\n \"kind\": \"submenu\",\n \"label\": \"Super Admin\",\n \"icon\": \"ShieldAlert\",\n \"children\": [],\n \"note\": \"Must be HIDDEN for all non-admins\"\n },\n {\n \"id\": \"m_54111c0a\",\n \"kind\": \"submenu\",\n \"label\": \"Global orphans\",\n \"icon\": \"Annoyed\",\n \"children\": []\n }\n ],\n \"notes\": \"\"\n} as MenuDesign);\n","// src/designed/rows.ts — @ai-matrx/context-menu: THE ADAPTER from today's engine to ModelRows.\n//\n// The ONLY file of the designed menu that knows the engine's MenuModel. Every row keeps the\n// engine's own handler, disabled state and label — nothing is re-implemented here. A later\n// trigger that builds rows another way replaces this file and nothing else.\n\nimport type { MenuModel, MenuNode as EngineNode, MenuSection } from \"../engine/model/menu-model\";\nimport type { ModelRow, RowIconComponent, RowOrigin } from \"./types\";\n\n/** The universal verbs say why they are off (the engine's R1 sentences). */\nconst VERB_REASONS: Record<string, string> = {\n copy: \"Select text, or right-click content, to copy it.\",\n cut: \"Cut works on selected text in an editable field.\",\n paste: \"Paste works in an editable field.\",\n undo: \"Nothing to undo here.\",\n redo: \"Nothing to redo here.\",\n find: \"Find works where there is text.\",\n};\n\n/** Rows that INSERT content into the surface: off on a read-only source. */\nconst INSERTS_CONTENT = new Set([\"placement:content-block\"]);\n\nexport interface EngineRowOptions {\n /** Rich-document action ids this menu must not draw (surface exclusions, already-here). */\n excludedRichIds?: readonly string[] | undefined;\n /** The menu edits its surface (`isEditable`). */\n editable?: boolean | undefined;\n}\n\nfunction originOf(key: string, section: MenuSection): RowOrigin {\n if (section.group === \"surface\") return \"page\";\n if (section.group === \"surface-info\") return \"surface\";\n if (key.startsWith(\"rich\")) return \"rich\";\n if (/^(placement|agent|agents|entry|cat):/.test(key)) return \"agent\";\n return \"engine\";\n}\n\nfunction keyOf(node: EngineNode, section: MenuSection): string {\n const bare = node.id.startsWith(\"x:\") ? node.id.slice(2) : node.id;\n if (section.group === \"surface\") return `${section.id}/${bare}`;\n if (section.group === \"surface-info\") return `surface/${bare}`;\n return node.id;\n}\n\nfunction convert(node: EngineNode, section: MenuSection, opts: EngineRowOptions, startsGroup: boolean): ModelRow | null {\n if (node.kind === \"separator\" || node.kind === \"label\") return null;\n const key = keyOf(node, section);\n const origin = originOf(key, section);\n const page = origin === \"page\" || origin === \"surface\";\n const base = {\n key,\n label: node.label,\n origin,\n page,\n section: section.id,\n ...(section.label ? { sectionLabel: section.label } : {}),\n ...(node.icon ? { icon: node.icon as unknown as RowIconComponent } : {}),\n ...(\"iconClassName\" in node && node.iconClassName ? { iconClassName: node.iconClassName } : {}),\n ...(\"iconStyle\" in node && node.iconStyle ? { iconStyle: node.iconStyle } : {}),\n ...(\"hint\" in node && node.hint ? { hint: node.hint } : {}),\n ...(\"description\" in node && node.description ? { description: node.description } : {}),\n ...(startsGroup ? { startsGroup: true } : {}),\n };\n if (node.kind === \"submenu\") {\n const children = convertList(node.children, section, opts);\n const inserts = INSERTS_CONTENT.has(node.id) && opts.editable === false;\n const empty = !node.loading && children.length === 0;\n return {\n ...base,\n kind: \"submenu\",\n disabled: Boolean(node.disabled) || inserts || empty,\n ...(inserts\n ? { reason: \"Inserts content — this place is read-only\" }\n : empty\n ? { reason: node.emptyLabel ?? \"Nothing here yet\" }\n : {}),\n ...(node.loading ? { loading: true } : {}),\n children,\n };\n }\n const disabled = \"disabled\" in node ? Boolean(node.disabled) : false;\n const reason = disabled ? (VERB_REASONS[node.id] ?? (\"description\" in node ? node.description : undefined)) : undefined;\n if (node.kind === \"link\") {\n return { ...base, kind: \"link\", disabled, href: node.href, ...(node.target ? { target: node.target } : {}), ...(reason ? { reason } : {}) };\n }\n if (node.kind === \"checkbox\") {\n return { ...base, kind: \"checkbox\", disabled, checked: node.checked, run: () => node.onCheckedChange(!node.checked), ...(reason ? { reason } : {}) };\n }\n return {\n ...base,\n kind: \"item\",\n disabled,\n ...(reason ? { reason } : {}),\n ...(node.destructive ? { destructive: true } : {}),\n ...(node.keepsMenuOpen ? { keepsMenuOpen: true } : {}),\n run: () => node.onSelect(),\n };\n}\n\nfunction convertList(nodes: readonly EngineNode[], section: MenuSection, opts: EngineRowOptions): ModelRow[] {\n const excluded = new Set(opts.excludedRichIds ?? []);\n const out: ModelRow[] = [];\n let startsGroup = false;\n for (const node of nodes) {\n if (node.kind === \"separator\") {\n startsGroup = out.length > 0;\n continue;\n }\n if (node.id.startsWith(\"rich:\") && excluded.has(node.id.slice(5))) continue;\n const row = convert(node, section, opts, startsGroup);\n if (!row) continue;\n startsGroup = false;\n out.push(row);\n }\n return out;\n}\n\n/** Every row the open menu can run, top level by section, submenus keeping their children. */\nexport function rowsFromEngineModel(model: MenuModel, opts: EngineRowOptions = {}): ModelRow[] {\n const out: ModelRow[] = [];\n for (const section of model.sections) out.push(...convertList(section.nodes, section, opts));\n return out;\n}\n\n/** The surface's display label, as the engine's surface submenu names it. */\nexport function surfaceLabelOf(model: MenuModel): string | null {\n const node = model.roles.surfaceInfo.nodes[0];\n return node && \"label\" in node && node.label ? node.label : null;\n}\n","\"use client\";\n\n// features/context-menu-v3/components/ShortcutKeyRunner.tsx\n//\n// Runs ONE agent shortcut whose advertised key combo was pressed — through the\n// SAME engine and the same launch handler the menu item uses\n// (`useContextMenuActions().handleShortcutExecute`), so a combo and a click\n// launch identically (scope, selection, widget handle, display mode). Renders\n// nothing; the shell mounts it for one press and drops it when done.\n\nimport { useEffect, useRef } from \"react\";\nimport { toast } from \"../utils/notify\";\nimport { useContextMenuActions } from \"../hooks/useContextMenuActions\";\nimport type { AgentMenuCategoryGroup, AgentMenuEntry } from \"../hooks/useUnifiedAgentContextMenu\";\nimport type { MenuContentProps } from \"../types\";\n\ntype ShortcutEntry = Extract<AgentMenuEntry, { entryType: \"agent_shortcut\" }>;\n\nfunction findShortcut(groups: AgentMenuCategoryGroup[], id: string): ShortcutEntry | null {\n for (const group of groups) {\n for (const item of group.items) {\n if (item.entryType === \"agent_shortcut\" && item.id === id) return item;\n }\n const nested = findShortcut(group.children, id);\n if (nested) return nested;\n }\n return null;\n}\n\nexport interface ShortcutKeyRunnerProps extends Omit<MenuContentProps, \"variant\"> {\n shortcutId: string;\n shortcutLabel: string;\n onDone(): void;\n}\n\nexport default function ShortcutKeyRunner(props: ShortcutKeyRunnerProps): null {\n const { shortcutId, shortcutLabel, onDone, ...menuProps } = props;\n const m = useContextMenuActions(menuProps);\n const ran = useRef(false);\n\n useEffect(() => {\n if (ran.current || m.loading) return;\n ran.current = true;\n const entry = findShortcut(m.categoryGroups, shortcutId);\n if (!entry) {\n toast({\n title: m.librariesError\n ? `Couldn't load ${shortcutLabel}`\n : `${shortcutLabel} isn't available here`,\n ...(m.librariesError ? { variant: \"destructive\" as const } : {}),\n });\n onDone();\n return;\n }\n void m.handleShortcutExecute(entry).finally(onDone);\n });\n\n return null;\n}\n"]}
|