@hypercli/gen 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -0
  3. package/dist/actions/communication.d.ts +201 -0
  4. package/dist/actions/communication.d.ts.map +1 -0
  5. package/dist/actions/communication.js +515 -0
  6. package/dist/actions/communication.js.map +1 -0
  7. package/dist/actions/decorator.d.ts +22 -0
  8. package/dist/actions/decorator.d.ts.map +1 -0
  9. package/dist/actions/decorator.js +110 -0
  10. package/dist/actions/decorator.js.map +1 -0
  11. package/dist/actions/executor.d.ts +85 -0
  12. package/dist/actions/executor.d.ts.map +1 -0
  13. package/dist/actions/executor.js +289 -0
  14. package/dist/actions/executor.js.map +1 -0
  15. package/dist/actions/index.d.ts +14 -0
  16. package/dist/actions/index.d.ts.map +1 -0
  17. package/dist/actions/index.js +15 -0
  18. package/dist/actions/index.js.map +1 -0
  19. package/dist/actions/parameter-resolver.d.ts +54 -0
  20. package/dist/actions/parameter-resolver.d.ts.map +1 -0
  21. package/dist/actions/parameter-resolver.js +300 -0
  22. package/dist/actions/parameter-resolver.js.map +1 -0
  23. package/dist/actions/registry.d.ts +78 -0
  24. package/dist/actions/registry.d.ts.map +1 -0
  25. package/dist/actions/registry.js +221 -0
  26. package/dist/actions/registry.js.map +1 -0
  27. package/dist/actions/types.d.ts +109 -0
  28. package/dist/actions/types.d.ts.map +1 -0
  29. package/dist/actions/types.js +31 -0
  30. package/dist/actions/types.js.map +1 -0
  31. package/dist/actions/utils.d.ts +42 -0
  32. package/dist/actions/utils.d.ts.map +1 -0
  33. package/dist/actions/utils.js +144 -0
  34. package/dist/actions/utils.js.map +1 -0
  35. package/dist/ai/ai-collector.d.ts +52 -0
  36. package/dist/ai/ai-collector.d.ts.map +1 -0
  37. package/dist/ai/ai-collector.js +64 -0
  38. package/dist/ai/ai-collector.js.map +1 -0
  39. package/dist/ai/ai-config.d.ts +230 -0
  40. package/dist/ai/ai-config.d.ts.map +1 -0
  41. package/dist/ai/ai-config.js +8 -0
  42. package/dist/ai/ai-config.js.map +1 -0
  43. package/dist/ai/ai-service.d.ts +66 -0
  44. package/dist/ai/ai-service.d.ts.map +1 -0
  45. package/dist/ai/ai-service.js +198 -0
  46. package/dist/ai/ai-service.js.map +1 -0
  47. package/dist/ai/ai-variable-resolver.d.ts +59 -0
  48. package/dist/ai/ai-variable-resolver.d.ts.map +1 -0
  49. package/dist/ai/ai-variable-resolver.js +219 -0
  50. package/dist/ai/ai-variable-resolver.js.map +1 -0
  51. package/dist/ai/context-collector.d.ts +30 -0
  52. package/dist/ai/context-collector.d.ts.map +1 -0
  53. package/dist/ai/context-collector.js +158 -0
  54. package/dist/ai/context-collector.js.map +1 -0
  55. package/dist/ai/cost-tracker.d.ts +41 -0
  56. package/dist/ai/cost-tracker.d.ts.map +1 -0
  57. package/dist/ai/cost-tracker.js +131 -0
  58. package/dist/ai/cost-tracker.js.map +1 -0
  59. package/dist/ai/env.d.ts +36 -0
  60. package/dist/ai/env.d.ts.map +1 -0
  61. package/dist/ai/env.js +100 -0
  62. package/dist/ai/env.js.map +1 -0
  63. package/dist/ai/index.d.ts +17 -0
  64. package/dist/ai/index.d.ts.map +1 -0
  65. package/dist/ai/index.js +25 -0
  66. package/dist/ai/index.js.map +1 -0
  67. package/dist/ai/model-router.d.ts +32 -0
  68. package/dist/ai/model-router.d.ts.map +1 -0
  69. package/dist/ai/model-router.js +113 -0
  70. package/dist/ai/model-router.js.map +1 -0
  71. package/dist/ai/output-validator.d.ts +24 -0
  72. package/dist/ai/output-validator.d.ts.map +1 -0
  73. package/dist/ai/output-validator.js +279 -0
  74. package/dist/ai/output-validator.js.map +1 -0
  75. package/dist/ai/prompt-assembler.d.ts +30 -0
  76. package/dist/ai/prompt-assembler.d.ts.map +1 -0
  77. package/dist/ai/prompt-assembler.js +93 -0
  78. package/dist/ai/prompt-assembler.js.map +1 -0
  79. package/dist/ai/prompt-pipeline.d.ts +63 -0
  80. package/dist/ai/prompt-pipeline.d.ts.map +1 -0
  81. package/dist/ai/prompt-pipeline.js +119 -0
  82. package/dist/ai/prompt-pipeline.js.map +1 -0
  83. package/dist/ai/prompt-template.jig +88 -0
  84. package/dist/ai/transports/api-transport.d.ts +12 -0
  85. package/dist/ai/transports/api-transport.d.ts.map +1 -0
  86. package/dist/ai/transports/api-transport.js +86 -0
  87. package/dist/ai/transports/api-transport.js.map +1 -0
  88. package/dist/ai/transports/command-transport.d.ts +20 -0
  89. package/dist/ai/transports/command-transport.d.ts.map +1 -0
  90. package/dist/ai/transports/command-transport.js +203 -0
  91. package/dist/ai/transports/command-transport.js.map +1 -0
  92. package/dist/ai/transports/index.d.ts +11 -0
  93. package/dist/ai/transports/index.d.ts.map +1 -0
  94. package/dist/ai/transports/index.js +10 -0
  95. package/dist/ai/transports/index.js.map +1 -0
  96. package/dist/ai/transports/resolve-transport.d.ts +15 -0
  97. package/dist/ai/transports/resolve-transport.d.ts.map +1 -0
  98. package/dist/ai/transports/resolve-transport.js +96 -0
  99. package/dist/ai/transports/resolve-transport.js.map +1 -0
  100. package/dist/ai/transports/stdout-transport.d.ts +14 -0
  101. package/dist/ai/transports/stdout-transport.d.ts.map +1 -0
  102. package/dist/ai/transports/stdout-transport.js +27 -0
  103. package/dist/ai/transports/stdout-transport.js.map +1 -0
  104. package/dist/ai/transports/types.d.ts +77 -0
  105. package/dist/ai/transports/types.d.ts.map +1 -0
  106. package/dist/ai/transports/types.js +8 -0
  107. package/dist/ai/transports/types.js.map +1 -0
  108. package/dist/commands/cookbook/info.d.ts +22 -0
  109. package/dist/commands/cookbook/info.d.ts.map +1 -0
  110. package/dist/commands/cookbook/info.js +217 -0
  111. package/dist/commands/cookbook/info.js.map +1 -0
  112. package/dist/commands/cookbook/list.d.ts +20 -0
  113. package/dist/commands/cookbook/list.d.ts.map +1 -0
  114. package/dist/commands/cookbook/list.js +133 -0
  115. package/dist/commands/cookbook/list.js.map +1 -0
  116. package/dist/commands/gen.d.ts +65 -0
  117. package/dist/commands/gen.d.ts.map +1 -0
  118. package/dist/commands/gen.js +478 -0
  119. package/dist/commands/gen.js.map +1 -0
  120. package/dist/commands/recipe/info.d.ts +18 -0
  121. package/dist/commands/recipe/info.d.ts.map +1 -0
  122. package/dist/commands/recipe/info.js +89 -0
  123. package/dist/commands/recipe/info.js.map +1 -0
  124. package/dist/commands/recipe/list.d.ts +29 -0
  125. package/dist/commands/recipe/list.d.ts.map +1 -0
  126. package/dist/commands/recipe/list.js +215 -0
  127. package/dist/commands/recipe/list.js.map +1 -0
  128. package/dist/commands/recipe/run.d.ts +44 -0
  129. package/dist/commands/recipe/run.d.ts.map +1 -0
  130. package/dist/commands/recipe/run.js +239 -0
  131. package/dist/commands/recipe/run.js.map +1 -0
  132. package/dist/commands/recipe/validate.d.ts +19 -0
  133. package/dist/commands/recipe/validate.d.ts.map +1 -0
  134. package/dist/commands/recipe/validate.js +66 -0
  135. package/dist/commands/recipe/validate.js.map +1 -0
  136. package/dist/discovery/generator-discovery.d.ts +130 -0
  137. package/dist/discovery/generator-discovery.d.ts.map +1 -0
  138. package/dist/discovery/generator-discovery.js +674 -0
  139. package/dist/discovery/generator-discovery.js.map +1 -0
  140. package/dist/discovery/index.d.ts +8 -0
  141. package/dist/discovery/index.d.ts.map +1 -0
  142. package/dist/discovery/index.js +7 -0
  143. package/dist/discovery/index.js.map +1 -0
  144. package/dist/hooks/command-not-found.d.ts +18 -0
  145. package/dist/hooks/command-not-found.d.ts.map +1 -0
  146. package/dist/hooks/command-not-found.js +182 -0
  147. package/dist/hooks/command-not-found.js.map +1 -0
  148. package/dist/hooks/suggest.d.ts +13 -0
  149. package/dist/hooks/suggest.d.ts.map +1 -0
  150. package/dist/hooks/suggest.js +28 -0
  151. package/dist/hooks/suggest.js.map +1 -0
  152. package/dist/index.d.ts +2 -0
  153. package/dist/index.d.ts.map +1 -0
  154. package/dist/index.js +3 -0
  155. package/dist/index.js.map +1 -0
  156. package/dist/lib/base-command.d.ts +26 -0
  157. package/dist/lib/base-command.d.ts.map +1 -0
  158. package/dist/lib/base-command.js +24 -0
  159. package/dist/lib/base-command.js.map +1 -0
  160. package/dist/lib/flags.d.ts +33 -0
  161. package/dist/lib/flags.d.ts.map +1 -0
  162. package/dist/lib/flags.js +64 -0
  163. package/dist/lib/flags.js.map +1 -0
  164. package/dist/ops/add.d.ts +4 -0
  165. package/dist/ops/add.d.ts.map +1 -0
  166. package/dist/ops/add.js +85 -0
  167. package/dist/ops/add.js.map +1 -0
  168. package/dist/ops/inject.d.ts +4 -0
  169. package/dist/ops/inject.d.ts.map +1 -0
  170. package/dist/ops/inject.js +28 -0
  171. package/dist/ops/inject.js.map +1 -0
  172. package/dist/ops/injector.d.ts +4 -0
  173. package/dist/ops/injector.d.ts.map +1 -0
  174. package/dist/ops/injector.js +68 -0
  175. package/dist/ops/injector.js.map +1 -0
  176. package/dist/ops/result.d.ts +3 -0
  177. package/dist/ops/result.d.ts.map +1 -0
  178. package/dist/ops/result.js +8 -0
  179. package/dist/ops/result.js.map +1 -0
  180. package/dist/prompts/interactive-prompts.d.ts +152 -0
  181. package/dist/prompts/interactive-prompts.d.ts.map +1 -0
  182. package/dist/prompts/interactive-prompts.js +574 -0
  183. package/dist/prompts/interactive-prompts.js.map +1 -0
  184. package/dist/recipe-engine/group-executor.d.ts +97 -0
  185. package/dist/recipe-engine/group-executor.d.ts.map +1 -0
  186. package/dist/recipe-engine/group-executor.js +293 -0
  187. package/dist/recipe-engine/group-executor.js.map +1 -0
  188. package/dist/recipe-engine/index.d.ts +112 -0
  189. package/dist/recipe-engine/index.d.ts.map +1 -0
  190. package/dist/recipe-engine/index.js +223 -0
  191. package/dist/recipe-engine/index.js.map +1 -0
  192. package/dist/recipe-engine/output-evaluator.d.ts +28 -0
  193. package/dist/recipe-engine/output-evaluator.d.ts.map +1 -0
  194. package/dist/recipe-engine/output-evaluator.js +78 -0
  195. package/dist/recipe-engine/output-evaluator.js.map +1 -0
  196. package/dist/recipe-engine/recipe-engine.d.ts +227 -0
  197. package/dist/recipe-engine/recipe-engine.d.ts.map +1 -0
  198. package/dist/recipe-engine/recipe-engine.js +1036 -0
  199. package/dist/recipe-engine/recipe-engine.js.map +1 -0
  200. package/dist/recipe-engine/step-executor.d.ts +172 -0
  201. package/dist/recipe-engine/step-executor.d.ts.map +1 -0
  202. package/dist/recipe-engine/step-executor.js +802 -0
  203. package/dist/recipe-engine/step-executor.js.map +1 -0
  204. package/dist/recipe-engine/tools/action-tool.d.ts +103 -0
  205. package/dist/recipe-engine/tools/action-tool.d.ts.map +1 -0
  206. package/dist/recipe-engine/tools/action-tool.js +473 -0
  207. package/dist/recipe-engine/tools/action-tool.js.map +1 -0
  208. package/dist/recipe-engine/tools/ai-tool.d.ts +26 -0
  209. package/dist/recipe-engine/tools/ai-tool.d.ts.map +1 -0
  210. package/dist/recipe-engine/tools/ai-tool.js +233 -0
  211. package/dist/recipe-engine/tools/ai-tool.js.map +1 -0
  212. package/dist/recipe-engine/tools/base.d.ts +214 -0
  213. package/dist/recipe-engine/tools/base.d.ts.map +1 -0
  214. package/dist/recipe-engine/tools/base.js +397 -0
  215. package/dist/recipe-engine/tools/base.js.map +1 -0
  216. package/dist/recipe-engine/tools/codemod-tool.d.ts +130 -0
  217. package/dist/recipe-engine/tools/codemod-tool.d.ts.map +1 -0
  218. package/dist/recipe-engine/tools/codemod-tool.js +786 -0
  219. package/dist/recipe-engine/tools/codemod-tool.js.map +1 -0
  220. package/dist/recipe-engine/tools/ensure-dirs-tool.d.ts +21 -0
  221. package/dist/recipe-engine/tools/ensure-dirs-tool.d.ts.map +1 -0
  222. package/dist/recipe-engine/tools/ensure-dirs-tool.js +130 -0
  223. package/dist/recipe-engine/tools/ensure-dirs-tool.js.map +1 -0
  224. package/dist/recipe-engine/tools/index.d.ts +126 -0
  225. package/dist/recipe-engine/tools/index.d.ts.map +1 -0
  226. package/dist/recipe-engine/tools/index.js +290 -0
  227. package/dist/recipe-engine/tools/index.js.map +1 -0
  228. package/dist/recipe-engine/tools/install-tool.d.ts +20 -0
  229. package/dist/recipe-engine/tools/install-tool.d.ts.map +1 -0
  230. package/dist/recipe-engine/tools/install-tool.js +194 -0
  231. package/dist/recipe-engine/tools/install-tool.js.map +1 -0
  232. package/dist/recipe-engine/tools/parallel-tool.d.ts +21 -0
  233. package/dist/recipe-engine/tools/parallel-tool.d.ts.map +1 -0
  234. package/dist/recipe-engine/tools/parallel-tool.js +134 -0
  235. package/dist/recipe-engine/tools/parallel-tool.js.map +1 -0
  236. package/dist/recipe-engine/tools/patch-tool.d.ts +21 -0
  237. package/dist/recipe-engine/tools/patch-tool.d.ts.map +1 -0
  238. package/dist/recipe-engine/tools/patch-tool.js +248 -0
  239. package/dist/recipe-engine/tools/patch-tool.js.map +1 -0
  240. package/dist/recipe-engine/tools/prompt-tool.d.ts +25 -0
  241. package/dist/recipe-engine/tools/prompt-tool.d.ts.map +1 -0
  242. package/dist/recipe-engine/tools/prompt-tool.js +162 -0
  243. package/dist/recipe-engine/tools/prompt-tool.js.map +1 -0
  244. package/dist/recipe-engine/tools/query-tool.d.ts +21 -0
  245. package/dist/recipe-engine/tools/query-tool.d.ts.map +1 -0
  246. package/dist/recipe-engine/tools/query-tool.js +249 -0
  247. package/dist/recipe-engine/tools/query-tool.js.map +1 -0
  248. package/dist/recipe-engine/tools/recipe-tool.d.ts +103 -0
  249. package/dist/recipe-engine/tools/recipe-tool.d.ts.map +1 -0
  250. package/dist/recipe-engine/tools/recipe-tool.js +617 -0
  251. package/dist/recipe-engine/tools/recipe-tool.js.map +1 -0
  252. package/dist/recipe-engine/tools/registry.d.ts +151 -0
  253. package/dist/recipe-engine/tools/registry.d.ts.map +1 -0
  254. package/dist/recipe-engine/tools/registry.js +244 -0
  255. package/dist/recipe-engine/tools/registry.js.map +1 -0
  256. package/dist/recipe-engine/tools/sequence-tool.d.ts +22 -0
  257. package/dist/recipe-engine/tools/sequence-tool.d.ts.map +1 -0
  258. package/dist/recipe-engine/tools/sequence-tool.js +122 -0
  259. package/dist/recipe-engine/tools/sequence-tool.js.map +1 -0
  260. package/dist/recipe-engine/tools/shell-tool.d.ts +25 -0
  261. package/dist/recipe-engine/tools/shell-tool.d.ts.map +1 -0
  262. package/dist/recipe-engine/tools/shell-tool.js +149 -0
  263. package/dist/recipe-engine/tools/shell-tool.js.map +1 -0
  264. package/dist/recipe-engine/tools/template-tool.d.ts +88 -0
  265. package/dist/recipe-engine/tools/template-tool.d.ts.map +1 -0
  266. package/dist/recipe-engine/tools/template-tool.js +613 -0
  267. package/dist/recipe-engine/tools/template-tool.js.map +1 -0
  268. package/dist/recipe-engine/types.d.ts +963 -0
  269. package/dist/recipe-engine/types.d.ts.map +1 -0
  270. package/dist/recipe-engine/types.js +94 -0
  271. package/dist/recipe-engine/types.js.map +1 -0
  272. package/dist/template-engines/ai-tags.d.ts +26 -0
  273. package/dist/template-engines/ai-tags.d.ts.map +1 -0
  274. package/dist/template-engines/ai-tags.js +233 -0
  275. package/dist/template-engines/ai-tags.js.map +1 -0
  276. package/dist/template-engines/index.d.ts +8 -0
  277. package/dist/template-engines/index.d.ts.map +1 -0
  278. package/dist/template-engines/index.js +8 -0
  279. package/dist/template-engines/index.js.map +1 -0
  280. package/dist/template-engines/jig-engine.d.ts +47 -0
  281. package/dist/template-engines/jig-engine.d.ts.map +1 -0
  282. package/dist/template-engines/jig-engine.js +173 -0
  283. package/dist/template-engines/jig-engine.js.map +1 -0
  284. package/dist/utils/coerce-value.d.ts +7 -0
  285. package/dist/utils/coerce-value.d.ts.map +1 -0
  286. package/dist/utils/coerce-value.js +18 -0
  287. package/dist/utils/coerce-value.js.map +1 -0
  288. package/dist/utils/diff.d.ts +8 -0
  289. package/dist/utils/diff.d.ts.map +1 -0
  290. package/dist/utils/diff.js +10 -0
  291. package/dist/utils/diff.js.map +1 -0
  292. package/dist/utils/global-packages.d.ts +11 -0
  293. package/dist/utils/global-packages.d.ts.map +1 -0
  294. package/dist/utils/global-packages.js +88 -0
  295. package/dist/utils/global-packages.js.map +1 -0
  296. package/dist/utils/pager.d.ts +6 -0
  297. package/dist/utils/pager.d.ts.map +1 -0
  298. package/dist/utils/pager.js +41 -0
  299. package/dist/utils/pager.js.map +1 -0
  300. package/help/cookbook/info.md +35 -0
  301. package/help/cookbook/list.md +37 -0
  302. package/help/gen.md +26 -0
  303. package/help/recipe/run.md +52 -0
  304. package/help/recipe/validate.md +51 -0
  305. package/oclif.manifest.json +580 -0
  306. package/package.json +120 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Action System Types
3
+ *
4
+ * Type definitions for the decorator-based action system
5
+ */
6
+ export interface ActionMetadata {
7
+ name: string;
8
+ description?: string;
9
+ parameters?: ActionParameter[];
10
+ category?: string;
11
+ tags?: string[];
12
+ examples?: ActionExample[];
13
+ }
14
+ export interface ActionParameter {
15
+ name: string;
16
+ type: ParameterType;
17
+ required?: boolean;
18
+ default?: any;
19
+ prompt?: string;
20
+ description?: string;
21
+ validation?: ParameterValidation;
22
+ values?: string[];
23
+ min?: number;
24
+ max?: number;
25
+ pattern?: string;
26
+ }
27
+ export type ParameterType = "string" | "boolean" | "number" | "enum" | "array" | "object" | "file" | "directory";
28
+ export interface ParameterValidation {
29
+ required?: boolean;
30
+ custom?: string;
31
+ message?: string;
32
+ }
33
+ export interface ActionContext {
34
+ variables: Record<string, any>;
35
+ projectRoot: string;
36
+ templatePath?: string;
37
+ logger: ActionLogger;
38
+ utils: ActionUtils;
39
+ dryRun?: boolean;
40
+ force?: boolean;
41
+ communication?: ActionCommunication;
42
+ }
43
+ export interface ActionCommunication {
44
+ actionId: string;
45
+ manager: any;
46
+ sendMessage: (type: string, payload: any, target?: string) => void;
47
+ getSharedData: (key: string) => any;
48
+ setSharedData: (key: string, value: any) => void;
49
+ waitForAction: (actionId: string, timeout?: number) => Promise<any>;
50
+ subscribeToMessages: (messageType: string, handler: (message: any) => void) => () => void;
51
+ }
52
+ export interface ActionResult {
53
+ success: boolean;
54
+ message?: string;
55
+ filesCreated?: string[];
56
+ filesModified?: string[];
57
+ filesDeleted?: string[];
58
+ data?: any;
59
+ metadata?: any;
60
+ }
61
+ export type ActionFunction = (context: ActionContext) => Promise<ActionResult>;
62
+ export interface DecoratedAction {
63
+ metadata: ActionMetadata;
64
+ fn: ActionFunction;
65
+ module: string;
66
+ exported: boolean;
67
+ }
68
+ export interface ActionExample {
69
+ title: string;
70
+ description?: string;
71
+ parameters: Record<string, any>;
72
+ expectedResult?: Partial<ActionResult>;
73
+ }
74
+ export interface ActionLogger {
75
+ info(message: string): void;
76
+ warn(message: string): void;
77
+ error(message: string): void;
78
+ debug(message: string): void;
79
+ trace(message: string): void;
80
+ }
81
+ export interface ActionUtils {
82
+ fileExists(path: string): boolean;
83
+ readFile(path: string): string;
84
+ writeFile(path: string, content: string): void;
85
+ createDirectory(path: string): void;
86
+ copyFile(src: string, dest: string): void;
87
+ deleteFile(path: string): void;
88
+ globFiles(pattern: string, options?: {
89
+ cwd?: string;
90
+ }): string[];
91
+ }
92
+ export declare class ActionExecutionError extends Error {
93
+ actionName: string;
94
+ parameterErrors?: string[] | undefined;
95
+ cause?: Error | undefined;
96
+ constructor(message: string, actionName: string, parameterErrors?: string[] | undefined, cause?: Error | undefined);
97
+ }
98
+ export declare class ActionParameterError extends Error {
99
+ parameterName: string;
100
+ parameterValue: any;
101
+ expectedType: ParameterType;
102
+ constructor(message: string, parameterName: string, parameterValue: any, expectedType: ParameterType);
103
+ }
104
+ export interface ActionQueryOptions {
105
+ category?: string;
106
+ tags?: string[];
107
+ search?: string;
108
+ }
109
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/actions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,EAAE,CA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;gBAHlC,OAAO,EAAE,MAAM,EACR,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,GAAG,EACnB,YAAY,EAAE,aAAa;CAKnC;AAGD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Action System Types
3
+ *
4
+ * Type definitions for the decorator-based action system
5
+ */
6
+ // Error types
7
+ export class ActionExecutionError extends Error {
8
+ actionName;
9
+ parameterErrors;
10
+ cause;
11
+ constructor(message, actionName, parameterErrors, cause) {
12
+ super(message);
13
+ this.actionName = actionName;
14
+ this.parameterErrors = parameterErrors;
15
+ this.cause = cause;
16
+ this.name = "ActionExecutionError";
17
+ }
18
+ }
19
+ export class ActionParameterError extends Error {
20
+ parameterName;
21
+ parameterValue;
22
+ expectedType;
23
+ constructor(message, parameterName, parameterValue, expectedType) {
24
+ super(message);
25
+ this.parameterName = parameterName;
26
+ this.parameterValue = parameterValue;
27
+ this.expectedType = expectedType;
28
+ this.name = "ActionParameterError";
29
+ }
30
+ }
31
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/actions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqHH,cAAc;AACd,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAGtC;IACA;IACS;IAJjB,YACC,OAAe,EACR,UAAkB,EAClB,eAA0B,EACjB,KAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,eAAU,GAAV,UAAU,CAAQ;QAClB,oBAAe,GAAf,eAAe,CAAW;QACjB,UAAK,GAAL,KAAK,CAAQ;QAG7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAGtC;IACA;IACA;IAJR,YACC,OAAe,EACR,aAAqB,EACrB,cAAmB,EACnB,YAA2B;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,kBAAa,GAAb,aAAa,CAAQ;QACrB,mBAAc,GAAd,cAAc,CAAK;QACnB,iBAAY,GAAZ,YAAY,CAAe;QAGlC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Action Utilities
3
+ *
4
+ * Utilities and helpers for action implementations
5
+ */
6
+ import type { ActionLogger, ActionUtils } from "./types.js";
7
+ export declare class DefaultActionUtils implements ActionUtils {
8
+ fileExists(filePath: string): boolean;
9
+ readFile(filePath: string): string;
10
+ writeFile(filePath: string, content: string): void;
11
+ createDirectory(dirPath: string): void;
12
+ copyFile(src: string, dest: string): void;
13
+ deleteFile(filePath: string): void;
14
+ globFiles(pattern: string, options?: {
15
+ cwd?: string;
16
+ }): string[];
17
+ installPackages(packages: string[], options?: {
18
+ dev?: boolean;
19
+ }): Promise<void>;
20
+ runCommand(command: string, options?: {
21
+ cwd?: string;
22
+ }): Promise<string>;
23
+ private detectPackageManager;
24
+ }
25
+ export declare class ConsoleActionLogger implements ActionLogger {
26
+ info(message: string): void;
27
+ warn(message: string): void;
28
+ error(message: string): void;
29
+ debug(message: string): void;
30
+ trace(message: string): void;
31
+ }
32
+ /**
33
+ * Silent logger for testing or when output should be suppressed
34
+ */
35
+ export declare class SilentActionLogger implements ActionLogger {
36
+ info(message: string): void;
37
+ warn(message: string): void;
38
+ error(message: string): void;
39
+ debug(message: string): void;
40
+ trace(message: string): void;
41
+ }
42
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/actions/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI5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AO,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG5B"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Action Utilities
3
+ *
4
+ * Utilities and helpers for action implementations
5
+ */
6
+ import path from "node:path";
7
+ import createDebug from "debug";
8
+ import execa from "execa";
9
+ import fs from "fs-extra";
10
+ import { glob } from "glob";
11
+ const debug = createDebug("hyper:action:utils");
12
+ export class DefaultActionUtils {
13
+ fileExists(filePath) {
14
+ debug("Checking file exists: %s", filePath);
15
+ return fs.existsSync(filePath);
16
+ }
17
+ readFile(filePath) {
18
+ debug("Reading file: %s", filePath);
19
+ return fs.readFileSync(filePath, "utf-8");
20
+ }
21
+ writeFile(filePath, content) {
22
+ debug("Writing file: %s", filePath);
23
+ fs.ensureDirSync(path.dirname(filePath));
24
+ fs.writeFileSync(filePath, content, "utf-8");
25
+ }
26
+ createDirectory(dirPath) {
27
+ debug("Creating directory: %s", dirPath);
28
+ fs.ensureDirSync(dirPath);
29
+ }
30
+ copyFile(src, dest) {
31
+ debug("Copying file: %s -> %s", src, dest);
32
+ fs.ensureDirSync(path.dirname(dest));
33
+ fs.copySync(src, dest);
34
+ }
35
+ deleteFile(filePath) {
36
+ debug("Deleting file: %s", filePath);
37
+ fs.removeSync(filePath);
38
+ }
39
+ globFiles(pattern, options = {}) {
40
+ debug("Globbing pattern: %s (cwd: %s)", pattern, options.cwd || process.cwd());
41
+ return glob.sync(pattern, {
42
+ cwd: options.cwd || process.cwd(),
43
+ absolute: false,
44
+ });
45
+ }
46
+ async installPackages(packages, options = {}) {
47
+ debug("Installing packages: %s (dev: %s)", packages.join(", "), options.dev || false);
48
+ // Detect package manager
49
+ const packageManager = await this.detectPackageManager();
50
+ let args;
51
+ switch (packageManager) {
52
+ case "bun":
53
+ args = ["add"];
54
+ if (options.dev)
55
+ args.push("--dev");
56
+ args.push(...packages);
57
+ break;
58
+ case "yarn":
59
+ args = ["add"];
60
+ if (options.dev)
61
+ args.push("--dev");
62
+ args.push(...packages);
63
+ break;
64
+ case "pnpm":
65
+ args = ["add"];
66
+ if (options.dev)
67
+ args.push("--save-dev");
68
+ args.push(...packages);
69
+ break;
70
+ default: // npm
71
+ args = ["install"];
72
+ if (options.dev)
73
+ args.push("--save-dev");
74
+ args.push(...packages);
75
+ break;
76
+ }
77
+ await this.runCommand(`${packageManager} ${args.join(" ")}`);
78
+ }
79
+ async runCommand(command, options = {}) {
80
+ debug("Running command: %s (cwd: %s)", command, options.cwd || process.cwd());
81
+ try {
82
+ const result = await execa(command, {
83
+ shell: true,
84
+ cwd: options.cwd || process.cwd(),
85
+ });
86
+ return result.stdout;
87
+ }
88
+ catch (error) {
89
+ throw new Error(`Command failed: ${command}\n${error.message}`);
90
+ }
91
+ }
92
+ async detectPackageManager() {
93
+ const cwd = process.cwd();
94
+ // Check for lock files to determine package manager
95
+ if (await fs.pathExists(path.join(cwd, "bun.lockb"))) {
96
+ return "bun";
97
+ }
98
+ if (await fs.pathExists(path.join(cwd, "yarn.lock"))) {
99
+ return "yarn";
100
+ }
101
+ if (await fs.pathExists(path.join(cwd, "pnpm-lock.yaml"))) {
102
+ return "pnpm";
103
+ }
104
+ return "npm";
105
+ }
106
+ }
107
+ export class ConsoleActionLogger {
108
+ info(message) {
109
+ console.log(`ℹ️ ${message}`);
110
+ }
111
+ warn(message) {
112
+ console.warn(`⚠️ ${message}`);
113
+ }
114
+ error(message) {
115
+ console.error(`❌ ${message}`);
116
+ }
117
+ debug(message) {
118
+ console.log(`🐛 ${message}`);
119
+ }
120
+ trace(message) {
121
+ console.log(`🔍 ${message}`);
122
+ }
123
+ }
124
+ /**
125
+ * Silent logger for testing or when output should be suppressed
126
+ */
127
+ export class SilentActionLogger {
128
+ info(message) {
129
+ // Silent
130
+ }
131
+ warn(message) {
132
+ // Silent
133
+ }
134
+ error(message) {
135
+ // Silent
136
+ }
137
+ debug(message) {
138
+ // Silent
139
+ }
140
+ trace(message) {
141
+ // Silent
142
+ }
143
+ }
144
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/actions/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,KAAK,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAEhD,MAAM,OAAO,kBAAkB;IAC9B,UAAU,CAAC,QAAgB;QAC1B,KAAK,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC;QAC5C,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,QAAgB;QACxB,KAAK,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QACpC,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,SAAS,CAAC,QAAgB,EAAE,OAAe;QAC1C,KAAK,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QACpC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QACzC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe,CAAC,OAAe;QAC9B,KAAK,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QACzC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,IAAY;QACjC,KAAK,CAAC,wBAAwB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;IACV,CAAC;IAED,KAAK,CAAC,OAAe;QACpB,SAAS;IACV,CAAC;IAED,KAAK,CAAC,OAAe;QACpB,SAAS;IACV,CAAC;CACD"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * AI Collector
3
+ *
4
+ * Singleton that accumulates AI block data (@ai/@context/@prompt/@output)
5
+ * across all templates during a single generation run.
6
+ *
7
+ * In the 2-pass system:
8
+ * Pass 1 (collect mode): Templates render but @ai blocks collect their
9
+ * data here instead of producing output. No files are written.
10
+ * Pass 2 (answers mode): Templates resolve @ai blocks from provided
11
+ * answers. Files are written normally.
12
+ */
13
+ /**
14
+ * Data collected from a single @ai block in a template
15
+ */
16
+ export interface AiBlockEntry {
17
+ /** JSON property name the LLM fills in (from @ai({ key })) */
18
+ key: string;
19
+ /** Rendered @context bodies within this @ai block */
20
+ contexts: string[];
21
+ /** Rendered @prompt body */
22
+ prompt: string;
23
+ /** Rendered @output body (format description) */
24
+ outputDescription: string;
25
+ /** Advisory type hint for the output (e.g. 'jsx-fragment', 'sql', 'json') */
26
+ typeHint: string;
27
+ /** Rendered @example bodies (concrete examples of expected output) */
28
+ examples: string[];
29
+ /** Which template file this block came from */
30
+ sourceFile: string;
31
+ }
32
+ /**
33
+ * Accumulates AI block data across all templates in a single run.
34
+ * Follows the same singleton pattern as AiService.
35
+ */
36
+ export declare class AiCollector {
37
+ private static instance;
38
+ /** Whether we're in Pass 1 (collecting) or not */
39
+ collectMode: boolean;
40
+ private globalContexts;
41
+ private entries;
42
+ private constructor();
43
+ static getInstance(): AiCollector;
44
+ static reset(): void;
45
+ addGlobalContext(text: string): void;
46
+ addEntry(entry: AiBlockEntry): void;
47
+ hasEntries(): boolean;
48
+ getGlobalContexts(): string[];
49
+ getEntries(): Map<string, AiBlockEntry>;
50
+ clear(): void;
51
+ }
52
+ //# sourceMappingURL=ai-collector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-collector.d.ts","sourceRoot":"","sources":["../../src/ai/ai-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IAEZ,qDAAqD;IACrD,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IAEf,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IAEjB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,WAAW;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA4B;IAEnD,kDAAkD;IAClD,WAAW,UAAS;IAEpB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,OAAO,CAAmC;IAElD,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,WAAW;IAOjC,MAAM,CAAC,KAAK,IAAI,IAAI;IAIpB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAOpC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAYnC,UAAU,IAAI,OAAO;IAIrB,iBAAiB,IAAI,MAAM,EAAE;IAI7B,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC;IAIvC,KAAK,IAAI,IAAI;CAMb"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * AI Collector
3
+ *
4
+ * Singleton that accumulates AI block data (@ai/@context/@prompt/@output)
5
+ * across all templates during a single generation run.
6
+ *
7
+ * In the 2-pass system:
8
+ * Pass 1 (collect mode): Templates render but @ai blocks collect their
9
+ * data here instead of producing output. No files are written.
10
+ * Pass 2 (answers mode): Templates resolve @ai blocks from provided
11
+ * answers. Files are written normally.
12
+ */
13
+ import createDebug from "debug";
14
+ const debug = createDebug("hypergen:ai:collector");
15
+ /**
16
+ * Accumulates AI block data across all templates in a single run.
17
+ * Follows the same singleton pattern as AiService.
18
+ */
19
+ export class AiCollector {
20
+ static instance = null;
21
+ /** Whether we're in Pass 1 (collecting) or not */
22
+ collectMode = false;
23
+ globalContexts = [];
24
+ entries = new Map();
25
+ constructor() { }
26
+ static getInstance() {
27
+ if (!AiCollector.instance) {
28
+ AiCollector.instance = new AiCollector();
29
+ }
30
+ return AiCollector.instance;
31
+ }
32
+ static reset() {
33
+ AiCollector.instance = null;
34
+ }
35
+ addGlobalContext(text) {
36
+ if (text.trim()) {
37
+ this.globalContexts.push(text.trim());
38
+ debug("Added global context (%d chars)", text.length);
39
+ }
40
+ }
41
+ addEntry(entry) {
42
+ if (this.entries.has(entry.key)) {
43
+ debug('Warning: duplicate AI block key "%s" — overwriting (source: %s)', entry.key, entry.sourceFile);
44
+ }
45
+ this.entries.set(entry.key, entry);
46
+ debug('Added AI block entry "%s" from %s', entry.key, entry.sourceFile);
47
+ }
48
+ hasEntries() {
49
+ return this.entries.size > 0;
50
+ }
51
+ getGlobalContexts() {
52
+ return [...this.globalContexts];
53
+ }
54
+ getEntries() {
55
+ return new Map(this.entries);
56
+ }
57
+ clear() {
58
+ this.globalContexts = [];
59
+ this.entries.clear();
60
+ this.collectMode = false;
61
+ debug("Collector cleared");
62
+ }
63
+ }
64
+ //# sourceMappingURL=ai-collector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-collector.js","sourceRoot":"","sources":["../../src/ai/ai-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AA4BnD;;;GAGG;AACH,MAAM,OAAO,WAAW;IACf,MAAM,CAAC,QAAQ,GAAuB,IAAI,CAAC;IAEnD,kDAAkD;IAClD,WAAW,GAAG,KAAK,CAAC;IAEZ,cAAc,GAAa,E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