iriai-build 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 (80) hide show
  1. package/bin/iriai-build.js +78 -0
  2. package/bridge-v3.js +98 -0
  3. package/cli/bootstrap.js +83 -0
  4. package/cli/commands/implementation.js +64 -0
  5. package/cli/commands/index.js +46 -0
  6. package/cli/commands/launch.js +153 -0
  7. package/cli/commands/plan.js +117 -0
  8. package/cli/commands/setup.js +80 -0
  9. package/cli/commands/slack.js +97 -0
  10. package/cli/commands/transfer.js +111 -0
  11. package/cli/config.js +92 -0
  12. package/cli/display.js +121 -0
  13. package/cli/terminal-input.js +666 -0
  14. package/cli/wait.js +82 -0
  15. package/index.js +1488 -0
  16. package/lib/agent-process.js +170 -0
  17. package/lib/bridge-state.js +126 -0
  18. package/lib/constants.js +137 -0
  19. package/lib/health-monitor.js +113 -0
  20. package/lib/prompt-builder.js +565 -0
  21. package/lib/signal-watcher.js +215 -0
  22. package/lib/slack-helpers.js +224 -0
  23. package/lib/state-machines/feature-lead.js +408 -0
  24. package/lib/state-machines/operator-agent.js +173 -0
  25. package/lib/state-machines/planning-role.js +161 -0
  26. package/lib/state-machines/role-agent.js +186 -0
  27. package/lib/state-machines/team-orchestrator.js +160 -0
  28. package/package.json +31 -0
  29. package/v3/.handover-html-evidence.md +35 -0
  30. package/v3/KICKOFF-HTML-EVIDENCE.md +98 -0
  31. package/v3/PLAN-HTML-EVIDENCE-HARDENING.md +603 -0
  32. package/v3/adapters/desktop-adapter.js +78 -0
  33. package/v3/adapters/interface.js +146 -0
  34. package/v3/adapters/slack-adapter.js +608 -0
  35. package/v3/adapters/slack-helpers.js +179 -0
  36. package/v3/adapters/terminal-adapter.js +249 -0
  37. package/v3/agent-supervisor.js +320 -0
  38. package/v3/artifact-portal.js +1184 -0
  39. package/v3/bridge.db +0 -0
  40. package/v3/constants.js +170 -0
  41. package/v3/db.js +76 -0
  42. package/v3/file-io.js +216 -0
  43. package/v3/helpers.js +174 -0
  44. package/v3/operator.js +364 -0
  45. package/v3/orchestrator.js +2886 -0
  46. package/v3/plan-compiler.js +440 -0
  47. package/v3/prompt-builder.js +849 -0
  48. package/v3/queries.js +461 -0
  49. package/v3/recovery.js +508 -0
  50. package/v3/review-sessions.js +360 -0
  51. package/v3/roles/accessibility-auditor/CLAUDE.md +50 -0
  52. package/v3/roles/analytics-engineer/CLAUDE.md +40 -0
  53. package/v3/roles/architect/CLAUDE.md +809 -0
  54. package/v3/roles/backend-implementer/CLAUDE.md +97 -0
  55. package/v3/roles/code-reviewer/CLAUDE.md +89 -0
  56. package/v3/roles/database-implementer/CLAUDE.md +97 -0
  57. package/v3/roles/deployer/CLAUDE.md +42 -0
  58. package/v3/roles/designer/CLAUDE.md +386 -0
  59. package/v3/roles/documentation/CLAUDE.md +40 -0
  60. package/v3/roles/feature-lead/CLAUDE.md +233 -0
  61. package/v3/roles/frontend-implementer/CLAUDE.md +97 -0
  62. package/v3/roles/implementer/CLAUDE.md +97 -0
  63. package/v3/roles/integration-tester/CLAUDE.md +174 -0
  64. package/v3/roles/observability-engineer/CLAUDE.md +40 -0
  65. package/v3/roles/operator/CLAUDE.md +322 -0
  66. package/v3/roles/orchestrator/CLAUDE.md +288 -0
  67. package/v3/roles/package-implementer/CLAUDE.md +47 -0
  68. package/v3/roles/performance-analyst/CLAUDE.md +49 -0
  69. package/v3/roles/plan-compiler/CLAUDE.md +163 -0
  70. package/v3/roles/planning-lead/CLAUDE.md +41 -0
  71. package/v3/roles/pm/CLAUDE.md +806 -0
  72. package/v3/roles/regression-tester/CLAUDE.md +135 -0
  73. package/v3/roles/release-manager/CLAUDE.md +43 -0
  74. package/v3/roles/security-auditor/CLAUDE.md +90 -0
  75. package/v3/roles/smoke-tester/CLAUDE.md +97 -0
  76. package/v3/roles/test-author/CLAUDE.md +42 -0
  77. package/v3/roles/verifier/CLAUDE.md +90 -0
  78. package/v3/schema.sql +134 -0
  79. package/v3/slack-adapter.js +510 -0
  80. package/v3/slack-helpers.js +346 -0
@@ -0,0 +1,146 @@
1
+ // interface.js — InterfaceAdapter base class.
2
+ // All user-facing I/O flows through this contract.
3
+ // Implementations: SlackAdapter, TerminalAdapter, DesktopAdapter.
4
+
5
+ /**
6
+ * @typedef {Object} DecisionSpec
7
+ * @property {string} id - Semantic ID, e.g. "gate-2-review", "plan-approval"
8
+ * @property {string} title - Human-readable title
9
+ * @property {string} [context] - Brief context text
10
+ * @property {string} [type] - "approval" | "choice" | "confirmation"
11
+ * @property {Array<{id: string, label: string, style?: string, description?: string}>} options
12
+ * @property {string} [reviewUrl] - URL to interactive doc review tool (qa-feedback)
13
+ * @property {string} [qaUrl] - URL to interactive QA testing session (qa-feedback proxy)
14
+ */
15
+
16
+ export class InterfaceAdapter {
17
+ // Default channel/workspace ref. Adapters set this to their primary channel.
18
+ // Used by orchestrator for feature disambiguation when multiple features are active.
19
+ planningChannel = null;
20
+
21
+ /**
22
+ * Create a feature channel/workspace. Returns an opaque channel reference string.
23
+ * @param {number} featureId
24
+ * @param {string} slug
25
+ * @returns {Promise<string|null>} channelRef — opaque handle (Slack channel ID, terminal slug, etc.)
26
+ */
27
+ async createFeatureChannel(featureId, slug) {
28
+ throw new Error("InterfaceAdapter.createFeatureChannel() not implemented");
29
+ }
30
+
31
+ /**
32
+ * Post a general message to the feature's channel.
33
+ * @param {number} featureId
34
+ * @param {string} text
35
+ * @returns {Promise<{ref?: string}>} Opaque message reference
36
+ */
37
+ async postMessage(featureId, text) {
38
+ throw new Error("InterfaceAdapter.postMessage() not implemented");
39
+ }
40
+
41
+ /**
42
+ * Post a message to the feature's parent thread (e.g. planning channel thread).
43
+ * @param {number} featureId
44
+ * @param {string} text
45
+ * @returns {Promise<void>}
46
+ */
47
+ async postThreadMessage(featureId, text) {
48
+ throw new Error("InterfaceAdapter.postThreadMessage() not implemented");
49
+ }
50
+
51
+ /**
52
+ * Post a pipeline/system status message.
53
+ * @param {number} featureId
54
+ * @param {string} text
55
+ * @returns {Promise<{ref?: string}>}
56
+ */
57
+ async postPipelineMessage(featureId, text) {
58
+ throw new Error("InterfaceAdapter.postPipelineMessage() not implemented");
59
+ }
60
+
61
+ /**
62
+ * Post an agent response (with media handling).
63
+ * @param {number} featureId
64
+ * @param {string} agentLabel - Display name of the agent
65
+ * @param {string} content - Raw content (may contain media markers)
66
+ * @returns {Promise<{ref?: string}>}
67
+ */
68
+ async postAgentResponse(featureId, agentLabel, content) {
69
+ throw new Error("InterfaceAdapter.postAgentResponse() not implemented");
70
+ }
71
+
72
+ /**
73
+ * Upload an artifact file.
74
+ * @param {number} featureId
75
+ * @param {string} filePath - Absolute path to file
76
+ * @param {string} title - Display title
77
+ * @returns {Promise<void>}
78
+ */
79
+ async uploadArtifact(featureId, filePath, title) {
80
+ throw new Error("InterfaceAdapter.uploadArtifact() not implemented");
81
+ }
82
+
83
+ /**
84
+ * Post a decision prompt (buttons/choices).
85
+ * @param {number} featureId
86
+ * @param {DecisionSpec} decision
87
+ * @returns {Promise<{ref?: string}>} Opaque decision message reference
88
+ */
89
+ async postDecision(featureId, decision) {
90
+ throw new Error("InterfaceAdapter.postDecision() not implemented");
91
+ }
92
+
93
+ /**
94
+ * Update a decision message to show resolved state.
95
+ * @param {number} featureId
96
+ * @param {string} messageRef - Opaque reference from postDecision
97
+ * @param {string} decisionId
98
+ * @param {string} selectedOption - Option ID
99
+ * @param {string} selectedLabel - Human label
100
+ * @param {string} resolvedBy - User ID
101
+ * @param {string} [feedback]
102
+ * @returns {Promise<void>}
103
+ */
104
+ async resolveDecisionMessage(featureId, messageRef, decisionId, selectedOption, selectedLabel, resolvedBy, feedback) {
105
+ throw new Error("InterfaceAdapter.resolveDecisionMessage() not implemented");
106
+ }
107
+
108
+ /**
109
+ * Post plan artifacts and approval decision.
110
+ * @param {number} featureId
111
+ * @param {string} planDir - Directory containing plan artifacts
112
+ * @returns {Promise<{ref?: string}>}
113
+ */
114
+ async postPlanForApproval(featureId, planDir) {
115
+ throw new Error("InterfaceAdapter.postPlanForApproval() not implemented");
116
+ }
117
+
118
+ /**
119
+ * Post feature completion message.
120
+ * @param {number} featureId
121
+ * @returns {Promise<void>}
122
+ */
123
+ async postFeatureComplete(featureId) {
124
+ throw new Error("InterfaceAdapter.postFeatureComplete() not implemented");
125
+ }
126
+
127
+ /**
128
+ * Add a processing indicator (e.g. :eyes: reaction).
129
+ * @param {number} featureId
130
+ * @param {string} messageRef
131
+ * @returns {Promise<void>}
132
+ */
133
+ async markProcessing(featureId, messageRef) {
134
+ // Optional — default no-op
135
+ }
136
+
137
+ /**
138
+ * Clear a processing indicator.
139
+ * @param {number} featureId
140
+ * @param {string} messageRef
141
+ * @returns {Promise<void>}
142
+ */
143
+ async clearProcessing(featureId, messageRef) {
144
+ // Optional — default no-op
145
+ }
146
+ }