ai-spec-dev 0.42.0 → 0.55.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 (70) hide show
  1. package/README.md +86 -40
  2. package/cli/commands/config.ts +129 -1
  3. package/cli/commands/create.ts +246 -11
  4. package/cli/commands/fix-history.ts +176 -0
  5. package/cli/commands/init.ts +344 -106
  6. package/cli/index.ts +3 -7
  7. package/cli/pipeline/helpers.ts +6 -0
  8. package/cli/pipeline/multi-repo.ts +291 -26
  9. package/cli/pipeline/single-repo.ts +103 -2
  10. package/cli/utils.ts +95 -4
  11. package/core/code-generator.ts +63 -14
  12. package/core/config-defaults.ts +44 -0
  13. package/core/constitution-generator.ts +2 -1
  14. package/core/cross-stack-verifier.ts +395 -0
  15. package/core/dsl-extractor.ts +2 -1
  16. package/core/error-feedback.ts +3 -2
  17. package/core/fix-history.ts +333 -0
  18. package/core/import-fixer.ts +827 -0
  19. package/core/import-verifier.ts +569 -0
  20. package/core/knowledge-memory.ts +55 -6
  21. package/core/openapi-exporter.ts +3 -2
  22. package/core/repo-store.ts +95 -0
  23. package/core/reviewer.ts +14 -13
  24. package/core/run-logger.ts +3 -4
  25. package/core/run-snapshot.ts +2 -3
  26. package/core/run-trend.ts +3 -4
  27. package/core/self-evaluator.ts +44 -7
  28. package/core/spec-generator.ts +30 -45
  29. package/core/token-budget.ts +3 -8
  30. package/core/types-generator.ts +2 -2
  31. package/core/vcr.ts +3 -1
  32. package/dist/cli/index.js +3889 -1937
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/index.mjs +3888 -1936
  35. package/dist/cli/index.mjs.map +1 -1
  36. package/dist/index.d.mts +17 -2
  37. package/dist/index.d.ts +17 -2
  38. package/dist/index.js +292 -181
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs +292 -181
  41. package/dist/index.mjs.map +1 -1
  42. package/package.json +2 -2
  43. package/tests/cross-stack-verifier.test.ts +301 -0
  44. package/tests/fix-history.test.ts +335 -0
  45. package/tests/import-fixer.test.ts +944 -0
  46. package/tests/import-verifier.test.ts +420 -0
  47. package/tests/knowledge-memory.test.ts +40 -0
  48. package/tests/self-evaluator.test.ts +97 -0
  49. package/cli/commands/model.ts +0 -156
  50. package/cli/commands/scan.ts +0 -99
  51. package/cli/commands/workspace.ts +0 -219
  52. package/demo-backend/.ai-spec-constitution.md +0 -65
  53. package/demo-backend/package.json +0 -21
  54. package/demo-backend/prisma/schema.prisma +0 -22
  55. package/demo-backend/specs/feature-1-bookmark-id-uuid-title-string-required-url-str-v1.dsl.json +0 -186
  56. package/demo-backend/specs/feature-1-bookmark-id-uuid-title-string-required-url-str-v1.md +0 -211
  57. package/demo-backend/src/controllers/bookmark.controller.test.ts +0 -255
  58. package/demo-backend/src/controllers/bookmark.controller.ts +0 -187
  59. package/demo-backend/src/index.ts +0 -17
  60. package/demo-backend/src/routes/bookmark.routes.test.ts +0 -264
  61. package/demo-backend/src/routes/bookmark.routes.ts +0 -11
  62. package/demo-backend/src/routes/index.ts +0 -8
  63. package/demo-backend/src/services/bookmark.service.test.ts +0 -433
  64. package/demo-backend/src/services/bookmark.service.ts +0 -261
  65. package/demo-backend/tsconfig.json +0 -12
  66. package/demo-frontend/.ai-spec-constitution.md +0 -95
  67. package/demo-frontend/package.json +0 -23
  68. package/demo-frontend/src/App.tsx +0 -12
  69. package/demo-frontend/src/main.tsx +0 -9
  70. package/demo-frontend/tsconfig.json +0 -13
package/dist/index.d.mts CHANGED
@@ -81,6 +81,8 @@ interface ProviderMeta {
81
81
  models: string[];
82
82
  /** Environment variable name for the API key */
83
83
  envKey: string;
84
+ /** Fallback env var names checked if envKey is not set */
85
+ fallbackEnvKeys?: string[];
84
86
  /**
85
87
  * Base URL for OpenAI-compatible providers.
86
88
  * Undefined means the provider has its own SDK (Gemini / Claude).
@@ -126,10 +128,9 @@ declare class OpenAICompatibleProvider implements AIProvider {
126
128
  generate(prompt: string, systemInstruction?: string): Promise<string>;
127
129
  }
128
130
  declare class MiMoProvider implements AIProvider {
131
+ private client;
129
132
  readonly providerName = "mimo";
130
133
  readonly modelName: string;
131
- private apiKey;
132
- private readonly baseUrl;
133
134
  constructor(apiKey: string, modelName?: string);
134
135
  generate(prompt: string, systemInstruction?: string): Promise<string>;
135
136
  }
@@ -211,6 +212,20 @@ interface CodeGenOptions {
211
212
  dslFilePath?: string;
212
213
  /** Repo language type — selects the appropriate codegen system prompt */
213
214
  repoType?: string;
215
+ /**
216
+ * Maximum number of tasks that can run concurrently within a single batch
217
+ * (api mode only). A batch larger than this value is split into sequential
218
+ * sub-chunks, each running maxConcurrency tasks in parallel. Default: 3.
219
+ */
220
+ maxConcurrency?: number;
221
+ /**
222
+ * When true, prior hallucination patterns from `.ai-spec-fix-history.json`
223
+ * are injected into the codegen prompt as a "DO NOT REPEAT" section.
224
+ * Default: true when the ledger exists.
225
+ */
226
+ injectFixHistory?: boolean;
227
+ /** Max number of past hallucination patterns to inject. Default: 10 */
228
+ fixHistoryInjectMax?: number;
214
229
  }
215
230
  declare class CodeGenerator {
216
231
  private provider;
package/dist/index.d.ts CHANGED
@@ -81,6 +81,8 @@ interface ProviderMeta {
81
81
  models: string[];
82
82
  /** Environment variable name for the API key */
83
83
  envKey: string;
84
+ /** Fallback env var names checked if envKey is not set */
85
+ fallbackEnvKeys?: string[];
84
86
  /**
85
87
  * Base URL for OpenAI-compatible providers.
86
88
  * Undefined means the provider has its own SDK (Gemini / Claude).
@@ -126,10 +128,9 @@ declare class OpenAICompatibleProvider implements AIProvider {
126
128
  generate(prompt: string, systemInstruction?: string): Promise<string>;
127
129
  }
128
130
  declare class MiMoProvider implements AIProvider {
131
+ private client;
129
132
  readonly providerName = "mimo";
130
133
  readonly modelName: string;
131
- private apiKey;
132
- private readonly baseUrl;
133
134
  constructor(apiKey: string, modelName?: string);
134
135
  generate(prompt: string, systemInstruction?: string): Promise<string>;
135
136
  }
@@ -211,6 +212,20 @@ interface CodeGenOptions {
211
212
  dslFilePath?: string;
212
213
  /** Repo language type — selects the appropriate codegen system prompt */
213
214
  repoType?: string;
215
+ /**
216
+ * Maximum number of tasks that can run concurrently within a single batch
217
+ * (api mode only). A batch larger than this value is split into sequential
218
+ * sub-chunks, each running maxConcurrency tasks in parallel. Default: 3.
219
+ */
220
+ maxConcurrency?: number;
221
+ /**
222
+ * When true, prior hallucination patterns from `.ai-spec-fix-history.json`
223
+ * are injected into the codegen prompt as a "DO NOT REPEAT" section.
224
+ * Default: true when the ledger exists.
225
+ */
226
+ injectFixHistory?: boolean;
227
+ /** Max number of past hallucination patterns to inject. Default: 10 */
228
+ fixHistoryInjectMax?: number;
214
229
  }
215
230
  declare class CodeGenerator {
216
231
  private provider;