@intelligo-dev/cli 1.0.0-beta.13 → 1.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +65 -2
  2. package/dist/args.d.ts +10 -0
  3. package/dist/args.d.ts.map +1 -0
  4. package/dist/args.js +20 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/bin.js +103 -22
  7. package/dist/bin.js.map +1 -1
  8. package/dist/commands/add.d.ts +4 -0
  9. package/dist/commands/add.d.ts.map +1 -1
  10. package/dist/commands/add.js +28 -2
  11. package/dist/commands/add.js.map +1 -1
  12. package/dist/commands/create-flow.d.ts +8 -1
  13. package/dist/commands/create-flow.d.ts.map +1 -1
  14. package/dist/commands/create-flow.js +101 -34
  15. package/dist/commands/create-flow.js.map +1 -1
  16. package/dist/commands/create.d.ts +24 -4
  17. package/dist/commands/create.d.ts.map +1 -1
  18. package/dist/commands/create.js +57 -14
  19. package/dist/commands/create.js.map +1 -1
  20. package/dist/commands/doctor.d.ts +2 -0
  21. package/dist/commands/doctor.d.ts.map +1 -1
  22. package/dist/commands/doctor.js +123 -35
  23. package/dist/commands/doctor.js.map +1 -1
  24. package/dist/commands/migrate-check.d.ts +20 -1
  25. package/dist/commands/migrate-check.d.ts.map +1 -1
  26. package/dist/commands/migrate-check.js +35 -6
  27. package/dist/commands/migrate-check.js.map +1 -1
  28. package/dist/commands/migrate.d.ts.map +1 -1
  29. package/dist/commands/migrate.js +2 -8
  30. package/dist/commands/migrate.js.map +1 -1
  31. package/dist/commands/sync-messages.d.ts +37 -0
  32. package/dist/commands/sync-messages.d.ts.map +1 -0
  33. package/dist/commands/sync-messages.js +88 -0
  34. package/dist/commands/sync-messages.js.map +1 -0
  35. package/dist/commands/sync-scaffold.d.ts +36 -0
  36. package/dist/commands/sync-scaffold.d.ts.map +1 -0
  37. package/dist/commands/sync-scaffold.js +53 -0
  38. package/dist/commands/sync-scaffold.js.map +1 -0
  39. package/dist/commands/sync.d.ts +109 -0
  40. package/dist/commands/sync.d.ts.map +1 -0
  41. package/dist/commands/sync.js +392 -0
  42. package/dist/commands/sync.js.map +1 -0
  43. package/dist/commands/upgrade-check.d.ts.map +1 -1
  44. package/dist/commands/upgrade-check.js +4 -1
  45. package/dist/commands/upgrade-check.js.map +1 -1
  46. package/dist/env-files.d.ts +11 -0
  47. package/dist/env-files.d.ts.map +1 -1
  48. package/dist/env-files.js +28 -9
  49. package/dist/env-files.js.map +1 -1
  50. package/dist/manifest.d.ts +27 -0
  51. package/dist/manifest.d.ts.map +1 -1
  52. package/dist/manifest.js +30 -3
  53. package/dist/manifest.js.map +1 -1
  54. package/dist/module-exports.d.ts +63 -0
  55. package/dist/module-exports.d.ts.map +1 -0
  56. package/dist/module-exports.js +231 -0
  57. package/dist/module-exports.js.map +1 -0
  58. package/dist/registry-bundle.d.ts +43 -0
  59. package/dist/registry-bundle.d.ts.map +1 -0
  60. package/dist/registry-bundle.js +74 -0
  61. package/dist/registry-bundle.js.map +1 -0
  62. package/dist/registry-items.d.ts +41 -13
  63. package/dist/registry-items.d.ts.map +1 -1
  64. package/dist/registry-items.js +117 -33
  65. package/dist/registry-items.js.map +1 -1
  66. package/package.json +1 -1
  67. package/src/args.ts +25 -0
  68. package/src/bin.ts +124 -22
  69. package/src/commands/add.ts +39 -12
  70. package/src/commands/create-flow.ts +119 -29
  71. package/src/commands/create.ts +82 -14
  72. package/src/commands/doctor.ts +156 -47
  73. package/src/commands/migrate-check.ts +51 -10
  74. package/src/commands/migrate.ts +2 -8
  75. package/src/commands/sync-messages.ts +114 -0
  76. package/src/commands/sync-scaffold.ts +83 -0
  77. package/src/commands/sync.ts +574 -0
  78. package/src/commands/upgrade-check.ts +4 -1
  79. package/src/env-files.ts +28 -7
  80. package/src/manifest.ts +57 -3
  81. package/src/module-exports.ts +266 -0
  82. package/src/registry-bundle.ts +103 -0
  83. package/src/registry-items.ts +141 -36
  84. package/templates/admin-page/admin-page.tsx.tpl +96 -24
  85. package/templates/app-scaffold/gitignore.tpl +25 -0
  86. package/templates/app-scaffold/intelligo.ts.tpl +6 -47
  87. package/templates/app-scaffold/next.config.mjs.tpl +31 -2
  88. package/templates/app-scaffold/package.json.tpl +2 -2
  89. package/templates/manifest.json +40 -3
  90. package/templates/pnpm-standalone/npmrc.tpl +6 -0
  91. package/templates/pnpm-standalone/pnpm-workspace.yaml.tpl +10 -0
  92. package/templates/registry/ai-agent-activity.json +23 -0
  93. package/templates/registry/ai-agent-progress.json +21 -0
  94. package/templates/registry/ai-approval-card.json +27 -0
  95. package/templates/registry/ai-artifact.json +22 -0
  96. package/templates/registry/ai-branch.json +21 -0
  97. package/templates/registry/ai-citations.json +24 -0
  98. package/templates/registry/ai-code-block.json +23 -0
  99. package/templates/registry/ai-composer-menu.json +19 -0
  100. package/templates/registry/ai-file-diff.json +25 -0
  101. package/templates/registry/ai-image-generation.json +23 -0
  102. package/templates/registry/ai-markdown.json +23 -0
  103. package/templates/registry/ai-message-bubble.json +23 -0
  104. package/templates/registry/ai-message-scroller.json +22 -0
  105. package/templates/registry/ai-message.json +21 -0
  106. package/templates/registry/ai-motion.json +19 -0
  107. package/templates/registry/ai-prompt-input.json +28 -0
  108. package/templates/registry/ai-reasoning-text.json +22 -0
  109. package/templates/registry/ai-reasoning.json +22 -0
  110. package/templates/registry/ai-shimmer-text.json +19 -0
  111. package/templates/registry/ai-sidebar.json +25 -0
  112. package/templates/registry/ai-speech-input.json +21 -0
  113. package/templates/registry/ai-streaming-response.json +24 -0
  114. package/templates/registry/ai-suggestion.json +19 -0
  115. package/templates/registry/ai-todo-list.json +22 -0
  116. package/templates/registry/ai-tool-approval.json +26 -0
  117. package/templates/registry/ai-tool-result.json +25 -0
  118. package/templates/registry/alert-dialog.json +23 -0
  119. package/templates/registry/animated-list.json +21 -0
  120. package/templates/registry/app-shell.json +93 -0
  121. package/templates/registry/artifacts.json +82 -0
  122. package/templates/registry/attachment.json +22 -0
  123. package/templates/registry/auth-email-verification.json +39 -0
  124. package/templates/registry/auth-login.json +72 -0
  125. package/templates/registry/auth-password-reset.json +53 -0
  126. package/templates/registry/auth-signup.json +41 -0
  127. package/templates/registry/billing-settings.json +66 -0
  128. package/templates/registry/button.json +22 -0
  129. package/templates/registry/chat-eve.json +19 -0
  130. package/templates/registry/chat-panel.json +30 -0
  131. package/templates/registry/chat-share.json +42 -0
  132. package/templates/registry/chat-widget.json +34 -0
  133. package/templates/registry/chat.json +326 -0
  134. package/templates/registry/checkbox.json +22 -0
  135. package/templates/registry/checkout.json +40 -0
  136. package/templates/registry/collapsible.json +19 -0
  137. package/templates/registry/command.json +23 -0
  138. package/templates/registry/copy-button.json +21 -0
  139. package/templates/registry/dashboard.json +69 -0
  140. package/templates/registry/dialog.json +24 -0
  141. package/templates/registry/document-viewer.json +22 -0
  142. package/templates/registry/dropdown-menu.json +23 -0
  143. package/templates/registry/expandable-tabs.json +22 -0
  144. package/templates/registry/feature-gating.json +73 -0
  145. package/templates/registry/file-upload.json +24 -0
  146. package/templates/registry/hold-action-button.json +22 -0
  147. package/templates/registry/input-group.json +23 -0
  148. package/templates/registry/input.json +19 -0
  149. package/templates/registry/intelligo.json +187 -0
  150. package/templates/registry/invitation-accept.json +64 -0
  151. package/templates/registry/language-switcher.json +29 -0
  152. package/templates/registry/morphing-modal.json +24 -0
  153. package/templates/registry/notification-stack.json +24 -0
  154. package/templates/registry/notifications.json +87 -0
  155. package/templates/registry/onboarding.json +83 -0
  156. package/templates/registry/otp-input.json +22 -0
  157. package/templates/registry/page-header.json +15 -0
  158. package/templates/registry/payment-poll.json +58 -0
  159. package/templates/registry/popover-morph.json +22 -0
  160. package/templates/registry/popover.json +22 -0
  161. package/templates/registry/pricing.json +117 -0
  162. package/templates/registry/privacy-settings.json +65 -0
  163. package/templates/registry/profile-settings.json +68 -0
  164. package/templates/registry/progress.json +19 -0
  165. package/templates/registry/radio-group.json +22 -0
  166. package/templates/registry/registry.json +2960 -0
  167. package/templates/registry/route-error.json +65 -0
  168. package/templates/registry/select-morph.json +23 -0
  169. package/templates/registry/select.json +23 -0
  170. package/templates/registry/settings-shell.json +47 -0
  171. package/templates/registry/sheet.json +24 -0
  172. package/templates/registry/sidebar.json +28 -0
  173. package/templates/registry/smoke.json +34 -0
  174. package/templates/registry/spinner.json +16 -0
  175. package/templates/registry/stat-card.json +18 -0
  176. package/templates/registry/status-badge.json +18 -0
  177. package/templates/registry/switch.json +20 -0
  178. package/templates/registry/tabs.json +23 -0
  179. package/templates/registry/team-settings.json +97 -0
  180. package/templates/registry/textarea.json +16 -0
  181. package/templates/registry/tooltip.json +22 -0
  182. package/templates/registry/trial-banner.json +43 -0
  183. package/templates/registry/usage.json +84 -0
  184. package/templates/registry/workspace-settings.json +71 -0
  185. package/templates/registry-items.json +3 -3
  186. package/templates/registry-requires.json +30 -4
  187. package/templates/vitest/server-only.ts.tpl +7 -0
  188. package/templates/vitest/vitest.config.ts.tpl +37 -0
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "chat-share",
4
+ "title": "Chat Share",
5
+ "description": "A conversation its owner published, readable by anyone with the link at /share/[id]: the same transcript, read-only, minus reasoning, tool details and attachments. Requires the chat item.",
6
+ "dependencies": [
7
+ "ai@^7.0.103",
8
+ "next-intl",
9
+ "@intelligo-dev/chat",
10
+ "@intelligo-dev/core"
11
+ ],
12
+ "registryDependencies": [
13
+ "@intelligo/button"
14
+ ],
15
+ "files": [
16
+ {
17
+ "path": "base/chat-share/page.tsx",
18
+ "content": "import type { Metadata } from \"next\";\nimport { notFound } from \"next/navigation\";\nimport { getTranslations } from \"next-intl/server\";\n\nimport { SharedConversation } from \"@/components/chat/shared-conversation\";\nimport { loadSharedConversation } from \"@/actions/chat-share\";\n\n/**\n * `/share/[id]` — a conversation its owner published, readable by\n * anyone with the link. Outside the `(app)` group on purpose: no\n * session, no workspace. `noindex`, so a link that leaks does not also\n * get crawled. Per-request, since sharing can be switched off.\n */\nexport const dynamic = \"force-dynamic\";\n\ninterface SharePageProps {\n params: Promise<{ id: string; locale: string }>;\n}\n\nexport async function generateMetadata({\n params,\n}: SharePageProps): Promise<Metadata> {\n const { id } = await params;\n const t = await getTranslations(\"chat-share\");\n const shared = await loadSharedConversation(id);\n return {\n title: shared?.title ?? t(\"title\"),\n robots: { index: false, follow: false },\n };\n}\n\nexport default async function SharePage({ params }: SharePageProps) {\n const { id } = await params;\n const shared = await loadSharedConversation(id);\n if (!shared) notFound();\n\n return (\n <SharedConversation\n conversationId={shared.id}\n title={shared.title}\n messages={shared.messages}\n />\n );\n}\n",
19
+ "type": "registry:page",
20
+ "target": "app/[locale]/share/[id]/page.tsx"
21
+ },
22
+ {
23
+ "path": "base/chat-share/actions.ts",
24
+ "content": "\"use server\";\n\n/**\n * The public read of a shared conversation. No actor: the reader is\n * anyone with the link. What they get is decided by `sanitizeForShare`\n * (`@intelligo-dev/chat`) — the transcript minus reasoning, tool\n * details, provider metadata, transient parts and file URLs. A product\n * that wants a named tool's output on the page passes a policy here.\n */\n\nimport { sanitizeForShare, toUIMessages } from \"@intelligo-dev/chat\";\nimport type { UIMessage } from \"ai\";\nimport {\n getPublicConversation,\n getPublicMessages,\n isConversationServiceError,\n} from \"@intelligo-dev/core/conversations\";\n\nexport type SharedConversation = {\n id: string;\n title: string | null;\n updatedAt: string;\n messages: UIMessage[];\n};\n\nexport async function loadSharedConversation(\n id: string\n): Promise<SharedConversation | null> {\n try {\n const conversation = await getPublicConversation(id);\n const rows = await getPublicMessages(id);\n return {\n id: conversation.id,\n title: conversation.title,\n updatedAt: conversation.updatedAt.toISOString(),\n messages: sanitizeForShare(toUIMessages(rows)),\n };\n } catch (error) {\n if (isConversationServiceError(error) && error.code === \"not_found\") {\n return null;\n }\n throw error;\n }\n}\n",
25
+ "type": "registry:file",
26
+ "target": "actions/chat-share.ts"
27
+ },
28
+ {
29
+ "path": "base/chat-share/components/shared-conversation.tsx",
30
+ "content": "\"use client\";\n\n/**\n * A shared conversation, read-only: the same message component the\n * chat page renders, with no composer, no actions and no edit. The\n * banner says what this is and offers the product.\n */\n\nimport { useTranslations } from \"next-intl\";\nimport type { UIMessage } from \"ai\";\n\nimport { MessageList } from \"@/components/chat/message-list\";\nimport { Button } from \"@/components/ui/button\";\nimport { Link } from \"@/i18n/navigation\";\n\ninterface SharedConversationProps {\n conversationId: string;\n title: string | null;\n messages: UIMessage[];\n}\n\nexport function SharedConversation({\n conversationId,\n title,\n messages,\n}: SharedConversationProps) {\n const t = useTranslations(\"chat-share\");\n\n return (\n <div className=\"flex h-dvh flex-col\">\n <header className=\"flex items-center justify-between gap-3 border-b px-4 py-3\">\n <div className=\"min-w-0\">\n <p className=\"text-xs text-muted-foreground\">{t(\"readOnly\")}</p>\n <h1 className=\"truncate text-sm font-medium\">\n {title ?? t(\"untitled\")}\n </h1>\n </div>\n <Button size=\"sm\" render={<Link href=\"/chat\" />} nativeButton={false}>\n {t(\"openApp\")}\n </Button>\n </header>\n <MessageList\n conversationId={conversationId}\n messages={messages}\n isStreaming={false}\n readOnly\n />\n </div>\n );\n}\n",
31
+ "type": "registry:component",
32
+ "target": "components/chat/shared-conversation.tsx"
33
+ },
34
+ {
35
+ "path": "base/chat-share/messages/en.json",
36
+ "content": "{\n \"title\": \"Shared conversation\",\n \"readOnly\": \"Shared conversation · read-only\",\n \"untitled\": \"Untitled conversation\",\n \"openApp\": \"Start your own\"\n}\n",
37
+ "type": "registry:file",
38
+ "target": "messages/en/chat-share.json"
39
+ }
40
+ ],
41
+ "type": "registry:block"
42
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "chat-widget",
4
+ "title": "Chat Widget",
5
+ "description": "The floating assistant: a launcher in a corner of every page and a compact chat over it, configured in lib/chat-widget-config.tsx. Requires the chat item.",
6
+ "dependencies": [
7
+ "lucide-react",
8
+ "next-intl"
9
+ ],
10
+ "registryDependencies": [
11
+ "@intelligo/button"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "base/chat-widget/components/chat-widget.tsx",
16
+ "content": "\"use client\";\n\n/**\n * The floating assistant: a launcher in a corner of every page and a\n * compact chat that opens over the page — the same thread the chat\n * page runs, in the widget variant. Mounted once in the app layout;\n * `lib/chat-widget-config.tsx` says where it sits, which agent it\n * runs as, and which routes hide it.\n *\n * Each open conversation is a real one, minted when the widget first\n * opens and kept for the page's lifetime. `body` on the component adds\n * per-page context to every turn; `chatWidgetConfig.body` adds the\n * product's.\n *\n * Installed from the `chat-widget` item; requires the `chat` item.\n */\n\nimport { Suspense, useState } from \"react\";\nimport { useTranslations } from \"next-intl\";\nimport { MessageSquareIcon, XIcon } from \"lucide-react\";\n\nimport { ChatThread } from \"@/components/chat/chat-thread\";\nimport { Button } from \"@/components/ui/button\";\nimport { usePathname } from \"@/i18n/navigation\";\nimport { chatWidgetConfig } from \"@/lib/chat-widget-config\";\nimport { cn } from \"@/lib/utils\";\n\ninterface ChatWidgetProps {\n /** Per-page context, merged over `chatWidgetConfig.body`. */\n body?: Record<string, unknown>;\n className?: string;\n}\n\nexport function ChatWidget({ body, className }: ChatWidgetProps) {\n const t = useTranslations(\"chat-widget\");\n const pathname = usePathname();\n const [open, setOpen] = useState(false);\n const [id] = useState(() => crypto.randomUUID());\n\n // Segment-aware: hiding on `/chat` must not hide it on `/chatbots`.\n const hidden = (chatWidgetConfig.hideOn ?? []).some(\n (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)\n );\n if (hidden) return null;\n\n const corner =\n chatWidgetConfig.position === \"bottom-left\"\n ? \"sm:right-auto sm:left-4\"\n : \"sm:left-auto sm:right-4\";\n const name = chatWidgetConfig.agent?.name ?? t(\"title\");\n\n return (\n <div\n className={cn(\n \"fixed inset-x-4 bottom-4 z-50 flex flex-col items-end gap-3\",\n corner,\n className\n )}\n >\n {open ? (\n <section\n role=\"dialog\"\n aria-label={name}\n className=\"flex h-128 max-h-dvh w-full flex-col overflow-hidden rounded-xl border bg-background shadow-lg sm:w-96\"\n >\n <header className=\"flex items-center justify-between gap-2 border-b px-3 py-2\">\n <span className=\"flex min-w-0 items-center gap-2 text-sm font-medium\">\n {chatWidgetConfig.agent?.icon ? (\n <span aria-hidden>{chatWidgetConfig.agent.icon}</span>\n ) : null}\n <span className=\"truncate\">{name}</span>\n </span>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t(\"close\")}\n onClick={() => setOpen(false)}\n >\n <XIcon />\n </Button>\n </header>\n <Suspense fallback={null}>\n <ChatThread\n conversationId={id}\n initialMessages={[]}\n variant=\"widget\"\n agentId={chatWidgetConfig.agent?.id}\n body={{ ...chatWidgetConfig.body, ...body }}\n autoFocus\n />\n </Suspense>\n </section>\n ) : null}\n <Button\n size=\"lg\"\n className=\"rounded-full shadow-lg\"\n aria-expanded={open}\n aria-label={open ? t(\"close\") : t(\"trigger\")}\n onClick={() => setOpen((value) => !value)}\n >\n {open ? <XIcon /> : <MessageSquareIcon />}\n <span className={open ? \"sr-only\" : undefined}>{t(\"trigger\")}</span>\n </Button>\n </div>\n );\n}\n",
17
+ "type": "registry:component",
18
+ "target": "components/chat/chat-widget.tsx"
19
+ },
20
+ {
21
+ "path": "base/chat-widget/lib/chat-widget-config.tsx",
22
+ "content": "/**\n * Chat widget config — the consumer-owned seam for the floating\n * assistant (composition through a config you own, never a\n * component edit).\n *\n * - `position`: which corner the launcher sits in.\n * - `agent`: which agent the widget's conversations run as, when it\n * differs from the chat page's (`chatConfig.agent`).\n * - `body`: sent with every turn — a static product context. For\n * per-page context pass `body` to `<ChatWidget>` where it mounts.\n * - `hideOn`: pathname prefixes where the launcher is not shown (the\n * chat page itself, auth pages).\n *\n * Mount the widget once, in your app layout:\n *\n * import { ChatWidget } from \"@/components/chat/chat-widget\";\n * …\n * <ChatWidget />\n */\n\nexport interface ChatWidgetConfig {\n position?: \"bottom-right\" | \"bottom-left\";\n agent?: { id?: string; name?: string; icon?: string };\n body?: Record<string, unknown>;\n hideOn?: string[];\n}\n\nexport const chatWidgetConfig: ChatWidgetConfig = {\n position: \"bottom-right\",\n hideOn: [\"/chat\", \"/login\", \"/signup\"],\n};\n",
23
+ "type": "registry:file",
24
+ "target": "lib/chat-widget-config.tsx"
25
+ },
26
+ {
27
+ "path": "base/chat-widget/messages/en.json",
28
+ "content": "{\n \"trigger\": \"Chat\",\n \"title\": \"Assistant\",\n \"close\": \"Close chat\"\n}\n",
29
+ "type": "registry:file",
30
+ "target": "messages/en/chat-widget.json"
31
+ }
32
+ ],
33
+ "type": "registry:block"
34
+ }