agentflight 0.1.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 +15 -5
- package/dist/adapters/agentloopkit.d.ts.map +1 -1
- package/dist/adapters/agentloopkit.js +26 -7
- package/dist/adapters/agentloopkit.js.map +1 -1
- package/dist/adapters/projscan.d.ts.map +1 -1
- package/dist/adapters/projscan.js +26 -7
- package/dist/adapters/projscan.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +40 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +20 -12
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/replay.d.ts +1 -0
- package/dist/commands/replay.d.ts.map +1 -1
- package/dist/commands/replay.js +26 -5
- package/dist/commands/replay.js.map +1 -1
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +27 -2
- package/dist/commands/report.js.map +1 -1
- package/dist/commands/resume.d.ts +1 -0
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/resume.js +26 -8
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/snapshot.d.ts +13 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +45 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +58 -14
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verify.d.ts +13 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +74 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +2 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/fs-safe.d.ts +1 -0
- package/dist/core/fs-safe.d.ts.map +1 -1
- package/dist/core/fs-safe.js +9 -0
- package/dist/core/fs-safe.js.map +1 -1
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +1 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/risk.d.ts.map +1 -1
- package/dist/core/risk.js +3 -0
- package/dist/core/risk.js.map +1 -1
- package/dist/core/session.d.ts +17 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +95 -0
- package/dist/core/session.js.map +1 -1
- package/dist/core/verification.d.ts +29 -0
- package/dist/core/verification.d.ts.map +1 -1
- package/dist/core/verification.js +159 -0
- package/dist/core/verification.js.map +1 -1
- package/dist/renderers/html-replay.d.ts +5 -6
- package/dist/renderers/html-replay.d.ts.map +1 -1
- package/dist/renderers/html-replay.js +57 -5
- package/dist/renderers/html-replay.js.map +1 -1
- package/dist/renderers/markdown-report.d.ts +7 -2
- package/dist/renderers/markdown-report.d.ts.map +1 -1
- package/dist/renderers/markdown-report.js +32 -7
- package/dist/renderers/markdown-report.js.map +1 -1
- package/dist/renderers/resume-prompt.d.ts +2 -0
- package/dist/renderers/resume-prompt.d.ts.map +1 -1
- package/dist/renderers/resume-prompt.js +9 -2
- package/dist/renderers/resume-prompt.js.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,8 +26,9 @@ AgentFlight creates a local `.agentflight/` directory in your repo:
|
|
|
26
26
|
- `sessions/` stores session metadata.
|
|
27
27
|
- `current/` stores the active session, handoff, and resume prompt.
|
|
28
28
|
- `reports/` stores Markdown proof reports and HTML replays.
|
|
29
|
+
- `evidence/` stores stdout and stderr from captured verification runs.
|
|
29
30
|
|
|
30
|
-
Reports include filenames and summaries by default, not full source diffs. AgentFlight does not collect telemetry and does not upload source code.
|
|
31
|
+
Sessions also store an `events` timeline with meaningful moments such as session start, verification attempts, snapshots, and generated artifacts. Reports include filenames and summaries by default, not full source diffs. AgentFlight does not collect telemetry and does not upload source code.
|
|
31
32
|
|
|
32
33
|
## Quick Start
|
|
33
34
|
|
|
@@ -37,6 +38,8 @@ npm run build
|
|
|
37
38
|
npx agentflight init
|
|
38
39
|
npx agentflight start --task "Add example feature"
|
|
39
40
|
npx agentflight status
|
|
41
|
+
npx agentflight verify -- npm test
|
|
42
|
+
npx agentflight snapshot --note "Tests passing locally"
|
|
40
43
|
npx agentflight report
|
|
41
44
|
npx agentflight replay
|
|
42
45
|
npx agentflight resume
|
|
@@ -55,6 +58,9 @@ npm run agentflight -- start --task "Add example feature"
|
|
|
55
58
|
- `agentflight init` initializes `.agentflight/` with safe writes.
|
|
56
59
|
- `agentflight start --task "..."` starts a session and writes the current handoff.
|
|
57
60
|
- `agentflight status` summarizes changed files, risk, verification status, and next action.
|
|
61
|
+
- `agentflight verify -- <command>` runs a proof command and records stdout/stderr evidence.
|
|
62
|
+
- `agentflight verify` runs commands from `.agentflight/config.json`.
|
|
63
|
+
- `agentflight snapshot --note "..."` records current git, risk, and verification state as a timeline event.
|
|
58
64
|
- `agentflight report` generates a Markdown proof report.
|
|
59
65
|
- `agentflight replay` generates a local self-contained HTML replay.
|
|
60
66
|
- `agentflight resume` prints and saves a Codex/Claude-ready continuation prompt.
|
|
@@ -71,14 +77,15 @@ agentflight start --task "Add password reset flow"
|
|
|
71
77
|
# Run Codex, Claude Code, Cursor, or another coding agent normally.
|
|
72
78
|
|
|
73
79
|
agentflight status
|
|
74
|
-
npm run typecheck
|
|
75
|
-
npm test
|
|
80
|
+
agentflight verify -- npm run typecheck
|
|
81
|
+
agentflight verify -- npm test
|
|
82
|
+
agentflight snapshot --note "Implementation and proof complete"
|
|
76
83
|
agentflight report
|
|
77
84
|
agentflight replay
|
|
78
85
|
agentflight resume
|
|
79
86
|
```
|
|
80
87
|
|
|
81
|
-
Use the generated report for review and the resume prompt when handing the work to another agent or human.
|
|
88
|
+
Use `agentflight verify -- <command>` when you want AgentFlight to capture proof. The command records exit code, timing, stdout path, and stderr path in the current session, then prints the evidence paths. Use `agentflight snapshot --note "..."` at meaningful milestones so replay and report artifacts show the session timeline. Use the generated report for review and the resume prompt when handing the work to another agent or human.
|
|
82
89
|
|
|
83
90
|
## Powered By ProjScan And AgentLoopKit
|
|
84
91
|
|
|
@@ -103,13 +110,14 @@ Runtime session data is ignored by git by default:
|
|
|
103
110
|
|
|
104
111
|
- `.agentflight/sessions/`
|
|
105
112
|
- `.agentflight/reports/`
|
|
113
|
+
- `.agentflight/evidence/`
|
|
106
114
|
- `.agentflight/current/`
|
|
107
115
|
|
|
108
116
|
`.agentflight/config.json` is intentionally not ignored, so a project can commit its local AgentFlight defaults if that is useful.
|
|
109
117
|
|
|
110
118
|
## Current Status
|
|
111
119
|
|
|
112
|
-
AgentFlight
|
|
120
|
+
AgentFlight current package version is `0.3.0`, centered on local session timelines, snapshots, and verification evidence.
|
|
113
121
|
|
|
114
122
|
Implemented:
|
|
115
123
|
|
|
@@ -121,6 +129,8 @@ Implemented:
|
|
|
121
129
|
- Self-contained HTML replay
|
|
122
130
|
- Resume prompt generation
|
|
123
131
|
- Doctor checks
|
|
132
|
+
- Verification evidence capture with `agentflight verify`
|
|
133
|
+
- Session events and snapshots with `agentflight snapshot`
|
|
124
134
|
- Defensive ProjScan and AgentLoopKit adapters
|
|
125
135
|
- Vitest coverage for core behavior, renderers, adapters, and command workflow
|
|
126
136
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentloopkit.d.ts","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentloopkit.d.ts","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAsC5B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,aAA0B,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAoC5B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
1
2
|
import { runCommand } from "../core/process.js";
|
|
2
3
|
export async function inspectAgentLoopKit(options = {}) {
|
|
3
4
|
const run = options.run ?? runCommand;
|
|
@@ -12,7 +13,7 @@ export async function inspectAgentLoopKit(options = {}) {
|
|
|
12
13
|
const doctor = await runWithFallback(run, command, "agentloopkit@latest", ["doctor"], options.cwd, 20_000);
|
|
13
14
|
const result = {
|
|
14
15
|
available: true,
|
|
15
|
-
version: version.stdout
|
|
16
|
+
version: normalizeVersion(version.stdout),
|
|
16
17
|
summary: doctor.stdout.trim() || "AgentLoopKit available for task discipline.",
|
|
17
18
|
warnings: []
|
|
18
19
|
};
|
|
@@ -53,16 +54,34 @@ function summarizeFailure(result) {
|
|
|
53
54
|
return (result.stderr || result.stdout || "no output").trim();
|
|
54
55
|
}
|
|
55
56
|
async function runWithFallback(run, localCommand, packageName, args, cwd, timeoutMs = 10_000) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const localFailures = [];
|
|
58
|
+
for (const candidate of repoLocalCommandCandidates(localCommand, cwd)) {
|
|
59
|
+
const local = await run(candidate, args, { cwd, timeoutMs });
|
|
60
|
+
if (local.exitCode === 0)
|
|
61
|
+
return local;
|
|
62
|
+
localFailures.push(local);
|
|
63
|
+
}
|
|
59
64
|
const fallback = await run("npx", ["--yes", packageName, ...args], { cwd, timeoutMs });
|
|
60
65
|
if (fallback.exitCode === 0)
|
|
61
66
|
return fallback;
|
|
67
|
+
const pathCommand = await run(localCommand, args, { cwd, timeoutMs });
|
|
68
|
+
if (pathCommand.exitCode === 0)
|
|
69
|
+
return pathCommand;
|
|
62
70
|
return {
|
|
63
|
-
exitCode:
|
|
64
|
-
stdout:
|
|
65
|
-
stderr: `${summarizeFailure(
|
|
71
|
+
exitCode: pathCommand.exitCode,
|
|
72
|
+
stdout: pathCommand.stdout,
|
|
73
|
+
stderr: `${localFailures.map(summarizeFailure).join("; ")}; npx fallback failed: ${summarizeFailure(fallback)}; PATH command failed: ${summarizeFailure(pathCommand)}`
|
|
66
74
|
};
|
|
67
75
|
}
|
|
76
|
+
function repoLocalCommandCandidates(command, cwd) {
|
|
77
|
+
if (!cwd || command.includes("/") || command.includes("\\"))
|
|
78
|
+
return [];
|
|
79
|
+
const executable = process.platform === "win32" ? `${command}.cmd` : command;
|
|
80
|
+
return [join(cwd, "node_modules", ".bin", executable)];
|
|
81
|
+
}
|
|
82
|
+
function normalizeVersion(output) {
|
|
83
|
+
const trimmed = output.trim();
|
|
84
|
+
const match = trimmed.match(/\bv?(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)\b/);
|
|
85
|
+
return match?.[1] ?? trimmed;
|
|
86
|
+
}
|
|
68
87
|
//# sourceMappingURL=agentloopkit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentloopkit.js","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentloopkit.js","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAsC,EAAE;IAExC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC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/adapters/projscan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,sBAAsB;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,eAAe,CACnC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CA+B5B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,GAAG,GAAE,aAA0B,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAsB5B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
1
2
|
import { runCommand } from "../core/process.js";
|
|
2
3
|
export async function inspectProjScan(options = {}) {
|
|
3
4
|
const run = options.run ?? runCommand;
|
|
@@ -12,7 +13,7 @@ export async function inspectProjScan(options = {}) {
|
|
|
12
13
|
const help = await runWithFallback(run, command, "projscan@latest", ["--help"], options.cwd);
|
|
13
14
|
const result = {
|
|
14
15
|
available: true,
|
|
15
|
-
version: version.stdout
|
|
16
|
+
version: normalizeVersion(version.stdout),
|
|
16
17
|
summary: "ProjScan available for repo intelligence and risk analysis.",
|
|
17
18
|
warnings: []
|
|
18
19
|
};
|
|
@@ -39,16 +40,34 @@ function summarizeFailure(result) {
|
|
|
39
40
|
return (result.stderr || result.stdout || "no output").trim();
|
|
40
41
|
}
|
|
41
42
|
async function runWithFallback(run, localCommand, packageName, args, cwd, timeoutMs = 10_000) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const localFailures = [];
|
|
44
|
+
for (const candidate of repoLocalCommandCandidates(localCommand, cwd)) {
|
|
45
|
+
const local = await run(candidate, args, { cwd, timeoutMs });
|
|
46
|
+
if (local.exitCode === 0)
|
|
47
|
+
return local;
|
|
48
|
+
localFailures.push(local);
|
|
49
|
+
}
|
|
45
50
|
const fallback = await run("npx", ["--yes", packageName, ...args], { cwd, timeoutMs });
|
|
46
51
|
if (fallback.exitCode === 0)
|
|
47
52
|
return fallback;
|
|
53
|
+
const pathCommand = await run(localCommand, args, { cwd, timeoutMs });
|
|
54
|
+
if (pathCommand.exitCode === 0)
|
|
55
|
+
return pathCommand;
|
|
48
56
|
return {
|
|
49
|
-
exitCode:
|
|
50
|
-
stdout:
|
|
51
|
-
stderr: `${summarizeFailure(
|
|
57
|
+
exitCode: pathCommand.exitCode,
|
|
58
|
+
stdout: pathCommand.stdout,
|
|
59
|
+
stderr: `${localFailures.map(summarizeFailure).join("; ")}; npx fallback failed: ${summarizeFailure(fallback)}; PATH command failed: ${summarizeFailure(pathCommand)}`
|
|
52
60
|
};
|
|
53
61
|
}
|
|
62
|
+
function repoLocalCommandCandidates(command, cwd) {
|
|
63
|
+
if (!cwd || command.includes("/") || command.includes("\\"))
|
|
64
|
+
return [];
|
|
65
|
+
const executable = process.platform === "win32" ? `${command}.cmd` : command;
|
|
66
|
+
return [join(cwd, "node_modules", ".bin", executable)];
|
|
67
|
+
}
|
|
68
|
+
function normalizeVersion(output) {
|
|
69
|
+
const trimmed = output.trim();
|
|
70
|
+
const match = trimmed.match(/\bv?(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)\b/);
|
|
71
|
+
return match?.[1] ?? trimmed;
|
|
72
|
+
}
|
|
54
73
|
//# sourceMappingURL=projscan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projscan.js","sourceRoot":"","sources":["../../src/adapters/projscan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projscan.js","sourceRoot":"","sources":["../../src/adapters/projscan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAA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/cli.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,SAAS,IAAI,OAAO,CAuGnC;AAeD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAG5F"}
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { realpathSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
2
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
import { getRepositoryRoot } from "./core/git.js";
|
|
@@ -9,14 +9,16 @@ import { runInitCommand } from "./commands/init.js";
|
|
|
9
9
|
import { runReplayCommand } from "./commands/replay.js";
|
|
10
10
|
import { runReportCommand } from "./commands/report.js";
|
|
11
11
|
import { runResumeCommand } from "./commands/resume.js";
|
|
12
|
+
import { runSnapshotCommand } from "./commands/snapshot.js";
|
|
12
13
|
import { runStartCommand } from "./commands/start.js";
|
|
13
14
|
import { runStatusCommand } from "./commands/status.js";
|
|
15
|
+
import { runVerifyCommand } from "./commands/verify.js";
|
|
14
16
|
export function createCli() {
|
|
15
17
|
const program = new Command();
|
|
16
18
|
program
|
|
17
19
|
.name("agentflight")
|
|
18
20
|
.description("Local-first flight recorder for AI coding agents.")
|
|
19
|
-
.version(
|
|
21
|
+
.version(readPackageVersion());
|
|
20
22
|
program
|
|
21
23
|
.command("init")
|
|
22
24
|
.description("Initialise AgentFlight in this repository.")
|
|
@@ -41,6 +43,28 @@ export function createCli() {
|
|
|
41
43
|
.action(async () => {
|
|
42
44
|
await printResult(runStatusCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
43
45
|
});
|
|
46
|
+
program
|
|
47
|
+
.command("verify")
|
|
48
|
+
.description("Run verification and capture local evidence for the current session.")
|
|
49
|
+
.allowUnknownOption(true)
|
|
50
|
+
.allowExcessArguments(true)
|
|
51
|
+
.argument("[command...]", "verification command to run after --")
|
|
52
|
+
.action(async (commandArgs) => {
|
|
53
|
+
await printResult(runVerifyCommand({
|
|
54
|
+
repoRoot: await getRepositoryRoot(process.cwd()),
|
|
55
|
+
commandArgs
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
program
|
|
59
|
+
.command("snapshot")
|
|
60
|
+
.description("Record a timeline snapshot for the current session.")
|
|
61
|
+
.option("--note <note>", "short snapshot note")
|
|
62
|
+
.action(async (options) => {
|
|
63
|
+
await printResult(runSnapshotCommand({
|
|
64
|
+
repoRoot: await getRepositoryRoot(process.cwd()),
|
|
65
|
+
note: options.note
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
44
68
|
program
|
|
45
69
|
.command("report")
|
|
46
70
|
.description("Generate a Markdown proof report for the current session.")
|
|
@@ -79,6 +103,9 @@ async function printResult(promise) {
|
|
|
79
103
|
try {
|
|
80
104
|
const result = await promise;
|
|
81
105
|
console.log(result.output.trimEnd());
|
|
106
|
+
if (result.exitCode !== undefined) {
|
|
107
|
+
process.exitCode = result.exitCode;
|
|
108
|
+
}
|
|
82
109
|
}
|
|
83
110
|
catch (error) {
|
|
84
111
|
console.error(error instanceof Error ? error.message : String(error));
|
|
@@ -99,6 +126,16 @@ function normalizeCliPath(path) {
|
|
|
99
126
|
return resolved;
|
|
100
127
|
}
|
|
101
128
|
}
|
|
129
|
+
function readPackageVersion() {
|
|
130
|
+
const packagePath = resolve(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
131
|
+
try {
|
|
132
|
+
const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
|
|
133
|
+
return typeof packageJson.version === "string" ? packageJson.version : "0.0.0";
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return "0.0.0";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
102
139
|
if (isDirectCliInvocation(import.meta.url, process.argv[1])) {
|
|
103
140
|
await createCli().parseAsync(process.argv);
|
|
104
141
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,UAAU,SAAS;IACvB,MAA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|
|
@@ -7,6 +7,7 @@ export interface DoctorCommandOptions {
|
|
|
7
7
|
packageManager?: string | null | undefined;
|
|
8
8
|
projscanAvailable?: boolean | undefined;
|
|
9
9
|
agentloopkitAvailable?: boolean | undefined;
|
|
10
|
+
now?: Date | undefined;
|
|
10
11
|
}
|
|
11
12
|
export interface DoctorCommandResult {
|
|
12
13
|
output: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAgD9B"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { inspectAgentLoopKit } from "../adapters/agentloopkit.js";
|
|
4
4
|
import { inspectProjScan } from "../adapters/projscan.js";
|
|
5
5
|
import { evaluateDoctorChecks } from "../core/doctor.js";
|
|
6
|
-
import { pathExists } from "../core/fs-safe.js";
|
|
6
|
+
import { isPathWritable, pathExists } from "../core/fs-safe.js";
|
|
7
7
|
import { getRepositoryRoot } from "../core/git.js";
|
|
8
8
|
import { renderStatus } from "../core/output.js";
|
|
9
9
|
import { detectPackageManager, readPackageJson } from "../core/project.js";
|
|
10
10
|
import { runCommand } from "../core/process.js";
|
|
11
11
|
import { resolveAgentFlightPaths } from "../core/paths.js";
|
|
12
|
+
import { appendSessionEvent } from "../core/session.js";
|
|
13
|
+
import { readCurrentSession } from "./status.js";
|
|
12
14
|
export async function runDoctorCommand(options) {
|
|
13
15
|
const paths = resolveAgentFlightPaths(options.repoRoot);
|
|
14
16
|
const packageJson = await readPackageJson(options.repoRoot);
|
|
@@ -37,7 +39,7 @@ export async function runDoctorCommand(options) {
|
|
|
37
39
|
repoRoot,
|
|
38
40
|
agentFlightExists: await pathExists(paths.root),
|
|
39
41
|
configValid: await isConfigValid(paths.config),
|
|
40
|
-
writable: await
|
|
42
|
+
writable: await isPathWritable(paths.root),
|
|
41
43
|
currentSessionExists: await pathExists(paths.currentSession),
|
|
42
44
|
projscanAvailable: projscan.available,
|
|
43
45
|
agentloopkitAvailable: agentloopkit.available,
|
|
@@ -48,11 +50,26 @@ export async function runDoctorCommand(options) {
|
|
|
48
50
|
lint: Boolean(scripts.lint)
|
|
49
51
|
}
|
|
50
52
|
});
|
|
53
|
+
await recordDoctorEvent(options.repoRoot, result.status, options.now ?? new Date());
|
|
51
54
|
return {
|
|
52
55
|
output: renderDoctor(result),
|
|
53
56
|
result
|
|
54
57
|
};
|
|
55
58
|
}
|
|
59
|
+
async function recordDoctorEvent(repoRoot, status, now) {
|
|
60
|
+
try {
|
|
61
|
+
const session = await readCurrentSession(repoRoot);
|
|
62
|
+
await appendSessionEvent(repoRoot, session, {
|
|
63
|
+
type: "doctor_run",
|
|
64
|
+
timestamp: now,
|
|
65
|
+
title: "Doctor run",
|
|
66
|
+
metadata: { status }
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Doctor should still report configuration issues when no session is active or writable.
|
|
71
|
+
}
|
|
72
|
+
}
|
|
56
73
|
async function getNpmVersion(repoRoot) {
|
|
57
74
|
const result = await runCommand("npm", ["--version"], { cwd: repoRoot, timeoutMs: 10_000 });
|
|
58
75
|
return result.exitCode === 0 ? result.stdout.trim() : null;
|
|
@@ -66,15 +83,6 @@ async function isConfigValid(path) {
|
|
|
66
83
|
return false;
|
|
67
84
|
}
|
|
68
85
|
}
|
|
69
|
-
async function isWritable(path) {
|
|
70
|
-
try {
|
|
71
|
-
await access(path);
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
86
|
function renderDoctor(result) {
|
|
79
87
|
return `AgentFlight Doctor
|
|
80
88
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,C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AAM;SACZ,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,sBAAsB,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,OAAO,KAAK,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC;IACjF,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC;CACZ,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAuC9B"}
|
package/dist/commands/replay.js
CHANGED
|
@@ -2,26 +2,41 @@ import { writeTextFileSafe } from "../core/fs-safe.js";
|
|
|
2
2
|
import { listChangedFiles } from "../core/git.js";
|
|
3
3
|
import { resolveAgentFlightPaths } from "../core/paths.js";
|
|
4
4
|
import { analyzeRisk } from "../core/risk.js";
|
|
5
|
+
import { addSessionEvent, getSessionTimelineEvents, saveSession } from "../core/session.js";
|
|
6
|
+
import { buildVerificationSummary } from "../core/verification.js";
|
|
5
7
|
import { renderHtmlReplay } from "../renderers/html-replay.js";
|
|
6
8
|
import { readCurrentSession } from "./status.js";
|
|
7
9
|
export async function runReplayCommand(options) {
|
|
8
10
|
const session = await readCurrentSession(options.repoRoot);
|
|
9
11
|
const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
|
|
10
12
|
const risk = analyzeRisk(changedFiles);
|
|
13
|
+
const verification = buildVerificationSummary(session, {
|
|
14
|
+
changedFilesCount: changedFiles.length,
|
|
15
|
+
riskLevel: risk.level
|
|
16
|
+
});
|
|
11
17
|
const replayPath = `${resolveAgentFlightPaths(options.repoRoot).reports}/${session.id}-replay.html`;
|
|
18
|
+
const updatedSession = addSessionEvent(session, {
|
|
19
|
+
type: "replay_generated",
|
|
20
|
+
timestamp: options.now ?? new Date(),
|
|
21
|
+
title: "Replay generated",
|
|
22
|
+
metadata: {
|
|
23
|
+
path: `.agentflight/reports/${session.id}-replay.html`
|
|
24
|
+
}
|
|
25
|
+
});
|
|
12
26
|
const html = renderHtmlReplay({
|
|
13
27
|
task: session.task.title,
|
|
14
28
|
sessionId: session.id,
|
|
15
29
|
startedAt: session.startedAt,
|
|
16
|
-
timeline:
|
|
30
|
+
timeline: getSessionTimelineEvents(updatedSession),
|
|
17
31
|
changedFiles,
|
|
32
|
+
changedFileGroups: risk.categories,
|
|
18
33
|
riskBadges: [risk.level, ...risk.categories.map((summary) => summary.category)],
|
|
19
|
-
verificationEvidence:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
: "Run verification and prepare a scoped handoff."
|
|
34
|
+
verificationEvidence: verification.runs,
|
|
35
|
+
reviewReadiness: verification.readiness,
|
|
36
|
+
recommendation: `${verification.readiness}. ${buildReplayNextAction(verification.readiness, verification.nextAction)}`
|
|
23
37
|
});
|
|
24
38
|
await writeTextFileSafe(replayPath, html, { overwrite: true });
|
|
39
|
+
await saveSession(options.repoRoot, updatedSession);
|
|
25
40
|
return {
|
|
26
41
|
output: `Replay generated:
|
|
27
42
|
${replayPath}
|
|
@@ -29,4 +44,10 @@ ${replayPath}
|
|
|
29
44
|
replayPath
|
|
30
45
|
};
|
|
31
46
|
}
|
|
47
|
+
function buildReplayNextAction(readiness, fallback) {
|
|
48
|
+
if (readiness === "Ready for review") {
|
|
49
|
+
return "Use this replay for review and handoff; continue only scoped follow-up work.";
|
|
50
|
+
}
|
|
51
|
+
return fallback;
|
|
52
|
+
}
|
|
32
53
|
//# sourceMappingURL=replay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAajD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OA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Y,CAAC,SAAS;QACvC,cAAc,EAAE,GAAG,YAAY,CAAC,SAAS,KAAK,qBAAqB,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE;KACvH,CAAC,CAAC;IAEH,MAAM,iBAAiB,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,MAAM,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAEpD,OAAO;QACL,MAAM,EAAE;EACV,UAAU;CACX;QACG,UAAU;KACX,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB,EAAE,QAAgB;IAChE,IAAI,SAAS,KAAK,kBAAkB,EAAE,CAAC;QACrC,OAAO,8EAA8E,CAAC;IACxF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAyC9B"}
|
package/dist/commands/report.js
CHANGED
|
@@ -2,24 +2,43 @@ import { writeTextFileSafe } from "../core/fs-safe.js";
|
|
|
2
2
|
import { listChangedFiles } from "../core/git.js";
|
|
3
3
|
import { resolveAgentFlightPaths } from "../core/paths.js";
|
|
4
4
|
import { analyzeRisk } from "../core/risk.js";
|
|
5
|
+
import { addSessionEvent, getSessionTimelineEvents, saveSession } from "../core/session.js";
|
|
6
|
+
import { buildVerificationSummary } from "../core/verification.js";
|
|
5
7
|
import { renderMarkdownReport } from "../renderers/markdown-report.js";
|
|
6
8
|
import { readCurrentSession } from "./status.js";
|
|
7
9
|
export async function runReportCommand(options) {
|
|
8
10
|
const session = await readCurrentSession(options.repoRoot);
|
|
9
11
|
const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
|
|
10
12
|
const risk = analyzeRisk(changedFiles);
|
|
13
|
+
const verification = buildVerificationSummary(session, {
|
|
14
|
+
changedFilesCount: changedFiles.length,
|
|
15
|
+
riskLevel: risk.level
|
|
16
|
+
});
|
|
17
|
+
const reportPath = `${resolveAgentFlightPaths(options.repoRoot).reports}/${session.id}-proof.md`;
|
|
18
|
+
const updatedSession = addSessionEvent(session, {
|
|
19
|
+
type: "report_generated",
|
|
20
|
+
timestamp: options.now ?? new Date(),
|
|
21
|
+
title: "Report generated",
|
|
22
|
+
metadata: {
|
|
23
|
+
path: `.agentflight/reports/${session.id}-proof.md`
|
|
24
|
+
}
|
|
25
|
+
});
|
|
11
26
|
const report = renderMarkdownReport({
|
|
12
27
|
task: session.task.title,
|
|
13
28
|
sessionId: session.id,
|
|
14
29
|
startedAt: session.startedAt,
|
|
15
30
|
changedFiles,
|
|
31
|
+
timelineEvents: getSessionTimelineEvents(updatedSession),
|
|
16
32
|
risk,
|
|
17
33
|
verificationCommands: session.verificationCommands,
|
|
18
|
-
verificationEvidence:
|
|
34
|
+
verificationEvidence: verification.runs,
|
|
35
|
+
verificationGaps: verification.gaps,
|
|
36
|
+
recommendation: verification.readiness,
|
|
37
|
+
nextAction: buildReportNextAction(verification.readiness, verification.nextAction),
|
|
19
38
|
tooling: session.tools
|
|
20
39
|
});
|
|
21
|
-
const reportPath = `${resolveAgentFlightPaths(options.repoRoot).reports}/${session.id}-proof.md`;
|
|
22
40
|
await writeTextFileSafe(reportPath, report, { overwrite: true });
|
|
41
|
+
await saveSession(options.repoRoot, updatedSession);
|
|
23
42
|
return {
|
|
24
43
|
output: `Report generated:
|
|
25
44
|
${reportPath}
|
|
@@ -27,4 +46,10 @@ ${reportPath}
|
|
|
27
46
|
reportPath
|
|
28
47
|
};
|
|
29
48
|
}
|
|
49
|
+
function buildReportNextAction(readiness, fallback) {
|
|
50
|
+
if (readiness === "Ready for review") {
|
|
51
|
+
return "Share this report with the reviewer and keep follow-up scoped to the risk areas above.";
|
|
52
|
+
}
|
|
53
|
+
return fallback;
|
|
54
|
+
}
|
|
30
55
|
//# sourceMappingURL=report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MA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IAAI;QACvC,gBAAgB,EAAE,YAAY,CAAC,IAAI;QACnC,cAAc,EAAE,YAAY,CAAC,SAAS;QACtC,UAAU,EAAE,qBAAqB,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC;QAClF,OAAO,EAAE,OAAO,CAAC,KAAK;KACvB,CAAC,CAAC;IAEH,MAAM,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,MAAM,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAEpD,OAAO;QACL,MAAM,EAAE;EACV,UAAU;CACX;QACG,UAAU;KACX,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB,EAAE,QAAgB;IAChE,IAAI,SAAS,KAAK,kBAAkB,EAAE,CAAC;QACrC,OAAO,wFAAwF,CAAC;IAClG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../src/commands/resume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../src/commands/resume.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAsC9B"}
|