@punks/cli 2.1.6 → 2.1.7
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/AGENTS.md +2 -0
- package/README.md +1 -1
- package/dist/data/catalog/packs.ts +1 -1
- package/dist/data/hooks/format-edited-file.mjs +80 -8
- package/dist/data/hooks.test.ts +35 -1
- package/dist/data/scripts/sync-subagents.mjs +46 -0
- package/dist/index.js +190 -30
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -6,6 +6,8 @@ This app owns the `punks`/`dp` executable, repo detection flow, local scaffold a
|
|
|
6
6
|
|
|
7
7
|
Keep consumer-repo product logic out of the CLI. The future backend owns registry, provenance, auth, telemetry, and artifact access; the CLI remains the local scanner, cache, prompt/skill/hook placer, and filesystem writer.
|
|
8
8
|
|
|
9
|
+
When pushing a new npm executable release, update `CHANGELOG.md` first with a non-empty section for the exact `apps/cli/package.json` version. `bun run release:publish` must publish `@punks/cli`, push the matching `v<version>` tag, and create the GitHub release from that changelog entry. Baseline-only releases stay on `baseline/stable/*` and do not require package changelog entries.
|
|
10
|
+
|
|
9
11
|
For direct CLI UX, packaging, and release behavior guidance, inspect:
|
|
10
12
|
|
|
11
13
|
- `opensrc path cevr/sentry-cli` (`https://github.com/cevr/sentry-cli`)
|
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ bun run release:publish
|
|
|
92
92
|
|
|
93
93
|
`bun run baseline:publish` builds the current scaffold baseline, creates or updates the `baseline/stable/<date>-<sha>` GitHub release, and uploads the baseline manifest plus tarball. Use it when scaffold data changes but the npm executable does not need a new version.
|
|
94
94
|
|
|
95
|
-
`bun run release:publish` builds the CLI, publishes a sanitized npm package from the built `dist/` output, updates the `latest` dist-tag, also updates `next` for latest releases,
|
|
95
|
+
`bun run release:publish` builds the CLI, publishes a sanitized npm package from the built `dist/` output, updates the `latest` dist-tag, also updates `next` for latest releases, pushes the matching `v<version>` git tag, and creates the GitHub release from `CHANGELOG.md`. Commit the version bump and changelog entry before running it; the script refuses dirty worktrees, missing changelog entries, and existing tags that point at another commit. Set `NPM_TAG=beta` for beta prereleases without moving `latest`.
|
|
96
96
|
|
|
97
97
|
Before npm releases, authenticate against the public npm registry:
|
|
98
98
|
|
|
@@ -7,11 +7,25 @@ import path from "node:path";
|
|
|
7
7
|
import { spawnSync } from "node:child_process";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const javascriptFormattableSuffixes = new Set([
|
|
11
|
+
".ts",
|
|
12
|
+
".tsx",
|
|
13
|
+
".js",
|
|
14
|
+
".jsx",
|
|
15
|
+
".mjs",
|
|
16
|
+
".cjs",
|
|
17
|
+
".json",
|
|
18
|
+
]);
|
|
19
|
+
const javascriptLintableSuffixes = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
20
|
+
const pythonFormattableSuffixes = new Set([".py"]);
|
|
21
|
+
const formattableSuffixes = new Set([
|
|
22
|
+
...javascriptFormattableSuffixes,
|
|
23
|
+
...pythonFormattableSuffixes,
|
|
24
|
+
]);
|
|
12
25
|
const ignoredParts = new Set([".git", "node_modules", ".next", "dist"]);
|
|
13
26
|
const productRoots = new Set(["apps", "packages"]);
|
|
14
27
|
const packageManagers = new Set(["bun", "pnpm", "npm", "yarn"]);
|
|
28
|
+
const backendWorkspaceSegments = new Set(["api", "backend", "server", "services"]);
|
|
15
29
|
|
|
16
30
|
function readStdinJson() {
|
|
17
31
|
try {
|
|
@@ -69,10 +83,14 @@ function isLintablePath(relativePath) {
|
|
|
69
83
|
return (
|
|
70
84
|
parts.length > 0 &&
|
|
71
85
|
productRoots.has(parts[0]) &&
|
|
72
|
-
|
|
86
|
+
javascriptLintableSuffixes.has(path.extname(relativePath))
|
|
73
87
|
);
|
|
74
88
|
}
|
|
75
89
|
|
|
90
|
+
function isPythonPath(relativePath) {
|
|
91
|
+
return pythonFormattableSuffixes.has(path.extname(relativePath));
|
|
92
|
+
}
|
|
93
|
+
|
|
76
94
|
function runCommand(root, args, stdio = "ignore") {
|
|
77
95
|
const result = spawnSync(args[0], args.slice(1), {
|
|
78
96
|
cwd: root,
|
|
@@ -174,6 +192,60 @@ function toolCommand(root, tool, args) {
|
|
|
174
192
|
return ["npx", tool, ...args];
|
|
175
193
|
}
|
|
176
194
|
|
|
195
|
+
function nearestPythonProject(root, relativePath) {
|
|
196
|
+
const parts = relativePath.split("/");
|
|
197
|
+
|
|
198
|
+
for (let index = parts.length - 1; index > 0; index -= 1) {
|
|
199
|
+
const projectPath = parts.slice(0, index).join("/");
|
|
200
|
+
if (existsSync(path.join(root, projectPath, "pyproject.toml"))) {
|
|
201
|
+
return projectPath;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (parts.length >= 2 && productRoots.has(parts[0]) && backendWorkspaceSegments.has(parts[1])) {
|
|
206
|
+
return `${parts[0]}/${parts[1]}`;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return ".";
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function formatCommandForPath(root, relativePath) {
|
|
213
|
+
if (isPythonPath(relativePath)) {
|
|
214
|
+
return [
|
|
215
|
+
"uv",
|
|
216
|
+
"run",
|
|
217
|
+
"--project",
|
|
218
|
+
nearestPythonProject(root, relativePath),
|
|
219
|
+
"ruff",
|
|
220
|
+
"format",
|
|
221
|
+
relativePath,
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return toolCommand(root, "oxfmt", ["--write", relativePath]);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function lintCommandForPath(root, relativePath) {
|
|
229
|
+
if (isPythonPath(relativePath)) {
|
|
230
|
+
return [
|
|
231
|
+
"uv",
|
|
232
|
+
"run",
|
|
233
|
+
"--project",
|
|
234
|
+
nearestPythonProject(root, relativePath),
|
|
235
|
+
"ruff",
|
|
236
|
+
"check",
|
|
237
|
+
"--fix",
|
|
238
|
+
relativePath,
|
|
239
|
+
];
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (!isLintablePath(relativePath)) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return toolCommand(root, "oxlint", ["-c", ".oxlintrc.json", relativePath]);
|
|
247
|
+
}
|
|
248
|
+
|
|
177
249
|
function formatAndLintFiles(root, filePaths) {
|
|
178
250
|
const normalizedFiles = [];
|
|
179
251
|
|
|
@@ -189,7 +261,7 @@ function formatAndLintFiles(root, filePaths) {
|
|
|
189
261
|
const lintFailed = [];
|
|
190
262
|
|
|
191
263
|
for (const relativePath of normalizedFiles) {
|
|
192
|
-
const formattedOk = runCommand(root,
|
|
264
|
+
const formattedOk = runCommand(root, formatCommandForPath(root, relativePath)).ok;
|
|
193
265
|
|
|
194
266
|
if (!formattedOk) {
|
|
195
267
|
formatFailed.push(relativePath);
|
|
@@ -198,10 +270,8 @@ function formatAndLintFiles(root, filePaths) {
|
|
|
198
270
|
|
|
199
271
|
formatted.push(relativePath);
|
|
200
272
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
!runCommand(root, toolCommand(root, "oxlint", ["-c", ".oxlintrc.json", relativePath])).ok
|
|
204
|
-
) {
|
|
273
|
+
const lintCommand = lintCommandForPath(root, relativePath);
|
|
274
|
+
if (lintCommand !== null && !runCommand(root, lintCommand).ok) {
|
|
205
275
|
lintFailed.push(relativePath);
|
|
206
276
|
}
|
|
207
277
|
}
|
|
@@ -594,6 +664,8 @@ export const FormatAndLintPlugin = async ({ client, worktree }) => {
|
|
|
594
664
|
};
|
|
595
665
|
|
|
596
666
|
export const testHooks = {
|
|
667
|
+
formatCommandForPath,
|
|
668
|
+
lintCommandForPath,
|
|
597
669
|
toolCommand,
|
|
598
670
|
};
|
|
599
671
|
|
package/dist/data/hooks.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
@@ -12,6 +12,11 @@ type HookModule = {
|
|
|
12
12
|
tool: string,
|
|
13
13
|
args: ReadonlyArray<string>,
|
|
14
14
|
) => ReadonlyArray<string>;
|
|
15
|
+
readonly formatCommandForPath?: (root: string, relativePath: string) => ReadonlyArray<string>;
|
|
16
|
+
readonly lintCommandForPath?: (
|
|
17
|
+
root: string,
|
|
18
|
+
relativePath: string,
|
|
19
|
+
) => ReadonlyArray<string> | null;
|
|
15
20
|
};
|
|
16
21
|
};
|
|
17
22
|
|
|
@@ -24,6 +29,7 @@ const tempRepo = (files: Record<string, string>) => {
|
|
|
24
29
|
const root = mkdtempSync(path.join(tmpdir(), "dp-hook-test-"));
|
|
25
30
|
|
|
26
31
|
for (const [filePath, content] of Object.entries(files)) {
|
|
32
|
+
mkdirSync(path.dirname(path.join(root, filePath)), { recursive: true });
|
|
27
33
|
writeFileSync(path.join(root, filePath), content);
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -55,4 +61,32 @@ describe("scaffolded hooks", () => {
|
|
|
55
61
|
),
|
|
56
62
|
).toEqual(["pnpm", "exec", "oxlint", "-c", ".oxlintrc.json", "src/index.ts"]);
|
|
57
63
|
});
|
|
64
|
+
|
|
65
|
+
it("routes Python backend files through Ruff in their project", async () => {
|
|
66
|
+
const { testHooks } = await loadHookModule("format-edited-file.mjs");
|
|
67
|
+
const root = tempRepo({
|
|
68
|
+
"apps/backend/pyproject.toml": '[project]\nname = "backend"\n',
|
|
69
|
+
"apps/backend/main.py": "print('hi')\n",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
expect(testHooks.formatCommandForPath?.(root, "apps/backend/main.py")).toEqual([
|
|
73
|
+
"uv",
|
|
74
|
+
"run",
|
|
75
|
+
"--project",
|
|
76
|
+
"apps/backend",
|
|
77
|
+
"ruff",
|
|
78
|
+
"format",
|
|
79
|
+
"apps/backend/main.py",
|
|
80
|
+
]);
|
|
81
|
+
expect(testHooks.lintCommandForPath?.(root, "apps/backend/main.py")).toEqual([
|
|
82
|
+
"uv",
|
|
83
|
+
"run",
|
|
84
|
+
"--project",
|
|
85
|
+
"apps/backend",
|
|
86
|
+
"ruff",
|
|
87
|
+
"check",
|
|
88
|
+
"--fix",
|
|
89
|
+
"apps/backend/main.py",
|
|
90
|
+
]);
|
|
91
|
+
});
|
|
58
92
|
});
|
|
@@ -40,6 +40,7 @@ const opencodeDir = path.join(repoRoot, ".opencode");
|
|
|
40
40
|
const opencodeAgentsDir = path.join(opencodeDir, "agents");
|
|
41
41
|
const opencodePluginsDir = path.join(opencodeDir, "plugins");
|
|
42
42
|
const opencodeAgentsMirrorPath = path.join(opencodeDir, "AGENTS.md");
|
|
43
|
+
const opencodeConfigPath = path.join(repoRoot, "opencode.json");
|
|
43
44
|
|
|
44
45
|
const managedHeader = [
|
|
45
46
|
"# Generated by scripts/sync-subagents.mjs.",
|
|
@@ -124,6 +125,44 @@ function buildCursorHooksConfig({ hasFormatHook }) {
|
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
function buildOpenCodeConfig(existingConfig, { hasFormatHook }) {
|
|
129
|
+
const config = { ...existingConfig };
|
|
130
|
+
|
|
131
|
+
if (hasFormatHook) {
|
|
132
|
+
config.plugin = [
|
|
133
|
+
...new Set([
|
|
134
|
+
...(Array.isArray(config.plugin) ? config.plugin : []),
|
|
135
|
+
"./.opencode/plugins/format-edited-file.mjs",
|
|
136
|
+
]),
|
|
137
|
+
];
|
|
138
|
+
config.formatter = {
|
|
139
|
+
...(typeof config.formatter === "object" && config.formatter !== null
|
|
140
|
+
? config.formatter
|
|
141
|
+
: {}),
|
|
142
|
+
"harness-format-edited-file": {
|
|
143
|
+
command: ["node", ".agents/hooks/format-edited-file.mjs", "files", "$FILE"],
|
|
144
|
+
extensions: [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs", ".json", ".py"],
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
$schema: "https://opencode.ai/config.json",
|
|
151
|
+
...config,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function readJsonFile(filePath) {
|
|
156
|
+
try {
|
|
157
|
+
return JSON.parse(await readFile(filePath, "utf8"));
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
127
166
|
function getSkillNames(agent) {
|
|
128
167
|
if (Array.isArray(agent.skills)) {
|
|
129
168
|
return [...new Set(agent.skills)];
|
|
@@ -400,6 +439,13 @@ async function main() {
|
|
|
400
439
|
"utf8",
|
|
401
440
|
);
|
|
402
441
|
await writeFile(cursorHooksJsonPath, encodeJson(buildCursorHooksConfig(availableHooks)), "utf8");
|
|
442
|
+
if (availableHooks.hasFormatHook || (await pathExists(opencodeConfigPath))) {
|
|
443
|
+
await writeFile(
|
|
444
|
+
opencodeConfigPath,
|
|
445
|
+
encodeJson(buildOpenCodeConfig(await readJsonFile(opencodeConfigPath), availableHooks)),
|
|
446
|
+
"utf8",
|
|
447
|
+
);
|
|
448
|
+
}
|
|
403
449
|
await writeManagedFiles(claudeAgentsDir, "md", claudeFiles);
|
|
404
450
|
await writeManagedFiles(codexAgentsDir, "toml", codexFiles);
|
|
405
451
|
await writeManagedFiles(cursorAgentsDir, "md", cursorFiles);
|
package/dist/index.js
CHANGED
|
@@ -52337,8 +52337,7 @@ class ProjectUsageSummary extends exports_Schema.Class("ProjectUsageSummary")({
|
|
|
52337
52337
|
}
|
|
52338
52338
|
|
|
52339
52339
|
class ProjectUsageList extends exports_Schema.Class("ProjectUsageList")({
|
|
52340
|
-
projects: exports_Schema.Array(ProjectUsageSummary)
|
|
52341
|
-
reports: exports_Schema.Array(HarnessReportSummary)
|
|
52340
|
+
projects: exports_Schema.Array(ProjectUsageSummary)
|
|
52342
52341
|
}) {
|
|
52343
52342
|
}
|
|
52344
52343
|
|
|
@@ -52407,7 +52406,7 @@ var recordProductTelemetryEvent = (options9) => exports_Effect.gen(function* ()
|
|
|
52407
52406
|
|
|
52408
52407
|
// package.json
|
|
52409
52408
|
var name = "@punks/cli";
|
|
52410
|
-
var version = "2.1.
|
|
52409
|
+
var version = "2.1.7";
|
|
52411
52410
|
// src/telemetry/product.ts
|
|
52412
52411
|
var git = (cwd, args2) => {
|
|
52413
52412
|
try {
|
|
@@ -53565,7 +53564,7 @@ var packCatalog = [
|
|
|
53565
53564
|
"python-testing-patterns"
|
|
53566
53565
|
],
|
|
53567
53566
|
lintAssets: [],
|
|
53568
|
-
hooks: [],
|
|
53567
|
+
hooks: ["format-edited-file"],
|
|
53569
53568
|
promptSurfaces: [],
|
|
53570
53569
|
promptDetails: []
|
|
53571
53570
|
},
|
|
@@ -54498,6 +54497,156 @@ var localMultiSelect = (options9) => {
|
|
|
54498
54497
|
return exports_Prompt.run(prompt4).pipe(exports_Effect.map((values4) => values4.toSorted()));
|
|
54499
54498
|
};
|
|
54500
54499
|
|
|
54500
|
+
// src/scaffold/single-select.ts
|
|
54501
|
+
var Action3 = taggedEnum();
|
|
54502
|
+
var figures3 = {
|
|
54503
|
+
arrowUp: text3("\u2191"),
|
|
54504
|
+
arrowDown: text3("\u2193"),
|
|
54505
|
+
bullet: text3("\u25C7"),
|
|
54506
|
+
pointer: text3("\u25C6"),
|
|
54507
|
+
stem: text3("\u2502"),
|
|
54508
|
+
tick: text3("\u25C6")
|
|
54509
|
+
};
|
|
54510
|
+
var eraseText3 = (text12, columns) => {
|
|
54511
|
+
if (columns === 0) {
|
|
54512
|
+
return cat2(eraseLine3, cursorTo3(0));
|
|
54513
|
+
}
|
|
54514
|
+
let rows = 0;
|
|
54515
|
+
for (const line4 of text12.split(/\r?\n/u)) {
|
|
54516
|
+
rows += 1 + Math.floor(Math.max(line4.length - 1, 0) / columns);
|
|
54517
|
+
}
|
|
54518
|
+
return eraseLines3(rows);
|
|
54519
|
+
};
|
|
54520
|
+
var entriesToDisplay3 = (cursor, total, maxVisible) => {
|
|
54521
|
+
let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
|
|
54522
|
+
if (startIndex < 0) {
|
|
54523
|
+
startIndex = 0;
|
|
54524
|
+
}
|
|
54525
|
+
const endIndex = Math.min(startIndex + maxVisible, total);
|
|
54526
|
+
return { startIndex, endIndex };
|
|
54527
|
+
};
|
|
54528
|
+
var renderOutput9 = (message) => {
|
|
54529
|
+
const lines3 = message.split(/\r?\n/u);
|
|
54530
|
+
const [firstLine, ...rest] = lines3;
|
|
54531
|
+
return vsep2([
|
|
54532
|
+
annotate2(figures3.bullet, cyanBright2).pipe(cat2(space2), cat2(annotate2(text3(firstLine ?? ""), bold2))),
|
|
54533
|
+
...rest.map((line4) => annotate2(figures3.stem, blackBright2).pipe(cat2(space2), cat2(space2), cat2(text3(line4)))),
|
|
54534
|
+
annotate2(figures3.stem, blackBright2).pipe(cat2(space2), cat2(space2))
|
|
54535
|
+
]);
|
|
54536
|
+
};
|
|
54537
|
+
var withStem2 = (prefix) => prefix.pipe(cat2(space2), cat2(space2));
|
|
54538
|
+
var renderChoiceDescription4 = (choice4, isHighlighted) => choice4.description && isHighlighted ? char3("-").pipe(cat2(space2), cat2(text3(choice4.description)), annotate2(blackBright2)) : empty38;
|
|
54539
|
+
var renderChoices4 = (state, options9) => {
|
|
54540
|
+
const toDisplay = entriesToDisplay3(state.index, options9.choices.length, options9.maxPerPage);
|
|
54541
|
+
const documents = [];
|
|
54542
|
+
for (let index = toDisplay.startIndex;index < toDisplay.endIndex; index++) {
|
|
54543
|
+
const choice4 = options9.choices[index];
|
|
54544
|
+
const isHighlighted = state.index === index;
|
|
54545
|
+
let prefix = space2;
|
|
54546
|
+
if (index === toDisplay.startIndex && toDisplay.startIndex > 0) {
|
|
54547
|
+
prefix = figures3.arrowUp;
|
|
54548
|
+
} else if (index === toDisplay.endIndex - 1 && toDisplay.endIndex < options9.choices.length) {
|
|
54549
|
+
prefix = figures3.arrowDown;
|
|
54550
|
+
} else if (isHighlighted) {
|
|
54551
|
+
prefix = figures3.pointer;
|
|
54552
|
+
} else {
|
|
54553
|
+
prefix = figures3.stem;
|
|
54554
|
+
}
|
|
54555
|
+
const title = isHighlighted ? annotate2(text3(choice4.title), cyanBright2) : text3(choice4.title);
|
|
54556
|
+
const description = renderChoiceDescription4(choice4, isHighlighted);
|
|
54557
|
+
documents.push(withStem2(prefix).pipe(cat2(title), cat2(space2), cat2(description)));
|
|
54558
|
+
}
|
|
54559
|
+
return vsep2(documents);
|
|
54560
|
+
};
|
|
54561
|
+
var visiblePromptLines2 = (message) => {
|
|
54562
|
+
const lines3 = message.split(/\r?\n/u);
|
|
54563
|
+
const [firstLine, ...rest] = lines3;
|
|
54564
|
+
return [`\u25C7 ${firstLine ?? ""}`, ...rest.map((line4) => `\u2502 ${line4}`), "\u2502 "];
|
|
54565
|
+
};
|
|
54566
|
+
var visibleChoiceLines2 = (state, options9) => {
|
|
54567
|
+
const toDisplay = entriesToDisplay3(state.index, options9.choices.length, options9.maxPerPage);
|
|
54568
|
+
const lines3 = [];
|
|
54569
|
+
for (let index = toDisplay.startIndex;index < toDisplay.endIndex; index++) {
|
|
54570
|
+
const choice4 = options9.choices[index];
|
|
54571
|
+
let prefix = " ";
|
|
54572
|
+
if (index === toDisplay.startIndex && toDisplay.startIndex > 0) {
|
|
54573
|
+
prefix = "\u2191";
|
|
54574
|
+
} else if (index === toDisplay.endIndex - 1 && toDisplay.endIndex < options9.choices.length) {
|
|
54575
|
+
prefix = "\u2193";
|
|
54576
|
+
} else if (state.index === index) {
|
|
54577
|
+
prefix = "\u25C6";
|
|
54578
|
+
} else {
|
|
54579
|
+
prefix = "\u2502";
|
|
54580
|
+
}
|
|
54581
|
+
const description = choice4.description && state.index === index ? ` - ${choice4.description}` : "";
|
|
54582
|
+
lines3.push(`${prefix} ${choice4.title} ${description}`);
|
|
54583
|
+
}
|
|
54584
|
+
return lines3;
|
|
54585
|
+
};
|
|
54586
|
+
var visibleFrameText2 = (state, options9) => [...visiblePromptLines2(options9.message), ...visibleChoiceLines2(state, options9)].join(`
|
|
54587
|
+
`);
|
|
54588
|
+
var renderNextFrame10 = (state, options9) => exports_Effect.gen(function* () {
|
|
54589
|
+
const terminal = yield* Terminal;
|
|
54590
|
+
const columns = yield* terminal.columns;
|
|
54591
|
+
return cursorHide3.pipe(cat2(renderOutput9(options9.message)), cat2(hardLine2), cat2(renderChoices4(state, options9)), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54592
|
+
});
|
|
54593
|
+
var renderSubmission10 = (state, options9) => exports_Effect.gen(function* () {
|
|
54594
|
+
const terminal = yield* Terminal;
|
|
54595
|
+
const columns = yield* terminal.columns;
|
|
54596
|
+
const selected = options9.choices[state.index];
|
|
54597
|
+
return renderOutput9(options9.message).pipe(cat2(annotate2(figures3.tick, green3)), cat2(space2), cat2(annotate2(text3(selected.title), white3)), cat2(hardLine2), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54598
|
+
});
|
|
54599
|
+
var clearPrompt2 = (state, options9) => exports_Effect.gen(function* () {
|
|
54600
|
+
const terminal = yield* Terminal;
|
|
54601
|
+
const columns = yield* terminal.columns;
|
|
54602
|
+
return eraseText3(visibleFrameText2(state, options9), columns).pipe(cat2(eraseLine3), cat2(cursorLeft3), optimize3(Deep), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54603
|
+
});
|
|
54604
|
+
var localSingleSelect = (options9) => {
|
|
54605
|
+
const defaultIndex = Math.max(0, options9.choices.findIndex((choice4) => choice4.value === options9.defaultValue));
|
|
54606
|
+
const resolvedOptions = {
|
|
54607
|
+
defaultValue: options9.choices[defaultIndex]?.value ?? "",
|
|
54608
|
+
maxPerPage: 10,
|
|
54609
|
+
...options9
|
|
54610
|
+
};
|
|
54611
|
+
const prompt4 = exports_Prompt.custom({
|
|
54612
|
+
index: defaultIndex
|
|
54613
|
+
}, {
|
|
54614
|
+
render: (state, action) => Action3.$match(action, {
|
|
54615
|
+
Beep: () => exports_Effect.succeed(render3(beep3, { style: "pretty" })),
|
|
54616
|
+
NextFrame: ({ state: state2 }) => renderNextFrame10(state2, resolvedOptions),
|
|
54617
|
+
Submit: () => renderSubmission10(state, resolvedOptions)
|
|
54618
|
+
}),
|
|
54619
|
+
process: (input, state) => {
|
|
54620
|
+
switch (input.key.name) {
|
|
54621
|
+
case "k":
|
|
54622
|
+
case "up":
|
|
54623
|
+
return exports_Effect.succeed(Action3.NextFrame({
|
|
54624
|
+
state: {
|
|
54625
|
+
index: state.index === 0 ? resolvedOptions.choices.length - 1 : state.index - 1
|
|
54626
|
+
}
|
|
54627
|
+
}));
|
|
54628
|
+
case "j":
|
|
54629
|
+
case "down":
|
|
54630
|
+
case "tab":
|
|
54631
|
+
return exports_Effect.succeed(Action3.NextFrame({
|
|
54632
|
+
state: {
|
|
54633
|
+
index: (state.index + 1) % resolvedOptions.choices.length
|
|
54634
|
+
}
|
|
54635
|
+
}));
|
|
54636
|
+
case "enter":
|
|
54637
|
+
case "return":
|
|
54638
|
+
return exports_Effect.succeed(Action3.Submit({
|
|
54639
|
+
value: resolvedOptions.choices[state.index].value
|
|
54640
|
+
}));
|
|
54641
|
+
default:
|
|
54642
|
+
return exports_Effect.succeed(Action3.Beep());
|
|
54643
|
+
}
|
|
54644
|
+
},
|
|
54645
|
+
clear: (state) => clearPrompt2(state, resolvedOptions)
|
|
54646
|
+
});
|
|
54647
|
+
return exports_Prompt.run(prompt4);
|
|
54648
|
+
};
|
|
54649
|
+
|
|
54501
54650
|
// src/scaffold/prompt.ts
|
|
54502
54651
|
var isPromptQuitSignal = (cause3) => typeof cause3 === "object" && cause3 !== null && ("name" in cause3) && cause3.name === "QuitException";
|
|
54503
54652
|
var restoreLineInput = (readline2) => {
|
|
@@ -54526,6 +54675,14 @@ var PromptLive = exports_Effect.acquireRelease(exports_Effect.sync(() => createI
|
|
|
54526
54675
|
cause: cause3,
|
|
54527
54676
|
message: "Failed to read checklist input."
|
|
54528
54677
|
}))),
|
|
54678
|
+
singleSelect: ({ message, choices, defaultValue }) => exports_Effect.sync(() => readline2.pause()).pipe(exports_Effect.zipRight(localSingleSelect({
|
|
54679
|
+
message,
|
|
54680
|
+
choices,
|
|
54681
|
+
...defaultValue ? { defaultValue } : {}
|
|
54682
|
+
})), exports_Effect.ensuring(exports_Effect.sync(() => restoreLineInput(readline2))), exports_Effect.mapError((cause3) => new CliPromptError({
|
|
54683
|
+
cause: cause3,
|
|
54684
|
+
message: "Failed to read selection input."
|
|
54685
|
+
}))),
|
|
54529
54686
|
writeLine: (line4) => exports_Effect.async((resume2) => {
|
|
54530
54687
|
output.write(`${line4}
|
|
54531
54688
|
`, () => {
|
|
@@ -56425,7 +56582,8 @@ var writeScaffoldOutput = ({
|
|
|
56425
56582
|
const finalSkills = selectedSkills(finalPacks, baseline);
|
|
56426
56583
|
const hasOxlint = detectionHasPackage(detection, "oxlint");
|
|
56427
56584
|
const hasOxfmt = detectionHasPackage(detection, "oxfmt");
|
|
56428
|
-
const
|
|
56585
|
+
const hasPython = detection.detectedLanguages.includes("python");
|
|
56586
|
+
const finalHookIds = selectedHookIds(finalPacks, baseline).filter((hookId) => hookId !== "format-edited-file" || hasOxfmt || hasPython);
|
|
56429
56587
|
const lintAssets = hasOxlint ? resolveLintAssetsForPacks(finalPacks, baseline) : [];
|
|
56430
56588
|
const lintAssetIdsByPack = Object.fromEntries(finalPacks.map((packId) => [
|
|
56431
56589
|
packId,
|
|
@@ -56574,6 +56732,9 @@ var writeScaffoldOutput = ({
|
|
|
56574
56732
|
stdio: "ignore"
|
|
56575
56733
|
});
|
|
56576
56734
|
harnessFiles.push(...collectRelativeFiles(outputDirectory, ".claude"), ...collectRelativeFiles(outputDirectory, ".codex"), ...collectRelativeFiles(outputDirectory, ".cursor"), ...collectRelativeFiles(outputDirectory, ".opencode"));
|
|
56735
|
+
if (existsSync5(path10.join(outputDirectory, "opencode.json"))) {
|
|
56736
|
+
harnessFiles.push("opencode.json");
|
|
56737
|
+
}
|
|
56577
56738
|
generatedFiles.push(...harnessFiles);
|
|
56578
56739
|
const requiredToolsFile = ".devpunks/required-tools.json";
|
|
56579
56740
|
generatedFiles.push(writeArtifact({
|
|
@@ -58137,34 +58298,33 @@ var backlogProviderLabels2 = {
|
|
|
58137
58298
|
linear: "Linear",
|
|
58138
58299
|
monday: "monday.com"
|
|
58139
58300
|
};
|
|
58140
|
-
var backlogProviderAliases = {
|
|
58141
|
-
"1": "github",
|
|
58142
|
-
"2": "linear",
|
|
58143
|
-
"3": "azure-devops",
|
|
58144
|
-
"4": "monday",
|
|
58145
|
-
ado: "azure-devops",
|
|
58146
|
-
azure: "azure-devops",
|
|
58147
|
-
"azure devops": "azure-devops",
|
|
58148
|
-
"azure-devops": "azure-devops",
|
|
58149
|
-
gh: "github",
|
|
58150
|
-
github: "github",
|
|
58151
|
-
"github projects": "github",
|
|
58152
|
-
linear: "linear",
|
|
58153
|
-
monday: "monday",
|
|
58154
|
-
"monday.com": "monday"
|
|
58155
|
-
};
|
|
58156
|
-
var parseBacklogProvider = (value6) => backlogProviderAliases[value6.trim().toLowerCase()] ?? null;
|
|
58157
58301
|
var promptBacklogProvider = ({
|
|
58158
58302
|
prompt: prompt4
|
|
58159
58303
|
}) => exports_Effect.gen(function* () {
|
|
58160
|
-
const answer = yield* prompt4.
|
|
58161
|
-
|
|
58162
|
-
|
|
58163
|
-
|
|
58164
|
-
|
|
58165
|
-
|
|
58166
|
-
|
|
58167
|
-
|
|
58304
|
+
const answer = yield* prompt4.singleSelect({
|
|
58305
|
+
message: "Select backlog provider",
|
|
58306
|
+
defaultValue: "github",
|
|
58307
|
+
choices: [
|
|
58308
|
+
{
|
|
58309
|
+
title: "GitHub Projects and Issues",
|
|
58310
|
+
value: "github",
|
|
58311
|
+
description: "default"
|
|
58312
|
+
},
|
|
58313
|
+
{
|
|
58314
|
+
title: "Linear",
|
|
58315
|
+
value: "linear"
|
|
58316
|
+
},
|
|
58317
|
+
{
|
|
58318
|
+
title: "Azure DevOps",
|
|
58319
|
+
value: "azure-devops"
|
|
58320
|
+
},
|
|
58321
|
+
{
|
|
58322
|
+
title: "monday.com",
|
|
58323
|
+
value: "monday"
|
|
58324
|
+
}
|
|
58325
|
+
]
|
|
58326
|
+
});
|
|
58327
|
+
return answer;
|
|
58168
58328
|
});
|
|
58169
58329
|
var renderBacklogProviderMarkdown = (provider) => `# Backlog Provider
|
|
58170
58330
|
|