@jawache/flow 0.2.1 → 0.3.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.
- package/README.md +52 -277
- package/dist/flow.mjs +12290 -124
- package/dist/index.mjs +7945 -24
- package/dist/packs.mjs +9468 -141
- package/dist/types/adapter/claude.d.ts +23 -15
- package/dist/types/adapter/domain.d.ts +630 -153
- package/dist/types/adapter/product.d.ts +5 -0
- package/dist/types/checks/domain.d.ts +111 -106
- package/dist/types/engine/domain.d.ts +65 -15
- package/dist/types/engine/state.d.ts +7 -4
- package/dist/types/index.d.ts +3 -2
- package/dist/types/language/domain.d.ts +204 -21
- package/dist/types/packs/docs.d.ts +17 -13
- package/dist/types/packs/flow.d.ts +15 -5
- package/dist/types/packs/git.d.ts +20 -25
- package/dist/types/packs/justfile.d.ts +3 -3
- package/dist/types/packs/secrets.d.ts +32 -4
- package/dist/types/packs/work.d.ts +4 -4
- package/docs/user/migrations/0.1.0.md +142 -0
- package/docs/user/migrations/0.1.1.md +44 -0
- package/docs/user/migrations/0.1.2.md +58 -0
- package/docs/user/migrations/0.2.0.md +113 -0
- package/docs/user/migrations/0.2.1.md +41 -0
- package/docs/user/migrations/0.2.2.md +104 -0
- package/docs/user/migrations/0.2.3.md +42 -0
- package/docs/user/migrations/0.3.0.md +289 -0
- package/docs/user/migrations/index.md +45 -0
- package/package.json +5 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ExecResult, type FlowConfig, type LoadResult, type Grammar, type Settings, type World } from "../language/domain.ts";
|
|
2
|
-
import { type
|
|
2
|
+
import { type AgentOf } from "../engine/domain.ts";
|
|
3
|
+
import { type CommitScope, type CallRecord, type Change, type Delta, type HookEvent, type HookPayload, type HookResult } from "./domain.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Run one command the way a check means it — through a shell, in the repo, hermetically.
|
|
5
6
|
*
|
|
@@ -13,7 +14,7 @@ import { type CallRecord, type Change, type Delta, type HookEvent, type HookPayl
|
|
|
13
14
|
* installed refuses the commit instead of passing it. bash answers 127 itself; the only case left
|
|
14
15
|
* is bash being unspawnable, which is the same fact one level up and is answered the same way.
|
|
15
16
|
*/
|
|
16
|
-
export declare function runCommand(command: string, root: string): ExecResult;
|
|
17
|
+
export declare function runCommand(command: string, root: string, env?: Record<string, string | undefined>): ExecResult;
|
|
17
18
|
/** A file's text, or null when it is not there / not readable. */
|
|
18
19
|
export declare function readText(root: string, path: string): string | null;
|
|
19
20
|
/**
|
|
@@ -52,14 +53,14 @@ export declare function currentBranch(root: string): string | null;
|
|
|
52
53
|
* who is here — and a rule that fires at the gate for a wearer status never showed is the exact
|
|
53
54
|
* surprise the marker exists to prevent.
|
|
54
55
|
*
|
|
55
|
-
* `
|
|
56
|
-
* rather than a guess: there is no transcript and no
|
|
57
|
-
* only truthful answer there can be.
|
|
56
|
+
* `who` is null when the marker is missing, stale or malformed, and then the wearer wears NOTHING
|
|
57
|
+
* rather than a guess: there is no transcript and no hook message out here, so the stored verdict is
|
|
58
|
+
* the only truthful answer there can be.
|
|
58
59
|
*/
|
|
59
60
|
export declare function wearer(root: string): {
|
|
60
61
|
readonly branch: string | null;
|
|
61
62
|
readonly session: string;
|
|
62
|
-
readonly
|
|
63
|
+
readonly who: AgentOf | null;
|
|
63
64
|
readonly wearing: readonly string[];
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
@@ -76,7 +77,8 @@ export declare function takeSnapshot(root: string, key: string, include: readonl
|
|
|
76
77
|
}): void;
|
|
77
78
|
/**
|
|
78
79
|
* WHAT THE CALL CHANGED: the tree now against the tree its snapshot recorded, path by path, with
|
|
79
|
-
* the content either side
|
|
80
|
+
* the content either side, less each path git put there (see `authored`). The before-snapshot is
|
|
81
|
+
* kept — a revert reads from it — until `forget`.
|
|
80
82
|
*/
|
|
81
83
|
export declare function observeDelta(root: string, key: string, include: readonly string[]): Delta & {
|
|
82
84
|
readonly before?: string;
|
|
@@ -115,10 +117,10 @@ export declare function projectRoot(cwd: string): string;
|
|
|
115
117
|
* once in the host's settings and fire in every repo the agent visits, so a missing config is the
|
|
116
118
|
* ordinary case and blocking on it would make flow unusable the moment it was installed.
|
|
117
119
|
*
|
|
118
|
-
* `broken` is the opposite fact and
|
|
119
|
-
* not even import is a guard that cannot run
|
|
120
|
-
*
|
|
121
|
-
* the same
|
|
120
|
+
* `broken` is the opposite fact and must never be silent: a config file that is THERE and will
|
|
121
|
+
* not even import is a guard that cannot run. The hook rail hands it to `whileBroken`, which lets
|
|
122
|
+
* every call through with the load error, and the commit gate refuses. (A config that imports and
|
|
123
|
+
* then will not load — `load.ok === false` — is the same fact and gets the same two answers.)
|
|
122
124
|
*/
|
|
123
125
|
export type Regime = {
|
|
124
126
|
readonly kind: "none";
|
|
@@ -165,10 +167,10 @@ export declare function runHook(hook: HookEvent, payload: HookPayload, root: str
|
|
|
165
167
|
* WHO IT IS comes from the marker the PreToolUse rail left — session AND agent — so a commit's rows
|
|
166
168
|
* land in the session that caused them and an actor-scoped rule fires at this moment as honestly as
|
|
167
169
|
* at any other. The classification itself is never re-derived here: there is no transcript and no
|
|
168
|
-
*
|
|
170
|
+
* hook message outside a session, so the STORED verdict is the only truthful answer, and a fresh commit
|
|
169
171
|
* on a stale or absent marker wears nothing rather than wearing a guess.
|
|
170
172
|
*/
|
|
171
|
-
export declare function runCommit(root: string,
|
|
173
|
+
export declare function runCommit(root: string, scope: CommitScope): Promise<HookResult>;
|
|
172
174
|
/** What came in on stdin: a payload, or which of the two ways reading it failed. */
|
|
173
175
|
export type PayloadRead = {
|
|
174
176
|
readonly ok: true;
|
|
@@ -206,5 +208,11 @@ export declare function readPayload(): PayloadRead;
|
|
|
206
208
|
* is silence rather than a usage message in front of the model.
|
|
207
209
|
*/
|
|
208
210
|
export declare function hookEntry(event: string, cwd: string): Promise<HookResult>;
|
|
209
|
-
/**
|
|
210
|
-
|
|
211
|
+
/**
|
|
212
|
+
* The git gate, end to end — `flow hook commit`, or `flow hook commit --all` for the whole tree.
|
|
213
|
+
*
|
|
214
|
+
* It takes no file list: git is asked. `flow commit <files…>`, the name an older hook still calls,
|
|
215
|
+
* arrives here with `legacy` set and its list is dropped, because git's answer is the only list — a
|
|
216
|
+
* second source of the staged set is two answers that can disagree.
|
|
217
|
+
*/
|
|
218
|
+
export declare function commitEntry(args: readonly string[], cwd: string, legacy?: boolean): Promise<HookResult>;
|