@turri-dev/cli 0.4.3-next.620bae9 → 0.4.3-next.8482fed
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 +1 -0
- package/dist/background-skills.d.ts +4 -1
- package/dist/background-skills.js +9 -1
- package/dist/capture/agents.d.ts +361 -0
- package/dist/capture/agents.js +332 -0
- package/dist/capture/area.d.ts +58 -0
- package/dist/capture/area.js +197 -0
- package/dist/capture/assemble.d.ts +122 -0
- package/dist/capture/assemble.js +452 -0
- package/dist/capture/capture.d.ts +116 -0
- package/dist/capture/capture.js +1228 -0
- package/dist/capture/chat.d.ts +29 -0
- package/dist/capture/chat.js +94 -0
- package/dist/capture/checks.d.ts +142 -0
- package/dist/capture/checks.js +643 -0
- package/dist/capture/config.d.ts +13 -0
- package/dist/capture/config.js +60 -0
- package/dist/capture/interface.d.ts +71 -0
- package/dist/capture/interface.js +199 -0
- package/dist/capture/map.d.ts +56 -0
- package/dist/capture/map.js +530 -0
- package/dist/capture/progress.d.ts +108 -0
- package/dist/capture/progress.js +234 -0
- package/dist/capture/report.d.ts +75 -0
- package/dist/capture/report.js +267 -0
- package/dist/capture/scripts.d.ts +26 -0
- package/dist/capture/scripts.js +33 -0
- package/dist/capture/state.d.ts +296 -0
- package/dist/capture/state.js +43 -0
- package/dist/capture/trial.d.ts +34 -0
- package/dist/capture/trial.js +89 -0
- package/dist/capture-cli.d.ts +1 -0
- package/dist/capture-cli.js +77 -0
- package/dist/cli.js +32 -14
- package/dist/config-edit.js +1 -0
- package/dist/config.d.ts +15 -2
- package/dist/config.js +57 -3
- package/dist/extension.js +125 -3
- package/dist/identity.js +2 -1
- package/dist/init-config.js +1 -0
- package/dist/loop-cli.js +5 -1
- package/dist/loop-tools.js +5 -1
- package/dist/new-project.d.ts +5 -0
- package/dist/new-project.js +11 -0
- package/dist/pi.js +2 -2
- package/dist/plain-code-blocks.d.ts +14 -0
- package/dist/plain-code-blocks.js +56 -0
- package/dist/regenerate/command-check.js +80 -11
- package/dist/regenerate/loop.js +9 -1
- package/dist/regenerate/test-scripts.d.ts +5 -0
- package/dist/regenerate/test-scripts.js +4 -0
- package/dist/reopen.d.ts +29 -0
- package/dist/reopen.js +47 -0
- package/dist/setup.js +9 -1
- package/docs/README.md +2 -0
- package/docs/capture.md +191 -0
- package/docs/config.md +14 -2
- package/docs/development.md +4 -1
- package/docs/regenerating.md +1 -1
- package/docs/sandbox.md +2 -2
- package/docs/theming.md +1 -1
- package/docs/using.md +5 -1
- package/genome/capture/capture.md +26 -0
- package/genome/capture/check-conventions.md +5 -0
- package/genome/capture/check-reference.md +11 -0
- package/genome/capture/concepts.md +3 -0
- package/genome/capture/divide.md +9 -0
- package/genome/capture/feature.md +45 -0
- package/genome/capture/interface.md +9 -0
- package/genome/capture/modules.md +23 -0
- package/genome/capture/outline.md +11 -0
- package/genome/capture/readability.md +12 -0
- package/genome/capture/reference.md +10 -0
- package/genome/capture/split.md +9 -0
- package/genome/capture/survey.md +37 -0
- package/genome/capture/trial.md +18 -0
- package/genome/capture/verify.md +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type TestEvidence } from "./area.ts";
|
|
2
|
+
import { type CaptureStatus } from "./progress.ts";
|
|
3
|
+
import { type ScriptWriter } from "./scripts.ts";
|
|
4
|
+
import { type InterfaceEntry, type InterfaceSurface, type AreaState, type CapturedSpec, type CaptureState, type Part } from "./state.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Capture: an existing codebase captured into ***plain, offline, into a folder of its own - `plain/` in the codebase by
|
|
7
|
+
* default - after which the ***plain is worked on and the original abandoned (docs/capture.md).
|
|
8
|
+
*
|
|
9
|
+
* Cost follows features, not lines: no agent sees more than a fixed budget however large the codebase is. A map built
|
|
10
|
+
* with no model; a survey of the whole of it, folded, that settles the conventions every feature follows; areas split
|
|
11
|
+
* until each fits; each leaf outlined into features; the features divided, each behaviour one feature's; a writer for
|
|
12
|
+
* each feature, side by side, its scenarios as many as the original's tests of it are dense; each part's features
|
|
13
|
+
* gathered into modules by concern, in the order they are built; concepts defined twice reconciled; a readability pass over each module's
|
|
14
|
+
* ***plain alone; its interface checked against the code; its scenarios tried on a copy of the original; then the files,
|
|
15
|
+
* the parser's check and the report. Every answer is saved as it comes, so a capture stopped part-way goes on from where
|
|
16
|
+
* it was.
|
|
17
|
+
*/
|
|
18
|
+
export interface CaptureOptions {
|
|
19
|
+
/** The codebase to capture. */
|
|
20
|
+
root: string;
|
|
21
|
+
/** Where the ***plain goes: `<root>/plain` unless given. */
|
|
22
|
+
plainDir?: string;
|
|
23
|
+
/** What capture's agents run on - the chat's model, or `--harness-model`. */
|
|
24
|
+
model?: string;
|
|
25
|
+
/** Written into the new project's config, when given. */
|
|
26
|
+
harnessModel?: string;
|
|
27
|
+
codingModel?: string;
|
|
28
|
+
/** How many agents work at once. */
|
|
29
|
+
parallel?: number;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
/** A line of progress: an area split, a feature captured. */
|
|
32
|
+
progress?: (line: string) => void;
|
|
33
|
+
/** Each change in where it is - its stage, its features, each agent at work and what it did last - for a live view. */
|
|
34
|
+
watch?: (status: CaptureStatus) => void;
|
|
35
|
+
/** An area of more lines than this is split; one of fewer is outlined. */
|
|
36
|
+
leafLines?: number;
|
|
37
|
+
/** How many characters of the map an agent is shown. */
|
|
38
|
+
mapBudget?: number;
|
|
39
|
+
/** The most functional specs areas are gathered into one module with. */
|
|
40
|
+
moduleSpecs?: number;
|
|
41
|
+
/** Writes a part's testing script: turri's skill for it unless given. */
|
|
42
|
+
writeScript?: ScriptWriter;
|
|
43
|
+
/**
|
|
44
|
+
* The folder whose config is in use where the capture was started - the chat's, the command line's: the captured
|
|
45
|
+
* project's config starts as it (`capture/config.ts`). None: it starts empty.
|
|
46
|
+
*/
|
|
47
|
+
configFrom?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CaptureResult {
|
|
50
|
+
plainDir: string;
|
|
51
|
+
reportFile: string;
|
|
52
|
+
summary: string;
|
|
53
|
+
modules: string[];
|
|
54
|
+
specs: number;
|
|
55
|
+
/** Areas and features that could not be captured. */
|
|
56
|
+
uncaptured: number;
|
|
57
|
+
/** Modules the parser fails. */
|
|
58
|
+
failing: number;
|
|
59
|
+
}
|
|
60
|
+
/** A capture that cannot start, or cannot go on: said as it is, nothing written but what was before. */
|
|
61
|
+
export declare class CaptureError extends Error {
|
|
62
|
+
constructor(message: string);
|
|
63
|
+
}
|
|
64
|
+
/** Lines above which an area is split rather than outlined: about what one agent can outline from a map and a look. */
|
|
65
|
+
export declare const LEAF_LINES: number;
|
|
66
|
+
/** Characters of the map an agent is shown: about six thousand tokens. */
|
|
67
|
+
export declare const MAP_BUDGET = 24000;
|
|
68
|
+
/** How many agents work at once, unless told. */
|
|
69
|
+
export declare const DEFAULT_PARALLEL = 4;
|
|
70
|
+
/** The output folder's state as it stands: nothing there, a capture to go on with, or something capture must not touch. */
|
|
71
|
+
export declare function plainDirState(plainDir: string): {
|
|
72
|
+
kind: "empty";
|
|
73
|
+
} | {
|
|
74
|
+
kind: "resume";
|
|
75
|
+
state: CaptureState;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "finished";
|
|
78
|
+
} | {
|
|
79
|
+
kind: "taken";
|
|
80
|
+
why: string;
|
|
81
|
+
};
|
|
82
|
+
/** Run a whole capture - or go on with one stopped part-way. */
|
|
83
|
+
export declare function runCapture(options: CaptureOptions): Promise<CaptureResult>;
|
|
84
|
+
/** The interface among some files, file by file, for an agent: each name the code gives it, so many at most. */
|
|
85
|
+
export declare function interfaceBlock(tag: string, lead: string, surfaces: InterfaceSurface[]): string;
|
|
86
|
+
/**
|
|
87
|
+
* The interface among some files, for an agent: the reference's entries - each with every name, what it takes, its
|
|
88
|
+
* choices and its default, and where - and, after them, what the map found there that the reference does not list.
|
|
89
|
+
*/
|
|
90
|
+
export declare function referenceBlock(tag: string, lead: string, entries: InterfaceEntry[], unlisted: InterfaceSurface[]): string;
|
|
91
|
+
/** A feature as the agent that gathers a part's features into modules is shown it. */
|
|
92
|
+
export interface GatheringFeature {
|
|
93
|
+
key: string;
|
|
94
|
+
area: AreaState;
|
|
95
|
+
title: string;
|
|
96
|
+
/** What it owns, as the division said, else what it was outlined for. */
|
|
97
|
+
owns: string;
|
|
98
|
+
specs: CapturedSpec[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A part's features for the agent that gathers them into modules, area by area in the order of their code: each with
|
|
102
|
+
* what it owns, the first line of each functional spec, and its scenarios - cut shorter, then left out, until they fit
|
|
103
|
+
* the budget.
|
|
104
|
+
*/
|
|
105
|
+
export declare function gatheringList(features: GatheringFeature[], budget: number): string;
|
|
106
|
+
/**
|
|
107
|
+
* The original's tests in a feature's files, for its writer: how many lines each holds and what they are called - where
|
|
108
|
+
* its scenarios go - and how many scenarios it may write, more the more the original tests it.
|
|
109
|
+
*/
|
|
110
|
+
export declare function testsBlock(evidence: TestEvidence[], budget: number): string;
|
|
111
|
+
/**
|
|
112
|
+
* What a part is built on, as a writer is told it: the standard library's templates it imports - the stack, its kind's
|
|
113
|
+
* common one, its language's - in full, and its own implementation reqs. All of it is the default: what the code does
|
|
114
|
+
* because of it is never restated.
|
|
115
|
+
*/
|
|
116
|
+
export declare function stackBlock(part: Part): string;
|