@popovych.co/witness 0.28.2 → 0.29.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 +15 -3
- package/dist/abandon.d.ts +67 -0
- package/dist/act.d.ts +17 -0
- package/dist/act.js +70 -0
- package/dist/adopt.d.ts +21 -0
- package/dist/allowlist.d.ts +48 -0
- package/dist/allowlist.js +79 -5
- package/dist/arbiter.d.ts +37 -0
- package/dist/arbiter.js +7 -5
- package/dist/ask.d.ts +29 -0
- package/dist/ask.js +11 -5
- package/dist/autonomy.d.ts +46 -0
- package/dist/autonomy.js +24 -12
- package/dist/awake.d.ts +15 -0
- package/dist/basis.d.ts +9 -0
- package/dist/battery.d.ts +23 -0
- package/dist/bin.d.ts +2 -0
- package/dist/busy.d.ts +38 -0
- package/dist/busy.js +274 -0
- package/dist/caps.d.ts +21 -0
- package/dist/caps.js +24 -3
- package/dist/cli.d.ts +18 -0
- package/dist/config-file.d.ts +12 -0
- package/dist/config.d.ts +96 -0
- package/dist/config.js +2 -1
- package/dist/contain.d.ts +16 -0
- package/dist/context.d.ts +25 -0
- package/dist/criteria.d.ts +27 -0
- package/dist/criteria.js +2 -1
- package/dist/decide-view.d.ts +52 -0
- package/dist/decide-view.js +155 -0
- package/dist/decisions.d.ts +23 -0
- package/dist/deferral.d.ts +26 -0
- package/dist/delta.d.ts +58 -0
- package/dist/departure.d.ts +66 -0
- package/dist/design.d.ts +34 -0
- package/dist/drafts.d.ts +31 -0
- package/dist/drafts.js +5 -3
- package/dist/drift.d.ts +23 -0
- package/dist/drive-presence.d.ts +30 -0
- package/dist/drive-presence.js +29 -6
- package/dist/drive-report.d.ts +24 -0
- package/dist/drive-report.js +4 -4
- package/dist/drive.d.ts +114 -0
- package/dist/drive.js +328 -115
- package/dist/dsl.d.ts +23 -0
- package/dist/dsl.js +8 -3
- package/dist/evidence.d.ts +67 -0
- package/dist/evidence.js +8 -2
- package/dist/floor.d.ts +6 -0
- package/dist/fm.d.ts +9 -0
- package/dist/gate-run-view.d.ts +57 -0
- package/dist/gate-run-view.js +100 -0
- package/dist/gate.d.ts +91 -0
- package/dist/gate.js +51 -71
- package/dist/gates/decompose.d.ts +1 -0
- package/dist/gates/decompose.js +3 -1
- package/dist/gates/design.d.ts +1 -0
- package/dist/gates/design.js +6 -2
- package/dist/gates/implement.d.ts +1 -0
- package/dist/gates/implement.js +20 -5
- package/dist/gates/index.d.ts +5 -0
- package/dist/gates/plan.d.ts +1 -0
- package/dist/gates/plan.js +10 -4
- package/dist/gates/ship.d.ts +1 -0
- package/dist/gates/ship.js +13 -6
- package/dist/gitio.d.ts +35 -0
- package/dist/gitio.js +31 -3
- package/dist/glob.d.ts +2 -0
- package/dist/harness.d.ts +73 -0
- package/dist/harness.js +36 -15
- package/dist/history.d.ts +10 -0
- package/dist/idlists.d.ts +2 -0
- package/dist/install.d.ts +29 -0
- package/dist/journal.d.ts +74 -0
- package/dist/journal.js +5 -1
- package/dist/junit.d.ts +9 -0
- package/dist/live.d.ts +29 -0
- package/dist/live.js +15 -3
- package/dist/lock.d.ts +9 -0
- package/dist/matcher.d.ts +8 -0
- package/dist/migration.d.ts +25 -0
- package/dist/model.d.ts +8 -0
- package/dist/models.d.ts +9 -0
- package/dist/models.js +10 -0
- package/dist/needs-you.d.ts +91 -0
- package/dist/needs-you.js +153 -51
- package/dist/needs.d.ts +44 -0
- package/dist/needs.js +37 -7
- package/dist/notify.d.ts +12 -0
- package/dist/opener.d.ts +15 -0
- package/dist/pin.d.ts +12 -0
- package/dist/pin.js +9 -2
- package/dist/principles.d.ts +3 -0
- package/dist/probe.d.ts +1 -0
- package/dist/progress.d.ts +3 -0
- package/dist/progress.js +2 -0
- package/dist/recommend.d.ts +31 -0
- package/dist/recommend.js +51 -42
- package/dist/refusal.d.ts +20 -0
- package/dist/refusal.js +12 -4
- package/dist/registry.d.ts +1 -0
- package/dist/released-comments.d.ts +1 -0
- package/dist/review.d.ts +27 -0
- package/dist/reviewed.d.ts +27 -0
- package/dist/reviewed.js +9 -0
- package/dist/reviewer.d.ts +47 -0
- package/dist/rounds.d.ts +139 -0
- package/dist/rounds.js +75 -25
- package/dist/runner-lock.d.ts +5 -0
- package/dist/runner.d.ts +30 -0
- package/dist/scan.d.ts +27 -0
- package/dist/schemas.d.ts +11 -0
- package/dist/schemas.js +7 -3
- package/dist/session-clock.d.ts +16 -0
- package/dist/settings.d.ts +73 -0
- package/dist/settings.js +12 -2
- package/dist/settle.d.ts +62 -0
- package/dist/settle.js +177 -39
- package/dist/sha.d.ts +5 -0
- package/dist/ship-outcome.d.ts +24 -0
- package/dist/ship-outcome.js +76 -0
- package/dist/ship.d.ts +31 -0
- package/dist/ship.js +324 -82
- package/dist/slice.d.ts +45 -0
- package/dist/slice.js +2 -2
- package/dist/snapshot.d.ts +10 -0
- package/dist/spawn.d.ts +22 -0
- package/dist/stamp.d.ts +33 -0
- package/dist/stamp.js +20 -8
- package/dist/steps.d.ts +31 -0
- package/dist/steps.js +39 -10
- package/dist/toon.d.ts +17 -0
- package/dist/toon.js +150 -14
- package/dist/txn.d.ts +28 -0
- package/dist/usage.d.ts +25 -0
- package/dist/verbs/abandon.d.ts +2 -0
- package/dist/verbs/adopt.d.ts +2 -0
- package/dist/verbs/adopt.js +9 -4
- package/dist/verbs/ask.d.ts +2 -0
- package/dist/verbs/check.d.ts +2 -0
- package/dist/verbs/check.js +29 -10
- package/dist/verbs/clean.d.ts +2 -0
- package/dist/verbs/dashboard.d.ts +59 -0
- package/dist/verbs/dashboard.js +11 -3
- package/dist/verbs/decide.d.ts +46 -0
- package/dist/verbs/decide.js +168 -149
- package/dist/verbs/design.d.ts +2 -0
- package/dist/verbs/design.js +8 -5
- package/dist/verbs/diff.d.ts +2 -0
- package/dist/verbs/diff.js +4 -2
- package/dist/verbs/dismiss.d.ts +2 -0
- package/dist/verbs/dispatch.d.ts +2 -0
- package/dist/verbs/dispatch.js +2 -2
- package/dist/verbs/draft.d.ts +2 -0
- package/dist/verbs/draft.js +6 -3
- package/dist/verbs/drive.d.ts +2 -0
- package/dist/verbs/evidence.d.ts +5 -0
- package/dist/verbs/evidence.js +40 -3
- package/dist/verbs/floor.d.ts +2 -0
- package/dist/verbs/gate.d.ts +3 -0
- package/dist/verbs/index-verb.d.ts +2 -0
- package/dist/verbs/init.d.ts +2 -0
- package/dist/verbs/log.d.ts +9 -0
- package/dist/verbs/migrate.d.ts +13 -0
- package/dist/verbs/next.d.ts +78 -0
- package/dist/verbs/next.js +373 -131
- package/dist/verbs/read.d.ts +2 -0
- package/dist/verbs/read.js +3 -1
- package/dist/verbs/recap.d.ts +28 -0
- package/dist/verbs/recap.js +3 -3
- package/dist/verbs/recover.d.ts +5 -0
- package/dist/verbs/recover.js +14 -9
- package/dist/verbs/rename.d.ts +2 -0
- package/dist/verbs/rename.js +1 -1
- package/dist/verbs/retry.d.ts +2 -0
- package/dist/verbs/review.d.ts +2 -0
- package/dist/verbs/review.js +1 -1
- package/dist/verbs/satisfy.d.ts +2 -0
- package/dist/verbs/ship.d.ts +3 -0
- package/dist/verbs/start.d.ts +2 -0
- package/dist/verbs/start.js +12 -7
- package/dist/verbs/step-close.d.ts +2 -0
- package/dist/verbs/sync.d.ts +15 -0
- package/dist/verbs/trust.d.ts +4 -0
- package/dist/verbs/trust.js +34 -32
- package/dist/verbs/turn.d.ts +2 -0
- package/dist/verbs/wait.d.ts +9 -0
- package/dist/verbs/wait.js +33 -8
- package/dist/verbs/write.d.ts +18 -0
- package/dist/verbs/write.js +11 -5
- package/dist/verdict.d.ts +60 -0
- package/dist/version.d.ts +4 -0
- package/dist/worker-stream.d.ts +22 -0
- package/dist/worktree.d.ts +22 -0
- package/dist/worktree.js +1 -1
- package/package.json +7 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/commands/witness.md +17 -11
- package/plugin/hooks/canon-guard.mjs +71 -10
- package/plugin/hooks/session-dashboard.sh +1 -1
- package/plugin/skills/witness-brainstorm/SKILL.md +3 -3
- package/plugin/skills/witness-decompose/SKILL.md +3 -3
- package/plugin/skills/witness-design/SKILL.md +2 -2
- package/plugin/skills/witness-implement/SKILL.md +5 -5
- package/plugin/skills/witness-plan/SKILL.md +3 -3
- package/plugin/skills/witness-ship/SKILL.md +3 -3
package/dist/drive.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type Ctx } from './cli.js';
|
|
2
|
+
import { type Config } from './config.js';
|
|
3
|
+
import { type Result } from './refusal.js';
|
|
4
|
+
import { type Canon } from './scan.js';
|
|
5
|
+
import { spawn, type ResolvedSpawn } from './spawn.js';
|
|
6
|
+
import { type NextAction } from './verbs/next.js';
|
|
7
|
+
import { type DecisionAct } from './verbs/decide.js';
|
|
8
|
+
import { type Decision } from './recommend.js';
|
|
9
|
+
import { type KeptStop } from './autonomy.js';
|
|
10
|
+
import { type RunCommand } from './allowlist.js';
|
|
11
|
+
import { type WorkerStream } from './worker-stream.js';
|
|
12
|
+
import { type Clock } from './usage.js';
|
|
13
|
+
import { type Ticker } from './session-clock.js';
|
|
14
|
+
export type DriveStep = {
|
|
15
|
+
kind: 'spawn';
|
|
16
|
+
home: string;
|
|
17
|
+
stage?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
model?: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'decision';
|
|
22
|
+
gate?: string;
|
|
23
|
+
target?: string;
|
|
24
|
+
block?: Decision;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'conversation';
|
|
27
|
+
line: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'merge';
|
|
30
|
+
line: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'fix';
|
|
33
|
+
line: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'kept';
|
|
36
|
+
stop: 'trust-grant';
|
|
37
|
+
line: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'idle';
|
|
40
|
+
};
|
|
41
|
+
export declare function classifyAction(action: NextAction, root: string, opts?: {
|
|
42
|
+
autonomy?: boolean;
|
|
43
|
+
}): DriveStep;
|
|
44
|
+
export type SpawnStep = Extract<DriveStep, {
|
|
45
|
+
kind: 'spawn';
|
|
46
|
+
}>;
|
|
47
|
+
export type SpawnOutcome = 'exited' | 'timeout' | 'spawn-failed' | 'stopped';
|
|
48
|
+
export interface SessionEnd {
|
|
49
|
+
outcome: SpawnOutcome;
|
|
50
|
+
code: number | null;
|
|
51
|
+
tail: string[];
|
|
52
|
+
ms: number;
|
|
53
|
+
failed: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare const SESSION_QUIET_MS = 300000;
|
|
56
|
+
export declare function lineSink(emit: (record: string) => void): {
|
|
57
|
+
push(chunk: string): void;
|
|
58
|
+
flush(): void;
|
|
59
|
+
};
|
|
60
|
+
export declare function signalSession(child: ReturnType<typeof spawn>, grouped: boolean, env: Record<string, string | undefined>, sig: NodeJS.Signals): void;
|
|
61
|
+
export declare function spawnSession(step: SpawnStep, cfg: Config, ctx: Ctx, spawnN: number, opts?: {
|
|
62
|
+
manual?: boolean;
|
|
63
|
+
signal?: AbortSignal;
|
|
64
|
+
ticker?: Ticker;
|
|
65
|
+
hear?: (line: string) => void;
|
|
66
|
+
root?: string;
|
|
67
|
+
stream?: WorkerStream;
|
|
68
|
+
next?: string;
|
|
69
|
+
progress?: (session?: string) => string[];
|
|
70
|
+
}): Promise<SessionEnd>;
|
|
71
|
+
export interface DriveFlags {
|
|
72
|
+
flow?: string;
|
|
73
|
+
maxSpawns?: number;
|
|
74
|
+
manual?: boolean;
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
}
|
|
77
|
+
export declare const DEFAULT_MAX_SPAWNS = 20;
|
|
78
|
+
export declare const AUTONOMY_MAX_SPAWNS = 200;
|
|
79
|
+
export declare const PAUSE_POLL_MS = 5000;
|
|
80
|
+
export declare const PAUSE_IDLE_MAX_MS = 43200000;
|
|
81
|
+
export declare function watchSignature(root: string): string;
|
|
82
|
+
export type AsideKind = 'kept' | 'decision' | 'conversation' | 'merge' | 'fix' | 'stuck' | 'capped' | 'retry' | 'recheck';
|
|
83
|
+
export interface Aside {
|
|
84
|
+
target: string;
|
|
85
|
+
kind: AsideKind;
|
|
86
|
+
line: string;
|
|
87
|
+
why: string;
|
|
88
|
+
gate?: string;
|
|
89
|
+
stop?: KeptStop;
|
|
90
|
+
key0?: string;
|
|
91
|
+
trust?: RunCommand[];
|
|
92
|
+
due?: number;
|
|
93
|
+
kept?: DecisionAct;
|
|
94
|
+
tries?: number;
|
|
95
|
+
}
|
|
96
|
+
export declare const RETRY_DUE_MS = 30000;
|
|
97
|
+
export declare const RETRY_MAX = 3;
|
|
98
|
+
export declare const RECHECK_FIRST_MS = 300000;
|
|
99
|
+
export declare const RECHECK_MAX_MS = 3600000;
|
|
100
|
+
export declare function settleAdmitsFor(t: string | undefined, s: {
|
|
101
|
+
lanes: ReadonlyMap<string, unknown>;
|
|
102
|
+
aside: ReadonlyMap<string, unknown>;
|
|
103
|
+
flow?: string;
|
|
104
|
+
busy: (t: string) => boolean;
|
|
105
|
+
}): boolean;
|
|
106
|
+
export declare function flowOf(canon: Canon, t: string): string[];
|
|
107
|
+
export declare function journalWatch(root: string, target: string): (session?: string) => string[];
|
|
108
|
+
export declare function driveLoop(root: string, cfg: Config, ctx: Ctx, flags: DriveFlags, clock?: Clock): Promise<number>;
|
|
109
|
+
export declare function detachArgv(bin: string | undefined, args: readonly string[], env: Record<string, string | undefined>, platform?: NodeJS.Platform): Result<ResolvedSpawn>;
|
|
110
|
+
export declare function detachDrive(root: string, ctx: Ctx, args: readonly string[]): Result<{
|
|
111
|
+
pid: number;
|
|
112
|
+
log: string;
|
|
113
|
+
}>;
|
|
114
|
+
export declare function splitArgv(command: string): string[];
|