project-iris 0.0.13 → 0.0.15

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 (189) hide show
  1. package/README.md +261 -94
  2. package/bin/cli.js +21 -0
  3. package/flows/aidlc/README.md +372 -0
  4. package/flows/aidlc/agents/construction-agent.md +79 -0
  5. package/flows/aidlc/agents/inception-agent.md +97 -0
  6. package/flows/aidlc/agents/master-agent.md +61 -0
  7. package/flows/aidlc/agents/operations-agent.md +89 -0
  8. package/flows/aidlc/commands/construction-agent.md +63 -0
  9. package/flows/aidlc/commands/inception-agent.md +55 -0
  10. package/flows/aidlc/commands/master-agent.md +47 -0
  11. package/flows/aidlc/commands/operations-agent.md +77 -0
  12. package/flows/aidlc/context-config.yaml +67 -0
  13. package/flows/aidlc/memory-bank.yaml +104 -0
  14. package/flows/aidlc/quick-start.md +322 -0
  15. package/flows/aidlc/skills/construction/bolt-list.md +163 -0
  16. package/flows/aidlc/skills/construction/bolt-replan.md +345 -0
  17. package/flows/aidlc/skills/construction/bolt-start.md +442 -0
  18. package/flows/aidlc/skills/construction/bolt-status.md +185 -0
  19. package/flows/aidlc/skills/construction/navigator.md +196 -0
  20. package/flows/aidlc/skills/inception/bolt-plan.md +372 -0
  21. package/flows/aidlc/skills/inception/context.md +171 -0
  22. package/flows/aidlc/skills/inception/intent-create.md +211 -0
  23. package/flows/aidlc/skills/inception/intent-list.md +124 -0
  24. package/flows/aidlc/skills/inception/navigator.md +207 -0
  25. package/flows/aidlc/skills/inception/requirements.md +227 -0
  26. package/flows/aidlc/skills/inception/review.md +248 -0
  27. package/flows/aidlc/skills/inception/story-create.md +304 -0
  28. package/flows/aidlc/skills/inception/units.md +278 -0
  29. package/flows/aidlc/skills/master/analyze-context.md +239 -0
  30. package/flows/aidlc/skills/master/answer-question.md +141 -0
  31. package/flows/aidlc/skills/master/explain-flow.md +158 -0
  32. package/flows/aidlc/skills/master/project-init.md +281 -0
  33. package/flows/aidlc/skills/master/route-request.md +126 -0
  34. package/flows/aidlc/skills/operations/build.md +237 -0
  35. package/flows/aidlc/skills/operations/deploy.md +259 -0
  36. package/flows/aidlc/skills/operations/monitor.md +265 -0
  37. package/flows/aidlc/skills/operations/navigator.md +209 -0
  38. package/flows/aidlc/skills/operations/verify.md +224 -0
  39. package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/ddd-construction-bolt.md +3 -3
  40. package/{dist → flows/aidlc}/templates/construction/bolt-types/spike-bolt.md +2 -2
  41. package/flows/aidlc/templates/construction/construction-log-template.md +129 -0
  42. package/flows/aidlc/templates/construction/standards/coding-standards.md +29 -0
  43. package/flows/aidlc/templates/construction/standards/system-architecture.md +22 -0
  44. package/flows/aidlc/templates/construction/standards/tech-stack.md +19 -0
  45. package/flows/aidlc/templates/inception/inception-log-template.md +134 -0
  46. package/flows/aidlc/templates/inception/project/README.md +55 -0
  47. package/flows/aidlc/templates/standards/catalog.yaml +345 -0
  48. package/flows/aidlc/templates/standards/coding-standards.guide.md +553 -0
  49. package/flows/aidlc/templates/standards/data-stack.guide.md +162 -0
  50. package/flows/aidlc/templates/standards/tech-stack.guide.md +280 -0
  51. package/lib/InstallerFactory.js +36 -0
  52. package/lib/analytics/env-detector.js +92 -0
  53. package/lib/analytics/index.js +22 -0
  54. package/lib/analytics/machine-id.js +33 -0
  55. package/lib/analytics/tracker.js +232 -0
  56. package/lib/cli-utils.js +342 -0
  57. package/lib/constants.js +32 -0
  58. package/lib/installer.js +402 -0
  59. package/lib/installers/AntigravityInstaller.js +112 -0
  60. package/lib/installers/ClaudeInstaller.js +85 -0
  61. package/lib/installers/ClineInstaller.js +21 -0
  62. package/lib/installers/CodexInstaller.js +21 -0
  63. package/lib/installers/CopilotInstaller.js +113 -0
  64. package/lib/installers/CursorInstaller.js +63 -0
  65. package/lib/installers/GeminiInstaller.js +75 -0
  66. package/lib/installers/KiroInstaller.js +22 -0
  67. package/lib/installers/OpenCodeInstaller.js +22 -0
  68. package/lib/installers/RooInstaller.js +22 -0
  69. package/lib/installers/ToolInstaller.js +73 -0
  70. package/lib/installers/WindsurfInstaller.js +22 -0
  71. package/lib/markdown-validator.ts +175 -0
  72. package/lib/yaml-validator.ts +99 -0
  73. package/package.json +106 -33
  74. package/scripts/artifact-validator.js +594 -0
  75. package/scripts/bolt-complete.js +606 -0
  76. package/scripts/status-integrity.js +598 -0
  77. package/dist/bridge/agent-runner.js +0 -190
  78. package/dist/bridge/connector-factory.js +0 -31
  79. package/dist/bridge/connectors/antigravity-connector.js +0 -18
  80. package/dist/bridge/connectors/cursor-connector.js +0 -31
  81. package/dist/bridge/connectors/in-process-connector.js +0 -29
  82. package/dist/bridge/connectors/vscode-connector.js +0 -31
  83. package/dist/bridge/connectors/windsurf-connector.js +0 -23
  84. package/dist/bridge/filesystem-connector.js +0 -110
  85. package/dist/bridge/helper.js +0 -203
  86. package/dist/bridge/types.js +0 -10
  87. package/dist/cli.js +0 -40
  88. package/dist/commands/ask.js +0 -259
  89. package/dist/commands/bridge.js +0 -88
  90. package/dist/commands/create.js +0 -25
  91. package/dist/commands/develop.js +0 -141
  92. package/dist/commands/doctor.js +0 -102
  93. package/dist/commands/flow.js +0 -301
  94. package/dist/commands/framework.js +0 -273
  95. package/dist/commands/generate.js +0 -59
  96. package/dist/commands/install.js +0 -100
  97. package/dist/commands/pack.js +0 -33
  98. package/dist/commands/phase.js +0 -38
  99. package/dist/commands/run.js +0 -199
  100. package/dist/commands/status.js +0 -114
  101. package/dist/commands/uninstall.js +0 -14
  102. package/dist/commands/use.js +0 -20
  103. package/dist/commands/validate.js +0 -102
  104. package/dist/framework/framework-loader.js +0 -97
  105. package/dist/framework/framework-paths.js +0 -48
  106. package/dist/framework/framework-types.js +0 -15
  107. package/dist/iris/artifact-checker.js +0 -78
  108. package/dist/iris/artifacts/config.js +0 -68
  109. package/dist/iris/artifacts/generator.js +0 -88
  110. package/dist/iris/artifacts/types.js +0 -1
  111. package/dist/iris/bundle.js +0 -44
  112. package/dist/iris/doctrine/collector.js +0 -124
  113. package/dist/iris/fixer.js +0 -149
  114. package/dist/iris/flows/manifest.js +0 -124
  115. package/dist/iris/framework-context.js +0 -49
  116. package/dist/iris/framework-manager.js +0 -215
  117. package/dist/iris/fs/atomic.js +0 -22
  118. package/dist/iris/guard.js +0 -38
  119. package/dist/iris/importers/index.js +0 -9
  120. package/dist/iris/importers/types.js +0 -8
  121. package/dist/iris/importers/writer.js +0 -139
  122. package/dist/iris/include.js +0 -49
  123. package/dist/iris/installer.js +0 -334
  124. package/dist/iris/interactive/env.js +0 -21
  125. package/dist/iris/interactive/intent-interview.js +0 -345
  126. package/dist/iris/interactive/intent-schema.js +0 -28
  127. package/dist/iris/interactive/interview-io.js +0 -22
  128. package/dist/iris/interview/config.js +0 -71
  129. package/dist/iris/interview/types.js +0 -16
  130. package/dist/iris/interview/utils.js +0 -38
  131. package/dist/iris/manifest.js +0 -54
  132. package/dist/iris/packer.js +0 -325
  133. package/dist/iris/parsers/unit-parser.js +0 -43
  134. package/dist/iris/paths.js +0 -18
  135. package/dist/iris/policy.js +0 -133
  136. package/dist/iris/proc.js +0 -56
  137. package/dist/iris/report.js +0 -53
  138. package/dist/iris/resolver.js +0 -66
  139. package/dist/iris/router.js +0 -114
  140. package/dist/iris/routes.js +0 -189
  141. package/dist/iris/run-state.js +0 -146
  142. package/dist/iris/state.js +0 -113
  143. package/dist/iris/templates.js +0 -70
  144. package/dist/iris/tmp.js +0 -24
  145. package/dist/iris/uninstaller.js +0 -181
  146. package/dist/iris/utils/interpolate.js +0 -42
  147. package/dist/iris/validator.js +0 -391
  148. package/dist/iris/workflow/config.js +0 -51
  149. package/dist/iris/workflow/engine.js +0 -129
  150. package/dist/iris/workflow/steps.js +0 -448
  151. package/dist/iris/workflow/types.js +0 -1
  152. package/dist/iris_bundle/frameworks/iris-core/framework.yaml +0 -9
  153. package/dist/iris_bundle/frameworks/iris-core/memory/memory-bank.yaml +0 -1
  154. package/dist/iris_bundle/frameworks/iris-core/policy.yaml +0 -7
  155. package/dist/iris_bundle/frameworks/iris-core/templates/config/memory-bank.yaml +0 -1
  156. package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/spike-bolt.md +0 -240
  157. package/dist/lib.js +0 -96
  158. package/dist/templates/construction/bolt-template.md +0 -226
  159. package/dist/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +0 -49
  160. package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +0 -55
  161. package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +0 -67
  162. package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +0 -62
  163. package/dist/templates/construction/bolt-types/ddd-construction-bolt.md +0 -528
  164. package/dist/templates/construction/bolt-types/simple-construction-bolt.md +0 -347
  165. package/dist/templates/inception/requirements-template.md +0 -144
  166. package/dist/templates/inception/stories-template.md +0 -38
  167. package/dist/templates/inception/story-template.md +0 -147
  168. package/dist/templates/inception/system-context-template.md +0 -29
  169. package/dist/templates/inception/unit-brief-template.md +0 -177
  170. package/dist/templates/inception/units-template.md +0 -52
  171. package/dist/utils/exit-codes.js +0 -7
  172. package/dist/utils/logo.js +0 -17
  173. package/dist/workflows/bolt-execution.js +0 -238
  174. package/dist/workflows/bolt-plan.js +0 -221
  175. package/dist/workflows/intent-inception.js +0 -285
  176. package/dist/workflows/memory-bank-generator.js +0 -180
  177. package/dist/workflows/reporting.js +0 -74
  178. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-template.md +0 -0
  179. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +0 -0
  180. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +0 -0
  181. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +0 -0
  182. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +0 -0
  183. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/construction/bolt-types/simple-construction-bolt.md +0 -0
  184. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/requirements-template.md +0 -0
  185. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/stories-template.md +0 -0
  186. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/story-template.md +0 -0
  187. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/system-context-template.md +0 -0
  188. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/unit-brief-template.md +0 -0
  189. /package/{dist/iris_bundle/frameworks/iris-core → flows/aidlc}/templates/inception/units-template.md +0 -0
package/dist/cli.js DELETED
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from "commander";
3
- import { installCommand } from "./commands/install.js";
4
- import { flowCommand } from "./commands/flow.js";
5
- import { uninstallCommand } from "./commands/uninstall.js";
6
- import { phaseCommand } from "./commands/phase.js";
7
- import { validateCommand } from "./commands/validate.js";
8
- import { statusCommand } from "./commands/status.js";
9
- import { runCommand } from "./commands/run.js";
10
- import { packCommand } from "./commands/pack.js";
11
- import { askCommand } from "./commands/ask.js";
12
- import { doctorCommand } from "./commands/doctor.js";
13
- import { developCommand } from "./commands/develop.js";
14
- import { bridgeCommand } from "./commands/bridge.js";
15
- import { frameworkCommand } from "./commands/framework.js";
16
- import { generateCommand } from "./commands/generate.js";
17
- import { useCommand } from "./commands/use.js";
18
- import { createCommand } from "./commands/create.js";
19
- const program = new Command();
20
- program
21
- .name("iris")
22
- .description("IRIS CLI - Intelligent Repository for Intent-driven Systems")
23
- .version("0.0.12")
24
- .addCommand(installCommand)
25
- .addCommand(uninstallCommand)
26
- .addCommand(frameworkCommand)
27
- .addCommand(generateCommand)
28
- .addCommand(flowCommand)
29
- .addCommand(phaseCommand)
30
- .addCommand(validateCommand)
31
- .addCommand(statusCommand)
32
- .addCommand(packCommand)
33
- .addCommand(runCommand)
34
- .addCommand(askCommand)
35
- .addCommand(doctorCommand)
36
- .addCommand(developCommand)
37
- .addCommand(bridgeCommand)
38
- .addCommand(useCommand)
39
- .addCommand(createCommand);
40
- program.parseAsync(process.argv);
@@ -1,259 +0,0 @@
1
- import { Command } from "commander";
2
- import inquirer from "inquirer";
3
- import kleur from "kleur";
4
- import path from "path";
5
- import fs from "fs";
6
- import { repoRoot } from "../lib.js";
7
- import { resolveArtifactPath, getIrisDebugInfo } from "../iris/resolver.js";
8
- import { loadEffectiveRoutes } from "../iris/routes.js";
9
- import { routeIntent } from "../iris/router.js";
10
- import { checkArtifact } from "../iris/artifact-checker.js";
11
- import { loadPolicy } from "../iris/policy.js";
12
- import { loadState } from "../iris/state.js";
13
- import { EXIT_CODES } from "../utils/exit-codes.js";
14
- import { createConnector } from "../bridge/connector-factory.js";
15
- import { executeIntentInception } from "../workflows/intent-inception.js";
16
- import { executeBoltPlan } from "../workflows/bolt-plan.js";
17
- import { createRun } from "../iris/run-state.js";
18
- import { migrateLegacyDraft } from "../iris/interactive/intent-interview.js";
19
- import { checkInteractiveMode } from "../iris/interactive/env.js";
20
- import { resolveActiveFramework } from "../iris/framework-context.js";
21
- import { loadEffectiveInterviewConfig } from "../iris/interview/config.js";
22
- export const askCommand = new Command("ask")
23
- .description("Route intent to an agent and generate context pack")
24
- .argument("[intent...]", "Natural language request intent")
25
- .option("--agent <agent>", "Override target agent")
26
- .option("--phase <phase>", "Override target phase")
27
- .option("--out <path>", "Explicit output path for pack")
28
- .option("--stdout", "Print pack to stdout", false)
29
- .option("--json", "Output structured JSON result", false)
30
- .option("--dry-run", "Simulate routing without writing files", false)
31
- .option("--debug", "Show IRIS authority and artifact resolution info", false)
32
- .option("--non-interactive", "Skip interactive interview", false)
33
- .option("--force-interactive", "Force interactive mode even in CI/Pipe", false)
34
- .option("--save-draft-only", "Run interview and save draft, but do not execute workflow", false)
35
- .action(async (intentParts, opts) => {
36
- const root = repoRoot();
37
- const { resolution } = await resolveActiveFramework(root);
38
- if (opts.debug) {
39
- const debug = getIrisDebugInfo(root);
40
- console.log(kleur.bold("IRIS Authority Debug"));
41
- console.log(`- Repo Root: ${debug.repoRoot}`);
42
- console.log(`- IRIS Root: ${debug.irisRoot}`);
43
- console.log(`- Source: ${kleur.magenta(debug.source.toUpperCase())}`);
44
- console.log(`- Bundled Path:${debug.bundledPath}`);
45
- console.log("");
46
- // Show artifact validation details
47
- const policy = loadPolicy(root);
48
- const state = loadState();
49
- const phase = state.phase.current;
50
- const requirements = policy.phases[phase]?.requires || [];
51
- if (requirements.length > 0) {
52
- console.log(kleur.bold("Required Artifacts Debug"));
53
- for (const req of requirements) {
54
- const check = checkArtifact(root, req.path, req.type);
55
- console.log(`\n- Artifact: ${req.type}`);
56
- console.log(` Raw: ${JSON.stringify(req.path)}`);
57
- console.log(` Normalized: ${check.normalized}`);
58
- console.log(` Absolute: ${check.absolutePath}`);
59
- console.log(` Inferred: ${check.inferredKind}`);
60
- console.log(` Exists: ${check.exists ? kleur.green("YES") : kleur.red("NO")}`);
61
- if (check.exists) {
62
- console.log(` Type: ${check.isDirectory ? "directory" : check.isFile ? "file" : "unknown"}`);
63
- }
64
- if (check.hasControlChars) {
65
- console.log(` ${kleur.yellow("⚠ WARNING: Raw path contains control characters (\\r, \\n, etc.)")}`);
66
- }
67
- }
68
- console.log("");
69
- }
70
- }
71
- // Migration Check
72
- const migrated = migrateLegacyDraft(root);
73
- if (migrated) {
74
- console.log(kleur.dim("Migrated old intent-draft.json to intent-draft.latest.json"));
75
- }
76
- // 1. Get Intent
77
- let intent = intentParts.join(" ");
78
- // Environment Check
79
- const envCheck = checkInteractiveMode({
80
- nonInteractive: opts.nonInteractive,
81
- forceInteractive: opts.forceInteractive
82
- });
83
- if (envCheck.isInteractive) {
84
- // 1.5 Load Interview Config
85
- // Skipped Legacy Interview - proceeding directly to Ping-Pong Flow
86
- // If no intent provided yet, ask for just the one-liner intent
87
- if (!intent) {
88
- const { initialIntent } = await inquirer.prompt([
89
- {
90
- type: "input",
91
- name: "initialIntent",
92
- message: "What are you trying to build?",
93
- validate: (val) => val.trim().length > 0 || "Please provide a goal."
94
- }
95
- ]);
96
- intent = initialIntent;
97
- }
98
- }
99
- else {
100
- // NON-INTERACTIVE MODE
101
- if (!opts.nonInteractive && !opts.forceInteractive) {
102
- // Warn if we fell back automatically (reason exists)
103
- if (envCheck.reason) {
104
- console.warn(kleur.yellow(`⚠ Interactive mode disabled: ${envCheck.reason}`));
105
- console.warn(kleur.dim(" Use --force-interactive to override if safe."));
106
- }
107
- }
108
- // Fallback input reading
109
- if (!intent) {
110
- if (process.stdin.isTTY) {
111
- console.error(kleur.red("Error: Intent argument required in non-interactive mode."));
112
- process.exit(EXIT_CODES.INVALID);
113
- return;
114
- }
115
- else {
116
- try {
117
- intent = fs.readFileSync(0, "utf-8").trim();
118
- }
119
- catch (e) {
120
- // Ignore read error
121
- }
122
- }
123
- }
124
- }
125
- if (!intent) {
126
- console.error(kleur.red("No intent provided."));
127
- process.exit(EXIT_CODES.INVALID);
128
- return; // TS Guard
129
- }
130
- // 2. Load Routes
131
- let routesConfig;
132
- try {
133
- const state = loadState();
134
- // Load Base or Effective
135
- routesConfig = loadEffectiveRoutes(resolution, root, state.active.flow);
136
- }
137
- catch (e) {
138
- if (e.name === "RoutesOverlayMissingError") {
139
- console.error(kleur.red(`\n[Policy Error] ${e.message}`));
140
- process.exit(EXIT_CODES.POLICY_ERROR);
141
- }
142
- if (e.name === "RoutesLoadError") {
143
- console.error(kleur.red(`\n[Routes Error] ${e.message}`));
144
- if (e.cause)
145
- console.error(kleur.gray(e.cause));
146
- process.exit(EXIT_CODES.POLICY_ERROR);
147
- }
148
- // Fallback for unexpected
149
- console.error(kleur.red(`Failed to load routes: ${e.message}`));
150
- process.exit(EXIT_CODES.POLICY_ERROR);
151
- }
152
- // 3. Route
153
- const routing = routeIntent(intent, routesConfig);
154
- const routeId = routing.route === "default" ? "default" : routing.route.route_id;
155
- const source = routing.route !== "default" ? routing.route._source : "default";
156
- if (opts.debug) {
157
- console.log(kleur.bold(`Matched route_id: ${routeId} ${source ? `(source: ${source})` : ""}`));
158
- }
159
- // 4. Execution Workflow (Inception + Planning)
160
- if (opts.dryRun) {
161
- // DRY RUN: Simulate pack generation
162
- // We know intent, route, agent.
163
- // We can create a Plan object.
164
- const plan = {
165
- schemaVersion: 1,
166
- intent: intent,
167
- framework: resolution ? resolution.manifest.id : "legacy-fallback",
168
- route: {
169
- id: routeId,
170
- target: routing.route === "default" ? "default" : routing.route.agent,
171
- score: routing.route === "default" ? 0 : routing.route.score
172
- },
173
- routesSource: {
174
- kind: routesConfig?._meta?.sourceKind || (resolution ? 'framework' : 'legacy'),
175
- path: routesConfig?._meta?.sourcePath || (resolution ? resolution.files.routes : resolveArtifactPath(root, ".iris/routes.yaml"))
176
- },
177
- interviewSource: (() => {
178
- // We need to load it here for dry run to show source
179
- const interviewConfig = loadEffectiveInterviewConfig(resolution);
180
- const isFramework = !!(resolution?.files.interview);
181
- return {
182
- kind: isFramework ? 'framework' : 'default',
183
- path: isFramework ? resolution?.files.interview : null,
184
- activeFrameworkId: resolution?.manifest.id || null
185
- };
186
- })(),
187
- pack: {
188
- planned: true,
189
- }
190
- };
191
- if (opts.json) {
192
- console.log(JSON.stringify(plan, null, 2));
193
- }
194
- else {
195
- console.log(kleur.yellow("[Dry Run] Routing Result:"));
196
- console.log(JSON.stringify(plan, null, 2));
197
- }
198
- process.exit(0);
199
- return;
200
- }
201
- console.log(kleur.bold("Starting IRIS Inception & Planning"));
202
- console.log(kleur.dim("This process will clarify your intent and generate an implementation plan.\n"));
203
- // Initialize Bridge/IDE
204
- // Default to 'auto' (In-Process Agent) for seamless UX, ignoring detected IDE unless explicitly bridged?
205
- // For now, satisfy user request: "Check user intent first".
206
- // We will use "auto" as the default connector.
207
- const ideId = "auto";
208
- // Create new run
209
- const runState = createRun(intent, ideId, "manual");
210
- const connector = createConnector(ideId);
211
- try {
212
- // Phase 1: Inception (Clarify + Artifacts)
213
- await executeIntentInception(runState, connector, {
214
- gate: "manual",
215
- noBridge: false
216
- });
217
- // Phase 2: Bolt Plan (Stories -> Bolts)
218
- await executeBoltPlan(runState, connector, {
219
- gate: "manual",
220
- noBridge: false
221
- });
222
- const result = {
223
- runId: runState.runId,
224
- status: "plan_created",
225
- planPath: path.join(root, ".iris/runs", runState.runId, "implementation_plan.md")
226
- };
227
- if (opts.json) {
228
- console.log(JSON.stringify(result, null, 2));
229
- }
230
- else {
231
- console.log("");
232
- console.log(kleur.bold(kleur.green("✓ Plan Created Successfully!")));
233
- console.log("To start execution, run:");
234
- console.log(kleur.cyan(` iris develop --resume ${runState.runId}`));
235
- console.log("");
236
- }
237
- }
238
- catch (error) {
239
- if (opts.json) {
240
- console.log(JSON.stringify({ error: error.message }, null, 2));
241
- }
242
- else {
243
- console.error(kleur.red(`\n✗ Planning Failed: ${error.message}`));
244
- }
245
- process.exit(1);
246
- }
247
- });
248
- function inferAgentFromPhase(phase) {
249
- if (!phase)
250
- return "master";
251
- const p = phase.toLowerCase();
252
- if (p === "inception")
253
- return "inception";
254
- if (p === "construction")
255
- return "construction";
256
- if (p === "operations")
257
- return "operations";
258
- return "master";
259
- }
@@ -1,88 +0,0 @@
1
- import { Command } from "commander";
2
- import { startBridgeHelper, INBOX_DIR, OUTBOX_DIR, STATE_DIR } from "../bridge/helper.js";
3
- import { getSelectedIde } from "../iris/state.js";
4
- import { createConnector } from "../bridge/connector-factory.js";
5
- import kleur from "kleur";
6
- import fs from "fs";
7
- export const bridgeCommand = new Command("bridge")
8
- .description("Bridge helper commands for IDE integration (Advanced)")
9
- .configureHelp({ showGlobalOptions: true }); // Hide from main list if possible, or just mark advanced
10
- // iris bridge run
11
- bridgeCommand
12
- .command("run")
13
- .description("Start bridge helper (watches inbox, opens IDE, waits for results)")
14
- .option("--poll-interval <ms>", "Polling interval in milliseconds", "2000")
15
- .action(async (options) => {
16
- await startBridgeHelper({
17
- pollInterval: parseInt(options.pollInterval),
18
- verbose: true
19
- });
20
- });
21
- // iris bridge serve
22
- bridgeCommand
23
- .command("serve")
24
- .description("Start automated agent (Simulates AI response)")
25
- .action(async () => {
26
- const { startAgentRunner } = await import("../bridge/agent-runner.js");
27
- await startAgentRunner({ verbose: true });
28
- });
29
- // iris bridge status
30
- bridgeCommand
31
- .command("status")
32
- .description("Show bridge status and IDE information")
33
- .action(() => {
34
- console.log("");
35
- console.log(kleur.bold("IRIS Bridge Status"));
36
- console.log("===================\n");
37
- // IDE selection
38
- const ideId = getSelectedIde();
39
- if (ideId) {
40
- console.log(kleur.bold("Selected IDE:"));
41
- console.log(` ${kleur.cyan(ideId)}\n`);
42
- }
43
- else {
44
- console.log(kleur.yellow("⚠ No IDE selected"));
45
- console.log(kleur.dim(" Run: iris install\n"));
46
- }
47
- // Connector availability
48
- if (ideId) {
49
- const connector = createConnector(ideId);
50
- console.log(kleur.bold("Connector:"));
51
- console.log(` Type: ${connector.displayName}`);
52
- console.log(` ID: ${connector.id}\n`);
53
- }
54
- // Bridge directories
55
- console.log(kleur.bold("Bridge Directories:"));
56
- const dirs = [
57
- { name: "Inbox", path: INBOX_DIR },
58
- { name: "Outbox", path: OUTBOX_DIR },
59
- { name: "State", path: STATE_DIR }
60
- ];
61
- dirs.forEach(({ name, path: dirPath }) => {
62
- const exists = fs.existsSync(dirPath);
63
- const status = exists ? kleur.green("✓") : kleur.red("✗");
64
- console.log(` ${status} ${name}: ${dirPath}`);
65
- if (exists) {
66
- const files = fs.readdirSync(dirPath);
67
- if (files.length > 0) {
68
- console.log(kleur.dim(` ${files.length} file(s)`));
69
- }
70
- }
71
- });
72
- console.log("");
73
- // Pending tasks
74
- if (fs.existsSync(INBOX_DIR)) {
75
- const tasks = fs.readdirSync(INBOX_DIR).filter(f => f.endsWith(".json"));
76
- if (tasks.length > 0) {
77
- console.log(kleur.bold("Pending Tasks:"));
78
- tasks.forEach(task => {
79
- console.log(kleur.yellow(` - ${task.replace(".json", "")}`));
80
- });
81
- console.log("");
82
- }
83
- }
84
- // Helper running check
85
- console.log(kleur.bold("Bridge Helper:"));
86
- console.log(kleur.dim(" To start: iris bridge run"));
87
- console.log("");
88
- });
@@ -1,25 +0,0 @@
1
- import { Command } from "commander";
2
- import { generateMemoryBankStructure } from "../workflows/memory-bank-generator.js";
3
- import { createConnector } from "../bridge/connector-factory.js";
4
- import kleur from "kleur";
5
- export const createCommand = new Command("create")
6
- .description("Create memory bank artifacts")
7
- .addCommand(new Command("intent")
8
- .description("Create a new intent with full structure")
9
- .argument("<intent>", "Intent description")
10
- .action(async (intent) => {
11
- console.log(kleur.bold(`Creating intent: ${intent}`));
12
- const connector = createConnector("auto");
13
- try {
14
- await generateMemoryBankStructure({
15
- intent,
16
- answers: {}, // No answers for pure creation, or we could prompt
17
- connector
18
- });
19
- console.log(kleur.green("✓ Intent created successfully"));
20
- }
21
- catch (error) {
22
- console.error(kleur.red(`Failed to create intent: ${error.message}`));
23
- process.exit(1);
24
- }
25
- }));
@@ -1,141 +0,0 @@
1
- import { Command } from "commander";
2
- import inquirer from "inquirer";
3
- import kleur from "kleur";
4
- import { getSelectedIde, setSelectedIde } from "../iris/state.js";
5
- import { createRun, loadRun, saveRun } from "../iris/run-state.js";
6
- import { createConnector } from "../bridge/connector-factory.js";
7
- import { WorkflowStage } from "../bridge/types.js";
8
- import fs from "fs";
9
- import path from "path";
10
- export const developCommand = new Command("develop")
11
- .description("Run automated IRIS workflow (Execution Phase)")
12
- .argument("[intent...]", "Intent description")
13
- .option("--resume <runId>", "Resume a previous run")
14
- .option("--ide <ideId>", "Override IDE selection")
15
- .option("--gate <mode>", "Gate approval mode: auto or manual", "manual")
16
- .action(async (intentArgs, options) => {
17
- // Handle resume (existing logic is fine-ish but we need to ensure it skips to execution)
18
- if (options.resume) {
19
- console.log(kleur.cyan(`Resuming run: ${options.resume}`));
20
- await resumeRun(options.resume, options);
21
- return;
22
- }
23
- // Implicitly resume OR start new execution if plan exists
24
- // User expects "iris develop" to just work if plan is ready.
25
- // Check for bolts/plan.md
26
- const planPath = path.join(process.cwd(), "memory-bank/operations/bolts/plan.md");
27
- if (!fs.existsSync(planPath)) {
28
- console.error(kleur.red("No bolt plan found."));
29
- console.log(kleur.yellow("Please run 'iris ask' first to create a plan."));
30
- process.exit(1);
31
- }
32
- // We need a RunState.
33
- // If "iris ask" created a run, we should probably print the runId to resume?
34
- // Or "iris ask" just created files.
35
- // We should create a NEW run for execution if one isn't passed?
36
- // Actually, if we want to trace the whole thing, "iris ask" created a run.
37
- // But "iris ask" might have exited.
38
- // We can create a new run for "Execution Phase".
39
- const intent = intentArgs.join(" ") || "Execute Plan"; // Optional intent arg if just running
40
- // Get IDE selection
41
- let ideId = options.ide || getSelectedIde();
42
- if (!ideId) {
43
- const { selectedIde } = await inquirer.prompt([
44
- {
45
- type: "input",
46
- name: "selectedIde",
47
- message: "Which IDE will you use? (e.g., cursor, vscode, antigravity)",
48
- default: "antigravity"
49
- }
50
- ]);
51
- ideId = selectedIde;
52
- setSelectedIde(ideId);
53
- }
54
- console.log("");
55
- console.log(kleur.bold("Starting IRIS Execution"));
56
- console.log(kleur.gray(`IDE: ${ideId}`));
57
- console.log("");
58
- const runState = createRun(intent, ideId, options.gate);
59
- // Pre-load bolts from plan
60
- // executeBoltPlan usually does this. We need to do it here manually since we skipped that stage.
61
- // We can reuse logic or just rely on executeBoltExecution to load them?
62
- // executeBoltExecution expects runState.bolts to be populated.
63
- // We need to parse bolts.
64
- // We should export parseBoltsFromPlan from bolt-plan.ts or move to a utility.
65
- // Or just re-implement simple parsing here.
66
- const bolts = await parseBoltsFromPlan();
67
- if (bolts.length === 0) {
68
- console.error(kleur.red("No bolts found in plan.md"));
69
- process.exit(1);
70
- }
71
- runState.bolts = bolts;
72
- runState.stage = WorkflowStage.BOLT_EXECUTION;
73
- saveRun(runState);
74
- console.log(kleur.cyan(`Loaded ${bolts.length} bolts from plan.`));
75
- // Execute workflow
76
- await executeWorkflow(runState, options);
77
- });
78
- async function resumeRun(runId, options) {
79
- try {
80
- const runState = loadRun(runId);
81
- console.log(kleur.gray(`Intent: ${runState.intent}`));
82
- console.log(kleur.gray(`Current Stage: ${runState.stage}`));
83
- console.log("");
84
- await executeWorkflow(runState, options);
85
- }
86
- catch (error) {
87
- console.error(kleur.red(`Failed to resume run: ${error.message}`));
88
- process.exit(1);
89
- }
90
- }
91
- async function executeWorkflow(runState, options) {
92
- const connector = createConnector(runState.ideId);
93
- // Initial bridge check (Invisible Bridge handled by waitResult, but we might want to ensure it's up)
94
- // await connector.ensureRunning(); // optional
95
- console.log(kleur.bold("Execution Phase"));
96
- // We only handle Bolt Execution loop here
97
- if (runState.stage === WorkflowStage.BOLT_EXECUTION) {
98
- // Custom loop to add Reporting
99
- while (runState.currentBoltIndex < runState.bolts.length) {
100
- const bolt = runState.bolts[runState.currentBoltIndex];
101
- // Execute Bolt
102
- // We can reuse executeBoltExecution BUT it loops internaly.
103
- // We want to interject reporting.
104
- // So we should probably modify executeBoltExecution OR
105
- // just call a "executeSingleBolt" if exposed?
106
- // It is not exposed.
107
- // Alternative: Let executeBoltExecution run ALL bolts, and we rely on it?
108
- // But we want reporting "After every bolt iris generates a report".
109
- // We can modify executeBoltExecution to do reporting?
110
- // YES. That is a better place if we want it tightly coupled.
111
- // But per "Refactoring develop command" plan:
112
- // "Modify executeWorkflow to... Iterate bolts... Execute... Report"
113
- // If I cannot cleanly call single bolt execution, I should modify bolt-execution.ts to accept a callback or emit events?
114
- // Or just verify if I can import executeSingleBolt? It's not exported.
115
- // I will modify bolt-execution.ts to export executeSingleBolt or handle reporting.
116
- // For now, let's assume I will REFACTOR bolt-execution.ts to export executeSingleBolt.
117
- // Wait, let's verify if I can export it.
118
- // Yes I can.
119
- }
120
- // Using the "Refactor develop.ts" to IMPLEMENT the loop here is cleaner than modifying the workflow file too much.
121
- // ...
122
- }
123
- }
124
- // ... helper to parse bolts needed if not importing ...
125
- async function parseBoltsFromPlan() {
126
- const planPath = path.join(process.cwd(), "memory-bank/operations/bolts/plan.md");
127
- if (!fs.existsSync(planPath))
128
- return [];
129
- // Simple regex parse execution
130
- const content = fs.readFileSync(planPath, "utf8");
131
- const bolts = [];
132
- const boltPattern = /(?:^|\n)(?:\d+\.|[-*])\s+([a-z0-9-]+)(?:\.md)?/gi;
133
- let match;
134
- while ((match = boltPattern.exec(content)) !== null) {
135
- const boltId = match[1].replace(/\.md$/, "");
136
- if (!bolts.find(b => b.id === boltId)) {
137
- bolts.push({ id: boltId, status: "pending" });
138
- }
139
- }
140
- return bolts;
141
- }
@@ -1,102 +0,0 @@
1
- import { Command } from "commander";
2
- import { execSync } from "child_process";
3
- import fs from "fs";
4
- import path from "path";
5
- import kleur from "kleur";
6
- function checkmark(condition) {
7
- return condition ? kleur.green("✓") : kleur.red("✗");
8
- }
9
- function getNodeVersion() {
10
- return process.version;
11
- }
12
- function getNpmVersion() {
13
- try {
14
- return execSync("npm --version", { encoding: "utf-8" }).trim();
15
- }
16
- catch {
17
- return "unknown";
18
- }
19
- }
20
- function getNpmPrefix() {
21
- try {
22
- return execSync("npm prefix -g", { encoding: "utf-8" }).trim();
23
- }
24
- catch {
25
- return "unknown";
26
- }
27
- }
28
- function isInPath(dir) {
29
- const pathEnv = process.env.PATH || "";
30
- const paths = pathEnv.split(":");
31
- return paths.includes(dir);
32
- }
33
- export const doctorCommand = new Command("doctor")
34
- .description("Diagnose environment and PATH issues for iris")
35
- .action(() => {
36
- const root = process.cwd();
37
- const cliPath = path.join(root, "dist/cli.js");
38
- const cliExists = fs.existsSync(cliPath);
39
- const nodeVersion = getNodeVersion();
40
- const npmVersion = getNpmVersion();
41
- const npmPrefix = getNpmPrefix();
42
- const globalBinDir = npmPrefix !== "unknown" ? path.join(npmPrefix, "bin") : "unknown";
43
- const irisLinkPath = globalBinDir !== "unknown" ? path.join(globalBinDir, "iris") : "unknown";
44
- const irisLinkExists = irisLinkPath !== "unknown" && fs.existsSync(irisLinkPath);
45
- const binInPath = globalBinDir !== "unknown" && isInPath(globalBinDir);
46
- console.log("");
47
- console.log(kleur.bold("IRIS Doctor - Environment Diagnostics"));
48
- console.log("=====================================");
49
- console.log("");
50
- // System info
51
- console.log(kleur.bold("System:"));
52
- console.log(`${checkmark(true)} Node.js: ${nodeVersion}`);
53
- console.log(`${checkmark(npmVersion !== "unknown")} npm: ${npmVersion}`);
54
- console.log(`${checkmark(true)} Repo root: ${root}`);
55
- console.log(`${checkmark(cliExists)} CLI built: ${cliExists ? "dist/cli.js exists" : "dist/cli.js MISSING"}`);
56
- console.log("");
57
- if (!cliExists) {
58
- console.log(kleur.yellow("⚠ Action Required:"));
59
- console.log(" Build the CLI first:");
60
- console.log(kleur.cyan(" npm run build"));
61
- console.log("");
62
- }
63
- // Global installation
64
- console.log(kleur.bold("Global Installation:"));
65
- console.log(`${checkmark(npmPrefix !== "unknown")} npm prefix: ${npmPrefix}`);
66
- console.log(`${checkmark(globalBinDir !== "unknown")} bin dir: ${globalBinDir}`);
67
- console.log(`${checkmark(binInPath)} In PATH: ${binInPath ? "YES" : "NO"}`);
68
- console.log(`${checkmark(irisLinkExists)} iris link: ${irisLinkExists ? `${irisLinkPath} → exists` : `${irisLinkPath} → NOT FOUND`}`);
69
- console.log("");
70
- // Actionable guidance
71
- const hasIssues = !cliExists || !binInPath || !irisLinkExists;
72
- if (hasIssues) {
73
- console.log(kleur.yellow("⚠ Action Required:"));
74
- console.log("");
75
- if (!irisLinkExists && cliExists) {
76
- console.log(" Link iris globally:");
77
- console.log(kleur.cyan(" npm run link:iris"));
78
- console.log("");
79
- }
80
- if (!binInPath && globalBinDir !== "unknown") {
81
- console.log(" Add global bin to PATH:");
82
- console.log(kleur.cyan(` export PATH="${globalBinDir}:$PATH"`));
83
- console.log("");
84
- console.log(" Then reload shell:");
85
- console.log(kleur.cyan(" source ~/.zshrc && hash -r"));
86
- console.log("");
87
- }
88
- }
89
- else {
90
- console.log(kleur.green("✓ Everything looks good!"));
91
- console.log("");
92
- console.log(" You can run iris globally:");
93
- console.log(kleur.cyan(" iris --version"));
94
- console.log(kleur.cyan(" iris validate"));
95
- console.log("");
96
- }
97
- // Additional tips
98
- console.log(kleur.dim("Tips:"));
99
- console.log(kleur.dim(" - Run 'type -a iris' to see which iris resolves"));
100
- console.log(kleur.dim(" - Use 'npm run iris -- <command>' for repo-local execution"));
101
- console.log("");
102
- });