specrails-core 5.5.1 → 6.0.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 (276) hide show
  1. package/README.md +27 -145
  2. package/bin/specrails-core.mjs +12 -554
  3. package/dist/agent-runtime/capabilities.js +0 -1
  4. package/dist/agent-runtime/cli-executor.d.ts +1 -1
  5. package/dist/agent-runtime/cli-executor.js +4 -3
  6. package/dist/agent-runtime/cli-process.js +0 -1
  7. package/dist/agent-runtime/cli.d.ts +8 -0
  8. package/dist/agent-runtime/cli.js +31 -5
  9. package/dist/agent-runtime/codex-schema.js +0 -1
  10. package/dist/agent-runtime/compact/architect.d.ts +3 -272
  11. package/dist/agent-runtime/compact/architect.js +8 -9
  12. package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
  13. package/dist/agent-runtime/compact/chat-client.js +1 -2
  14. package/dist/agent-runtime/compact/developer.d.ts +3 -70
  15. package/dist/agent-runtime/compact/developer.js +13 -14
  16. package/dist/agent-runtime/compact/environment.d.ts +4 -5
  17. package/dist/agent-runtime/compact/environment.js +1 -2
  18. package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
  19. package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
  20. package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
  21. package/dist/agent-runtime/compact/guarded-loop.js +7 -8
  22. package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
  23. package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
  24. package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
  25. package/dist/agent-runtime/compact/reviewer.js +5 -6
  26. package/dist/agent-runtime/compact/step.d.ts +0 -1
  27. package/dist/agent-runtime/compact/step.js +1 -2
  28. package/dist/agent-runtime/compact/test-reachability.js +0 -1
  29. package/dist/agent-runtime/config.js +0 -1
  30. package/dist/agent-runtime/core-host.d.ts +1 -1
  31. package/dist/agent-runtime/core-host.js +5 -3
  32. package/dist/agent-runtime/durable-store.d.ts +0 -1
  33. package/dist/agent-runtime/durable-store.js +1 -2
  34. package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
  35. package/dist/agent-runtime/efficiency-summary.js +1 -2
  36. package/dist/agent-runtime/efficiency-types.js +0 -1
  37. package/dist/agent-runtime/efficiency.js +0 -1
  38. package/dist/agent-runtime/evaluation-corpus.js +0 -1
  39. package/dist/agent-runtime/evaluation.d.ts +2 -1
  40. package/dist/agent-runtime/evaluation.js +1 -2
  41. package/dist/agent-runtime/executor-types.d.ts +1 -1
  42. package/dist/agent-runtime/executor-types.js +0 -1
  43. package/dist/agent-runtime/executors.js +0 -1
  44. package/dist/agent-runtime/gemini-policy.js +0 -1
  45. package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
  46. package/dist/agent-runtime/graph/artifacts.js +11 -5
  47. package/dist/agent-runtime/graph/nodes.d.ts +1 -1
  48. package/dist/agent-runtime/graph/nodes.js +1 -2
  49. package/dist/agent-runtime/graph/review-policy.js +0 -1
  50. package/dist/agent-runtime/graph/roles.d.ts +2 -5
  51. package/dist/agent-runtime/graph/roles.js +2 -8
  52. package/dist/agent-runtime/graph/state.d.ts +1 -1
  53. package/dist/agent-runtime/graph/state.js +0 -1
  54. package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
  55. package/dist/agent-runtime/graph-checkpointer.js +0 -1
  56. package/dist/agent-runtime/guardrails.d.ts +3 -3
  57. package/dist/agent-runtime/guardrails.js +1 -2
  58. package/dist/agent-runtime/index.d.ts +2 -1
  59. package/dist/agent-runtime/index.js +2 -2
  60. package/dist/agent-runtime/kimi-acp.js +1 -2
  61. package/dist/agent-runtime/kimi-model.d.ts +6 -0
  62. package/dist/agent-runtime/kimi-model.js +12 -0
  63. package/dist/agent-runtime/openai-executor.d.ts +0 -9
  64. package/dist/agent-runtime/openai-executor.js +6 -7
  65. package/dist/agent-runtime/openspec-tool-server.js +1 -2
  66. package/dist/agent-runtime/openspec.d.ts +0 -2
  67. package/dist/agent-runtime/openspec.js +3 -7
  68. package/dist/agent-runtime/prompts.d.ts +4 -3
  69. package/dist/agent-runtime/prompts.js +0 -1
  70. package/dist/agent-runtime/provider-diagnostic.js +1 -2
  71. package/dist/agent-runtime/recovery.d.ts +46 -0
  72. package/dist/agent-runtime/recovery.js +169 -0
  73. package/dist/agent-runtime/repository-context.d.ts +1 -1
  74. package/dist/agent-runtime/repository-context.js +0 -1
  75. package/dist/agent-runtime/review-context.d.ts +1 -1
  76. package/dist/agent-runtime/review-context.js +0 -1
  77. package/dist/agent-runtime/role-routing.js +0 -1
  78. package/dist/agent-runtime/role-state.js +0 -1
  79. package/dist/agent-runtime/runtime-identity.js +1 -2
  80. package/dist/agent-runtime/tool-event.js +0 -1
  81. package/dist/agent-runtime/verification-plan.d.ts +5 -4
  82. package/dist/agent-runtime/verification-plan.js +1 -2
  83. package/dist/agent-runtime/workflow-types.js +0 -1
  84. package/dist/agent-runtime/workflow.js +0 -1
  85. package/dist/agent-runtime/workspace-tools.d.ts +2 -2
  86. package/dist/agent-runtime/workspace-tools.js +1 -2
  87. package/dist/installer/cli.d.ts +3 -32
  88. package/dist/installer/cli.js +26 -101
  89. package/dist/installer/commands/framework.d.ts +4 -3
  90. package/dist/installer/commands/framework.js +0 -1
  91. package/dist/installer/commands/init.d.ts +4 -25
  92. package/dist/installer/commands/init.js +5 -8
  93. package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
  94. package/dist/installer/phases/framework-lifecycle.js +2 -3
  95. package/dist/installer/phases/install-config.d.ts +7 -8
  96. package/dist/installer/phases/install-config.js +2 -7
  97. package/dist/installer/phases/manifest.d.ts +6 -7
  98. package/dist/installer/phases/manifest.js +2 -7
  99. package/dist/installer/phases/prereqs.d.ts +6 -7
  100. package/dist/installer/phases/prereqs.js +4 -6
  101. package/dist/installer/phases/provider-detect.d.ts +6 -7
  102. package/dist/installer/phases/provider-detect.js +2 -4
  103. package/dist/installer/phases/scaffold.d.ts +9 -10
  104. package/dist/installer/phases/scaffold.js +82 -805
  105. package/dist/installer/util/errors.js +0 -1
  106. package/dist/installer/util/exec.d.ts +3 -2
  107. package/dist/installer/util/exec.js +0 -1
  108. package/dist/installer/util/fs.d.ts +0 -10
  109. package/dist/installer/util/fs.js +1 -2
  110. package/dist/installer/util/git.js +0 -1
  111. package/dist/installer/util/install-transaction.d.ts +2 -2
  112. package/dist/installer/util/install-transaction.js +1 -2
  113. package/dist/installer/util/logger.d.ts +1 -3
  114. package/dist/installer/util/logger.js +0 -1
  115. package/dist/installer/util/paths.js +0 -1
  116. package/dist/installer/util/registry.d.ts +4 -8
  117. package/dist/installer/util/registry.js +2 -3
  118. package/dist/{installer/runtime → pipeline}/pipeline-state.js +0 -3
  119. package/dist/shared/args.d.ts +18 -0
  120. package/dist/shared/args.js +53 -0
  121. package/integration-contract.json +10 -46
  122. package/package.json +3 -10
  123. package/templates/agents/sr-architect.md +15 -310
  124. package/templates/agents/sr-developer.md +15 -269
  125. package/templates/agents/sr-reviewer.md +13 -367
  126. package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
  127. package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
  128. package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
  129. package/templates/kimi/specrails/run-skill.mjs +91 -2173
  130. package/bin/tui-installer.mjs +0 -430
  131. package/commands/doctor.md +0 -62
  132. package/dist/agent-runtime/capabilities.js.map +0 -1
  133. package/dist/agent-runtime/cli-executor.js.map +0 -1
  134. package/dist/agent-runtime/cli-process.js.map +0 -1
  135. package/dist/agent-runtime/cli.js.map +0 -1
  136. package/dist/agent-runtime/codex-schema.js.map +0 -1
  137. package/dist/agent-runtime/compact/architect.js.map +0 -1
  138. package/dist/agent-runtime/compact/chat-client.js.map +0 -1
  139. package/dist/agent-runtime/compact/developer.js.map +0 -1
  140. package/dist/agent-runtime/compact/environment.js.map +0 -1
  141. package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
  142. package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
  143. package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
  144. package/dist/agent-runtime/compact/reviewer.js.map +0 -1
  145. package/dist/agent-runtime/compact/step.js.map +0 -1
  146. package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
  147. package/dist/agent-runtime/config.js.map +0 -1
  148. package/dist/agent-runtime/core-host.js.map +0 -1
  149. package/dist/agent-runtime/durable-store.js.map +0 -1
  150. package/dist/agent-runtime/efficiency-summary.js.map +0 -1
  151. package/dist/agent-runtime/efficiency-types.js.map +0 -1
  152. package/dist/agent-runtime/efficiency.js.map +0 -1
  153. package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
  154. package/dist/agent-runtime/evaluation.js.map +0 -1
  155. package/dist/agent-runtime/executor-types.js.map +0 -1
  156. package/dist/agent-runtime/executors.js.map +0 -1
  157. package/dist/agent-runtime/gemini-policy.js.map +0 -1
  158. package/dist/agent-runtime/graph/artifacts.js.map +0 -1
  159. package/dist/agent-runtime/graph/nodes.js.map +0 -1
  160. package/dist/agent-runtime/graph/review-policy.js.map +0 -1
  161. package/dist/agent-runtime/graph/roles.js.map +0 -1
  162. package/dist/agent-runtime/graph/state.js.map +0 -1
  163. package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
  164. package/dist/agent-runtime/guardrails.js.map +0 -1
  165. package/dist/agent-runtime/index.js.map +0 -1
  166. package/dist/agent-runtime/kimi-acp.js.map +0 -1
  167. package/dist/agent-runtime/openai-executor.js.map +0 -1
  168. package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
  169. package/dist/agent-runtime/openspec.js.map +0 -1
  170. package/dist/agent-runtime/prompts.js.map +0 -1
  171. package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
  172. package/dist/agent-runtime/repository-context.js.map +0 -1
  173. package/dist/agent-runtime/review-context.js.map +0 -1
  174. package/dist/agent-runtime/role-routing.js.map +0 -1
  175. package/dist/agent-runtime/role-state.js.map +0 -1
  176. package/dist/agent-runtime/runtime-identity.js.map +0 -1
  177. package/dist/agent-runtime/tool-event.js.map +0 -1
  178. package/dist/agent-runtime/verification-plan.js.map +0 -1
  179. package/dist/agent-runtime/workflow-types.js.map +0 -1
  180. package/dist/agent-runtime/workflow.js.map +0 -1
  181. package/dist/agent-runtime/workspace-tools.js.map +0 -1
  182. package/dist/installer/cli.js.map +0 -1
  183. package/dist/installer/commands/doctor.d.ts +0 -27
  184. package/dist/installer/commands/doctor.js +0 -615
  185. package/dist/installer/commands/doctor.js.map +0 -1
  186. package/dist/installer/commands/framework.js.map +0 -1
  187. package/dist/installer/commands/init.js.map +0 -1
  188. package/dist/installer/commands/update.d.ts +0 -56
  189. package/dist/installer/commands/update.js +0 -257
  190. package/dist/installer/commands/update.js.map +0 -1
  191. package/dist/installer/commands/v5-migration.d.ts +0 -32
  192. package/dist/installer/commands/v5-migration.js +0 -133
  193. package/dist/installer/commands/v5-migration.js.map +0 -1
  194. package/dist/installer/phases/framework-lifecycle.js.map +0 -1
  195. package/dist/installer/phases/install-config.js.map +0 -1
  196. package/dist/installer/phases/manifest.js.map +0 -1
  197. package/dist/installer/phases/prereqs.js.map +0 -1
  198. package/dist/installer/phases/provider-detect.js.map +0 -1
  199. package/dist/installer/phases/scaffold.js.map +0 -1
  200. package/dist/installer/runtime/kimi.d.ts +0 -84
  201. package/dist/installer/runtime/kimi.js +0 -255
  202. package/dist/installer/runtime/kimi.js.map +0 -1
  203. package/dist/installer/runtime/pipeline-state.js.map +0 -1
  204. package/dist/installer/util/errors.js.map +0 -1
  205. package/dist/installer/util/exec.js.map +0 -1
  206. package/dist/installer/util/fs.js.map +0 -1
  207. package/dist/installer/util/git.js.map +0 -1
  208. package/dist/installer/util/install-transaction.js.map +0 -1
  209. package/dist/installer/util/logger.js.map +0 -1
  210. package/dist/installer/util/paths.js.map +0 -1
  211. package/dist/installer/util/prompts.d.ts +0 -23
  212. package/dist/installer/util/prompts.js +0 -49
  213. package/dist/installer/util/prompts.js.map +0 -1
  214. package/dist/installer/util/registry.js.map +0 -1
  215. package/dist/installer/util/template.d.ts +0 -23
  216. package/dist/installer/util/template.js +0 -60
  217. package/dist/installer/util/template.js.map +0 -1
  218. package/docs/README.md +0 -40
  219. package/docs/agent-runtime-efficiency.md +0 -65
  220. package/docs/agent-runtime.md +0 -347
  221. package/docs/agents.md +0 -315
  222. package/docs/changelog.md +0 -168
  223. package/docs/ci-cd.md +0 -60
  224. package/docs/concepts.md +0 -183
  225. package/docs/customization.md +0 -363
  226. package/docs/deployment.md +0 -234
  227. package/docs/getting-started.md +0 -122
  228. package/docs/installation.md +0 -395
  229. package/docs/local-tickets.md +0 -191
  230. package/docs/migration-guide.md +0 -140
  231. package/docs/playbook-oss-maintainer.md +0 -112
  232. package/docs/playbook-parallel-dev.md +0 -124
  233. package/docs/playbook-product-discovery.md +0 -115
  234. package/docs/plugin-architecture.md +0 -144
  235. package/docs/research/codex-compatibility-analysis.md +0 -365
  236. package/docs/research/mcp-feasibility-analysis.md +0 -382
  237. package/docs/testing/test-matrix-codex.md +0 -130
  238. package/docs/updating.md +0 -89
  239. package/docs/user-docs/cli-reference.md +0 -428
  240. package/docs/user-docs/codex-vs-claude-code.md +0 -23
  241. package/docs/user-docs/core-updates.md +0 -70
  242. package/docs/user-docs/faq.md +0 -146
  243. package/docs/user-docs/getting-started-codex.md +0 -194
  244. package/docs/user-docs/getting-started-kimi.md +0 -423
  245. package/docs/user-docs/installation.md +0 -237
  246. package/docs/user-docs/provider-pipelines.md +0 -96
  247. package/docs/user-docs/quick-start.md +0 -161
  248. package/docs/windows.md +0 -78
  249. package/docs/workflows.md +0 -463
  250. package/schemas/profile.v1.json +0 -207
  251. package/templates/claude-md/CLAUDE-quickstart.md +0 -54
  252. package/templates/claude-md/root.md +0 -50
  253. package/templates/codex-skills/batch-implement/SKILL.md +0 -38
  254. package/templates/codex-skills/implement/SKILL.md +0 -38
  255. package/templates/codex-skills/retry/SKILL.md +0 -16
  256. package/templates/commands/specrails/compat-check.md +0 -271
  257. package/templates/commands/specrails/doctor.md +0 -62
  258. package/templates/commands/specrails/explore-spec.md +0 -173
  259. package/templates/commands/specrails/health-check.md +0 -527
  260. package/templates/commands/specrails/memory-inspect.md +0 -261
  261. package/templates/commands/specrails/opsx-diff.md +0 -419
  262. package/templates/commands/specrails/propose-spec.md +0 -102
  263. package/templates/commands/specrails/refactor-recommender.md +0 -169
  264. package/templates/commands/specrails/telemetry.md +0 -552
  265. package/templates/commands/specrails/why.md +0 -96
  266. package/templates/gemini-commands/batch-implement.toml +0 -37
  267. package/templates/gemini-commands/implement.toml +0 -37
  268. package/templates/gemini-commands/retry.toml +0 -15
  269. package/templates/profiles/default.json +0 -14
  270. package/templates/profiles/kimi-default.json +0 -15
  271. package/templates/rules/layer.md +0 -8
  272. package/templates/runtime/provider-pipeline.md +0 -113
  273. package/templates/security/security-exemptions.yaml +0 -20
  274. package/templates/settings/confidence-config.json +0 -17
  275. package/templates/settings/settings.json +0 -15
  276. /package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +0 -0
@@ -76,4 +76,3 @@ export class PromptAbortError extends InstallerError {
76
76
  export function isInstallerError(err) {
77
77
  return err instanceof InstallerError;
78
78
  }
79
- //# sourceMappingURL=errors.js.map
@@ -1,4 +1,4 @@
1
- export interface RunOptions {
1
+ interface RunOptions {
2
2
  /** Working directory for the child. Defaults to `process.cwd()`. */
3
3
  cwd?: string;
4
4
  /** Environment variables, merged on top of `process.env`. */
@@ -8,7 +8,7 @@ export interface RunOptions {
8
8
  /** Hard timeout in milliseconds. Child is SIGKILL'd on timeout. Defaults to none. */
9
9
  timeoutMs?: number;
10
10
  }
11
- export interface RunResult {
11
+ interface RunResult {
12
12
  code: number;
13
13
  stdout: string;
14
14
  stderr: string;
@@ -39,3 +39,4 @@ export declare function tryRunCommand(cmd: string, args: string[], opts?: RunOpt
39
39
  * on Windows and `which` on POSIX.
40
40
  */
41
41
  export declare function commandExists(cmd: string): Promise<boolean>;
42
+ export {};
@@ -153,4 +153,3 @@ function quoteArgForShell(arg) {
153
153
  return arg;
154
154
  return `"${arg.replace(/"/g, '\\"')}"`;
155
155
  }
156
- //# sourceMappingURL=exec.js.map
@@ -141,13 +141,3 @@ export declare function snapshotTree(src: string, dest: string): LinkRecord[];
141
141
  export declare function restoreTree(saved: string, target: string, links: LinkRecord[], options?: {
142
142
  skip?: (rel: string) => boolean;
143
143
  }): void;
144
- /**
145
- * Recreate a recorded link at `linkPath`. Delegates to {@link symlinkOrCopy} so
146
- * Windows gets a junction (no privilege required) and an unprivileged machine
147
- * with no link mechanism at all still ends up with the right CONTENTS.
148
- *
149
- * A target that no longer exists cannot be copied, so the pointer is recreated
150
- * verbatim where the platform allows a dangling link rather than failing the
151
- * whole rollback.
152
- */
153
- export declare function restoreLink(target: string, linkPath: string): void;
@@ -427,7 +427,7 @@ export function restoreTree(saved, target, links, options = {}) {
427
427
  * verbatim where the platform allows a dangling link rather than failing the
428
428
  * whole rollback.
429
429
  */
430
- export function restoreLink(target, linkPath) {
430
+ function restoreLink(target, linkPath) {
431
431
  if (pathExists(target)) {
432
432
  symlinkOrCopy(target, linkPath);
433
433
  return;
@@ -450,4 +450,3 @@ function listNames(dir) {
450
450
  throw new FilesystemError(`failed to read directory: ${err.message}`, dir);
451
451
  }
452
452
  }
453
- //# sourceMappingURL=fs.js.map
@@ -110,4 +110,3 @@ export async function gitInstalled() {
110
110
  return false;
111
111
  }
112
112
  }
113
- //# sourceMappingURL=git.js.map
@@ -10,7 +10,7 @@ export declare function withFrameworkLifecycleLock<T>(frameworkDir: string, appl
10
10
  * one exactly as it stands — copying it bought no safety and cost a full copy of
11
11
  * the framework store on every install.
12
12
  */
13
- export type ProtectedSurface = string | {
13
+ type ProtectedSurface = string | {
14
14
  path: string;
15
15
  snapshotContents: boolean;
16
16
  };
@@ -23,7 +23,7 @@ export type ProtectedSurface = string | {
23
23
  * without SeCreateSymbolicLinkPrivilege.
24
24
  */
25
25
  export declare function withInstallRollback<T>(paths: ProtectedSurface[], apply: () => Promise<T>): Promise<T>;
26
- export declare function compareCoreVersions(left: string, right: string): number | null;
27
26
  /** Refuse an implicit downgrade. Explicit swap-current is the rollback interface. */
28
27
  export declare function assertNoCoreDowngrade(current: string | null, target: string): void;
29
28
  export declare function currentFrameworkVersion(frameworkDir: string): string | null;
29
+ export {};
@@ -207,7 +207,7 @@ export async function withInstallRollback(paths, apply) {
207
207
  rmSync(backup, { recursive: true, force: true });
208
208
  }
209
209
  }
210
- export function compareCoreVersions(left, right) {
210
+ function compareCoreVersions(left, right) {
211
211
  const parse = (value) => {
212
212
  const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(value);
213
213
  return match ? { core: match.slice(1, 4).map(Number), pre: match[4]?.split('.') ?? [] } : null;
@@ -263,4 +263,3 @@ export function currentFrameworkVersion(frameworkDir) {
263
263
  return null;
264
264
  }
265
265
  }
266
- //# sourceMappingURL=install-transaction.js.map
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Coloured output helpers for the installer. The emoji prefixes match
3
- * what the retired bash scripts printed (`✓ ⚠ ✗ →`) so existing user
4
- * bug reports and screenshots still read the same.
2
+ * Coloured output helpers for the installer (`✓ ⚠ ✗ →` prefixes).
5
3
  *
6
4
  * The logger writes to stdout by default; callers may override via
7
5
  * {@link setLoggerStreams} (useful in tests that capture output).
@@ -52,4 +52,3 @@ export function rawOut(text) {
52
52
  export function rawErr(text) {
53
53
  streams.err.write(text);
54
54
  }
55
- //# sourceMappingURL=logger.js.map
@@ -75,4 +75,3 @@ export function repoRelative(repoRoot, absPath) {
75
75
  }
76
76
  return rel.replace(/\\/g, '/');
77
77
  }
78
- //# sourceMappingURL=paths.js.map
@@ -60,7 +60,7 @@ export interface ProjectEntry {
60
60
  desktopProjectId?: string;
61
61
  }
62
62
  /** On-disk shape of `registry.json`. */
63
- export interface RegistryFile {
63
+ interface RegistryFile {
64
64
  schemaVersion: number;
65
65
  generator?: string;
66
66
  updatedAt?: string;
@@ -68,7 +68,7 @@ export interface RegistryFile {
68
68
  projects: Record<string, ProjectEntry>;
69
69
  }
70
70
  /** The flattened result both tools consume. */
71
- export interface Resolution {
71
+ interface Resolution {
72
72
  /** Normalized map key. */
73
73
  key: string;
74
74
  repoPath: string;
@@ -88,7 +88,7 @@ export interface Resolution {
88
88
  /** True when there is no registry entry and we fell back to the in-repo layout. */
89
89
  isLegacy: boolean;
90
90
  }
91
- export interface ResolveOptions {
91
+ interface ResolveOptions {
92
92
  /** When true, allocate + persist an entry if none exists. Readers pass false. */
93
93
  allocate?: boolean;
94
94
  /** Who is allocating (only consulted when allocate=true). Default 'core-standalone'. */
@@ -107,8 +107,6 @@ export interface ResolveOptions {
107
107
  * (`server/desktop-router.ts`). Do not "improve" it; parity is the contract.
108
108
  */
109
109
  export declare function slugify(name: string): string;
110
- /** `$HOME` for the registry, overridable for tests. */
111
- export declare function resolveHome(home?: string): string;
112
110
  /** Absolute path to `registry.json`. */
113
111
  export declare function registryPath(home?: string): string;
114
112
  /**
@@ -122,9 +120,6 @@ export declare function registryPath(home?: string): string;
122
120
  export declare function frameworkRoot(home?: string): string;
123
121
  /** Absolute path to the advisory lock file. */
124
122
  export declare function lockPath(home?: string): string;
125
- /** `fs.realpathSync` that falls back to the resolved-but-unreal path on error
126
- * (the path may not exist yet, or be on a volume that rejects realpath). */
127
- export declare function realpathSafe(abs: string): string;
128
123
  /** Case-fold the key on case-insensitive platforms (macOS, Windows) so two
129
124
  * spellings of the same path map to one entry. The stored `repoPath` keeps
130
125
  * its canonical case; only the index key is folded. */
@@ -172,3 +167,4 @@ export declare function resolveArtifacts(repoPathInput: string, opts?: ResolveOp
172
167
  * Desktop-owned entries remain the host's responsibility; never claim ownership.
173
168
  */
174
169
  export declare function recordSuccessfulInstall(repoPath: string, opts: Pick<ResolveOptions, 'home' | 'providers' | 'coreVersion' | 'now'>): void;
170
+ export {};
@@ -191,7 +191,7 @@ export function slugify(name) {
191
191
  return name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
192
192
  }
193
193
  /** `$HOME` for the registry, overridable for tests. */
194
- export function resolveHome(home) {
194
+ function resolveHome(home) {
195
195
  return home ?? process.env.SPECRAILS_REGISTRY_HOME ?? os.homedir();
196
196
  }
197
197
  /** Absolute path to `registry.json`. */
@@ -215,7 +215,7 @@ export function lockPath(home) {
215
215
  }
216
216
  /** `fs.realpathSync` that falls back to the resolved-but-unreal path on error
217
217
  * (the path may not exist yet, or be on a volume that rejects realpath). */
218
- export function realpathSafe(abs) {
218
+ function realpathSafe(abs) {
219
219
  try {
220
220
  return realpathSync(abs);
221
221
  }
@@ -576,4 +576,3 @@ export function recordSuccessfulInstall(repoPath, opts) {
576
576
  atomicWrite(registryPath(opts.home), JSON.stringify(registry, null, 2) + '\n');
577
577
  });
578
578
  }
579
- //# sourceMappingURL=registry.js.map
@@ -223,8 +223,6 @@ function excluded(state, repo, relative) {
223
223
  const absolute = path.join(repo.path, relative);
224
224
  if (within(pipelineStateDirectory(state.context), absolute))
225
225
  return true;
226
- if (['.specrails/kimi-role-wave.json', '.specrails/kimi-role-request.json', '.specrails/kimi-role-merge.json', '.specrails/kimi-role-worktrees/' + state.runId + '.json'].includes(relative))
227
- return true;
228
226
  if (relative === '.specrails/runtime' || relative.startsWith('.specrails/runtime/'))
229
227
  return true;
230
228
  if (repo.id !== state.context.artifactRepositoryId)
@@ -1478,4 +1476,3 @@ export function readVerificationEvidence(context, query = {}) {
1478
1476
  const next = offset + text.length;
1479
1477
  return { schemaVersion: 1, available: true, text, byteCount: bytes, totalBytes: Buffer.byteLength(content), truncated: next < content.length || document.outputTruncated, ...(next < content.length ? { nextCursor: cursor(next) } : {}) };
1480
1478
  }
1481
- //# sourceMappingURL=pipeline-state.js.map
@@ -0,0 +1,18 @@
1
+ /** Parsed command line shared by the installer and runtime CLIs. */
2
+ interface ParsedArgs {
3
+ subcommand: string | null;
4
+ flags: Record<string, string | boolean>;
5
+ positionals: string[];
6
+ }
7
+ /**
8
+ * Minimal arg parser, no external dep. Handles:
9
+ * subcommand (first bare positional)
10
+ * --flag (boolean true)
11
+ * --flag=value (string)
12
+ * --flag value (string, consumes next token)
13
+ * -h / --help (help alias)
14
+ * -v / --version (version alias)
15
+ * positionals (everything else)
16
+ */
17
+ export declare function parseArgs(argv: string[]): ParsedArgs;
18
+ export {};
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Minimal arg parser, no external dep. Handles:
3
+ * subcommand (first bare positional)
4
+ * --flag (boolean true)
5
+ * --flag=value (string)
6
+ * --flag value (string, consumes next token)
7
+ * -h / --help (help alias)
8
+ * -v / --version (version alias)
9
+ * positionals (everything else)
10
+ */
11
+ export function parseArgs(argv) {
12
+ const flags = {};
13
+ const positionals = [];
14
+ let subcommand = null;
15
+ for (let i = 0; i < argv.length; i++) {
16
+ const token = argv[i];
17
+ if (token.startsWith('--')) {
18
+ const rest = token.slice(2);
19
+ const eq = rest.indexOf('=');
20
+ if (eq >= 0) {
21
+ flags[rest.slice(0, eq)] = rest.slice(eq + 1);
22
+ }
23
+ else {
24
+ const peek = argv[i + 1];
25
+ if (peek !== undefined && !peek.startsWith('-')) {
26
+ flags[rest] = peek;
27
+ i++;
28
+ }
29
+ else {
30
+ flags[rest] = true;
31
+ }
32
+ }
33
+ }
34
+ else if (token === '-h') {
35
+ flags.help = true;
36
+ }
37
+ else if (token === '-v') {
38
+ flags.version = true;
39
+ }
40
+ else if (token.startsWith('-') && token.length > 1) {
41
+ flags[token.slice(1)] = true;
42
+ }
43
+ else {
44
+ if (subcommand === null) {
45
+ subcommand = token;
46
+ }
47
+ else {
48
+ positionals.push(token);
49
+ }
50
+ }
51
+ }
52
+ return { subcommand, flags, positionals };
53
+ }
@@ -1,19 +1,13 @@
1
1
  {
2
- "schemaVersion": "4.0",
2
+ "schemaVersion": "5.0",
3
3
  "providers": {
4
4
  "claude": {
5
- "updateCommand": "update",
6
5
  "cli": {
7
6
  "initArgs": [
8
7
  "init",
9
8
  "--yes",
10
9
  "--provider",
11
10
  "claude"
12
- ],
13
- "updateArgs": [
14
- "update",
15
- "--provider",
16
- "claude"
17
11
  ]
18
12
  },
19
13
  "initCommand": "init",
@@ -24,18 +18,12 @@
24
18
  }
25
19
  },
26
20
  "codex": {
27
- "updateCommand": "update",
28
21
  "cli": {
29
22
  "initArgs": [
30
23
  "init",
31
24
  "--yes",
32
25
  "--provider",
33
26
  "codex"
34
- ],
35
- "updateArgs": [
36
- "update",
37
- "--provider",
38
- "codex"
39
27
  ]
40
28
  },
41
29
  "initCommand": "init",
@@ -46,18 +34,12 @@
46
34
  }
47
35
  },
48
36
  "gemini": {
49
- "updateCommand": "update",
50
37
  "cli": {
51
38
  "initArgs": [
52
39
  "init",
53
40
  "--yes",
54
41
  "--provider",
55
42
  "gemini"
56
- ],
57
- "updateArgs": [
58
- "update",
59
- "--provider",
60
- "gemini"
61
43
  ]
62
44
  },
63
45
  "initCommand": "init",
@@ -68,7 +50,6 @@
68
50
  }
69
51
  },
70
52
  "kimi": {
71
- "updateCommand": "update",
72
53
  "cli": {
73
54
  "binary": "node",
74
55
  "providerBinary": "kimi",
@@ -77,19 +58,6 @@
77
58
  "nestedSkillInvocation": "Kimi built-in Skill tool with { skill, args }; never literal /skill text",
78
59
  "modelIdPattern": "^[A-Za-z0-9][A-Za-z0-9._/:-]{0,127}$",
79
60
  "sessionIdPattern": "^(?!\\.{1,2}$)[A-Za-z0-9._-]{1,128}$",
80
- "roleWave": {
81
- "path": ".specrails/kimi-role-wave.json",
82
- "schema": "{ run: safe-id, roles: Array<{ key: safe-id, skill: direct-child-id, model: safe-model-id, profile: \"inherit\" | safe-id, args: string, workspace: \"current\" | \"worktree:<safe-id>\" }> } with no extra keys",
83
- "maxBytes": 1048576,
84
- "maxRoles": 32,
85
- "transport": "structured WriteFile followed by one static foreground --role-wave-file command; the one-shot file is deleted before setup and every role is awaited. Inspection, merge, and cleanup use the separate static --role-wave-status, --role-merge-file, and --role-wave-cleanup modes",
86
- "workspaces": "current roles receive unique execution directories with SPECRAILS_REPO_DIR set to the target repository; isolated roles create/reuse detached git worktrees from a synthetic baseline that includes the starting tracked/untracked overlay but excludes provider/runtime control files, with SPECRAILS_REPO_DIR set to that worktree",
87
- "manifest": ".specrails/kimi-role-worktrees/<run>.json records the immutable synthetic base commit, source head, worktree ids, and role key to execution/repository paths",
88
- "status": "--role-wave-status <run> validates the persisted manifest/ref/worktrees and emits one specrails.merge.inventory frame before any downstream merge",
89
- "merge": ".specrails/kimi-role-merge.json is the only accepted merge request path; { run, actions: Array<{ worktree: safe-id, path: safe-relative-path, operation: \"copy\" | \"delete\" }> } applies an explicit A/M/D inventory through --role-merge-file without attributing the starting overlay or provider control files",
90
- "cleanup": "--role-wave-cleanup <run> removes owned worktrees, temporary execution roots, persisted manifest, and synthetic baseline ref, then emits specrails.role.cleanup",
91
- "output": "newline-delimited attributed specrails.role.workspace, specrails.role.event/output, specrails.role.completed, specrails.merge.inventory, specrails.merge.applied, and specrails.role.cleanup frames; aggregate role-wave exit is nonzero when any role fails"
92
- },
93
61
  "stableEngineEnv": {
94
62
  "KIMI_CODE_EXPERIMENTAL_FLAG": null,
95
63
  "KIMI_DISABLE_CRON": "1",
@@ -98,7 +66,7 @@
98
66
  },
99
67
  "windowsPromptTransport": "For the standard npm kimi.cmd/bat shim, prompt bytes travel over stdin to a fixed Node bootstrap which restores process.argv before importing Kimi; native executables fail above a 30000 UTF-16 command-line budget.",
100
68
  "initialActivationTelemetry": "Visible prompt parity only; the external materializer cannot emit Kimi-private skill.activated/origin telemetry.",
101
- "cancellation": "Single-skill mode forwards SIGINT/SIGTERM/SIGHUP to its direct Kimi child. Role-wave mode forwards each termination signal to every live Kimi child and waits for aggregate completion; the embedding host remains responsible for platform process-tree teardown.",
69
+ "cancellation": "The runner forwards SIGINT/SIGTERM/SIGHUP to its direct Kimi child; the embedding host remains responsible for platform process-tree teardown.",
102
70
  "initArgs": [
103
71
  "init",
104
72
  "--yes",
@@ -108,12 +76,7 @@
108
76
  "resumeArgs": [
109
77
  "--session=<session-id>"
110
78
  ],
111
- "notes": "CLI-only provider execution. Installation/update uses the deterministic Core CLI above. Headless workflows use the managed Node skill runner, never literal /skill text in kimi -p. Role waves await every child and preserve frozen Core execution context. Authenticate once with kimi login.",
112
- "updateArgs": [
113
- "update",
114
- "--provider",
115
- "kimi"
116
- ],
79
+ "notes": "CLI-only provider execution. Installation uses the deterministic Core CLI above. Headless workflows use the managed Node skill runner, never literal /skill text in kimi -p. Authenticate once with kimi login.",
117
80
  "workflowArgs": [
118
81
  ".kimi-code/specrails/run-skill.mjs",
119
82
  "--skill",
@@ -186,8 +149,7 @@
186
149
  "model": "sonnet"
187
150
  },
188
151
  "overrides": {
189
- "sr-architect": "opus",
190
- "sr-product-manager": "opus"
152
+ "sr-architect": "opus"
191
153
  }
192
154
  }
193
155
  },
@@ -227,22 +189,24 @@
227
189
  "max"
228
190
  ]
229
191
  },
230
- "note": "Install config and profiles retain exact ids or safe custom aliases. Preset names do not imply Claude aliases for Kimi. Process launch prefixes only the three documented official short ids with kimi-code/; every custom alias that matches the published model grammar passes through unchanged."
192
+ "note": "Install config retains exact ids or safe custom aliases. Preset names do not imply Claude aliases for Kimi. Process launch prefixes only the three documented official short ids with kimi-code/; every custom alias that matches the published model grammar passes through unchanged."
231
193
  }
232
194
  },
233
195
  "legacyCompat": {
234
196
  "setupCommandAlias": false,
235
197
  "enrichCommand": false,
236
- "note": "Core 5 installs directly. Legacy config tier is tolerated; enrich, --quick and --lite are removed. Hosts must negotiate schema 4 deterministic lifecycle."
198
+ "note": "Core installs directly and is driven by Desktop through init and the offline framework lifecycle (install-framework, swap-current, assemble). enrich, update, doctor, profile, --quick and --lite are removed."
237
199
  },
238
200
  "lifecycle": {
239
201
  "mode": "deterministic",
240
202
  "requiresEnrich": false,
241
203
  "initCommand": "init",
242
- "updateCommand": "update",
243
204
  "minimumCoreMajor": 5,
244
205
  "removedCommands": [
245
- "enrich"
206
+ "enrich",
207
+ "update",
208
+ "doctor",
209
+ "profile"
246
210
  ],
247
211
  "removedFlags": [
248
212
  "--quick",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "5.5.1",
4
- "description": "Provider-independent AI agent workflow system for Claude Code, Codex, Gemini CLI, and Kimi Code",
3
+ "version": "6.0.0",
4
+ "description": "Agent workflow engine for specrails-desktop: provider-independent installer and programmatic agent runtime for Claude Code, Codex, Gemini CLI and Kimi Code",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./agent-runtime": {
@@ -20,8 +20,6 @@
20
20
  "bin/",
21
21
  "dist/",
22
22
  "templates/",
23
- "commands/",
24
- "docs/",
25
23
  "schemas/",
26
24
  "integration-contract.json",
27
25
  "pinned-versions.json"
@@ -47,12 +45,8 @@
47
45
  "llm",
48
46
  "ai",
49
47
  "automation",
50
- "productivity",
51
48
  "specrails",
52
49
  "openspec",
53
- "code-generation",
54
- "product-management",
55
- "vibe-coding",
56
50
  "agents",
57
51
  "multi-agent",
58
52
  "software-engineering",
@@ -78,12 +72,10 @@
78
72
  },
79
73
  "dependencies": {
80
74
  "@fission-ai/openspec": "1.4.1",
81
- "@inquirer/prompts": "^7.0.0",
82
75
  "@langchain/core": "1.2.10",
83
76
  "@langchain/langgraph": "1.4.14",
84
77
  "@langchain/langgraph-checkpoint": "1.1.5",
85
78
  "@modelcontextprotocol/sdk": "1.29.0",
86
- "ajv": "^8.18.0",
87
79
  "cross-spawn": "7.0.6",
88
80
  "js-yaml": "^4.1.0",
89
81
  "picocolors": "^1.1.1",
@@ -94,6 +86,7 @@
94
86
  "@types/js-yaml": "^4.0.9",
95
87
  "@types/node": "^22.10.2",
96
88
  "@vitest/coverage-v8": "^4.1.5",
89
+ "ajv": "^8.20.0",
97
90
  "typescript": "^5.7.2",
98
91
  "vitest": "^4.1.5"
99
92
  },