@orkestrel/scaffold 0.0.133 → 0.0.135
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/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +61 -96
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +48 -76
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +27 -66
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +31 -64
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +43 -57
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +43 -86
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +68 -104
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +35 -69
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +47 -84
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +134 -116
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +38 -90
- package/dist/agents/skills/orkestrel-harden/scripts/interleave.js +39 -103
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +40 -89
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +41 -87
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +43 -88
- package/dist/agents/skills/orkestrel-parallel/scripts/lane.js +1568 -213
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +40 -60
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +47 -81
- package/dist/agents/skills/orkestrel-publish/scripts/steps.js +66 -104
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +74 -88
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +387 -109
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +55 -96
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +54 -101
- package/dist/bin/main.js +275 -33
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +1 -1
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +81 -97
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +64 -72
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +41 -63
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +56 -79
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +61 -74
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +59 -89
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +87 -106
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +57 -76
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +73 -88
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +2 -2
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +167 -119
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +58 -75
- package/dist/host/agents/skills/orkestrel-harden/scripts/interleave.ts +55 -99
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +59 -90
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +60 -80
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +71 -108
- package/dist/host/agents/skills/orkestrel-parallel/scripts/lane.ts +1990 -274
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +28 -7
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +58 -79
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +66 -87
- package/dist/host/agents/skills/orkestrel-publish/scripts/steps.ts +84 -102
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +92 -99
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +483 -127
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +82 -120
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +85 -112
- package/dist/host/claude/agents/orkestrel.md +16 -16
- package/dist/host/claude/rules/architecture.md +1 -1
- package/dist/host/claude/rules/documentation.md +1 -1
- package/dist/host/claude/rules/patterns.md +7 -4
- package/dist/host/claude/rules/styles.md +1 -1
- package/dist/host/claude/rules/tests.md +3 -3
- package/dist/host/claude/rules/workspace.md +50 -37
- package/dist/host/configs/helpers.ts +117 -71
- package/dist/host/dotfiles/oxlintrc.json +6 -0
- package/dist/host/guides/agent.md +989 -395
- package/dist/host/guides/database.md +357 -342
- package/dist/host/guides/form.md +79 -4
- package/dist/host/guides/middleware.md +5 -5
- package/dist/host/guides/ollama.md +41 -42
- package/dist/host/guides/scaffold.md +170 -70
- package/dist/host/guides/study.md +12 -12
- package/dist/host/guides/table.md +20 -6
- package/dist/host/guides/test.md +166 -52
- package/dist/host/guides/toolbox.md +127 -81
- package/dist/host/guides/workspace.md +21 -14
- package/dist/host/manifest.json +54 -54
- package/dist/host/tests/config.test.ts +251 -7
- package/dist/host/tests/policy.test.ts +14 -21
- package/dist/host/tests/setupPolicy.ts +43 -36
- package/dist/src/core/index.cjs +533 -139
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +223 -16
- package/dist/src/core/index.d.ts +223 -16
- package/dist/src/core/index.js +524 -139
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +23 -14
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +3 -2
- package/dist/src/server/index.d.ts +3 -2
- package/dist/src/server/index.js +24 -15
- package/dist/src/server/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,84 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
// node .agents/skills/orkestrel-parallel/scripts/cases.ts --report FILE.json [--passed NAME ...] [--failed NAME ...]
|
|
3
|
-
// The report is Vitest's `--reporter=json` output. A name matches every case whose full name (its
|
|
4
|
-
// `describe` titles and its own title, joined by spaces) or whose own title equals it exactly; a name
|
|
5
|
-
// that opens with `--` cannot be given. Each `--passed NAME` requires every case it matches to have
|
|
6
|
-
// passed and each `--failed NAME` requires every one to have failed; a name that matches no case is
|
|
7
|
-
// missing. A failed case that no name matches is refused, so a run that fails more than the request
|
|
8
|
-
// expected reads as a difference. A test file that failed with no failed case (it did not collect,
|
|
9
|
-
// or a hook threw) is an unnamed failure named by its file, and a report whose `success` is false
|
|
10
|
-
// while no case and no file failed is a difference too. Name no case to require a report with no
|
|
11
|
-
// failure. Both flags repeat and a name may not be given to both. The script prints one summary
|
|
12
|
-
// line, one line per difference, and `ok` or `differences=N`. The script refuses a flag it does not
|
|
13
|
-
// read, the `--flag=value` form included, and names an unknown flag before a flag given with no
|
|
14
|
-
// value. Exit 0 when the report matches the names, 3 when it does not, 2 when the report cannot be
|
|
15
|
-
// read as a Vitest report, 64 on usage.
|
|
16
|
-
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, realpathSync, statSync } from 'node:fs';
|
|
17
2
|
import { relative } from 'node:path';
|
|
18
|
-
|
|
19
|
-
export const VALUE_FLAGS = ['--report', '--passed', '--failed'];
|
|
20
|
-
/** Lists every flag the script reads, value flags and switches alike. */
|
|
21
|
-
export const FLAGS = VALUE_FLAGS;
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
22
4
|
/** Holds the usage line printed when a call names no report. */
|
|
23
5
|
export const USAGE = 'usage: cases.ts --report FILE.json [--passed NAME ...] [--failed NAME ...]; --passed and --failed repeat';
|
|
6
|
+
/** Declares every flag the script reads, for `parseArgs`. */
|
|
7
|
+
export const OPTIONS = Object.freeze({
|
|
8
|
+
report: Object.freeze({ type: 'string' }),
|
|
9
|
+
passed: Object.freeze({ type: 'string', multiple: true }),
|
|
10
|
+
failed: Object.freeze({ type: 'string', multiple: true }),
|
|
11
|
+
});
|
|
24
12
|
/**
|
|
25
|
-
*
|
|
13
|
+
* Parses the arguments in strict mode against `OPTIONS`.
|
|
26
14
|
*
|
|
27
15
|
* @param argv - The arguments after the script path.
|
|
28
|
-
* @
|
|
29
|
-
* @returns Each named flag that appears last or is followed by another flag, in argument order.
|
|
16
|
+
* @returns The values and positionals, or the message `parseArgs` refused the arguments with.
|
|
30
17
|
*/
|
|
31
|
-
export function
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Names the flags a caller gave that the script does not read.
|
|
47
|
-
*
|
|
48
|
-
* @remarks
|
|
49
|
-
* A `--flag=value` argument is unknown, because the script reads no such form. A bare `--` ends the
|
|
50
|
-
* scan.
|
|
51
|
-
*
|
|
52
|
-
* @param argv - The arguments after the script path.
|
|
53
|
-
* @param flags - Every flag the script reads, value flags and switches alike.
|
|
54
|
-
* @returns Each argument that opens with `--` and is not a read flag, in argument order.
|
|
55
|
-
*/
|
|
56
|
-
export function readUnknownFlags(argv, flags) {
|
|
57
|
-
const end = argv.indexOf('--');
|
|
58
|
-
return (end === -1 ? argv : argv.slice(0, end)).filter((argument) => argument.startsWith('--') && !flags.includes(argument));
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Reads every value that follows a repeatable flag.
|
|
62
|
-
*
|
|
63
|
-
* @param argv - The arguments after the script path.
|
|
64
|
-
* @param name - The flag, such as `--passed`.
|
|
65
|
-
* @returns The values in order, empty when the flag never appears.
|
|
66
|
-
*/
|
|
67
|
-
export function readOptions(argv, name) {
|
|
68
|
-
return argv.flatMap((argument, index) => {
|
|
69
|
-
const value = argv[index + 1];
|
|
70
|
-
return argument === name && value !== undefined && !value.startsWith('--') ? [value] : [];
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Reads the arguments that are neither a flag nor the value of a value flag.
|
|
75
|
-
*
|
|
76
|
-
* @param argv - The arguments after the script path.
|
|
77
|
-
* @param valueFlags - The flags that take a value.
|
|
78
|
-
* @returns The positional arguments in order.
|
|
79
|
-
*/
|
|
80
|
-
export function readPositionals(argv, valueFlags) {
|
|
81
|
-
return argv.filter((argument, index) => !argument.startsWith('--') && !valueFlags.includes(argv[index - 1] ?? ''));
|
|
18
|
+
export function parseArguments(argv) {
|
|
19
|
+
try {
|
|
20
|
+
const { values, positionals } = parseArgs({
|
|
21
|
+
args: [...argv],
|
|
22
|
+
options: OPTIONS,
|
|
23
|
+
strict: true,
|
|
24
|
+
allowPositionals: false,
|
|
25
|
+
});
|
|
26
|
+
return { success: true, value: { values, positionals } };
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
30
|
+
}
|
|
82
31
|
}
|
|
83
32
|
/**
|
|
84
33
|
* Checks whether a value is a non-null, non-array object.
|
|
@@ -269,6 +218,17 @@ export function readReport(path) {
|
|
|
269
218
|
return undefined;
|
|
270
219
|
}
|
|
271
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Collects the strings a repeatable flag's value holds.
|
|
223
|
+
*
|
|
224
|
+
* @param value - The value `parseArgs` read for a flag declared with `multiple: true`.
|
|
225
|
+
* @returns Each string in order, empty when the flag never appears.
|
|
226
|
+
*/
|
|
227
|
+
export function collectStrings(value) {
|
|
228
|
+
return Array.isArray(value)
|
|
229
|
+
? value.filter((member) => typeof member === 'string')
|
|
230
|
+
: [];
|
|
231
|
+
}
|
|
272
232
|
/**
|
|
273
233
|
* Runs the script on its arguments.
|
|
274
234
|
*
|
|
@@ -277,21 +237,16 @@ export function readReport(path) {
|
|
|
277
237
|
* cannot be read as a Vitest report, 64 on usage.
|
|
278
238
|
*/
|
|
279
239
|
export function main(argv) {
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
console.error(`cases: ${
|
|
283
|
-
return 64;
|
|
284
|
-
}
|
|
285
|
-
const missing = readMissingFlags(argv, VALUE_FLAGS);
|
|
286
|
-
if (missing.length > 0) {
|
|
287
|
-
console.error(`cases: ${missing.join(', ')} given with no value`);
|
|
240
|
+
const parsed = parseArguments(argv);
|
|
241
|
+
if (!parsed.success) {
|
|
242
|
+
console.error(`cases: ${parsed.error}; ${USAGE}`);
|
|
288
243
|
return 64;
|
|
289
244
|
}
|
|
290
|
-
const
|
|
291
|
-
const path =
|
|
292
|
-
const passed =
|
|
293
|
-
const failed =
|
|
294
|
-
if (path === undefined
|
|
245
|
+
const { values } = parsed.value;
|
|
246
|
+
const path = typeof values.report === 'string' ? values.report : undefined;
|
|
247
|
+
const passed = collectStrings(values.passed);
|
|
248
|
+
const failed = collectStrings(values.failed);
|
|
249
|
+
if (path === undefined) {
|
|
295
250
|
console.error(USAGE);
|
|
296
251
|
return 64;
|
|
297
252
|
}
|
|
@@ -300,7 +255,7 @@ export function main(argv) {
|
|
|
300
255
|
console.error(`cases: ${both.map(quote).join(', ')} given to both --passed and --failed; ${USAGE}`);
|
|
301
256
|
return 64;
|
|
302
257
|
}
|
|
303
|
-
if (
|
|
258
|
+
if (statSync(path, { throwIfNoEntry: false })?.isFile() !== true) {
|
|
304
259
|
console.error(`cases: ${quote(path)} is not a readable file`);
|
|
305
260
|
return 2;
|
|
306
261
|
}
|