theslopmachine 0.4.2 → 0.4.5

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.
package/src/init.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import fs from 'node:fs/promises'
2
+ import { randomUUID } from 'node:crypto'
2
3
  import path from 'node:path'
3
4
 
4
5
  import { buildPaths } from './constants.js'
@@ -150,12 +151,59 @@ async function runWorkflowBootstrap(paths, targetPath, trackerScript) {
150
151
  }
151
152
 
152
153
  async function createRepoStructure(targetPath, agentsTemplate) {
154
+ log('Creating parent workflow directories')
155
+ await ensureDir(path.join(targetPath, 'docs'))
156
+ await ensureDir(path.join(targetPath, 'sessions'))
157
+
153
158
  log('Creating repo/ working directory')
154
159
  await ensureDir(path.join(targetPath, 'repo'))
155
160
 
156
161
  log('Copying AGENTS template into repo/')
157
162
  await fs.copyFile(agentsTemplate, path.join(targetPath, 'repo', 'AGENTS.md'))
158
163
 
164
+ const projectMetadataPath = path.join(targetPath, 'metadata.json')
165
+ if (!(await pathExists(projectMetadataPath))) {
166
+ log('Creating parent metadata.json')
167
+ await fs.writeFile(projectMetadataPath, `${JSON.stringify({
168
+ prompt: null,
169
+ project_type: null,
170
+ frontend_language: null,
171
+ backend_language: null,
172
+ database: null,
173
+ session_id: null,
174
+ frontend_framework: null,
175
+ backend_framework: null,
176
+ }, null, 2)}\n`, 'utf8')
177
+ }
178
+
179
+ const workflowMetadataPath = path.join(targetPath, '.ai', 'metadata.json')
180
+ if (!(await pathExists(workflowMetadataPath))) {
181
+ log('Creating .ai/metadata.json')
182
+ await fs.writeFile(workflowMetadataPath, `${JSON.stringify({
183
+ run_id: randomUUID(),
184
+ current_phase: null,
185
+ awaiting_human: false,
186
+ clarification_approved: false,
187
+ remediation_round: 0,
188
+ clarification_validator_session_id: null,
189
+ evaluation_pass: 0,
190
+ backend_evaluation_session_id: null,
191
+ frontend_evaluation_session_id: null,
192
+ last_evaluation_session_id: null,
193
+ backend_evaluation_report_path: null,
194
+ frontend_evaluation_report_path: null,
195
+ passed_evaluation_tracks: [],
196
+ developer_sessions: [],
197
+ active_developer_session_id: null,
198
+ next_develop_session_number: 1,
199
+ next_bugfix_session_number: 1,
200
+ submission_completed: false,
201
+ }, null, 2)}\n`, 'utf8')
202
+ }
203
+
204
+ await fs.writeFile(path.join(targetPath, '.ai', 'artifacts', '.gitkeep'), '', 'utf8')
205
+ await fs.writeFile(path.join(targetPath, 'docs', '.gitkeep'), '', 'utf8')
206
+ await fs.writeFile(path.join(targetPath, 'sessions', '.gitkeep'), '', 'utf8')
159
207
  await fs.writeFile(path.join(targetPath, 'repo', '.gitkeep'), '', 'utf8')
160
208
  }
161
209