@kynetic-ai/spec 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 (278) hide show
  1. package/README.md +263 -0
  2. package/dist/acp/client.d.ts +159 -0
  3. package/dist/acp/client.d.ts.map +1 -0
  4. package/dist/acp/client.js +255 -0
  5. package/dist/acp/client.js.map +1 -0
  6. package/dist/acp/framing.d.ts +119 -0
  7. package/dist/acp/framing.d.ts.map +1 -0
  8. package/dist/acp/framing.js +302 -0
  9. package/dist/acp/framing.js.map +1 -0
  10. package/dist/acp/index.d.ts +14 -0
  11. package/dist/acp/index.d.ts.map +1 -0
  12. package/dist/acp/index.js +13 -0
  13. package/dist/acp/index.js.map +1 -0
  14. package/dist/acp/types.d.ts +89 -0
  15. package/dist/acp/types.d.ts.map +1 -0
  16. package/dist/acp/types.js +99 -0
  17. package/dist/acp/types.js.map +1 -0
  18. package/dist/agents/adapters.d.ts +55 -0
  19. package/dist/agents/adapters.d.ts.map +1 -0
  20. package/dist/agents/adapters.js +84 -0
  21. package/dist/agents/adapters.js.map +1 -0
  22. package/dist/agents/index.d.ts +8 -0
  23. package/dist/agents/index.d.ts.map +1 -0
  24. package/dist/agents/index.js +10 -0
  25. package/dist/agents/index.js.map +1 -0
  26. package/dist/agents/spawner.d.ts +53 -0
  27. package/dist/agents/spawner.d.ts.map +1 -0
  28. package/dist/agents/spawner.js +83 -0
  29. package/dist/agents/spawner.js.map +1 -0
  30. package/dist/cli/batch.d.ts +82 -0
  31. package/dist/cli/batch.d.ts.map +1 -0
  32. package/dist/cli/batch.js +162 -0
  33. package/dist/cli/batch.js.map +1 -0
  34. package/dist/cli/commands/clone-for-testing.d.ts +6 -0
  35. package/dist/cli/commands/clone-for-testing.d.ts.map +1 -0
  36. package/dist/cli/commands/clone-for-testing.js +176 -0
  37. package/dist/cli/commands/clone-for-testing.js.map +1 -0
  38. package/dist/cli/commands/derive.d.ts +6 -0
  39. package/dist/cli/commands/derive.d.ts.map +1 -0
  40. package/dist/cli/commands/derive.js +450 -0
  41. package/dist/cli/commands/derive.js.map +1 -0
  42. package/dist/cli/commands/help.d.ts +6 -0
  43. package/dist/cli/commands/help.d.ts.map +1 -0
  44. package/dist/cli/commands/help.js +196 -0
  45. package/dist/cli/commands/help.js.map +1 -0
  46. package/dist/cli/commands/inbox.d.ts +6 -0
  47. package/dist/cli/commands/inbox.d.ts.map +1 -0
  48. package/dist/cli/commands/inbox.js +235 -0
  49. package/dist/cli/commands/inbox.js.map +1 -0
  50. package/dist/cli/commands/index.d.ts +20 -0
  51. package/dist/cli/commands/index.d.ts.map +1 -0
  52. package/dist/cli/commands/index.js +21 -0
  53. package/dist/cli/commands/index.js.map +1 -0
  54. package/dist/cli/commands/init.d.ts +6 -0
  55. package/dist/cli/commands/init.d.ts.map +1 -0
  56. package/dist/cli/commands/init.js +245 -0
  57. package/dist/cli/commands/init.js.map +1 -0
  58. package/dist/cli/commands/item.d.ts +6 -0
  59. package/dist/cli/commands/item.d.ts.map +1 -0
  60. package/dist/cli/commands/item.js +1311 -0
  61. package/dist/cli/commands/item.js.map +1 -0
  62. package/dist/cli/commands/link.d.ts +6 -0
  63. package/dist/cli/commands/link.d.ts.map +1 -0
  64. package/dist/cli/commands/link.js +288 -0
  65. package/dist/cli/commands/link.js.map +1 -0
  66. package/dist/cli/commands/log.d.ts +16 -0
  67. package/dist/cli/commands/log.d.ts.map +1 -0
  68. package/dist/cli/commands/log.js +291 -0
  69. package/dist/cli/commands/log.js.map +1 -0
  70. package/dist/cli/commands/meta.d.ts +15 -0
  71. package/dist/cli/commands/meta.d.ts.map +1 -0
  72. package/dist/cli/commands/meta.js +1378 -0
  73. package/dist/cli/commands/meta.js.map +1 -0
  74. package/dist/cli/commands/module.d.ts +6 -0
  75. package/dist/cli/commands/module.d.ts.map +1 -0
  76. package/dist/cli/commands/module.js +102 -0
  77. package/dist/cli/commands/module.js.map +1 -0
  78. package/dist/cli/commands/ralph.d.ts +9 -0
  79. package/dist/cli/commands/ralph.d.ts.map +1 -0
  80. package/dist/cli/commands/ralph.js +465 -0
  81. package/dist/cli/commands/ralph.js.map +1 -0
  82. package/dist/cli/commands/search.d.ts +6 -0
  83. package/dist/cli/commands/search.d.ts.map +1 -0
  84. package/dist/cli/commands/search.js +134 -0
  85. package/dist/cli/commands/search.js.map +1 -0
  86. package/dist/cli/commands/session.d.ts +164 -0
  87. package/dist/cli/commands/session.d.ts.map +1 -0
  88. package/dist/cli/commands/session.js +745 -0
  89. package/dist/cli/commands/session.js.map +1 -0
  90. package/dist/cli/commands/setup.d.ts +26 -0
  91. package/dist/cli/commands/setup.d.ts.map +1 -0
  92. package/dist/cli/commands/setup.js +586 -0
  93. package/dist/cli/commands/setup.js.map +1 -0
  94. package/dist/cli/commands/shadow.d.ts +6 -0
  95. package/dist/cli/commands/shadow.d.ts.map +1 -0
  96. package/dist/cli/commands/shadow.js +299 -0
  97. package/dist/cli/commands/shadow.js.map +1 -0
  98. package/dist/cli/commands/task.d.ts +6 -0
  99. package/dist/cli/commands/task.d.ts.map +1 -0
  100. package/dist/cli/commands/task.js +1514 -0
  101. package/dist/cli/commands/task.js.map +1 -0
  102. package/dist/cli/commands/tasks.d.ts +6 -0
  103. package/dist/cli/commands/tasks.d.ts.map +1 -0
  104. package/dist/cli/commands/tasks.js +347 -0
  105. package/dist/cli/commands/tasks.js.map +1 -0
  106. package/dist/cli/commands/trait.d.ts +10 -0
  107. package/dist/cli/commands/trait.d.ts.map +1 -0
  108. package/dist/cli/commands/trait.js +295 -0
  109. package/dist/cli/commands/trait.js.map +1 -0
  110. package/dist/cli/commands/validate.d.ts +6 -0
  111. package/dist/cli/commands/validate.d.ts.map +1 -0
  112. package/dist/cli/commands/validate.js +626 -0
  113. package/dist/cli/commands/validate.js.map +1 -0
  114. package/dist/cli/exit-codes.d.ts +62 -0
  115. package/dist/cli/exit-codes.d.ts.map +1 -0
  116. package/dist/cli/exit-codes.js +65 -0
  117. package/dist/cli/exit-codes.js.map +1 -0
  118. package/dist/cli/help/content.d.ts +35 -0
  119. package/dist/cli/help/content.d.ts.map +1 -0
  120. package/dist/cli/help/content.js +312 -0
  121. package/dist/cli/help/content.js.map +1 -0
  122. package/dist/cli/index.d.ts +5 -0
  123. package/dist/cli/index.d.ts.map +1 -0
  124. package/dist/cli/index.js +85 -0
  125. package/dist/cli/index.js.map +1 -0
  126. package/dist/cli/introspection.d.ts +87 -0
  127. package/dist/cli/introspection.d.ts.map +1 -0
  128. package/dist/cli/introspection.js +127 -0
  129. package/dist/cli/introspection.js.map +1 -0
  130. package/dist/cli/output.d.ts +56 -0
  131. package/dist/cli/output.d.ts.map +1 -0
  132. package/dist/cli/output.js +467 -0
  133. package/dist/cli/output.js.map +1 -0
  134. package/dist/cli/suggest.d.ts +16 -0
  135. package/dist/cli/suggest.d.ts.map +1 -0
  136. package/dist/cli/suggest.js +72 -0
  137. package/dist/cli/suggest.js.map +1 -0
  138. package/dist/index.d.ts +3 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +5 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/parser/alignment.d.ts +113 -0
  143. package/dist/parser/alignment.d.ts.map +1 -0
  144. package/dist/parser/alignment.js +261 -0
  145. package/dist/parser/alignment.js.map +1 -0
  146. package/dist/parser/assess.d.ts +81 -0
  147. package/dist/parser/assess.d.ts.map +1 -0
  148. package/dist/parser/assess.js +197 -0
  149. package/dist/parser/assess.js.map +1 -0
  150. package/dist/parser/convention-validation.d.ts +48 -0
  151. package/dist/parser/convention-validation.d.ts.map +1 -0
  152. package/dist/parser/convention-validation.js +167 -0
  153. package/dist/parser/convention-validation.js.map +1 -0
  154. package/dist/parser/fix.d.ts +38 -0
  155. package/dist/parser/fix.d.ts.map +1 -0
  156. package/dist/parser/fix.js +185 -0
  157. package/dist/parser/fix.js.map +1 -0
  158. package/dist/parser/index.d.ts +12 -0
  159. package/dist/parser/index.d.ts.map +1 -0
  160. package/dist/parser/index.js +13 -0
  161. package/dist/parser/index.js.map +1 -0
  162. package/dist/parser/items.d.ts +138 -0
  163. package/dist/parser/items.d.ts.map +1 -0
  164. package/dist/parser/items.js +321 -0
  165. package/dist/parser/items.js.map +1 -0
  166. package/dist/parser/meta.d.ts +120 -0
  167. package/dist/parser/meta.d.ts.map +1 -0
  168. package/dist/parser/meta.js +441 -0
  169. package/dist/parser/meta.js.map +1 -0
  170. package/dist/parser/refs.d.ts +185 -0
  171. package/dist/parser/refs.d.ts.map +1 -0
  172. package/dist/parser/refs.js +404 -0
  173. package/dist/parser/refs.js.map +1 -0
  174. package/dist/parser/shadow.d.ts +253 -0
  175. package/dist/parser/shadow.d.ts.map +1 -0
  176. package/dist/parser/shadow.js +1053 -0
  177. package/dist/parser/shadow.js.map +1 -0
  178. package/dist/parser/traits.d.ts +72 -0
  179. package/dist/parser/traits.d.ts.map +1 -0
  180. package/dist/parser/traits.js +120 -0
  181. package/dist/parser/traits.js.map +1 -0
  182. package/dist/parser/validate.d.ts +89 -0
  183. package/dist/parser/validate.d.ts.map +1 -0
  184. package/dist/parser/validate.js +817 -0
  185. package/dist/parser/validate.js.map +1 -0
  186. package/dist/parser/yaml.d.ts +326 -0
  187. package/dist/parser/yaml.d.ts.map +1 -0
  188. package/dist/parser/yaml.js +1383 -0
  189. package/dist/parser/yaml.js.map +1 -0
  190. package/dist/ralph/cli-renderer.d.ts +20 -0
  191. package/dist/ralph/cli-renderer.d.ts.map +1 -0
  192. package/dist/ralph/cli-renderer.js +179 -0
  193. package/dist/ralph/cli-renderer.js.map +1 -0
  194. package/dist/ralph/events.d.ts +65 -0
  195. package/dist/ralph/events.d.ts.map +1 -0
  196. package/dist/ralph/events.js +397 -0
  197. package/dist/ralph/events.js.map +1 -0
  198. package/dist/ralph/index.d.ts +8 -0
  199. package/dist/ralph/index.d.ts.map +1 -0
  200. package/dist/ralph/index.js +10 -0
  201. package/dist/ralph/index.js.map +1 -0
  202. package/dist/schema/common.d.ts +46 -0
  203. package/dist/schema/common.d.ts.map +1 -0
  204. package/dist/schema/common.js +71 -0
  205. package/dist/schema/common.js.map +1 -0
  206. package/dist/schema/inbox.d.ts +90 -0
  207. package/dist/schema/inbox.d.ts.map +1 -0
  208. package/dist/schema/inbox.js +30 -0
  209. package/dist/schema/inbox.js.map +1 -0
  210. package/dist/schema/index.d.ts +6 -0
  211. package/dist/schema/index.d.ts.map +1 -0
  212. package/dist/schema/index.js +7 -0
  213. package/dist/schema/index.js.map +1 -0
  214. package/dist/schema/meta.d.ts +762 -0
  215. package/dist/schema/meta.d.ts.map +1 -0
  216. package/dist/schema/meta.js +144 -0
  217. package/dist/schema/meta.js.map +1 -0
  218. package/dist/schema/spec.d.ts +912 -0
  219. package/dist/schema/spec.d.ts.map +1 -0
  220. package/dist/schema/spec.js +104 -0
  221. package/dist/schema/spec.js.map +1 -0
  222. package/dist/schema/task.d.ts +664 -0
  223. package/dist/schema/task.d.ts.map +1 -0
  224. package/dist/schema/task.js +130 -0
  225. package/dist/schema/task.js.map +1 -0
  226. package/dist/sessions/index.d.ts +11 -0
  227. package/dist/sessions/index.d.ts.map +1 -0
  228. package/dist/sessions/index.js +13 -0
  229. package/dist/sessions/index.js.map +1 -0
  230. package/dist/sessions/store.d.ts +144 -0
  231. package/dist/sessions/store.d.ts.map +1 -0
  232. package/dist/sessions/store.js +325 -0
  233. package/dist/sessions/store.js.map +1 -0
  234. package/dist/sessions/types.d.ts +157 -0
  235. package/dist/sessions/types.d.ts.map +1 -0
  236. package/dist/sessions/types.js +90 -0
  237. package/dist/sessions/types.js.map +1 -0
  238. package/dist/strings/errors.d.ts +420 -0
  239. package/dist/strings/errors.d.ts.map +1 -0
  240. package/dist/strings/errors.js +282 -0
  241. package/dist/strings/errors.js.map +1 -0
  242. package/dist/strings/guidance.d.ts +65 -0
  243. package/dist/strings/guidance.d.ts.map +1 -0
  244. package/dist/strings/guidance.js +66 -0
  245. package/dist/strings/guidance.js.map +1 -0
  246. package/dist/strings/index.d.ts +12 -0
  247. package/dist/strings/index.d.ts.map +1 -0
  248. package/dist/strings/index.js +12 -0
  249. package/dist/strings/index.js.map +1 -0
  250. package/dist/strings/labels.d.ts +74 -0
  251. package/dist/strings/labels.d.ts.map +1 -0
  252. package/dist/strings/labels.js +75 -0
  253. package/dist/strings/labels.js.map +1 -0
  254. package/dist/strings/validation.d.ts +126 -0
  255. package/dist/strings/validation.d.ts.map +1 -0
  256. package/dist/strings/validation.js +135 -0
  257. package/dist/strings/validation.js.map +1 -0
  258. package/dist/utils/commit.d.ts +23 -0
  259. package/dist/utils/commit.d.ts.map +1 -0
  260. package/dist/utils/commit.js +67 -0
  261. package/dist/utils/commit.js.map +1 -0
  262. package/dist/utils/git.d.ts +57 -0
  263. package/dist/utils/git.d.ts.map +1 -0
  264. package/dist/utils/git.js +192 -0
  265. package/dist/utils/git.js.map +1 -0
  266. package/dist/utils/grep.d.ts +28 -0
  267. package/dist/utils/grep.d.ts.map +1 -0
  268. package/dist/utils/grep.js +86 -0
  269. package/dist/utils/grep.js.map +1 -0
  270. package/dist/utils/index.d.ts +8 -0
  271. package/dist/utils/index.d.ts.map +1 -0
  272. package/dist/utils/index.js +6 -0
  273. package/dist/utils/index.js.map +1 -0
  274. package/dist/utils/time.d.ts +18 -0
  275. package/dist/utils/time.d.ts.map +1 -0
  276. package/dist/utils/time.js +61 -0
  277. package/dist/utils/time.js.map +1 -0
  278. package/package.json +62 -0
@@ -0,0 +1,420 @@
1
+ /**
2
+ * Centralized error messages for CLI commands
3
+ *
4
+ * Organizes error messages by category to improve maintainability and consistency.
5
+ * Each category corresponds to a common error pattern across command files.
6
+ */
7
+ /**
8
+ * Reference resolution errors (not found, ambiguous, wrong type)
9
+ */
10
+ export declare const referenceErrors: {
11
+ readonly itemNotFound: (ref: string) => string;
12
+ readonly taskNotFound: (ref: string) => string;
13
+ readonly specNotFound: (ref: string) => string;
14
+ readonly metaNotFound: (ref: string) => string;
15
+ readonly inboxNotFound: (ref: string) => string;
16
+ readonly observationNotFound: (ref: string) => string;
17
+ readonly depNotFound: (ref: string) => string;
18
+ readonly acNotFound: (acId: string, itemRef: string) => string;
19
+ readonly ambiguous: (ref: string) => string;
20
+ readonly slugMapsToMultiple: (ref: string) => string;
21
+ readonly notTask: (ref: string) => string;
22
+ readonly notItem: (ref: string) => string;
23
+ readonly taskUseTaskCommands: (ref: string) => string;
24
+ readonly itemUseTaskCancel: (ref: string) => string;
25
+ readonly parentIsTask: (ref: string) => string;
26
+ readonly notSpecItem: (ref: string) => string;
27
+ readonly metaRefNotFound: (ref: string) => string;
28
+ readonly metaRefPointsToSpec: (ref: string) => string;
29
+ readonly specRefNotFound: (ref: string) => string;
30
+ readonly specRefIsTask: (ref: string) => string;
31
+ readonly refNotFound: (ref: string) => string;
32
+ };
33
+ /**
34
+ * Slug validation errors
35
+ */
36
+ export declare const slugErrors: {
37
+ readonly alreadyExists: (slug: string, existingUlid: string) => string;
38
+ readonly notFound: (slug: string) => string;
39
+ readonly cannotRemoveLast: (slug: string) => string;
40
+ };
41
+ /**
42
+ * Validation errors (JSON, data format, constraints)
43
+ */
44
+ export declare const validationErrors: {
45
+ readonly invalidJson: "Invalid JSON syntax";
46
+ readonly invalidJsonInData: (err: string) => string;
47
+ readonly invalidJsonFromStdin: (err: string) => string;
48
+ readonly invalidPatchData: (err: string) => string;
49
+ readonly noPatchesProvided: "No patches provided";
50
+ readonly noPatchData: "No patch data. Use --data or pipe JSON to stdin.";
51
+ readonly noInputProvided: "No input provided. Use --data for single item or pipe JSONL/JSON for bulk.";
52
+ readonly failedToParseBulk: (err: string) => string;
53
+ readonly expectedJsonArray: "Expected JSON array";
54
+ readonly patchMustBeObject: (index: number) => string;
55
+ readonly patchMustHaveRef: (index: number) => string;
56
+ readonly patchMustHaveData: (index: number) => string;
57
+ readonly jsonLineError: (line: number, message: string) => string;
58
+ readonly unknownFields: (fields: string[]) => string;
59
+ readonly invalidPatchDataWithIssues: (issues: string) => string;
60
+ readonly priorityOutOfRange: "Priority must be between 1 and 5";
61
+ readonly invalidObservationType: (type: string) => string;
62
+ readonly invalidType: (type: string, validTypes: string[]) => string;
63
+ readonly invalidTodoId: (id: string) => string;
64
+ readonly titleRequired: "Task title is required";
65
+ readonly resolutionRequired: "Resolution text is required";
66
+ readonly agentRequiresId: "Agent requires --id";
67
+ readonly agentRequiresName: "Agent requires --name";
68
+ readonly workflowRequiresId: "Workflow requires --id";
69
+ readonly workflowRequiresTrigger: "Workflow requires --trigger";
70
+ readonly conventionRequiresDomain: "Convention requires --domain";
71
+ };
72
+ /**
73
+ * Status/state errors (wrong status for operation)
74
+ */
75
+ export declare const statusErrors: {
76
+ readonly cannotStart: (status: string) => string;
77
+ readonly cannotComplete: (status: string) => string;
78
+ readonly cannotBlock: (status: string) => string;
79
+ readonly completeRequiresReview: "Task must be submitted for review first. Use: kspec task submit @ref";
80
+ readonly completeRequiresStart: "Task must be started and submitted first";
81
+ readonly completeBlockedTask: "Cannot complete blocked task";
82
+ readonly completeCancelledTask: "Cannot complete cancelled task. Use: kspec task reset @ref first";
83
+ readonly completeAlreadyCompleted: "Task is already completed";
84
+ readonly skipReviewRequiresReason: "--skip-review requires --reason to document why";
85
+ };
86
+ /**
87
+ * Duplicate/conflict errors
88
+ */
89
+ export declare const conflictErrors: {
90
+ readonly acAlreadyExists: (acId: string, itemRef: string) => string;
91
+ readonly acIdAlreadyExists: (acId: string) => string;
92
+ readonly observationAlreadyPromoted: (taskRef: string) => string;
93
+ readonly observationAlreadyResolved: (date: string, reason: string) => string;
94
+ readonly specDirExists: (dir: string) => string;
95
+ readonly moduleFileExists: (path: string) => string;
96
+ };
97
+ /**
98
+ * Operation not allowed errors
99
+ */
100
+ export declare const operationErrors: {
101
+ readonly cannotDeleteNoSource: "Cannot delete item: no source file tracked";
102
+ readonly cannotPromoteResolved: "Cannot promote resolved observation; use --force to override";
103
+ readonly tasksNoAcceptanceCriteria: (ref: string) => string;
104
+ readonly confirmRequired: (itemLabel: string) => string;
105
+ readonly cannotDeleteReferencedByTasks: (itemLabel: string, count: number, taskRefs: string) => string;
106
+ readonly cannotDeleteReferencedByObservations: (itemLabel: string, count: number, obsRefs: string) => string;
107
+ readonly deleteItemFailed: (itemLabel: string) => string;
108
+ };
109
+ /**
110
+ * Git-related errors
111
+ */
112
+ export declare const gitErrors: {
113
+ readonly notGitRepo: "Not a git repository";
114
+ readonly couldNotDetermineRoot: "Could not determine git root directory";
115
+ };
116
+ /**
117
+ * Project/initialization errors
118
+ */
119
+ export declare const projectErrors: {
120
+ readonly noKspecProject: "No kspec project found";
121
+ readonly shadowInitFailed: (error: string) => string;
122
+ readonly couldNotGetImplSummary: "Could not get implementation summary";
123
+ readonly runningFromShadow: "Cannot run kspec from inside .kspec/ directory";
124
+ readonly runningFromShadowHint: (projectRoot: string) => string;
125
+ };
126
+ /**
127
+ * Usage/argument errors
128
+ */
129
+ export declare const usageErrors: {
130
+ readonly deriveNeedRefOrAll: "Either provide a spec reference or use --all";
131
+ readonly deriveCannotUseBoth: "Cannot use both a specific reference and --all";
132
+ readonly deriveUsageHelp: {
133
+ readonly header: "Usage:";
134
+ readonly examples: readonly [" kspec derive @spec-ref", " kspec derive @spec-ref --flat", " kspec derive --all"];
135
+ };
136
+ readonly patchNeedRef: "Reference required for single item patch. Use: kspec item patch <ref> --data <json>";
137
+ readonly logNeedRef: "Provide a reference or use --spec/--task";
138
+ readonly maxLoopsPositive: "--max-loops must be a positive integer";
139
+ readonly maxRetriesNonNegative: "--max-retries must be a non-negative integer";
140
+ readonly maxFailuresPositive: "--max-failures must be a positive integer";
141
+ readonly agentPromptCancelled: "Agent prompt was cancelled";
142
+ readonly deriveNoRef: "Either provide a spec reference or use --all";
143
+ readonly deriveRefAndAll: "Cannot use both a specific reference and --all";
144
+ };
145
+ /**
146
+ * Generic operation failures (with err object)
147
+ */
148
+ export declare const operationFailures: {
149
+ readonly listItems: "Failed to list items";
150
+ readonly getItem: "Failed to get item";
151
+ readonly createItem: "Failed to create item";
152
+ readonly updateItem: "Failed to update item";
153
+ readonly deleteItem: "Failed to delete item";
154
+ readonly patchItems: "Failed to patch item(s)";
155
+ readonly getItemStatus: "Failed to get item status";
156
+ readonly getTypes: "Failed to get types";
157
+ readonly getTags: "Failed to get tags";
158
+ readonly listAc: "Failed to list acceptance criteria";
159
+ readonly addAc: "Failed to add acceptance criterion";
160
+ readonly updateAc: "Failed to update acceptance criterion";
161
+ readonly removeAc: "Failed to remove acceptance criterion";
162
+ readonly getTask: "Failed to get task";
163
+ readonly createTask: "Failed to create task";
164
+ readonly updateTask: "Failed to update task";
165
+ readonly patchTask: "Failed to patch task";
166
+ readonly startTask: "Failed to start task";
167
+ readonly completeTask: "Failed to complete task";
168
+ readonly blockTask: "Failed to block task";
169
+ readonly unblockTask: "Failed to unblock task";
170
+ readonly cancelTask: "Failed to cancel task";
171
+ readonly deleteTask: "Failed to delete task";
172
+ readonly addNote: "Failed to add note";
173
+ readonly getNotes: "Failed to get notes";
174
+ readonly getTodos: "Failed to get todos";
175
+ readonly addTodo: "Failed to add todo";
176
+ readonly markTodoDone: "Failed to mark todo as done";
177
+ readonly markTodoNotDone: "Failed to mark todo as not done";
178
+ readonly listTasks: "Failed to list tasks";
179
+ readonly getReadyTasks: "Failed to get ready tasks";
180
+ readonly getNextTask: "Failed to get next task";
181
+ readonly getBlockedTasks: "Failed to get blocked tasks";
182
+ readonly getActiveTasks: "Failed to get active tasks";
183
+ readonly showMeta: "Failed to show meta";
184
+ readonly listAgents: "Failed to list agents";
185
+ readonly listWorkflows: "Failed to list workflows";
186
+ readonly listConventions: "Failed to list conventions";
187
+ readonly getMetaItem: "Failed to get meta item";
188
+ readonly listMetaItems: "Failed to list meta items";
189
+ readonly createObservation: "Failed to create observation";
190
+ readonly listObservations: "Failed to list observations";
191
+ readonly promoteObservation: "Failed to promote observation";
192
+ readonly resolveObservation: "Failed to resolve observation";
193
+ readonly createMeta: (type: string) => string;
194
+ readonly updateMetaItem: "Failed to update meta item";
195
+ readonly deleteMetaItem: "Failed to delete meta item";
196
+ readonly addInboxItem: "Failed to add inbox item";
197
+ readonly listInboxItems: "Failed to list inbox items";
198
+ readonly promoteInboxItem: "Failed to promote inbox item";
199
+ readonly deleteInboxItem: "Failed to delete inbox item";
200
+ readonly getInboxItem: "Failed to get inbox item";
201
+ readonly gatherSessionContext: "Failed to gather session context";
202
+ readonly runCheckpoint: "Failed to run checkpoint";
203
+ readonly updateSessionContext: "Failed to update session context";
204
+ readonly search: "Failed to search";
205
+ readonly searchCommits: "Failed to search commits";
206
+ readonly initProject: "Failed to initialize project";
207
+ readonly installConfig: (agentType: string) => string;
208
+ readonly setupFailed: "Setup failed";
209
+ readonly deriveTasks: "Failed to derive tasks";
210
+ readonly ralphLoop: "Ralph loop failed";
211
+ readonly iterationFailed: (err: string) => string;
212
+ readonly iterationFailedAfterRetries: (iteration: number, maxRetries: number, consecutiveFailures: number, maxFailures: number) => string;
213
+ readonly lastError: (err: string) => string;
214
+ readonly reachedMaxFailures: (maxFailures: number) => string;
215
+ };
216
+ /**
217
+ * Todo-specific errors
218
+ */
219
+ export declare const todoErrors: {
220
+ readonly notFound: (id: number) => string;
221
+ readonly invalidId: (id: string) => string;
222
+ };
223
+ /**
224
+ * Relationship/link errors
225
+ */
226
+ export declare const relationshipErrors: {
227
+ readonly invalidType: (type: string, validTypes: string) => string;
228
+ };
229
+ /**
230
+ * Re-export all error categories as a single object for convenience
231
+ */
232
+ export declare const errors: {
233
+ readonly reference: {
234
+ readonly itemNotFound: (ref: string) => string;
235
+ readonly taskNotFound: (ref: string) => string;
236
+ readonly specNotFound: (ref: string) => string;
237
+ readonly metaNotFound: (ref: string) => string;
238
+ readonly inboxNotFound: (ref: string) => string;
239
+ readonly observationNotFound: (ref: string) => string;
240
+ readonly depNotFound: (ref: string) => string;
241
+ readonly acNotFound: (acId: string, itemRef: string) => string;
242
+ readonly ambiguous: (ref: string) => string;
243
+ readonly slugMapsToMultiple: (ref: string) => string;
244
+ readonly notTask: (ref: string) => string;
245
+ readonly notItem: (ref: string) => string;
246
+ readonly taskUseTaskCommands: (ref: string) => string;
247
+ readonly itemUseTaskCancel: (ref: string) => string;
248
+ readonly parentIsTask: (ref: string) => string;
249
+ readonly notSpecItem: (ref: string) => string;
250
+ readonly metaRefNotFound: (ref: string) => string;
251
+ readonly metaRefPointsToSpec: (ref: string) => string;
252
+ readonly specRefNotFound: (ref: string) => string;
253
+ readonly specRefIsTask: (ref: string) => string;
254
+ readonly refNotFound: (ref: string) => string;
255
+ };
256
+ readonly slug: {
257
+ readonly alreadyExists: (slug: string, existingUlid: string) => string;
258
+ readonly notFound: (slug: string) => string;
259
+ readonly cannotRemoveLast: (slug: string) => string;
260
+ };
261
+ readonly validation: {
262
+ readonly invalidJson: "Invalid JSON syntax";
263
+ readonly invalidJsonInData: (err: string) => string;
264
+ readonly invalidJsonFromStdin: (err: string) => string;
265
+ readonly invalidPatchData: (err: string) => string;
266
+ readonly noPatchesProvided: "No patches provided";
267
+ readonly noPatchData: "No patch data. Use --data or pipe JSON to stdin.";
268
+ readonly noInputProvided: "No input provided. Use --data for single item or pipe JSONL/JSON for bulk.";
269
+ readonly failedToParseBulk: (err: string) => string;
270
+ readonly expectedJsonArray: "Expected JSON array";
271
+ readonly patchMustBeObject: (index: number) => string;
272
+ readonly patchMustHaveRef: (index: number) => string;
273
+ readonly patchMustHaveData: (index: number) => string;
274
+ readonly jsonLineError: (line: number, message: string) => string;
275
+ readonly unknownFields: (fields: string[]) => string;
276
+ readonly invalidPatchDataWithIssues: (issues: string) => string;
277
+ readonly priorityOutOfRange: "Priority must be between 1 and 5";
278
+ readonly invalidObservationType: (type: string) => string;
279
+ readonly invalidType: (type: string, validTypes: string[]) => string;
280
+ readonly invalidTodoId: (id: string) => string;
281
+ readonly titleRequired: "Task title is required";
282
+ readonly resolutionRequired: "Resolution text is required";
283
+ readonly agentRequiresId: "Agent requires --id";
284
+ readonly agentRequiresName: "Agent requires --name";
285
+ readonly workflowRequiresId: "Workflow requires --id";
286
+ readonly workflowRequiresTrigger: "Workflow requires --trigger";
287
+ readonly conventionRequiresDomain: "Convention requires --domain";
288
+ };
289
+ readonly status: {
290
+ readonly cannotStart: (status: string) => string;
291
+ readonly cannotComplete: (status: string) => string;
292
+ readonly cannotBlock: (status: string) => string;
293
+ readonly completeRequiresReview: "Task must be submitted for review first. Use: kspec task submit @ref";
294
+ readonly completeRequiresStart: "Task must be started and submitted first";
295
+ readonly completeBlockedTask: "Cannot complete blocked task";
296
+ readonly completeCancelledTask: "Cannot complete cancelled task. Use: kspec task reset @ref first";
297
+ readonly completeAlreadyCompleted: "Task is already completed";
298
+ readonly skipReviewRequiresReason: "--skip-review requires --reason to document why";
299
+ };
300
+ readonly conflict: {
301
+ readonly acAlreadyExists: (acId: string, itemRef: string) => string;
302
+ readonly acIdAlreadyExists: (acId: string) => string;
303
+ readonly observationAlreadyPromoted: (taskRef: string) => string;
304
+ readonly observationAlreadyResolved: (date: string, reason: string) => string;
305
+ readonly specDirExists: (dir: string) => string;
306
+ readonly moduleFileExists: (path: string) => string;
307
+ };
308
+ readonly operation: {
309
+ readonly cannotDeleteNoSource: "Cannot delete item: no source file tracked";
310
+ readonly cannotPromoteResolved: "Cannot promote resolved observation; use --force to override";
311
+ readonly tasksNoAcceptanceCriteria: (ref: string) => string;
312
+ readonly confirmRequired: (itemLabel: string) => string;
313
+ readonly cannotDeleteReferencedByTasks: (itemLabel: string, count: number, taskRefs: string) => string;
314
+ readonly cannotDeleteReferencedByObservations: (itemLabel: string, count: number, obsRefs: string) => string;
315
+ readonly deleteItemFailed: (itemLabel: string) => string;
316
+ };
317
+ readonly git: {
318
+ readonly notGitRepo: "Not a git repository";
319
+ readonly couldNotDetermineRoot: "Could not determine git root directory";
320
+ };
321
+ readonly project: {
322
+ readonly noKspecProject: "No kspec project found";
323
+ readonly shadowInitFailed: (error: string) => string;
324
+ readonly couldNotGetImplSummary: "Could not get implementation summary";
325
+ readonly runningFromShadow: "Cannot run kspec from inside .kspec/ directory";
326
+ readonly runningFromShadowHint: (projectRoot: string) => string;
327
+ };
328
+ readonly usage: {
329
+ readonly deriveNeedRefOrAll: "Either provide a spec reference or use --all";
330
+ readonly deriveCannotUseBoth: "Cannot use both a specific reference and --all";
331
+ readonly deriveUsageHelp: {
332
+ readonly header: "Usage:";
333
+ readonly examples: readonly [" kspec derive @spec-ref", " kspec derive @spec-ref --flat", " kspec derive --all"];
334
+ };
335
+ readonly patchNeedRef: "Reference required for single item patch. Use: kspec item patch <ref> --data <json>";
336
+ readonly logNeedRef: "Provide a reference or use --spec/--task";
337
+ readonly maxLoopsPositive: "--max-loops must be a positive integer";
338
+ readonly maxRetriesNonNegative: "--max-retries must be a non-negative integer";
339
+ readonly maxFailuresPositive: "--max-failures must be a positive integer";
340
+ readonly agentPromptCancelled: "Agent prompt was cancelled";
341
+ readonly deriveNoRef: "Either provide a spec reference or use --all";
342
+ readonly deriveRefAndAll: "Cannot use both a specific reference and --all";
343
+ };
344
+ readonly failures: {
345
+ readonly listItems: "Failed to list items";
346
+ readonly getItem: "Failed to get item";
347
+ readonly createItem: "Failed to create item";
348
+ readonly updateItem: "Failed to update item";
349
+ readonly deleteItem: "Failed to delete item";
350
+ readonly patchItems: "Failed to patch item(s)";
351
+ readonly getItemStatus: "Failed to get item status";
352
+ readonly getTypes: "Failed to get types";
353
+ readonly getTags: "Failed to get tags";
354
+ readonly listAc: "Failed to list acceptance criteria";
355
+ readonly addAc: "Failed to add acceptance criterion";
356
+ readonly updateAc: "Failed to update acceptance criterion";
357
+ readonly removeAc: "Failed to remove acceptance criterion";
358
+ readonly getTask: "Failed to get task";
359
+ readonly createTask: "Failed to create task";
360
+ readonly updateTask: "Failed to update task";
361
+ readonly patchTask: "Failed to patch task";
362
+ readonly startTask: "Failed to start task";
363
+ readonly completeTask: "Failed to complete task";
364
+ readonly blockTask: "Failed to block task";
365
+ readonly unblockTask: "Failed to unblock task";
366
+ readonly cancelTask: "Failed to cancel task";
367
+ readonly deleteTask: "Failed to delete task";
368
+ readonly addNote: "Failed to add note";
369
+ readonly getNotes: "Failed to get notes";
370
+ readonly getTodos: "Failed to get todos";
371
+ readonly addTodo: "Failed to add todo";
372
+ readonly markTodoDone: "Failed to mark todo as done";
373
+ readonly markTodoNotDone: "Failed to mark todo as not done";
374
+ readonly listTasks: "Failed to list tasks";
375
+ readonly getReadyTasks: "Failed to get ready tasks";
376
+ readonly getNextTask: "Failed to get next task";
377
+ readonly getBlockedTasks: "Failed to get blocked tasks";
378
+ readonly getActiveTasks: "Failed to get active tasks";
379
+ readonly showMeta: "Failed to show meta";
380
+ readonly listAgents: "Failed to list agents";
381
+ readonly listWorkflows: "Failed to list workflows";
382
+ readonly listConventions: "Failed to list conventions";
383
+ readonly getMetaItem: "Failed to get meta item";
384
+ readonly listMetaItems: "Failed to list meta items";
385
+ readonly createObservation: "Failed to create observation";
386
+ readonly listObservations: "Failed to list observations";
387
+ readonly promoteObservation: "Failed to promote observation";
388
+ readonly resolveObservation: "Failed to resolve observation";
389
+ readonly createMeta: (type: string) => string;
390
+ readonly updateMetaItem: "Failed to update meta item";
391
+ readonly deleteMetaItem: "Failed to delete meta item";
392
+ readonly addInboxItem: "Failed to add inbox item";
393
+ readonly listInboxItems: "Failed to list inbox items";
394
+ readonly promoteInboxItem: "Failed to promote inbox item";
395
+ readonly deleteInboxItem: "Failed to delete inbox item";
396
+ readonly getInboxItem: "Failed to get inbox item";
397
+ readonly gatherSessionContext: "Failed to gather session context";
398
+ readonly runCheckpoint: "Failed to run checkpoint";
399
+ readonly updateSessionContext: "Failed to update session context";
400
+ readonly search: "Failed to search";
401
+ readonly searchCommits: "Failed to search commits";
402
+ readonly initProject: "Failed to initialize project";
403
+ readonly installConfig: (agentType: string) => string;
404
+ readonly setupFailed: "Setup failed";
405
+ readonly deriveTasks: "Failed to derive tasks";
406
+ readonly ralphLoop: "Ralph loop failed";
407
+ readonly iterationFailed: (err: string) => string;
408
+ readonly iterationFailedAfterRetries: (iteration: number, maxRetries: number, consecutiveFailures: number, maxFailures: number) => string;
409
+ readonly lastError: (err: string) => string;
410
+ readonly reachedMaxFailures: (maxFailures: number) => string;
411
+ };
412
+ readonly todo: {
413
+ readonly notFound: (id: number) => string;
414
+ readonly invalidId: (id: string) => string;
415
+ };
416
+ readonly relationship: {
417
+ readonly invalidType: (type: string, validTypes: string) => string;
418
+ };
419
+ };
420
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/strings/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;iCAEN,MAAM;iCACN,MAAM;iCACN,MAAM;iCACN,MAAM;kCACL,MAAM;wCACA,MAAM;gCACd,MAAM;gCACN,MAAM,WAAW,MAAM;8BAIzB,MAAM;uCACG,MAAM;4BAGjB,MAAM;4BACN,MAAM;wCACM,MAAM;sCACR,MAAM;iCACX,MAAM;gCACP,MAAM;oCAGF,MAAM;wCACF,MAAM;oCAGV,MAAM;kCACR,MAAM;gCAGR,MAAM;CACjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,UAAU;mCACC,MAAM,gBAAgB,MAAM;8BAEjC,MAAM;sCACE,MAAM;CAEvB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;sCAGF,MAAM;yCACH,MAAM;qCACV,MAAM;;;;sCAML,MAAM;;wCAEJ,MAAM;uCACP,MAAM;wCACL,MAAM;mCACX,MAAM,WAAW,MAAM;qCAGrB,MAAM,EAAE;kDACK,MAAM;;4CAIZ,MAAM;iCACjB,MAAM,cAAc,MAAM,EAAE;iCAE5B,MAAM;;;;;;;;CAUlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;mCACD,MAAM;sCACH,MAAM;mCACT,MAAM;;;;;;;CAapB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;qCACD,MAAM,WAAW,MAAM;uCAErB,MAAM;mDACM,MAAM;gDAET,MAAM,UAAU,MAAM;kCAEpC,MAAM;sCACF,MAAM;CACvB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;8CAGO,MAAM;0CAEV,MAAM;wDAEQ,MAAM,SAAS,MAAM,YAAY,MAAM;+DAEhC,MAAM,SAAS,MAAM,WAAW,MAAM;2CAE1D,MAAM;CAC5B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;uCAEE,MAAM;;;kDAGK,MAAM;CAEnC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;CA4Bd,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAkDT,MAAM;;;;;;;;;;;;;;wCAwBE,MAAM;;;;oCAQV,MAAM;sDACY,MAAM,cAAc,MAAM,uBAAuB,MAAM,eAAe,MAAM;8BAEpG,MAAM;+CACW,MAAM;CAEhC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,UAAU;4BACN,MAAM;6BACL,MAAM;CACd,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB;iCACT,MAAM,cAAc,MAAM;CAEtC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,MAAM;;qCAjTG,MAAM;qCACN,MAAM;qCACN,MAAM;qCACN,MAAM;sCACL,MAAM;4CACA,MAAM;oCACd,MAAM;oCACN,MAAM,WAAW,MAAM;kCAIzB,MAAM;2CACG,MAAM;gCAGjB,MAAM;gCACN,MAAM;4CACM,MAAM;0CACR,MAAM;qCACX,MAAM;oCACP,MAAM;wCAGF,MAAM;4CACF,MAAM;wCAGV,MAAM;sCACR,MAAM;oCAGR,MAAM;;;uCAOH,MAAM,gBAAgB,MAAM;kCAEjC,MAAM;0CACE,MAAM;;;;0CAUN,MAAM;6CACH,MAAM;yCACV,MAAM;;;;0CAML,MAAM;;4CAEJ,MAAM;2CACP,MAAM;4CACL,MAAM;uCACX,MAAM,WAAW,MAAM;yCAGrB,MAAM,EAAE;sDACK,MAAM;;gDAIZ,MAAM;qCACjB,MAAM,cAAc,MAAM,EAAE;qCAE5B,MAAM;;;;;;;;;;uCAgBJ,MAAM;0CACH,MAAM;uCACT,MAAM;;;;;;;;;yCAmBJ,MAAM,WAAW,MAAM;2CAErB,MAAM;uDACM,MAAM;oDAET,MAAM,UAAU,MAAM;sCAEpC,MAAM;0CACF,MAAM;;;;;kDASE,MAAM;8CAEV,MAAM;4DAEQ,MAAM,SAAS,MAAM,YAAY,MAAM;mEAEhC,MAAM,SAAS,MAAM,WAAW,MAAM;+CAE1D,MAAM;;;;;;;;2CAgBV,MAAM;;;sDAGK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA0FxB,MAAM;;;;;;;;;;;;;;4CAwBE,MAAM;;;;wCAQV,MAAM;0DACY,MAAM,cAAc,MAAM,uBAAuB,MAAM,eAAe,MAAM;kCAEpG,MAAM;mDACW,MAAM;;;gCAQzB,MAAM;iCACL,MAAM;;;qCAOF,MAAM,cAAc,MAAM;;CAoBtC,CAAC"}