synarcx 0.1.0

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 (288) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +90 -0
  3. package/bin/synarcx.js +3 -0
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.js +474 -0
  6. package/dist/commands/change.d.ts +35 -0
  7. package/dist/commands/change.js +278 -0
  8. package/dist/commands/completion.d.ts +72 -0
  9. package/dist/commands/completion.js +264 -0
  10. package/dist/commands/config.d.ts +36 -0
  11. package/dist/commands/config.js +552 -0
  12. package/dist/commands/feedback.d.ts +9 -0
  13. package/dist/commands/feedback.js +170 -0
  14. package/dist/commands/schema.d.ts +6 -0
  15. package/dist/commands/schema.js +870 -0
  16. package/dist/commands/show.d.ts +14 -0
  17. package/dist/commands/show.js +132 -0
  18. package/dist/commands/spec.d.ts +15 -0
  19. package/dist/commands/spec.js +226 -0
  20. package/dist/commands/validate.d.ts +24 -0
  21. package/dist/commands/validate.js +295 -0
  22. package/dist/commands/workflow/index.d.ts +17 -0
  23. package/dist/commands/workflow/index.js +12 -0
  24. package/dist/commands/workflow/instructions.d.ts +29 -0
  25. package/dist/commands/workflow/instructions.js +327 -0
  26. package/dist/commands/workflow/new-change.d.ts +11 -0
  27. package/dist/commands/workflow/new-change.js +45 -0
  28. package/dist/commands/workflow/schemas.d.ts +10 -0
  29. package/dist/commands/workflow/schemas.js +34 -0
  30. package/dist/commands/workflow/shared.d.ts +57 -0
  31. package/dist/commands/workflow/shared.js +117 -0
  32. package/dist/commands/workflow/status.d.ts +14 -0
  33. package/dist/commands/workflow/status.js +75 -0
  34. package/dist/commands/workflow/templates.d.ts +16 -0
  35. package/dist/commands/workflow/templates.js +69 -0
  36. package/dist/commands/workspace/open.d.ts +29 -0
  37. package/dist/commands/workspace/open.js +84 -0
  38. package/dist/commands/workspace/operations.d.ts +18 -0
  39. package/dist/commands/workspace/operations.js +461 -0
  40. package/dist/commands/workspace/selection.d.ts +5 -0
  41. package/dist/commands/workspace/selection.js +90 -0
  42. package/dist/commands/workspace/types.d.ts +83 -0
  43. package/dist/commands/workspace/types.js +36 -0
  44. package/dist/commands/workspace.d.ts +3 -0
  45. package/dist/commands/workspace.js +635 -0
  46. package/dist/core/archive.d.ts +11 -0
  47. package/dist/core/archive.js +319 -0
  48. package/dist/core/artifact-graph/graph.d.ts +56 -0
  49. package/dist/core/artifact-graph/graph.js +141 -0
  50. package/dist/core/artifact-graph/index.d.ts +8 -0
  51. package/dist/core/artifact-graph/index.js +14 -0
  52. package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
  53. package/dist/core/artifact-graph/instruction-loader.js +217 -0
  54. package/dist/core/artifact-graph/outputs.d.ts +14 -0
  55. package/dist/core/artifact-graph/outputs.js +39 -0
  56. package/dist/core/artifact-graph/resolver.d.ts +81 -0
  57. package/dist/core/artifact-graph/resolver.js +258 -0
  58. package/dist/core/artifact-graph/schema.d.ts +13 -0
  59. package/dist/core/artifact-graph/schema.js +108 -0
  60. package/dist/core/artifact-graph/state.d.ts +12 -0
  61. package/dist/core/artifact-graph/state.js +31 -0
  62. package/dist/core/artifact-graph/types.d.ts +45 -0
  63. package/dist/core/artifact-graph/types.js +43 -0
  64. package/dist/core/available-tools.d.ts +17 -0
  65. package/dist/core/available-tools.js +43 -0
  66. package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
  67. package/dist/core/command-generation/adapters/amazon-q.js +26 -0
  68. package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
  69. package/dist/core/command-generation/adapters/antigravity.js +26 -0
  70. package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
  71. package/dist/core/command-generation/adapters/auggie.js +27 -0
  72. package/dist/core/command-generation/adapters/bob.d.ts +14 -0
  73. package/dist/core/command-generation/adapters/bob.js +45 -0
  74. package/dist/core/command-generation/adapters/claude.d.ts +13 -0
  75. package/dist/core/command-generation/adapters/claude.js +50 -0
  76. package/dist/core/command-generation/adapters/cline.d.ts +14 -0
  77. package/dist/core/command-generation/adapters/cline.js +27 -0
  78. package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
  79. package/dist/core/command-generation/adapters/codebuddy.js +28 -0
  80. package/dist/core/command-generation/adapters/codex.d.ts +16 -0
  81. package/dist/core/command-generation/adapters/codex.js +39 -0
  82. package/dist/core/command-generation/adapters/continue.d.ts +13 -0
  83. package/dist/core/command-generation/adapters/continue.js +28 -0
  84. package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
  85. package/dist/core/command-generation/adapters/costrict.js +27 -0
  86. package/dist/core/command-generation/adapters/crush.d.ts +13 -0
  87. package/dist/core/command-generation/adapters/crush.js +30 -0
  88. package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
  89. package/dist/core/command-generation/adapters/cursor.js +44 -0
  90. package/dist/core/command-generation/adapters/factory.d.ts +13 -0
  91. package/dist/core/command-generation/adapters/factory.js +27 -0
  92. package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
  93. package/dist/core/command-generation/adapters/gemini.js +26 -0
  94. package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
  95. package/dist/core/command-generation/adapters/github-copilot.js +26 -0
  96. package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
  97. package/dist/core/command-generation/adapters/iflow.js +29 -0
  98. package/dist/core/command-generation/adapters/index.d.ts +32 -0
  99. package/dist/core/command-generation/adapters/index.js +32 -0
  100. package/dist/core/command-generation/adapters/junie.d.ts +13 -0
  101. package/dist/core/command-generation/adapters/junie.js +26 -0
  102. package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
  103. package/dist/core/command-generation/adapters/kilocode.js +23 -0
  104. package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
  105. package/dist/core/command-generation/adapters/kiro.js +26 -0
  106. package/dist/core/command-generation/adapters/lingma.d.ts +13 -0
  107. package/dist/core/command-generation/adapters/lingma.js +30 -0
  108. package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
  109. package/dist/core/command-generation/adapters/opencode.js +27 -0
  110. package/dist/core/command-generation/adapters/pi.d.ts +18 -0
  111. package/dist/core/command-generation/adapters/pi.js +55 -0
  112. package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
  113. package/dist/core/command-generation/adapters/qoder.js +30 -0
  114. package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
  115. package/dist/core/command-generation/adapters/qwen.js +26 -0
  116. package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
  117. package/dist/core/command-generation/adapters/roocode.js +27 -0
  118. package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
  119. package/dist/core/command-generation/adapters/windsurf.js +51 -0
  120. package/dist/core/command-generation/generator.d.ts +21 -0
  121. package/dist/core/command-generation/generator.js +27 -0
  122. package/dist/core/command-generation/index.d.ts +22 -0
  123. package/dist/core/command-generation/index.js +24 -0
  124. package/dist/core/command-generation/registry.d.ts +36 -0
  125. package/dist/core/command-generation/registry.js +98 -0
  126. package/dist/core/command-generation/types.d.ts +56 -0
  127. package/dist/core/command-generation/types.js +8 -0
  128. package/dist/core/completions/command-registry.d.ts +7 -0
  129. package/dist/core/completions/command-registry.js +596 -0
  130. package/dist/core/completions/completion-provider.d.ts +71 -0
  131. package/dist/core/completions/completion-provider.js +129 -0
  132. package/dist/core/completions/factory.d.ts +64 -0
  133. package/dist/core/completions/factory.js +75 -0
  134. package/dist/core/completions/generators/bash-generator.d.ts +35 -0
  135. package/dist/core/completions/generators/bash-generator.js +230 -0
  136. package/dist/core/completions/generators/fish-generator.d.ts +32 -0
  137. package/dist/core/completions/generators/fish-generator.js +160 -0
  138. package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
  139. package/dist/core/completions/generators/powershell-generator.js +266 -0
  140. package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
  141. package/dist/core/completions/generators/zsh-generator.js +274 -0
  142. package/dist/core/completions/installers/bash-installer.d.ts +87 -0
  143. package/dist/core/completions/installers/bash-installer.js +318 -0
  144. package/dist/core/completions/installers/fish-installer.d.ts +43 -0
  145. package/dist/core/completions/installers/fish-installer.js +143 -0
  146. package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
  147. package/dist/core/completions/installers/powershell-installer.js +387 -0
  148. package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
  149. package/dist/core/completions/installers/zsh-installer.js +421 -0
  150. package/dist/core/completions/templates/bash-templates.d.ts +6 -0
  151. package/dist/core/completions/templates/bash-templates.js +30 -0
  152. package/dist/core/completions/templates/fish-templates.d.ts +7 -0
  153. package/dist/core/completions/templates/fish-templates.js +45 -0
  154. package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
  155. package/dist/core/completions/templates/powershell-templates.js +34 -0
  156. package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
  157. package/dist/core/completions/templates/zsh-templates.js +45 -0
  158. package/dist/core/completions/types.d.ts +101 -0
  159. package/dist/core/completions/types.js +2 -0
  160. package/dist/core/config-prompts.d.ts +9 -0
  161. package/dist/core/config-prompts.js +34 -0
  162. package/dist/core/config-schema.d.ts +86 -0
  163. package/dist/core/config-schema.js +213 -0
  164. package/dist/core/config.d.ts +19 -0
  165. package/dist/core/config.js +38 -0
  166. package/dist/core/converters/json-converter.d.ts +6 -0
  167. package/dist/core/converters/json-converter.js +51 -0
  168. package/dist/core/global-config.d.ts +49 -0
  169. package/dist/core/global-config.js +124 -0
  170. package/dist/core/index.d.ts +3 -0
  171. package/dist/core/index.js +4 -0
  172. package/dist/core/init.d.ts +37 -0
  173. package/dist/core/init.js +585 -0
  174. package/dist/core/legacy-cleanup.d.ts +169 -0
  175. package/dist/core/legacy-cleanup.js +578 -0
  176. package/dist/core/list.d.ts +9 -0
  177. package/dist/core/list.js +172 -0
  178. package/dist/core/migration.d.ts +23 -0
  179. package/dist/core/migration.js +108 -0
  180. package/dist/core/parsers/change-parser.d.ts +13 -0
  181. package/dist/core/parsers/change-parser.js +197 -0
  182. package/dist/core/parsers/markdown-parser.d.ts +26 -0
  183. package/dist/core/parsers/markdown-parser.js +227 -0
  184. package/dist/core/parsers/requirement-blocks.d.ts +37 -0
  185. package/dist/core/parsers/requirement-blocks.js +201 -0
  186. package/dist/core/parsers/spec-structure.d.ts +9 -0
  187. package/dist/core/parsers/spec-structure.js +88 -0
  188. package/dist/core/profile-sync-drift.d.ts +38 -0
  189. package/dist/core/profile-sync-drift.js +197 -0
  190. package/dist/core/profiles.d.ts +26 -0
  191. package/dist/core/profiles.js +37 -0
  192. package/dist/core/project-config.d.ts +64 -0
  193. package/dist/core/project-config.js +224 -0
  194. package/dist/core/schemas/base.schema.d.ts +13 -0
  195. package/dist/core/schemas/base.schema.js +13 -0
  196. package/dist/core/schemas/change.schema.d.ts +73 -0
  197. package/dist/core/schemas/change.schema.js +31 -0
  198. package/dist/core/schemas/index.d.ts +4 -0
  199. package/dist/core/schemas/index.js +4 -0
  200. package/dist/core/schemas/spec.schema.d.ts +18 -0
  201. package/dist/core/schemas/spec.schema.js +15 -0
  202. package/dist/core/shared/index.d.ts +8 -0
  203. package/dist/core/shared/index.js +8 -0
  204. package/dist/core/shared/skill-generation.d.ts +49 -0
  205. package/dist/core/shared/skill-generation.js +90 -0
  206. package/dist/core/shared/tool-detection.d.ts +71 -0
  207. package/dist/core/shared/tool-detection.js +152 -0
  208. package/dist/core/specs-apply.d.ts +73 -0
  209. package/dist/core/specs-apply.js +393 -0
  210. package/dist/core/styles/palette.d.ts +7 -0
  211. package/dist/core/styles/palette.js +8 -0
  212. package/dist/core/templates/index.d.ts +8 -0
  213. package/dist/core/templates/index.js +9 -0
  214. package/dist/core/templates/skill-templates.d.ts +15 -0
  215. package/dist/core/templates/skill-templates.js +14 -0
  216. package/dist/core/templates/types.d.ts +19 -0
  217. package/dist/core/templates/types.js +5 -0
  218. package/dist/core/templates/workflows/analyze.d.ts +4 -0
  219. package/dist/core/templates/workflows/analyze.js +101 -0
  220. package/dist/core/templates/workflows/apply-change.d.ts +10 -0
  221. package/dist/core/templates/workflows/apply-change.js +308 -0
  222. package/dist/core/templates/workflows/archive-change.d.ts +10 -0
  223. package/dist/core/templates/workflows/archive-change.js +271 -0
  224. package/dist/core/templates/workflows/clarify.d.ts +4 -0
  225. package/dist/core/templates/workflows/clarify.js +108 -0
  226. package/dist/core/templates/workflows/debug.d.ts +4 -0
  227. package/dist/core/templates/workflows/debug.js +117 -0
  228. package/dist/core/templates/workflows/explore.d.ts +10 -0
  229. package/dist/core/templates/workflows/explore.js +479 -0
  230. package/dist/core/templates/workflows/propose.d.ts +10 -0
  231. package/dist/core/templates/workflows/propose.js +216 -0
  232. package/dist/core/templates/workflows/sync.d.ts +4 -0
  233. package/dist/core/templates/workflows/sync.js +108 -0
  234. package/dist/core/update.d.ts +82 -0
  235. package/dist/core/update.js +555 -0
  236. package/dist/core/validation/constants.d.ts +34 -0
  237. package/dist/core/validation/constants.js +40 -0
  238. package/dist/core/validation/types.d.ts +18 -0
  239. package/dist/core/validation/types.js +2 -0
  240. package/dist/core/validation/validator.d.ts +33 -0
  241. package/dist/core/validation/validator.js +418 -0
  242. package/dist/core/view.d.ts +8 -0
  243. package/dist/core/view.js +169 -0
  244. package/dist/core/workspace/foundation.d.ts +79 -0
  245. package/dist/core/workspace/foundation.js +367 -0
  246. package/dist/core/workspace/index.d.ts +5 -0
  247. package/dist/core/workspace/index.js +5 -0
  248. package/dist/core/workspace/link-input.d.ts +9 -0
  249. package/dist/core/workspace/link-input.js +32 -0
  250. package/dist/core/workspace/open-surface.d.ts +24 -0
  251. package/dist/core/workspace/open-surface.js +137 -0
  252. package/dist/core/workspace/openers.d.ts +21 -0
  253. package/dist/core/workspace/openers.js +119 -0
  254. package/dist/index.d.ts +3 -0
  255. package/dist/index.js +3 -0
  256. package/dist/prompts/searchable-multi-select.d.ts +28 -0
  257. package/dist/prompts/searchable-multi-select.js +159 -0
  258. package/dist/ui/ascii-patterns.d.ts +25 -0
  259. package/dist/ui/ascii-patterns.js +140 -0
  260. package/dist/ui/welcome-screen.d.ts +10 -0
  261. package/dist/ui/welcome-screen.js +144 -0
  262. package/dist/utils/change-metadata.d.ts +51 -0
  263. package/dist/utils/change-metadata.js +147 -0
  264. package/dist/utils/change-utils.d.ts +62 -0
  265. package/dist/utils/change-utils.js +122 -0
  266. package/dist/utils/command-references.d.ts +18 -0
  267. package/dist/utils/command-references.js +20 -0
  268. package/dist/utils/file-system.d.ts +41 -0
  269. package/dist/utils/file-system.js +301 -0
  270. package/dist/utils/index.d.ts +6 -0
  271. package/dist/utils/index.js +9 -0
  272. package/dist/utils/interactive.d.ts +18 -0
  273. package/dist/utils/interactive.js +21 -0
  274. package/dist/utils/item-discovery.d.ts +4 -0
  275. package/dist/utils/item-discovery.js +73 -0
  276. package/dist/utils/match.d.ts +3 -0
  277. package/dist/utils/match.js +22 -0
  278. package/dist/utils/shell-detection.d.ts +20 -0
  279. package/dist/utils/shell-detection.js +41 -0
  280. package/dist/utils/task-progress.d.ts +8 -0
  281. package/dist/utils/task-progress.js +36 -0
  282. package/package.json +76 -0
  283. package/schemas/synarcx/schema.yaml +153 -0
  284. package/schemas/synarcx/templates/design.md +19 -0
  285. package/schemas/synarcx/templates/proposal.md +23 -0
  286. package/schemas/synarcx/templates/spec.md +8 -0
  287. package/schemas/synarcx/templates/tasks.md +9 -0
  288. package/scripts/postinstall.js +83 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Static template strings for Zsh completion scripts.
3
+ * These are Zsh-specific helper functions that never change.
4
+ */
5
+ export const ZSH_DYNAMIC_HELPERS = `# Dynamic completion helpers
6
+
7
+ # Use synarcx __complete to get available changes
8
+ _synarcx_complete_changes() {
9
+ local -a changes
10
+ while IFS=$'\\t' read -r id desc; do
11
+ changes+=("$id:$desc")
12
+ done < <(synarcx __complete changes 2>/dev/null)
13
+ _describe "change" changes
14
+ }
15
+
16
+ # Use synarcx __complete to get available specs
17
+ _synarcx_complete_specs() {
18
+ local -a specs
19
+ while IFS=$'\\t' read -r id desc; do
20
+ specs+=("$id:$desc")
21
+ done < <(synarcx __complete specs 2>/dev/null)
22
+ _describe "spec" specs
23
+ }
24
+
25
+ # Get both changes and specs
26
+ _synarcx_complete_items() {
27
+ local -a items
28
+ while IFS=$'\\t' read -r id desc; do
29
+ items+=("$id:$desc")
30
+ done < <(synarcx __complete changes 2>/dev/null)
31
+ while IFS=$'\\t' read -r id desc; do
32
+ items+=("$id:$desc")
33
+ done < <(synarcx __complete specs 2>/dev/null)
34
+ _describe "item" items
35
+ }
36
+
37
+ # Use synarcx __complete to get available schemas
38
+ _synarcx_complete_schemas() {
39
+ local -a schemas
40
+ while IFS=$'\\t' read -r id desc; do
41
+ schemas+=("$id:$desc")
42
+ done < <(synarcx __complete schemas 2>/dev/null)
43
+ _describe "schema" schemas
44
+ }`;
45
+ //# sourceMappingURL=zsh-templates.js.map
@@ -0,0 +1,101 @@
1
+ import { SupportedShell } from '../../utils/shell-detection.js';
2
+ /**
3
+ * Definition of a command-line flag/option
4
+ */
5
+ export interface FlagDefinition {
6
+ /**
7
+ * Flag name without dashes (e.g., "json", "strict", "no-interactive")
8
+ */
9
+ name: string;
10
+ /**
11
+ * Short flag name without dash (e.g., "y" for "-y")
12
+ */
13
+ short?: string;
14
+ /**
15
+ * Human-readable description of what the flag does
16
+ */
17
+ description: string;
18
+ /**
19
+ * Whether the flag takes an argument value
20
+ */
21
+ takesValue?: boolean;
22
+ /**
23
+ * Possible values for the flag (for completion suggestions)
24
+ */
25
+ values?: string[];
26
+ }
27
+ export type PositionalType = 'change-id' | 'spec-id' | 'change-or-spec-id' | 'path' | 'shell' | 'schema-name';
28
+ /**
29
+ * Definition of a positional argument.
30
+ */
31
+ export interface PositionalDefinition {
32
+ /**
33
+ * Positional name used in generated shell metadata.
34
+ */
35
+ name: string;
36
+ /**
37
+ * Type of positional argument for dynamic completion.
38
+ */
39
+ type?: PositionalType;
40
+ /**
41
+ * Whether this positional is optional in the CLI syntax.
42
+ */
43
+ optional?: boolean;
44
+ }
45
+ /**
46
+ * Definition of a CLI command
47
+ */
48
+ export interface CommandDefinition {
49
+ /**
50
+ * Command name (e.g., "init", "validate", "show")
51
+ */
52
+ name: string;
53
+ /**
54
+ * Human-readable description of the command
55
+ */
56
+ description: string;
57
+ /**
58
+ * Flags/options supported by this command
59
+ */
60
+ flags: FlagDefinition[];
61
+ /**
62
+ * Subcommands (e.g., "change show", "spec validate")
63
+ */
64
+ subcommands?: CommandDefinition[];
65
+ /**
66
+ * Whether this command accepts a positional argument (e.g., item name, path)
67
+ */
68
+ acceptsPositional?: boolean;
69
+ /**
70
+ * Type of positional argument for dynamic completion
71
+ * - 'change-id': Complete with active change IDs
72
+ * - 'spec-id': Complete with spec IDs
73
+ * - 'change-or-spec-id': Complete with both changes and specs
74
+ * - 'path': Complete with file paths
75
+ * - 'shell': Complete with supported shell names
76
+ * - 'schema-name': Complete with available schema names
77
+ * - undefined: No specific completion
78
+ */
79
+ positionalType?: PositionalType;
80
+ /**
81
+ * Ordered positional arguments when a command accepts more than one.
82
+ */
83
+ positionals?: PositionalDefinition[];
84
+ }
85
+ /**
86
+ * Interface for shell-specific completion script generators
87
+ */
88
+ export interface CompletionGenerator {
89
+ /**
90
+ * The shell type this generator targets
91
+ */
92
+ readonly shell: SupportedShell;
93
+ /**
94
+ * Generate the completion script content
95
+ *
96
+ * @param commands - Command definitions to generate completions for
97
+ * @returns The shell-specific completion script as a string
98
+ */
99
+ generate(commands: CommandDefinition[]): string;
100
+ }
101
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,9 @@
1
+ import type { ProjectConfig } from './project-config.js';
2
+ /**
3
+ * Serialize config to YAML string with helpful comments.
4
+ *
5
+ * @param config - Partial config object (schema required, context/rules optional)
6
+ * @returns YAML string ready to write to file
7
+ */
8
+ export declare function serializeConfig(config: Partial<ProjectConfig>): string;
9
+ //# sourceMappingURL=config-prompts.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Serialize config to YAML string with helpful comments.
3
+ *
4
+ * @param config - Partial config object (schema required, context/rules optional)
5
+ * @returns YAML string ready to write to file
6
+ */
7
+ export function serializeConfig(config) {
8
+ const lines = [];
9
+ // Schema (required)
10
+ lines.push(`schema: ${config.schema}`);
11
+ lines.push('');
12
+ // Context section with comments
13
+ lines.push('# Project context (optional)');
14
+ lines.push('# This is shown to AI when creating artifacts.');
15
+ lines.push('# Add your tech stack, conventions, style guides, domain knowledge, etc.');
16
+ lines.push('# Example:');
17
+ lines.push('# context: |');
18
+ lines.push('# Tech stack: TypeScript, React, Node.js');
19
+ lines.push('# We use conventional commits');
20
+ lines.push('# Domain: e-commerce platform');
21
+ lines.push('');
22
+ // Rules section with comments
23
+ lines.push('# Per-artifact rules (optional)');
24
+ lines.push('# Add custom rules for specific artifacts.');
25
+ lines.push('# Example:');
26
+ lines.push('# rules:');
27
+ lines.push('# proposal:');
28
+ lines.push('# - Keep proposals under 500 words');
29
+ lines.push('# - Always include a "Non-goals" section');
30
+ lines.push('# tasks:');
31
+ lines.push('# - Break tasks into chunks of max 2 hours');
32
+ return lines.join('\n') + '\n';
33
+ }
34
+ //# sourceMappingURL=config-prompts.js.map
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for global synarcx configuration.
4
+ * Uses passthrough() to preserve unknown fields for forward compatibility.
5
+ */
6
+ export declare const GlobalConfigSchema: z.ZodObject<{
7
+ featureFlags: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
8
+ profile: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
9
+ core: "core";
10
+ custom: "custom";
11
+ }>>>;
12
+ delivery: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
+ commands: "commands";
14
+ skills: "skills";
15
+ both: "both";
16
+ }>>>;
17
+ workflows: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ }, z.core.$loose>;
19
+ export type GlobalConfigType = z.infer<typeof GlobalConfigSchema>;
20
+ /**
21
+ * Default configuration values.
22
+ */
23
+ export declare const DEFAULT_CONFIG: GlobalConfigType;
24
+ /**
25
+ * Validate a config key path for CLI set operations.
26
+ * Unknown top-level keys are rejected unless explicitly allowed by the caller.
27
+ */
28
+ export declare function validateConfigKeyPath(path: string): {
29
+ valid: boolean;
30
+ reason?: string;
31
+ };
32
+ /**
33
+ * Get a nested value from an object using dot notation.
34
+ *
35
+ * @param obj - The object to access
36
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
37
+ * @returns The value at the path, or undefined if not found
38
+ */
39
+ export declare function getNestedValue(obj: Record<string, unknown>, path: string): unknown;
40
+ /**
41
+ * Set a nested value in an object using dot notation.
42
+ * Creates intermediate objects as needed.
43
+ *
44
+ * @param obj - The object to modify (mutated in place)
45
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
46
+ * @param value - The value to set
47
+ */
48
+ export declare function setNestedValue(obj: Record<string, unknown>, path: string, value: unknown): void;
49
+ /**
50
+ * Delete a nested value from an object using dot notation.
51
+ *
52
+ * @param obj - The object to modify (mutated in place)
53
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
54
+ * @returns true if the key existed and was deleted, false otherwise
55
+ */
56
+ export declare function deleteNestedValue(obj: Record<string, unknown>, path: string): boolean;
57
+ /**
58
+ * Coerce a string value to its appropriate type.
59
+ * - "true" / "false" -> boolean
60
+ * - Numeric strings -> number
61
+ * - Everything else -> string
62
+ *
63
+ * @param value - The string value to coerce
64
+ * @param forceString - If true, always return the value as a string
65
+ * @returns The coerced value
66
+ */
67
+ export declare function coerceValue(value: string, forceString?: boolean): string | number | boolean;
68
+ /**
69
+ * Format a value for YAML-like display.
70
+ *
71
+ * @param value - The value to format
72
+ * @param indent - Current indentation level
73
+ * @returns Formatted string
74
+ */
75
+ export declare function formatValueYaml(value: unknown, indent?: number): string;
76
+ /**
77
+ * Validate a configuration object against the schema.
78
+ *
79
+ * @param config - The configuration to validate
80
+ * @returns Validation result with success status and optional error message
81
+ */
82
+ export declare function validateConfig(config: unknown): {
83
+ success: boolean;
84
+ error?: string;
85
+ };
86
+ //# sourceMappingURL=config-schema.d.ts.map
@@ -0,0 +1,213 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for global synarcx configuration.
4
+ * Uses passthrough() to preserve unknown fields for forward compatibility.
5
+ */
6
+ export const GlobalConfigSchema = z
7
+ .object({
8
+ featureFlags: z
9
+ .record(z.string(), z.boolean())
10
+ .optional()
11
+ .default({}),
12
+ profile: z
13
+ .enum(['core', 'custom'])
14
+ .optional()
15
+ .default('core'),
16
+ delivery: z
17
+ .enum(['both', 'skills', 'commands'])
18
+ .optional()
19
+ .default('both'),
20
+ workflows: z
21
+ .array(z.string())
22
+ .optional(),
23
+ })
24
+ .passthrough();
25
+ /**
26
+ * Default configuration values.
27
+ */
28
+ export const DEFAULT_CONFIG = {
29
+ featureFlags: {},
30
+ profile: 'core',
31
+ delivery: 'both',
32
+ };
33
+ const KNOWN_TOP_LEVEL_KEYS = new Set([...Object.keys(DEFAULT_CONFIG), 'workflows']);
34
+ /**
35
+ * Validate a config key path for CLI set operations.
36
+ * Unknown top-level keys are rejected unless explicitly allowed by the caller.
37
+ */
38
+ export function validateConfigKeyPath(path) {
39
+ const rawKeys = path.split('.');
40
+ if (rawKeys.length === 0 || rawKeys.some((key) => key.trim() === '')) {
41
+ return { valid: false, reason: 'Key path must not be empty' };
42
+ }
43
+ const rootKey = rawKeys[0];
44
+ if (!KNOWN_TOP_LEVEL_KEYS.has(rootKey)) {
45
+ return { valid: false, reason: `Unknown top-level key "${rootKey}"` };
46
+ }
47
+ if (rootKey === 'featureFlags') {
48
+ if (rawKeys.length > 2) {
49
+ return { valid: false, reason: 'featureFlags values are booleans and do not support nested keys' };
50
+ }
51
+ return { valid: true };
52
+ }
53
+ if (rawKeys.length > 1) {
54
+ return { valid: false, reason: `"${rootKey}" does not support nested keys` };
55
+ }
56
+ return { valid: true };
57
+ }
58
+ /**
59
+ * Get a nested value from an object using dot notation.
60
+ *
61
+ * @param obj - The object to access
62
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
63
+ * @returns The value at the path, or undefined if not found
64
+ */
65
+ export function getNestedValue(obj, path) {
66
+ const keys = path.split('.');
67
+ let current = obj;
68
+ for (const key of keys) {
69
+ if (current === null || current === undefined) {
70
+ return undefined;
71
+ }
72
+ if (typeof current !== 'object') {
73
+ return undefined;
74
+ }
75
+ current = current[key];
76
+ }
77
+ return current;
78
+ }
79
+ /**
80
+ * Set a nested value in an object using dot notation.
81
+ * Creates intermediate objects as needed.
82
+ *
83
+ * @param obj - The object to modify (mutated in place)
84
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
85
+ * @param value - The value to set
86
+ */
87
+ export function setNestedValue(obj, path, value) {
88
+ const keys = path.split('.');
89
+ let current = obj;
90
+ for (let i = 0; i < keys.length - 1; i++) {
91
+ const key = keys[i];
92
+ if (current[key] === undefined || current[key] === null || typeof current[key] !== 'object') {
93
+ current[key] = {};
94
+ }
95
+ current = current[key];
96
+ }
97
+ const lastKey = keys[keys.length - 1];
98
+ current[lastKey] = value;
99
+ }
100
+ /**
101
+ * Delete a nested value from an object using dot notation.
102
+ *
103
+ * @param obj - The object to modify (mutated in place)
104
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
105
+ * @returns true if the key existed and was deleted, false otherwise
106
+ */
107
+ export function deleteNestedValue(obj, path) {
108
+ const keys = path.split('.');
109
+ let current = obj;
110
+ for (let i = 0; i < keys.length - 1; i++) {
111
+ const key = keys[i];
112
+ if (current[key] === undefined || current[key] === null || typeof current[key] !== 'object') {
113
+ return false;
114
+ }
115
+ current = current[key];
116
+ }
117
+ const lastKey = keys[keys.length - 1];
118
+ if (lastKey in current) {
119
+ delete current[lastKey];
120
+ return true;
121
+ }
122
+ return false;
123
+ }
124
+ /**
125
+ * Coerce a string value to its appropriate type.
126
+ * - "true" / "false" -> boolean
127
+ * - Numeric strings -> number
128
+ * - Everything else -> string
129
+ *
130
+ * @param value - The string value to coerce
131
+ * @param forceString - If true, always return the value as a string
132
+ * @returns The coerced value
133
+ */
134
+ export function coerceValue(value, forceString = false) {
135
+ if (forceString) {
136
+ return value;
137
+ }
138
+ // Boolean coercion
139
+ if (value === 'true') {
140
+ return true;
141
+ }
142
+ if (value === 'false') {
143
+ return false;
144
+ }
145
+ // Number coercion - must be a valid finite number
146
+ const num = Number(value);
147
+ if (!isNaN(num) && isFinite(num) && value.trim() !== '') {
148
+ return num;
149
+ }
150
+ return value;
151
+ }
152
+ /**
153
+ * Format a value for YAML-like display.
154
+ *
155
+ * @param value - The value to format
156
+ * @param indent - Current indentation level
157
+ * @returns Formatted string
158
+ */
159
+ export function formatValueYaml(value, indent = 0) {
160
+ const indentStr = ' '.repeat(indent);
161
+ if (value === null || value === undefined) {
162
+ return 'null';
163
+ }
164
+ if (typeof value === 'boolean' || typeof value === 'number') {
165
+ return String(value);
166
+ }
167
+ if (typeof value === 'string') {
168
+ return value;
169
+ }
170
+ if (Array.isArray(value)) {
171
+ if (value.length === 0) {
172
+ return '[]';
173
+ }
174
+ return value.map((item) => `${indentStr}- ${formatValueYaml(item, indent + 1)}`).join('\n');
175
+ }
176
+ if (typeof value === 'object') {
177
+ const entries = Object.entries(value);
178
+ if (entries.length === 0) {
179
+ return '{}';
180
+ }
181
+ return entries
182
+ .map(([key, val]) => {
183
+ const formattedVal = formatValueYaml(val, indent + 1);
184
+ if (typeof val === 'object' && val !== null && Object.keys(val).length > 0) {
185
+ return `${indentStr}${key}:\n${formattedVal}`;
186
+ }
187
+ return `${indentStr}${key}: ${formattedVal}`;
188
+ })
189
+ .join('\n');
190
+ }
191
+ return String(value);
192
+ }
193
+ /**
194
+ * Validate a configuration object against the schema.
195
+ *
196
+ * @param config - The configuration to validate
197
+ * @returns Validation result with success status and optional error message
198
+ */
199
+ export function validateConfig(config) {
200
+ try {
201
+ GlobalConfigSchema.parse(config);
202
+ return { success: true };
203
+ }
204
+ catch (error) {
205
+ if (error instanceof z.ZodError) {
206
+ const zodError = error;
207
+ const messages = zodError.issues.map((e) => `${e.path.join('.')}: ${e.message}`);
208
+ return { success: false, error: messages.join('; ') };
209
+ }
210
+ return { success: false, error: 'Unknown validation error' };
211
+ }
212
+ }
213
+ //# sourceMappingURL=config-schema.js.map
@@ -0,0 +1,19 @@
1
+ export declare const SYNSPEC_DIR_NAME = "synspec";
2
+ export declare const SYNSPEC_MARKERS: {
3
+ start: string;
4
+ end: string;
5
+ };
6
+ export interface SynspecConfig {
7
+ aiTools: string[];
8
+ }
9
+ export interface AIToolOption {
10
+ name: string;
11
+ value: string;
12
+ available: boolean;
13
+ successLabel?: string;
14
+ skillsDir?: string;
15
+ detectionPaths?: string[];
16
+ hasCommands?: boolean;
17
+ }
18
+ export declare const AI_TOOLS: AIToolOption[];
19
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,38 @@
1
+ export const SYNSPEC_DIR_NAME = 'synspec';
2
+ export const SYNSPEC_MARKERS = {
3
+ start: '<!-- SYNSPEC:START -->',
4
+ end: '<!-- SYNSPEC:END -->'
5
+ };
6
+ export const AI_TOOLS = [
7
+ { name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer', skillsDir: '.amazonq' },
8
+ { name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity', skillsDir: '.agent' },
9
+ { name: 'Auggie (Augment CLI)', value: 'auggie', available: true, successLabel: 'Auggie', skillsDir: '.augment' },
10
+ { name: 'Bob Shell', value: 'bob', available: true, successLabel: 'Bob Shell', skillsDir: '.bob' },
11
+ { name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code', skillsDir: '.claude', hasCommands: true },
12
+ { name: 'Cline', value: 'cline', available: true, successLabel: 'Cline', skillsDir: '.cline' },
13
+ { name: 'Codex', value: 'codex', available: true, successLabel: 'Codex', skillsDir: '.codex' },
14
+ { name: 'ForgeCode', value: 'forgecode', available: true, successLabel: 'ForgeCode', skillsDir: '.forge' },
15
+ { name: 'CodeBuddy Code (CLI)', value: 'codebuddy', available: true, successLabel: 'CodeBuddy Code', skillsDir: '.codebuddy' },
16
+ { name: 'Continue', value: 'continue', available: true, successLabel: 'Continue (VS Code / JetBrains / Cli)', skillsDir: '.continue' },
17
+ { name: 'CoStrict', value: 'costrict', available: true, successLabel: 'CoStrict', skillsDir: '.cospec' },
18
+ { name: 'Crush', value: 'crush', available: true, successLabel: 'Crush', skillsDir: '.crush' },
19
+ { name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor', skillsDir: '.cursor' },
20
+ { name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid', skillsDir: '.factory' },
21
+ { name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI', skillsDir: '.gemini' },
22
+ { name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot', skillsDir: '.github', detectionPaths: ['.github/copilot-instructions.md', '.github/instructions', '.github/workflows/copilot-setup-steps.yml', '.github/prompts', '.github/agents', '.github/skills', '.github/.mcp.json'] },
23
+ { name: 'iFlow', value: 'iflow', available: true, successLabel: 'iFlow', skillsDir: '.iflow' },
24
+ { name: 'Junie', value: 'junie', available: true, successLabel: 'Junie', skillsDir: '.junie' },
25
+ { name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code', skillsDir: '.kilocode' },
26
+ { name: 'Kimi CLI', value: 'kimi', available: true, successLabel: 'Kimi CLI', skillsDir: '.kimi' },
27
+ { name: 'Kiro', value: 'kiro', available: true, successLabel: 'Kiro', skillsDir: '.kiro' },
28
+ { name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode', skillsDir: '.opencode', hasCommands: true },
29
+ { name: 'Pi', value: 'pi', available: true, successLabel: 'Pi', skillsDir: '.pi' },
30
+ { name: 'Qoder', value: 'qoder', available: true, successLabel: 'Qoder', skillsDir: '.qoder' },
31
+ { name: 'Lingma', value: 'lingma', available: true, successLabel: 'Lingma', skillsDir: '.lingma' },
32
+ { name: 'Qwen Code', value: 'qwen', available: true, successLabel: 'Qwen Code', skillsDir: '.qwen' },
33
+ { name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode', skillsDir: '.roo' },
34
+ { name: 'Trae', value: 'trae', available: true, successLabel: 'Trae', skillsDir: '.trae' },
35
+ { name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf', skillsDir: '.windsurf' },
36
+ { name: 'AGENTS.md (works with Amp, VS Code, …)', value: 'agents', available: false, successLabel: 'your AGENTS.md-compatible assistant' }
37
+ ];
38
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,6 @@
1
+ export declare class JsonConverter {
2
+ convertSpecToJson(filePath: string): string;
3
+ convertChangeToJson(filePath: string): Promise<string>;
4
+ private extractNameFromPath;
5
+ }
6
+ //# sourceMappingURL=json-converter.d.ts.map
@@ -0,0 +1,51 @@
1
+ import { readFileSync } from 'fs';
2
+ import path from 'path';
3
+ import { MarkdownParser } from '../parsers/markdown-parser.js';
4
+ import { ChangeParser } from '../parsers/change-parser.js';
5
+ import { FileSystemUtils } from '../../utils/file-system.js';
6
+ export class JsonConverter {
7
+ convertSpecToJson(filePath) {
8
+ const content = readFileSync(filePath, 'utf-8');
9
+ const parser = new MarkdownParser(content);
10
+ const specName = this.extractNameFromPath(filePath);
11
+ const spec = parser.parseSpec(specName);
12
+ const jsonSpec = {
13
+ ...spec,
14
+ metadata: {
15
+ ...spec.metadata,
16
+ sourcePath: filePath,
17
+ },
18
+ };
19
+ return JSON.stringify(jsonSpec, null, 2);
20
+ }
21
+ async convertChangeToJson(filePath) {
22
+ const content = readFileSync(filePath, 'utf-8');
23
+ const changeName = this.extractNameFromPath(filePath);
24
+ const changeDir = path.dirname(filePath);
25
+ const parser = new ChangeParser(content, changeDir);
26
+ const change = await parser.parseChangeWithDeltas(changeName);
27
+ const jsonChange = {
28
+ ...change,
29
+ metadata: {
30
+ ...change.metadata,
31
+ sourcePath: filePath,
32
+ },
33
+ };
34
+ return JSON.stringify(jsonChange, null, 2);
35
+ }
36
+ extractNameFromPath(filePath) {
37
+ const normalizedPath = FileSystemUtils.toPosixPath(filePath);
38
+ const parts = normalizedPath.split('/');
39
+ for (let i = parts.length - 1; i >= 0; i--) {
40
+ if (parts[i] === 'specs' || parts[i] === 'changes') {
41
+ if (i < parts.length - 1) {
42
+ return parts[i + 1];
43
+ }
44
+ }
45
+ }
46
+ const fileName = parts[parts.length - 1] ?? '';
47
+ const dotIndex = fileName.lastIndexOf('.');
48
+ return dotIndex > 0 ? fileName.slice(0, dotIndex) : fileName;
49
+ }
50
+ }
51
+ //# sourceMappingURL=json-converter.js.map
@@ -0,0 +1,49 @@
1
+ export declare const GLOBAL_CONFIG_DIR_NAME = "synarcx";
2
+ export declare const GLOBAL_CONFIG_FILE_NAME = "config.json";
3
+ export declare const GLOBAL_DATA_DIR_NAME = "synarcx";
4
+ export type Profile = 'core' | 'custom';
5
+ export type Delivery = 'both' | 'skills' | 'commands';
6
+ export interface GlobalConfig {
7
+ featureFlags?: Record<string, boolean>;
8
+ profile?: Profile;
9
+ delivery?: Delivery;
10
+ workflows?: string[];
11
+ }
12
+ /**
13
+ * Gets the global configuration directory path following XDG Base Directory Specification.
14
+ *
15
+ * - All platforms: $XDG_CONFIG_HOME/synarcx/ if XDG_CONFIG_HOME is set
16
+ * - Unix/macOS fallback: ~/.config/synarcx/
17
+ * - Windows fallback: %APPDATA%/synarcx/
18
+ */
19
+ export declare function getGlobalConfigDir(): string;
20
+ /**
21
+ * Gets the global data directory path following XDG Base Directory Specification.
22
+ * Used for user data like schema overrides.
23
+ *
24
+ * - All platforms: $XDG_DATA_HOME/synarcx/ if XDG_DATA_HOME is set
25
+ * - Unix/macOS fallback: ~/.local/share/synarcx/
26
+ * - Windows fallback: %LOCALAPPDATA%/synarcx/
27
+ */
28
+ export interface GlobalDataDirOptions {
29
+ env?: NodeJS.ProcessEnv;
30
+ platform?: NodeJS.Platform;
31
+ homedir?: string;
32
+ }
33
+ export declare function getGlobalDataDir(options?: GlobalDataDirOptions): string;
34
+ /**
35
+ * Gets the path to the global config file.
36
+ */
37
+ export declare function getGlobalConfigPath(): string;
38
+ /**
39
+ * Loads the global configuration from disk.
40
+ * Returns default configuration if file doesn't exist or is invalid.
41
+ * Merges loaded config with defaults to ensure new fields are available.
42
+ */
43
+ export declare function getGlobalConfig(): GlobalConfig;
44
+ /**
45
+ * Saves the global configuration to disk.
46
+ * Creates the config directory if it doesn't exist.
47
+ */
48
+ export declare function saveGlobalConfig(config: GlobalConfig): void;
49
+ //# sourceMappingURL=global-config.d.ts.map