assistant-ui 0.0.105 → 0.0.107

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 (87) hide show
  1. package/README.md +2 -2
  2. package/dist/codemods/utils/createTransformer.d.ts +0 -1
  3. package/dist/codemods/utils/createTransformer.d.ts.map +1 -1
  4. package/dist/codemods/v0-11/content-part-to-message-part.d.ts.map +1 -1
  5. package/dist/codemods/v0-12/assistant-api-to-aui.d.ts.map +1 -1
  6. package/dist/codemods/v0-12/assistant-api-to-aui.js.map +1 -1
  7. package/dist/codemods/v0-12/event-names-to-camelcase.d.ts.map +1 -1
  8. package/dist/codemods/v0-12/primitive-if-to-aui-if.d.ts.map +1 -1
  9. package/dist/codemods/v0-8/ui-package-split.d.ts.map +1 -1
  10. package/dist/codemods/v0-8/ui-package-split.js.map +1 -1
  11. package/dist/codemods/v0-9/edge-package-split.d.ts.map +1 -1
  12. package/dist/commands/add.d.ts +1 -1
  13. package/dist/commands/add.d.ts.map +1 -1
  14. package/dist/commands/add.js +8 -5
  15. package/dist/commands/add.js.map +1 -1
  16. package/dist/commands/agent.d.ts +0 -1
  17. package/dist/commands/agent.d.ts.map +1 -1
  18. package/dist/commands/create.d.ts +0 -1
  19. package/dist/commands/create.d.ts.map +1 -1
  20. package/dist/commands/create.js +26 -8
  21. package/dist/commands/create.js.map +1 -1
  22. package/dist/commands/doctor.d.ts +0 -1
  23. package/dist/commands/doctor.d.ts.map +1 -1
  24. package/dist/commands/doctor.js +66 -29
  25. package/dist/commands/doctor.js.map +1 -1
  26. package/dist/commands/info.d.ts +3 -2
  27. package/dist/commands/info.d.ts.map +1 -1
  28. package/dist/commands/info.js +22 -26
  29. package/dist/commands/info.js.map +1 -1
  30. package/dist/commands/init.d.ts +1 -3
  31. package/dist/commands/init.d.ts.map +1 -1
  32. package/dist/commands/init.js +14 -24
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/commands/mcp.d.ts +0 -1
  35. package/dist/commands/mcp.d.ts.map +1 -1
  36. package/dist/commands/mcp.js +14 -4
  37. package/dist/commands/mcp.js.map +1 -1
  38. package/dist/commands/update.d.ts +0 -1
  39. package/dist/commands/update.d.ts.map +1 -1
  40. package/dist/commands/update.js +14 -1
  41. package/dist/commands/update.js.map +1 -1
  42. package/dist/commands/upgrade.d.ts +0 -1
  43. package/dist/commands/upgrade.d.ts.map +1 -1
  44. package/dist/index.d.ts +1 -1
  45. package/dist/lib/agent-skill.d.ts +0 -1
  46. package/dist/lib/agent-skill.d.ts.map +1 -1
  47. package/dist/lib/create-project.d.ts +7 -2
  48. package/dist/lib/create-project.d.ts.map +1 -1
  49. package/dist/lib/create-project.js +34 -17
  50. package/dist/lib/create-project.js.map +1 -1
  51. package/dist/lib/install-ai-sdk-lib.d.ts.map +1 -1
  52. package/dist/lib/install-edge-lib.d.ts.map +1 -1
  53. package/dist/lib/install-ui-lib.d.ts.map +1 -1
  54. package/dist/lib/run-spawn.d.ts.map +1 -1
  55. package/dist/lib/transform-options.d.ts.map +1 -1
  56. package/dist/lib/transform.d.ts +0 -1
  57. package/dist/lib/transform.d.ts.map +1 -1
  58. package/dist/lib/upgrade.d.ts +0 -1
  59. package/dist/lib/upgrade.d.ts.map +1 -1
  60. package/dist/lib/utils/config.d.ts.map +1 -1
  61. package/dist/lib/utils/file-scanner.d.ts.map +1 -1
  62. package/dist/lib/utils/logger.d.ts.map +1 -1
  63. package/dist/lib/utils/package-installer.d.ts.map +1 -1
  64. package/dist/lib/utils/package-manager.d.ts.map +1 -1
  65. package/dist/lib/utils/registry.d.ts +7 -0
  66. package/dist/lib/utils/registry.d.ts.map +1 -0
  67. package/dist/lib/utils/registry.js +25 -0
  68. package/dist/lib/utils/registry.js.map +1 -0
  69. package/dist/lib/utils/workspace.d.ts +6 -0
  70. package/dist/lib/utils/workspace.d.ts.map +1 -0
  71. package/dist/lib/utils/workspace.js +28 -0
  72. package/dist/lib/utils/workspace.js.map +1 -0
  73. package/dist/program.d.ts +0 -1
  74. package/dist/program.d.ts.map +1 -1
  75. package/package.json +12 -9
  76. package/plugin/skills/assistant-ui/SKILL.md +24 -5
  77. package/src/commands/add.ts +9 -4
  78. package/src/commands/create.ts +28 -8
  79. package/src/commands/doctor.ts +97 -44
  80. package/src/commands/info.ts +49 -42
  81. package/src/commands/init.ts +16 -24
  82. package/src/commands/mcp.ts +20 -5
  83. package/src/commands/update.ts +17 -1
  84. package/src/lib/create-project.ts +64 -20
  85. package/src/lib/utils/registry.test.ts +114 -0
  86. package/src/lib/utils/registry.ts +43 -0
  87. package/src/lib/utils/workspace.ts +34 -0
package/README.md CHANGED
@@ -27,7 +27,7 @@ npx assistant-ui@latest create my-app
27
27
  npx assistant-ui@latest create my-app --template minimal
28
28
 
29
29
  # scaffold from a feature example
30
- npx assistant-ui@latest create my-app --example with-ai-sdk-v6
30
+ npx assistant-ui@latest create my-app --example with-ai-sdk-v7
31
31
 
32
32
  # scaffold an Expo / React Native project
33
33
  npx assistant-ui@latest create my-app --native
@@ -58,7 +58,7 @@ npx assistant-ui info
58
58
 
59
59
  ## Templates
60
60
 
61
- `create` scaffolds from named templates: `default` (AI SDK), `minimal`, `cloud`, `cloud-clerk`, `langgraph`, `mcp`, `eve`. Pass `-t <name>`, pass `--example <name>` for examples such as `with-ai-sdk-v6`, use `--native` for Expo / React Native, use `--ink` for React Ink, or pass `--preset <url>` to scaffold from an `assistant-ui.com` playground link.
61
+ `create` scaffolds from named templates: `default` (AI SDK), `minimal`, `cloud`, `cloud-clerk`, `langchain`, `mcp`, `eve`. Pass `-t <name>`, pass `--example <name>` for examples such as `with-ai-sdk-v7`, use `--native` for Expo / React Native, use `--ink` for React Ink, or pass `--preset <url>` to scaffold from an `assistant-ui.com` playground link.
62
62
 
63
63
  ## Documentation
64
64
 
@@ -1,5 +1,4 @@
1
1
  import { API, Collection, FileInfo, JSCodeshift } from "jscodeshift";
2
-
3
2
  //#region src/codemods/utils/createTransformer.d.ts
4
3
  type TransformerFunction = (context: TransformContext, fileInfo: FileInfo, api: API, options: any) => void;
5
4
  interface TransformContext {
@@ -1 +1 @@
1
- {"version":3,"file":"createTransformer.d.ts","names":[],"sources":["../../../src/codemods/utils/createTransformer.ts"],"mappings":";;;KAEY,mBAAA,IACV,OAAA,EAAS,gBAAA,EACT,QAAA,EAAU,QAAA,EACV,GAAA,EAAK,GAAA,EACL,OAAA;AAAA,UAGe,gBAAA;EAPL;;;EAWV,CAAA,EAAG,WAAA;EATO;;;EAcV,IAAA,EAAM,UAAU;EAEhB,aAAA;AAAA;AAAA,iBAGc,iBAAA,CAAkB,WAAA,EAAa,mBAAA,IACjB,QAAA,EAAU,QAAA,EAAU,GAAA,EAAK,GAAA,EAAK,OAAA"}
1
+ {"version":3,"file":"createTransformer.d.ts","names":[],"sources":["../../../src/codemods/utils/createTransformer.ts"],"mappings":";;KAEY,uBACV,SAAS,kBACT,UAAU,UACV,KAAK,KACL;UAGe;;;;EAIf,GAAG;;;;EAKH,MAAM;EAEN;;iBAGc,kBAAkB,aAAa,uBACjB,UAAU,UAAU,KAAK,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"content-part-to-message-part.d.ts","names":[],"sources":["../../../src/codemods/v0-11/content-part-to-message-part.ts"],"mappings":";cAuEM,+BAAA,GAA+B,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"content-part-to-message-part.d.ts","names":[],"sources":["../../../src/codemods/v0-11/content-part-to-message-part.ts"],"mappings":";cAuEM,kCAA+B,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-api-to-aui.d.ts","names":[],"sources":["../../../src/codemods/v0-12/assistant-api-to-aui.ts"],"mappings":";cAsFM,wBAAA,GAAwB,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"assistant-api-to-aui.d.ts","names":[],"sources":["../../../src/codemods/v0-12/assistant-api-to-aui.ts"],"mappings":";cAsFM,2BAAwB,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-api-to-aui.js","names":[],"sources":["../../../src/codemods/v0-12/assistant-api-to-aui.ts"],"sourcesContent":["import { createTransformer } from \"../utils/createTransformer\";\n\n// Map of old hook names to new hook names\nconst hookRenamingMap: Record<string, string> = {\n useAssistantApi: \"useAui\",\n useAssistantState: \"useAuiState\",\n useAssistantEvent: \"useAuiEvent\",\n};\n\n// Map of old component names to new component names\nconst componentRenamingMap: Record<string, string> = {\n AssistantIf: \"AuiIf\",\n AssistantProvider: \"AuiProvider\",\n};\n\nconst isUseAuiCall = (j: any, node: any): boolean => {\n return (\n node &&\n j.CallExpression.check(node) &&\n j.Identifier.check(node.callee) &&\n (node.callee.name === \"useAui\" || node.callee.name === \"useAssistantApi\")\n );\n};\n\n// Check if a scope node directly contains an 'api' variable declaration\nconst scopeHasDirectApiDeclaration = (j: any, scopeNode: any): boolean => {\n // Get the body of the scope\n let body = null;\n if (\n j.FunctionDeclaration.check(scopeNode) ||\n j.FunctionExpression.check(scopeNode)\n ) {\n body = scopeNode.body?.body;\n } else if (j.ArrowFunctionExpression.check(scopeNode)) {\n // Arrow functions might have block or expression body\n if (j.BlockStatement.check(scopeNode.body)) {\n body = scopeNode.body.body;\n }\n } else if (j.BlockStatement.check(scopeNode)) {\n body = scopeNode.body;\n }\n\n if (!Array.isArray(body)) return false;\n\n // Check only direct statements in this scope's body\n for (const statement of body) {\n if (j.VariableDeclaration.check(statement)) {\n for (const declarator of statement.declarations) {\n if (j.Identifier.check(declarator.id) && declarator.id.name === \"api\") {\n // Don't count it as shadowing if it's from useAui\n if (!isUseAuiCall(j, declarator.init)) {\n return true;\n }\n }\n }\n }\n }\n\n return false;\n};\n\n// Check if a path is inside a scope that shadows the api variable\nconst isInsideShadowingScope = (j: any, identifierPath: any): boolean => {\n let currentPath = identifierPath.parent;\n\n while (currentPath) {\n const node = currentPath.value;\n\n // Check if this is a scope-creating node (function, arrow function, block)\n if (\n j.FunctionDeclaration.check(node) ||\n j.FunctionExpression.check(node) ||\n j.ArrowFunctionExpression.check(node) ||\n j.BlockStatement.check(node)\n ) {\n if (scopeHasDirectApiDeclaration(j, node)) {\n return true;\n }\n }\n\n currentPath = currentPath.parent;\n }\n\n return false;\n};\n\nconst migrateAssistantApiToAui = createTransformer(\n ({ j, root, markAsChanged }) => {\n let hasApiFromUseAui = false;\n\n // 1. Update imports\n root.find(j.ImportDeclaration).forEach((path: any) => {\n const source = path.value.source.value;\n\n // Only process imports from @assistant-ui packages\n if (typeof source === \"string\" && source.startsWith(\"@assistant-ui/\")) {\n path.value.specifiers?.forEach((specifier: any) => {\n if (j.ImportSpecifier.check(specifier)) {\n const oldName = specifier.imported.name as string;\n\n // Rename hooks\n if (hookRenamingMap[oldName]) {\n const newName = hookRenamingMap[oldName];\n specifier.imported.name = newName;\n if (specifier.local && specifier.local.name === oldName) {\n specifier.local.name = newName;\n }\n markAsChanged();\n }\n\n // Rename components\n if (componentRenamingMap[oldName]) {\n const newName = componentRenamingMap[oldName];\n specifier.imported.name = newName;\n if (specifier.local && specifier.local.name === oldName) {\n specifier.local.name = newName;\n }\n markAsChanged();\n }\n }\n });\n }\n });\n\n // 2. Find and rename variable declarations from useAui (or useAssistantApi)\n root.find(j.VariableDeclarator).forEach((path: any) => {\n const init = path.value.init;\n\n // Check if this is a call to useAui or useAssistantApi\n if (isUseAuiCall(j, init)) {\n if (j.Identifier.check(path.value.id)) {\n const oldVarName = path.value.id.name;\n\n // Only rename if it's called 'api'\n if (oldVarName === \"api\") {\n path.value.id.name = \"aui\";\n hasApiFromUseAui = true;\n markAsChanged();\n }\n }\n }\n });\n\n // 3. Rename all references to 'api' if we found it from useAui\n if (hasApiFromUseAui) {\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === \"api\") {\n // Skip if this is part of an import\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // Skip if this is a variable declarator id\n if (j.VariableDeclarator.check(path.parent.value)) {\n const declarator = path.parent.value;\n if (declarator.id === path.value) {\n return;\n }\n }\n\n // Skip if this is a property key in an object (e.g., { api: true })\n if (j.Property.check(path.parent.value)) {\n const prop = path.parent.value;\n if (prop.key === path.value && !prop.shorthand && !prop.computed) {\n return;\n }\n }\n\n if (j.ObjectProperty.check(path.parent.value)) {\n const prop = path.parent.value;\n if (prop.key === path.value && !prop.shorthand && !prop.computed) {\n return;\n }\n }\n\n // Skip if this is a property in a member expression (e.g., foo.api)\n if (\n j.MemberExpression.check(path.parent.value) &&\n path.parent.value.property === path.value &&\n !path.parent.value.computed\n ) {\n return;\n }\n\n // Skip if this is a JSX attribute name\n if (j.JSXAttribute.check(path.parent.value)) {\n return;\n }\n\n // Skip if this identifier is inside a scope that shadows the api variable\n if (isInsideShadowingScope(j, path)) {\n return;\n }\n\n // Update the reference\n path.value.name = \"aui\";\n markAsChanged();\n }\n });\n\n // Also handle JSX identifiers\n root.find(j.JSXIdentifier).forEach((path: any) => {\n if (path.value.name === \"api\") {\n if (!isInsideShadowingScope(j, path)) {\n path.value.name = \"aui\";\n markAsChanged();\n }\n }\n });\n }\n\n // 4. Update hook call references (in case they're used as values)\n Object.entries(hookRenamingMap).forEach(([oldName, newName]) => {\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === oldName) {\n // Skip if already handled in imports\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // This might be a reference to the hook as a value\n path.value.name = newName;\n markAsChanged();\n }\n });\n });\n\n // 5. Update JSX component names\n Object.entries(componentRenamingMap).forEach(([oldName, newName]) => {\n // Update JSX opening elements\n root.find(j.JSXOpeningElement).forEach((path: any) => {\n if (\n j.JSXIdentifier.check(path.value.name) &&\n path.value.name.name === oldName\n ) {\n path.value.name.name = newName;\n markAsChanged();\n }\n });\n\n // Update JSX closing elements\n root.find(j.JSXClosingElement).forEach((path: any) => {\n if (\n j.JSXIdentifier.check(path.value.name) &&\n path.value.name.name === oldName\n ) {\n path.value.name.name = newName;\n markAsChanged();\n }\n });\n\n // Update regular identifier references (for component references)\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === oldName) {\n // Skip if already handled in imports\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // Skip JSX identifiers (already handled above)\n if (j.JSXIdentifier.check(path.value)) {\n return;\n }\n\n // This might be a reference to the component as a value\n path.value.name = newName;\n markAsChanged();\n }\n });\n });\n },\n);\n\nexport default migrateAssistantApiToAui;\n"],"mappings":";;AAGA,MAAM,kBAA0C;CAC9C,iBAAiB;CACjB,mBAAmB;CACnB,mBAAmB;AACrB;AAGA,MAAM,uBAA+C;CACnD,aAAa;CACb,mBAAmB;AACrB;AAEA,MAAM,gBAAgB,GAAQ,SAAuB;CACnD,OACE,QACA,EAAE,eAAe,MAAM,IAAI,KAC3B,EAAE,WAAW,MAAM,KAAK,MAAM,MAC7B,KAAK,OAAO,SAAS,YAAY,KAAK,OAAO,SAAS;AAE3D;AAGA,MAAM,gCAAgC,GAAQ,cAA4B;CAExE,IAAI,OAAO;CACX,IACE,EAAE,oBAAoB,MAAM,SAAS,KACrC,EAAE,mBAAmB,MAAM,SAAS,GAEpC,OAAO,UAAU,MAAM;MAClB,IAAI,EAAE,wBAAwB,MAAM,SAAS;MAE9C,EAAE,eAAe,MAAM,UAAU,IAAI,GACvC,OAAO,UAAU,KAAK;CAAA,OAEnB,IAAI,EAAE,eAAe,MAAM,SAAS,GACzC,OAAO,UAAU;CAGnB,IAAI,CAAC,MAAM,QAAQ,IAAI,GAAG,OAAO;CAGjC,KAAK,MAAM,aAAa,MACtB,IAAI,EAAE,oBAAoB,MAAM,SAAS;OAClC,MAAM,cAAc,UAAU,cACjC,IAAI,EAAE,WAAW,MAAM,WAAW,EAAE,KAAK,WAAW,GAAG,SAAS;OAE1D,CAAC,aAAa,GAAG,WAAW,IAAI,GAClC,OAAO;EAAA;CACT;CAMR,OAAO;AACT;AAGA,MAAM,0BAA0B,G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AAM,SAAS,SAAS;IAE/B,IAAI,EAAE,gBAAgB,MAAM,KAAK,OAAO,KAAK,GAC3C;IAIF,KAAK,MAAM,OAAO;IAClB,cAAc;GAChB;EACF,CAAC;CACH,CAAC;CAGD,OAAO,QAAQ,oBAAoB,CAAC,CAAC,SAAS,CAAC,SAAS,aAAa;EAEnE,KAAK,KAAK,EAAE,iBAAiB,CAAC,CAAC,SAAS,SAAc;GACpD,IACE,EAAE,cAAc,MAAM,KAAK,MAAM,IAAI,KACrC,KAAK,MAAM,KAAK,SAAS,SACzB;IACA,KAAK,MAAM,KAAK,OAAO;IACvB,cAAc;GAChB;EACF,CAAC;EAGD,KAAK,KAAK,EAAE,iBAAiB,CAAC,CAAC,SAAS,SAAc;GACpD,IACE,EAAE,cAAc,MAAM,KAAK,MAAM,IAAI,KACrC,KAAK,MAAM,KAAK,SAAS,SACzB;IACA,KAAK,MAAM,KAAK,OAAO;IACvB,cAAc;GAChB;EACF,CAAC;EAGD,KAAK,KAAK,EAAE,UAAU,CAAC,CAAC,SAAS,SAAc;GAC7C,IAAI,KAAK,MAAM,SAAS,SAAS;IAE/B,IAAI,EAAE,gBAAgB,MAAM,KAAK,OAAO,KAAK,GAC3C;IAIF,IAAI,EAAE,cAAc,MAAM,KAAK,KAAK,GAClC;IAIF,KAAK,MAAM,OAAO;IAClB,cAAc;GAChB;EACF,CAAC;CACH,CAAC;AACH,CACF"}
1
+ {"version":3,"file":"assistant-api-to-aui.js","names":[],"sources":["../../../src/codemods/v0-12/assistant-api-to-aui.ts"],"sourcesContent":["import { createTransformer } from \"../utils/createTransformer\";\n\n// Map of old hook names to new hook names\nconst hookRenamingMap: Record<string, string> = {\n useAssistantApi: \"useAui\",\n useAssistantState: \"useAuiState\",\n useAssistantEvent: \"useAuiEvent\",\n};\n\n// Map of old component names to new component names\nconst componentRenamingMap: Record<string, string> = {\n AssistantIf: \"AuiIf\",\n AssistantProvider: \"AuiProvider\",\n};\n\nconst isUseAuiCall = (j: any, node: any): boolean => {\n return (\n node &&\n j.CallExpression.check(node) &&\n j.Identifier.check(node.callee) &&\n (node.callee.name === \"useAui\" || node.callee.name === \"useAssistantApi\")\n );\n};\n\n// Check if a scope node directly contains an 'api' variable declaration\nconst scopeHasDirectApiDeclaration = (j: any, scopeNode: any): boolean => {\n // Get the body of the scope\n let body = null;\n if (\n j.FunctionDeclaration.check(scopeNode) ||\n j.FunctionExpression.check(scopeNode)\n ) {\n body = scopeNode.body?.body;\n } else if (j.ArrowFunctionExpression.check(scopeNode)) {\n // Arrow functions might have block or expression body\n if (j.BlockStatement.check(scopeNode.body)) {\n body = scopeNode.body.body;\n }\n } else if (j.BlockStatement.check(scopeNode)) {\n body = scopeNode.body;\n }\n\n if (!Array.isArray(body)) return false;\n\n // Check only direct statements in this scope's body\n for (const statement of body) {\n if (j.VariableDeclaration.check(statement)) {\n for (const declarator of statement.declarations) {\n if (j.Identifier.check(declarator.id) && declarator.id.name === \"api\") {\n // Don't count it as shadowing if it's from useAui\n if (!isUseAuiCall(j, declarator.init)) {\n return true;\n }\n }\n }\n }\n }\n\n return false;\n};\n\n// Check if a path is inside a scope that shadows the api variable\nconst isInsideShadowingScope = (j: any, identifierPath: any): boolean => {\n let currentPath = identifierPath.parent;\n\n while (currentPath) {\n const node = currentPath.value;\n\n // Check if this is a scope-creating node (function, arrow function, block)\n if (\n j.FunctionDeclaration.check(node) ||\n j.FunctionExpression.check(node) ||\n j.ArrowFunctionExpression.check(node) ||\n j.BlockStatement.check(node)\n ) {\n if (scopeHasDirectApiDeclaration(j, node)) {\n return true;\n }\n }\n\n currentPath = currentPath.parent;\n }\n\n return false;\n};\n\nconst migrateAssistantApiToAui = createTransformer(\n ({ j, root, markAsChanged }) => {\n let hasApiFromUseAui = false;\n\n // 1. Update imports\n root.find(j.ImportDeclaration).forEach((path: any) => {\n const source = path.value.source.value;\n\n // Only process imports from @assistant-ui packages\n if (typeof source === \"string\" && source.startsWith(\"@assistant-ui/\")) {\n path.value.specifiers?.forEach((specifier: any) => {\n if (j.ImportSpecifier.check(specifier)) {\n const oldName = specifier.imported.name as string;\n\n // Rename hooks\n if (hookRenamingMap[oldName]) {\n const newName = hookRenamingMap[oldName];\n specifier.imported.name = newName;\n if (specifier.local && specifier.local.name === oldName) {\n specifier.local.name = newName;\n }\n markAsChanged();\n }\n\n // Rename components\n if (componentRenamingMap[oldName]) {\n const newName = componentRenamingMap[oldName];\n specifier.imported.name = newName;\n if (specifier.local && specifier.local.name === oldName) {\n specifier.local.name = newName;\n }\n markAsChanged();\n }\n }\n });\n }\n });\n\n // 2. Find and rename variable declarations from useAui (or useAssistantApi)\n root.find(j.VariableDeclarator).forEach((path: any) => {\n const init = path.value.init;\n\n // Check if this is a call to useAui or useAssistantApi\n if (isUseAuiCall(j, init)) {\n if (j.Identifier.check(path.value.id)) {\n const oldVarName = path.value.id.name;\n\n // Only rename if it's called 'api'\n if (oldVarName === \"api\") {\n path.value.id.name = \"aui\";\n hasApiFromUseAui = true;\n markAsChanged();\n }\n }\n }\n });\n\n // 3. Rename all references to 'api' if we found it from useAui\n if (hasApiFromUseAui) {\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === \"api\") {\n // Skip if this is part of an import\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // Skip if this is a variable declarator id\n if (j.VariableDeclarator.check(path.parent.value)) {\n const declarator = path.parent.value;\n if (declarator.id === path.value) {\n return;\n }\n }\n\n // Skip if this is a property key in an object (e.g., { api: true })\n if (j.Property.check(path.parent.value)) {\n const prop = path.parent.value;\n if (prop.key === path.value && !prop.shorthand && !prop.computed) {\n return;\n }\n }\n\n if (j.ObjectProperty.check(path.parent.value)) {\n const prop = path.parent.value;\n if (prop.key === path.value && !prop.shorthand && !prop.computed) {\n return;\n }\n }\n\n // Skip if this is a property in a member expression (e.g., foo.api)\n if (\n j.MemberExpression.check(path.parent.value) &&\n path.parent.value.property === path.value &&\n !path.parent.value.computed\n ) {\n return;\n }\n\n // Skip if this is a JSX attribute name\n if (j.JSXAttribute.check(path.parent.value)) {\n return;\n }\n\n // Skip if this identifier is inside a scope that shadows the api variable\n if (isInsideShadowingScope(j, path)) {\n return;\n }\n\n // Update the reference\n path.value.name = \"aui\";\n markAsChanged();\n }\n });\n\n // Also handle JSX identifiers\n root.find(j.JSXIdentifier).forEach((path: any) => {\n if (path.value.name === \"api\") {\n if (!isInsideShadowingScope(j, path)) {\n path.value.name = \"aui\";\n markAsChanged();\n }\n }\n });\n }\n\n // 4. Update hook call references (in case they're used as values)\n Object.entries(hookRenamingMap).forEach(([oldName, newName]) => {\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === oldName) {\n // Skip if already handled in imports\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // This might be a reference to the hook as a value\n path.value.name = newName;\n markAsChanged();\n }\n });\n });\n\n // 5. Update JSX component names\n Object.entries(componentRenamingMap).forEach(([oldName, newName]) => {\n // Update JSX opening elements\n root.find(j.JSXOpeningElement).forEach((path: any) => {\n if (\n j.JSXIdentifier.check(path.value.name) &&\n path.value.name.name === oldName\n ) {\n path.value.name.name = newName;\n markAsChanged();\n }\n });\n\n // Update JSX closing elements\n root.find(j.JSXClosingElement).forEach((path: any) => {\n if (\n j.JSXIdentifier.check(path.value.name) &&\n path.value.name.name === oldName\n ) {\n path.value.name.name = newName;\n markAsChanged();\n }\n });\n\n // Update regular identifier references (for component references)\n root.find(j.Identifier).forEach((path: any) => {\n if (path.value.name === oldName) {\n // Skip if already handled in imports\n if (j.ImportSpecifier.check(path.parent.value)) {\n return;\n }\n\n // Skip JSX identifiers (already handled above)\n if (j.JSXIdentifier.check(path.value)) {\n return;\n }\n\n // This might be a reference to the component as a value\n path.value.name = newName;\n markAsChanged();\n }\n });\n });\n },\n);\n\nexport default migrateAssistantApiToAui;\n"],"mappings":";;AAGA,MAAM,kBAA0C;CAC9C,iBAAiB;CACjB,mBAAmB;CACnB,mBAAmB;AACrB;AAGA,MAAM,uBAA+C;CACnD,aAAa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;GAChB;EACF,CAAC;EAGD,KAAK,KAAK,EAAE,iBAAiB,CAAC,CAAC,SAAS,SAAc;GACpD,IACE,EAAE,cAAc,MAAM,KAAK,MAAM,IAAI,KACrC,KAAK,MAAM,KAAK,SAAS,SACzB;IACA,KAAK,MAAM,KAAK,OAAO;IACvB,cAAc;GAChB;EACF,CAAC;EAGD,KAAK,KAAK,EAAE,UAAU,CAAC,CAAC,SAAS,SAAc;GAC7C,IAAI,KAAK,MAAM,SAAS,SAAS;IAE/B,IAAI,EAAE,gBAAgB,MAAM,KAAK,OAAO,KAAK,GAC3C;IAIF,IAAI,EAAE,cAAc,MAAM,KAAK,KAAK,GAClC;IAIF,KAAK,MAAM,OAAO;IAClB,cAAc;GAChB;EACF,CAAC;CACH,CAAC;AACH,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-names-to-camelcase.d.ts","names":[],"sources":["../../../src/codemods/v0-12/event-names-to-camelcase.ts"],"mappings":";cAYM,4BAAA,GAA4B,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"event-names-to-camelcase.d.ts","names":[],"sources":["../../../src/codemods/v0-12/event-names-to-camelcase.ts"],"mappings":";cAYM,+BAA4B,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"primitive-if-to-aui-if.d.ts","names":[],"sources":["../../../src/codemods/v0-12/primitive-if-to-aui-if.ts"],"mappings":";cAmKM,yBAAA,GAAyB,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"primitive-if-to-aui-if.d.ts","names":[],"sources":["../../../src/codemods/v0-12/primitive-if-to-aui-if.ts"],"mappings":";cAmKM,4BAAyB,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ui-package-split.d.ts","names":[],"sources":["../../../src/codemods/v0-8/ui-package-split.ts"],"mappings":";cA8BM,kBAAA,GAAkB,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"ui-package-split.d.ts","names":[],"sources":["../../../src/codemods/v0-8/ui-package-split.ts"],"mappings":";cA8BM,qBAAkB,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ui-package-split.js","names":[],"sources":["../../../src/codemods/v0-8/ui-package-split.ts"],"sourcesContent":["import { createTransformer } from \"../utils/createTransformer\";\n\nconst reactUIExports: string[] = [\n \"ThreadConfigProvider\",\n \"useThreadConfig\",\n \"ThreadConfig\",\n \"ThreadWelcomeConfig\",\n \"UserMessageConfig\",\n \"AssistantMessageConfig\",\n \"StringsConfig\",\n \"SuggestionConfig\",\n \"ThreadConfigProviderProps\",\n \"AssistantActionBar\",\n \"AssistantMessage\",\n \"AssistantModal\",\n \"BranchPicker\",\n \"Composer\",\n \"MessagePart\",\n \"AttachmentUI\",\n \"EditComposer\",\n \"Thread\",\n \"ThreadList\",\n \"ThreadListItem\",\n \"ThreadWelcome\",\n \"UserMessage\",\n \"makeMarkdownText\",\n \"MakeMarkdownTextProps\",\n \"CodeHeader\",\n];\n\nconst migrateAssistantUI = createTransformer(({ j, root, markAsChanged }) => {\n const sourcesToMigrate: string[] = [\n \"@assistant-ui/react\",\n \"@assistant-ui/react-markdown\",\n ];\n const movedSpecifiers: any[] = [];\n let lastMigratedImportPath: any = null;\n\n root\n .find(j.ImportDeclaration)\n .filter((path: any) => sourcesToMigrate.includes(path.value.source.value))\n .forEach((path: any) => {\n let hadMigratedSpecifiers = false;\n const remainingSpecifiers: any[] = [];\n path.value.specifiers.forEach((specifier: any) => {\n if (\n j.ImportSpecifier.check(specifier) &&\n reactUIExports.includes(specifier.imported.name as string)\n ) {\n movedSpecifiers.push(specifier);\n hadMigratedSpecifiers = true;\n } else {\n remainingSpecifiers.push(specifier);\n }\n });\n if (hadMigratedSpecifiers) {\n lastMigratedImportPath = path;\n }\n if (remainingSpecifiers.length === 0) {\n j(path).remove();\n markAsChanged();\n } else if (remainingSpecifiers.length !== path.value.specifiers.length) {\n path.value.specifiers = remainingSpecifiers;\n markAsChanged();\n }\n });\n\n if (movedSpecifiers.length > 0) {\n const existingReactUIImport = root.find(j.ImportDeclaration, {\n source: { value: \"@assistant-ui/react-ui\" },\n });\n if (existingReactUIImport.size() > 0) {\n existingReactUIImport.forEach((path: any) => {\n movedSpecifiers.forEach((specifier: any) => {\n if (\n !path.value.specifiers.some(\n (s: any) => s.imported.name === specifier.imported.name,\n )\n ) {\n path.value.specifiers.push(specifier);\n }\n });\n });\n } else {\n const newImport = j.importDeclaration(\n movedSpecifiers,\n j.literal(\"@assistant-ui/react-ui\"),\n );\n if (lastMigratedImportPath) {\n j(lastMigratedImportPath).insertAfter(newImport);\n } else {\n const firstImport = root.find(j.ImportDeclaration).at(0);\n if (firstImport.size() > 0) {\n firstImport.insertBefore(newImport);\n } else {\n root.get().node.program.body.unshift(newImport);\n }\n }\n }\n markAsChanged();\n }\n\n const cssReplacements: Record<string, string> = {\n \"@assistant-ui/react/styles/index.css\":\n \"@assistant-ui/react-ui/styles/index.css\",\n \"@assistant-ui/react/styles/modal.css\":\n \"@assistant-ui/react-ui/styles/modal.css\",\n \"@assistant-ui/react-markdown/styles/markdown.css\":\n \"@assistant-ui/react-ui/styles/markdown.css\",\n };\n\n root.find(j.ImportDeclaration).forEach((path: any) => {\n const sourceValue: string = path.value.source.value;\n if (cssReplacements[sourceValue]) {\n path.value.source = j.literal(cssReplacements[sourceValue]);\n markAsChanged();\n }\n });\n\n let removedMarkdownPlugin = false;\n root\n .find(j.CallExpression, { callee: { name: \"require\" } })\n .filter((path: any) => {\n const arg = path.value.arguments[0];\n return (\n arg &&\n (arg.type === \"Literal\" || arg.type === \"StringLiteral\") &&\n arg.value === \"@assistant-ui/react-markdown/tailwindcss\"\n );\n })\n .forEach((path: any) => {\n removedMarkdownPlugin = true;\n const parent = path.parentPath;\n if (parent?.value && parent.value.type === \"VariableDeclarator\") {\n const varDecl = parent.parentPath;\n if (\n varDecl?.value.declarations &&\n varDecl.value.declarations.length === 1\n ) {\n j(varDecl).remove();\n } else {\n varDecl.value.declarations = varDecl.value.declarations.filter(\n (decl: any) => decl !== parent.value,\n );\n }\n markAsChanged();\n } else {\n j(path).remove();\n markAsChanged();\n }\n });\n\n root\n .find(j.CallExpression, { callee: { name: \"require\" } })\n .filter((path: any) => {\n const arg = path.value.arguments[0];\n return (\n arg &&\n (arg.type === \"Literal\" || arg.type === \"StringLiteral\") &&\n arg.value === \"@assistant-ui/react/tailwindcss\"\n );\n })\n .forEach((path: any) => {\n path.value.arguments[0].value = \"@assistant-ui/react-ui/tailwindcss\";\n markAsChanged();\n if (removedMarkdownPlugin) {\n if (\n path.parentPath?.value &&\n path.parentPath.value.type === \"CallExpression\" &&\n path.parentPath.value.arguments.length > 0\n ) {\n const configObj = path.parentPath.value.arguments[0];\n if (configObj && configObj.type === \"ObjectExpression\") {\n const componentsProp = configObj.properties.find((prop: any) => {\n return (\n (prop.key.name === \"components\" ||\n prop.key.value === \"components\") &&\n prop.value.type === \"ArrayExpression\"\n );\n });\n if (componentsProp) {\n const componentsArray = componentsProp.value.elements;\n const hasMarkdown = componentsArray.some(\n (el: any) => el.type === \"Literal\" && el.value === \"markdown\",\n );\n if (!hasMarkdown) {\n componentsArray.push(j.literal(\"markdown\"));\n markAsChanged();\n }\n }\n }\n }\n }\n });\n});\n\nexport default migrateAssistantUI;\n"],"mappings":";;AAEA,MAAM,iBAA2B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,qBAAqB,mBAAmB,EAAE,GAAG,MAAM,oBAAoB;CAC3E,MAAM,mBAA6B,CACjC,uBACA,8BACF;CACA,MAAM,kBAAyB,CAAC;CAChC,IAAI,yBAA8B;CAElC,KACG,KA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d,IAAI;OAEA,KAAK,YAAY,SACjB,KAAK,WAAW,MAAM,SAAS,oBAC/B,KAAK,WAAW,MAAM,UAAU,SAAS,GACzC;IACA,MAAM,YAAY,KAAK,WAAW,MAAM,UAAU;IAClD,IAAI,aAAa,UAAU,SAAS,oBAAoB;KACtD,MAAM,iBAAiB,UAAU,WAAW,MAAM,SAAc;MAC9D,QACG,KAAK,IAAI,SAAS,gBACjB,KAAK,IAAI,UAAU,iBACrB,KAAK,MAAM,SAAS;KAExB,CAAC;KACD,IAAI,gBAAgB;MAClB,MAAM,kBAAkB,eAAe,MAAM;MAI7C,IAAI,CAHgB,gBAAgB,MACjC,OAAY,GAAG,SAAS,aAAa,GAAG,UAAU,UAEtC,GAAG;OAChB,gBAAgB,KAAK,EAAE,QAAQ,UAAU,CAAC;OAC1C,cAAc;MAChB;KACF;IACF;GACF;;CAEJ,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"ui-package-split.js","names":[],"sources":["../../../src/codemods/v0-8/ui-package-split.ts"],"sourcesContent":["import { createTransformer } from \"../utils/createTransformer\";\n\nconst reactUIExports: string[] = [\n \"ThreadConfigProvider\",\n \"useThreadConfig\",\n \"ThreadConfig\",\n \"ThreadWelcomeConfig\",\n \"UserMessageConfig\",\n \"AssistantMessageConfig\",\n \"StringsConfig\",\n \"SuggestionConfig\",\n \"ThreadConfigProviderProps\",\n \"AssistantActionBar\",\n \"AssistantMessage\",\n \"AssistantModal\",\n \"BranchPicker\",\n \"Composer\",\n \"MessagePart\",\n \"AttachmentUI\",\n \"EditComposer\",\n \"Thread\",\n \"ThreadList\",\n \"ThreadListItem\",\n \"ThreadWelcome\",\n \"UserMessage\",\n \"makeMarkdownText\",\n \"MakeMarkdownTextProps\",\n \"CodeHeader\",\n];\n\nconst migrateAssistantUI = createTransformer(({ j, root, markAsChanged }) => {\n const sourcesToMigrate: string[] = [\n \"@assistant-ui/react\",\n \"@assistant-ui/react-markdown\",\n ];\n const movedSpecifiers: any[] = [];\n let lastMigratedImportPath: any = null;\n\n root\n .find(j.ImportDeclaration)\n .filter((path: any) => sourcesToMigrate.includes(path.value.source.value))\n .forEach((path: any) => {\n let hadMigratedSpecifiers = false;\n const remainingSpecifiers: any[] = [];\n path.value.specifiers.forEach((specifier: any) => {\n if (\n j.ImportSpecifier.check(specifier) &&\n reactUIExports.includes(specifier.imported.name as string)\n ) {\n movedSpecifiers.push(specifier);\n hadMigratedSpecifiers = true;\n } else {\n remainingSpecifiers.push(specifier);\n }\n });\n if (hadMigratedSpecifiers) {\n lastMigratedImportPath = path;\n }\n if (remainingSpecifiers.length === 0) {\n j(path).remove();\n markAsChanged();\n } else if (remainingSpecifiers.length !== path.value.specifiers.length) {\n path.value.specifiers = remainingSpecifiers;\n markAsChanged();\n }\n });\n\n if (movedSpecifiers.length > 0) {\n const existingReactUIImport = root.find(j.ImportDeclaration, {\n source: { value: \"@assistant-ui/react-ui\" },\n });\n if (existingReactUIImport.size() > 0) {\n existingReactUIImport.forEach((path: any) => {\n movedSpecifiers.forEach((specifier: any) => {\n if (\n !path.value.specifiers.some(\n (s: any) => s.imported.name === specifier.imported.name,\n )\n ) {\n path.value.specifiers.push(specifier);\n }\n });\n });\n } else {\n const newImport = j.importDeclaration(\n movedSpecifiers,\n j.literal(\"@assistant-ui/react-ui\"),\n );\n if (lastMigratedImportPath) {\n j(lastMigratedImportPath).insertAfter(newImport);\n } else {\n const firstImport = root.find(j.ImportDeclaration).at(0);\n if (firstImport.size() > 0) {\n firstImport.insertBefore(newImport);\n } else {\n root.get().node.program.body.unshift(newImport);\n }\n }\n }\n markAsChanged();\n }\n\n const cssReplacements: Record<string, string> = {\n \"@assistant-ui/react/styles/index.css\":\n \"@assistant-ui/react-ui/styles/index.css\",\n \"@assistant-ui/react/styles/modal.css\":\n \"@assistant-ui/react-ui/styles/modal.css\",\n \"@assistant-ui/react-markdown/styles/markdown.css\":\n \"@assistant-ui/react-ui/styles/markdown.css\",\n };\n\n root.find(j.ImportDeclaration).forEach((path: any) => {\n const sourceValue: string = path.value.source.value;\n if (cssReplacements[sourceValue]) {\n path.value.source = j.literal(cssReplacements[sourceValue]);\n markAsChanged();\n }\n });\n\n let removedMarkdownPlugin = false;\n root\n .find(j.CallExpression, { callee: { name: \"require\" } })\n .filter((path: any) => {\n const arg = path.value.arguments[0];\n return (\n arg &&\n (arg.type === \"Literal\" || arg.type === \"StringLiteral\") &&\n arg.value === \"@assistant-ui/react-markdown/tailwindcss\"\n );\n })\n .forEach((path: any) => {\n removedMarkdownPlugin = true;\n const parent = path.parentPath;\n if (parent?.value && parent.value.type === \"VariableDeclarator\") {\n const varDecl = parent.parentPath;\n if (\n varDecl?.value.declarations &&\n varDecl.value.declarations.length === 1\n ) {\n j(varDecl).remove();\n } else {\n varDecl.value.declarations = varDecl.value.declarations.filter(\n (decl: any) => decl !== parent.value,\n );\n }\n markAsChanged();\n } else {\n j(path).remove();\n markAsChanged();\n }\n });\n\n root\n .find(j.CallExpression, { callee: { name: \"require\" } })\n .filter((path: any) => {\n const arg = path.value.arguments[0];\n return (\n arg &&\n (arg.type === \"Literal\" || arg.type === \"StringLiteral\") &&\n arg.value === \"@assistant-ui/react/tailwindcss\"\n );\n })\n .forEach((path: any) => {\n path.value.arguments[0].value = \"@assistant-ui/react-ui/tailwindcss\";\n markAsChanged();\n if (removedMarkdownPlugin) {\n if (\n path.parentPath?.value &&\n path.parentPath.value.type === \"CallExpression\" &&\n path.parentPath.value.arguments.length > 0\n ) {\n const configObj = path.parentPath.value.arguments[0];\n if (configObj && configObj.type === \"ObjectExpression\") {\n const componentsProp = configObj.properties.find((prop: any) => {\n return (\n (prop.key.name === \"components\" ||\n prop.key.value === \"components\") &&\n prop.value.type === \"ArrayExpression\"\n );\n });\n if (componentsProp) {\n const componentsArray = componentsProp.value.elements;\n const hasMarkdown = componentsArray.some(\n (el: any) => el.type === \"Literal\" && el.value === \"markdown\",\n );\n if (!hasMarkdown) {\n componentsArray.push(j.literal(\"markdown\"));\n markAsChanged();\n }\n }\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,EAAE,IAAI,CAAC,CAAC,OAAO;GACf,cAAc;EAChB;CACF,CAAC;CAEH,KACG,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,EAAE,CAAC,CAAC,CACvD,QAAQ,SAAc;EACrB,MAAM,MAAM,KAAK,MAAM,UAAU;EACjC,OACE,QACC,IAAI,SAAS,aAAa,IAAI,SAAS,oBACxC,IAAI,UAAU;CAElB,CAAC,CAAC,CACD,SAAS,SAAc;EACtB,KAAK,MAAM,UAAU,EAAE,CAAC,QAAQ;EAChC,cAAc;EACd,IAAI,uBAEA;OAAA,KAAK,YAAY,SACjB,KAAK,WAAW,MAAM,SAAS,oBAC/B,KAAK,WAAW,MAAM,UAAU,SAAS,GACzC;IACA,MAAM,YAAY,KAAK,WAAW,MAAM,UAAU;IAClD,IAAI,aAAa,UAAU,SAAS,oBAAoB;KACtD,MAAM,iBAAiB,UAAU,WAAW,MAAM,SAAc;MAC9D,QACG,KAAK,IAAI,SAAS,gBACjB,KAAK,IAAI,UAAU,iBACrB,KAAK,MAAM,SAAS;KAExB,CAAC;KACD,IAAI,gBAAgB;MAClB,MAAM,kBAAkB,eAAe,MAAM;MAI7C,IAAI,CAHgB,gBAAgB,MACjC,OAAY,GAAG,SAAS,aAAa,GAAG,UAAU,UAEtC,GAAG;OAChB,gBAAgB,KAAK,EAAE,QAAQ,UAAU,CAAC;OAC1C,cAAc;MAChB;KACF;IACF;GACF;;CAEJ,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"edge-package-split.d.ts","names":[],"sources":["../../../src/codemods/v0-9/edge-package-split.ts"],"mappings":";cA8BM,oBAAA,GAAoB,QAAA,iCAAA,QAAA,EAAA,GAAA,iCAAA,GAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"edge-package-split.d.ts","names":[],"sources":["../../../src/codemods/v0-9/edge-package-split.ts"],"mappings":";cA8BM,uBAAoB,yCAAA,UAAA,oCAAA,KAAA"}
@@ -1,6 +1,5 @@
1
1
  import { PackageManagerName } from "../lib/create-project.js";
2
2
  import { Command } from "commander";
3
-
4
3
  //#region src/commands/add.d.ts
5
4
  interface AddComponentsPlan {
6
5
  command: string;
@@ -13,6 +12,7 @@ declare function createAddComponentsPlan(params: {
13
12
  overwrite?: boolean;
14
13
  cwd?: string;
15
14
  path?: string;
15
+ style?: string;
16
16
  }): AddComponentsPlan;
17
17
  declare const add: Command;
18
18
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","names":[],"sources":["../../src/commands/add.ts"],"mappings":";;;;UAaiB,iBAAA;EACf,OAAA;EACA,IAAI;AAAA;AAAA,iBAGU,uBAAA,CAAwB,MAAA;EACtC,UAAA;EACA,cAAA,EAAgB,kBAAA;EAChB,GAAA;EACA,SAAA;EACA,GAAA;EACA,IAAA;AAAA,IACE,iBAAiB;AAAA,cAqBR,GAAA,EAAG,OAqDZ"}
1
+ {"version":3,"file":"add.d.ts","names":[],"sources":["../../src/commands/add.ts"],"mappings":";;;UAeiB;EACf;EACA;;iBAGc,wBAAwB;EACtC;EACA,gBAAgB;EAChB;EACA;EACA;EACA;EACA;IACE;cAqBS,KAAG"}
@@ -2,13 +2,13 @@ import { logger } from "../lib/utils/logger.js";
2
2
  import { SpawnExitError, runSpawn } from "../lib/run-spawn.js";
3
3
  import { dlxCommand, resolvePackageManager, resolvePackageManagerForCwd } from "../lib/create-project.js";
4
4
  import { hasConfig } from "../lib/utils/config.js";
5
+ import { getComponentsJsonStyle, resolveRegistryItemUrl } from "../lib/utils/registry.js";
5
6
  import { Command } from "commander";
6
7
  //#region src/commands/add.ts
7
- const REGISTRY_BASE_URL = "https://r.assistant-ui.com";
8
8
  function createAddComponentsPlan(params) {
9
9
  const componentsToAdd = params.components.map((c) => {
10
10
  if (!/^[a-zA-Z0-9-/]+$/.test(c)) throw new Error(`Invalid component name: ${c}`);
11
- return `${REGISTRY_BASE_URL}/${encodeURIComponent(c)}.json`;
11
+ return resolveRegistryItemUrl(c, params.style);
12
12
  });
13
13
  const [command, dlxArgs] = dlxCommand(params.packageManager);
14
14
  const args = [
@@ -28,17 +28,20 @@ function createAddComponentsPlan(params) {
28
28
  }
29
29
  const add = new Command().name("add").description("add a component to your project").argument("<components...>", "the components to add").option("-y, --yes", "skip confirmation prompt.", true).option("-o, --overwrite", "overwrite existing files.", false).option("-c, --cwd <cwd>", "the working directory. defaults to the current directory.", process.cwd()).option("-p, --path <path>", "the path to add the component to.").option("--use-npm", "explicitly use npm").option("--use-pnpm", "explicitly use pnpm").option("--use-yarn", "explicitly use yarn").option("--use-bun", "explicitly use bun").action(async (components, opts) => {
30
30
  if (!hasConfig(opts.cwd)) {
31
- logger.warn("It looks like you haven't initialized your project yet. Run 'assistant-ui init' first.");
31
+ logger.warn("It looks like you haven't initialized your project yet — defaulting to Base UI flavored components. Run 'assistant-ui init' first for a configured setup.");
32
32
  logger.break();
33
33
  }
34
34
  logger.step(`Adding ${components.length} component(s)...`);
35
+ const packageManager = await resolvePackageManagerForCwd(opts.cwd, resolvePackageManager(opts));
36
+ const style = getComponentsJsonStyle(opts.cwd);
35
37
  const { command, args } = createAddComponentsPlan({
36
38
  components,
37
- packageManager: await resolvePackageManagerForCwd(opts.cwd, resolvePackageManager(opts)),
39
+ packageManager,
38
40
  yes: opts.yes,
39
41
  overwrite: opts.overwrite,
40
42
  cwd: opts.cwd,
41
- path: opts.path
43
+ path: opts.path,
44
+ ...style === void 0 ? {} : { style }
42
45
  });
43
46
  try {
44
47
  await runSpawn(command, args, opts.cwd);
@@ -1 +1 @@
1
- {"version":3,"file":"add.js","names":[],"sources":["../../src/commands/add.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { logger } from \"../lib/utils/logger\";\nimport { hasConfig } from \"../lib/utils/config\";\nimport {\n dlxCommand,\n resolvePackageManager,\n resolvePackageManagerForCwd,\n type PackageManagerName,\n} from \"../lib/create-project\";\nimport { runSpawn, SpawnExitError } from \"../lib/run-spawn\";\n\nconst REGISTRY_BASE_URL = \"https://r.assistant-ui.com\";\n\nexport interface AddComponentsPlan {\n command: string;\n args: string[];\n}\n\nexport function createAddComponentsPlan(params: {\n components: string[];\n packageManager: PackageManagerName;\n yes?: boolean;\n overwrite?: boolean;\n cwd?: string;\n path?: string;\n}): AddComponentsPlan {\n const componentsToAdd = params.components.map((c) => {\n if (!/^[a-zA-Z0-9-/]+$/.test(c)) {\n throw new Error(`Invalid component name: ${c}`);\n }\n return `${REGISTRY_BASE_URL}/${encodeURIComponent(c)}.json`;\n });\n\n const [command, dlxArgs] = dlxCommand(params.packageManager);\n const args = [...dlxArgs, \"shadcn@latest\", \"add\", ...componentsToAdd];\n\n // For npm, dlxArgs may already include `--yes` for npx auto-install.\n // This flag is for shadcn's own confirmation prompt.\n if (params.yes) args.push(\"--yes\");\n if (params.overwrite) args.push(\"--overwrite\");\n if (params.cwd) args.push(\"--cwd\", params.cwd);\n if (params.path) args.push(\"--path\", params.path);\n\n return { command, args };\n}\n\nexport const add = new Command()\n .name(\"add\")\n .description(\"add a component to your project\")\n .argument(\"<components...>\", \"the components to add\")\n .option(\"-y, --yes\", \"skip confirmation prompt.\", true)\n .option(\"-o, --overwrite\", \"overwrite existing files.\", false)\n .option(\n \"-c, --cwd <cwd>\",\n \"the working directory. defaults to the current directory.\",\n process.cwd(),\n )\n .option(\"-p, --path <path>\", \"the path to add the component to.\")\n .option(\"--use-npm\", \"explicitly use npm\")\n .option(\"--use-pnpm\", \"explicitly use pnpm\")\n .option(\"--use-yarn\", \"explicitly use yarn\")\n .option(\"--use-bun\", \"explicitly use bun\")\n .action(async (components: string[], opts) => {\n // Check if project is initialized\n if (!hasConfig(opts.cwd)) {\n logger.warn(\n \"It looks like you haven't initialized your project yet. Run 'assistant-ui init' first.\",\n );\n logger.break();\n }\n\n logger.step(`Adding ${components.length} component(s)...`);\n\n const packageManager = await resolvePackageManagerForCwd(\n opts.cwd,\n resolvePackageManager(opts),\n );\n const { command, args } = createAddComponentsPlan({\n components,\n packageManager,\n yes: opts.yes,\n overwrite: opts.overwrite,\n cwd: opts.cwd,\n path: opts.path,\n });\n\n try {\n await runSpawn(command, args, opts.cwd);\n } catch (error) {\n if (error instanceof SpawnExitError) {\n logger.error(`Process exited with code ${error.code}`);\n process.exit(error.code);\n }\n const message = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to add components: ${message}`);\n process.exit(1);\n }\n\n logger.success(\"Components added successfully!\");\n });\n"],"mappings":";;;;;;AAWA,MAAM,oBAAoB;AAO1B,SAAgB,wBAAwB,QAOlB;CACpB,MAAM,kBAAkB,OAAO,WAAW,KAAK,MAAM;EACnD,IAAI,CAAC,mBAAmB,KAAK,CAAC,GAC5B,MAAM,IAAI,MAAM,2BAA2B,GAAG;EAEhD,OAAO,GAAG,kBAAkB,GAAG,mBAAmB,CAAC,EAAE;CACvD,CAAC;CAED,MAAM,CAAC,SAAS,WAAW,WAAW,OAAO,cAAc;CAC3D,MAAM,OAAO;EAAC,GAAG;EAAS;EAAiB;EAAO,GAAG;CAAe;CAIpE,IAAI,OAAO,KAAK,KAAK,KAAK,OAAO;CACjC,IAAI,OAAO,WAAW,KAAK,KAAK,aAAa;CAC7C,IAAI,OAAO,KAAK,KAAK,KAAK,SAAS,OAAO,GAAG;CAC7C,IAAI,OAAO,MAAM,KAAK,KAAK,UAAU,OAAO,IAAI;CAEhD,OAAO;EAAE;EAAS;CAAK;AACzB;AAEA,MAAa,MAAM,IAAI,QAAQ,CAAC,CAC7B,KAAK,KAAK,CAAC,CACX,YAAY,iCAAiC,CAAC,CAC9C,SAAS,mBAAmB,uBAAuB,CAAC,CACpD,OAAO,aAAa,6BAA6B,IAAI,CAAC,CACtD,OAAO,mBAAmB,6BAA6B,KAAK,CAAC,CAC7D,OACC,mBACA,6DACA,QAAQ,IAAI,CACd,CAAC,CACA,OAAO,qBAAqB,mCAAmC,CAAC,CAChE,OAAO,aAAa,oBAAoB,CAAC,CACzC,OAAO,cAAc,qBAAqB,CAAC,CAC3C,OAAO,cAAc,qBAAqB,CAAC,CAC3C,OAAO,aAAa,oBAAoB,CAAC,CACzC,OAAO,OAAO,YAAsB,SAAS;CAE5C,IAAI,CAAC,UAAU,KAAK,GAAG,GAAG;EACxB,OAAO,KACL,wFACF;EACA,OAAO,MAAM;CACf;CAEA,OAAO,KAAK,UAAU,WAAW,OAAO,iBAAiB;CAMzD,MAAM,EAAE,SAAS,SAAS,wBAAwB;EAChD;EACA,gBAAA,MAN2B,4BAC3B,KAAK,KACL,sBAAsB,IAAI,CAC5B;EAIE,KAAK,KAAK;EACV,WAAW,KAAK;EAChB,KAAK,KAAK;EACV,MAAM,KAAK;CACb,CAAC;CAED,IAAI;EACF,MAAM,SAAS,SAAS,MAAM,KAAK,GAAG;CACxC,SAAS,OAAO;EACd,IAAI,iBAAiB,gBAAgB;GACnC,OAAO,MAAM,4BAA4B,MAAM,MAAM;GACrD,QAAQ,KAAK,MAAM,IAAI;EACzB;EACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,OAAO,MAAM,6BAA6B,SAAS;EACnD,QAAQ,KAAK,CAAC;CAChB;CAEA,OAAO,QAAQ,gCAAgC;AACjD,CAAC"}
1
+ {"version":3,"file":"add.js","names":[],"sources":["../../src/commands/add.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { logger } from \"../lib/utils/logger\";\nimport { hasConfig } from \"../lib/utils/config\";\nimport {\n getComponentsJsonStyle,\n resolveRegistryItemUrl,\n} from \"../lib/utils/registry\";\nimport {\n dlxCommand,\n resolvePackageManager,\n resolvePackageManagerForCwd,\n type PackageManagerName,\n} from \"../lib/create-project\";\nimport { runSpawn, SpawnExitError } from \"../lib/run-spawn\";\n\nexport interface AddComponentsPlan {\n command: string;\n args: string[];\n}\n\nexport function createAddComponentsPlan(params: {\n components: string[];\n packageManager: PackageManagerName;\n yes?: boolean;\n overwrite?: boolean;\n cwd?: string;\n path?: string;\n style?: string;\n}): AddComponentsPlan {\n const componentsToAdd = params.components.map((c) => {\n if (!/^[a-zA-Z0-9-/]+$/.test(c)) {\n throw new Error(`Invalid component name: ${c}`);\n }\n return resolveRegistryItemUrl(c, params.style);\n });\n\n const [command, dlxArgs] = dlxCommand(params.packageManager);\n const args = [...dlxArgs, \"shadcn@latest\", \"add\", ...componentsToAdd];\n\n // For npm, dlxArgs may already include `--yes` for npx auto-install.\n // This flag is for shadcn's own confirmation prompt.\n if (params.yes) args.push(\"--yes\");\n if (params.overwrite) args.push(\"--overwrite\");\n if (params.cwd) args.push(\"--cwd\", params.cwd);\n if (params.path) args.push(\"--path\", params.path);\n\n return { command, args };\n}\n\nexport const add = new Command()\n .name(\"add\")\n .description(\"add a component to your project\")\n .argument(\"<components...>\", \"the components to add\")\n .option(\"-y, --yes\", \"skip confirmation prompt.\", true)\n .option(\"-o, --overwrite\", \"overwrite existing files.\", false)\n .option(\n \"-c, --cwd <cwd>\",\n \"the working directory. defaults to the current directory.\",\n process.cwd(),\n )\n .option(\"-p, --path <path>\", \"the path to add the component to.\")\n .option(\"--use-npm\", \"explicitly use npm\")\n .option(\"--use-pnpm\", \"explicitly use pnpm\")\n .option(\"--use-yarn\", \"explicitly use yarn\")\n .option(\"--use-bun\", \"explicitly use bun\")\n .action(async (components: string[], opts) => {\n // Check if project is initialized\n if (!hasConfig(opts.cwd)) {\n logger.warn(\n \"It looks like you haven't initialized your project yet — defaulting to Base UI flavored components. Run 'assistant-ui init' first for a configured setup.\",\n );\n logger.break();\n }\n\n logger.step(`Adding ${components.length} component(s)...`);\n\n const packageManager = await resolvePackageManagerForCwd(\n opts.cwd,\n resolvePackageManager(opts),\n );\n const style = getComponentsJsonStyle(opts.cwd);\n const { command, args } = createAddComponentsPlan({\n components,\n packageManager,\n yes: opts.yes,\n overwrite: opts.overwrite,\n cwd: opts.cwd,\n path: opts.path,\n ...(style === undefined ? {} : { style }),\n });\n\n try {\n await runSpawn(command, args, opts.cwd);\n } catch (error) {\n if (error instanceof SpawnExitError) {\n logger.error(`Process exited with code ${error.code}`);\n process.exit(error.code);\n }\n const message = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to add components: ${message}`);\n process.exit(1);\n }\n\n logger.success(\"Components added successfully!\");\n });\n"],"mappings":";;;;;;;AAoBA,SAAgB,wBAAwB,QAQlB;CACpB,MAAM,kBAAkB,OAAO,WAAW,KAAK,MAAM;EACnD,IAAI,CAAC,mBAAmB,KAAK,CAAC,GAC5B,MAAM,IAAI,MAAM,2BAA2B,GAAG;EAEhD,OAAO,uBAAuB,GAAG,OAAO,KAAK;CAC/C,CAAC;CAED,MAAM,CAAC,SAAS,WAAW,WAAW,OAAO,cAAc;CAC3D,MAAM,OAAO;EAAC,GAAG;EAAS;EAAiB;EAAO,GAAG;CAAe;CAIpE,IAAI,OAAO,KAAK,KAAK,KAAK,OAAO;CACjC,IAAI,OAAO,WAAW,KAAK,KAAK,aAAa;CAC7C,IAAI,OAAO,KAAK,KAAK,KAAK,SAAS,OAAO,GAAG;CAC7C,IAAI,OAAO,MAAM,KAAK,KAAK,UAAU,OAAO,IAAI;CAEhD,OAAO;EAAE;EAAS;CAAK;AACzB;AAEA,MAAa,MAAM,IAAI,QAAQ,CAAC,CAC7B,KAAK,KAAK,CAAC,CACX,YAAY,iCAAiC,CAAC,CAC9C,SAAS,mBAAmB,uBAAuB,CAAC,CACpD,OAAO,aAAa,6BAA6B,IAAI,CAAC,CACtD,OAAO,mBAAmB,6BAA6B,KAAK,CAAC,CAC7D,OACC,mBACA,6DACA,QAAQ,IAAI,CACd,CAAC,CACA,OAAO,qBAAqB,mCAAmC,CAAC,CAChE,OAAO,aAAa,oBAAoB,CAAC,CACzC,OAAO,cAAc,qBAAqB,CAAC,CAC3C,OAAO,cAAc,qBAAqB,CAAC,CAC3C,OAAO,aAAa,oBAAoB,CAAC,CACzC,OAAO,OAAO,YAAsB,SAAS;CAE5C,IAAI,CAAC,UAAU,KAAK,GAAG,GAAG;EACxB,OAAO,KACL,2JACF;EACA,OAAO,MAAM;CACf;CAEA,OAAO,KAAK,UAAU,WAAW,OAAO,iBAAiB;CAEzD,MAAM,iBAAiB,MAAM,4BAC3B,KAAK,KACL,sBAAsB,IAAI,CAC5B;CACA,MAAM,QAAQ,uBAAuB,KAAK,GAAG;CAC7C,MAAM,EAAE,SAAS,SAAS,wBAAwB;EAChD;EACA;EACA,KAAK,KAAK;EACV,WAAW,KAAK;EAChB,KAAK,KAAK;EACV,MAAM,KAAK;EACX,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;CACzC,CAAC;CAED,IAAI;EACF,MAAM,SAAS,SAAS,MAAM,KAAK,GAAG;CACxC,SAAS,OAAO;EACd,IAAI,iBAAiB,gBAAgB;GACnC,OAAO,MAAM,4BAA4B,MAAM,MAAM;GACrD,QAAQ,KAAK,MAAM,IAAI;EACzB;EACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,OAAO,MAAM,6BAA6B,SAAS;EACnD,QAAQ,KAAK,CAAC;CAChB;CAEA,OAAO,QAAQ,gCAAgC;AACjD,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { Command } from "commander";
2
-
3
2
  //#region src/commands/agent.d.ts
4
3
  declare const agent: Command;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","names":[],"sources":["../../src/commands/agent.ts"],"mappings":";;;cAuBa,KAAA,EAAK,OAcd"}
1
+ {"version":3,"file":"agent.d.ts","names":[],"sources":["../../src/commands/agent.ts"],"mappings":";;cAuBa,OAAK"}
@@ -1,6 +1,5 @@
1
1
  import { Command } from "commander";
2
2
  import * as p from "@clack/prompts";
3
-
4
3
  //#region src/commands/create.d.ts
5
4
  interface ProjectMetadata {
6
5
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","names":[],"sources":["../../src/commands/create.ts"],"mappings":";;;;UAqBiB,eAAA;EACf,IAAA;EACA,KAAA;EACA,WAAA;EACA,QAAA;EACA,IAAA;EACA,kBAAA;AAAA;AAAA,cAGW,gBAAA,EAAkB,eAAe;AAAA,iBAsPxB,cAAA,CAAe,MAAA;EACnC,QAAA;EACA,OAAA;EACA,UAAA;EACA,MAAA,UAAgB,CAAA,CAAE,MAAA;EAClB,QAAA,UAAkB,CAAA,CAAE,QAAA;AAAA,IAClB,OAAA,CAAQ,eAAA;AAAA,iBA2EI,6BAAA,CAA8B,MAAA;EAC5C,gBAAA;EACA,UAAA;AAAA;AAAA,iBAYc,gBAAA,CAAiB,MAAc;AAAA,UAO9B,uBAAA;EACf,QAAA;EACA,OAAA;EACA,MAAA;EACA,MAAA;EACA,GAAA;AAAA;AAAA,UAGe,wBAAA;EACf,QAAA;EACA,OAAA;EACA,MAAA;AAAA;AAAA,iBAac,uBAAA,CACd,IAAA,EAAM,uBAAA,GACL,wBAAwB;AAAA,cAoCd,MAAA,EAAM,OAsRf"}
1
+ {"version":3,"file":"create.d.ts","names":[],"sources":["../../src/commands/create.ts"],"mappings":";;;UAsBiB;EACf;EACA;EACA;EACA;EACA;EACA;;cAGW,kBAAkB;iBA8PT,eAAe;EACnC;EACA;EACA;EACA,gBAAgB,EAAE;EAClB,kBAAkB,EAAE;IAClB,QAAQ;iBA2EI,8BAA8B;EAC5C;EACA;;iBAYc,iBAAiB;UAOhB;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;iBAac,wBACd,MAAM,0BACL;cAoCU,QAAM"}
@@ -82,11 +82,11 @@ const PROJECT_METADATA = [
82
82
  hasLocalComponents: false
83
83
  },
84
84
  {
85
- name: "with-ai-sdk-v6",
86
- label: "AI SDK v6",
87
- description: "Vercel AI SDK v6",
85
+ name: "with-ai-sdk-v7",
86
+ label: "AI SDK v7",
87
+ description: "Vercel AI SDK v7",
88
88
  category: "example",
89
- path: "examples/with-ai-sdk-v6",
89
+ path: "examples/with-ai-sdk-v7",
90
90
  hasLocalComponents: false
91
91
  },
92
92
  {
@@ -143,7 +143,7 @@ const PROJECT_METADATA = [
143
143
  description: "Realtime voice with ElevenLabs",
144
144
  category: "example",
145
145
  path: "examples/with-elevenlabs-conversational",
146
- hasLocalComponents: true
146
+ hasLocalComponents: false
147
147
  },
148
148
  {
149
149
  name: "with-elevenlabs-scribe",
@@ -159,7 +159,7 @@ const PROJECT_METADATA = [
159
159
  description: "Realtime voice with LiveKit",
160
160
  category: "example",
161
161
  path: "examples/with-livekit",
162
- hasLocalComponents: true
162
+ hasLocalComponents: false
163
163
  },
164
164
  {
165
165
  name: "with-expo",
@@ -175,7 +175,7 @@ const PROJECT_METADATA = [
175
175
  description: "AI-driven interactive UI components",
176
176
  category: "example",
177
177
  path: "examples/with-interactables",
178
- hasLocalComponents: true
178
+ hasLocalComponents: false
179
179
  },
180
180
  {
181
181
  name: "with-external-store",
@@ -232,6 +232,14 @@ const PROJECT_METADATA = [
232
232
  category: "example",
233
233
  path: "examples/with-tanstack",
234
234
  hasLocalComponents: false
235
+ },
236
+ {
237
+ name: "with-resumable-stream",
238
+ label: "Resumable Stream",
239
+ description: "Resumable LLM stream that survives reload mid-response",
240
+ category: "example",
241
+ path: "examples/with-resumable-stream",
242
+ hasLocalComponents: false
235
243
  }
236
244
  ];
237
245
  const templateNames = PROJECT_METADATA.filter((m) => m.category === "template").map((m) => m.name);
@@ -412,6 +420,7 @@ const create = new Command().name("create").description("create a new project").
412
420
  const ref = await refPromise;
413
421
  if (!localSourceRoot && !ref) logger.warn("Could not resolve latest release, downloading from HEAD");
414
422
  logger.step(localSourceRoot ? `Copying project from local source: ${localSourceRoot}` : "Downloading project...");
423
+ let transformResult;
415
424
  try {
416
425
  const source = localSourceRoot ? {
417
426
  kind: "local",
@@ -429,7 +438,7 @@ const create = new Command().name("create").description("create a new project").
429
438
  logger.warn("Template not found at release tag, downloading from HEAD");
430
439
  await downloadProject(project.path, absoluteProjectDir);
431
440
  }
432
- await transformProject(absoluteProjectDir, {
441
+ transformResult = await transformProject(absoluteProjectDir, {
433
442
  hasLocalComponents: project.hasLocalComponents,
434
443
  skipInstall: opts.skipInstall,
435
444
  packageManager: pm
@@ -450,6 +459,15 @@ const create = new Command().name("create").description("create a new project").
450
459
  });
451
460
  throw err;
452
461
  }
462
+ if (transformResult.registryInstallFailure) {
463
+ process.removeListener("exit", cleanupOnExit);
464
+ logger.break();
465
+ logger.error("Project created with missing components.");
466
+ logger.info("Retry the component install with:");
467
+ logger.info(` cd ${resolvedProjectDirectory}`);
468
+ logger.info(` ${transformResult.registryInstallFailure.retryCommand}`);
469
+ process.exit(1);
470
+ }
453
471
  if (scaffoldSelector.preset) {
454
472
  const presetUrl = resolvePresetUrl(scaffoldSelector.preset);
455
473
  logger.info("Applying preset configuration...");
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","names":[],"sources":["../../src/commands/create.ts"],"sourcesContent":["import { Command, Option } from \"commander\";\nimport chalk from \"chalk\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { logger } from \"../lib/utils/logger\";\nimport {\n dlxCommand,\n downloadProject,\n resolveLatestReleaseRef,\n resolvePackageManager,\n resolvePackageManagerForCwd,\n scaffoldProject,\n transformProject,\n} from \"../lib/create-project\";\nimport { runSpawn, SpawnExitError } from \"../lib/run-spawn\";\nimport {\n buildSkillsAddCommand,\n resolveSkillsInstall,\n} from \"../lib/agent-skill\";\n\nexport interface ProjectMetadata {\n name: string;\n label: string;\n description?: string;\n category: \"template\" | \"example\";\n path: string;\n hasLocalComponents: boolean;\n}\n\nexport const PROJECT_METADATA: ProjectMetadata[] = [\n // Templates\n {\n name: \"default\",\n label: \"Default\",\n description: \"Default template with Vercel AI SDK\",\n category: \"template\",\n path: \"templates/default\",\n hasLocalComponents: false,\n },\n {\n name: \"minimal\",\n label: \"Minimal\",\n description: \"Bare-bones starting point\",\n category: \"template\",\n path: \"templates/minimal\",\n hasLocalComponents: true,\n },\n {\n name: \"cloud\",\n label: \"Cloud\",\n description: \"Cloud-backed persistence starter\",\n category: \"template\",\n path: \"templates/cloud\",\n hasLocalComponents: false,\n },\n {\n name: \"cloud-clerk\",\n label: \"Cloud + Clerk\",\n description: \"Cloud-backed starter with Clerk auth\",\n category: \"template\",\n path: \"templates/cloud-clerk\",\n hasLocalComponents: false,\n },\n {\n name: \"langchain\",\n label: \"LangChain\",\n description: \"LangGraph starter with the react-langchain adapter\",\n category: \"template\",\n path: \"templates/langchain\",\n hasLocalComponents: false,\n },\n {\n name: \"mcp\",\n label: \"MCP\",\n description: \"MCP tools + MCP Apps renderer starter\",\n category: \"template\",\n path: \"templates/mcp\",\n hasLocalComponents: false,\n },\n {\n name: \"eve\",\n label: \"Eve\",\n description: \"Eve agent + Next.js starter\",\n category: \"template\",\n path: \"templates/eve\",\n hasLocalComponents: false,\n },\n // Examples\n {\n name: \"with-ag-ui\",\n label: \"AG-UI\",\n description: \"AG-UI protocol integration\",\n category: \"example\",\n path: \"examples/with-ag-ui\",\n hasLocalComponents: false,\n },\n {\n name: \"with-google-adk\",\n label: \"Google ADK\",\n description: \"Google ADK agent integration\",\n category: \"example\",\n path: \"examples/with-google-adk\",\n hasLocalComponents: false,\n },\n {\n name: \"with-ai-sdk-v6\",\n label: \"AI SDK v6\",\n description: \"Vercel AI SDK v6\",\n category: \"example\",\n path: \"examples/with-ai-sdk-v6\",\n hasLocalComponents: false,\n },\n {\n name: \"with-eve\",\n label: \"Eve\",\n description: \"Eve agent integration\",\n category: \"example\",\n path: \"examples/with-eve\",\n hasLocalComponents: false,\n },\n {\n name: \"with-artifacts\",\n label: \"Artifacts\",\n description: \"Artifact rendering\",\n category: \"example\",\n path: \"examples/with-artifacts\",\n hasLocalComponents: false,\n },\n {\n name: \"with-assistant-transport\",\n label: \"Assistant Transport\",\n description: \"Assistant transport protocol\",\n category: \"example\",\n path: \"examples/with-assistant-transport\",\n hasLocalComponents: false,\n },\n {\n name: \"with-chain-of-thought\",\n label: \"Chain of Thought\",\n description: \"Chain-of-thought, tool calls, and source citations\",\n category: \"example\",\n path: \"examples/with-chain-of-thought\",\n hasLocalComponents: false,\n },\n {\n name: \"with-cloud\",\n label: \"Cloud Example\",\n description: \"Cloud integration example\",\n category: \"example\",\n path: \"examples/with-cloud\",\n hasLocalComponents: false,\n },\n {\n name: \"with-custom-thread-list\",\n label: \"Custom Thread List\",\n description: \"Custom thread list UI\",\n category: \"example\",\n path: \"examples/with-custom-thread-list\",\n hasLocalComponents: false,\n },\n {\n name: \"with-elevenlabs-conversational\",\n label: \"ElevenLabs Conversational\",\n description: \"Realtime voice with ElevenLabs\",\n category: \"example\",\n path: \"examples/with-elevenlabs-conversational\",\n hasLocalComponents: true,\n },\n {\n name: \"with-elevenlabs-scribe\",\n label: \"ElevenLabs Scribe\",\n description: \"Audio/speech integration\",\n category: \"example\",\n path: \"examples/with-elevenlabs-scribe\",\n hasLocalComponents: false,\n },\n {\n name: \"with-livekit\",\n label: \"LiveKit Voice\",\n description: \"Realtime voice with LiveKit\",\n category: \"example\",\n path: \"examples/with-livekit\",\n hasLocalComponents: true,\n },\n {\n name: \"with-expo\",\n label: \"Expo\",\n description: \"Expo / React Native\",\n category: \"example\",\n path: \"examples/with-expo\",\n hasLocalComponents: true,\n },\n {\n name: \"with-interactables\",\n label: \"Interactables\",\n description: \"AI-driven interactive UI components\",\n category: \"example\",\n path: \"examples/with-interactables\",\n hasLocalComponents: true,\n },\n {\n name: \"with-external-store\",\n label: \"External Store\",\n description: \"Custom message store\",\n category: \"example\",\n path: \"examples/with-external-store\",\n hasLocalComponents: false,\n },\n {\n name: \"with-ffmpeg\",\n label: \"FFmpeg\",\n description: \"File processing\",\n category: \"example\",\n path: \"examples/with-ffmpeg\",\n hasLocalComponents: false,\n },\n {\n name: \"with-langgraph\",\n label: \"LangGraph Example\",\n description: \"LangGraph integration\",\n category: \"example\",\n path: \"examples/with-langgraph\",\n hasLocalComponents: false,\n },\n {\n name: \"with-react-hook-form\",\n label: \"React Hook Form\",\n description: \"Form integration\",\n category: \"example\",\n path: \"examples/with-react-hook-form\",\n hasLocalComponents: false,\n },\n {\n name: \"with-react-ink\",\n label: \"React Ink\",\n description: \"Terminal UI chat\",\n category: \"example\",\n path: \"examples/with-react-ink\",\n hasLocalComponents: true,\n },\n {\n name: \"with-react-router\",\n label: \"React Router\",\n description: \"React Router v7 + Vite\",\n category: \"example\",\n path: \"examples/with-react-router\",\n hasLocalComponents: false,\n },\n {\n name: \"with-tanstack\",\n label: \"TanStack\",\n description: \"TanStack/React Router + Vite\",\n category: \"example\",\n path: \"examples/with-tanstack\",\n hasLocalComponents: false,\n },\n];\n\n// Examples that exist in the monorepo but are intentionally excluded from the CLI:\n//\n// - waterfall: Still in development, not ready for production.\n// - with-cloud-standalone: For cloud without assistant-ui — not for the\n// assistant-ui CLI.\n// - with-store: In development, not ready for public use of the tap store.\n// - with-tap-runtime: In development, not ready for public use of the tap\n// store.\n\nconst templateNames = PROJECT_METADATA.filter(\n (m) => m.category === \"template\",\n).map((m) => m.name);\n\nconst exampleNames = PROJECT_METADATA.filter(\n (m) => m.category === \"example\",\n).map((m) => m.name);\n\nexport async function resolveProject(params: {\n template?: string;\n example?: string;\n stdinIsTTY?: boolean;\n select?: typeof p.select;\n isCancel?: typeof p.isCancel;\n}): Promise<ProjectMetadata | null> {\n const {\n template,\n example,\n stdinIsTTY = process.stdin.isTTY,\n select = p.select,\n isCancel = p.isCancel,\n } = params;\n\n if (template !== undefined) {\n const meta = PROJECT_METADATA.find(\n (m) => m.name === template && m.category === \"template\",\n );\n if (!meta) {\n logger.error(`Unknown template: ${template}`);\n logger.info(`Available templates: ${templateNames.join(\", \")}`);\n process.exit(1);\n }\n return meta;\n }\n\n if (example !== undefined) {\n const meta = PROJECT_METADATA.find(\n (m) => m.name === example && m.category === \"example\",\n );\n if (!meta) {\n logger.error(`Unknown example: ${example}`);\n logger.info(`Available examples: ${exampleNames.join(\", \")}`);\n process.exit(1);\n }\n return meta;\n }\n\n if (!stdinIsTTY) {\n return PROJECT_METADATA.find((m) => m.name === \"default\")!;\n }\n\n const selected = await select({\n message: \"Select a project to scaffold:\",\n options: [\n {\n value: \"_separator\",\n label: \"────── Starter Templates ──────\",\n disabled: true,\n },\n ...PROJECT_METADATA.filter((m) => m.category === \"template\").map((m) => ({\n value: m.name,\n label: m.label,\n ...(m.description ? { hint: m.description } : {}),\n })),\n {\n value: \"_separator\",\n label: \"────── Feature Examples ──────\",\n disabled: true,\n },\n ...PROJECT_METADATA.filter((m) => m.category === \"example\").map((m) => ({\n value: m.name,\n label: m.label,\n ...(m.description ? { hint: m.description } : {}),\n })),\n ],\n });\n\n if (isCancel(selected)) {\n return null;\n }\n\n const meta = PROJECT_METADATA.find((m) => m.name === selected);\n if (!meta) {\n logger.error(`Unknown selection: ${String(selected)}`);\n process.exit(1);\n }\n return meta;\n}\n\nexport function resolveCreateProjectDirectory(params: {\n projectDirectory?: string;\n stdinIsTTY?: boolean;\n}): string | undefined {\n const { projectDirectory, stdinIsTTY = process.stdin.isTTY } = params;\n\n if (projectDirectory) return projectDirectory;\n if (!stdinIsTTY) return \"my-aui-app\";\n return undefined;\n}\n\nconst PLAYGROUND_PRESET_BASE_URL =\n \"https://www.assistant-ui.com/playground/init\";\n\nexport function resolvePresetUrl(preset: string): string {\n if (preset.startsWith(\"http://\") || preset.startsWith(\"https://\")) {\n return preset;\n }\n return `${PLAYGROUND_PRESET_BASE_URL}?preset=${encodeURIComponent(preset)}`;\n}\n\nexport interface ScaffoldSelectorOptions {\n template?: string;\n example?: string;\n preset?: string;\n native?: boolean;\n ink?: boolean;\n}\n\nexport interface ResolvedScaffoldSelector {\n template?: string;\n example?: string;\n preset?: string;\n}\n\nconst scaffoldSelectorHelp =\n \"Choose one scaffold selector: --template <name>, --example <name>, --native, or --ink. --preset <name-or-url> can be used with --template or by itself.\";\n\nfunction getPresetConflict(opts: ScaffoldSelectorOptions): string | undefined {\n if (opts.example !== undefined) return \"--example\";\n if (opts.native) return \"--native\";\n if (opts.ink) return \"--ink\";\n return undefined;\n}\n\nexport function resolveScaffoldSelector(\n opts: ScaffoldSelectorOptions,\n): ResolvedScaffoldSelector {\n const hasPreset = opts.preset !== undefined;\n const presetConflict = getPresetConflict(opts);\n const selectors = [\n opts.template !== undefined ? \"--template\" : undefined,\n opts.example !== undefined ? \"--example\" : undefined,\n opts.native ? \"--native\" : undefined,\n opts.ink ? \"--ink\" : undefined,\n ].filter((selector): selector is string => selector !== undefined);\n\n if (selectors.length > 1) {\n throw new Error(\n `Only one scaffold selector can be provided (${selectors.join(\", \")}). ${scaffoldSelectorHelp}`,\n );\n }\n\n if (hasPreset && presetConflict) {\n throw new Error(\n `Cannot use --preset with ${presetConflict}. ${scaffoldSelectorHelp}`,\n );\n }\n\n if (opts.native) return { example: \"with-expo\" };\n if (opts.ink) return { example: \"with-react-ink\" };\n\n if (opts.preset !== undefined && opts.template === undefined) {\n return { template: \"default\", preset: opts.preset };\n }\n\n return {\n ...(opts.template !== undefined && { template: opts.template }),\n ...(opts.example !== undefined && { example: opts.example }),\n ...(hasPreset && { preset: opts.preset }),\n };\n}\n\nexport const create = new Command()\n .name(\"create\")\n .description(\"create a new project\")\n .argument(\"[project-directory]\")\n .usage(`${chalk.green(\"[project-directory]\")} [options]`)\n .option(\n \"-t, --template <template>\",\n `template to use (${templateNames.join(\", \")})`,\n )\n .option(\n \"-e, --example <example>\",\n `create from an example (${exampleNames.join(\", \")})`,\n )\n .option(\n \"-p, --preset <name-or-url>\",\n \"preset name or URL (e.g., chatgpt or https://www.assistant-ui.com/playground/init?preset=chatgpt)\",\n )\n .option(\"--use-npm\", \"explicitly use npm\")\n .option(\"--use-pnpm\", \"explicitly use pnpm\")\n .option(\"--use-yarn\", \"explicitly use yarn\")\n .option(\"--use-bun\", \"explicitly use bun\")\n .option(\"--native\", \"create an Expo / React Native project\")\n .option(\"--ink\", \"create a React Ink terminal project\")\n .option(\"--skip-install\", \"skip installing packages\")\n .option(\"--skills\", \"add assistant-ui agent skills for AI coding assistants\")\n .option(\"--no-skills\", \"skip adding assistant-ui agent skills\")\n .addOption(\n new Option(\n \"--debug-source-root <path>\",\n \"copy templates/examples from a local assistant-ui repo root\",\n ).hideHelp(),\n )\n .action(async (projectDirectory, opts) => {\n let scaffoldSelector: ResolvedScaffoldSelector;\n try {\n scaffoldSelector = resolveScaffoldSelector(opts);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n logger.error(message);\n process.exit(1);\n }\n\n const localSourceRoot = opts.debugSourceRoot\n ? path.resolve(opts.debugSourceRoot)\n : undefined;\n\n // Start release ref resolution early (runs during user prompts)\n const refPromise = localSourceRoot\n ? Promise.resolve(undefined)\n : resolveLatestReleaseRef();\n\n // 1. Resolve project directory\n let resolvedProjectDirectory = resolveCreateProjectDirectory({\n projectDirectory,\n });\n\n if (!resolvedProjectDirectory) {\n const result = await p.text({\n message: \"Project name:\",\n placeholder: \"my-aui-app\",\n defaultValue: \"my-aui-app\",\n validate: (value?: string) => {\n const name = (value ?? \"\").trim();\n if (!name) return \"Project name cannot be empty\";\n if (name === \".\" || name === \"..\")\n return \"Project name cannot be . or ..\";\n if (name.includes(\"/\") || name.includes(\"\\\\\"))\n return \"Project name cannot contain path separators\";\n return undefined;\n },\n });\n\n if (p.isCancel(result)) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n resolvedProjectDirectory = result;\n }\n\n // Check directory\n const absoluteProjectDir = path.resolve(resolvedProjectDirectory);\n try {\n const files = fs.readdirSync(absoluteProjectDir);\n if (files.length > 0) {\n logger.error(\n `Directory ${resolvedProjectDirectory} already exists and is not empty`,\n );\n process.exit(1);\n }\n } catch (err: unknown) {\n const code =\n err instanceof Error ? (err as NodeJS.ErrnoException).code : undefined;\n if (code === \"ENOENT\") {\n // Directory doesn't exist — good, proceed\n } else if (code === \"ENOTDIR\") {\n logger.error(\n `${resolvedProjectDirectory} already exists and is not a directory`,\n );\n process.exit(1);\n } else {\n const message = err instanceof Error ? err.message : String(err);\n logger.error(`Cannot access ${resolvedProjectDirectory}: ${message}`);\n process.exit(1);\n }\n }\n\n // 2. Resolve scaffold target\n const project = await resolveProject(scaffoldSelector);\n if (!project) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n const stdinIsTTY = process.stdin.isTTY;\n let installSkills = resolveSkillsInstall({\n skills: opts.skills,\n stdinIsTTY,\n });\n if (installSkills === undefined) {\n const result = await p.confirm({\n message: \"Add assistant-ui agent skills for AI coding assistants?\",\n initialValue: true,\n });\n\n if (p.isCancel(result)) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n installSkills = result;\n }\n\n logger.info(`Creating project from ${project.category}: ${project.label}`);\n logger.break();\n\n const pm = await resolvePackageManagerForCwd(\n path.dirname(absoluteProjectDir),\n resolvePackageManager(opts),\n );\n\n // Clean up partial project directory on unexpected exit (e.g. Ctrl+C)\n const cleanupOnExit = () => {\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n };\n process.once(\"exit\", cleanupOnExit);\n\n try {\n // 3. Resolve latest release ref (started before prompts)\n if (!localSourceRoot) {\n logger.step(\"Resolving latest release...\");\n }\n const ref = await refPromise;\n if (!localSourceRoot && !ref) {\n logger.warn(\"Could not resolve latest release, downloading from HEAD\");\n }\n\n // 4. Scaffold project\n logger.step(\n localSourceRoot\n ? `Copying project from local source: ${localSourceRoot}`\n : \"Downloading project...\",\n );\n try {\n const source = localSourceRoot\n ? { kind: \"local\" as const, rootDir: localSourceRoot }\n : {\n kind: \"github\" as const,\n ref,\n };\n await scaffoldProject(project.path, absoluteProjectDir, source);\n\n // If the template didn't exist at the release tag, retry from HEAD\n if (\n !localSourceRoot &&\n ref &&\n !fs.existsSync(path.join(absoluteProjectDir, \"package.json\"))\n ) {\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n logger.warn(\n \"Template not found at release tag, downloading from HEAD\",\n );\n await downloadProject(project.path, absoluteProjectDir);\n }\n\n // 5. Run transform pipeline\n await transformProject(absoluteProjectDir, {\n hasLocalComponents: project.hasLocalComponents,\n skipInstall: opts.skipInstall,\n packageManager: pm,\n });\n\n if (installSkills) {\n logger.step(\"Adding assistant-ui agent skills...\");\n const [skillsCmd, skillsArgs] = buildSkillsAddCommand(pm, {\n stdinIsTTY,\n });\n try {\n await runSpawn(skillsCmd, skillsArgs, absoluteProjectDir);\n } catch {\n logger.warn(\n `Could not add assistant-ui agent skills. You can add them later with:\\n ${skillsCmd} ${skillsArgs.join(\" \")}`,\n );\n }\n }\n } catch (err) {\n // Clean up partially created project directory\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n throw err;\n }\n\n // 6. Apply preset if provided\n if (scaffoldSelector.preset) {\n const presetUrl = resolvePresetUrl(scaffoldSelector.preset);\n logger.info(\"Applying preset configuration...\");\n logger.break();\n const [dlxCmd, dlxArgs] = dlxCommand(pm);\n try {\n await runSpawn(\n dlxCmd,\n [\n ...dlxArgs,\n \"shadcn@latest\",\n \"add\",\n \"--yes\",\n \"--overwrite\",\n presetUrl,\n ],\n absoluteProjectDir,\n );\n } catch {\n logger.warn(\n `Preset application failed. You can retry manually with:\\n ${dlxCmd} ${[...dlxArgs, \"shadcn@latest\", \"add\", presetUrl].join(\" \")}`,\n );\n }\n }\n\n process.removeListener(\"exit\", cleanupOnExit);\n\n logger.break();\n logger.success(\"Project created successfully!\");\n logger.break();\n const runCmd = pm === \"npm\" ? \"npm run\" : pm;\n let devScript = \"dev\";\n let envFile = \".env.local\";\n try {\n const scaffoldedPkg = JSON.parse(\n fs.readFileSync(\n path.join(absoluteProjectDir, \"package.json\"),\n \"utf-8\",\n ),\n );\n devScript = scaffoldedPkg.scripts?.dev\n ? \"dev\"\n : scaffoldedPkg.scripts?.start\n ? \"start\"\n : \"dev\";\n envFile = scaffoldedPkg.dependencies?.next ? \".env.local\" : \".env\";\n } catch {\n // Fall back to defaults if package.json cannot be read\n }\n\n logger.info(\"Next steps:\");\n logger.info(` cd ${resolvedProjectDirectory}`);\n if (opts.skipInstall) {\n logger.info(` ${pm} install`);\n }\n logger.info(` # Set up your environment variables in ${envFile}`);\n logger.info(` ${runCmd} ${devScript}`);\n } catch (error) {\n if (error instanceof SpawnExitError) {\n logger.error(`Project creation failed with code ${error.code}`);\n process.exit(error.code);\n }\n const message = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to create project: ${message}`);\n process.exit(1);\n }\n });\n"],"mappings":";;;;;;;;;;AA8BA,MAAa,mBAAsC;CAEjD;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CAEA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;AACF;AAWA,MAAM,gBAAgB,iBAAiB,QACpC,MAAM,EAAE,aAAa,UACxB,CAAC,CAAC,KAAK,MAAM,EAAE,IAAI;A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QAAQ,0BAA0B;EAC9C,IAAI,KAAK,aACP,OAAO,KAAK,KAAK,GAAG,SAAS;EAE/B,OAAO,KAAK,4CAA4C,SAAS;EACjE,OAAO,KAAK,KAAK,OAAO,GAAG,WAAW;CACxC,SAAS,OAAO;EACd,IAAI,iBAAiB,gBAAgB;GACnC,OAAO,MAAM,qCAAqC,MAAM,MAAM;GAC9D,QAAQ,KAAK,MAAM,IAAI;EACzB;EACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,OAAO,MAAM,6BAA6B,SAAS;EACnD,QAAQ,KAAK,CAAC;CAChB;AACF,CAAC"}
1
+ {"version":3,"file":"create.js","names":[],"sources":["../../src/commands/create.ts"],"sourcesContent":["import { Command, Option } from \"commander\";\nimport chalk from \"chalk\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { logger } from \"../lib/utils/logger\";\nimport {\n dlxCommand,\n downloadProject,\n resolveLatestReleaseRef,\n resolvePackageManager,\n resolvePackageManagerForCwd,\n scaffoldProject,\n transformProject,\n type TransformResult,\n} from \"../lib/create-project\";\nimport { runSpawn, SpawnExitError } from \"../lib/run-spawn\";\nimport {\n buildSkillsAddCommand,\n resolveSkillsInstall,\n} from \"../lib/agent-skill\";\n\nexport interface ProjectMetadata {\n name: string;\n label: string;\n description?: string;\n category: \"template\" | \"example\";\n path: string;\n hasLocalComponents: boolean;\n}\n\nexport const PROJECT_METADATA: ProjectMetadata[] = [\n // Templates\n {\n name: \"default\",\n label: \"Default\",\n description: \"Default template with Vercel AI SDK\",\n category: \"template\",\n path: \"templates/default\",\n hasLocalComponents: false,\n },\n {\n name: \"minimal\",\n label: \"Minimal\",\n description: \"Bare-bones starting point\",\n category: \"template\",\n path: \"templates/minimal\",\n hasLocalComponents: true,\n },\n {\n name: \"cloud\",\n label: \"Cloud\",\n description: \"Cloud-backed persistence starter\",\n category: \"template\",\n path: \"templates/cloud\",\n hasLocalComponents: false,\n },\n {\n name: \"cloud-clerk\",\n label: \"Cloud + Clerk\",\n description: \"Cloud-backed starter with Clerk auth\",\n category: \"template\",\n path: \"templates/cloud-clerk\",\n hasLocalComponents: false,\n },\n {\n name: \"langchain\",\n label: \"LangChain\",\n description: \"LangGraph starter with the react-langchain adapter\",\n category: \"template\",\n path: \"templates/langchain\",\n hasLocalComponents: false,\n },\n {\n name: \"mcp\",\n label: \"MCP\",\n description: \"MCP tools + MCP Apps renderer starter\",\n category: \"template\",\n path: \"templates/mcp\",\n hasLocalComponents: false,\n },\n {\n name: \"eve\",\n label: \"Eve\",\n description: \"Eve agent + Next.js starter\",\n category: \"template\",\n path: \"templates/eve\",\n hasLocalComponents: false,\n },\n // Examples\n {\n name: \"with-ag-ui\",\n label: \"AG-UI\",\n description: \"AG-UI protocol integration\",\n category: \"example\",\n path: \"examples/with-ag-ui\",\n hasLocalComponents: false,\n },\n {\n name: \"with-google-adk\",\n label: \"Google ADK\",\n description: \"Google ADK agent integration\",\n category: \"example\",\n path: \"examples/with-google-adk\",\n hasLocalComponents: false,\n },\n {\n name: \"with-ai-sdk-v7\",\n label: \"AI SDK v7\",\n description: \"Vercel AI SDK v7\",\n category: \"example\",\n path: \"examples/with-ai-sdk-v7\",\n hasLocalComponents: false,\n },\n {\n name: \"with-eve\",\n label: \"Eve\",\n description: \"Eve agent integration\",\n category: \"example\",\n path: \"examples/with-eve\",\n hasLocalComponents: false,\n },\n {\n name: \"with-artifacts\",\n label: \"Artifacts\",\n description: \"Artifact rendering\",\n category: \"example\",\n path: \"examples/with-artifacts\",\n hasLocalComponents: false,\n },\n {\n name: \"with-assistant-transport\",\n label: \"Assistant Transport\",\n description: \"Assistant transport protocol\",\n category: \"example\",\n path: \"examples/with-assistant-transport\",\n hasLocalComponents: false,\n },\n {\n name: \"with-chain-of-thought\",\n label: \"Chain of Thought\",\n description: \"Chain-of-thought, tool calls, and source citations\",\n category: \"example\",\n path: \"examples/with-chain-of-thought\",\n hasLocalComponents: false,\n },\n {\n name: \"with-cloud\",\n label: \"Cloud Example\",\n description: \"Cloud integration example\",\n category: \"example\",\n path: \"examples/with-cloud\",\n hasLocalComponents: false,\n },\n {\n name: \"with-custom-thread-list\",\n label: \"Custom Thread List\",\n description: \"Custom thread list UI\",\n category: \"example\",\n path: \"examples/with-custom-thread-list\",\n hasLocalComponents: false,\n },\n {\n name: \"with-elevenlabs-conversational\",\n label: \"ElevenLabs Conversational\",\n description: \"Realtime voice with ElevenLabs\",\n category: \"example\",\n path: \"examples/with-elevenlabs-conversational\",\n hasLocalComponents: false,\n },\n {\n name: \"with-elevenlabs-scribe\",\n label: \"ElevenLabs Scribe\",\n description: \"Audio/speech integration\",\n category: \"example\",\n path: \"examples/with-elevenlabs-scribe\",\n hasLocalComponents: false,\n },\n {\n name: \"with-livekit\",\n label: \"LiveKit Voice\",\n description: \"Realtime voice with LiveKit\",\n category: \"example\",\n path: \"examples/with-livekit\",\n hasLocalComponents: false,\n },\n {\n name: \"with-expo\",\n label: \"Expo\",\n description: \"Expo / React Native\",\n category: \"example\",\n path: \"examples/with-expo\",\n hasLocalComponents: true,\n },\n {\n name: \"with-interactables\",\n label: \"Interactables\",\n description: \"AI-driven interactive UI components\",\n category: \"example\",\n path: \"examples/with-interactables\",\n hasLocalComponents: false,\n },\n {\n name: \"with-external-store\",\n label: \"External Store\",\n description: \"Custom message store\",\n category: \"example\",\n path: \"examples/with-external-store\",\n hasLocalComponents: false,\n },\n {\n name: \"with-ffmpeg\",\n label: \"FFmpeg\",\n description: \"File processing\",\n category: \"example\",\n path: \"examples/with-ffmpeg\",\n hasLocalComponents: false,\n },\n {\n name: \"with-langgraph\",\n label: \"LangGraph Example\",\n description: \"LangGraph integration\",\n category: \"example\",\n path: \"examples/with-langgraph\",\n hasLocalComponents: false,\n },\n {\n name: \"with-react-hook-form\",\n label: \"React Hook Form\",\n description: \"Form integration\",\n category: \"example\",\n path: \"examples/with-react-hook-form\",\n hasLocalComponents: false,\n },\n {\n name: \"with-react-ink\",\n label: \"React Ink\",\n description: \"Terminal UI chat\",\n category: \"example\",\n path: \"examples/with-react-ink\",\n hasLocalComponents: true,\n },\n {\n name: \"with-react-router\",\n label: \"React Router\",\n description: \"React Router v7 + Vite\",\n category: \"example\",\n path: \"examples/with-react-router\",\n hasLocalComponents: false,\n },\n {\n name: \"with-tanstack\",\n label: \"TanStack\",\n description: \"TanStack/React Router + Vite\",\n category: \"example\",\n path: \"examples/with-tanstack\",\n hasLocalComponents: false,\n },\n {\n name: \"with-resumable-stream\",\n label: \"Resumable Stream\",\n description: \"Resumable LLM stream that survives reload mid-response\",\n category: \"example\",\n path: \"examples/with-resumable-stream\",\n hasLocalComponents: false,\n },\n];\n\n// Examples that exist in the monorepo but are intentionally excluded from the CLI:\n//\n// - waterfall: Still in development, not ready for production.\n// - with-cloud-standalone: For cloud without assistant-ui — not for the\n// assistant-ui CLI.\n// - with-store: In development, not ready for public use of the tap store.\n// - with-tap-runtime: In development, not ready for public use of the tap\n// store.\n\nconst templateNames = PROJECT_METADATA.filter(\n (m) => m.category === \"template\",\n).map((m) => m.name);\n\nconst exampleNames = PROJECT_METADATA.filter(\n (m) => m.category === \"example\",\n).map((m) => m.name);\n\nexport async function resolveProject(params: {\n template?: string;\n example?: string;\n stdinIsTTY?: boolean;\n select?: typeof p.select;\n isCancel?: typeof p.isCancel;\n}): Promise<ProjectMetadata | null> {\n const {\n template,\n example,\n stdinIsTTY = process.stdin.isTTY,\n select = p.select,\n isCancel = p.isCancel,\n } = params;\n\n if (template !== undefined) {\n const meta = PROJECT_METADATA.find(\n (m) => m.name === template && m.category === \"template\",\n );\n if (!meta) {\n logger.error(`Unknown template: ${template}`);\n logger.info(`Available templates: ${templateNames.join(\", \")}`);\n process.exit(1);\n }\n return meta;\n }\n\n if (example !== undefined) {\n const meta = PROJECT_METADATA.find(\n (m) => m.name === example && m.category === \"example\",\n );\n if (!meta) {\n logger.error(`Unknown example: ${example}`);\n logger.info(`Available examples: ${exampleNames.join(\", \")}`);\n process.exit(1);\n }\n return meta;\n }\n\n if (!stdinIsTTY) {\n return PROJECT_METADATA.find((m) => m.name === \"default\")!;\n }\n\n const selected = await select({\n message: \"Select a project to scaffold:\",\n options: [\n {\n value: \"_separator\",\n label: \"────── Starter Templates ──────\",\n disabled: true,\n },\n ...PROJECT_METADATA.filter((m) => m.category === \"template\").map((m) => ({\n value: m.name,\n label: m.label,\n ...(m.description ? { hint: m.description } : {}),\n })),\n {\n value: \"_separator\",\n label: \"────── Feature Examples ──────\",\n disabled: true,\n },\n ...PROJECT_METADATA.filter((m) => m.category === \"example\").map((m) => ({\n value: m.name,\n label: m.label,\n ...(m.description ? { hint: m.description } : {}),\n })),\n ],\n });\n\n if (isCancel(selected)) {\n return null;\n }\n\n const meta = PROJECT_METADATA.find((m) => m.name === selected);\n if (!meta) {\n logger.error(`Unknown selection: ${String(selected)}`);\n process.exit(1);\n }\n return meta;\n}\n\nexport function resolveCreateProjectDirectory(params: {\n projectDirectory?: string;\n stdinIsTTY?: boolean;\n}): string | undefined {\n const { projectDirectory, stdinIsTTY = process.stdin.isTTY } = params;\n\n if (projectDirectory) return projectDirectory;\n if (!stdinIsTTY) return \"my-aui-app\";\n return undefined;\n}\n\nconst PLAYGROUND_PRESET_BASE_URL =\n \"https://www.assistant-ui.com/playground/init\";\n\nexport function resolvePresetUrl(preset: string): string {\n if (preset.startsWith(\"http://\") || preset.startsWith(\"https://\")) {\n return preset;\n }\n return `${PLAYGROUND_PRESET_BASE_URL}?preset=${encodeURIComponent(preset)}`;\n}\n\nexport interface ScaffoldSelectorOptions {\n template?: string;\n example?: string;\n preset?: string;\n native?: boolean;\n ink?: boolean;\n}\n\nexport interface ResolvedScaffoldSelector {\n template?: string;\n example?: string;\n preset?: string;\n}\n\nconst scaffoldSelectorHelp =\n \"Choose one scaffold selector: --template <name>, --example <name>, --native, or --ink. --preset <name-or-url> can be used with --template or by itself.\";\n\nfunction getPresetConflict(opts: ScaffoldSelectorOptions): string | undefined {\n if (opts.example !== undefined) return \"--example\";\n if (opts.native) return \"--native\";\n if (opts.ink) return \"--ink\";\n return undefined;\n}\n\nexport function resolveScaffoldSelector(\n opts: ScaffoldSelectorOptions,\n): ResolvedScaffoldSelector {\n const hasPreset = opts.preset !== undefined;\n const presetConflict = getPresetConflict(opts);\n const selectors = [\n opts.template !== undefined ? \"--template\" : undefined,\n opts.example !== undefined ? \"--example\" : undefined,\n opts.native ? \"--native\" : undefined,\n opts.ink ? \"--ink\" : undefined,\n ].filter((selector): selector is string => selector !== undefined);\n\n if (selectors.length > 1) {\n throw new Error(\n `Only one scaffold selector can be provided (${selectors.join(\", \")}). ${scaffoldSelectorHelp}`,\n );\n }\n\n if (hasPreset && presetConflict) {\n throw new Error(\n `Cannot use --preset with ${presetConflict}. ${scaffoldSelectorHelp}`,\n );\n }\n\n if (opts.native) return { example: \"with-expo\" };\n if (opts.ink) return { example: \"with-react-ink\" };\n\n if (opts.preset !== undefined && opts.template === undefined) {\n return { template: \"default\", preset: opts.preset };\n }\n\n return {\n ...(opts.template !== undefined && { template: opts.template }),\n ...(opts.example !== undefined && { example: opts.example }),\n ...(hasPreset && { preset: opts.preset }),\n };\n}\n\nexport const create = new Command()\n .name(\"create\")\n .description(\"create a new project\")\n .argument(\"[project-directory]\")\n .usage(`${chalk.green(\"[project-directory]\")} [options]`)\n .option(\n \"-t, --template <template>\",\n `template to use (${templateNames.join(\", \")})`,\n )\n .option(\n \"-e, --example <example>\",\n `create from an example (${exampleNames.join(\", \")})`,\n )\n .option(\n \"-p, --preset <name-or-url>\",\n \"preset name or URL (e.g., chatgpt or https://www.assistant-ui.com/playground/init?preset=chatgpt)\",\n )\n .option(\"--use-npm\", \"explicitly use npm\")\n .option(\"--use-pnpm\", \"explicitly use pnpm\")\n .option(\"--use-yarn\", \"explicitly use yarn\")\n .option(\"--use-bun\", \"explicitly use bun\")\n .option(\"--native\", \"create an Expo / React Native project\")\n .option(\"--ink\", \"create a React Ink terminal project\")\n .option(\"--skip-install\", \"skip installing packages\")\n .option(\"--skills\", \"add assistant-ui agent skills for AI coding assistants\")\n .option(\"--no-skills\", \"skip adding assistant-ui agent skills\")\n .addOption(\n new Option(\n \"--debug-source-root <path>\",\n \"copy templates/examples from a local assistant-ui repo root\",\n ).hideHelp(),\n )\n .action(async (projectDirectory, opts) => {\n let scaffoldSelector: ResolvedScaffoldSelector;\n try {\n scaffoldSelector = resolveScaffoldSelector(opts);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n logger.error(message);\n process.exit(1);\n }\n\n const localSourceRoot = opts.debugSourceRoot\n ? path.resolve(opts.debugSourceRoot)\n : undefined;\n\n // Start release ref resolution early (runs during user prompts)\n const refPromise = localSourceRoot\n ? Promise.resolve(undefined)\n : resolveLatestReleaseRef();\n\n // 1. Resolve project directory\n let resolvedProjectDirectory = resolveCreateProjectDirectory({\n projectDirectory,\n });\n\n if (!resolvedProjectDirectory) {\n const result = await p.text({\n message: \"Project name:\",\n placeholder: \"my-aui-app\",\n defaultValue: \"my-aui-app\",\n validate: (value?: string) => {\n const name = (value ?? \"\").trim();\n if (!name) return \"Project name cannot be empty\";\n if (name === \".\" || name === \"..\")\n return \"Project name cannot be . or ..\";\n if (name.includes(\"/\") || name.includes(\"\\\\\"))\n return \"Project name cannot contain path separators\";\n return undefined;\n },\n });\n\n if (p.isCancel(result)) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n resolvedProjectDirectory = result;\n }\n\n // Check directory\n const absoluteProjectDir = path.resolve(resolvedProjectDirectory);\n try {\n const files = fs.readdirSync(absoluteProjectDir);\n if (files.length > 0) {\n logger.error(\n `Directory ${resolvedProjectDirectory} already exists and is not empty`,\n );\n process.exit(1);\n }\n } catch (err: unknown) {\n const code =\n err instanceof Error ? (err as NodeJS.ErrnoException).code : undefined;\n if (code === \"ENOENT\") {\n // Directory doesn't exist — good, proceed\n } else if (code === \"ENOTDIR\") {\n logger.error(\n `${resolvedProjectDirectory} already exists and is not a directory`,\n );\n process.exit(1);\n } else {\n const message = err instanceof Error ? err.message : String(err);\n logger.error(`Cannot access ${resolvedProjectDirectory}: ${message}`);\n process.exit(1);\n }\n }\n\n // 2. Resolve scaffold target\n const project = await resolveProject(scaffoldSelector);\n if (!project) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n const stdinIsTTY = process.stdin.isTTY;\n let installSkills = resolveSkillsInstall({\n skills: opts.skills,\n stdinIsTTY,\n });\n if (installSkills === undefined) {\n const result = await p.confirm({\n message: \"Add assistant-ui agent skills for AI coding assistants?\",\n initialValue: true,\n });\n\n if (p.isCancel(result)) {\n p.cancel(\"Project creation cancelled.\");\n process.exit(0);\n }\n\n installSkills = result;\n }\n\n logger.info(`Creating project from ${project.category}: ${project.label}`);\n logger.break();\n\n const pm = await resolvePackageManagerForCwd(\n path.dirname(absoluteProjectDir),\n resolvePackageManager(opts),\n );\n\n // Clean up partial project directory on unexpected exit (e.g. Ctrl+C)\n const cleanupOnExit = () => {\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n };\n process.once(\"exit\", cleanupOnExit);\n\n try {\n // 3. Resolve latest release ref (started before prompts)\n if (!localSourceRoot) {\n logger.step(\"Resolving latest release...\");\n }\n const ref = await refPromise;\n if (!localSourceRoot && !ref) {\n logger.warn(\"Could not resolve latest release, downloading from HEAD\");\n }\n\n // 4. Scaffold project\n logger.step(\n localSourceRoot\n ? `Copying project from local source: ${localSourceRoot}`\n : \"Downloading project...\",\n );\n let transformResult: TransformResult;\n try {\n const source = localSourceRoot\n ? { kind: \"local\" as const, rootDir: localSourceRoot }\n : {\n kind: \"github\" as const,\n ref,\n };\n await scaffoldProject(project.path, absoluteProjectDir, source);\n\n // If the template didn't exist at the release tag, retry from HEAD\n if (\n !localSourceRoot &&\n ref &&\n !fs.existsSync(path.join(absoluteProjectDir, \"package.json\"))\n ) {\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n logger.warn(\n \"Template not found at release tag, downloading from HEAD\",\n );\n await downloadProject(project.path, absoluteProjectDir);\n }\n\n // 5. Run transform pipeline\n transformResult = await transformProject(absoluteProjectDir, {\n hasLocalComponents: project.hasLocalComponents,\n skipInstall: opts.skipInstall,\n packageManager: pm,\n });\n\n if (installSkills) {\n logger.step(\"Adding assistant-ui agent skills...\");\n const [skillsCmd, skillsArgs] = buildSkillsAddCommand(pm, {\n stdinIsTTY,\n });\n try {\n await runSpawn(skillsCmd, skillsArgs, absoluteProjectDir);\n } catch {\n logger.warn(\n `Could not add assistant-ui agent skills. You can add them later with:\\n ${skillsCmd} ${skillsArgs.join(\" \")}`,\n );\n }\n }\n } catch (err) {\n // Clean up partially created project directory\n fs.rmSync(absoluteProjectDir, { recursive: true, force: true });\n throw err;\n }\n\n if (transformResult.registryInstallFailure) {\n process.removeListener(\"exit\", cleanupOnExit);\n logger.break();\n logger.error(\"Project created with missing components.\");\n logger.info(\"Retry the component install with:\");\n logger.info(` cd ${resolvedProjectDirectory}`);\n logger.info(` ${transformResult.registryInstallFailure.retryCommand}`);\n process.exit(1);\n }\n\n // 6. Apply preset if provided\n if (scaffoldSelector.preset) {\n const presetUrl = resolvePresetUrl(scaffoldSelector.preset);\n logger.info(\"Applying preset configuration...\");\n logger.break();\n const [dlxCmd, dlxArgs] = dlxCommand(pm);\n try {\n await runSpawn(\n dlxCmd,\n [\n ...dlxArgs,\n \"shadcn@latest\",\n \"add\",\n \"--yes\",\n \"--overwrite\",\n presetUrl,\n ],\n absoluteProjectDir,\n );\n } catch {\n logger.warn(\n `Preset application failed. You can retry manually with:\\n ${dlxCmd} ${[...dlxArgs, \"shadcn@latest\", \"add\", presetUrl].join(\" \")}`,\n );\n }\n }\n\n process.removeListener(\"exit\", cleanupOnExit);\n\n logger.break();\n logger.success(\"Project created successfully!\");\n logger.break();\n const runCmd = pm === \"npm\" ? \"npm run\" : pm;\n let devScript = \"dev\";\n let envFile = \".env.local\";\n try {\n const scaffoldedPkg = JSON.parse(\n fs.readFileSync(\n path.join(absoluteProjectDir, \"package.json\"),\n \"utf-8\",\n ),\n );\n devScript = scaffoldedPkg.scripts?.dev\n ? \"dev\"\n : scaffoldedPkg.scripts?.start\n ? \"start\"\n : \"dev\";\n envFile = scaffoldedPkg.dependencies?.next ? \".env.local\" : \".env\";\n } catch {\n // Fall back to defaults if package.json cannot be read\n }\n\n logger.info(\"Next steps:\");\n logger.info(` cd ${resolvedProjectDirectory}`);\n if (opts.skipInstall) {\n logger.info(` ${pm} install`);\n }\n logger.info(` # Set up your environment variables in ${envFile}`);\n logger.info(` ${runCmd} ${devScript}`);\n } catch (error) {\n if (error instanceof SpawnExitError) {\n logger.error(`Project creation failed with code ${error.code}`);\n process.exit(error.code);\n }\n const message = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to create project: ${message}`);\n process.exit(1);\n }\n });\n"],"mappings":";;;;;;;;;;AA+BA,MAAa,mBAAsC;CAEjD;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CAEA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,MAAM;EACN,oBAAoB;CACtB;CACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,UAAU;EACV,M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,KAAK,kCAAkC;GAC9C,OAAO,MAAM;GACb,MAAM,CAAC,QAAQ,WAAW,WAAW,EAAE;GACvC,IAAI;IACF,MAAM,SACJ,QACA;KACE,GAAG;KACH;KACA;KACA;KACA;KACA;IACF,GACA,kBACF;GACF,QAAQ;IACN,OAAO,KACL,8DAA8D,OAAO,GAAG;KAAC,GAAG;KAAS;KAAiB;KAAO;IAAS,CAAC,CAAC,KAAK,GAAG,GAClI;GACF;EACF;EAEA,QAAQ,eAAe,QAAQ,aAAa;EAE5C,OAAO,MAAM;EACb,OAAO,QAAQ,+BAA+B;EAC9C,OAAO,MAAM;EACb,MAAM,SAAS,OAAO,QAAQ,YAAY;EAC1C,IAAI,YAAY;EAChB,IAAI,UAAU;EACd,IAAI;GACF,MAAM,gBAAgB,KAAK,MACzB,GAAG,aACD,KAAK,KAAK,oBAAoB,cAAc,GAC5C,OACF,CACF;GACA,YAAY,cAAc,SAAS,MAC/B,QACA,cAAc,SAAS,QACrB,UACA;GACN,UAAU,cAAc,cAAc,OAAO,eAAe;EAC9D,QAAQ,CAER;EAEA,OAAO,KAAK,aAAa;EACzB,OAAO,KAAK,QAAQ,0BAA0B;EAC9C,IAAI,KAAK,aACP,OAAO,KAAK,KAAK,GAAG,SAAS;EAE/B,OAAO,KAAK,4CAA4C,SAAS;EACjE,OAAO,KAAK,KAAK,OAAO,GAAG,WAAW;CACxC,SAAS,OAAO;EACd,IAAI,iBAAiB,gBAAgB;GACnC,OAAO,MAAM,qCAAqC,MAAM,MAAM;GAC9D,QAAQ,KAAK,MAAM,IAAI;EACzB;EACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACrE,OAAO,MAAM,6BAA6B,SAAS;EACnD,QAAQ,KAAK,CAAC;CAChB;AACF,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { Command } from "commander";
2
-
3
2
  //#region src/commands/doctor.d.ts
4
3
  interface DiscoveredPackage {
5
4
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","names":[],"sources":["../../src/commands/doctor.ts"],"mappings":";;;UAiBiB,iBAAA;EACf,IAAA;EACA,OAAA;EACA,WAAA;AAAA;AAAA,iBA2Fc,yBAAA,CAA0B,GAAA,WAAc,iBAAiB;AAAA,UAOxD,cAAA;EACf,IAAA;EACA,aAAA,EAAe,iBAAiB;AAAA;AAAA,iBAGlB,cAAA,CACd,QAAA,EAAU,iBAAA,KACT,cAAc;AAAA,iBAmBD,kBAAA,CAAmB,QAA6B,EAAnB,iBAAiB;AAAA,iBAqD9C,aAAA,CAAc,CAAA,UAAW,CAAS;AAAA,UAkBjC,eAAA;EACf,IAAA;EACA,OAAA;EACA,MAAA;AAAA;AAAA,iBAGc,YAAA,CACd,QAAA,EAAU,iBAAA,IACV,MAAA,EAAQ,GAAA,0BACP,eAAA;AAAA,cAsFU,MAAA,EAAM,OA6Df"}
1
+ {"version":3,"file":"doctor.d.ts","names":[],"sources":["../../src/commands/doctor.ts"],"mappings":";;UAmBiB;EACf;EACA;EACA;;iBAiKc,0BAA0B,cAAc;UAiBvC;EACf;EACA,eAAe;;iBAGD,eACd,UAAU,sBACT;iBAmBa,mBAAmB,UAAU;iBAmC7B,cAAc,WAAW;UAOxB;EACf;EACA;EACA;;iBAGc,aACd,UAAU,qBACV,QAAQ,6BACP;cAsFU,QAAM"}