@orkestrel/scaffold 0.0.19 → 0.0.21

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 (31) hide show
  1. package/dist/bin/scaffold.js +15 -9
  2. package/dist/bin/scaffold.js.map +1 -1
  3. package/dist/host/CLAUDE.md +51 -24
  4. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +69 -59
  5. package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +2 -2
  6. package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +82 -0
  7. package/dist/host/claude/agents/application.md +34 -0
  8. package/dist/host/claude/agents/codex.md +7 -0
  9. package/dist/host/claude/agents/orkestrel.md +3 -3
  10. package/dist/host/claude/agents/researcher.md +31 -0
  11. package/dist/host/claude/agents/reviewer.md +5 -0
  12. package/dist/host/claude/agents/scout.md +25 -0
  13. package/dist/host/claude/rules/quality.md +10 -0
  14. package/dist/host/claude/rules/tests.md +10 -0
  15. package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -1
  16. package/dist/host/codex/agents/analyst.toml +5 -1
  17. package/dist/host/codex/agents/application.toml +23 -0
  18. package/dist/host/codex/agents/researcher.toml +22 -0
  19. package/dist/host/codex/agents/reviewer.toml +3 -1
  20. package/dist/host/codex/agents/scout.toml +18 -0
  21. package/dist/host/codex/config.toml +15 -6
  22. package/dist/host/guides/src/scaffold.md +120 -29
  23. package/dist/host/manifest.json +35 -0
  24. package/dist/host/tests/setupPolicy.ts +49 -11
  25. package/dist/src/core/index.cjs +1661 -856
  26. package/dist/src/core/index.cjs.map +1 -1
  27. package/dist/src/core/index.d.cts +84 -7
  28. package/dist/src/core/index.d.ts +84 -7
  29. package/dist/src/core/index.js +1656 -857
  30. package/dist/src/core/index.js.map +1 -1
  31. package/package.json +4 -2
@@ -41,12 +41,18 @@ export declare function alignTable(header: readonly string[], rows: readonly (re
41
41
  /** Additional development dependencies required by a private Vue browser application. */
42
42
  export declare const APP_BROWSER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
43
43
 
44
+ /** Baseline development dependency required by every private application environment. */
45
+ export declare const APP_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
46
+
44
47
  /**
45
48
  * The per-environment application matrix: thin config artifacts, Vitest project
46
49
  * label, and executable entry where the environment produces a runtime bundle.
47
50
  */
48
51
  export declare const APP_MATRIX: Readonly<Record<Environment, AppDefinition>>;
49
52
 
53
+ /** Additional development dependencies required by a private server application. */
54
+ export declare const APP_SERVER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
55
+
50
56
  /** The deterministic config, test-project, and runtime-entry settings for one application environment. */
51
57
  export declare interface AppDefinition {
52
58
  readonly configs: readonly string[];
@@ -58,9 +64,16 @@ export declare interface AppDefinition {
58
64
  * Draft the application source artifacts for every selected app environment.
59
65
  *
60
66
  * @param spec - The blueprint carrying the application environment set.
67
+ * @remarks
68
+ * Two conditional shapes layer over the per-environment set. The health contract —
69
+ * record, route constants, guard, and the one unknown-to-typed read — is declared by
70
+ * `app/server` while the server alone reads it and RELOCATES to `app/core` the moment
71
+ * the browser reads it too, because a contract two hosts share belongs to neither of
72
+ * them. The showcase entry pair, its seeder, and its factory appear only for a
73
+ * blueprint that declares the physical showcase wrapper alongside `app/browser`.
61
74
  * @returns Complete, runnable app/core, app/browser, and app/server artifacts.
62
75
  */
63
- export declare function applicationArtifacts(spec: Blueprint): readonly Artifact[];
76
+ export declare function applicationArtifacts(spec: Pick<Blueprint, 'name' | 'app' | 'showcase'>): readonly Artifact[];
64
77
 
65
78
  /**
66
79
  * Build the root Vite/Vitest configuration for a workspace that includes
@@ -341,7 +354,11 @@ export declare function blueprintShape(): ObjectShape<{
341
354
  * @remarks
342
355
  * Published source environments receive the canonical entity/type/factory/constant
343
356
  * inventory. Application environments receive their exact public declaration kinds,
344
- * including parsers, guards, handlers, errors, and runners where present.
357
+ * including parsers, guards, handlers, errors, and runners where present. Two groups
358
+ * move rather than duplicate: the health contract is declared against `app/server`
359
+ * while the server alone reads it and against `app/core` once the browser reads it
360
+ * too, and the showcase seed, factory, and root-view identity appear only for a
361
+ * blueprint whose showcase accompanies `app/browser`.
345
362
  * @returns The declared `Member[]`, one set per environment.
346
363
  *
347
364
  * @example
@@ -647,6 +664,18 @@ export declare function computeHash(text: string): string;
647
664
  */
648
665
  export declare function configArtifacts(spec: Blueprint): readonly Artifact[];
649
666
 
667
+ /**
668
+ * Build the standalone Node-only root-configuration Vitest project.
669
+ *
670
+ * @returns The emitted `config` project definition.
671
+ *
672
+ * @example
673
+ * ```ts
674
+ * configViteProject().includes("label: 'config'") // true
675
+ * ```
676
+ */
677
+ export declare function configViteProject(): string;
678
+
650
679
  /** Constant-declaration token kept out of template literals consumed by parity scans. */
651
680
  export declare const CONST_KEYWORD = "const";
652
681
 
@@ -1202,6 +1231,32 @@ export declare function coreViteConfig(): string;
1202
1231
  */
1203
1232
  export declare function guideUsage(spec: Blueprint, pascal: string): string;
1204
1233
 
1234
+ /**
1235
+ * Determine whether an application blueprint spans the shared browser/server boundary.
1236
+ *
1237
+ * @param spec - The blueprint to inspect.
1238
+ * @returns True only when app/core, app/browser, and app/server are all selected.
1239
+ *
1240
+ * @example
1241
+ * ```ts
1242
+ * hasApplicationBoundary(blueprint('application', { app: ['core', 'browser', 'server'] }))
1243
+ * ```
1244
+ */
1245
+ export declare function hasApplicationBoundary(spec: Pick<Blueprint, 'app'>): boolean;
1246
+
1247
+ /**
1248
+ * Determine whether an application blueprint emits its browser showcase.
1249
+ *
1250
+ * @param spec - The blueprint to inspect.
1251
+ * @returns True only when showcase intent accompanies app/browser.
1252
+ *
1253
+ * @example
1254
+ * ```ts
1255
+ * hasApplicationShowcase(blueprint('application', { app: ['browser'], showcase: true }))
1256
+ * ```
1257
+ */
1258
+ export declare function hasApplicationShowcase(spec: Pick<Blueprint, 'app' | 'showcase'>): boolean;
1259
+
1205
1260
  /**
1206
1261
  * Whether a structurally valid blueprint selects at least one source or app environment.
1207
1262
  *
@@ -2196,6 +2251,28 @@ export declare function coreViteConfig(): string;
2196
2251
  */
2197
2252
  export declare function renderObject(entry: Readonly<Record<string, unknown>>, indent: string): string;
2198
2253
 
2254
+ /**
2255
+ * Render a single-quoted TypeScript string array literal through `oxfmt`'s
2256
+ * inline-or-broken rule — inline when the rendered width fits
2257
+ * `JSON_PRINT_WIDTH`, one item per line with a trailing comma on every line
2258
+ * (including the last) otherwise, matching `.oxfmtrc.json`'s
2259
+ * `trailingComma: "all"` for non-JSON files.
2260
+ *
2261
+ * @param entries - The array's string elements, in order.
2262
+ * @param indent - The current indentation prefix.
2263
+ * @param prefix - The text already emitted on this line before the array.
2264
+ * @param suffix - The text that will follow the array on this line.
2265
+ * @returns The rendered array fragment (no trailing newline).
2266
+ *
2267
+ * @example
2268
+ * ```ts
2269
+ * import { renderStringArray } from '@orkestrel/scaffold'
2270
+ *
2271
+ * renderStringArray(['app', 'guides', 'tests'], '', '', '') // "['app', 'guides', 'tests']"
2272
+ * ```
2273
+ */
2274
+ export declare function renderStringArray(entries: readonly string[], indent: string, prefix: string, suffix: string): string;
2275
+
2199
2276
  /**
2200
2277
  * Render one JSON value through `formatJson`'s dispatch — arrays via
2201
2278
  * `renderArray`, objects via `renderObject`, everything else via
@@ -2279,7 +2356,7 @@ export declare function coreViteConfig(): string;
2279
2356
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2280
2357
 
2281
2358
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2282
- export declare const SCAFFOLD_RANGE = "^0.0.19";
2359
+ export declare const SCAFFOLD_RANGE = "^0.0.21";
2283
2360
 
2284
2361
  /**
2285
2362
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2431,7 +2508,7 @@ export declare function coreViteConfig(): string;
2431
2508
  * factory per environment (AGENTS §5's per-environment centralized-file pattern), so
2432
2509
  * every environment gets the same uniform stub shape.
2433
2510
  *
2434
- * @param spec - The `Blueprint` to derive source stubs from.
2511
+ * @param spec - The blueprint carrying the declared source environment set.
2435
2512
  * @param pascal - The package's PascalCase entity name.
2436
2513
  * @returns The `source` group's `Artifact[]`.
2437
2514
  *
@@ -2440,7 +2517,7 @@ export declare function coreViteConfig(): string;
2440
2517
  * sourceArtifacts(blueprint('router'), 'Router').length // 4
2441
2518
  * ```
2442
2519
  */
2443
- export declare function sourceArtifacts(spec: Blueprint, pascal: string): readonly Artifact[];
2520
+ export declare function sourceArtifacts(spec: Pick<Blueprint, 'src'>, pascal: string): readonly Artifact[];
2444
2521
 
2445
2522
  /**
2446
2523
  * Split one rendered GFM table row into its trimmed cell strings.
@@ -2841,7 +2918,7 @@ export declare function coreViteConfig(): string;
2841
2918
  * Render the one ordered proof and structural-axis project definition block.
2842
2919
  *
2843
2920
  * @param facts - Optional structural facts.
2844
- * @returns Policy, guides, then selected axis project definitions, separated by one blank line.
2921
+ * @returns Policy, config, guides, then selected axis project definitions, separated by one blank line.
2845
2922
  *
2846
2923
  * @example
2847
2924
  * ```ts
@@ -2868,7 +2945,7 @@ export declare function coreViteConfig(): string;
2868
2945
  * @example
2869
2946
  * ```ts
2870
2947
  * viteProjectRegistrations(['core'], [], { integration: true })
2871
- * // [{ project: 'srcCore' }, { project: 'policy' }, { project: 'guides' }, { project: 'integration' }]
2948
+ * // [{ project: 'srcCore' }, { project: 'policy' }, { project: 'config' }, { project: 'guides' }, { project: 'integration' }]
2872
2949
  * ```
2873
2950
  */
2874
2951
  export declare function viteProjectRegistrations(src: readonly Environment[], app?: readonly Environment[], facts?: ViteFacts): readonly ViteProjectRegistration[];
@@ -41,12 +41,18 @@ export declare function alignTable(header: readonly string[], rows: readonly (re
41
41
  /** Additional development dependencies required by a private Vue browser application. */
42
42
  export declare const APP_BROWSER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
43
43
 
44
+ /** Baseline development dependency required by every private application environment. */
45
+ export declare const APP_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
46
+
44
47
  /**
45
48
  * The per-environment application matrix: thin config artifacts, Vitest project
46
49
  * label, and executable entry where the environment produces a runtime bundle.
47
50
  */
48
51
  export declare const APP_MATRIX: Readonly<Record<Environment, AppDefinition>>;
49
52
 
53
+ /** Additional development dependencies required by a private server application. */
54
+ export declare const APP_SERVER_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
55
+
50
56
  /** The deterministic config, test-project, and runtime-entry settings for one application environment. */
51
57
  export declare interface AppDefinition {
52
58
  readonly configs: readonly string[];
@@ -58,9 +64,16 @@ export declare interface AppDefinition {
58
64
  * Draft the application source artifacts for every selected app environment.
59
65
  *
60
66
  * @param spec - The blueprint carrying the application environment set.
67
+ * @remarks
68
+ * Two conditional shapes layer over the per-environment set. The health contract —
69
+ * record, route constants, guard, and the one unknown-to-typed read — is declared by
70
+ * `app/server` while the server alone reads it and RELOCATES to `app/core` the moment
71
+ * the browser reads it too, because a contract two hosts share belongs to neither of
72
+ * them. The showcase entry pair, its seeder, and its factory appear only for a
73
+ * blueprint that declares the physical showcase wrapper alongside `app/browser`.
61
74
  * @returns Complete, runnable app/core, app/browser, and app/server artifacts.
62
75
  */
63
- export declare function applicationArtifacts(spec: Blueprint): readonly Artifact[];
76
+ export declare function applicationArtifacts(spec: Pick<Blueprint, 'name' | 'app' | 'showcase'>): readonly Artifact[];
64
77
 
65
78
  /**
66
79
  * Build the root Vite/Vitest configuration for a workspace that includes
@@ -341,7 +354,11 @@ export declare function blueprintShape(): ObjectShape<{
341
354
  * @remarks
342
355
  * Published source environments receive the canonical entity/type/factory/constant
343
356
  * inventory. Application environments receive their exact public declaration kinds,
344
- * including parsers, guards, handlers, errors, and runners where present.
357
+ * including parsers, guards, handlers, errors, and runners where present. Two groups
358
+ * move rather than duplicate: the health contract is declared against `app/server`
359
+ * while the server alone reads it and against `app/core` once the browser reads it
360
+ * too, and the showcase seed, factory, and root-view identity appear only for a
361
+ * blueprint whose showcase accompanies `app/browser`.
345
362
  * @returns The declared `Member[]`, one set per environment.
346
363
  *
347
364
  * @example
@@ -647,6 +664,18 @@ export declare function computeHash(text: string): string;
647
664
  */
648
665
  export declare function configArtifacts(spec: Blueprint): readonly Artifact[];
649
666
 
667
+ /**
668
+ * Build the standalone Node-only root-configuration Vitest project.
669
+ *
670
+ * @returns The emitted `config` project definition.
671
+ *
672
+ * @example
673
+ * ```ts
674
+ * configViteProject().includes("label: 'config'") // true
675
+ * ```
676
+ */
677
+ export declare function configViteProject(): string;
678
+
650
679
  /** Constant-declaration token kept out of template literals consumed by parity scans. */
651
680
  export declare const CONST_KEYWORD = "const";
652
681
 
@@ -1202,6 +1231,32 @@ export declare function coreViteConfig(): string;
1202
1231
  */
1203
1232
  export declare function guideUsage(spec: Blueprint, pascal: string): string;
1204
1233
 
1234
+ /**
1235
+ * Determine whether an application blueprint spans the shared browser/server boundary.
1236
+ *
1237
+ * @param spec - The blueprint to inspect.
1238
+ * @returns True only when app/core, app/browser, and app/server are all selected.
1239
+ *
1240
+ * @example
1241
+ * ```ts
1242
+ * hasApplicationBoundary(blueprint('application', { app: ['core', 'browser', 'server'] }))
1243
+ * ```
1244
+ */
1245
+ export declare function hasApplicationBoundary(spec: Pick<Blueprint, 'app'>): boolean;
1246
+
1247
+ /**
1248
+ * Determine whether an application blueprint emits its browser showcase.
1249
+ *
1250
+ * @param spec - The blueprint to inspect.
1251
+ * @returns True only when showcase intent accompanies app/browser.
1252
+ *
1253
+ * @example
1254
+ * ```ts
1255
+ * hasApplicationShowcase(blueprint('application', { app: ['browser'], showcase: true }))
1256
+ * ```
1257
+ */
1258
+ export declare function hasApplicationShowcase(spec: Pick<Blueprint, 'app' | 'showcase'>): boolean;
1259
+
1205
1260
  /**
1206
1261
  * Whether a structurally valid blueprint selects at least one source or app environment.
1207
1262
  *
@@ -2196,6 +2251,28 @@ export declare function coreViteConfig(): string;
2196
2251
  */
2197
2252
  export declare function renderObject(entry: Readonly<Record<string, unknown>>, indent: string): string;
2198
2253
 
2254
+ /**
2255
+ * Render a single-quoted TypeScript string array literal through `oxfmt`'s
2256
+ * inline-or-broken rule — inline when the rendered width fits
2257
+ * `JSON_PRINT_WIDTH`, one item per line with a trailing comma on every line
2258
+ * (including the last) otherwise, matching `.oxfmtrc.json`'s
2259
+ * `trailingComma: "all"` for non-JSON files.
2260
+ *
2261
+ * @param entries - The array's string elements, in order.
2262
+ * @param indent - The current indentation prefix.
2263
+ * @param prefix - The text already emitted on this line before the array.
2264
+ * @param suffix - The text that will follow the array on this line.
2265
+ * @returns The rendered array fragment (no trailing newline).
2266
+ *
2267
+ * @example
2268
+ * ```ts
2269
+ * import { renderStringArray } from '@orkestrel/scaffold'
2270
+ *
2271
+ * renderStringArray(['app', 'guides', 'tests'], '', '', '') // "['app', 'guides', 'tests']"
2272
+ * ```
2273
+ */
2274
+ export declare function renderStringArray(entries: readonly string[], indent: string, prefix: string, suffix: string): string;
2275
+
2199
2276
  /**
2200
2277
  * Render one JSON value through `formatJson`'s dispatch — arrays via
2201
2278
  * `renderArray`, objects via `renderObject`, everything else via
@@ -2279,7 +2356,7 @@ export declare function coreViteConfig(): string;
2279
2356
  export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
2280
2357
 
2281
2358
  /** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
2282
- export declare const SCAFFOLD_RANGE = "^0.0.19";
2359
+ export declare const SCAFFOLD_RANGE = "^0.0.21";
2283
2360
 
2284
2361
  /**
2285
2362
  * Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
@@ -2431,7 +2508,7 @@ export declare function coreViteConfig(): string;
2431
2508
  * factory per environment (AGENTS §5's per-environment centralized-file pattern), so
2432
2509
  * every environment gets the same uniform stub shape.
2433
2510
  *
2434
- * @param spec - The `Blueprint` to derive source stubs from.
2511
+ * @param spec - The blueprint carrying the declared source environment set.
2435
2512
  * @param pascal - The package's PascalCase entity name.
2436
2513
  * @returns The `source` group's `Artifact[]`.
2437
2514
  *
@@ -2440,7 +2517,7 @@ export declare function coreViteConfig(): string;
2440
2517
  * sourceArtifacts(blueprint('router'), 'Router').length // 4
2441
2518
  * ```
2442
2519
  */
2443
- export declare function sourceArtifacts(spec: Blueprint, pascal: string): readonly Artifact[];
2520
+ export declare function sourceArtifacts(spec: Pick<Blueprint, 'src'>, pascal: string): readonly Artifact[];
2444
2521
 
2445
2522
  /**
2446
2523
  * Split one rendered GFM table row into its trimmed cell strings.
@@ -2841,7 +2918,7 @@ export declare function coreViteConfig(): string;
2841
2918
  * Render the one ordered proof and structural-axis project definition block.
2842
2919
  *
2843
2920
  * @param facts - Optional structural facts.
2844
- * @returns Policy, guides, then selected axis project definitions, separated by one blank line.
2921
+ * @returns Policy, config, guides, then selected axis project definitions, separated by one blank line.
2845
2922
  *
2846
2923
  * @example
2847
2924
  * ```ts
@@ -2868,7 +2945,7 @@ export declare function coreViteConfig(): string;
2868
2945
  * @example
2869
2946
  * ```ts
2870
2947
  * viteProjectRegistrations(['core'], [], { integration: true })
2871
- * // [{ project: 'srcCore' }, { project: 'policy' }, { project: 'guides' }, { project: 'integration' }]
2948
+ * // [{ project: 'srcCore' }, { project: 'policy' }, { project: 'config' }, { project: 'guides' }, { project: 'integration' }]
2872
2949
  * ```
2873
2950
  */
2874
2951
  export declare function viteProjectRegistrations(src: readonly Environment[], app?: readonly Environment[], facts?: ViteFacts): readonly ViteProjectRegistration[];