@agent-native/core 0.40.2 → 0.41.1
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/README.md +11 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +57 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +16 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +11 -0
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -0
- package/dist/cli/pr-visual-recap-workflow.js +11 -0
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -0
- package/dist/cli/recap.d.ts +52 -0
- package/dist/cli/recap.d.ts.map +1 -0
- package/dist/cli/recap.js +581 -0
- package/dist/cli/recap.js.map +1 -0
- package/dist/cli/skills.d.ts +17 -4
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +60 -16
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/templates-meta.js +1 -1
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +19 -4
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/blocks/index.d.ts +3 -0
- package/dist/client/blocks/index.d.ts.map +1 -1
- package/dist/client/blocks/index.js +3 -0
- package/dist/client/blocks/index.js.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +6 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +134 -0
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -0
- package/dist/client/blocks/library/HighlightedCode.d.ts +21 -1
- package/dist/client/blocks/library/HighlightedCode.d.ts.map +1 -1
- package/dist/client/blocks/library/HighlightedCode.js +86 -4
- package/dist/client/blocks/library/HighlightedCode.js.map +1 -1
- package/dist/client/blocks/library/annotated-code.config.d.ts +58 -0
- package/dist/client/blocks/library/annotated-code.config.d.ts.map +1 -0
- package/dist/client/blocks/library/annotated-code.config.js +53 -0
- package/dist/client/blocks/library/annotated-code.config.js.map +1 -0
- package/dist/client/blocks/library/checklist.js +2 -2
- package/dist/client/blocks/library/checklist.js.map +1 -1
- package/dist/client/blocks/library/code-highlight.d.ts +16 -0
- package/dist/client/blocks/library/code-highlight.d.ts.map +1 -0
- package/dist/client/blocks/library/code-highlight.js +160 -0
- package/dist/client/blocks/library/code-highlight.js.map +1 -0
- package/dist/client/blocks/library/code-tabs.config.d.ts +6 -0
- package/dist/client/blocks/library/code-tabs.config.d.ts.map +1 -1
- package/dist/client/blocks/library/code-tabs.config.js +1 -0
- package/dist/client/blocks/library/code-tabs.config.js.map +1 -1
- package/dist/client/blocks/library/code-tabs.d.ts.map +1 -1
- package/dist/client/blocks/library/code-tabs.js +35 -5
- package/dist/client/blocks/library/code-tabs.js.map +1 -1
- package/dist/client/blocks/library/code.config.d.ts +43 -0
- package/dist/client/blocks/library/code.config.d.ts.map +1 -0
- package/dist/client/blocks/library/code.config.js +34 -0
- package/dist/client/blocks/library/code.config.js.map +1 -0
- package/dist/client/blocks/library/code.d.ts +3 -0
- package/dist/client/blocks/library/code.d.ts.map +1 -0
- package/dist/client/blocks/library/code.js +95 -0
- package/dist/client/blocks/library/code.js.map +1 -0
- package/dist/client/blocks/library/dev-doc-ui.d.ts +2 -1
- package/dist/client/blocks/library/dev-doc-ui.d.ts.map +1 -1
- package/dist/client/blocks/library/dev-doc-ui.js +2 -1
- package/dist/client/blocks/library/dev-doc-ui.js.map +1 -1
- package/dist/client/blocks/library/server-specs.d.ts.map +1 -1
- package/dist/client/blocks/library/server-specs.js +21 -0
- package/dist/client/blocks/library/server-specs.js.map +1 -1
- package/dist/client/blocks/library/specs.d.ts +1 -1
- package/dist/client/blocks/library/specs.d.ts.map +1 -1
- package/dist/client/blocks/library/specs.js +30 -2
- package/dist/client/blocks/library/specs.js.map +1 -1
- package/dist/client/blocks/server.d.ts +1 -0
- package/dist/client/blocks/server.d.ts.map +1 -1
- package/dist/client/blocks/server.js +1 -0
- package/dist/client/blocks/server.js.map +1 -1
- package/dist/client/blocks/types.d.ts +1 -1
- package/dist/client/blocks/types.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +28 -13
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +31 -9
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts +49 -0
- package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts.map +1 -0
- package/dist/client/rich-markdown-editor/CodeBlockNode.js +126 -0
- package/dist/client/rich-markdown-editor/CodeBlockNode.js.map +1 -0
- package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js +26 -3
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
- package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +1 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/extensions.js +8 -8
- package/dist/client/rich-markdown-editor/extensions.js.map +1 -1
- package/dist/client/rich-markdown-editor/index.d.ts +1 -0
- package/dist/client/rich-markdown-editor/index.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/index.js +1 -0
- package/dist/client/rich-markdown-editor/index.js.map +1 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.js +1 -0
- package/dist/client/rich-markdown-editor/registrySlashCommands.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +63 -2
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/routes.d.ts.map +1 -1
- package/dist/extensions/routes.js +24 -3
- package/dist/extensions/routes.js.map +1 -1
- package/dist/extensions/schema.d.ts +43 -2
- package/dist/extensions/schema.d.ts.map +1 -1
- package/dist/extensions/schema.js +12 -0
- package/dist/extensions/schema.js.map +1 -1
- package/dist/extensions/store.d.ts +20 -0
- package/dist/extensions/store.d.ts.map +1 -1
- package/dist/extensions/store.js +82 -3
- package/dist/extensions/store.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +13 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +11 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/recap-image-route.d.ts +8 -0
- package/dist/server/recap-image-route.d.ts.map +1 -0
- package/dist/server/recap-image-route.js +200 -0
- package/dist/server/recap-image-route.js.map +1 -0
- package/dist/server/recap-image-store.d.ts +41 -0
- package/dist/server/recap-image-store.d.ts.map +1 -0
- package/dist/server/recap-image-store.js +138 -0
- package/dist/server/recap-image-store.js.map +1 -0
- package/dist/styles/rich-markdown-editor.css +66 -17
- package/dist/templates/default/pnpm-workspace.yaml +7 -0
- package/dist/templates/workspace-root/package.json +0 -5
- package/dist/templates/workspace-root/pnpm-workspace.yaml +14 -0
- package/docs/content/cloneable-saas.md +10 -0
- package/docs/content/external-agents.md +4 -7
- package/docs/content/faq.md +10 -0
- package/docs/content/getting-started.md +11 -0
- package/docs/content/pr-visual-recap.md +103 -0
- package/docs/content/skills-guide.md +1 -3
- package/docs/content/template-assets.md +1 -4
- package/docs/content/template-design.md +0 -57
- package/docs/content/template-plan.md +22 -18
- package/docs/content/visual-plans.md +10 -7
- package/docs/content/what-is-agent-native.md +2 -0
- package/package.json +5 -1
- package/src/templates/default/pnpm-workspace.yaml +7 -0
- package/src/templates/workspace-root/package.json +0 -5
- package/src/templates/workspace-root/pnpm-workspace.yaml +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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2E;IAC3E,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,qBAAqB;IACrB,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;IAChC,CAAC;IAED,2EAA2E;IAC3E,6EAA6E;IAC7E,0EAA0E;IAC1E,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvD,4EAA4E;QAC5E,kEAAkE;QAClE,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,IAAI,CACP,kBAAkB,CAAC,SAAS,CAAC;gBAC3B,QAAQ,EAAE,EAAE,SAAS,EAAE;gBACvB,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;aACnD,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Extension, Node, Mark } from \"@tiptap/core\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport type { StarterKitOptions } from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport TaskList from \"@tiptap/extension-task-list\";\nimport TaskItem from \"@tiptap/extension-task-item\";\nimport { Table } from \"@tiptap/extension-table\";\nimport { TableRow } from \"@tiptap/extension-table-row\";\nimport { TableCell } from \"@tiptap/extension-table-cell\";\nimport { TableHeader } from \"@tiptap/extension-table-header\";\nimport { Markdown } from \"tiptap-markdown\";\nimport { CodeBlockLowlight } from \"@tiptap/extension-code-block-lowlight\";\nimport { createLowlight } from \"lowlight\";\nimport bash from \"highlight.js/lib/languages/bash\";\nimport css from \"highlight.js/lib/languages/css\";\nimport javascript from \"highlight.js/lib/languages/javascript\";\nimport json from \"highlight.js/lib/languages/json\";\nimport markdown from \"highlight.js/lib/languages/markdown\";\nimport python from \"highlight.js/lib/languages/python\";\nimport sql from \"highlight.js/lib/languages/sql\";\nimport typescript from \"highlight.js/lib/languages/typescript\";\nimport xml from \"highlight.js/lib/languages/xml\";\nimport yaml from \"highlight.js/lib/languages/yaml\";\nimport Collaboration from \"@tiptap/extension-collaboration\";\nimport CollaborationCaret from \"@tiptap/extension-collaboration-caret\";\n\n/**\n * Shared lowlight instance for the editor's syntax-highlighted code blocks. A\n * curated grammar set (aliases like ts/tsx, js/jsx, html, sh, py, yml, md come\n * for free from each grammar) keeps the editor bundle lean while matching the\n * languages the read-side Shiki surfaces (`code-tabs`) support. highlight.js is\n * synchronous, which is what a live ProseMirror editor needs — Shiki is async\n * and only used for read-only render paths.\n */\nconst codeLowlight = createLowlight({\n bash,\n css,\n javascript,\n json,\n markdown,\n python,\n sql,\n typescript,\n xml,\n yaml,\n});\nimport type { Doc as YDoc } from \"yjs\";\nimport type { Awareness } from \"y-protocols/awareness\";\nimport { createImageExtension, type ImageUploadFn } from \"./ImageExtension.js\";\n\n/**\n * Markdown dialect the editor parses/serializes.\n *\n * - `gfm` — GitHub-Flavored Markdown. No raw HTML passthrough. The byte-stable\n * serialization used by Plans (see RichMarkdownEditor.roundtrip.spec.ts).\n * - `nfm` — the Notion-Flavored Markdown superset used by the Content editor,\n * which opts into inline HTML so Notion-specific blocks round-trip.\n */\nexport type RichMarkdownDialect = \"gfm\" | \"nfm\";\n\n/**\n * Editor preset. Schema-neutral today (both presets share the base schema),\n * but threaded through so an app can branch schema/behavior per preset without\n * a new factory. The collab/markdown wiring is preset-independent.\n */\nexport type RichMarkdownEditorPreset = \"plan\" | \"content\";\n\n/** User info used to label this client's collaborative cursor. */\nexport interface RichMarkdownCollabUser {\n name: string;\n color: string;\n email?: string;\n}\n\n/** Optional collaborative-editing inputs for the shared editor. */\nexport interface SharedEditorCollab {\n /**\n * Yjs document for collaborative editing. When present the editor binds the\n * shared {@link Collaboration} (+ {@link CollaborationCaret} when awareness\n * is set) extensions and StarterKit's built-in undo/redo is disabled (Yjs\n * owns history). When absent the editor is a controlled `value`/`onChange`\n * editor.\n */\n ydoc?: YDoc | null;\n /** Shared awareness instance for live multi-user cursors. */\n awareness?: Awareness | null;\n /** Current user info for the collaborative cursor label. */\n user?: RichMarkdownCollabUser | null;\n}\n\n/** Toggle the optional base extensions on/off per app. All default to `true`. */\nexport interface SharedEditorFeatures {\n /** GFM pipe tables (Table + TableRow + TableHeader + TableCell). */\n tables?: boolean;\n /** Task / checklist lists (TaskList + TaskItem). */\n tasks?: boolean;\n /** Inline links (the `Link` mark). When off, links fall back to plain text. */\n link?: boolean;\n /** Fenced code blocks. Disabling lets an app inject its own code-block node. */\n codeBlock?: boolean;\n /**\n * The built-in {@link Placeholder} extension. Default `true`. Apps that need a\n * bespoke placeholder resolver (per-node-type labels, ancestor-aware text)\n * disable this and supply their own Placeholder via `extraExtensions`.\n */\n placeholder?: boolean;\n /**\n * The built-in dialect-keyed {@link Markdown} serializer. Default `true`.\n * Apps with a custom serializer (e.g. Content's NFM converter, which does NOT\n * round-trip through tiptap-markdown's storage) disable this and own the\n * serialize/parse pipeline themselves. The Markdown extension is still added\n * so paste/clipboard transforms work — disable it only when supplying your own\n * Markdown configuration via the {@link CreateSharedEditorExtensionsOptions.markdown}\n * option instead.\n */\n markdown?: boolean;\n /**\n * The shared block-level image node (`@tiptap/extension-image`). Default\n * `false` so existing embedders are unchanged. When `true`, images\n * serialize to GFM `` (source-syncable) and — when an\n * {@link CreateSharedEditorExtensionsOptions.onImageUpload} function is\n * supplied — paste / drop of local image files uploads through it. Content\n * leaves this off and injects its own richer image node via\n * `extraExtensions`, so the two never collide.\n */\n image?: boolean;\n}\n\nexport interface CreateSharedEditorExtensionsOptions {\n /** Markdown dialect; selects the keyed {@link Markdown} config. */\n dialect?: RichMarkdownDialect;\n /** Preset hook (schema-neutral today). */\n preset?: RichMarkdownEditorPreset;\n /** Empty-block placeholder text (headings get their own labels). */\n placeholder?: string;\n /** Toggle individual base extensions. */\n features?: SharedEditorFeatures;\n /**\n * Extra StarterKit options merged over the shared defaults. Lets an app turn\n * off StarterKit nodes it replaces (Content swaps in its own paragraph /\n * blockquote / code block) or pass a custom dropcursor, while still sharing\n * the rest of the StarterKit base + the collab undo/redo gating. The shared\n * defaults (`heading` levels 1-4, `link: false`, the default dropcursor, and\n * `undoRedo: false` in collab mode) are applied first and can be overridden\n * key-by-key here.\n */\n starterKit?: Partial<StarterKitOptions>;\n /**\n * Custom {@link Markdown} configuration. Replaces the dialect-keyed config from\n * {@link MARKDOWN_DIALECT_CONFIG} when provided. Only used when\n * `features.markdown !== false`; apps that own the whole markdown pipeline (no\n * tiptap-markdown serialization at all) should set `features.markdown: false`\n * and add their own configured Markdown extension via `extraExtensions`.\n */\n markdown?: Parameters<typeof Markdown.configure>[0];\n /**\n * App-specific extensions (Notion nodes, media, drag handles, comment\n * anchors, etc.) appended LAST so they bind over the shared base schema and\n * the optional Collaboration extensions still mount after them.\n */\n extraExtensions?: Array<Extension | Node | Mark>;\n /** Optional collaborative-editing wiring. */\n collab?: SharedEditorCollab | null;\n /**\n * Injectable image uploader for the shared image block. Only used when\n * `features.image` is on. Turns a picked / pasted / dropped image File into a\n * hosted `{ src, alt? }`. Plans pass `uploadEditorImage` (the framework\n * `upload-image` action). When omitted, the image block still renders and\n * round-trips `` markdown but cannot ingest local files.\n */\n onImageUpload?: ImageUploadFn | null;\n}\n\n/**\n * tiptap-markdown configuration, keyed by dialect. This is the single source of\n * truth for how each dialect parses/serializes markdown so the editor component\n * and the round-trip fidelity test can never drift apart.\n *\n * tiptap-markdown re-serializes the whole document on every edit, so the goal\n * for GFM is `serialize(parse(markdown)) === markdown` for the markdown plans\n * actually contain. We deliberately keep tiptap-markdown's own defaults\n * (`bulletListMarker: \"-\"`, `tightLists: true`, `linkify: false`,\n * `breaks: false`) because those produce the most byte-stable GFM. See\n * RichMarkdownEditor.roundtrip.spec.ts for the pinned corpus.\n *\n * NFM (Content) opts into inline HTML passthrough (`html: true`) so\n * Notion-specific blocks survive a markdown round-trip; the rest mirrors the\n * Content editor's existing `Markdown.configure` call.\n */\nexport const MARKDOWN_DIALECT_CONFIG: Record<\n RichMarkdownDialect,\n Parameters<typeof Markdown.configure>[0]\n> = {\n gfm: {\n // GFM plans are the common case and must never gain raw HTML as a second\n // representation.\n html: false,\n // Keep tiptap-markdown's defaults that minimise first-edit normalisation\n // churn (see roundtrip spec). Listed explicitly so the contract is\n // self-documenting rather than relying on the package defaults.\n bulletListMarker: \"-\",\n tightLists: true,\n linkify: false,\n breaks: false,\n transformPastedText: true,\n transformCopiedText: true,\n },\n nfm: {\n // NFM is a superset that allows inline HTML so Notion blocks round-trip.\n html: true,\n transformPastedText: true,\n transformCopiedText: true,\n },\n};\n\nconst DEFAULT_FEATURES: Required<SharedEditorFeatures> = {\n tables: true,\n tasks: true,\n link: true,\n codeBlock: true,\n placeholder: true,\n markdown: true,\n // Off by default: only Plans opt in today. Content injects its own richer\n // image node via `extraExtensions` and must not get a second `image` node.\n image: false,\n};\n\n/**\n * The ONE editor extension factory shared by every embedder (Plans today,\n * Content next). It assembles the base Tiptap schema (StarterKit + Placeholder\n * + Link + tasks + tables + code block), the dialect-keyed {@link Markdown}\n * serializer, the optional Collaboration stack, and finally any app-specific\n * `extraExtensions`.\n *\n * Ordering matters:\n * 1. Base schema (StarterKit first so its nodes/marks register; `starterKit`\n * overrides let an app disable replaced nodes / swap the dropcursor).\n * 2. dialect-keyed Markdown serializer (suppressible via `features.markdown`\n * for apps that own the whole serialize/parse pipeline, e.g. Content's NFM).\n * 3. `extraExtensions` (Notion/media/etc.) — appended before Collaboration so\n * apps can extend the schema and Collaboration still binds over the full\n * schema.\n * 4. Collaboration (+ CollaborationCaret) LAST so they bind over everything.\n *\n * Content (the NFM editor) drives this factory with `features.placeholder` and\n * `features.markdown` off, `features.tasks/tables/link` off where it ships its\n * own, a `starterKit` override disabling paragraph/blockquote/codeBlock, and all\n * Notion/media/fidelity nodes + its own Markdown(NFM)/Placeholder via\n * `extraExtensions` — so it shares the StarterKit base + the collab wiring while\n * owning its byte-identical NFM serializer.\n */\nexport function createSharedEditorExtensions({\n dialect = \"gfm\",\n // `preset` is accepted and forwarded for future preset-specific schema\n // branches; it is currently schema-neutral.\n preset: _preset = \"plan\",\n placeholder = \"Type '/' for commands...\",\n features,\n starterKit,\n markdown,\n extraExtensions = [],\n collab = null,\n onImageUpload = null,\n}: CreateSharedEditorExtensionsOptions = {}): Array<Extension | Node | Mark> {\n const feat = { ...DEFAULT_FEATURES, ...(features ?? {}) };\n const ydoc = collab?.ydoc ?? null;\n const awareness = collab?.awareness ?? null;\n const user = collab?.user ?? null;\n\n const exts: Array<Extension | Node | Mark> = [\n StarterKit.configure({\n heading: { levels: [1, 2, 3, 4] },\n link: false,\n // StarterKit's plain code block is always disabled; when enabled we add the\n // syntax-highlighting `CodeBlockLowlight` (same `codeBlock` node) below.\n codeBlock: false,\n dropcursor: { color: \"hsl(var(--ring))\", width: 2 },\n // Yjs owns undo/redo when Collaboration is active; the StarterKit history\n // plugin and the CRDT cannot both track undo without corrupting state.\n ...(ydoc ? { undoRedo: false } : {}),\n // App overrides last so embedders can disable replaced nodes (paragraph,\n // blockquote, code block) or swap the dropcursor while keeping the shared\n // base + the collab undo/redo gating above.\n ...(starterKit ?? {}),\n }),\n ];\n\n // Syntax-highlighted code block (replaces StarterKit's plain one) only when the\n // embedder opts in via `features.codeBlock`. Content disables it and ships its\n // own code node, so this affects Plans (and future opt-in apps) alone.\n if (feat.codeBlock) {\n exts.push(\n CodeBlockLowlight.configure({\n lowlight: codeLowlight,\n defaultLanguage: null,\n }),\n );\n }\n\n if (feat.placeholder) {\n exts.push(\n Placeholder.configure({\n placeholder: ({ node }) => {\n if (node.type.name === \"heading\") {\n const level = node.attrs.level;\n if (level === 1) return \"Heading 1\";\n if (level === 2) return \"Heading 2\";\n if (level === 3) return \"Heading 3\";\n return \"Heading 4\";\n }\n return placeholder;\n },\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n }),\n );\n }\n\n if (feat.link) {\n exts.push(\n Link.configure({\n openOnClick: false,\n HTMLAttributes: { class: \"an-rich-md-link\" },\n }),\n );\n }\n\n if (feat.tasks) {\n exts.push(\n TaskList.configure({\n HTMLAttributes: { class: \"an-rich-md-task-list\" },\n }),\n TaskItem.configure({ nested: true }),\n );\n }\n\n if (feat.tables) {\n exts.push(\n Table.configure({\n resizable: false,\n HTMLAttributes: { class: \"an-rich-md-table\" },\n }),\n TableRow,\n TableHeader,\n TableCell,\n );\n }\n\n if (feat.markdown) {\n exts.push(Markdown.configure(markdown ?? MARKDOWN_DIALECT_CONFIG[dialect]));\n }\n\n // Shared block-level image node. The node is named `image`, so when\n // `features.markdown` is on, tiptap-markdown serializes it through its\n // built-in `defaultMarkdownSerializer.nodes.image` fallback → ``\n // (no width-as-HTML override here, so GFM stays byte-stable and\n // source-syncable). With an `onImageUpload` it accepts paste/drop uploads.\n if (feat.image) {\n exts.push(createImageExtension({ onImageUpload }));\n }\n\n // App-specific extensions (Notion/media/drag handles/comments). Appended\n // before Collaboration so they can extend the schema and Collaboration binds\n // over the full set.\n if (extraExtensions.length > 0) {\n exts.push(...extraExtensions);\n }\n\n // Collaborative editing via the shared Y.Doc. Markdown stays the canonical\n // saved representation (onChange serializes it); the Y.Doc is transient live\n // state only. Appended last so it binds over the configured schema above.\n if (ydoc) {\n exts.push(Collaboration.configure({ document: ydoc }));\n // Live multi-user cursors. Only mounted alongside a Y.Doc so the standalone\n // controlled editor (today's plan/content behavior) is untouched.\n if (awareness) {\n exts.push(\n CollaborationCaret.configure({\n provider: { awareness },\n user: user ?? { name: \"Anonymous\", color: \"#999\" },\n }),\n );\n }\n }\n\n return exts;\n}\n"]}
|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;IAC5E,gEAAgE;IAChE,2EAA2E;IAC3E,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,qBAAqB;IACrB,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;IAChC,CAAC;IAED,2EAA2E;IAC3E,6EAA6E;IAC7E,0EAA0E;IAC1E,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvD,4EAA4E;QAC5E,kEAAkE;QAClE,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,IAAI,CACP,kBAAkB,CAAC,SAAS,CAAC;gBAC3B,QAAQ,EAAE,EAAE,SAAS,EAAE;gBACvB,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;aACnD,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Extension, Node, Mark } from \"@tiptap/core\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport type { StarterKitOptions } from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport TaskList from \"@tiptap/extension-task-list\";\nimport TaskItem from \"@tiptap/extension-task-item\";\nimport { Table } from \"@tiptap/extension-table\";\nimport { TableRow } from \"@tiptap/extension-table-row\";\nimport { TableCell } from \"@tiptap/extension-table-cell\";\nimport { TableHeader } from \"@tiptap/extension-table-header\";\nimport { Markdown } from \"tiptap-markdown\";\nimport { createLowlight } from \"lowlight\";\nimport bash from \"highlight.js/lib/languages/bash\";\nimport css from \"highlight.js/lib/languages/css\";\nimport javascript from \"highlight.js/lib/languages/javascript\";\nimport json from \"highlight.js/lib/languages/json\";\nimport markdown from \"highlight.js/lib/languages/markdown\";\nimport python from \"highlight.js/lib/languages/python\";\nimport sql from \"highlight.js/lib/languages/sql\";\nimport typescript from \"highlight.js/lib/languages/typescript\";\nimport xml from \"highlight.js/lib/languages/xml\";\nimport yaml from \"highlight.js/lib/languages/yaml\";\nimport Collaboration from \"@tiptap/extension-collaboration\";\nimport CollaborationCaret from \"@tiptap/extension-collaboration-caret\";\n\n/**\n * Shared lowlight instance for the editor's syntax-highlighted code blocks. A\n * curated grammar set (aliases like ts/tsx, js/jsx, html, sh, py, yml, md come\n * for free from each grammar) keeps the editor bundle lean while matching the\n * languages the read-side Shiki surfaces (`code-tabs`) support. highlight.js is\n * synchronous, which is what a live ProseMirror editor needs — Shiki is async\n * and only used for read-only render paths.\n */\nconst codeLowlight = createLowlight({\n bash,\n css,\n javascript,\n json,\n markdown,\n python,\n sql,\n typescript,\n xml,\n yaml,\n});\nimport type { Doc as YDoc } from \"yjs\";\nimport type { Awareness } from \"y-protocols/awareness\";\nimport { createImageExtension, type ImageUploadFn } from \"./ImageExtension.js\";\nimport { createCodeBlockNode } from \"./CodeBlockNode.js\";\n\n/**\n * Markdown dialect the editor parses/serializes.\n *\n * - `gfm` — GitHub-Flavored Markdown. No raw HTML passthrough. The byte-stable\n * serialization used by Plans (see RichMarkdownEditor.roundtrip.spec.ts).\n * - `nfm` — the Notion-Flavored Markdown superset used by the Content editor,\n * which opts into inline HTML so Notion-specific blocks round-trip.\n */\nexport type RichMarkdownDialect = \"gfm\" | \"nfm\";\n\n/**\n * Editor preset. Schema-neutral today (both presets share the base schema),\n * but threaded through so an app can branch schema/behavior per preset without\n * a new factory. The collab/markdown wiring is preset-independent.\n */\nexport type RichMarkdownEditorPreset = \"plan\" | \"content\";\n\n/** User info used to label this client's collaborative cursor. */\nexport interface RichMarkdownCollabUser {\n name: string;\n color: string;\n email?: string;\n}\n\n/** Optional collaborative-editing inputs for the shared editor. */\nexport interface SharedEditorCollab {\n /**\n * Yjs document for collaborative editing. When present the editor binds the\n * shared {@link Collaboration} (+ {@link CollaborationCaret} when awareness\n * is set) extensions and StarterKit's built-in undo/redo is disabled (Yjs\n * owns history). When absent the editor is a controlled `value`/`onChange`\n * editor.\n */\n ydoc?: YDoc | null;\n /** Shared awareness instance for live multi-user cursors. */\n awareness?: Awareness | null;\n /** Current user info for the collaborative cursor label. */\n user?: RichMarkdownCollabUser | null;\n}\n\n/** Toggle the optional base extensions on/off per app. All default to `true`. */\nexport interface SharedEditorFeatures {\n /** GFM pipe tables (Table + TableRow + TableHeader + TableCell). */\n tables?: boolean;\n /** Task / checklist lists (TaskList + TaskItem). */\n tasks?: boolean;\n /** Inline links (the `Link` mark). When off, links fall back to plain text. */\n link?: boolean;\n /** Fenced code blocks. Disabling lets an app inject its own code-block node. */\n codeBlock?: boolean;\n /**\n * The built-in {@link Placeholder} extension. Default `true`. Apps that need a\n * bespoke placeholder resolver (per-node-type labels, ancestor-aware text)\n * disable this and supply their own Placeholder via `extraExtensions`.\n */\n placeholder?: boolean;\n /**\n * The built-in dialect-keyed {@link Markdown} serializer. Default `true`.\n * Apps with a custom serializer (e.g. Content's NFM converter, which does NOT\n * round-trip through tiptap-markdown's storage) disable this and own the\n * serialize/parse pipeline themselves. The Markdown extension is still added\n * so paste/clipboard transforms work — disable it only when supplying your own\n * Markdown configuration via the {@link CreateSharedEditorExtensionsOptions.markdown}\n * option instead.\n */\n markdown?: boolean;\n /**\n * The shared block-level image node (`@tiptap/extension-image`). Default\n * `false` so existing embedders are unchanged. When `true`, images\n * serialize to GFM `` (source-syncable) and — when an\n * {@link CreateSharedEditorExtensionsOptions.onImageUpload} function is\n * supplied — paste / drop of local image files uploads through it. Content\n * leaves this off and injects its own richer image node via\n * `extraExtensions`, so the two never collide.\n */\n image?: boolean;\n}\n\nexport interface CreateSharedEditorExtensionsOptions {\n /** Markdown dialect; selects the keyed {@link Markdown} config. */\n dialect?: RichMarkdownDialect;\n /** Preset hook (schema-neutral today). */\n preset?: RichMarkdownEditorPreset;\n /** Empty-block placeholder text (headings get their own labels). */\n placeholder?: string;\n /** Toggle individual base extensions. */\n features?: SharedEditorFeatures;\n /**\n * Extra StarterKit options merged over the shared defaults. Lets an app turn\n * off StarterKit nodes it replaces (Content swaps in its own paragraph /\n * blockquote / code block) or pass a custom dropcursor, while still sharing\n * the rest of the StarterKit base + the collab undo/redo gating. The shared\n * defaults (`heading` levels 1-4, `link: false`, the default dropcursor, and\n * `undoRedo: false` in collab mode) are applied first and can be overridden\n * key-by-key here.\n */\n starterKit?: Partial<StarterKitOptions>;\n /**\n * Custom {@link Markdown} configuration. Replaces the dialect-keyed config from\n * {@link MARKDOWN_DIALECT_CONFIG} when provided. Only used when\n * `features.markdown !== false`; apps that own the whole markdown pipeline (no\n * tiptap-markdown serialization at all) should set `features.markdown: false`\n * and add their own configured Markdown extension via `extraExtensions`.\n */\n markdown?: Parameters<typeof Markdown.configure>[0];\n /**\n * App-specific extensions (Notion nodes, media, drag handles, comment\n * anchors, etc.) appended LAST so they bind over the shared base schema and\n * the optional Collaboration extensions still mount after them.\n */\n extraExtensions?: Array<Extension | Node | Mark>;\n /** Optional collaborative-editing wiring. */\n collab?: SharedEditorCollab | null;\n /**\n * Injectable image uploader for the shared image block. Only used when\n * `features.image` is on. Turns a picked / pasted / dropped image File into a\n * hosted `{ src, alt? }`. Plans pass `uploadEditorImage` (the framework\n * `upload-image` action). When omitted, the image block still renders and\n * round-trips `` markdown but cannot ingest local files.\n */\n onImageUpload?: ImageUploadFn | null;\n}\n\n/**\n * tiptap-markdown configuration, keyed by dialect. This is the single source of\n * truth for how each dialect parses/serializes markdown so the editor component\n * and the round-trip fidelity test can never drift apart.\n *\n * tiptap-markdown re-serializes the whole document on every edit, so the goal\n * for GFM is `serialize(parse(markdown)) === markdown` for the markdown plans\n * actually contain. We deliberately keep tiptap-markdown's own defaults\n * (`bulletListMarker: \"-\"`, `tightLists: true`, `linkify: false`,\n * `breaks: false`) because those produce the most byte-stable GFM. See\n * RichMarkdownEditor.roundtrip.spec.ts for the pinned corpus.\n *\n * NFM (Content) opts into inline HTML passthrough (`html: true`) so\n * Notion-specific blocks survive a markdown round-trip; the rest mirrors the\n * Content editor's existing `Markdown.configure` call.\n */\nexport const MARKDOWN_DIALECT_CONFIG: Record<\n RichMarkdownDialect,\n Parameters<typeof Markdown.configure>[0]\n> = {\n gfm: {\n // GFM plans are the common case and must never gain raw HTML as a second\n // representation.\n html: false,\n // Keep tiptap-markdown's defaults that minimise first-edit normalisation\n // churn (see roundtrip spec). Listed explicitly so the contract is\n // self-documenting rather than relying on the package defaults.\n bulletListMarker: \"-\",\n tightLists: true,\n linkify: false,\n breaks: false,\n transformPastedText: true,\n transformCopiedText: true,\n },\n nfm: {\n // NFM is a superset that allows inline HTML so Notion blocks round-trip.\n html: true,\n transformPastedText: true,\n transformCopiedText: true,\n },\n};\n\nconst DEFAULT_FEATURES: Required<SharedEditorFeatures> = {\n tables: true,\n tasks: true,\n link: true,\n codeBlock: true,\n placeholder: true,\n markdown: true,\n // Off by default: only Plans opt in today. Content injects its own richer\n // image node via `extraExtensions` and must not get a second `image` node.\n image: false,\n};\n\n/**\n * The ONE editor extension factory shared by every embedder (Plans today,\n * Content next). It assembles the base Tiptap schema (StarterKit + Placeholder\n * + Link + tasks + tables + code block), the dialect-keyed {@link Markdown}\n * serializer, the optional Collaboration stack, and finally any app-specific\n * `extraExtensions`.\n *\n * Ordering matters:\n * 1. Base schema (StarterKit first so its nodes/marks register; `starterKit`\n * overrides let an app disable replaced nodes / swap the dropcursor).\n * 2. dialect-keyed Markdown serializer (suppressible via `features.markdown`\n * for apps that own the whole serialize/parse pipeline, e.g. Content's NFM).\n * 3. `extraExtensions` (Notion/media/etc.) — appended before Collaboration so\n * apps can extend the schema and Collaboration still binds over the full\n * schema.\n * 4. Collaboration (+ CollaborationCaret) LAST so they bind over everything.\n *\n * Content (the NFM editor) drives this factory with `features.placeholder` and\n * `features.markdown` off, `features.tasks/tables/link` off where it ships its\n * own, a `starterKit` override disabling paragraph/blockquote/codeBlock, and all\n * Notion/media/fidelity nodes + its own Markdown(NFM)/Placeholder via\n * `extraExtensions` — so it shares the StarterKit base + the collab wiring while\n * owning its byte-identical NFM serializer.\n */\nexport function createSharedEditorExtensions({\n dialect = \"gfm\",\n // `preset` is accepted and forwarded for future preset-specific schema\n // branches; it is currently schema-neutral.\n preset: _preset = \"plan\",\n placeholder = \"Type '/' for commands...\",\n features,\n starterKit,\n markdown,\n extraExtensions = [],\n collab = null,\n onImageUpload = null,\n}: CreateSharedEditorExtensionsOptions = {}): Array<Extension | Node | Mark> {\n const feat = { ...DEFAULT_FEATURES, ...(features ?? {}) };\n const ydoc = collab?.ydoc ?? null;\n const awareness = collab?.awareness ?? null;\n const user = collab?.user ?? null;\n\n const exts: Array<Extension | Node | Mark> = [\n StarterKit.configure({\n heading: { levels: [1, 2, 3, 4] },\n link: false,\n // StarterKit's plain code block is always disabled; when enabled we add the\n // syntax-highlighting `CodeBlockLowlight` (same `codeBlock` node) below.\n codeBlock: false,\n dropcursor: { color: \"hsl(var(--ring))\", width: 2 },\n // Yjs owns undo/redo when Collaboration is active; the StarterKit history\n // plugin and the CRDT cannot both track undo without corrupting state.\n ...(ydoc ? { undoRedo: false } : {}),\n // App overrides last so embedders can disable replaced nodes (paragraph,\n // blockquote, code block) or swap the dropcursor while keeping the shared\n // base + the collab undo/redo gating above.\n ...(starterKit ?? {}),\n }),\n ];\n\n // Notion-style syntax-highlighted code block (replaces StarterKit's plain one)\n // only when the embedder opts in via `features.codeBlock`. The shared node adds\n // a language picker header (Auto-detects by default) over `CodeBlockLowlight`,\n // so fenced markdown still round-trips byte-identically. Content disables this\n // and ships its own code node, so this affects Plans (and future opt-in apps)\n // alone.\n if (feat.codeBlock) {\n exts.push(createCodeBlockNode({ lowlight: codeLowlight }));\n }\n\n if (feat.placeholder) {\n exts.push(\n Placeholder.configure({\n placeholder: ({ node }) => {\n if (node.type.name === \"heading\") {\n const level = node.attrs.level;\n if (level === 1) return \"Heading 1\";\n if (level === 2) return \"Heading 2\";\n if (level === 3) return \"Heading 3\";\n return \"Heading 4\";\n }\n return placeholder;\n },\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n }),\n );\n }\n\n if (feat.link) {\n exts.push(\n Link.configure({\n openOnClick: false,\n HTMLAttributes: { class: \"an-rich-md-link\" },\n }),\n );\n }\n\n if (feat.tasks) {\n exts.push(\n TaskList.configure({\n HTMLAttributes: { class: \"an-rich-md-task-list\" },\n }),\n TaskItem.configure({ nested: true }),\n );\n }\n\n if (feat.tables) {\n exts.push(\n Table.configure({\n resizable: false,\n HTMLAttributes: { class: \"an-rich-md-table\" },\n }),\n TableRow,\n TableHeader,\n TableCell,\n );\n }\n\n if (feat.markdown) {\n exts.push(Markdown.configure(markdown ?? MARKDOWN_DIALECT_CONFIG[dialect]));\n }\n\n // Shared block-level image node. The node is named `image`, so when\n // `features.markdown` is on, tiptap-markdown serializes it through its\n // built-in `defaultMarkdownSerializer.nodes.image` fallback → ``\n // (no width-as-HTML override here, so GFM stays byte-stable and\n // source-syncable). With an `onImageUpload` it accepts paste/drop uploads.\n if (feat.image) {\n exts.push(createImageExtension({ onImageUpload }));\n }\n\n // App-specific extensions (Notion/media/drag handles/comments). Appended\n // before Collaboration so they can extend the schema and Collaboration binds\n // over the full set.\n if (extraExtensions.length > 0) {\n exts.push(...extraExtensions);\n }\n\n // Collaborative editing via the shared Y.Doc. Markdown stays the canonical\n // saved representation (onChange serializes it); the Y.Doc is transient live\n // state only. Appended last so it binds over the configured schema above.\n if (ydoc) {\n exts.push(Collaboration.configure({ document: ydoc }));\n // Live multi-user cursors. Only mounted alongside a Y.Doc so the standalone\n // controlled editor (today's plan/content behavior) is untouched.\n if (awareness) {\n exts.push(\n CollaborationCaret.configure({\n provider: { awareness },\n user: user ?? { name: \"Anonymous\", color: \"#999\" },\n }),\n );\n }\n }\n\n return exts;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export { SharedImage, createImageExtension, pickAndInsertImage, type ImageUpload
|
|
|
5
5
|
export { uploadEditorImage } from "./uploadEditorImage.js";
|
|
6
6
|
export { BubbleToolbar, buildDefaultBubbleItems, type BubbleToolbarItem, type BubbleToolbarProps, } from "./BubbleToolbar.js";
|
|
7
7
|
export { SharedRichEditor, type SharedRichEditorProps, } from "./SharedRichEditor.js";
|
|
8
|
+
export { createCodeBlockNode, DEFAULT_CODE_LANGUAGES, type CodeLanguageOption, type CodeBlockClassNames, type CreateCodeBlockNodeOptions, } from "./CodeBlockNode.js";
|
|
8
9
|
export { RichMarkdownEditor, createRichMarkdownExtensions, type RichMarkdownEditorProps, type CreateRichMarkdownExtensionsOptions, } from "./RichMarkdownEditor.js";
|
|
9
10
|
export { RunId, RUN_ID_NODE_TYPES } from "./RunId.js";
|
|
10
11
|
export { gfmToProseJSON, proseJSONToGfm } from "./gfmDoc.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mCAAmC,GACzC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sCAAsC,EACtC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,GACzC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,oCAAoC,EACpC,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,KAAK,mCAAmC,GACzC,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mCAAmC,GACzC,MAAM,iBAAiB,CAAC;AACzB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B,CAAC;AAChC,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,KAAK,mCAAmC,GACzC,MAAM,4BAA4B,CAAC"}
|
|
@@ -5,6 +5,7 @@ export { SharedImage, createImageExtension, pickAndInsertImage, } from "./ImageE
|
|
|
5
5
|
export { uploadEditorImage } from "./uploadEditorImage.js";
|
|
6
6
|
export { BubbleToolbar, buildDefaultBubbleItems, } from "./BubbleToolbar.js";
|
|
7
7
|
export { SharedRichEditor, } from "./SharedRichEditor.js";
|
|
8
|
+
export { createCodeBlockNode, DEFAULT_CODE_LANGUAGES, } from "./CodeBlockNode.js";
|
|
8
9
|
export { RichMarkdownEditor, createRichMarkdownExtensions, } from "./RichMarkdownEditor.js";
|
|
9
10
|
export { RunId, RUN_ID_NODE_TYPES } from "./RunId.js";
|
|
10
11
|
export { gfmToProseJSON, proseJSONToGfm } from "./gfmDoc.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,GAOxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sCAAsC,GAGvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,GAGxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAG7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,oCAAoC,GAIrC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GAIrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,GAEhC,MAAM,4BAA4B,CAAC","sourcesContent":["export {\n createSharedEditorExtensions,\n MARKDOWN_DIALECT_CONFIG,\n type RichMarkdownDialect,\n type RichMarkdownEditorPreset,\n type RichMarkdownCollabUser,\n type SharedEditorCollab,\n type SharedEditorFeatures,\n type CreateSharedEditorExtensionsOptions,\n} from \"./extensions.js\";\nexport {\n useCollabReconcile,\n getEditorMarkdown,\n RICH_MARKDOWN_PROGRAMMATIC_TRANSACTION,\n type UseCollabReconcileOptions,\n type UseCollabReconcileResult,\n} from \"./useCollabReconcile.js\";\nexport {\n SlashCommandMenu,\n DEFAULT_SLASH_COMMANDS,\n createImageSlashCommand,\n type SlashCommandItem,\n type SlashCommandMenuProps,\n} from \"./SlashCommandMenu.js\";\nexport {\n SharedImage,\n createImageExtension,\n pickAndInsertImage,\n type ImageUploadFn,\n type SharedImageOptions,\n} from \"./ImageExtension.js\";\nexport { uploadEditorImage } from \"./uploadEditorImage.js\";\nexport {\n BubbleToolbar,\n buildDefaultBubbleItems,\n type BubbleToolbarItem,\n type BubbleToolbarProps,\n} from \"./BubbleToolbar.js\";\nexport {\n SharedRichEditor,\n type SharedRichEditorProps,\n} from \"./SharedRichEditor.js\";\nexport {\n RichMarkdownEditor,\n createRichMarkdownExtensions,\n type RichMarkdownEditorProps,\n type CreateRichMarkdownExtensionsOptions,\n} from \"./RichMarkdownEditor.js\";\nexport { RunId, RUN_ID_NODE_TYPES } from \"./RunId.js\";\nexport { gfmToProseJSON, proseJSONToGfm } from \"./gfmDoc.js\";\nexport {\n DragHandle,\n DEFAULT_DRAG_HANDLE_WRAPPER_SELECTOR,\n type DragHandleDropContext,\n type DragHandleDropPlacement,\n type DragHandleOptions,\n} from \"./DragHandle.js\";\nexport {\n createRegistryBlockNode,\n RegistryBlockNodeView,\n RegistryBlockDataProvider,\n useRegistryBlockData,\n type CreateRegistryBlockNodeOptions,\n type RegistryBlockDataValue,\n type RegistryBlockSideMapBlock,\n} from \"./RegistryBlockNode.js\";\nexport {\n buildRegistryBlockSlashItems,\n getRegistryBlockSlashDescription,\n getRegistryBlockSlashSearchText,\n type BuildRegistryBlockSlashItemsOptions,\n} from \"./registrySlashCommands.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,GAOxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sCAAsC,GAGvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,GAGxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAG7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,oCAAoC,GAIrC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GAIrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,GAEhC,MAAM,4BAA4B,CAAC","sourcesContent":["export {\n createSharedEditorExtensions,\n MARKDOWN_DIALECT_CONFIG,\n type RichMarkdownDialect,\n type RichMarkdownEditorPreset,\n type RichMarkdownCollabUser,\n type SharedEditorCollab,\n type SharedEditorFeatures,\n type CreateSharedEditorExtensionsOptions,\n} from \"./extensions.js\";\nexport {\n useCollabReconcile,\n getEditorMarkdown,\n RICH_MARKDOWN_PROGRAMMATIC_TRANSACTION,\n type UseCollabReconcileOptions,\n type UseCollabReconcileResult,\n} from \"./useCollabReconcile.js\";\nexport {\n SlashCommandMenu,\n DEFAULT_SLASH_COMMANDS,\n createImageSlashCommand,\n type SlashCommandItem,\n type SlashCommandMenuProps,\n} from \"./SlashCommandMenu.js\";\nexport {\n SharedImage,\n createImageExtension,\n pickAndInsertImage,\n type ImageUploadFn,\n type SharedImageOptions,\n} from \"./ImageExtension.js\";\nexport { uploadEditorImage } from \"./uploadEditorImage.js\";\nexport {\n BubbleToolbar,\n buildDefaultBubbleItems,\n type BubbleToolbarItem,\n type BubbleToolbarProps,\n} from \"./BubbleToolbar.js\";\nexport {\n SharedRichEditor,\n type SharedRichEditorProps,\n} from \"./SharedRichEditor.js\";\nexport {\n createCodeBlockNode,\n DEFAULT_CODE_LANGUAGES,\n type CodeLanguageOption,\n type CodeBlockClassNames,\n type CreateCodeBlockNodeOptions,\n} from \"./CodeBlockNode.js\";\nexport {\n RichMarkdownEditor,\n createRichMarkdownExtensions,\n type RichMarkdownEditorProps,\n type CreateRichMarkdownExtensionsOptions,\n} from \"./RichMarkdownEditor.js\";\nexport { RunId, RUN_ID_NODE_TYPES } from \"./RunId.js\";\nexport { gfmToProseJSON, proseJSONToGfm } from \"./gfmDoc.js\";\nexport {\n DragHandle,\n DEFAULT_DRAG_HANDLE_WRAPPER_SELECTOR,\n type DragHandleDropContext,\n type DragHandleDropPlacement,\n type DragHandleOptions,\n} from \"./DragHandle.js\";\nexport {\n createRegistryBlockNode,\n RegistryBlockNodeView,\n RegistryBlockDataProvider,\n useRegistryBlockData,\n type CreateRegistryBlockNodeOptions,\n type RegistryBlockDataValue,\n type RegistryBlockSideMapBlock,\n} from \"./RegistryBlockNode.js\";\nexport {\n buildRegistryBlockSlashItems,\n getRegistryBlockSlashDescription,\n getRegistryBlockSlashSearchText,\n type BuildRegistryBlockSlashItemsOptions,\n} from \"./registrySlashCommands.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrySlashCommands.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"registrySlashCommands.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAwBnE;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,GAC5C,MAAM,CAKR;AAED,mFAAmF;AACnF,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC,GACtD,MAAM,CAKR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,mCAAmC,CAAC,KAAK,EAAE,OAAO;IACjE;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;IAClD,mEAAmE;IACnE,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAAK,KAAK,CAAC;IACtE;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;IAC3C;;;OAGG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,EACzD,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,mCAAmC,CAAC,KAAK,EAAE,OAAO,CAAC,GAC3D,KAAK,EAAE,CAUT"}
|
|
@@ -17,6 +17,7 @@ const COMPACT_REGISTRY_BLOCK_DESCRIPTIONS = {
|
|
|
17
17
|
diff: "Code diff",
|
|
18
18
|
"file-tree": "File/change tree",
|
|
19
19
|
"json-explorer": "JSON tree",
|
|
20
|
+
"annotated-code": "Code walkthrough",
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
23
|
* Compact, user-facing slash-menu copy for structured registry blocks. The full
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrySlashCommands.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAEA,MAAM,mCAAmC,GAA2B;IAClE,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,eAAe;IAC1B,eAAe,EAAE,uBAAuB;IACxC,SAAS,EAAE,iBAAiB;IAC5B,KAAK,EAAE,eAAe;IACtB,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,sBAAsB;IACnC,aAAa,EAAE,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,iBAAiB;IAC1B,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,YAAY;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,kBAAkB;IAC/B,eAAe,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"registrySlashCommands.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAEA,MAAM,mCAAmC,GAA2B;IAClE,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,eAAe;IAC1B,eAAe,EAAE,uBAAuB;IACxC,SAAS,EAAE,iBAAiB;IAC5B,KAAK,EAAE,eAAe;IACtB,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,sBAAsB;IACnC,aAAa,EAAE,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,iBAAiB;IAC1B,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,YAAY;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,kBAAkB;IAC/B,eAAe,EAAE,WAAW;IAC5B,gBAAgB,EAAE,kBAAkB;CACrC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,IAA6C;IAE7C,OAAO,CACL,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAC7C,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,+BAA+B,CAC7C,IAAuD;IAEvD,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC;SAC7C,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC;SACT,WAAW,EAAE,CAAC;AACnB,CAAC;AA+CD;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAuB,EACvB,OAA4D;IAE5D,MAAM,YAAY,GAChB,OAAO,CAAC,kBAAkB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC3E,OAAO,QAAQ;SACZ,IAAI,CAAC,OAAO,CAAC;SACb,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;SACrD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;SACrE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACpE,CAAC;AACN,CAAC","sourcesContent":["import type { BlockRegistry, BlockSpec } from \"../blocks/index.js\";\n\nconst COMPACT_REGISTRY_BLOCK_DESCRIPTIONS: Record<string, string> = {\n callout: \"Emphasized note\",\n diagram: \"Inline diagram\",\n wireframe: \"Screen mockup\",\n \"question-form\": \"Interactive questions\",\n checklist: \"Checklist items\",\n table: \"Editable grid\",\n \"table-block\": \"Editable grid\",\n \"code-tabs\": \"Tabbed code snippets\",\n \"custom-html\": \"Sandboxed HTML\",\n tabs: \"Tabbed block group\",\n columns: \"Side-by-side columns\",\n mermaid: \"Mermaid diagram\",\n \"api-endpoint\": \"API reference\",\n \"openapi-spec\": \"OpenAPI document\",\n \"data-model\": \"ERD schema\",\n diff: \"Code diff\",\n \"file-tree\": \"File/change tree\",\n \"json-explorer\": \"JSON tree\",\n \"annotated-code\": \"Code walkthrough\",\n};\n\n/**\n * Compact, user-facing slash-menu copy for structured registry blocks. The full\n * registry description remains available through search text, but the visible\n * row should scan like a command palette, not a block reference page.\n */\nexport function getRegistryBlockSlashDescription(\n spec: Pick<BlockSpec, \"type\" | \"description\">,\n): string {\n return (\n COMPACT_REGISTRY_BLOCK_DESCRIPTIONS[spec.type] ??\n spec.description.trim().replace(/\\s+/g, \" \")\n );\n}\n\n/** Searchable text for registry block slash items, including raw type keywords. */\nexport function getRegistryBlockSlashSearchText(\n spec: Pick<BlockSpec, \"type\" | \"label\" | \"description\">,\n): string {\n return [spec.label, spec.description, spec.type]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\n/**\n * Shared builder for the registry-derived block slash commands both the plan and\n * content editors offer. Both apps take every `BlockSpec` whose `placement`\n * includes `\"block\"`, gate it by Notion-compatibility when the open document is\n * linked to a Notion page, and emit one slash item per surviving spec that\n * inserts that block's atom node. The only legitimate per-app differences are:\n *\n * - the ITEM SHAPE (plan uses a text-glyph `icon`, content a React component),\n * - the Notion-compat PREDICATE (plan unions in prose-only NFM analogs, content\n * reads the registry `notionCompatible` flag directly), and\n * - the INSERT behavior (plan inserts a `planBlock` node, content a\n * `registryBlock` node seeded with inline `__raw`).\n *\n * Those three are injected; everything else (the `list(\"block\")` source, the\n * Notion filter wiring, the one-item-per-spec mapping) lives here so adding a\n * new library block only touches the registry, never the slash builders.\n */\nexport interface BuildRegistryBlockSlashItemsOptions<TItem, TEditor> {\n /**\n * When `true`, only specs the predicate accepts are offered (the open document\n * is linked to a Notion page, so blocks that can't round-trip to NFM are\n * hidden). When unset/false, every block-placed spec is offered.\n */\n notionCompatibleOnly?: boolean;\n /**\n * Decide whether a spec round-trips to Notion. Defaults to the spec's own\n * `notionCompatible` flag (content's rule). Plan passes a predicate that unions\n * in prose-only NFM analogs not carried as registry flags.\n */\n isNotionCompatible?: (spec: BlockSpec) => boolean;\n /** Build one app-shaped slash item from a surviving block spec. */\n toItem: (spec: BlockSpec, insert: (editor: TEditor) => void) => TItem;\n /**\n * Optional app-level capability gate. Use this for blocks whose schema is\n * registered for parse/render compatibility but whose authoring experience is\n * not available in this editor yet.\n */\n includeSpec?: (spec: BlockSpec) => boolean;\n /**\n * Insert this spec's block atom into the editor. Plan inserts a `planBlock`\n * node; content inserts a `registryBlock` node seeded with inline `__raw`.\n */\n insertBlock: (editor: TEditor, spec: BlockSpec) => void;\n}\n\n/**\n * Build the registry-derived block slash items, shared by plan and content. Each\n * app prepends its own prose/base commands and wraps the result in its own item\n * type via {@link BuildRegistryBlockSlashItemsOptions.toItem}.\n */\nexport function buildRegistryBlockSlashItems<TItem, TEditor>(\n registry: BlockRegistry,\n options: BuildRegistryBlockSlashItemsOptions<TItem, TEditor>,\n): TItem[] {\n const isCompatible =\n options.isNotionCompatible ?? ((spec) => Boolean(spec.notionCompatible));\n return registry\n .list(\"block\")\n .filter((spec) => options.includeSpec?.(spec) ?? true)\n .filter((spec) => !options.notionCompatibleOnly || isCompatible(spec))\n .map((spec) =>\n options.toItem(spec, (editor) => options.insertBlock(editor, spec)),\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/extensions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/extensions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAiChE,wBAAgB,4BAA4B,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAkrB1E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writeAppState } from "../application-state/script-helpers.js";
|
|
2
|
-
import { createExtension, deleteExtension, getHiddenExtensionIdsForCurrentUser, getExtension, getExtensionHistoryVersion, hideExtension, listExtensionHistory, listExtensions, restoreExtensionHistoryVersion, unhideExtension, updateExtension, updateExtensionContent, } from "./store.js";
|
|
2
|
+
import { createExtension, deleteExtension, getHiddenExtensionIdsForCurrentUser, getExtension, getExtensionHistoryVersion, globalHideExtension, globalUnhideExtension, hideExtension, listExtensionHistory, listExtensions, restoreExtensionHistoryVersion, unhideExtension, updateExtension, updateExtensionContent, } from "./store.js";
|
|
3
3
|
import { resolveAccess } from "../sharing/access.js";
|
|
4
4
|
import { addExtensionSlotTarget, installExtensionSlot, uninstallExtensionSlot, listExtensionsForSlot, listSlotsForExtension, } from "./slots/store.js";
|
|
5
5
|
import { extensionPath } from "./path.js";
|
|
@@ -19,6 +19,10 @@ export function createExtensionActionEntries() {
|
|
|
19
19
|
type: "boolean",
|
|
20
20
|
description: "Include extensions the current user has hidden from their list. Defaults to false.",
|
|
21
21
|
},
|
|
22
|
+
includeGloballyHidden: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
description: "Include extensions an admin/owner has globally hidden from everyone (via global-hide-extension). Defaults to false. Use this to find ids to unhide for everyone.",
|
|
25
|
+
},
|
|
22
26
|
includeContent: {
|
|
23
27
|
type: "boolean",
|
|
24
28
|
description: "Include full Alpine.js content. Defaults to false to keep results concise.",
|
|
@@ -32,13 +36,17 @@ export function createExtensionActionEntries() {
|
|
|
32
36
|
},
|
|
33
37
|
run: async (args) => {
|
|
34
38
|
const includeHidden = coerceBoolean(args?.includeHidden);
|
|
39
|
+
const includeGloballyHidden = coerceBoolean(args?.includeGloballyHidden);
|
|
35
40
|
const includeContent = coerceBoolean(args?.includeContent);
|
|
36
41
|
const search = String(args?.search ?? "")
|
|
37
42
|
.trim()
|
|
38
43
|
.toLowerCase();
|
|
39
44
|
const limit = coerceLimit(args?.limit);
|
|
40
45
|
const hiddenIds = await getHiddenExtensionIdsForCurrentUser();
|
|
41
|
-
let rows = await listExtensions({
|
|
46
|
+
let rows = await listExtensions({
|
|
47
|
+
includeHidden,
|
|
48
|
+
includeGloballyHidden,
|
|
49
|
+
});
|
|
42
50
|
if (search) {
|
|
43
51
|
rows = rows.filter((row) => [row.id, row.name, row.description, row.ownerEmail]
|
|
44
52
|
.join("\n")
|
|
@@ -445,6 +453,56 @@ export function createExtensionActionEntries() {
|
|
|
445
453
|
return { ok: true, id };
|
|
446
454
|
},
|
|
447
455
|
},
|
|
456
|
+
"global-hide-extension": {
|
|
457
|
+
tool: {
|
|
458
|
+
description: "Globally hide an extension from EVERYONE's Extensions list/sidebar (not just the current user) by stamping it hidden. Requires owner/admin access. Use this for an admin takedown of a shared/org extension. The extension is not deleted and stays accessible by id; use global-unhide-extension to reverse. For removing an extension only from your own view, use hide-extension instead.",
|
|
459
|
+
parameters: {
|
|
460
|
+
type: "object",
|
|
461
|
+
properties: {
|
|
462
|
+
id: {
|
|
463
|
+
type: "string",
|
|
464
|
+
description: "Extension id to hide for everyone. Use list-extensions first if you only know the display name.",
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
required: ["id"],
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
run: async (args) => {
|
|
471
|
+
const id = String(args?.id ?? "").trim();
|
|
472
|
+
if (!id)
|
|
473
|
+
return "Error: id is required.";
|
|
474
|
+
const extension = await getExtension(id);
|
|
475
|
+
if (!extension)
|
|
476
|
+
return `Error: extension not found: ${id}`;
|
|
477
|
+
await globalHideExtension(id);
|
|
478
|
+
return {
|
|
479
|
+
ok: true,
|
|
480
|
+
globallyHidden: summarizeDeletedExtension(extension),
|
|
481
|
+
};
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
"global-unhide-extension": {
|
|
485
|
+
tool: {
|
|
486
|
+
description: "Reverse a global hide so the extension reappears in everyone's Extensions list/sidebar again. Requires owner/admin access. Use list-extensions with includeGloballyHidden=true to find globally-hidden ids.",
|
|
487
|
+
parameters: {
|
|
488
|
+
type: "object",
|
|
489
|
+
properties: {
|
|
490
|
+
id: {
|
|
491
|
+
type: "string",
|
|
492
|
+
description: "Extension id to unhide for everyone.",
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
required: ["id"],
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
run: async (args) => {
|
|
499
|
+
const id = String(args?.id ?? "").trim();
|
|
500
|
+
if (!id)
|
|
501
|
+
return "Error: id is required.";
|
|
502
|
+
await globalUnhideExtension(id);
|
|
503
|
+
return { ok: true, id };
|
|
504
|
+
},
|
|
505
|
+
},
|
|
448
506
|
"add-extension-slot-target": {
|
|
449
507
|
tool: {
|
|
450
508
|
description: 'Declare that an extension can render in a UI extension-point slot of an app (e.g. "mail.contact-sidebar.bottom"). Apps drop ExtensionSlot components in their UI; this action registers an extension as installable into one of those slots. Slot IDs follow the convention <app>.<area>.<position>. Caller must have editor access to the extension.',
|
|
@@ -597,6 +655,9 @@ async function summarizeExtension(row, hiddenIds, includeContent) {
|
|
|
597
655
|
: false,
|
|
598
656
|
canDelete: access ? ["owner", "admin"].includes(access.role) : false,
|
|
599
657
|
hidden: hiddenIds.has(row.id),
|
|
658
|
+
globallyHidden: row.hiddenAt != null,
|
|
659
|
+
hiddenAt: row.hiddenAt,
|
|
660
|
+
hiddenBy: row.hiddenBy,
|
|
600
661
|
createdAt: row.createdAt,
|
|
601
662
|
updatedAt: row.updatedAt,
|
|
602
663
|
...(includeContent ? { content: row.content } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/extensions/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EACL,eAAe,EACf,eAAe,EACf,mCAAmC,EACnC,YAAY,EACZ,0BAA0B,EAC1B,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,8BAA8B,EAC9B,eAAe,EACf,eAAe,EACf,sBAAsB,GAEvB,MAAM,YAAY,CA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AAE,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC;QAC3E,KAAK,eAAe,CAAC;QACrB,KAAK,cAAc;YACjB,OAAO,CACL,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACpE,CAAC;QACJ,KAAK,iBAAiB;YACpB,OAAO,CACL,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAC9B,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;gBAC5B,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACjC,CAAC;QACJ,KAAK,iBAAiB;YACpB,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACrE,CAAC;QACJ,KAAK,cAAc;YACjB,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;gBAChC,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAC/B,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAC/B,CAAC;QACJ,KAAK,gBAAgB;YACnB,OAAO,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC;QAC1C,KAAK,eAAe;YAClB,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACrE,CAAC;QACJ;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["import type { ActionEntry } from \"../agent/production-agent.js\";\nimport { writeAppState } from \"../application-state/script-helpers.js\";\nimport {\n createExtension,\n deleteExtension,\n getHiddenExtensionIdsForCurrentUser,\n getExtension,\n getExtensionHistoryVersion,\n hideExtension,\n listExtensionHistory,\n listExtensions,\n restoreExtensionHistoryVersion,\n unhideExtension,\n updateExtension,\n updateExtensionContent,\n type ExtensionRow,\n} from \"./store.js\";\nimport { resolveAccess } from \"../sharing/access.js\";\nimport {\n addExtensionSlotTarget,\n installExtensionSlot,\n uninstallExtensionSlot,\n listExtensionsForSlot,\n listSlotsForExtension,\n} from \"./slots/store.js\";\nimport { extensionPath } from \"./path.js\";\nimport type {\n ExtensionContentEdit,\n ExtensionLegacyPatch,\n} from \"./content-patch.js\";\n\nexport function createExtensionActionEntries(): Record<string, ActionEntry> {\n return {\n \"list-extensions\": {\n tool: {\n description:\n \"List extensions visible in the current user's Extensions list/sidebar. Use this for browsing or when you only know a display name. If <current-screen> or <current-url> already contains extensionId for the current extension, use get-extension or update-extension with that id directly instead of listing. Do not query the legacy tools table directly for extension management.\",\n parameters: {\n type: \"object\",\n properties: {\n search: {\n type: \"string\",\n description:\n \"Optional case-insensitive filter matched against id, name, description, and owner email. Example: Connect Zoom.\",\n },\n includeHidden: {\n type: \"boolean\",\n description:\n \"Include extensions the current user has hidden from their list. Defaults to false.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full Alpine.js content. Defaults to false to keep results concise.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return. Defaults to 100.\",\n },\n },\n },\n },\n run: async (args) => {\n const includeHidden = coerceBoolean(args?.includeHidden);\n const includeContent = coerceBoolean(args?.includeContent);\n const search = String(args?.search ?? \"\")\n .trim()\n .toLowerCase();\n const limit = coerceLimit(args?.limit);\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n\n let rows = await listExtensions({ includeHidden });\n if (search) {\n rows = rows.filter((row) =>\n [row.id, row.name, row.description, row.ownerEmail]\n .join(\"\\n\")\n .toLowerCase()\n .includes(search),\n );\n }\n\n rows = rows.slice(0, limit);\n const extensions = await Promise.all(\n rows.map((row) => summarizeExtension(row, hiddenIds, includeContent)),\n );\n return {\n ok: true,\n count: extensions.length,\n extensions,\n };\n },\n readOnly: true,\n },\n\n \"get-extension\": {\n tool: {\n description:\n \"Get one existing extension by id. Use this when <current-screen> or <current-url> contains extensionId for the current extension; do not call list-extensions just to rediscover that id. Defaults to including the full Alpine.js content so you can make a targeted update-extension edit.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to read. Prefer the extensionId from <current-screen> or <current-url> when the user refers to the current extension.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full Alpine.js content. Defaults to true for targeted edits.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const includeContent =\n args?.includeContent === undefined\n ? true\n : coerceBoolean(args.includeContent);\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n extension: await summarizeExtension(\n extension,\n hiddenIds,\n includeContent,\n ),\n };\n },\n readOnly: true,\n },\n\n \"list-extension-history\": {\n tool: {\n description:\n \"List saved history snapshots for one extension. Use this when the user asks what changed, wants a changelog, or wants to pick an older version to restore. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url>.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id whose history should be listed.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum versions to return. Defaults to 50.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full HTML content for each version. Defaults to false.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const history = await listExtensionHistory(id, {\n limit:\n args?.limit === undefined ? undefined : coerceLimit(args.limit),\n includeContent: coerceBoolean(args?.includeContent),\n });\n return {\n ok: true,\n count: history.length,\n history,\n };\n },\n readOnly: true,\n },\n\n \"get-extension-history-version\": {\n tool: {\n description:\n \"Get one extension history version with its previous-version diff. Use after list-extension-history when the user wants to inspect exactly what changed.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id whose history version should be read.\",\n },\n version: {\n type: \"number\",\n description: \"History version number to inspect.\",\n },\n },\n required: [\"id\", \"version\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const version = Number(args?.version);\n if (!Number.isInteger(version) || version < 1) {\n return \"Error: version must be a positive integer.\";\n }\n const detail = await getExtensionHistoryVersion(id, version);\n if (!detail) {\n return `Error: extension history version not found: ${id}#${version}`;\n }\n return { ok: true, ...detail };\n },\n readOnly: true,\n },\n\n \"create-extension\": {\n tool: {\n description:\n \"Create a sandboxed Alpine.js mini-app extension. Use this when the user asks to create, build, or make an extension/widget/dashboard/calculator. Call this action exactly once per requested extension. The content must be a self-contained Alpine.js HTML body snippet that can use appAction(), appFetch(), dbQuery(), dbExec(), extensionFetch(), and extensionData. Prefer appAction(name, params) for app data and actions, including read actions mounted as GET; do not call template /api/* routes from appFetch because the extension bridge only allows framework /_agent-native/* paths. Parse JSON string action results before aggregating; use dbQuery()/dbExec() only for known existing SQL tables. Keep the initial create-extension payload compact and working; for complex extensions, create a useful v1 first, then use focused update-extension edits for refinements rather than assembling one enormous tool input. For any non-trivial component (more than a couple of state fields, any methods, any string formatting, any branching) put the component in a <script> block via Alpine.data('name', () => ({...})) and reference it with x-data=\\\"name\\\" — do NOT cram methods, template literals, or branching logic into an inline x-data=\\\"{...}\\\" attribute (HTML parser pitfalls cause ReferenceError failures). Define every variable referenced from x-text/x-show/x-if/x-for on the data object's initial state. If the extension's value depends on an LLM call, require a real key via \\\\${keys.OPENAI_API_KEY}/\\\\${keys.ANTHROPIC_API_KEY} (and tell the user to add it in Settings → Secrets if missing) or route the AI work to the agent chat — never ship a stubbed analysis step that renders a placeholder/boolean as the result.\",\n parameters: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description:\n 'Short display name for the extension. Do not include \"app\" — e.g. name a todo app \"Todos\", a weather app \"Weather\".',\n },\n description: {\n type: \"string\",\n description: \"One-sentence summary of what the extension does.\",\n },\n content: {\n type: \"string\",\n description:\n \"Self-contained Alpine.js HTML body snippet. The iframe canvas already has modest default padding, so avoid duplicate outer padding unless the design needs it. Use semantic Tailwind colors (bg-background, text-foreground, bg-primary, etc.) for native theming. Do not include a full app build, React code, or source files.\",\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n },\n required: [\"name\", \"content\"],\n },\n },\n run: async (args) => {\n const name = String(args?.name ?? \"\").trim();\n const content = String(args?.content ?? \"\").trim();\n if (!name) return \"Error: name is required.\";\n if (!content) return \"Error: content is required.\";\n\n const extension = await createExtension({\n name,\n description: String(args?.description ?? \"\").trim(),\n content,\n icon: args?.icon ? String(args.icon) : undefined,\n });\n const path = extensionPath(extension.id, extension.name);\n\n // Auto-navigate so the user lands on the new extension instead of\n // having to read the JSON response and click a link. Writes a\n // one-shot `navigate` app-state command the UI consumes and clears.\n try {\n await writeAppState(\"navigate\", {\n view: \"extensions\",\n extensionId: extension.id,\n path,\n // Unique-per-write token so the UI's `use-navigation-state` hook\n // can dedup race-driven re-reads of the same command.\n _writeId: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n });\n } catch {\n // Non-fatal — agent can still mention the path in its reply.\n }\n\n return {\n ok: true,\n extension: { ...extension, path },\n path,\n next: `Created. The user is being navigated to the new extension automatically — no further navigation tool calls needed.`,\n };\n },\n },\n\n \"update-extension\": {\n tool: {\n description:\n \"Update an existing sandboxed Alpine.js mini-app extension. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url> directly; do not list extensions first just to find the current id. Prefer granular edits for surgical changes; use full content replacement only for broad rewrites. Supported edits include literal replace, insert-before/after marker, replace-between markers, replace-section/wrap-section/remove-section for <!-- agent-native:section name --> blocks, and regex-replace. Pass format=true to run Prettier on the final HTML.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to update. Prefer the extensionId from <current-screen> or <current-url> for the current extension.\",\n },\n name: {\n type: \"string\",\n description: \"Optional new display name.\",\n },\n description: {\n type: \"string\",\n description: \"Optional new description.\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional full replacement Alpine.js HTML body snippet.\",\n },\n patches: {\n type: \"string\",\n description:\n 'Legacy optional JSON array of { \"find\": \"...\", \"replace\": \"...\", \"all\"?: true, \"expectedMatches\"?: 1, \"required\"?: true } patches. Missing required targets fail instead of silently no-oping.',\n },\n edits: {\n type: \"string\",\n description:\n 'Preferred optional JSON array of granular edit operations. Examples: { \"op\": \"insert-after\", \"marker\": \"<!-- section:metrics -->\", \"content\": \"...\" }, { \"op\": \"replace-section\", \"section\": \"npm-chart\", \"content\": \"...\" }, { \"op\": \"wrap-section\", \"section\": \"charts\", \"before\": \"<div>\", \"after\": \"</div>\" }, { \"op\": \"regex-replace\", \"pattern\": \"...\", \"replace\": \"...\", \"expectedMatches\": 1 }.',\n },\n format: {\n type: \"boolean\",\n description:\n \"When true, format the final extension HTML with Prettier after applying content, patches, and edits.\",\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n visibility: {\n type: \"string\",\n description: \"Optional sharing visibility.\",\n enum: [\"private\", \"org\", \"public\"],\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n\n let result = null;\n const hasContentUpdate =\n args?.content !== undefined ||\n args?.patches !== undefined ||\n args?.edits !== undefined ||\n args?.format !== undefined;\n if (hasContentUpdate) {\n const patches = parsePatches((args as any).patches);\n if (args?.patches !== undefined && !patches) {\n return \"Error: patches must be a JSON array of { find, replace } objects.\";\n }\n const edits = parseEdits((args as any).edits);\n if (args?.edits !== undefined && !edits) {\n return \"Error: edits must be a JSON array of supported extension edit operations.\";\n }\n result = await updateExtensionContent(id, {\n content:\n args?.content !== undefined ? String(args.content) : undefined,\n patches,\n edits,\n format: coerceBoolean(args?.format),\n });\n }\n\n const meta: Record<string, string> = {};\n if (args?.name !== undefined) meta.name = String(args.name).trim();\n if (args?.description !== undefined) {\n meta.description = String(args.description).trim();\n }\n if (args?.icon !== undefined) meta.icon = String(args.icon);\n if (args?.visibility !== undefined) {\n meta.visibility = String(args.visibility);\n }\n if (Object.keys(meta).length > 0) {\n result = await updateExtension(id, meta as any);\n }\n\n if (!result) result = await getExtension(id);\n if (!result) return `Error: extension not found: ${id}`;\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n extension: await summarizeExtension(result, hiddenIds, false),\n };\n },\n },\n\n \"delete-extension\": {\n tool: {\n description:\n \"Permanently delete an extension everywhere it is shared. Requires owner/admin access. If the user only wants a shared extension removed from their own sidebar/list, use hide-extension instead.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to permanently delete. Use list-extensions first if you only know the display name.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n\n try {\n const ok = await deleteExtension(id);\n if (!ok) return `Error: extension not found: ${id}`;\n return { ok: true, deleted: summarizeDeletedExtension(extension) };\n } catch (err: any) {\n return {\n ok: false,\n error: err?.message ?? String(err),\n next: \"If the user wants this gone only from their own view, call hide-extension with the same id.\",\n };\n }\n },\n },\n\n \"restore-extension-history-version\": {\n tool: {\n description:\n \"Restore an extension's name, description, icon, and HTML content from a saved history version. Requires editor access. This does not restore sharing visibility or ownership.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id to restore.\",\n },\n version: {\n type: \"number\",\n description:\n \"Saved history version number to restore. Use list-extension-history first if unsure.\",\n },\n },\n required: [\"id\", \"version\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const version = Number(args?.version);\n if (!Number.isInteger(version) || version < 1) {\n return \"Error: version must be a positive integer.\";\n }\n const result = await restoreExtensionHistoryVersion(id, version);\n if (!result) {\n return `Error: extension history version not found: ${id}#${version}`;\n }\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n restoredVersion: version,\n extension: await summarizeExtension(result, hiddenIds, false),\n };\n },\n },\n\n \"hide-extension\": {\n tool: {\n description:\n \"Hide an accessible extension from the current user's Extensions list/sidebar without deleting it for anyone else. Use this when the user says to remove a shared extension from their view, or when delete-extension reports that the current user is not owner/admin.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to hide for the current user. Use list-extensions first if you only know the display name.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n\n await hideExtension(id);\n return { ok: true, hidden: summarizeDeletedExtension(extension) };\n },\n },\n\n \"unhide-extension\": {\n tool: {\n description:\n \"Restore an extension the current user previously hid so it appears in their Extensions list/sidebar again. Use list-extensions with includeHidden=true to find hidden ids.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id to restore for the current user.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n await unhideExtension(id);\n return { ok: true, id };\n },\n },\n\n \"add-extension-slot-target\": {\n tool: {\n description:\n 'Declare that an extension can render in a UI extension-point slot of an app (e.g. \"mail.contact-sidebar.bottom\"). Apps drop ExtensionSlot components in their UI; this action registers an extension as installable into one of those slots. Slot IDs follow the convention <app>.<area>.<position>. Caller must have editor access to the extension.',\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with slot-specific config (defaults, hints, etc.).\",\n },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const row = await addExtensionSlotTarget(\n extensionId,\n slotId,\n args?.config ? String(args.config) : undefined,\n );\n return { ok: true, slot: row };\n },\n },\n\n \"install-extension\": {\n tool: {\n description:\n \"Install an extension as a widget in an extension-point slot for the current user. The extension must already declare the slot via add-extension-slot-target. Per-user installation — only affects the calling user's view. Use after creating an extension that targets a slot, or when the user asks to add an existing widget to a slot.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: {\n type: \"string\",\n description: \"Extension id to install.\",\n },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n position: {\n type: \"number\",\n description:\n \"Optional integer position within the slot (lower = earlier). Defaults to end.\",\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with per-install config (overrides, settings).\",\n },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const position =\n args?.position !== undefined && args.position !== null\n ? Number(args.position)\n : undefined;\n const row = await installExtensionSlot(extensionId, slotId, {\n position: Number.isFinite(position as number) ? position : undefined,\n config: args?.config ? String(args.config) : undefined,\n });\n return { ok: true, install: row };\n },\n },\n\n \"uninstall-extension\": {\n tool: {\n description:\n \"Remove an extension from an extension-point slot for the current user. Does not delete the extension itself.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n await uninstallExtensionSlot(extensionId, slotId);\n return { ok: true };\n },\n },\n\n \"list-extensions-for-slot\": {\n tool: {\n description:\n \"List extensions the current user has access to that declare a given extension-point slot. Use to discover what's available to install into a slot the user mentioned.\",\n parameters: {\n type: \"object\",\n properties: {\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"slotId\"],\n },\n },\n run: async (args) => {\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!slotId) return \"Error: slotId is required.\";\n return { extensions: await listExtensionsForSlot(slotId) };\n },\n readOnly: true,\n },\n\n \"list-extension-slots\": {\n tool: {\n description:\n \"List the extension-point slots a specific extension declares it can render in. Caller must have viewer access to the extension.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n },\n required: [\"extensionId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n return { slots: await listSlotsForExtension(extensionId) };\n },\n readOnly: true,\n },\n };\n}\n\nasync function summarizeExtension(\n row: ExtensionRow,\n hiddenIds: Set<string>,\n includeContent: boolean,\n) {\n const access = await resolveAccess(\"extension\", row.id).catch(() => null);\n return {\n id: row.id,\n name: row.name,\n path: extensionPath(row.id, row.name),\n description: row.description,\n icon: row.icon,\n ownerEmail: row.ownerEmail,\n visibility: row.visibility,\n role: access?.role ?? null,\n canEdit: access\n ? [\"owner\", \"admin\", \"editor\"].includes(access.role)\n : false,\n canDelete: access ? [\"owner\", \"admin\"].includes(access.role) : false,\n hidden: hiddenIds.has(row.id),\n createdAt: row.createdAt,\n updatedAt: row.updatedAt,\n ...(includeContent ? { content: row.content } : {}),\n };\n}\n\nfunction summarizeDeletedExtension(row: ExtensionRow) {\n return {\n id: row.id,\n name: row.name,\n ownerEmail: row.ownerEmail,\n visibility: row.visibility,\n };\n}\n\nfunction coerceBoolean(value: unknown): boolean {\n return value === true || value === \"true\";\n}\n\nfunction coerceLimit(value: unknown): number {\n const limit = Number(value ?? 100);\n if (!Number.isFinite(limit)) return 100;\n return Math.min(Math.max(1, Math.floor(limit)), 500);\n}\n\nfunction parsePatches(value: unknown): ExtensionLegacyPatch[] | undefined {\n if (value === undefined) return undefined;\n const parsed = typeof value === \"string\" ? JSON.parse(value) : value;\n if (!Array.isArray(parsed)) return undefined;\n if (\n parsed.some(\n (patch) =>\n !patch ||\n typeof patch.find !== \"string\" ||\n typeof patch.replace !== \"string\",\n )\n ) {\n return undefined;\n }\n return parsed;\n}\n\nfunction parseEdits(value: unknown): ExtensionContentEdit[] | undefined {\n if (value === undefined) return undefined;\n const parsed = typeof value === \"string\" ? JSON.parse(value) : value;\n if (!Array.isArray(parsed)) return undefined;\n return parsed.every(isValidContentEdit)\n ? (parsed as ExtensionContentEdit[])\n : undefined;\n}\n\nfunction isValidContentEdit(value: unknown): boolean {\n if (!value || typeof value !== \"object\") return false;\n const edit = value as Record<string, unknown>;\n const op = edit.op ?? \"replace\";\n if (typeof op !== \"string\") return false;\n\n switch (op) {\n case \"replace\":\n return typeof edit.find === \"string\" && typeof edit.replace === \"string\";\n case \"insert-before\":\n case \"insert-after\":\n return (\n typeof edit.marker === \"string\" && typeof edit.content === \"string\"\n );\n case \"replace-between\":\n return (\n typeof edit.start === \"string\" &&\n typeof edit.end === \"string\" &&\n typeof edit.content === \"string\"\n );\n case \"replace-section\":\n return (\n typeof edit.section === \"string\" && typeof edit.content === \"string\"\n );\n case \"wrap-section\":\n return (\n typeof edit.section === \"string\" &&\n typeof edit.before === \"string\" &&\n typeof edit.after === \"string\"\n );\n case \"remove-section\":\n return typeof edit.section === \"string\";\n case \"regex-replace\":\n return (\n typeof edit.pattern === \"string\" && typeof edit.replace === \"string\"\n );\n default:\n return false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"actions.js","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OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACrE,CAAC;QACJ,KAAK,cAAc;YACjB,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;gBAChC,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAC/B,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAC/B,CAAC;QACJ,KAAK,gBAAgB;YACnB,OAAO,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC;QAC1C,KAAK,eAAe;YAClB,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CACrE,CAAC;QACJ;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["import type { ActionEntry } from \"../agent/production-agent.js\";\nimport { writeAppState } from \"../application-state/script-helpers.js\";\nimport {\n createExtension,\n deleteExtension,\n getHiddenExtensionIdsForCurrentUser,\n getExtension,\n getExtensionHistoryVersion,\n globalHideExtension,\n globalUnhideExtension,\n hideExtension,\n listExtensionHistory,\n listExtensions,\n restoreExtensionHistoryVersion,\n unhideExtension,\n updateExtension,\n updateExtensionContent,\n type ExtensionRow,\n} from \"./store.js\";\nimport { resolveAccess } from \"../sharing/access.js\";\nimport {\n addExtensionSlotTarget,\n installExtensionSlot,\n uninstallExtensionSlot,\n listExtensionsForSlot,\n listSlotsForExtension,\n} from \"./slots/store.js\";\nimport { extensionPath } from \"./path.js\";\nimport type {\n ExtensionContentEdit,\n ExtensionLegacyPatch,\n} from \"./content-patch.js\";\n\nexport function createExtensionActionEntries(): Record<string, ActionEntry> {\n return {\n \"list-extensions\": {\n tool: {\n description:\n \"List extensions visible in the current user's Extensions list/sidebar. Use this for browsing or when you only know a display name. If <current-screen> or <current-url> already contains extensionId for the current extension, use get-extension or update-extension with that id directly instead of listing. Do not query the legacy tools table directly for extension management.\",\n parameters: {\n type: \"object\",\n properties: {\n search: {\n type: \"string\",\n description:\n \"Optional case-insensitive filter matched against id, name, description, and owner email. Example: Connect Zoom.\",\n },\n includeHidden: {\n type: \"boolean\",\n description:\n \"Include extensions the current user has hidden from their list. Defaults to false.\",\n },\n includeGloballyHidden: {\n type: \"boolean\",\n description:\n \"Include extensions an admin/owner has globally hidden from everyone (via global-hide-extension). Defaults to false. Use this to find ids to unhide for everyone.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full Alpine.js content. Defaults to false to keep results concise.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum results to return. Defaults to 100.\",\n },\n },\n },\n },\n run: async (args) => {\n const includeHidden = coerceBoolean(args?.includeHidden);\n const includeGloballyHidden = coerceBoolean(\n args?.includeGloballyHidden,\n );\n const includeContent = coerceBoolean(args?.includeContent);\n const search = String(args?.search ?? \"\")\n .trim()\n .toLowerCase();\n const limit = coerceLimit(args?.limit);\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n\n let rows = await listExtensions({\n includeHidden,\n includeGloballyHidden,\n });\n if (search) {\n rows = rows.filter((row) =>\n [row.id, row.name, row.description, row.ownerEmail]\n .join(\"\\n\")\n .toLowerCase()\n .includes(search),\n );\n }\n\n rows = rows.slice(0, limit);\n const extensions = await Promise.all(\n rows.map((row) => summarizeExtension(row, hiddenIds, includeContent)),\n );\n return {\n ok: true,\n count: extensions.length,\n extensions,\n };\n },\n readOnly: true,\n },\n\n \"get-extension\": {\n tool: {\n description:\n \"Get one existing extension by id. Use this when <current-screen> or <current-url> contains extensionId for the current extension; do not call list-extensions just to rediscover that id. Defaults to including the full Alpine.js content so you can make a targeted update-extension edit.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to read. Prefer the extensionId from <current-screen> or <current-url> when the user refers to the current extension.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full Alpine.js content. Defaults to true for targeted edits.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const includeContent =\n args?.includeContent === undefined\n ? true\n : coerceBoolean(args.includeContent);\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n extension: await summarizeExtension(\n extension,\n hiddenIds,\n includeContent,\n ),\n };\n },\n readOnly: true,\n },\n\n \"list-extension-history\": {\n tool: {\n description:\n \"List saved history snapshots for one extension. Use this when the user asks what changed, wants a changelog, or wants to pick an older version to restore. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url>.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id whose history should be listed.\",\n },\n limit: {\n type: \"number\",\n description: \"Maximum versions to return. Defaults to 50.\",\n },\n includeContent: {\n type: \"boolean\",\n description:\n \"Include full HTML content for each version. Defaults to false.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const history = await listExtensionHistory(id, {\n limit:\n args?.limit === undefined ? undefined : coerceLimit(args.limit),\n includeContent: coerceBoolean(args?.includeContent),\n });\n return {\n ok: true,\n count: history.length,\n history,\n };\n },\n readOnly: true,\n },\n\n \"get-extension-history-version\": {\n tool: {\n description:\n \"Get one extension history version with its previous-version diff. Use after list-extension-history when the user wants to inspect exactly what changed.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id whose history version should be read.\",\n },\n version: {\n type: \"number\",\n description: \"History version number to inspect.\",\n },\n },\n required: [\"id\", \"version\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const version = Number(args?.version);\n if (!Number.isInteger(version) || version < 1) {\n return \"Error: version must be a positive integer.\";\n }\n const detail = await getExtensionHistoryVersion(id, version);\n if (!detail) {\n return `Error: extension history version not found: ${id}#${version}`;\n }\n return { ok: true, ...detail };\n },\n readOnly: true,\n },\n\n \"create-extension\": {\n tool: {\n description:\n \"Create a sandboxed Alpine.js mini-app extension. Use this when the user asks to create, build, or make an extension/widget/dashboard/calculator. Call this action exactly once per requested extension. The content must be a self-contained Alpine.js HTML body snippet that can use appAction(), appFetch(), dbQuery(), dbExec(), extensionFetch(), and extensionData. Prefer appAction(name, params) for app data and actions, including read actions mounted as GET; do not call template /api/* routes from appFetch because the extension bridge only allows framework /_agent-native/* paths. Parse JSON string action results before aggregating; use dbQuery()/dbExec() only for known existing SQL tables. Keep the initial create-extension payload compact and working; for complex extensions, create a useful v1 first, then use focused update-extension edits for refinements rather than assembling one enormous tool input. For any non-trivial component (more than a couple of state fields, any methods, any string formatting, any branching) put the component in a <script> block via Alpine.data('name', () => ({...})) and reference it with x-data=\\\"name\\\" — do NOT cram methods, template literals, or branching logic into an inline x-data=\\\"{...}\\\" attribute (HTML parser pitfalls cause ReferenceError failures). Define every variable referenced from x-text/x-show/x-if/x-for on the data object's initial state. If the extension's value depends on an LLM call, require a real key via \\\\${keys.OPENAI_API_KEY}/\\\\${keys.ANTHROPIC_API_KEY} (and tell the user to add it in Settings → Secrets if missing) or route the AI work to the agent chat — never ship a stubbed analysis step that renders a placeholder/boolean as the result.\",\n parameters: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description:\n 'Short display name for the extension. Do not include \"app\" — e.g. name a todo app \"Todos\", a weather app \"Weather\".',\n },\n description: {\n type: \"string\",\n description: \"One-sentence summary of what the extension does.\",\n },\n content: {\n type: \"string\",\n description:\n \"Self-contained Alpine.js HTML body snippet. The iframe canvas already has modest default padding, so avoid duplicate outer padding unless the design needs it. Use semantic Tailwind colors (bg-background, text-foreground, bg-primary, etc.) for native theming. Do not include a full app build, React code, or source files.\",\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n },\n required: [\"name\", \"content\"],\n },\n },\n run: async (args) => {\n const name = String(args?.name ?? \"\").trim();\n const content = String(args?.content ?? \"\").trim();\n if (!name) return \"Error: name is required.\";\n if (!content) return \"Error: content is required.\";\n\n const extension = await createExtension({\n name,\n description: String(args?.description ?? \"\").trim(),\n content,\n icon: args?.icon ? String(args.icon) : undefined,\n });\n const path = extensionPath(extension.id, extension.name);\n\n // Auto-navigate so the user lands on the new extension instead of\n // having to read the JSON response and click a link. Writes a\n // one-shot `navigate` app-state command the UI consumes and clears.\n try {\n await writeAppState(\"navigate\", {\n view: \"extensions\",\n extensionId: extension.id,\n path,\n // Unique-per-write token so the UI's `use-navigation-state` hook\n // can dedup race-driven re-reads of the same command.\n _writeId: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n });\n } catch {\n // Non-fatal — agent can still mention the path in its reply.\n }\n\n return {\n ok: true,\n extension: { ...extension, path },\n path,\n next: `Created. The user is being navigated to the new extension automatically — no further navigation tool calls needed.`,\n };\n },\n },\n\n \"update-extension\": {\n tool: {\n description:\n \"Update an existing sandboxed Alpine.js mini-app extension. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url> directly; do not list extensions first just to find the current id. Prefer granular edits for surgical changes; use full content replacement only for broad rewrites. Supported edits include literal replace, insert-before/after marker, replace-between markers, replace-section/wrap-section/remove-section for <!-- agent-native:section name --> blocks, and regex-replace. Pass format=true to run Prettier on the final HTML.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to update. Prefer the extensionId from <current-screen> or <current-url> for the current extension.\",\n },\n name: {\n type: \"string\",\n description: \"Optional new display name.\",\n },\n description: {\n type: \"string\",\n description: \"Optional new description.\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional full replacement Alpine.js HTML body snippet.\",\n },\n patches: {\n type: \"string\",\n description:\n 'Legacy optional JSON array of { \"find\": \"...\", \"replace\": \"...\", \"all\"?: true, \"expectedMatches\"?: 1, \"required\"?: true } patches. Missing required targets fail instead of silently no-oping.',\n },\n edits: {\n type: \"string\",\n description:\n 'Preferred optional JSON array of granular edit operations. Examples: { \"op\": \"insert-after\", \"marker\": \"<!-- section:metrics -->\", \"content\": \"...\" }, { \"op\": \"replace-section\", \"section\": \"npm-chart\", \"content\": \"...\" }, { \"op\": \"wrap-section\", \"section\": \"charts\", \"before\": \"<div>\", \"after\": \"</div>\" }, { \"op\": \"regex-replace\", \"pattern\": \"...\", \"replace\": \"...\", \"expectedMatches\": 1 }.',\n },\n format: {\n type: \"boolean\",\n description:\n \"When true, format the final extension HTML with Prettier after applying content, patches, and edits.\",\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n visibility: {\n type: \"string\",\n description: \"Optional sharing visibility.\",\n enum: [\"private\", \"org\", \"public\"],\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n\n let result = null;\n const hasContentUpdate =\n args?.content !== undefined ||\n args?.patches !== undefined ||\n args?.edits !== undefined ||\n args?.format !== undefined;\n if (hasContentUpdate) {\n const patches = parsePatches((args as any).patches);\n if (args?.patches !== undefined && !patches) {\n return \"Error: patches must be a JSON array of { find, replace } objects.\";\n }\n const edits = parseEdits((args as any).edits);\n if (args?.edits !== undefined && !edits) {\n return \"Error: edits must be a JSON array of supported extension edit operations.\";\n }\n result = await updateExtensionContent(id, {\n content:\n args?.content !== undefined ? String(args.content) : undefined,\n patches,\n edits,\n format: coerceBoolean(args?.format),\n });\n }\n\n const meta: Record<string, string> = {};\n if (args?.name !== undefined) meta.name = String(args.name).trim();\n if (args?.description !== undefined) {\n meta.description = String(args.description).trim();\n }\n if (args?.icon !== undefined) meta.icon = String(args.icon);\n if (args?.visibility !== undefined) {\n meta.visibility = String(args.visibility);\n }\n if (Object.keys(meta).length > 0) {\n result = await updateExtension(id, meta as any);\n }\n\n if (!result) result = await getExtension(id);\n if (!result) return `Error: extension not found: ${id}`;\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n extension: await summarizeExtension(result, hiddenIds, false),\n };\n },\n },\n\n \"delete-extension\": {\n tool: {\n description:\n \"Permanently delete an extension everywhere it is shared. Requires owner/admin access. If the user only wants a shared extension removed from their own sidebar/list, use hide-extension instead.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to permanently delete. Use list-extensions first if you only know the display name.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n\n try {\n const ok = await deleteExtension(id);\n if (!ok) return `Error: extension not found: ${id}`;\n return { ok: true, deleted: summarizeDeletedExtension(extension) };\n } catch (err: any) {\n return {\n ok: false,\n error: err?.message ?? String(err),\n next: \"If the user wants this gone only from their own view, call hide-extension with the same id.\",\n };\n }\n },\n },\n\n \"restore-extension-history-version\": {\n tool: {\n description:\n \"Restore an extension's name, description, icon, and HTML content from a saved history version. Requires editor access. This does not restore sharing visibility or ownership.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id to restore.\",\n },\n version: {\n type: \"number\",\n description:\n \"Saved history version number to restore. Use list-extension-history first if unsure.\",\n },\n },\n required: [\"id\", \"version\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const version = Number(args?.version);\n if (!Number.isInteger(version) || version < 1) {\n return \"Error: version must be a positive integer.\";\n }\n const result = await restoreExtensionHistoryVersion(id, version);\n if (!result) {\n return `Error: extension history version not found: ${id}#${version}`;\n }\n const hiddenIds = await getHiddenExtensionIdsForCurrentUser();\n return {\n ok: true,\n restoredVersion: version,\n extension: await summarizeExtension(result, hiddenIds, false),\n };\n },\n },\n\n \"hide-extension\": {\n tool: {\n description:\n \"Hide an accessible extension from the current user's Extensions list/sidebar without deleting it for anyone else. Use this when the user says to remove a shared extension from their view, or when delete-extension reports that the current user is not owner/admin.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to hide for the current user. Use list-extensions first if you only know the display name.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n\n await hideExtension(id);\n return { ok: true, hidden: summarizeDeletedExtension(extension) };\n },\n },\n\n \"unhide-extension\": {\n tool: {\n description:\n \"Restore an extension the current user previously hid so it appears in their Extensions list/sidebar again. Use list-extensions with includeHidden=true to find hidden ids.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id to restore for the current user.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n await unhideExtension(id);\n return { ok: true, id };\n },\n },\n\n \"global-hide-extension\": {\n tool: {\n description:\n \"Globally hide an extension from EVERYONE's Extensions list/sidebar (not just the current user) by stamping it hidden. Requires owner/admin access. Use this for an admin takedown of a shared/org extension. The extension is not deleted and stays accessible by id; use global-unhide-extension to reverse. For removing an extension only from your own view, use hide-extension instead.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description:\n \"Extension id to hide for everyone. Use list-extensions first if you only know the display name.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n const extension = await getExtension(id);\n if (!extension) return `Error: extension not found: ${id}`;\n\n await globalHideExtension(id);\n return {\n ok: true,\n globallyHidden: summarizeDeletedExtension(extension),\n };\n },\n },\n\n \"global-unhide-extension\": {\n tool: {\n description:\n \"Reverse a global hide so the extension reappears in everyone's Extensions list/sidebar again. Requires owner/admin access. Use list-extensions with includeGloballyHidden=true to find globally-hidden ids.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Extension id to unhide for everyone.\",\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n await globalUnhideExtension(id);\n return { ok: true, id };\n },\n },\n\n \"add-extension-slot-target\": {\n tool: {\n description:\n 'Declare that an extension can render in a UI extension-point slot of an app (e.g. \"mail.contact-sidebar.bottom\"). Apps drop ExtensionSlot components in their UI; this action registers an extension as installable into one of those slots. Slot IDs follow the convention <app>.<area>.<position>. Caller must have editor access to the extension.',\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with slot-specific config (defaults, hints, etc.).\",\n },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const row = await addExtensionSlotTarget(\n extensionId,\n slotId,\n args?.config ? String(args.config) : undefined,\n );\n return { ok: true, slot: row };\n },\n },\n\n \"install-extension\": {\n tool: {\n description:\n \"Install an extension as a widget in an extension-point slot for the current user. The extension must already declare the slot via add-extension-slot-target. Per-user installation — only affects the calling user's view. Use after creating an extension that targets a slot, or when the user asks to add an existing widget to a slot.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: {\n type: \"string\",\n description: \"Extension id to install.\",\n },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n position: {\n type: \"number\",\n description:\n \"Optional integer position within the slot (lower = earlier). Defaults to end.\",\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with per-install config (overrides, settings).\",\n },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const position =\n args?.position !== undefined && args.position !== null\n ? Number(args.position)\n : undefined;\n const row = await installExtensionSlot(extensionId, slotId, {\n position: Number.isFinite(position as number) ? position : undefined,\n config: args?.config ? String(args.config) : undefined,\n });\n return { ok: true, install: row };\n },\n },\n\n \"uninstall-extension\": {\n tool: {\n description:\n \"Remove an extension from an extension-point slot for the current user. Does not delete the extension itself.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"extensionId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n await uninstallExtensionSlot(extensionId, slotId);\n return { ok: true };\n },\n },\n\n \"list-extensions-for-slot\": {\n tool: {\n description:\n \"List extensions the current user has access to that declare a given extension-point slot. Use to discover what's available to install into a slot the user mentioned.\",\n parameters: {\n type: \"object\",\n properties: {\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"slotId\"],\n },\n },\n run: async (args) => {\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!slotId) return \"Error: slotId is required.\";\n return { extensions: await listExtensionsForSlot(slotId) };\n },\n readOnly: true,\n },\n\n \"list-extension-slots\": {\n tool: {\n description:\n \"List the extension-point slots a specific extension declares it can render in. Caller must have viewer access to the extension.\",\n parameters: {\n type: \"object\",\n properties: {\n extensionId: { type: \"string\", description: \"Extension id.\" },\n },\n required: [\"extensionId\"],\n },\n },\n run: async (args) => {\n const extensionId = String(args?.extensionId ?? \"\").trim();\n if (!extensionId) return \"Error: extensionId is required.\";\n return { slots: await listSlotsForExtension(extensionId) };\n },\n readOnly: true,\n },\n };\n}\n\nasync function summarizeExtension(\n row: ExtensionRow,\n hiddenIds: Set<string>,\n includeContent: boolean,\n) {\n const access = await resolveAccess(\"extension\", row.id).catch(() => null);\n return {\n id: row.id,\n name: row.name,\n path: extensionPath(row.id, row.name),\n description: row.description,\n icon: row.icon,\n ownerEmail: row.ownerEmail,\n visibility: row.visibility,\n role: access?.role ?? null,\n canEdit: access\n ? [\"owner\", \"admin\", \"editor\"].includes(access.role)\n : false,\n canDelete: access ? [\"owner\", \"admin\"].includes(access.role) : false,\n hidden: hiddenIds.has(row.id),\n globallyHidden: row.hiddenAt != null,\n hiddenAt: row.hiddenAt,\n hiddenBy: row.hiddenBy,\n createdAt: row.createdAt,\n updatedAt: row.updatedAt,\n ...(includeContent ? { content: row.content } : {}),\n };\n}\n\nfunction summarizeDeletedExtension(row: ExtensionRow) {\n return {\n id: row.id,\n name: row.name,\n ownerEmail: row.ownerEmail,\n visibility: row.visibility,\n };\n}\n\nfunction coerceBoolean(value: unknown): boolean {\n return value === true || value === \"true\";\n}\n\nfunction coerceLimit(value: unknown): number {\n const limit = Number(value ?? 100);\n if (!Number.isFinite(limit)) return 100;\n return Math.min(Math.max(1, Math.floor(limit)), 500);\n}\n\nfunction parsePatches(value: unknown): ExtensionLegacyPatch[] | undefined {\n if (value === undefined) return undefined;\n const parsed = typeof value === \"string\" ? JSON.parse(value) : value;\n if (!Array.isArray(parsed)) return undefined;\n if (\n parsed.some(\n (patch) =>\n !patch ||\n typeof patch.find !== \"string\" ||\n typeof patch.replace !== \"string\",\n )\n ) {\n return undefined;\n }\n return parsed;\n}\n\nfunction parseEdits(value: unknown): ExtensionContentEdit[] | undefined {\n if (value === undefined) return undefined;\n const parsed = typeof value === \"string\" ? JSON.parse(value) : value;\n if (!Array.isArray(parsed)) return undefined;\n return parsed.every(isValidContentEdit)\n ? (parsed as ExtensionContentEdit[])\n : undefined;\n}\n\nfunction isValidContentEdit(value: unknown): boolean {\n if (!value || typeof value !== \"object\") return false;\n const edit = value as Record<string, unknown>;\n const op = edit.op ?? \"replace\";\n if (typeof op !== \"string\") return false;\n\n switch (op) {\n case \"replace\":\n return typeof edit.find === \"string\" && typeof edit.replace === \"string\";\n case \"insert-before\":\n case \"insert-after\":\n return (\n typeof edit.marker === \"string\" && typeof edit.content === \"string\"\n );\n case \"replace-between\":\n return (\n typeof edit.start === \"string\" &&\n typeof edit.end === \"string\" &&\n typeof edit.content === \"string\"\n );\n case \"replace-section\":\n return (\n typeof edit.section === \"string\" && typeof edit.content === \"string\"\n );\n case \"wrap-section\":\n return (\n typeof edit.section === \"string\" &&\n typeof edit.before === \"string\" &&\n typeof edit.after === \"string\"\n );\n case \"remove-section\":\n return typeof edit.section === \"string\";\n case \"regex-replace\":\n return (\n typeof edit.pattern === \"string\" && typeof edit.replace === \"string\"\n );\n default:\n return false;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/extensions/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/extensions/routes.ts"],"names":[],"mappings":"AAwDA,wBAAgB,uBAAuB,2FAuCtC"}
|