@ordewell/core 0.5.5 → 0.6.0

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 (54) hide show
  1. package/dist/IFileSystem-CFYf4yR2.d.mts +76 -0
  2. package/dist/IFileSystem-D4dAl2r8.d.ts +76 -0
  3. package/dist/{ModeResolver-D-SUFRNF.d.mts → ModeResolver-DVYVRbJp.d.ts} +6 -2
  4. package/dist/{ModeResolver-D3XO0fT9.d.ts → ModeResolver-a4xJFlEp.d.mts} +6 -2
  5. package/dist/Task-CZJr6rmz.d.mts +2121 -0
  6. package/dist/Task-CZJr6rmz.d.ts +2121 -0
  7. package/dist/{chunk-KLN7ELXO.mjs → chunk-2SOVKO7P.mjs} +1561 -1269
  8. package/dist/chunk-2SOVKO7P.mjs.map +1 -0
  9. package/dist/{chunk-T2S5O36I.mjs → chunk-C44UWIAD.mjs} +6 -6
  10. package/dist/chunk-C44UWIAD.mjs.map +1 -0
  11. package/dist/{chunk-HD2FWPRV.mjs → chunk-EDGUFCIR.mjs} +6 -1
  12. package/dist/chunk-EDGUFCIR.mjs.map +1 -0
  13. package/dist/{chunk-UUBGVCGJ.mjs → chunk-OM4D274O.mjs} +20 -2
  14. package/dist/chunk-OM4D274O.mjs.map +1 -0
  15. package/dist/index.d.mts +1594 -803
  16. package/dist/index.d.ts +1594 -803
  17. package/dist/index.js +9540 -6040
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +8167 -4996
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/order-labels.d.mts +3 -1
  22. package/dist/order-labels.d.ts +3 -1
  23. package/dist/{parsing-BTP4bwkk.d.ts → parsing-Bd6-b644.d.ts} +2 -2
  24. package/dist/{parsing-CDtRSxBY.d.mts → parsing-DIaGZmiQ.d.mts} +2 -2
  25. package/dist/parsing.d.mts +5 -3
  26. package/dist/parsing.d.ts +5 -3
  27. package/dist/parsing.js.map +1 -1
  28. package/dist/parsing.mjs +2 -2
  29. package/dist/{plan-utils-pE4TBwxl.d.mts → plan-utils-Ba-l8EZS.d.mts} +212 -43
  30. package/dist/{plan-utils-BFaPo-IT.d.ts → plan-utils-_T5S7Mnk.d.ts} +212 -43
  31. package/dist/plan-utils.d.mts +5 -4
  32. package/dist/plan-utils.d.ts +5 -4
  33. package/dist/plan-utils.js +352 -64
  34. package/dist/plan-utils.js.map +1 -1
  35. package/dist/plan-utils.mjs +11 -5
  36. package/dist/testing.d.mts +54 -4
  37. package/dist/testing.d.ts +54 -4
  38. package/dist/testing.js +93 -2
  39. package/dist/testing.js.map +1 -1
  40. package/dist/testing.mjs +91 -2
  41. package/dist/testing.mjs.map +1 -1
  42. package/package.json +2 -1
  43. package/skills/grilling/SKILL.md +6 -16
  44. package/skills/improve-codebase-architecture/SKILL.md +1 -1
  45. package/dist/ApprovalPolicy-BVhGdECT.d.mts +0 -79
  46. package/dist/ApprovalPolicy-BVhGdECT.d.ts +0 -79
  47. package/dist/ITerminalRunner-BV9Rd2o9.d.ts +0 -563
  48. package/dist/ITerminalRunner-C77ZNZS9.d.mts +0 -563
  49. package/dist/Task-Vl5Zq_D-.d.mts +0 -825
  50. package/dist/Task-Vl5Zq_D-.d.ts +0 -825
  51. package/dist/chunk-HD2FWPRV.mjs.map +0 -1
  52. package/dist/chunk-KLN7ELXO.mjs.map +0 -1
  53. package/dist/chunk-T2S5O36I.mjs.map +0 -1
  54. package/dist/chunk-UUBGVCGJ.mjs.map +0 -1
@@ -0,0 +1,76 @@
1
+ import { I as IApproval } from './Task-CZJr6rmz.mjs';
2
+
3
+ interface ToolOutcome {
4
+ success: boolean;
5
+ output: string;
6
+ truncated: boolean;
7
+ }
8
+ interface ReadFileOpts {
9
+ maxBytes?: number;
10
+ offset?: number;
11
+ limit?: number;
12
+ }
13
+ /**
14
+ * `content` returns matching lines, `files` only the paths that matched, and
15
+ * `count` a per-file tally. Cheap models otherwise grep and then read whole
16
+ * files to answer "which files touch this", burning rounds against the budget.
17
+ */
18
+ type GrepOutputMode = 'content' | 'files' | 'count';
19
+ interface GrepOptions {
20
+ /** File glob filter, e.g. `*.ts`. */
21
+ include?: string;
22
+ /** Search root. Relative to the workspace unless approved as external. */
23
+ path?: string;
24
+ outputMode?: GrepOutputMode;
25
+ /** Lines of context around each match (`content` mode only). */
26
+ contextBefore?: number;
27
+ contextAfter?: number;
28
+ /** Treat the pattern as a literal string rather than a regex. */
29
+ literal?: boolean;
30
+ caseInsensitive?: boolean;
31
+ /** Global cap on returned rows. Defaults to {@link GREP_DEFAULT_HEAD_LIMIT}. */
32
+ headLimit?: number;
33
+ }
34
+ interface GlobOptions {
35
+ /** Search root. Relative to the workspace unless approved as external. */
36
+ path?: string;
37
+ headLimit?: number;
38
+ }
39
+ interface FindSymbolOptions {
40
+ /** Language id or file extension, e.g. `typescript` or `.go`. Narrows the keyword set. */
41
+ language?: string;
42
+ /** Search root. Relative to the workspace unless approved as external. */
43
+ path?: string;
44
+ }
45
+ /** Global row cap for grep. A per-file cap is not a budget — see PoolFileSystem. */
46
+ declare const GREP_DEFAULT_HEAD_LIMIT = 100;
47
+ /**
48
+ * Directories that are never interesting to a planner and would otherwise eat
49
+ * the result budget. Applied by every search entry point, not just `glob` —
50
+ * `dist/` and `.ordewell/` are frequently not gitignored.
51
+ */
52
+ declare const SEARCH_EXCLUSIONS: string[];
53
+ interface IFileSystem {
54
+ readFile(path: string, opts?: ReadFileOpts): Promise<ToolOutcome>;
55
+ readFiles(paths: string[]): Promise<ToolOutcome>;
56
+ glob(pattern: string, opts?: GlobOptions): Promise<ToolOutcome>;
57
+ grep(pattern: string, opts?: GrepOptions): Promise<ToolOutcome>;
58
+ listDir(path: string, depth?: number): Promise<ToolOutcome>;
59
+ /**
60
+ * `signal` stops the planning turn this command belongs to: adapters kill
61
+ * the spawned child rather than let it run out its own timeout. The other
62
+ * tools here are short enough that the loop's between-call abort check is
63
+ * indistinguishable from cancelling them mid-flight; a `bash` call is not.
64
+ */
65
+ bash(command: string, signal?: AbortSignal): Promise<ToolOutcome>;
66
+ /** Definition-first lookup for one symbol. See `symbolPatterns.ts`. */
67
+ findSymbol(symbol: string, opts?: FindSymbolOptions): Promise<ToolOutcome>;
68
+ getWorkspaceRoot(): string;
69
+ /**
70
+ * Inject the human-approval channel for out-of-envelope access. Optional so
71
+ * test doubles stay small; every adapter extending `BaseFileSystem` has it.
72
+ */
73
+ setApproval?(approval: IApproval): void;
74
+ }
75
+
76
+ export { type FindSymbolOptions as F, GREP_DEFAULT_HEAD_LIMIT as G, type IFileSystem as I, type ReadFileOpts as R, SEARCH_EXCLUSIONS as S, type ToolOutcome as T, type GlobOptions as a, type GrepOptions as b, type GrepOutputMode as c };
@@ -0,0 +1,76 @@
1
+ import { I as IApproval } from './Task-CZJr6rmz.js';
2
+
3
+ interface ToolOutcome {
4
+ success: boolean;
5
+ output: string;
6
+ truncated: boolean;
7
+ }
8
+ interface ReadFileOpts {
9
+ maxBytes?: number;
10
+ offset?: number;
11
+ limit?: number;
12
+ }
13
+ /**
14
+ * `content` returns matching lines, `files` only the paths that matched, and
15
+ * `count` a per-file tally. Cheap models otherwise grep and then read whole
16
+ * files to answer "which files touch this", burning rounds against the budget.
17
+ */
18
+ type GrepOutputMode = 'content' | 'files' | 'count';
19
+ interface GrepOptions {
20
+ /** File glob filter, e.g. `*.ts`. */
21
+ include?: string;
22
+ /** Search root. Relative to the workspace unless approved as external. */
23
+ path?: string;
24
+ outputMode?: GrepOutputMode;
25
+ /** Lines of context around each match (`content` mode only). */
26
+ contextBefore?: number;
27
+ contextAfter?: number;
28
+ /** Treat the pattern as a literal string rather than a regex. */
29
+ literal?: boolean;
30
+ caseInsensitive?: boolean;
31
+ /** Global cap on returned rows. Defaults to {@link GREP_DEFAULT_HEAD_LIMIT}. */
32
+ headLimit?: number;
33
+ }
34
+ interface GlobOptions {
35
+ /** Search root. Relative to the workspace unless approved as external. */
36
+ path?: string;
37
+ headLimit?: number;
38
+ }
39
+ interface FindSymbolOptions {
40
+ /** Language id or file extension, e.g. `typescript` or `.go`. Narrows the keyword set. */
41
+ language?: string;
42
+ /** Search root. Relative to the workspace unless approved as external. */
43
+ path?: string;
44
+ }
45
+ /** Global row cap for grep. A per-file cap is not a budget — see PoolFileSystem. */
46
+ declare const GREP_DEFAULT_HEAD_LIMIT = 100;
47
+ /**
48
+ * Directories that are never interesting to a planner and would otherwise eat
49
+ * the result budget. Applied by every search entry point, not just `glob` —
50
+ * `dist/` and `.ordewell/` are frequently not gitignored.
51
+ */
52
+ declare const SEARCH_EXCLUSIONS: string[];
53
+ interface IFileSystem {
54
+ readFile(path: string, opts?: ReadFileOpts): Promise<ToolOutcome>;
55
+ readFiles(paths: string[]): Promise<ToolOutcome>;
56
+ glob(pattern: string, opts?: GlobOptions): Promise<ToolOutcome>;
57
+ grep(pattern: string, opts?: GrepOptions): Promise<ToolOutcome>;
58
+ listDir(path: string, depth?: number): Promise<ToolOutcome>;
59
+ /**
60
+ * `signal` stops the planning turn this command belongs to: adapters kill
61
+ * the spawned child rather than let it run out its own timeout. The other
62
+ * tools here are short enough that the loop's between-call abort check is
63
+ * indistinguishable from cancelling them mid-flight; a `bash` call is not.
64
+ */
65
+ bash(command: string, signal?: AbortSignal): Promise<ToolOutcome>;
66
+ /** Definition-first lookup for one symbol. See `symbolPatterns.ts`. */
67
+ findSymbol(symbol: string, opts?: FindSymbolOptions): Promise<ToolOutcome>;
68
+ getWorkspaceRoot(): string;
69
+ /**
70
+ * Inject the human-approval channel for out-of-envelope access. Optional so
71
+ * test doubles stay small; every adapter extending `BaseFileSystem` has it.
72
+ */
73
+ setApproval?(approval: IApproval): void;
74
+ }
75
+
76
+ export { type FindSymbolOptions as F, GREP_DEFAULT_HEAD_LIMIT as G, type IFileSystem as I, type ReadFileOpts as R, SEARCH_EXCLUSIONS as S, type ToolOutcome as T, type GlobOptions as a, type GrepOptions as b, type GrepOutputMode as c };
@@ -1,4 +1,4 @@
1
- import { H as RunnerId } from './Task-Vl5Zq_D-.mjs';
1
+ import { aG as RunnerId } from './Task-CZJr6rmz.js';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -38,7 +38,11 @@ declare function resolveDefaultMode(modes: RunnerModeInfo[] | undefined, autonom
38
38
  * either toggle.
39
39
  */
40
40
  declare function filteredBuildModes(modes: RunnerModeInfo[], autonomousDefault: boolean): RunnerModeInfo[];
41
+ /** The user-facing name of the `autonomousMode` boolean's two states. */
42
+ declare function autonomyLevelLabel(autonomous: boolean): 'Full auto' | 'Auto';
43
+ /** `full`/`auto` name the levels; `on`/`off` are the toggle's old words for them. Null for anything else. */
44
+ declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
41
45
  declare function buildModeGuide(runnerModes: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): string;
42
46
  declare function resolveTaskMode(emittedMode: string | undefined, runnerId: RunnerId, runnerModes: Record<RunnerId, RunnerModeInfo[]> | undefined, autonomousDefault?: boolean): string;
43
47
 
44
- export { type ManifestLookup as M, type RunnerModeInfo as R, resolveTaskMode as a, buildModeGuide as b, runnerModesFrom as c, filteredBuildModes as f, resolveDefaultMode as r };
48
+ export { type ManifestLookup as M, type RunnerModeInfo as R, autonomyLevelLabel as a, buildModeGuide as b, resolveTaskMode as c, runnerModesFrom as d, filteredBuildModes as f, parseAutonomyLevel as p, resolveDefaultMode as r };
@@ -1,4 +1,4 @@
1
- import { H as RunnerId } from './Task-Vl5Zq_D-.js';
1
+ import { aG as RunnerId } from './Task-CZJr6rmz.mjs';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -38,7 +38,11 @@ declare function resolveDefaultMode(modes: RunnerModeInfo[] | undefined, autonom
38
38
  * either toggle.
39
39
  */
40
40
  declare function filteredBuildModes(modes: RunnerModeInfo[], autonomousDefault: boolean): RunnerModeInfo[];
41
+ /** The user-facing name of the `autonomousMode` boolean's two states. */
42
+ declare function autonomyLevelLabel(autonomous: boolean): 'Full auto' | 'Auto';
43
+ /** `full`/`auto` name the levels; `on`/`off` are the toggle's old words for them. Null for anything else. */
44
+ declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
41
45
  declare function buildModeGuide(runnerModes: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): string;
42
46
  declare function resolveTaskMode(emittedMode: string | undefined, runnerId: RunnerId, runnerModes: Record<RunnerId, RunnerModeInfo[]> | undefined, autonomousDefault?: boolean): string;
43
47
 
44
- export { type ManifestLookup as M, type RunnerModeInfo as R, resolveTaskMode as a, buildModeGuide as b, runnerModesFrom as c, filteredBuildModes as f, resolveDefaultMode as r };
48
+ export { type ManifestLookup as M, type RunnerModeInfo as R, autonomyLevelLabel as a, buildModeGuide as b, resolveTaskMode as c, runnerModesFrom as d, filteredBuildModes as f, parseAutonomyLevel as p, resolveDefaultMode as r };