agentic-dev 0.2.14 → 0.2.16
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/README.md +26 -10
- package/dist/bin/agentic-dev.d.ts +3 -0
- package/dist/bin/agentic-dev.d.ts.map +1 -0
- package/dist/bin/agentic-dev.js +864 -0
- package/dist/bin/agentic-dev.js.map +1 -0
- package/dist/lib/github.d.ts +27 -0
- package/dist/lib/github.d.ts.map +1 -0
- package/dist/lib/github.js +217 -0
- package/dist/lib/github.js.map +1 -0
- package/dist/lib/orchestration-assets.d.ts +6 -0
- package/dist/lib/orchestration-assets.d.ts.map +1 -0
- package/dist/lib/orchestration-assets.js +673 -0
- package/dist/lib/orchestration-assets.js.map +1 -0
- package/dist/lib/scaffold.d.ts +23 -0
- package/dist/lib/scaffold.d.ts.map +1 -0
- package/dist/lib/scaffold.js +502 -0
- package/dist/lib/scaffold.js.map +1 -0
- package/dist/lib/types.d.ts +106 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/package.json +13 -6
- package/bin/agentic-dev.mjs +0 -1014
- package/lib/github.mjs +0 -246
- package/lib/orchestration-assets.mjs +0 -430
- package/lib/scaffold.mjs +0 -609
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { GithubProjectRef, GithubRepositoryRef, InstallTemplateRepoOptions, InstallTemplateRepoResult, ParsedArgs, SetupSelections, TemplateRepo } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_TEMPLATE_OWNER = "say828";
|
|
3
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
4
|
+
export declare function usage(): string;
|
|
5
|
+
export declare function ensureTargetDir(targetDir: string, { force }?: {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function fetchTemplateRepos({ owner }?: {
|
|
9
|
+
owner?: string;
|
|
10
|
+
}): Promise<TemplateRepo[]>;
|
|
11
|
+
export declare function resolveTemplateRepo(input: string, repos: TemplateRepo[]): TemplateRepo | null;
|
|
12
|
+
export declare function selectTemplateRepo(choice: string, repos: TemplateRepo[]): TemplateRepo;
|
|
13
|
+
export declare function scaffoldFromTemplateRepo({ destinationRoot, templateRepo, }: {
|
|
14
|
+
destinationRoot: string;
|
|
15
|
+
templateRepo: TemplateRepo;
|
|
16
|
+
}): void;
|
|
17
|
+
export declare function installTemplateRepo({ destinationRoot, templateRepo, setupSelections, skipBootstrap, }: InstallTemplateRepoOptions): InstallTemplateRepoResult;
|
|
18
|
+
export declare function resolveGitHubOrchestration(setupSelections?: SetupSelections): Promise<{
|
|
19
|
+
githubRepository: GithubRepositoryRef;
|
|
20
|
+
githubProject: GithubProjectRef;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function finalizeRepositoryGit(destinationRoot: string, setupSelections?: SetupSelections): void;
|
|
23
|
+
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/lib/scaffold.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,UAAU,EACV,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAqD/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA2FpD;AAED,wBAAgB,KAAK,IAAI,MAAM,CA8B9B;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,KAAa,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAatG;AA6BD,wBAAsB,kBAAkB,CAAC,EAAE,KAA8B,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAsC7H;AAkBD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,GAAG,IAAI,CAoB7F;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAetF;AAsMD,wBAAgB,wBAAwB,CAAC,EACvC,eAAe,EACf,YAAY,GACb,EAAE;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;CAC5B,GAAG,IAAI,CAYP;AAED,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,YAAY,EACZ,eAAoB,EACpB,aAAqB,GACtB,EAAE,0BAA0B,GAAG,yBAAyB,CA8BxD;AAED,wBAAsB,0BAA0B,CAC9C,eAAe,GAAE,eAAoB,GACpC,OAAO,CAAC;IAAE,gBAAgB,EAAE,mBAAmB,CAAC;IAAC,aAAa,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAcrF;AAED,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE,eAAe,GAAE,eAAoB,GAAG,IAAI,CAI1G"}
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import { ensureGitHubProject, ensureGitHubRepository } from "./github.js";
|
|
7
|
+
import { installOrchestrationAssets, installSharedAgentAssets, writeOrchestrationConfig, } from "./orchestration-assets.js";
|
|
8
|
+
export const DEFAULT_TEMPLATE_OWNER = "say828";
|
|
9
|
+
function runCommand(command, args, { cwd = process.cwd(), label = "" } = {}) {
|
|
10
|
+
if (label) {
|
|
11
|
+
console.log(`\n> ${label}`);
|
|
12
|
+
}
|
|
13
|
+
const result = spawnSync(command, args, {
|
|
14
|
+
cwd,
|
|
15
|
+
stdio: "inherit",
|
|
16
|
+
});
|
|
17
|
+
if (result.status !== 0) {
|
|
18
|
+
throw new Error(`Command failed: ${command} ${args.join(" ")}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function commandExists(command) {
|
|
22
|
+
const result = spawnSync("bash", ["-lc", `command -v ${command}`], {
|
|
23
|
+
stdio: "ignore",
|
|
24
|
+
});
|
|
25
|
+
return result.status === 0;
|
|
26
|
+
}
|
|
27
|
+
function copyDirectoryContents(sourceRoot, destinationRoot) {
|
|
28
|
+
for (const entry of fs.readdirSync(sourceRoot, { withFileTypes: true })) {
|
|
29
|
+
if (entry.name === ".git" || entry.name === "node_modules" || entry.name === "dist") {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
fs.cpSync(path.join(sourceRoot, entry.name), path.join(destinationRoot, entry.name), {
|
|
33
|
+
recursive: true,
|
|
34
|
+
force: true,
|
|
35
|
+
filter: (source) => {
|
|
36
|
+
const baseName = path.basename(source);
|
|
37
|
+
return baseName !== ".git" && baseName !== "node_modules" && baseName !== "dist";
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function fetchPage(url) {
|
|
43
|
+
const token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN || process.env.AGENTIC_GITHUB_TOKEN;
|
|
44
|
+
return fetch(url, {
|
|
45
|
+
headers: {
|
|
46
|
+
Accept: "application/vnd.github+json",
|
|
47
|
+
"User-Agent": "agentic-dev",
|
|
48
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export function parseArgs(argv) {
|
|
53
|
+
const args = [...argv];
|
|
54
|
+
const options = {
|
|
55
|
+
command: "init",
|
|
56
|
+
targetDir: "",
|
|
57
|
+
projectName: "",
|
|
58
|
+
template: "",
|
|
59
|
+
owner: DEFAULT_TEMPLATE_OWNER,
|
|
60
|
+
appMode: "",
|
|
61
|
+
aiProviders: [],
|
|
62
|
+
providerProfiles: [],
|
|
63
|
+
githubRepositoryInput: "",
|
|
64
|
+
githubProjectMode: "",
|
|
65
|
+
githubProjectTitle: "",
|
|
66
|
+
githubAuthMode: "",
|
|
67
|
+
githubPat: "",
|
|
68
|
+
force: false,
|
|
69
|
+
yes: false,
|
|
70
|
+
skipBootstrap: false,
|
|
71
|
+
};
|
|
72
|
+
if (args.length > 0 && !args[0]?.startsWith("-")) {
|
|
73
|
+
options.command = args.shift() ?? "init";
|
|
74
|
+
}
|
|
75
|
+
while (args.length > 0) {
|
|
76
|
+
const token = args.shift();
|
|
77
|
+
switch (token) {
|
|
78
|
+
case "--template":
|
|
79
|
+
case "-t":
|
|
80
|
+
options.template = args.shift() ?? "";
|
|
81
|
+
break;
|
|
82
|
+
case "--project-name":
|
|
83
|
+
options.projectName = args.shift() ?? "";
|
|
84
|
+
break;
|
|
85
|
+
case "--owner":
|
|
86
|
+
options.owner = args.shift() ?? DEFAULT_TEMPLATE_OWNER;
|
|
87
|
+
break;
|
|
88
|
+
case "--app-mode":
|
|
89
|
+
options.appMode = (args.shift() ?? "");
|
|
90
|
+
break;
|
|
91
|
+
case "--providers":
|
|
92
|
+
case "--provider": {
|
|
93
|
+
const value = args.shift() ?? "";
|
|
94
|
+
options.aiProviders = value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case "--provider-profiles": {
|
|
98
|
+
const value = args.shift() ?? "";
|
|
99
|
+
options.providerProfiles = value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
case "--github-repo":
|
|
103
|
+
options.githubRepositoryInput = args.shift() ?? "";
|
|
104
|
+
break;
|
|
105
|
+
case "--github-project-mode":
|
|
106
|
+
options.githubProjectMode = (args.shift() ?? "");
|
|
107
|
+
break;
|
|
108
|
+
case "--github-project-title":
|
|
109
|
+
options.githubProjectTitle = args.shift() ?? "";
|
|
110
|
+
break;
|
|
111
|
+
case "--github-auth":
|
|
112
|
+
options.githubAuthMode = (args.shift() ?? "");
|
|
113
|
+
break;
|
|
114
|
+
case "--github-pat":
|
|
115
|
+
options.githubPat = args.shift() ?? "";
|
|
116
|
+
break;
|
|
117
|
+
case "--force":
|
|
118
|
+
options.force = true;
|
|
119
|
+
break;
|
|
120
|
+
case "--yes":
|
|
121
|
+
case "-y":
|
|
122
|
+
options.yes = true;
|
|
123
|
+
break;
|
|
124
|
+
case "--skip-bootstrap":
|
|
125
|
+
options.skipBootstrap = true;
|
|
126
|
+
break;
|
|
127
|
+
case "--help":
|
|
128
|
+
case "-h":
|
|
129
|
+
options.command = "help";
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
if (!options.targetDir && token && !token.startsWith("-")) {
|
|
133
|
+
options.targetDir = token;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
throw new Error(`Unknown argument: ${token}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return options;
|
|
140
|
+
}
|
|
141
|
+
export function usage() {
|
|
142
|
+
return [
|
|
143
|
+
"Usage:",
|
|
144
|
+
" agentic-dev",
|
|
145
|
+
" agentic-dev init <target-dir>",
|
|
146
|
+
"",
|
|
147
|
+
"Examples:",
|
|
148
|
+
" npx agentic-dev",
|
|
149
|
+
" npx agentic-dev init my-app",
|
|
150
|
+
" npx agentic-dev init my-app --template template-web --yes",
|
|
151
|
+
" npx agentic-dev init my-app --template template-web --project-name my-app --providers codex,claude",
|
|
152
|
+
" npx agentic-dev init my-app --github-repo say828/my-app --github-project-title 'My App Delivery' --provider-profiles codex-subscription,openai-api",
|
|
153
|
+
"",
|
|
154
|
+
"Options:",
|
|
155
|
+
" --template, -t Template repo name or suffix to use",
|
|
156
|
+
" --project-name Project name written into scaffold metadata",
|
|
157
|
+
" --owner GitHub owner for template-* repos (default: say828)",
|
|
158
|
+
" --app-mode App mode: fullstack, frontend, backend",
|
|
159
|
+
" --providers Comma-separated AI providers: codex, claude, ollama",
|
|
160
|
+
" --provider-profiles Provider/runtime list such as codex-subscription, claude-api, openai-api",
|
|
161
|
+
" --github-repo GitHub repo slug or URL to create/use",
|
|
162
|
+
" --github-project-mode create-if-missing or use-existing",
|
|
163
|
+
" --github-project-title GitHub Project title to bind orchestration to",
|
|
164
|
+
" --github-auth GitHub credential source: gh, env, pat (legacy public => gh)",
|
|
165
|
+
" --github-pat GitHub PAT for this run only",
|
|
166
|
+
" --force Allow scaffolding into a non-empty directory",
|
|
167
|
+
" --yes, -y Skip interactive prompts",
|
|
168
|
+
" --skip-bootstrap Copy the template but skip install/bootstrap",
|
|
169
|
+
" --help, -h Show this help",
|
|
170
|
+
].join("\n");
|
|
171
|
+
}
|
|
172
|
+
export function ensureTargetDir(targetDir, { force = false } = {}) {
|
|
173
|
+
if (!targetDir) {
|
|
174
|
+
throw new Error("Missing target directory.");
|
|
175
|
+
}
|
|
176
|
+
const resolved = path.resolve(process.cwd(), targetDir);
|
|
177
|
+
fs.mkdirSync(resolved, { recursive: true });
|
|
178
|
+
const entries = fs
|
|
179
|
+
.readdirSync(resolved, { withFileTypes: true })
|
|
180
|
+
.filter((entry) => entry.name !== ".git");
|
|
181
|
+
if (entries.length > 0 && !force) {
|
|
182
|
+
throw new Error(`Target directory is not empty: ${resolved}`);
|
|
183
|
+
}
|
|
184
|
+
return resolved;
|
|
185
|
+
}
|
|
186
|
+
function initializeGitRepository(destinationRoot, githubRepository) {
|
|
187
|
+
const gitDir = path.join(destinationRoot, ".git");
|
|
188
|
+
if (!fs.existsSync(gitDir)) {
|
|
189
|
+
runCommand("git", ["init", "-b", "main"], {
|
|
190
|
+
cwd: destinationRoot,
|
|
191
|
+
label: "Initializing git repository",
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const remotes = spawnSync("git", ["remote"], {
|
|
195
|
+
cwd: destinationRoot,
|
|
196
|
+
encoding: "utf-8",
|
|
197
|
+
});
|
|
198
|
+
const existingRemotes = new Set((remotes.stdout || "").split(/\r?\n/).filter(Boolean));
|
|
199
|
+
if (existingRemotes.has("origin")) {
|
|
200
|
+
runCommand("git", ["remote", "set-url", "origin", githubRepository.cloneUrl], {
|
|
201
|
+
cwd: destinationRoot,
|
|
202
|
+
label: "Updating origin remote",
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
runCommand("git", ["remote", "add", "origin", githubRepository.cloneUrl], {
|
|
207
|
+
cwd: destinationRoot,
|
|
208
|
+
label: "Adding origin remote",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export async function fetchTemplateRepos({ owner = DEFAULT_TEMPLATE_OWNER } = {}) {
|
|
213
|
+
const repos = [];
|
|
214
|
+
let page = 1;
|
|
215
|
+
while (true) {
|
|
216
|
+
const response = await fetchPage(`https://api.github.com/users/${owner}/repos?per_page=100&page=${page}&sort=updated`);
|
|
217
|
+
if (!response.ok) {
|
|
218
|
+
throw new Error(`Failed to fetch template repos from GitHub: ${response.status}`);
|
|
219
|
+
}
|
|
220
|
+
const payload = (await response.json());
|
|
221
|
+
const publicRepos = payload
|
|
222
|
+
.filter((repo) => !repo.private && typeof repo.name === "string")
|
|
223
|
+
.filter((repo) => (repo.name ?? "").startsWith("template-"))
|
|
224
|
+
.map((repo) => ({
|
|
225
|
+
name: repo.name ?? "",
|
|
226
|
+
description: repo.description ?? "",
|
|
227
|
+
cloneUrl: repo.clone_url ?? "",
|
|
228
|
+
htmlUrl: repo.html_url ?? "",
|
|
229
|
+
defaultBranch: repo.default_branch || "main",
|
|
230
|
+
}));
|
|
231
|
+
repos.push(...publicRepos);
|
|
232
|
+
if (payload.length < 100) {
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
page += 1;
|
|
236
|
+
}
|
|
237
|
+
repos.sort((a, b) => a.name.localeCompare(b.name));
|
|
238
|
+
return repos;
|
|
239
|
+
}
|
|
240
|
+
function updateJsonFile(filePath, updater) {
|
|
241
|
+
if (!fs.existsSync(filePath)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
let current = {};
|
|
245
|
+
try {
|
|
246
|
+
current = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const next = updater(current);
|
|
252
|
+
fs.writeFileSync(filePath, `${JSON.stringify(next, null, 2)}\n`);
|
|
253
|
+
}
|
|
254
|
+
export function resolveTemplateRepo(input, repos) {
|
|
255
|
+
const normalized = input.trim();
|
|
256
|
+
if (!normalized) {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
const exact = repos.find((repo) => repo.name === normalized);
|
|
260
|
+
if (exact) {
|
|
261
|
+
return exact;
|
|
262
|
+
}
|
|
263
|
+
const normalizedSuffix = normalized.startsWith("template-") ? normalized.slice(9) : normalized;
|
|
264
|
+
const matches = repos.filter((repo) => repo.name === `template-${normalizedSuffix}`);
|
|
265
|
+
if (matches.length === 1) {
|
|
266
|
+
return matches[0] ?? null;
|
|
267
|
+
}
|
|
268
|
+
if (matches.length > 1) {
|
|
269
|
+
throw new Error(`Ambiguous template repo: ${normalized}`);
|
|
270
|
+
}
|
|
271
|
+
throw new Error(`Template repo not found: ${normalized}`);
|
|
272
|
+
}
|
|
273
|
+
export function selectTemplateRepo(choice, repos) {
|
|
274
|
+
const normalized = choice.trim();
|
|
275
|
+
if (!normalized) {
|
|
276
|
+
throw new Error("Missing template selection.");
|
|
277
|
+
}
|
|
278
|
+
if (/^\d+$/.test(normalized)) {
|
|
279
|
+
const index = Number.parseInt(normalized, 10) - 1;
|
|
280
|
+
if (index < 0 || index >= repos.length) {
|
|
281
|
+
throw new Error(`Invalid selection: ${normalized}`);
|
|
282
|
+
}
|
|
283
|
+
return repos[index];
|
|
284
|
+
}
|
|
285
|
+
return resolveTemplateRepo(normalized, repos);
|
|
286
|
+
}
|
|
287
|
+
function ensurePnpm() {
|
|
288
|
+
if (commandExists("pnpm")) {
|
|
289
|
+
return ["pnpm"];
|
|
290
|
+
}
|
|
291
|
+
if (commandExists("corepack")) {
|
|
292
|
+
runCommand("corepack", ["enable"], { label: "Enabling corepack" });
|
|
293
|
+
return ["corepack", "pnpm"];
|
|
294
|
+
}
|
|
295
|
+
runCommand("npm", ["install", "-g", "pnpm"], { label: "Installing pnpm globally" });
|
|
296
|
+
return ["pnpm"];
|
|
297
|
+
}
|
|
298
|
+
function maybeCreateEnvFile(destinationRoot) {
|
|
299
|
+
const envExample = path.join(destinationRoot, ".env.example");
|
|
300
|
+
const envFile = path.join(destinationRoot, ".env");
|
|
301
|
+
if (fs.existsSync(envExample) && !fs.existsSync(envFile)) {
|
|
302
|
+
fs.copyFileSync(envExample, envFile);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function bootstrapScriptPath(destinationRoot) {
|
|
306
|
+
return path.join(destinationRoot, "sdd/99_toolchain/01_automation/agentic-dev/bootstrap_frontend_parity.sh");
|
|
307
|
+
}
|
|
308
|
+
function detectClientSurfaces(destinationRoot) {
|
|
309
|
+
const clientDir = path.join(destinationRoot, "client");
|
|
310
|
+
if (!fs.existsSync(clientDir)) {
|
|
311
|
+
return [];
|
|
312
|
+
}
|
|
313
|
+
return fs
|
|
314
|
+
.readdirSync(clientDir, { withFileTypes: true })
|
|
315
|
+
.filter((entry) => entry.isDirectory())
|
|
316
|
+
.map((entry) => entry.name)
|
|
317
|
+
.sort();
|
|
318
|
+
}
|
|
319
|
+
function repoContractPath(destinationRoot) {
|
|
320
|
+
return path.join(destinationRoot, "sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json");
|
|
321
|
+
}
|
|
322
|
+
function readJsonFile(filePath) {
|
|
323
|
+
if (!fs.existsSync(filePath)) {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
return JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
throw new Error(`Failed to parse JSON file: ${filePath}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function resolveBootstrapTarget(destinationRoot) {
|
|
334
|
+
const contract = readJsonFile(repoContractPath(destinationRoot));
|
|
335
|
+
const frontend = contract?.frontend;
|
|
336
|
+
const defaultTargetName = frontend?.default_target;
|
|
337
|
+
const targetConfig = typeof defaultTargetName === "string" ? frontend?.targets?.[defaultTargetName] : null;
|
|
338
|
+
if (typeof targetConfig?.dir === "string" && targetConfig.dir.length > 0) {
|
|
339
|
+
const name = defaultTargetName;
|
|
340
|
+
if (!name) {
|
|
341
|
+
throw new Error("Missing frontend.default_target value.");
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
name,
|
|
345
|
+
dir: targetConfig.dir,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
const clientSurfaces = detectClientSurfaces(destinationRoot);
|
|
349
|
+
if (clientSurfaces.length === 1) {
|
|
350
|
+
return {
|
|
351
|
+
name: clientSurfaces[0],
|
|
352
|
+
dir: path.join("client", clientSurfaces[0]),
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
if (clientSurfaces.length > 1) {
|
|
356
|
+
throw new Error("Template repo has multiple client surfaces. Add frontend.default_target to sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json.");
|
|
357
|
+
}
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
function validateTemplateRepoContents(destinationRoot, templateRepo) {
|
|
361
|
+
const requiredPaths = [
|
|
362
|
+
".env.example",
|
|
363
|
+
"pnpm-workspace.yaml",
|
|
364
|
+
"sdd/99_toolchain/01_automation/agentic-dev/bootstrap_frontend_parity.sh",
|
|
365
|
+
];
|
|
366
|
+
const missing = requiredPaths.filter((relativePath) => !fs.existsSync(path.join(destinationRoot, relativePath)));
|
|
367
|
+
if (missing.length > 0) {
|
|
368
|
+
throw new Error(`Template repo ${templateRepo.name} is missing required files: ${missing.join(", ")}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function writeSetupConfig(destinationRoot, setupSelections = {}) {
|
|
372
|
+
const outputDir = path.join(destinationRoot, ".agentic-dev");
|
|
373
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
374
|
+
const outputPath = path.join(outputDir, "setup.json");
|
|
375
|
+
const setupConfig = {
|
|
376
|
+
project_name: setupSelections.projectName || path.basename(destinationRoot),
|
|
377
|
+
template_repo: setupSelections.template || "",
|
|
378
|
+
template_owner: setupSelections.owner || DEFAULT_TEMPLATE_OWNER,
|
|
379
|
+
app_mode: setupSelections.appMode || "fullstack",
|
|
380
|
+
ai_providers: Array.isArray(setupSelections.aiProviders) ? setupSelections.aiProviders : [],
|
|
381
|
+
provider_profiles: Array.isArray(setupSelections.providerProfiles) ? setupSelections.providerProfiles : [],
|
|
382
|
+
github_auth_mode: setupSelections.githubAuthMode || "public",
|
|
383
|
+
github_repository: setupSelections.githubRepository || null,
|
|
384
|
+
github_project: setupSelections.githubProject || null,
|
|
385
|
+
github_pat_supplied: Boolean(setupSelections.githubPat),
|
|
386
|
+
skip_bootstrap: Boolean(setupSelections.skipBootstrap),
|
|
387
|
+
};
|
|
388
|
+
fs.writeFileSync(outputPath, `${JSON.stringify(setupConfig, null, 2)}\n`);
|
|
389
|
+
}
|
|
390
|
+
function applyProviderSelections(destinationRoot, providers = []) {
|
|
391
|
+
if (providers.length === 0) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (!providers.includes("claude")) {
|
|
395
|
+
fs.rmSync(path.join(destinationRoot, ".claude"), { recursive: true, force: true });
|
|
396
|
+
}
|
|
397
|
+
if (!providers.includes("codex")) {
|
|
398
|
+
fs.rmSync(path.join(destinationRoot, ".codex"), { recursive: true, force: true });
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function applyProjectMetadata(destinationRoot, setupSelections = {}) {
|
|
402
|
+
if (!setupSelections.projectName) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
updateJsonFile(path.join(destinationRoot, ".claude", "workspace-config.json"), (current) => ({
|
|
406
|
+
...current,
|
|
407
|
+
nickname: setupSelections.projectName,
|
|
408
|
+
}));
|
|
409
|
+
}
|
|
410
|
+
function runInstallSteps(destinationRoot, bootstrapTarget, { installBrowser = true } = {}) {
|
|
411
|
+
maybeCreateEnvFile(destinationRoot);
|
|
412
|
+
const pnpmCommand = ensurePnpm();
|
|
413
|
+
runCommand(pnpmCommand[0], [...pnpmCommand.slice(1), "install"], {
|
|
414
|
+
cwd: destinationRoot,
|
|
415
|
+
label: "Installing workspace dependencies",
|
|
416
|
+
});
|
|
417
|
+
const executedSteps = ["pnpm install"];
|
|
418
|
+
if (bootstrapTarget && installBrowser) {
|
|
419
|
+
runCommand(pnpmCommand[0], [...pnpmCommand.slice(1), "--dir", bootstrapTarget.dir, "exec", "playwright", "install", "chromium"], {
|
|
420
|
+
cwd: destinationRoot,
|
|
421
|
+
label: `Installing Playwright Chromium for ${bootstrapTarget.name}`,
|
|
422
|
+
});
|
|
423
|
+
executedSteps.push(`pnpm --dir ${bootstrapTarget.dir} exec playwright install chromium`);
|
|
424
|
+
}
|
|
425
|
+
return executedSteps;
|
|
426
|
+
}
|
|
427
|
+
function runBootstrapStep(destinationRoot, bootstrapTarget) {
|
|
428
|
+
const bootstrapScript = bootstrapScriptPath(destinationRoot);
|
|
429
|
+
if (!fs.existsSync(bootstrapScript)) {
|
|
430
|
+
throw new Error(`Missing bootstrap script in template repo: ${path.relative(destinationRoot, bootstrapScript)}`);
|
|
431
|
+
}
|
|
432
|
+
const args = [bootstrapScript, "."];
|
|
433
|
+
if (bootstrapTarget?.name) {
|
|
434
|
+
args.push(bootstrapTarget.name);
|
|
435
|
+
}
|
|
436
|
+
runCommand("bash", args, {
|
|
437
|
+
cwd: destinationRoot,
|
|
438
|
+
label: "Running frontend parity bootstrap",
|
|
439
|
+
});
|
|
440
|
+
return [bootstrapTarget?.name ? `bootstrap_frontend_parity.sh . ${bootstrapTarget.name}` : "bootstrap_frontend_parity.sh ."];
|
|
441
|
+
}
|
|
442
|
+
export function scaffoldFromTemplateRepo({ destinationRoot, templateRepo, }) {
|
|
443
|
+
const cloneRoot = fs.mkdtempSync(path.join(os.tmpdir(), "agentic-dev-template-"));
|
|
444
|
+
const repoRoot = path.join(cloneRoot, templateRepo.name);
|
|
445
|
+
try {
|
|
446
|
+
runCommand("git", ["clone", "--depth", "1", templateRepo.cloneUrl, repoRoot], {
|
|
447
|
+
label: `Cloning ${templateRepo.name}`,
|
|
448
|
+
});
|
|
449
|
+
copyDirectoryContents(repoRoot, destinationRoot);
|
|
450
|
+
}
|
|
451
|
+
finally {
|
|
452
|
+
fs.rmSync(cloneRoot, { recursive: true, force: true });
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
export function installTemplateRepo({ destinationRoot, templateRepo, setupSelections = {}, skipBootstrap = false, }) {
|
|
456
|
+
scaffoldFromTemplateRepo({ destinationRoot, templateRepo });
|
|
457
|
+
installSharedAgentAssets(destinationRoot);
|
|
458
|
+
installOrchestrationAssets(destinationRoot);
|
|
459
|
+
applyProviderSelections(destinationRoot, setupSelections.aiProviders);
|
|
460
|
+
applyProjectMetadata(destinationRoot, setupSelections);
|
|
461
|
+
writeOrchestrationConfig(destinationRoot, setupSelections);
|
|
462
|
+
writeSetupConfig(destinationRoot, {
|
|
463
|
+
...setupSelections,
|
|
464
|
+
template: templateRepo.name,
|
|
465
|
+
skipBootstrap,
|
|
466
|
+
});
|
|
467
|
+
validateTemplateRepoContents(destinationRoot, templateRepo);
|
|
468
|
+
const bootstrapTarget = resolveBootstrapTarget(destinationRoot);
|
|
469
|
+
const effectiveSkipBootstrap = skipBootstrap || setupSelections.appMode === "backend";
|
|
470
|
+
const installBrowser = setupSelections.appMode !== "backend";
|
|
471
|
+
const executedSteps = runInstallSteps(destinationRoot, bootstrapTarget, { installBrowser });
|
|
472
|
+
if (!effectiveSkipBootstrap) {
|
|
473
|
+
executedSteps.push(...runBootstrapStep(destinationRoot, bootstrapTarget));
|
|
474
|
+
}
|
|
475
|
+
const bootstrapHint = bootstrapTarget
|
|
476
|
+
? `cd ${bootstrapTarget.dir} && npm run ui:parity:bootstrap`
|
|
477
|
+
: "bash sdd/99_toolchain/01_automation/agentic-dev/bootstrap_frontend_parity.sh .";
|
|
478
|
+
return {
|
|
479
|
+
destinationRoot,
|
|
480
|
+
templateRepo: templateRepo.name,
|
|
481
|
+
executedSteps,
|
|
482
|
+
nextSteps: effectiveSkipBootstrap ? [bootstrapHint] : [],
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export async function resolveGitHubOrchestration(setupSelections = {}) {
|
|
486
|
+
const repository = await ensureGitHubRepository(setupSelections.githubRepositoryInput || setupSelections.projectName || "");
|
|
487
|
+
const project = await ensureGitHubProject({
|
|
488
|
+
ownerLogin: repository.owner,
|
|
489
|
+
title: setupSelections.githubProjectTitle || `${setupSelections.projectName || "Project"} Delivery`,
|
|
490
|
+
mode: setupSelections.githubProjectMode || "create-if-missing",
|
|
491
|
+
});
|
|
492
|
+
return {
|
|
493
|
+
githubRepository: repository,
|
|
494
|
+
githubProject: project,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
export function finalizeRepositoryGit(destinationRoot, setupSelections = {}) {
|
|
498
|
+
if (setupSelections.githubRepository) {
|
|
499
|
+
initializeGitRepository(destinationRoot, setupSelections.githubRepository);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/lib/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,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AC5B,aAAa,EAAE,OAAO;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,eAAuB,EAAE,kBAAmC,EAAE;IAClG,IAAI,eAAe,CAAC,gBAAgB,EAAE,CAAC;QACrC,uBAAuB,CAAC,eAAe,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export type GithubAuthMode = "gh" | "env" | "pat";
|
|
2
|
+
export type GitHubAuthMode = GithubAuthMode;
|
|
3
|
+
export type AppMode = "fullstack" | "frontend" | "backend";
|
|
4
|
+
export type AiProvider = "codex" | "claude" | "ollama";
|
|
5
|
+
export type ProviderProfile = "codex-subscription" | "codex-api" | "claude-subscription" | "claude-api" | "openai-api" | "ollama-self-hosted";
|
|
6
|
+
export type GithubProjectMode = "create-if-missing" | "use-existing";
|
|
7
|
+
export type GitHubProjectMode = GithubProjectMode;
|
|
8
|
+
export interface TemplateRepo {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
cloneUrl: string;
|
|
12
|
+
htmlUrl: string;
|
|
13
|
+
defaultBranch: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GithubRepositoryRef {
|
|
16
|
+
owner: string;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
cloneUrl: string;
|
|
20
|
+
htmlUrl: string;
|
|
21
|
+
created?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type GitHubRepositoryRef = GithubRepositoryRef;
|
|
24
|
+
export interface GithubProjectRef {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
number: number;
|
|
28
|
+
url: string;
|
|
29
|
+
created?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type GitHubProjectRef = GithubProjectRef;
|
|
32
|
+
export type GitHubRepositoryResult = GithubRepositoryRef;
|
|
33
|
+
export type GitHubProjectResult = GithubProjectRef;
|
|
34
|
+
export interface GitHubViewer {
|
|
35
|
+
login: string;
|
|
36
|
+
id: string;
|
|
37
|
+
}
|
|
38
|
+
export type NormalizedRepoInput = GithubRepositoryRef;
|
|
39
|
+
export interface RepositoryContract {
|
|
40
|
+
frontend?: {
|
|
41
|
+
default_target?: string;
|
|
42
|
+
targets?: Record<string, {
|
|
43
|
+
dir?: string;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface ParsedArgs {
|
|
48
|
+
command: string;
|
|
49
|
+
targetDir: string;
|
|
50
|
+
projectName: string;
|
|
51
|
+
template: string;
|
|
52
|
+
owner: string;
|
|
53
|
+
appMode: AppMode | "";
|
|
54
|
+
aiProviders: string[];
|
|
55
|
+
providerProfiles: string[];
|
|
56
|
+
githubRepositoryInput: string;
|
|
57
|
+
githubProjectMode: GithubProjectMode | "";
|
|
58
|
+
githubProjectTitle: string;
|
|
59
|
+
githubAuthMode: GithubAuthMode | "";
|
|
60
|
+
githubPat: string;
|
|
61
|
+
force: boolean;
|
|
62
|
+
yes: boolean;
|
|
63
|
+
skipBootstrap: boolean;
|
|
64
|
+
}
|
|
65
|
+
export type ParseArgsOptions = ParsedArgs;
|
|
66
|
+
export interface SetupSelections {
|
|
67
|
+
targetDir?: string;
|
|
68
|
+
projectName?: string;
|
|
69
|
+
template?: string;
|
|
70
|
+
templateRepo?: string;
|
|
71
|
+
owner?: string;
|
|
72
|
+
appMode?: AppMode | string;
|
|
73
|
+
aiProviders?: string[];
|
|
74
|
+
providerProfiles?: string[];
|
|
75
|
+
githubRepositoryInput?: string;
|
|
76
|
+
githubProjectMode?: GithubProjectMode | string;
|
|
77
|
+
githubProjectTitle?: string;
|
|
78
|
+
githubAuthMode?: GithubAuthMode | string;
|
|
79
|
+
githubPat?: string;
|
|
80
|
+
githubRepository?: GithubRepositoryRef;
|
|
81
|
+
githubProject?: GithubProjectRef;
|
|
82
|
+
force?: boolean;
|
|
83
|
+
yes?: boolean;
|
|
84
|
+
skipBootstrap?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface InstallTemplateRepoOptions {
|
|
87
|
+
destinationRoot: string;
|
|
88
|
+
templateRepo: TemplateRepo;
|
|
89
|
+
setupSelections?: SetupSelections;
|
|
90
|
+
skipBootstrap?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface InstallTemplateRepoResult {
|
|
93
|
+
destinationRoot: string;
|
|
94
|
+
templateRepo: string;
|
|
95
|
+
executedSteps: string[];
|
|
96
|
+
nextSteps: string[];
|
|
97
|
+
}
|
|
98
|
+
export interface BootstrapTarget {
|
|
99
|
+
name: string;
|
|
100
|
+
dir: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ResolveGitHubOrchestrationResult {
|
|
103
|
+
githubRepository: GithubRepositoryRef;
|
|
104
|
+
githubProject: GithubProjectRef;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|