@turri-dev/core 0.1.1-next.35d4c49 → 0.1.1-next.ad4aa8f
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/CHANGELOG.md +56 -0
- package/README.md +17 -11
- package/dist/api/models.d.ts +9 -0
- package/dist/api/models.js +15 -0
- package/dist/api/plain.d.ts +6 -6
- package/dist/api/plain.js +4 -7
- package/dist/api/project.d.ts +35 -0
- package/dist/api/project.js +47 -0
- package/dist/api/session.d.ts +48 -0
- package/dist/api/session.js +17 -0
- package/dist/api/system.d.ts +18 -0
- package/dist/api/system.js +23 -0
- package/dist/btw.d.ts +1 -1
- package/dist/capture/capture.js +11 -8
- package/dist/capture/chat.d.ts +0 -11
- package/dist/capture/chat.js +0 -29
- package/dist/capture/config.d.ts +4 -5
- package/dist/capture/config.js +34 -20
- package/dist/capture/models.d.ts +2 -1
- package/dist/capture/models.js +1 -0
- package/dist/chat-entries.d.ts +81 -39
- package/dist/chat-entries.js +125 -11
- package/dist/chat-model.d.ts +37 -0
- package/dist/chat-model.js +61 -0
- package/dist/chats.d.ts +54 -42
- package/dist/chats.js +86 -80
- package/dist/client.d.ts +30 -0
- package/dist/client.js +12 -0
- package/dist/config-edit.d.ts +54 -1
- package/dist/config-edit.js +103 -33
- package/dist/config.d.ts +12 -9
- package/dist/config.js +38 -9
- package/dist/doctor-checks.d.ts +42 -0
- package/dist/doctor-checks.js +39 -0
- package/dist/environment.d.ts +2 -23
- package/dist/environment.js +5 -68
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +24 -0
- package/dist/extension.d.ts +23 -16
- package/dist/extension.js +170 -234
- package/dist/identity.d.ts +1 -1
- package/dist/identity.js +13 -9
- package/dist/init-config.d.ts +11 -9
- package/dist/init-config.js +15 -7
- package/dist/launch-session.d.ts +2 -0
- package/dist/launch-session.js +17 -1
- package/dist/loop-tools.js +11 -10
- package/dist/module-check.d.ts +13 -0
- package/dist/module-check.js +117 -0
- package/dist/notice.d.ts +5 -0
- package/dist/parse-tool.js +3 -2
- package/dist/plain/check.d.ts +27 -13
- package/dist/plain/check.js +51 -116
- package/dist/plain/files.d.ts +2 -0
- package/dist/plain/files.js +13 -0
- package/dist/plain/graph.js +2 -2
- package/dist/plain/highlight.d.ts +4 -20
- package/dist/plain/highlight.js +7 -5
- package/dist/project.d.ts +19 -0
- package/dist/project.js +34 -0
- package/dist/quiet.d.ts +0 -2
- package/dist/quiet.js +0 -14
- package/dist/regenerate/command-check.d.ts +0 -8
- package/dist/regenerate/command-check.js +133 -53
- package/dist/regenerate/conversation-writes.d.ts +5 -1
- package/dist/regenerate/conversation-writes.js +7 -3
- package/dist/regenerate/jobs.d.ts +25 -2
- package/dist/regenerate/jobs.js +3 -0
- package/dist/regenerate/launch.d.ts +1 -0
- package/dist/regenerate/launch.js +9 -0
- package/dist/regenerate/ledger-view.d.ts +14 -14
- package/dist/regenerate/ledger.d.ts +1 -0
- package/dist/regenerate/ledger.js +4 -2
- package/dist/regenerate/loop.d.ts +2 -1
- package/dist/regenerate/loop.js +9 -1
- package/dist/regenerate/os-sandbox.d.ts +4 -2
- package/dist/regenerate/os-sandbox.js +0 -1
- package/dist/regenerate/regenerate.js +2 -1
- package/dist/regenerate/requires-chain.d.ts +44 -0
- package/dist/regenerate/requires-chain.js +174 -0
- package/dist/regenerate/requires.d.ts +2 -40
- package/dist/regenerate/requires.js +14 -171
- package/dist/regenerate/resources.d.ts +0 -2
- package/dist/regenerate/resources.js +2 -14
- package/dist/regenerate/shell.js +20 -9
- package/dist/regenerate/spec-map.d.ts +2 -0
- package/dist/regenerate/spec-map.js +4 -0
- package/dist/regenerate/standing.d.ts +5 -2
- package/dist/run-report.js +2 -2
- package/dist/self-invocation.d.ts +1 -1
- package/dist/self-invocation.js +2 -3
- package/dist/sentinel-chat.js +7 -11
- package/dist/sentinel.d.ts +1 -1
- package/dist/sentinel.js +12 -5
- package/dist/session-events.d.ts +14 -0
- package/dist/session.d.ts +594 -0
- package/dist/session.js +672 -0
- package/dist/settings.d.ts +28 -2
- package/dist/settings.js +92 -56
- package/dist/setup.d.ts +6 -30
- package/dist/setup.js +28 -105
- package/dist/stack.d.ts +25 -12
- package/dist/stack.js +77 -12
- package/dist/surface.d.ts +2 -2
- package/dist/surface.js +4 -5
- package/dist/work.d.ts +125 -0
- package/dist/work.js +250 -0
- package/docs/README.md +2 -3
- package/docs/capture.md +4 -4
- package/docs/chats.md +5 -3
- package/docs/claude-subscription.md +2 -2
- package/docs/config.md +4 -4
- package/docs/core.md +105 -128
- package/docs/development.md +9 -9
- package/docs/headless.md +1 -1
- package/docs/installation.md +4 -2
- package/docs/launch.md +2 -2
- package/docs/parser.md +1 -1
- package/docs/regenerating.md +1 -1
- package/docs/sandbox.md +4 -4
- package/docs/sentinel.md +4 -4
- package/docs/skills-and-gates.md +1 -1
- package/docs/using.md +2 -2
- package/genome/rules/integration-embedded-testing.md +3 -3
- package/genome/rules/integration-embedded.md +3 -3
- package/genome/skills/implement-conformance-testing-script/SKILL.md +6 -4
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +13 -11
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +8 -7
- package/genome/skills/implement-unit-testing-script/SKILL.md +7 -5
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +9 -13
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +1 -1
- package/package.json +19 -32
- package/dist/api/commands.d.ts +0 -45
- package/dist/api/commands.js +0 -54
- package/dist/api/config.d.ts +0 -8
- package/dist/api/config.js +0 -8
- package/dist/api/ledger.d.ts +0 -3
- package/dist/api/ledger.js +0 -3
- package/dist/api/startup.d.ts +0 -8
- package/dist/api/startup.js +0 -8
- package/dist/api/terminal.d.ts +0 -18
- package/dist/api/terminal.js +0 -16
- package/dist/chat-models.d.ts +0 -11
- package/dist/chat-models.js +0 -11
- package/dist/chat-ui.d.ts +0 -33
- package/dist/chat-ui.js +0 -192
- package/dist/headless.d.ts +0 -99
- package/dist/headless.js +0 -226
- package/dist/host-session.d.ts +0 -136
- package/dist/host-session.js +0 -139
- package/dist/host.d.ts +0 -8
- package/dist/host.js +0 -17
- package/dist/index.d.ts +0 -16
- package/dist/index.js +0 -7
- package/dist/notifications.d.ts +0 -21
- package/dist/notifications.js +0 -44
- package/dist/reopen.d.ts +0 -29
- package/dist/reopen.js +0 -47
- package/dist/turri-versions.d.ts +0 -71
- package/dist/turri-versions.js +0 -276
- package/dist/view.d.ts +0 -78
- package/dist/view.js +0 -1
- package/docs/hosting.md +0 -284
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
`@turri-dev/core` follows [semantic versioning](https://semver.org/); while it is 0.x, a breaking change bumps the minor version. A pi upgrade is a breaking change: pi's types are in the core's.
|
|
4
|
+
|
|
5
|
+
## 0.2.0 - unreleased
|
|
6
|
+
|
|
7
|
+
One interface for every front end. 0.1.0's surface was cut for its two consumers - a terminal entry with the CLI's internals, a host entry for turri desktop, the CLI's start-up and commands - with two kinds of session and protocols through environment variables. 0.2.0 replaces it with one session any front end opens, and entries by domain. [The core](docs/core.md) is the whole interface.
|
|
8
|
+
|
|
9
|
+
### Breaking
|
|
10
|
+
|
|
11
|
+
- **Five entries by domain:** `.` (the session), `/plain`, `/project`, `/models`, `/system`. Gone: `/host`, `/terminal`, `/startup`, `/commands`, `/config`, `/ledger`, the default extension export and `processSession`. Config reading, `initConfig`, the ledger, drift, history and capture are in `/project` - `historyLog` and `historyShow` by the module's name, as `turri lineage` takes it; vendors, Bedrock and the model catalogue in `/models`; `doctor` and the Node check in `/system`.
|
|
12
|
+
- **One session:** `createTurri({ frontend, client, overrides, ... })` for every front end, or none. A front end says what it does differently in `Frontend` - `surface`, `extensions`, `ask`, `sessions` (`managed` or `external`, with `Turri.extension` and `chats.adopt` for pi sessions it makes), `reveal`, `openProject`, `openPiSettings`, `systemPrompt`, `shows`, `sentinel`. `createTurriCore`, `TurriView`, `ChatDriver`, the host session's callbacks and `runHeadless`/`HeadlessView` are gone.
|
|
13
|
+
- **Typed events:** one stream of plain-data events (`TurriEventMap`: `chats`, `entry`, `job`, `plan`, `launch`, `notice`, `concluded`, `skillProgress`, `captureProgress`, `spending`, `failure`, ...) by `on(type)`, `on()`, `events()` or `onEvent`, replacing `TurriHost`'s callbacks, `onChats`, `onLedgerEvent` and `onModelEvent`.
|
|
14
|
+
- **Operations instead of commands:** `work.regenerate`, `work.conform`, `work.halt`, `work.lookAhead`, `work.map`, `work.history`, `settings.set`/`get`/`choices`/`turnOnConformanceTests`, `launches.*`, `notices.*`, `sentinel.check`, `skills.list`/`run`. `regenerate` and `conform` resolve to what they planned and a `done` verdict, with start over, a run report and an export as options.
|
|
15
|
+
- **No terminal special case:** the core no longer has a terminal flag, an inbox (`TerminalNotifications`), a welcome, a hidden chat's screen stand-in or a side panel; transcript entries are always appended, and a chat's `"question"` status comes from turri's own pending asks. With no `surface`, the model is told of no key, panel or view.
|
|
16
|
+
- **No protocols between core and front end:** `overrideConfig` and `TURRI_CODING_MODEL` become the session's `overrides`, held for its project - a `models:` entry for the role still wins over them; `setTurriRoot`/`turriRoot` become `client`; the reopen file and `TURRI_REOPENED_AFTER_CAPTURE` become `Frontend.openProject` and `captured`. The CLI's own concerns leave the core: update and PATH checks, the version line, themes, the old global pi extension file, `dropNoise` and the doctor's install checks.
|
|
17
|
+
- **Errors:** refusals are `TurriError`s with a `code` (`config-invalid`, `refused`, `chat-limit`, `no-chat`, `chat-closed`, `not-found`, `extension-not-built`, `session-open`, `aborted`), told apart with `isTurriError`.
|
|
18
|
+
- **Types:** `Job.details` is `JobDetails`; `ChatEntryMap`, `ChatMessageMap` and a constant for every message type are exported, with `isChatEntryOf`; `HighlightState` is opaque; `initConfig`'s model pair is `ModelPair`. Every type a public signature reaches has a public name.
|
|
19
|
+
- **Settings by key and type:** `settings.get`, `set` and `choices` take a `SettingKey`, and a value of the setting's type (`SettingValues`); `get` throws `config-invalid` for a value the file has that its kind cannot take. `/project`'s `currentValue` is `readSetting`, typed the same way; `Setting.key` is a `SettingKey`.
|
|
20
|
+
- **The check, by domain:** `checkPlainFile` and `checkPlainTargets` (`/plain`) are the \*\*\*plain language's check alone. What the project says of a module - two config files among those it requires, the steps of adding tests it skipped, a base folder not there - is `checkModule` and `checkModules` (`/project`), the check `turri parse` runs.
|
|
21
|
+
- **The ledger's run `mode` is the front end's own word.** `run.started`'s `mode` was `host` for any front end and `chat` with none, so a terminal's run read as the desktop's, and a command run unattended as a front end's. The core cannot tell a terminal from an app: a front end now says how it runs turri in `client.mode` (`chat`, `regenerate`, `host` - the words readers already know), recorded as it is; without one it is `frontend`, or `unattended` with no front end. Tell front ends apart by `client`, and how each ran by `mode`.
|
|
22
|
+
- `chats.restore` reopens a run's chats except those open already, replacing `skipFirst`. `Chat.stop()` never ends the session: what a front end's interrupt does beyond it is its own.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- A session's work loop runs with no chat open, on the config's models: the coding model builds, the harness model plans.
|
|
27
|
+
- A person's chat runs on `harness-model`: put on it as it starts and whenever it changes, a model chosen in the chat holding until then. While it cannot be reached - no such model, or its provider not signed in - the chat refuses what is sent to it and says why, rather than reaching pi's own choice of model: `Chat.outOfReach()`, the `outOfReach` event, and `chats.onHarnessModel()` after a sign-in.
|
|
28
|
+
- A front end with no chats: `sessions: { kind: "none" }` - it answers questions and hears the events, and no chat opens, so neither does the sentinel. `Frontend.ask`'s `chat` is optional, none for a question outside any chat.
|
|
29
|
+
- `startOver` takes a function, asked for the run alone with what would be started over and why (`StartOverQuestion`): a command with no front end asks at its terminal. `false` is "no": the rest of the chain is regenerated, as a "no" through the front end did; absent or unanswered, the run ends at once.
|
|
30
|
+
- `skills.run({ dir })` runs the skill in a folder with a SKILL.md, as `turri cultivate <folder>` does, beside one by name.
|
|
31
|
+
- A skill run says what it does as it goes: `skills.run`'s `onReport` hears each step tried, its artifact, each gate's judges and verdicts and its decision with the critique (`SkillReport`), and `skills.list()` gives each skill's steps and gates (`SkillInfo`). `SkillResult.runDir` says where the run's artifacts are.
|
|
32
|
+
- `doctor`'s `overrides`: models of the caller's own - named on a command line - checked and asked in place of the config's, their AWS region worked out with it, with no session open to hold them (`DoctorModels`).
|
|
33
|
+
- `launches.followLogs` and `followLaunchedLogs` stop on a signal.
|
|
34
|
+
- `launchOutput` events: each launch's agent's words as they stream. `launches.launch` takes `onOutput`, `signal`, `guidance`, `inModule` and `again`, and `launchModule` `onOutput`.
|
|
35
|
+
- `map` events: the spec map as it changes, for a front end that shows it (`Frontend.shows.map`) - its files looked at each second, its marks laid again as the work moves.
|
|
36
|
+
- `settings.set` writes through `/settings`' own path: a path outside the project and a project-wide setting in a module's file refused, the legacy config copied first, a module's file and what overrides it said, and the harness model the session was opened with giving way to the file's, as the coding model does.
|
|
37
|
+
- `isChatEntry` checks what a record carries against its type, field by field: one another extension wrote under a name of turri's, or written wrong, is not turri's. Each entry's and message's schema matches its type exactly, or the core does not compile.
|
|
38
|
+
- `sideEffects: false`: no entry does anything as it is imported.
|
|
39
|
+
- `/plain` loads no pi: an editor reads, highlights and checks \*\*\*plain with no agent runtime. Nor does `/system` until `doctor` runs: `coreVersion()` and the Node check are quick for a `--version`.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- The audit after an agent's command put back a spec the chat edited, or what a command of the chat's own changed, when it ended in the millisecond the agent's command began - the person's edit undone, and a test of it failing now and then on a fast machine. Such a change is now the conversation's, and left.
|
|
44
|
+
- With the sentinel on, nothing told the person how to try what a launch after a pulse started: the launch's end went to the sentinel alone, and for a command-line tool nothing runs to find. A conclusion now carries `tryIt` - the words of the launch the sentinel tested in, where it runs or the commands to run it from `dist/<module>` - which the chat is told with the verdict and a front end hears in `concluded`.
|
|
45
|
+
- `doctor` said a module's toolchain was there when it was older than its implementation reqs pin - Go 1.24.3 against the standard library's `Go 1.25` - and the project then failed at its first build. A pinned Go, Java, Node or Rust version is now checked against this machine's, and an older one is `missing`, with the version to install; the chat is told so with what the machine lacks.
|
|
46
|
+
- The testing-script skills taught a fixed working folder, `/tmp/<lang>_<basename>`, removed with `rm -rf`: a Go script's module cache is read-only, so the cleanup failed and the next run failed on what it left, and two projects testing at once shared one folder. The skills, their Bash reference scripts and the integration-embedded rules now make a folder of the run's own with `mktemp -d` and make it writable before removing it (`chmod -R u+w`); Go's row sets `GOFLAGS=-modcacherw` and keeps its build cache in the folder too.
|
|
47
|
+
- The command check refused commands that write only where they may: a `cd` into a folder a variable of the same line names (`D=$TMPDIR/t1; cd $D; touch a.txt`), an option's value read as a file written (`truncate -s 1073741825 big.mp4`), and the body of a here-document fed to an interpreter (`python3 - <<'EOF'`) read as shell - a `>` in its text a redirection, its quotes leaving the shell's out of step for the rest of the line, which could also let a write after it through. A variable the line sets is now followed, a `cd` it cannot tell leaves the folder to the OS sandbox, option values are skipped, `cp -t` names its target, and a program's here-document is checked for its paths alone.
|
|
48
|
+
- The person's message after a note turri told a chat with no turn of its own - a pulse end or the sentinel's conclusion, under `shows.pulseEnds` - was read by the model as part of that note: pi gives the model every custom message as the person's. Each of turri's own messages now reaches the model inside a `<turri-note>`, and the chat's prompt says what is outside one is the person's.
|
|
49
|
+
- A pulse that stopped at its tests is said to have stopped there: `stoppedAt` reaches its job, and a job that failed for good keeps its last attempt's details.
|
|
50
|
+
- A front end's question dialog declined while it opened is closed.
|
|
51
|
+
- `doctor` asking the models, `runCapture` and `launchModule` set `AWS_REGION` for the project's Bedrock models, as a session does as it opens: with no session open, a model of a geography that needs a region of its own was called in pi's default.
|
|
52
|
+
- What turri said while no chat was shown - the orphans stopped at start, a provider waited out - was a `notification` event again when the first chat was shown: it is heard once, and shown in that chat.
|
|
53
|
+
- An incident, or the orphans stopped as a session opens, is heard once: as its own event, never again as a `notification` a front end could tell it by only by its text. It is still said in the chat shown.
|
|
54
|
+
- A listener's throw reaches `process.emitWarning` coded `TURRI_LISTENER`, as documented: given the error itself, Node dropped the code.
|
|
55
|
+
- Importing the core set exit, SIGINT, SIGTERM and SIGHUP handlers on the importing process; they are set once turri first starts a process group.
|
|
56
|
+
- Fresh and resumed captures run on the project's init-config models; init-config sets all three capture models and keeps a `models:` block valid.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**turri** is the first coding agent with the power of [regenerative software](https://chadfowler.com/regenerative-software/): you maintain the system's definition in [\*\*\*plain](https://plainlang.org/), and **turri** regenerates the code from it and proves the code conforms to it.
|
|
4
4
|
|
|
5
|
-
This is **turri**'s core: everything that decides and does - the session and its chats, the work loop, its pulses and their agents, the sandbox, launch, capture, the ledger, the \*\*\*plain parser, the skills and rules in `genome/` and the standard library in `stdlib/` - built
|
|
5
|
+
This is **turri**'s core: everything that decides and does - the session and its chats, the work loop, its pulses and their agents, the sandbox, launch, capture, the ledger, the \*\*\*plain parser, the skills and rules in `genome/` and the standard library in `stdlib/` - built on [pi](https://pi.dev). It has no terminal UI and no command line: it is one interface every front end builds on - **turri**'s CLI, [turri desktop](https://github.com/turri-oss/turri-desktop), an editor's extension - or none, for unattended work. The CLI and turri desktop are moving onto it; until they do, both import turri as `@turri-dev/cli`.
|
|
6
6
|
|
|
7
7
|
To use **turri**, install the CLI:
|
|
8
8
|
|
|
@@ -15,16 +15,22 @@ turri doctor
|
|
|
15
15
|
|
|
16
16
|
| import | what |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| `@turri-dev/core` | `createTurri`:
|
|
19
|
-
| `@turri-dev/core/
|
|
20
|
-
| `@turri-dev/core/
|
|
21
|
-
| `@turri-dev/core/
|
|
22
|
-
| `@turri-dev/core/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
| `@turri-dev/core` | `createTurri`: the session for any front end - its chats, work, launches, sentinel, settings and skills, its typed events and data |
|
|
19
|
+
| `@turri-dev/core/plain` | the \*\*\*plain language: parse, check, graph, concepts, highlighting, the standard library |
|
|
20
|
+
| `@turri-dev/core/project` | a project on disk with no session: config and settings, a first config, standing and drift, history, the ledger, capture |
|
|
21
|
+
| `@turri-dev/core/models` | vendors, Amazon Bedrock, pi's model catalogue, the providers signed in to |
|
|
22
|
+
| `@turri-dev/core/system` | the machine: `doctor`, the Node check, the core's version |
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createTurri } from "@turri-dev/core";
|
|
26
|
+
|
|
27
|
+
const turri = await createTurri({ frontend: { surface: "the app's own words for its views", shows: { pulseEnds: true } } });
|
|
28
|
+
turri.on("job", ({ job, final }) => { if (final) console.log(job.id, job.status); });
|
|
29
|
+
const chat = await turri.chats.open();
|
|
30
|
+
await chat.session.prompt("Build the todo app");
|
|
31
|
+
```
|
|
26
32
|
|
|
27
|
-
The package is ESM only, with TypeScript declarations, for Node 22.19 or newer.
|
|
33
|
+
The package is ESM only, with TypeScript declarations, for Node 22.19 or newer. A front end and the core share one `@earendil-works/pi-coding-agent` peer (1.6.0). The harness uses git and bash. A 0.x release may change the API - see [the core](docs/core.md) for the whole interface and [CHANGELOG.md](CHANGELOG.md) for what changed.
|
|
28
34
|
|
|
29
35
|
## Working on it
|
|
30
36
|
|
|
@@ -37,7 +43,7 @@ npm test # the whole suite, about a minute - calls no model
|
|
|
37
43
|
|
|
38
44
|
The TypeScript runs unbuilt, through Node's own type stripping. To try a change in the chat, link this clone into a clone of the CLI and start it with `NODE_OPTIONS=--conditions=turri-source`, so the core runs from `src/` - see [importing the core](docs/core.md#importing-the-core).
|
|
39
45
|
|
|
40
|
-
[The core](docs/core.md)
|
|
46
|
+
[The core](docs/core.md) is the interface: its entries, the session, the front end, its events, errors and versioning, and the boundary with what only a screen needs. [Development](docs/development.md) has the tests, the source layout and publishing; the other pages in [docs/](docs/README.md) say how each part behaves. Read [regenerating](docs/regenerating.md), [the sandbox](docs/sandbox.md) and [skills and gates](docs/skills-and-gates.md) before changing the harness, and [contributing](CONTRIBUTING.md) before opening a pull request.
|
|
41
47
|
|
|
42
48
|
## License
|
|
43
49
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** pi's id for this machine, as a provider's sign-in asks for it. */
|
|
2
|
+
export declare function loginDeviceId(cwd: string, agentDir?: string): string;
|
|
3
|
+
export { modelSpec, projectModels, splitModelSpec, THINKING_LEVELS, type ModelChoice, type ThinkingLevel } from "../config.ts";
|
|
4
|
+
export { bedrockRegionFor, type BedrockRegion, type BedrockRegionSource } from "../bedrock-region.ts";
|
|
5
|
+
export { BEDROCK_DEFAULT, BEDROCK_GEOGRAPHIES, BEDROCK_IN_REGION, BEDROCK_REGIONS, bedrockAwsRegion, bedrockDefaultModels, bedrockMakerOf, bedrockMakers, bedrockModels, bedrockModelsIn, bedrockNeedsAwsRegion, bedrockPlaceOf, bedrockRegionOf, hasPreset as hasBedrockPreset, makerLabel, priced, vendorOf, VENDORS, type BedrockChoice, type BedrockMaker, type BedrockOffer, type ModelSet, type PresetMaker, type Vendor, type VendorPreset, } from "../init-config.ts";
|
|
6
|
+
export type { AgentRole, ProjectConfig, RoleChoice, SentinelSetting } from "../config.ts";
|
|
7
|
+
export { AGENT_ROLES } from "../config.ts";
|
|
8
|
+
export { piModelCatalogue, type CatalogueModel, type ModelCatalogue } from "../model-check.ts";
|
|
9
|
+
export { installedModelRuntime, EXTENSION_PROVIDERS } from "../installed-providers.ts";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@turri-dev/core/models`: the models turri runs on - each vendor's pair, Amazon Bedrock's makers and geographies, pi's
|
|
3
|
+
* catalogue of models, model specs as config.turri.yaml writes them - and the providers signed in to.
|
|
4
|
+
*/
|
|
5
|
+
import { getAgentDir, SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
/** pi's id for this machine, as a provider's sign-in asks for it. */
|
|
7
|
+
export function loginDeviceId(cwd, agentDir = getAgentDir()) {
|
|
8
|
+
return SettingsManager.create(cwd, agentDir).getOrCreateDeviceId();
|
|
9
|
+
}
|
|
10
|
+
export { modelSpec, projectModels, splitModelSpec, THINKING_LEVELS } from "../config.js";
|
|
11
|
+
export { bedrockRegionFor } from "../bedrock-region.js";
|
|
12
|
+
export { BEDROCK_DEFAULT, BEDROCK_GEOGRAPHIES, BEDROCK_IN_REGION, BEDROCK_REGIONS, bedrockAwsRegion, bedrockDefaultModels, bedrockMakerOf, bedrockMakers, bedrockModels, bedrockModelsIn, bedrockNeedsAwsRegion, bedrockPlaceOf, bedrockRegionOf, hasPreset as hasBedrockPreset, makerLabel, priced, vendorOf, VENDORS, } from "../init-config.js";
|
|
13
|
+
export { AGENT_ROLES } from "../config.js";
|
|
14
|
+
export { piModelCatalogue } from "../model-check.js";
|
|
15
|
+
export { installedModelRuntime, EXTENSION_PROVIDERS } from "../installed-providers.js";
|
package/dist/api/plain.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
3
|
-
export { requiresOrder } from "../regenerate/requires.ts";
|
|
1
|
+
/** `@turri-dev/core/plain`: the ***plain language - parsing and checking it, its graph and concepts, highlighting it, and the standard library's stacks. */
|
|
2
|
+
export { requiresOrder } from "../regenerate/requires-chain.ts";
|
|
4
3
|
export { resolveTemplateDirs } from "../regenerate/paths.ts";
|
|
5
|
-
export { checkPlainFile, checkPlainTargets, formatCheckResults, type CheckResult } from "../plain/check.ts";
|
|
6
|
-
export { plainFileParser } from "../plain/parser.ts";
|
|
7
|
-
export { ACCEPTANCE_TEST_HEADING, CONFORMANCE_TEST_HEADING, DEFINITIONS, FUNCTIONAL_REQUIREMENTS, NON_FUNCTIONAL_REQUIREMENTS, TEST_REQUIREMENTS, iterateFunctionalSpecs } from "../plain/spec.ts";
|
|
4
|
+
export { checkPlainFile, checkPlainTargets, formatCheckResults, type CheckedFunctionalSpec, type CheckResult } from "../plain/check.ts";
|
|
5
|
+
export { plainFileParser, type ParseOptions } from "../plain/parser.ts";
|
|
6
|
+
export { ACCEPTANCE_TEST_HEADING, ACCEPTANCE_TESTS, CONFORMANCE_TEST_HEADING, CONFORMANCE_TESTS, DEFINITIONS, FUNCTIONAL_REQUIREMENTS, NON_FUNCTIONAL_REQUIREMENTS, TEST_REQUIREMENTS, iterateFunctionalSpecs, type MarshalledPlainSource, type ScenarioText, type Specifications } from "../plain/spec.ts";
|
|
8
7
|
export { highlightLine, highlightLines, roleOf, type HighlightState, type PlainRole, type Token } from "../plain/highlight.ts";
|
|
9
8
|
export { RESOURCE_MARKER } from "../plain/markdown.ts";
|
|
10
9
|
export { conceptsOf, type ModuleConcept } from "../plain/module-concepts.ts";
|
|
11
10
|
export { conceptBeingTyped, findConcepts } from "../plain/concepts.ts";
|
|
12
11
|
export { plainGraph, type PlainConceptNode, type PlainGraph, type PlainItemNode, type PlainLink, type PlainModuleNode, type PlainScenario, type PlainSection, type PlainTestPlainFileNode } from "../plain/graph.ts";
|
|
13
12
|
export { isStack, STDLIB_KINDS, stdlibTemplates, type StdlibKind, type StdlibTemplate } from "../stdlib.ts";
|
|
13
|
+
export { DIFF_HEADER, locateDiffLines, type DiffWhere } from "../regenerate/diff-where.ts";
|
package/dist/api/plain.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function projectStanding(projectDir, files) {
|
|
4
|
-
return standing(projectDir, { files });
|
|
5
|
-
}
|
|
6
|
-
export { requiresOrder } from "../regenerate/requires.js";
|
|
1
|
+
/** `@turri-dev/core/plain`: the ***plain language - parsing and checking it, its graph and concepts, highlighting it, and the standard library's stacks. */
|
|
2
|
+
export { requiresOrder } from "../regenerate/requires-chain.js";
|
|
7
3
|
export { resolveTemplateDirs } from "../regenerate/paths.js";
|
|
8
4
|
export { checkPlainFile, checkPlainTargets, formatCheckResults } from "../plain/check.js";
|
|
9
5
|
export { plainFileParser } from "../plain/parser.js";
|
|
10
|
-
export { ACCEPTANCE_TEST_HEADING, CONFORMANCE_TEST_HEADING, DEFINITIONS, FUNCTIONAL_REQUIREMENTS, NON_FUNCTIONAL_REQUIREMENTS, TEST_REQUIREMENTS, iterateFunctionalSpecs } from "../plain/spec.js";
|
|
6
|
+
export { ACCEPTANCE_TEST_HEADING, ACCEPTANCE_TESTS, CONFORMANCE_TEST_HEADING, CONFORMANCE_TESTS, DEFINITIONS, FUNCTIONAL_REQUIREMENTS, NON_FUNCTIONAL_REQUIREMENTS, TEST_REQUIREMENTS, iterateFunctionalSpecs } from "../plain/spec.js";
|
|
11
7
|
export { highlightLine, highlightLines, roleOf } from "../plain/highlight.js";
|
|
12
8
|
export { RESOURCE_MARKER } from "../plain/markdown.js";
|
|
13
9
|
export { conceptsOf } from "../plain/module-concepts.js";
|
|
14
10
|
export { conceptBeingTyped, findConcepts } from "../plain/concepts.js";
|
|
15
11
|
export { plainGraph } from "../plain/graph.js";
|
|
16
12
|
export { isStack, STDLIB_KINDS, stdlibTemplates } from "../stdlib.js";
|
|
13
|
+
export { DIFF_HEADER, locateDiffLines } from "../regenerate/diff-where.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ModuleStanding } from "../regenerate/standing.ts";
|
|
2
|
+
/** How far each module is built and conformed, and what drifted, read from disk - a session's `work.standing` knows its live work too. */
|
|
3
|
+
export declare function projectStanding(projectDir: string, files?: string[]): ModuleStanding[];
|
|
4
|
+
/** The conversations pi has saved for the project, including ones not open in a chat. */
|
|
5
|
+
export declare function savedChatFiles(cwd: string, sessionDir?: string): Promise<string[]>;
|
|
6
|
+
/** Where pi keeps the credentials of the providers signed in to. */
|
|
7
|
+
export declare function credentialsFile(agentDir?: string): string;
|
|
8
|
+
export { AGENT_ROLES, CONFIG_FILE, configForSpec, configLines, configuredModel, debugMode, DEFAULT_TEST_DIR, hasProjectConfig, moduleConfigsOf, readProjectConfig, skillModel, testDirOf, type AgentRole, type ConfigLine, type ConfigLineKind, type ProjectConfig, type RoleChoice, type SentinelSetting, type ThinkingLevel } from "../config.ts";
|
|
9
|
+
export { configSettings, EFFECT_TEXT, overriddenBy, readConfigText, readSetting, settingTakes, type Effect, type ModelRole, type Setting, type SettingKey, type SettingKind, type SettingValues } from "../config-edit.ts";
|
|
10
|
+
export { initConfig, PLAIN_PAINT, type InitConfigOptions, type ModelPair, type Paint } from "../init-config.ts";
|
|
11
|
+
export { MODULES_DIR, projectDirOf } from "../regenerate/paths.ts";
|
|
12
|
+
export { defaultParallelJobs } from "../regenerate/jobs.ts";
|
|
13
|
+
export { describeDrift, describeModules, type DriftReport } from "../regenerate/loop.ts";
|
|
14
|
+
export { readDrift, launchModule } from "../project.ts";
|
|
15
|
+
/**
|
|
16
|
+
* A module's lineage, newest first: each commit of its code and tests - when, and what it was regenerated from - one a
|
|
17
|
+
* line, the last `limit` (30). `cwd`: the project's folder, the process's by default. Says so when there is none yet.
|
|
18
|
+
*/
|
|
19
|
+
export declare function historyLog(module: string, options?: {
|
|
20
|
+
cwd?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}): string;
|
|
23
|
+
/** One commit of a module's lineage in full: what it says, the files it changed, and how. */
|
|
24
|
+
export declare function historyShow(module: string, commit: string, options?: {
|
|
25
|
+
cwd?: string;
|
|
26
|
+
}): string;
|
|
27
|
+
export { lastRun, type ChatRecord, type RunRecord } from "../chat-records.ts";
|
|
28
|
+
export { ledgerDir, readLedger, type AgentRef, type LedgerEntry, type LedgerEvent, type LedgerKind, type LedgerQuery } from "../regenerate/ledger.ts";
|
|
29
|
+
export { asJob, describePulseView, describeRuns, earlierPulses, ledgerProjects, pulseView, runViews, type PulseView, type RunView } from "../regenerate/ledger-view.ts";
|
|
30
|
+
export { runCapture, CaptureError, DEFAULT_PARALLEL, type CaptureOptions, type CaptureResult } from "../capture/capture.ts";
|
|
31
|
+
export type { Convention, Definition, Part } from "../capture/state.ts";
|
|
32
|
+
export type { ScriptRequest, ScriptWriter } from "../capture/scripts.ts";
|
|
33
|
+
export { exportCode, type ExportResult } from "../work.ts";
|
|
34
|
+
export { checkModule, checkModules } from "../module-check.ts";
|
|
35
|
+
export type { ModuleStanding } from "../regenerate/standing.ts";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@turri-dev/core/project`: a project on disk, with no session open - its modules checked in it, its config read, its
|
|
3
|
+
* settings' catalogue and edits, a project's first config (`initConfig`), how far its modules are built and what drifted, their history, the
|
|
4
|
+
* ledger of what turri did, the chats of its last run, capturing an existing codebase into ***plain, and launching its
|
|
5
|
+
* code on its own.
|
|
6
|
+
*/
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { getAgentDir, SessionManager } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import { projectStanding as standing } from "../regenerate/standing.js";
|
|
10
|
+
/** How far each module is built and conformed, and what drifted, read from disk - a session's `work.standing` knows its live work too. */
|
|
11
|
+
export function projectStanding(projectDir, files) {
|
|
12
|
+
return standing(projectDir, files !== undefined ? { files } : {});
|
|
13
|
+
}
|
|
14
|
+
/** The conversations pi has saved for the project, including ones not open in a chat. */
|
|
15
|
+
export async function savedChatFiles(cwd, sessionDir) {
|
|
16
|
+
return (await SessionManager.list(cwd, sessionDir)).map((session) => session.path);
|
|
17
|
+
}
|
|
18
|
+
/** Where pi keeps the credentials of the providers signed in to. */
|
|
19
|
+
export function credentialsFile(agentDir = getAgentDir()) {
|
|
20
|
+
return join(agentDir, "auth.json");
|
|
21
|
+
}
|
|
22
|
+
export { AGENT_ROLES, CONFIG_FILE, configForSpec, configLines, configuredModel, debugMode, DEFAULT_TEST_DIR, hasProjectConfig, moduleConfigsOf, readProjectConfig, skillModel, testDirOf } from "../config.js";
|
|
23
|
+
export { configSettings, EFFECT_TEXT, overriddenBy, readConfigText, readSetting, settingTakes } from "../config-edit.js";
|
|
24
|
+
export { initConfig, PLAIN_PAINT } from "../init-config.js";
|
|
25
|
+
export { MODULES_DIR, projectDirOf } from "../regenerate/paths.js";
|
|
26
|
+
export { defaultParallelJobs } from "../regenerate/jobs.js";
|
|
27
|
+
export { describeDrift, describeModules } from "../regenerate/loop.js";
|
|
28
|
+
export { readDrift, launchModule } from "../project.js";
|
|
29
|
+
import { historyLog as codeHistoryLog, historyShow as codeHistoryShow } from "../regenerate/lineage.js";
|
|
30
|
+
import { defaultBuildDir } from "../regenerate/paths.js";
|
|
31
|
+
/**
|
|
32
|
+
* A module's lineage, newest first: each commit of its code and tests - when, and what it was regenerated from - one a
|
|
33
|
+
* line, the last `limit` (30). `cwd`: the project's folder, the process's by default. Says so when there is none yet.
|
|
34
|
+
*/
|
|
35
|
+
export function historyLog(module, options = {}) {
|
|
36
|
+
return codeHistoryLog(defaultBuildDir(module, options.cwd), options.limit);
|
|
37
|
+
}
|
|
38
|
+
/** One commit of a module's lineage in full: what it says, the files it changed, and how. */
|
|
39
|
+
export function historyShow(module, commit, options = {}) {
|
|
40
|
+
return codeHistoryShow(defaultBuildDir(module, options.cwd), commit);
|
|
41
|
+
}
|
|
42
|
+
export { lastRun } from "../chat-records.js";
|
|
43
|
+
export { ledgerDir, readLedger } from "../regenerate/ledger.js";
|
|
44
|
+
export { asJob, describePulseView, describeRuns, earlierPulses, ledgerProjects, pulseView, runViews } from "../regenerate/ledger-view.js";
|
|
45
|
+
export { runCapture, CaptureError, DEFAULT_PARALLEL } from "../capture/capture.js";
|
|
46
|
+
export { exportCode } from "../work.js";
|
|
47
|
+
export { checkModule, checkModules } from "../module-check.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@turri-dev/core`: turri's session, for any front end - its chats, work, launches, notices, sentinel, settings and
|
|
3
|
+
* skills, the events it emits, and the data they carry; with turri's own words for that data, where a front end shows
|
|
4
|
+
* them. Reading a project on disk without a session is `/project`; the ***plain language is `/plain`; models and
|
|
5
|
+
* sign-in are `/models`; the machine is `/system`.
|
|
6
|
+
*/
|
|
7
|
+
export { createTurri, type CaptureEnd, type Chat, type ExternalSessions, type Frontend, type HaltTarget, type LaunchOptions, type ManagedSessions, type NoSessions, type Question, type RevealTarget, type SessionOverrides, type SessionRequest, type SkillGate, type SkillInfo, type SkillReport, type SkillResult, type SkillStep, type SkillRunOptions, type Turri, type TurriEvent, type TurriEventMap, type TurriEventType, type TurriOptions, type WorkStatus, } from "../session.ts";
|
|
8
|
+
export { isTurriError, TurriError, type TurriErrorCode } from "../errors.ts";
|
|
9
|
+
export type { ClientInfo } from "../client.ts";
|
|
10
|
+
export type { ModelOutOfReach } from "../chat-model.ts";
|
|
11
|
+
export { MAX_CHATS, type ChatInfo, type ChatStatus } from "../chats.ts";
|
|
12
|
+
export type { RunRecord } from "../chat-records.ts";
|
|
13
|
+
export { BANNER_ENTRY, COMMAND_OUTCOME, CONCLUDED_ENTRY, HISTORY_ENTRY, INTERVIEW_ENTRY, JOB_ENTRY, JOB_LANDED_MESSAGE, JOBS_LIST_ENTRY, LAUNCH_MESSAGE, MILESTONE_ENTRY, NOTICE_ANSWER_MESSAGE, NOTICE_ENTRY, NOTICE_OVER_ENTRY, SENTINEL_CHECK_MESSAGE, SENTINEL_PULSE_MESSAGE, SENTINEL_RESUME_MESSAGE, SIDE_ENTRY, SKILL_MESSAGE_ENTRY, SKILL_REPORT_ENTRY, SKILL_RUN_ENTRY, SPEC_CONFLICT_MESSAGE, VERSION_ENTRY, isChatEntry, isChatEntryOf, type BannerData, type ChatEntry, type ChatEntryMap, type ChatEntryOf, type ChatEntryType, type ChatMessageMap, type ChatMessageOf, type CommandOutcome, type Exchange, type JobAnnouncement, } from "../chat-entries.ts";
|
|
14
|
+
export type { SkillProgress } from "../session-events.ts";
|
|
15
|
+
export type { SessionSpending } from "../session-spending.ts";
|
|
16
|
+
export { CAPTURE_PHASES, COMPACT_PHASES, capturePhases, captureStageText, type CaptureStatus } from "../capture/progress.ts";
|
|
17
|
+
export type { CaptureResult } from "../capture/capture.ts";
|
|
18
|
+
export { SENTINEL, SENTINEL_START, type Conclusion, type Notice, type NoticeAction, type NoticeAnswer, type NoticeSeverity, type NoticeState, type SentinelCheck } from "../notice.ts";
|
|
19
|
+
export type { CheckRequest } from "../sentinel-check.ts";
|
|
20
|
+
export { launchText, type Launch, type LaunchStatus, type LaunchStopped } from "../launch-track.ts";
|
|
21
|
+
export { formatDuration, pulseName, type Job, type JobDetails, type PulseCases, type PulseSpec } from "../regenerate/jobs.ts";
|
|
22
|
+
export { didNotPass, pulseCost } from "../regenerate/job-panel.ts";
|
|
23
|
+
export { describeAgents, type ModelEvent, type TranscriptEntry } from "../regenerate/activity.ts";
|
|
24
|
+
export type { SpecGap } from "../regenerate/notes.ts";
|
|
25
|
+
export type { DriftReport, ModuleStatus, PlannedPulse } from "../regenerate/loop.ts";
|
|
26
|
+
export type { ModuleStanding } from "../regenerate/standing.ts";
|
|
27
|
+
export type { ModuleState } from "../run-report.ts";
|
|
28
|
+
export type { RunView } from "../regenerate/ledger-view.ts";
|
|
29
|
+
export { countOf, focusOf, hasScenarioViews, lineDiff, rungOf, type Mark, type MarkedItem, type MarkedPage, type Rung } from "../regenerate/spec-map.ts";
|
|
30
|
+
export type { ExportResult, StartOverQuestion, WorkRequest, WorkResult, WorkRunOptions } from "../work.ts";
|
|
31
|
+
export type { ChatRole, NoticeInput } from "../notice.ts";
|
|
32
|
+
export type { ChatRecord } from "../chat-records.ts";
|
|
33
|
+
export type { ConfigLine, ConfigLineKind } from "../config.ts";
|
|
34
|
+
export type { ModelRole, SettingKey, SettingValues } from "../config-edit.ts";
|
|
35
|
+
export type { JobRef, TranscriptRecord } from "../chat-entries.ts";
|
|
36
|
+
export type { JobStatus } from "../regenerate/jobs.ts";
|
|
37
|
+
export type { AgentTally, BuildingSpec, SpecConflict, UsageReport } from "../regenerate/activity.ts";
|
|
38
|
+
export type { JobCases, ScenarioCases, ScenarioRef, TouchedSpec } from "../regenerate/drift.ts";
|
|
39
|
+
export type { LaunchCause } from "../launch-track.ts";
|
|
40
|
+
export type { ExportedCode, LaunchedProcess } from "../regenerate/launch.ts";
|
|
41
|
+
export type { ItemState, MapItem, MapPage, MapScenarios } from "../regenerate/spec-map.ts";
|
|
42
|
+
export type { MapCodebase, MapPulse, ModuleCompletion, Track } from "../regenerate/loop.ts";
|
|
43
|
+
export type { CaptureAgentStatus, CaptureStage } from "../capture/progress.ts";
|
|
44
|
+
export type { AgentRef, LedgerEntry, LedgerEvent } from "../regenerate/ledger.ts";
|
|
45
|
+
export type { LedgerEntryOf, PulseView } from "../regenerate/ledger-view.ts";
|
|
46
|
+
export type { DiffWhere } from "../regenerate/diff-where.ts";
|
|
47
|
+
export type { ScriptKind } from "../regenerate/test-scripts.ts";
|
|
48
|
+
export type { SandboxSummary, Wall } from "../regenerate/os-sandbox.ts";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@turri-dev/core`: turri's session, for any front end - its chats, work, launches, notices, sentinel, settings and
|
|
3
|
+
* skills, the events it emits, and the data they carry; with turri's own words for that data, where a front end shows
|
|
4
|
+
* them. Reading a project on disk without a session is `/project`; the ***plain language is `/plain`; models and
|
|
5
|
+
* sign-in are `/models`; the machine is `/system`.
|
|
6
|
+
*/
|
|
7
|
+
export { createTurri, } from "../session.js";
|
|
8
|
+
export { isTurriError, TurriError } from "../errors.js";
|
|
9
|
+
export { MAX_CHATS } from "../chats.js";
|
|
10
|
+
export { BANNER_ENTRY, COMMAND_OUTCOME, CONCLUDED_ENTRY, HISTORY_ENTRY, INTERVIEW_ENTRY, JOB_ENTRY, JOB_LANDED_MESSAGE, JOBS_LIST_ENTRY, LAUNCH_MESSAGE, MILESTONE_ENTRY, NOTICE_ANSWER_MESSAGE, NOTICE_ENTRY, NOTICE_OVER_ENTRY, SENTINEL_CHECK_MESSAGE, SENTINEL_PULSE_MESSAGE, SENTINEL_RESUME_MESSAGE, SIDE_ENTRY, SKILL_MESSAGE_ENTRY, SKILL_REPORT_ENTRY, SKILL_RUN_ENTRY, SPEC_CONFLICT_MESSAGE, VERSION_ENTRY, isChatEntry, isChatEntryOf, } from "../chat-entries.js";
|
|
11
|
+
export { CAPTURE_PHASES, COMPACT_PHASES, capturePhases, captureStageText } from "../capture/progress.js";
|
|
12
|
+
export { SENTINEL, SENTINEL_START } from "../notice.js";
|
|
13
|
+
export { launchText } from "../launch-track.js";
|
|
14
|
+
export { formatDuration, pulseName } from "../regenerate/jobs.js";
|
|
15
|
+
export { didNotPass, pulseCost } from "../regenerate/job-panel.js";
|
|
16
|
+
export { describeAgents } from "../regenerate/activity.js";
|
|
17
|
+
export { countOf, focusOf, hasScenarioViews, lineDiff, rungOf } from "../regenerate/spec-map.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DoctorOptions } from "../doctor-checks.ts";
|
|
2
|
+
import type { Check } from "../node-check.ts";
|
|
3
|
+
/** The core's own version - and its commit, when it runs from a clone - with the pi it runs on. */
|
|
4
|
+
export declare function coreVersion(): {
|
|
5
|
+
version: string | null;
|
|
6
|
+
commit: string | null;
|
|
7
|
+
changed: boolean | null;
|
|
8
|
+
pi: string | null;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Whether this machine - and, with `dir`, that project - is ready for turri, as checks: each named, with what to do when
|
|
12
|
+
* it is not. It prints nothing and asks nothing; with `models`, each model is asked for a word, which costs money.
|
|
13
|
+
*/
|
|
14
|
+
export declare function doctor(options?: DoctorOptions): Promise<Check[]>;
|
|
15
|
+
export { asksModels, verdictOf, describeChecks, type DoctorModels, type DoctorOptions } from "../doctor-checks.ts";
|
|
16
|
+
export { checkNode, type Check, type Level } from "../node-check.ts";
|
|
17
|
+
export { MIN_NODE, nodeVersionOk } from "../environment.ts";
|
|
18
|
+
export { machineChange, machineChangeReason } from "../regenerate/command-check.ts";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@turri-dev/core/system`: the machine turri runs on - whether it is ready (`doctor`, each check with a stable name),
|
|
3
|
+
* the Node it needs, what an agent's command would change on it, and the core's own version.
|
|
4
|
+
*/
|
|
5
|
+
import { coreIdentity, piVersion } from "../environment.js";
|
|
6
|
+
/** The core's own version - and its commit, when it runs from a clone - with the pi it runs on. */
|
|
7
|
+
export function coreVersion() {
|
|
8
|
+
const identity = coreIdentity();
|
|
9
|
+
return { version: identity.version, commit: identity.git_commit, changed: identity.git_dirty, pi: piVersion() ?? null };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Whether this machine - and, with `dir`, that project - is ready for turri, as checks: each named, with what to do when
|
|
13
|
+
* it is not. It prints nothing and asks nothing; with `models`, each model is asked for a word, which costs money.
|
|
14
|
+
*/
|
|
15
|
+
export async function doctor(options = {}) {
|
|
16
|
+
// The checks of providers and models load pi: only once doctor runs, so the rest of this entry loads none.
|
|
17
|
+
const { doctor: check } = await import("../setup.js");
|
|
18
|
+
return check(options);
|
|
19
|
+
}
|
|
20
|
+
export { asksModels, verdictOf, describeChecks } from "../doctor-checks.js";
|
|
21
|
+
export { checkNode } from "../node-check.js";
|
|
22
|
+
export { MIN_NODE, nodeVersionOk } from "../environment.js";
|
|
23
|
+
export { machineChange, machineChangeReason } from "../regenerate/command-check.js";
|
package/dist/btw.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface SideQuestion {
|
|
|
53
53
|
projectDir: string;
|
|
54
54
|
/** turri's own folder: its source, skills, rules and docs. */
|
|
55
55
|
harnessDir: string;
|
|
56
|
-
/**
|
|
56
|
+
/** The front end's surface, in its own words (TurriHost.surface): where the person watches the work. None: no view is named. */
|
|
57
57
|
surface?: string;
|
|
58
58
|
}
|
|
59
59
|
export declare function sideQuestionPrompt(side: SideQuestion): string;
|
package/dist/capture/capture.js
CHANGED
|
@@ -4,8 +4,9 @@ import { CONFIG_FILE, inheritModel, modelSpec, projectModels, readProjectConfig,
|
|
|
4
4
|
import { captureDefaults } from "./models.js";
|
|
5
5
|
import { writeSetting } from "../config-edit.js";
|
|
6
6
|
import { slashed } from "../regenerate/paths.js";
|
|
7
|
+
import { applyBedrockRegion } from "../bedrock-region.js";
|
|
7
8
|
import { findTestScripts, testingScriptSkill } from "../regenerate/test-scripts.js";
|
|
8
|
-
import {
|
|
9
|
+
import { checkModule } from "../module-check.js";
|
|
9
10
|
import { conformanceOf, stdlibCatalogue, stdlibTemplates } from "../stdlib.js";
|
|
10
11
|
import { AREAS_TOOL, askAgent, capturePrompt, watched, COMPACT_TOOL, CONCEPTS_TOOL, CONVENTIONS_TOOL, CORRECTIONS_TOOL, definitionsOf, EDITS_TOOL, FEATURE_TOOL, FEATURES_TOOL, INTERFACE_TOOL, leftOutOf, MODULES_TOOL, OWNERS_TOOL, records, REFERENCE_CHECKED_TOOL, REFERENCE_TOOL, strings, SURVEY_TOOL, text, TRIAL_TOOL } from "./agents.js";
|
|
11
12
|
import { buildOrder, covers, entriesOf, filesOf, kebab, linesOf, renderArea, testEvidence } from "./area.js";
|
|
@@ -16,7 +17,7 @@ import { buildMap, INTERFACE_KINDS } from "./map.js";
|
|
|
16
17
|
import { CaptureTracker, findingLine } from "./progress.js";
|
|
17
18
|
import { capturePlan } from "./plan.js";
|
|
18
19
|
import { pythonInterface } from "./python-interface.js";
|
|
19
|
-
import { configInUse, configInUseProblem
|
|
20
|
+
import { captureConfig, configInUse, configInUseProblem } from "./config.js";
|
|
20
21
|
import { renderReport, summaryOf } from "./report.js";
|
|
21
22
|
import { writeTestingScript } from "./scripts.js";
|
|
22
23
|
import { runnerChoices, reuseRunner } from "./runners.js";
|
|
@@ -79,8 +80,8 @@ export async function runCapture(options) {
|
|
|
79
80
|
throw new CaptureError(`Nothing captured: ${found.why}. Capture writes into a folder of its own - name another.`);
|
|
80
81
|
const source = options.configFrom !== undefined ? configInUse(options.configFrom) : undefined;
|
|
81
82
|
const configPath = join(plainDir, CONFIG_FILE);
|
|
82
|
-
const
|
|
83
|
-
const unusable =
|
|
83
|
+
const savedConfig = existsSync(configPath) ? readFileSync(configPath, "utf8") : undefined;
|
|
84
|
+
const unusable = configInUseProblem(source) ?? (savedConfig !== undefined ? configInUseProblem(configPath) : undefined);
|
|
84
85
|
if (unusable !== undefined)
|
|
85
86
|
throw new CaptureError(unusable);
|
|
86
87
|
const tracker = new CaptureTracker(root, options.progress, options.watch);
|
|
@@ -95,13 +96,15 @@ export async function runCapture(options) {
|
|
|
95
96
|
saveState(plainDir, state);
|
|
96
97
|
tracker.counted(state);
|
|
97
98
|
};
|
|
98
|
-
const
|
|
99
|
+
const config = await captureConfig(source, { harnessModel: options.harnessModel ?? options.model, codingModel: options.codingModel }, savedConfig);
|
|
99
100
|
save();
|
|
100
101
|
tracker.said(`${state.plan.kind} capture: ${state.plan.reason}`);
|
|
101
102
|
// The config in use, from the start - after the state, so a capture stopped here goes on: its agents run on its models,
|
|
102
103
|
// and the project it writes keeps them.
|
|
103
|
-
if (
|
|
104
|
-
writeFileSync(configPath,
|
|
104
|
+
if (config !== savedConfig)
|
|
105
|
+
writeFileSync(configPath, config);
|
|
106
|
+
// The AWS region its Bedrock models need, set as a session sets it as it opens: a capture calls them with none open.
|
|
107
|
+
applyBedrockRegion(plainDir);
|
|
105
108
|
const inUse = projectModels(readProjectConfig(plainDir));
|
|
106
109
|
const model = options.model ?? options.harnessModel ?? modelSpec(inUse.harness);
|
|
107
110
|
const codingModel = options.codingModel ?? modelSpec(inUse.coding);
|
|
@@ -1072,7 +1075,7 @@ class CaptureRun {
|
|
|
1072
1075
|
finish() {
|
|
1073
1076
|
const { plainDir } = this.options;
|
|
1074
1077
|
const assembly = assemble(this.state, this.options.moduleSpecs);
|
|
1075
|
-
const checks = assembly.modules.map((module) =>
|
|
1078
|
+
const checks = assembly.modules.map((module) => checkModule(join(plainDir, `${module.name}.plain`)));
|
|
1076
1079
|
this.state.finished = new Date().toISOString();
|
|
1077
1080
|
const report = renderReport({ root: this.options.root, plainDir, map: this.map, state: this.state, assembly, checks });
|
|
1078
1081
|
writeFileSync(reportFile(plainDir), report);
|
package/dist/capture/chat.d.ts
CHANGED
|
@@ -15,15 +15,4 @@ export declare function captureGoesOn(root: string): boolean;
|
|
|
15
15
|
* regenerated by opening turri in its folder.
|
|
16
16
|
*/
|
|
17
17
|
export declare function captureEnded(cwd: string, result: Pick<CaptureResult, "plainDir" | "reportFile" | "summary">): SkillRunEnd;
|
|
18
|
-
/** What the person is asked once a capture in the chat ends: to open turri again in the captured project. */
|
|
19
|
-
export declare function captureOpenQuestion(cwd: string, result: Pick<CaptureResult, "plainDir" | "summary">): {
|
|
20
|
-
title: string;
|
|
21
|
-
message: string;
|
|
22
|
-
};
|
|
23
|
-
/** What a turri opened again after a capture is told at its start: what the capture said of itself. */
|
|
24
|
-
export declare function reopenedAfterCapture(summary: string): string;
|
|
25
|
-
/** What a turri opened again after a capture was told, or undefined when it is not that turri. */
|
|
26
|
-
export declare function readReopenedAfterCapture(told: string | undefined): {
|
|
27
|
-
summary: string;
|
|
28
|
-
} | undefined;
|
|
29
18
|
export declare function captureFailed(error: unknown): SkillRunEnd;
|
package/dist/capture/chat.js
CHANGED
|
@@ -49,35 +49,6 @@ export function captureEnded(cwd, result) {
|
|
|
49
49
|
].join("\n"),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
/** What the person is asked once a capture in the chat ends: to open turri again in the captured project. */
|
|
53
|
-
export function captureOpenQuestion(cwd, result) {
|
|
54
|
-
const folder = `${relative(cwd, result.plainDir) || result.plainDir}/`;
|
|
55
|
-
return {
|
|
56
|
-
title: `Open the captured ***plain in ${folder}?`,
|
|
57
|
-
message: [
|
|
58
|
-
result.summary,
|
|
59
|
-
"",
|
|
60
|
-
`turri closes here and opens again in ${folder} - the captured project - where ctrl+h shows its ***plain and /regenerate builds it. Its report is told there.`,
|
|
61
|
-
`Not now: it stays here, and \`cd ${folder.slice(0, -1)} && turri\` opens it later.`,
|
|
62
|
-
].join("\n"),
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
/** What a turri opened again after a capture is told at its start: what the capture said of itself. */
|
|
66
|
-
export function reopenedAfterCapture(summary) {
|
|
67
|
-
return JSON.stringify({ summary });
|
|
68
|
-
}
|
|
69
|
-
/** What a turri opened again after a capture was told, or undefined when it is not that turri. */
|
|
70
|
-
export function readReopenedAfterCapture(told) {
|
|
71
|
-
if (told === undefined)
|
|
72
|
-
return undefined;
|
|
73
|
-
try {
|
|
74
|
-
const parsed = JSON.parse(told);
|
|
75
|
-
return typeof parsed.summary === "string" ? { summary: parsed.summary } : undefined;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
52
|
export function captureFailed(error) {
|
|
82
53
|
const why = error instanceof Error ? error.message : String(error);
|
|
83
54
|
return {
|
package/dist/capture/config.d.ts
CHANGED
|
@@ -3,11 +3,10 @@ export declare function configInUse(dir: string): string | undefined;
|
|
|
3
3
|
/** Why the config in use cannot be started from - it does not parse - or undefined. */
|
|
4
4
|
export declare function configInUseProblem(file: string | undefined): string | undefined;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* where the config in use says otherwise.
|
|
6
|
+
* Start from the config in use. On resume, keep the capture's own settings (including any scripts already written)
|
|
7
|
+
* but take the project and capture models from the current source config, which may have been initialised since.
|
|
9
8
|
*/
|
|
10
|
-
export declare function
|
|
9
|
+
export declare function captureConfig(source: string | undefined, given: {
|
|
11
10
|
harnessModel?: string;
|
|
12
11
|
codingModel?: string;
|
|
13
|
-
}): Promise<string>;
|
|
12
|
+
}, saved?: string): Promise<string>;
|