agentflight 0.1.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.
Files changed (103) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +152 -0
  3. package/dist/adapters/agentloopkit.d.ts +10 -0
  4. package/dist/adapters/agentloopkit.d.ts.map +1 -0
  5. package/dist/adapters/agentloopkit.js +68 -0
  6. package/dist/adapters/agentloopkit.js.map +1 -0
  7. package/dist/adapters/projscan.d.ts +10 -0
  8. package/dist/adapters/projscan.d.ts.map +1 -0
  9. package/dist/adapters/projscan.js +54 -0
  10. package/dist/adapters/projscan.js.map +1 -0
  11. package/dist/cli.d.ts +5 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +95 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/commands/doctor.d.ts +16 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +91 -0
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/init.d.ts +9 -0
  20. package/dist/commands/init.d.ts.map +1 -0
  21. package/dist/commands/init.js +28 -0
  22. package/dist/commands/init.js.map +1 -0
  23. package/dist/commands/replay.d.ts +10 -0
  24. package/dist/commands/replay.d.ts.map +1 -0
  25. package/dist/commands/replay.js +32 -0
  26. package/dist/commands/replay.js.map +1 -0
  27. package/dist/commands/report.d.ts +10 -0
  28. package/dist/commands/report.d.ts.map +1 -0
  29. package/dist/commands/report.js +30 -0
  30. package/dist/commands/report.js.map +1 -0
  31. package/dist/commands/resume.d.ts +10 -0
  32. package/dist/commands/resume.d.ts.map +1 -0
  33. package/dist/commands/resume.js +34 -0
  34. package/dist/commands/resume.js.map +1 -0
  35. package/dist/commands/start.d.ts +20 -0
  36. package/dist/commands/start.d.ts.map +1 -0
  37. package/dist/commands/start.js +89 -0
  38. package/dist/commands/start.js.map +1 -0
  39. package/dist/commands/status.d.ts +12 -0
  40. package/dist/commands/status.d.ts.map +1 -0
  41. package/dist/commands/status.js +55 -0
  42. package/dist/commands/status.js.map +1 -0
  43. package/dist/core/config.d.ts +23 -0
  44. package/dist/core/config.d.ts.map +1 -0
  45. package/dist/core/config.js +74 -0
  46. package/dist/core/config.js.map +1 -0
  47. package/dist/core/doctor.d.ts +22 -0
  48. package/dist/core/doctor.d.ts.map +1 -0
  49. package/dist/core/doctor.js +68 -0
  50. package/dist/core/doctor.js.map +1 -0
  51. package/dist/core/fs-safe.d.ts +14 -0
  52. package/dist/core/fs-safe.d.ts.map +1 -0
  53. package/dist/core/fs-safe.js +31 -0
  54. package/dist/core/fs-safe.js.map +1 -0
  55. package/dist/core/git.d.ts +7 -0
  56. package/dist/core/git.d.ts.map +1 -0
  57. package/dist/core/git.js +40 -0
  58. package/dist/core/git.js.map +1 -0
  59. package/dist/core/output.d.ts +6 -0
  60. package/dist/core/output.d.ts.map +1 -0
  61. package/dist/core/output.js +11 -0
  62. package/dist/core/output.js.map +1 -0
  63. package/dist/core/paths.d.ts +3 -0
  64. package/dist/core/paths.d.ts.map +1 -0
  65. package/dist/core/paths.js +15 -0
  66. package/dist/core/paths.js.map +1 -0
  67. package/dist/core/process.d.ts +11 -0
  68. package/dist/core/process.d.ts.map +1 -0
  69. package/dist/core/process.js +27 -0
  70. package/dist/core/process.js.map +1 -0
  71. package/dist/core/project.d.ts +4 -0
  72. package/dist/core/project.d.ts.map +1 -0
  73. package/dist/core/project.js +25 -0
  74. package/dist/core/project.js.map +1 -0
  75. package/dist/core/risk.d.ts +4 -0
  76. package/dist/core/risk.d.ts.map +1 -0
  77. package/dist/core/risk.js +110 -0
  78. package/dist/core/risk.js.map +1 -0
  79. package/dist/core/session.d.ts +26 -0
  80. package/dist/core/session.d.ts.map +1 -0
  81. package/dist/core/session.js +83 -0
  82. package/dist/core/session.js.map +1 -0
  83. package/dist/core/verification.d.ts +5 -0
  84. package/dist/core/verification.d.ts.map +1 -0
  85. package/dist/core/verification.js +14 -0
  86. package/dist/core/verification.js.map +1 -0
  87. package/dist/renderers/html-replay.d.ts +17 -0
  88. package/dist/renderers/html-replay.d.ts.map +1 -0
  89. package/dist/renderers/html-replay.js +84 -0
  90. package/dist/renderers/html-replay.js.map +1 -0
  91. package/dist/renderers/markdown-report.d.ts +16 -0
  92. package/dist/renderers/markdown-report.d.ts.map +1 -0
  93. package/dist/renderers/markdown-report.js +80 -0
  94. package/dist/renderers/markdown-report.js.map +1 -0
  95. package/dist/renderers/resume-prompt.d.ts +13 -0
  96. package/dist/renderers/resume-prompt.d.ts.map +1 -0
  97. package/dist/renderers/resume-prompt.js +34 -0
  98. package/dist/renderers/resume-prompt.js.map +1 -0
  99. package/dist/types/index.d.ts +93 -0
  100. package/dist/types/index.d.ts.map +1 -0
  101. package/dist/types/index.js +2 -0
  102. package/dist/types/index.js.map +1 -0
  103. package/package.json +66 -0
@@ -0,0 +1,91 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { inspectAgentLoopKit } from "../adapters/agentloopkit.js";
4
+ import { inspectProjScan } from "../adapters/projscan.js";
5
+ import { evaluateDoctorChecks } from "../core/doctor.js";
6
+ import { pathExists } from "../core/fs-safe.js";
7
+ import { getRepositoryRoot } from "../core/git.js";
8
+ import { renderStatus } from "../core/output.js";
9
+ import { detectPackageManager, readPackageJson } from "../core/project.js";
10
+ import { runCommand } from "../core/process.js";
11
+ import { resolveAgentFlightPaths } from "../core/paths.js";
12
+ export async function runDoctorCommand(options) {
13
+ const paths = resolveAgentFlightPaths(options.repoRoot);
14
+ const packageJson = await readPackageJson(options.repoRoot);
15
+ const scripts = packageJson.scripts ?? {};
16
+ const [npmVersion, repoRoot, packageManager, projscan, agentloopkit] = await Promise.all([
17
+ options.npmVersion !== undefined
18
+ ? Promise.resolve(options.npmVersion)
19
+ : getNpmVersion(options.repoRoot),
20
+ getRepositoryRoot(options.repoRoot),
21
+ options.packageManager !== undefined
22
+ ? Promise.resolve(options.packageManager)
23
+ : detectPackageManager(options.repoRoot),
24
+ options.projscanAvailable !== undefined
25
+ ? Promise.resolve({ available: options.projscanAvailable })
26
+ : inspectProjScan({ cwd: options.repoRoot }),
27
+ options.agentloopkitAvailable !== undefined
28
+ ? Promise.resolve({ available: options.agentloopkitAvailable })
29
+ : inspectAgentLoopKit({ cwd: options.repoRoot })
30
+ ]);
31
+ const result = evaluateDoctorChecks({
32
+ nodeVersion: options.nodeVersion ?? process.version,
33
+ npmVersion,
34
+ gitAvailable: options.gitAvailable ??
35
+ (repoRoot !== options.repoRoot || (await pathExists(join(options.repoRoot, ".git")))),
36
+ packageManager,
37
+ repoRoot,
38
+ agentFlightExists: await pathExists(paths.root),
39
+ configValid: await isConfigValid(paths.config),
40
+ writable: await isWritable(paths.root),
41
+ currentSessionExists: await pathExists(paths.currentSession),
42
+ projscanAvailable: projscan.available,
43
+ agentloopkitAvailable: agentloopkit.available,
44
+ scripts: {
45
+ test: Boolean(scripts.test),
46
+ build: Boolean(scripts.build),
47
+ typecheck: Boolean(scripts.typecheck),
48
+ lint: Boolean(scripts.lint)
49
+ }
50
+ });
51
+ return {
52
+ output: renderDoctor(result),
53
+ result
54
+ };
55
+ }
56
+ async function getNpmVersion(repoRoot) {
57
+ const result = await runCommand("npm", ["--version"], { cwd: repoRoot, timeoutMs: 10_000 });
58
+ return result.exitCode === 0 ? result.stdout.trim() : null;
59
+ }
60
+ async function isConfigValid(path) {
61
+ try {
62
+ JSON.parse(await readFile(path, "utf8"));
63
+ return true;
64
+ }
65
+ catch {
66
+ return false;
67
+ }
68
+ }
69
+ async function isWritable(path) {
70
+ try {
71
+ await access(path);
72
+ return true;
73
+ }
74
+ catch {
75
+ return false;
76
+ }
77
+ }
78
+ function renderDoctor(result) {
79
+ return `AgentFlight Doctor
80
+
81
+ Overall: ${renderStatus(result.status)}
82
+
83
+ ${result.checks
84
+ .map((check) => {
85
+ const fix = check.suggestedFix ? `\n Suggested fix: ${check.suggestedFix}` : "";
86
+ return `- ${renderStatus(check.status)} ${check.name}: ${check.message}${fix}`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C,MAAoB;IACxC,OAAO;;WAEE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;;EAEpC,MAAM,CAAC,MAAM;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"}
@@ -0,0 +1,9 @@
1
+ export interface InitCommandOptions {
2
+ repoRoot: string;
3
+ now?: Date | undefined;
4
+ }
5
+ export interface InitCommandResult {
6
+ output: string;
7
+ }
8
+ export declare function runInitCommand(options: InitCommandOptions): Promise<InitCommandResult>;
9
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyB5F"}
@@ -0,0 +1,28 @@
1
+ import { initAgentFlight } from "../core/config.js";
2
+ import { formatToolAvailability } from "../core/output.js";
3
+ export async function runInitCommand(options) {
4
+ const result = await initAgentFlight(options);
5
+ return {
6
+ output: `AgentFlight initialized
7
+
8
+ Project:
9
+ ${result.config.projectName}
10
+
11
+ Created:
12
+ ${result.created.length}
13
+
14
+ Skipped existing files:
15
+ ${result.skipped.length}
16
+
17
+ Detected:
18
+ ${formatToolAvailability("AgentLoopKit", result.detections.agentloopkit)}
19
+ ${formatToolAvailability("ProjScan", result.detections.projscan)}
20
+
21
+ Next commands:
22
+ agentflight start --task "Describe the work"
23
+ agentflight status
24
+ agentflight doctor
25
+ `
26
+ };
27
+ }
28
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAW3D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA2B;IAC9D,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IAE9C,OAAO;QACL,MAAM,EAAE;;;EAGV,MAAM,CAAC,MAAM,CAAC,WAAW;;;EAGzB,MAAM,CAAC,OAAO,CAAC,MAAM;;;EAGrB,MAAM,CAAC,OAAO,CAAC,MAAM;;;EAGrB,sBAAsB,CAAC,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC;EACtE,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;;;;;;CAM/D;KACE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface ReplayCommandOptions {
2
+ repoRoot: string;
3
+ changedFiles?: string[] | undefined;
4
+ }
5
+ export interface ReplayCommandResult {
6
+ output: string;
7
+ replayPath: string;
8
+ }
9
+ export declare function runReplayCommand(options: ReplayCommandOptions): Promise<ReplayCommandResult>;
10
+ //# sourceMappingURL=replay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;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,CA2B9B"}
@@ -0,0 +1,32 @@
1
+ import { writeTextFileSafe } from "../core/fs-safe.js";
2
+ import { listChangedFiles } from "../core/git.js";
3
+ import { resolveAgentFlightPaths } from "../core/paths.js";
4
+ import { analyzeRisk } from "../core/risk.js";
5
+ import { renderHtmlReplay } from "../renderers/html-replay.js";
6
+ import { readCurrentSession } from "./status.js";
7
+ export async function runReplayCommand(options) {
8
+ const session = await readCurrentSession(options.repoRoot);
9
+ const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
10
+ const risk = analyzeRisk(changedFiles);
11
+ const replayPath = `${resolveAgentFlightPaths(options.repoRoot).reports}/${session.id}-replay.html`;
12
+ const html = renderHtmlReplay({
13
+ task: session.task.title,
14
+ sessionId: session.id,
15
+ startedAt: session.startedAt,
16
+ timeline: [{ label: "Session started", timestamp: session.startedAt }],
17
+ changedFiles,
18
+ riskBadges: [risk.level, ...risk.categories.map((summary) => summary.category)],
19
+ verificationEvidence: [],
20
+ recommendation: risk.level === "high"
21
+ ? "Run verification and request focused review on high-risk file categories."
22
+ : "Run verification and prepare a scoped handoff."
23
+ });
24
+ await writeTextFileSafe(replayPath, html, { overwrite: true });
25
+ return {
26
+ output: `Replay generated:
27
+ ${replayPath}
28
+ `,
29
+ replayPath
30
+ };
31
+ }
32
+ //# sourceMappingURL=replay.js.map
@@ -0,0 +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,M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AAiB,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/D,OAAO;QACL,MAAM,EAAE;EACV,UAAU;CACX;QACG,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface ReportCommandOptions {
2
+ repoRoot: string;
3
+ changedFiles?: string[] | undefined;
4
+ }
5
+ export interface ReportCommandResult {
6
+ output: string;
7
+ reportPath: string;
8
+ }
9
+ export declare function runReportCommand(options: ReportCommandOptions): Promise<ReportCommandResult>;
10
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;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,CAwB9B"}
@@ -0,0 +1,30 @@
1
+ import { writeTextFileSafe } from "../core/fs-safe.js";
2
+ import { listChangedFiles } from "../core/git.js";
3
+ import { resolveAgentFlightPaths } from "../core/paths.js";
4
+ import { analyzeRisk } from "../core/risk.js";
5
+ import { renderMarkdownReport } from "../renderers/markdown-report.js";
6
+ import { readCurrentSession } from "./status.js";
7
+ export async function runReportCommand(options) {
8
+ const session = await readCurrentSession(options.repoRoot);
9
+ const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
10
+ const risk = analyzeRisk(changedFiles);
11
+ const report = renderMarkdownReport({
12
+ task: session.task.title,
13
+ sessionId: session.id,
14
+ startedAt: session.startedAt,
15
+ changedFiles,
16
+ risk,
17
+ verificationCommands: session.verificationCommands,
18
+ verificationEvidence: [],
19
+ tooling: session.tools
20
+ });
21
+ const reportPath = `${resolveAgentFlightPaths(options.repoRoot).reports}/${session.id}-proof.md`;
22
+ await writeTextFileSafe(reportPath, report, { overwrite: true });
23
+ return {
24
+ output: `Report generated:
25
+ ${reportPath}
26
+ `,
27
+ reportPath
28
+ };
29
+ }
30
+ //# sourceMappingURL=report.js.map
@@ -0,0 +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;AAYjD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAA6B;IAE7B,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,MAAM,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxF,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,oBAAoB,CAAC;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;QACxB,SAAS,EAAE,OAAO,CAAC,EAAE;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY;QACZ,IAAI;QACJ,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,oBAAoB,EAAE,EAAE;QACxB,OAAO,EAAE,OAAO,CAAC,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,GAAG,uBAAuB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,WAAW,CAAC;IAEjG,MAAM,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEjE,OAAO;QACL,MAAM,EAAE;EACV,UAAU;CACX;QACG,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface ResumeCommandOptions {
2
+ repoRoot: string;
3
+ changedFiles?: string[] | undefined;
4
+ }
5
+ export interface ResumeCommandResult {
6
+ output: string;
7
+ resumePath: string;
8
+ }
9
+ export declare function runResumeCommand(options: ResumeCommandOptions): Promise<ResumeCommandResult>;
10
+ //# sourceMappingURL=resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../src/commands/resume.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;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,CA8B9B"}
@@ -0,0 +1,34 @@
1
+ import { writeTextFileSafe } from "../core/fs-safe.js";
2
+ import { listChangedFiles } from "../core/git.js";
3
+ import { resolveAgentFlightPaths } from "../core/paths.js";
4
+ import { analyzeRisk } from "../core/risk.js";
5
+ import { renderResumePrompt } from "../renderers/resume-prompt.js";
6
+ import { readCurrentSession } from "./status.js";
7
+ export async function runResumeCommand(options) {
8
+ const session = await readCurrentSession(options.repoRoot);
9
+ const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
10
+ const risk = analyzeRisk(changedFiles);
11
+ const verificationGaps = session.verificationCommands.length > 0
12
+ ? [
13
+ `No verification evidence recorded. Suggested first command: ${session.verificationCommands[0]}`
14
+ ]
15
+ : ["No verification commands detected."];
16
+ const prompt = renderResumePrompt({
17
+ task: session.task.title,
18
+ sessionId: session.id,
19
+ branch: session.git.branch,
20
+ changedFiles,
21
+ riskLevel: risk.level,
22
+ riskReasons: risk.reasons,
23
+ verificationGaps,
24
+ nextAction: session.verificationCommands[0] ??
25
+ "Add or run an appropriate verification command before claiming completion."
26
+ });
27
+ const resumePath = resolveAgentFlightPaths(options.repoRoot).currentResumePrompt;
28
+ await writeTextFileSafe(resumePath, prompt, { overwrite: true });
29
+ return {
30
+ output: prompt,
31
+ resumePath
32
+ };
33
+ }
34
+ //# sourceMappingURL=resume.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.js","sourceRoot":"","sources":["../../src/commands/resume.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,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAYjD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAA6B;IAE7B,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,MAAM,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxF,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,gBAAgB,GACpB,OAAO,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC;QACrC,CAAC,CAAC;YACE,+DAA+D,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;SACjG;QACH,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;QACxB,SAAS,EAAE,OAAO,CAAC,EAAE;QACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM;QAC1B,YAAY;QACZ,SAAS,EAAE,IAAI,CAAC,KAAK;QACrB,WAAW,EAAE,IAAI,CAAC,OAAO;QACzB,gBAAgB;QAChB,UAAU,EACR,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC/B,4EAA4E;KAC/E,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,uBAAuB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC;IAEjF,MAAM,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEjE,OAAO;QACL,MAAM,EAAE,MAAM;QACd,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { GitInfo, ToolAdapterResult } from "../types/index.js";
2
+ export interface StartCommandOptions {
3
+ repoRoot: string;
4
+ task: string;
5
+ yes?: boolean | undefined;
6
+ now?: Date | undefined;
7
+ git?: GitInfo | undefined;
8
+ packageManager?: string | null | undefined;
9
+ tools?: {
10
+ projscan: ToolAdapterResult;
11
+ agentloopkit: ToolAdapterResult;
12
+ } | undefined;
13
+ }
14
+ export interface StartCommandResult {
15
+ output: string;
16
+ sessionId: string;
17
+ handoffPath: string;
18
+ }
19
+ export declare function runStartCommand(options: StartCommandOptions): Promise<StartCommandResult>;
20
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EACF;QACE,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,YAAY,EAAE,iBAAiB,CAAC;KACjC,GACD,SAAS,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAoD/F"}
@@ -0,0 +1,89 @@
1
+ import { createAgentLoopTask, inspectAgentLoopKit } from "../adapters/agentloopkit.js";
2
+ import { inspectProjScan, runProjScanBaseline } from "../adapters/projscan.js";
3
+ import { initAgentFlight } from "../core/config.js";
4
+ import { pathExists } from "../core/fs-safe.js";
5
+ import { getGitInfo } from "../core/git.js";
6
+ import { formatToolAvailability } from "../core/output.js";
7
+ import { detectPackageManager, readPackageJson } from "../core/project.js";
8
+ import { resolveAgentFlightPaths } from "../core/paths.js";
9
+ import { startSession } from "../core/session.js";
10
+ import { detectVerificationCommands } from "../core/verification.js";
11
+ export async function runStartCommand(options) {
12
+ const paths = resolveAgentFlightPaths(options.repoRoot);
13
+ if (!(await pathExists(paths.config))) {
14
+ if (options.yes === true) {
15
+ await initAgentFlight({ repoRoot: options.repoRoot, now: options.now });
16
+ }
17
+ else {
18
+ throw new Error("AgentFlight is not initialized. Run agentflight init first, or pass --yes.");
19
+ }
20
+ }
21
+ const packageJson = await readPackageJson(options.repoRoot);
22
+ const verificationCommands = detectVerificationCommands(packageJson);
23
+ const git = options.git ?? (await getGitInfo(options.repoRoot));
24
+ const packageManager = options.packageManager ?? (await detectPackageManager(options.repoRoot));
25
+ const tools = options.tools ?? (await inspectTools(options.repoRoot, options.task));
26
+ const result = await startSession({
27
+ repoRoot: options.repoRoot,
28
+ task: options.task,
29
+ now: options.now,
30
+ git,
31
+ packageManager,
32
+ verificationCommands,
33
+ tools
34
+ });
35
+ return {
36
+ output: `AgentFlight started
37
+
38
+ Task:
39
+ ${options.task}
40
+
41
+ Session:
42
+ ${result.session.id}
43
+
44
+ Detected:
45
+ Git branch: ${git.branch ?? "unknown"}
46
+ Package manager: ${packageManager ?? "unknown"}
47
+ ${formatToolAvailability("ProjScan", tools.projscan.available)}
48
+ ${formatToolAvailability("AgentLoopKit", tools.agentloopkit.available)}
49
+
50
+ Suggested proof:
51
+ ${verificationCommands.length ? verificationCommands.join("\n") : "No proof commands detected yet."}
52
+
53
+ Handoff saved:
54
+ ${result.handoffPath}
55
+
56
+ Now run your coding agent normally.
57
+ `,
58
+ sessionId: result.session.id,
59
+ handoffPath: result.handoffPath
60
+ };
61
+ }
62
+ async function inspectTools(repoRoot, task) {
63
+ const [projscanInspection, agentLoopInspection] = await Promise.all([
64
+ inspectProjScan({ cwd: repoRoot }),
65
+ inspectAgentLoopKit({ cwd: repoRoot })
66
+ ]);
67
+ const [projscanBaseline, agentLoopTask] = await Promise.all([
68
+ projscanInspection.available
69
+ ? runProjScanBaseline(repoRoot)
70
+ : Promise.resolve(projscanInspection),
71
+ agentLoopInspection.available
72
+ ? createAgentLoopTask(repoRoot, task)
73
+ : Promise.resolve(agentLoopInspection)
74
+ ]);
75
+ return {
76
+ projscan: mergeToolResults(projscanInspection, projscanBaseline),
77
+ agentloopkit: mergeToolResults(agentLoopInspection, agentLoopTask)
78
+ };
79
+ }
80
+ function mergeToolResults(base, extra) {
81
+ return {
82
+ available: base.available && extra.available,
83
+ ...(base.version ? { version: base.version } : {}),
84
+ ...((extra.summary ?? base.summary) ? { summary: extra.summary ?? base.summary } : {}),
85
+ ...(extra.taskLinked !== undefined ? { taskLinked: extra.taskLinked } : {}),
86
+ warnings: [...base.warnings, ...extra.warnings]
87
+ };
88
+ }
89
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAwBrE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA4B;IAChE,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACtC,IAAI,OAAO,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,eA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O,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;KAChD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AgentFlightSession } from "../types/index.js";
2
+ export interface StatusCommandOptions {
3
+ repoRoot: string;
4
+ now?: Date | undefined;
5
+ changedFiles?: string[] | undefined;
6
+ }
7
+ export interface StatusCommandResult {
8
+ output: string;
9
+ }
10
+ export declare function runStatusCommand(options: StatusCommandOptions): Promise<StatusCommandResult>;
11
+ export declare function readCurrentSession(repoRoot: string): Promise<AgentFlightSession>;
12
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA+B9B;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEtF"}
@@ -0,0 +1,55 @@
1
+ import { listChangedFiles } from "../core/git.js";
2
+ import { readJsonFile } from "../core/fs-safe.js";
3
+ import { resolveAgentFlightPaths } from "../core/paths.js";
4
+ import { analyzeRisk } from "../core/risk.js";
5
+ export async function runStatusCommand(options) {
6
+ const session = await readCurrentSession(options.repoRoot);
7
+ const changedFiles = options.changedFiles ?? (await listChangedFiles(options.repoRoot));
8
+ const risk = analyzeRisk(changedFiles);
9
+ const duration = formatDuration(session.startedAt, options.now ?? new Date());
10
+ const verificationStatus = session.verificationCommands.length
11
+ ? "configured, evidence not recorded"
12
+ : "missing";
13
+ return {
14
+ output: `AgentFlight status
15
+
16
+ Task:
17
+ ${session.task.title}
18
+
19
+ Session duration:
20
+ ${duration}
21
+
22
+ Changed files:
23
+ ${changedFiles.length}
24
+
25
+ Risk: ${risk.level}
26
+ ${risk.reasons.map((reason) => `- ${reason}`).join("\n")}
27
+
28
+ Verification:
29
+ ${verificationStatus}
30
+
31
+ Next action:
32
+ ${nextAction(risk.level, session.verificationCommands)}
33
+ `
34
+ };
35
+ }
36
+ export async function readCurrentSession(repoRoot) {
37
+ return readJsonFile(resolveAgentFlightPaths(repoRoot).currentSession);
38
+ }
39
+ function formatDuration(startedAt, now) {
40
+ const elapsedMs = Math.max(0, now.getTime() - new Date(startedAt).getTime());
41
+ const minutes = Math.floor(elapsedMs / 60_000);
42
+ if (minutes < 1)
43
+ return "less than a minute";
44
+ if (minutes === 1)
45
+ return "1 minute";
46
+ return `${minutes} minutes`;
47
+ }
48
+ function nextAction(level, commands) {
49
+ if (commands.length > 0)
50
+ return `Run ${commands[0]} and capture proof.`;
51
+ if (level === "high")
52
+ return "Add verification commands before claiming completion.";
53
+ return "Review changed files and add proof commands if needed.";
54
+ }
55
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1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gB;IACvD,OAAO,YAAY,CAAqB,uBAAuB,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC;AAC5F,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB,EAAE,GAAS;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;IAC/C,IAAI,OAAO,GAAG,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAC7C,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IACrC,OAAO,GAAG,OAAO,UAAU,CAAC;AAC9B,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,QAAkB;IACnD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,OAAO,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACxE,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,uDAAuD,CAAC;IACrF,OAAO,wDAAwD,CAAC;AAClE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { AgentFlightConfig, AgentFlightPaths } from "../types/index.js";
2
+ export interface CreateDefaultConfigOptions {
3
+ repoRoot: string;
4
+ now?: Date | undefined;
5
+ }
6
+ export interface InitAgentFlightOptions {
7
+ repoRoot: string;
8
+ now?: Date | undefined;
9
+ }
10
+ export interface InitAgentFlightResult {
11
+ paths: AgentFlightPaths;
12
+ config: AgentFlightConfig;
13
+ created: string[];
14
+ skipped: string[];
15
+ detections: {
16
+ agentloopkit: boolean;
17
+ projscan: boolean;
18
+ };
19
+ }
20
+ export declare function createDefaultConfig(options: CreateDefaultConfigOptions): AgentFlightConfig;
21
+ export declare function initAgentFlight(options: InitAgentFlightOptions): Promise<InitAgentFlightResult>;
22
+ export declare function loadConfig(repoRoot: string): Promise<AgentFlightConfig | null>;
23
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE;QACV,YAAY,EAAE,OAAO,CAAC;QACtB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,iBAAiB,CAyB1F;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAwChC;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAIpF"}
@@ -0,0 +1,74 @@
1
+ import { basename } from "node:path";
2
+ import { ensureDir, pathExists, readJsonFile, writeJsonFileSafe, writeTextFileSafe } from "./fs-safe.js";
3
+ import { resolveAgentFlightPaths } from "./paths.js";
4
+ export function createDefaultConfig(options) {
5
+ const now = options.now ?? new Date();
6
+ return {
7
+ version: 1,
8
+ projectName: basename(options.repoRoot),
9
+ createdAt: now.toISOString(),
10
+ engines: {
11
+ projscan: {
12
+ enabled: true,
13
+ mode: "npx"
14
+ },
15
+ agentloopkit: {
16
+ enabled: true,
17
+ mode: "npx"
18
+ }
19
+ },
20
+ verification: {
21
+ commands: []
22
+ },
23
+ privacy: {
24
+ localOnly: true,
25
+ telemetry: false
26
+ }
27
+ };
28
+ }
29
+ export async function initAgentFlight(options) {
30
+ const paths = resolveAgentFlightPaths(options.repoRoot);
31
+ const created = [];
32
+ const skipped = [];
33
+ await ensureDir(paths.root);
34
+ await ensureDir(paths.sessions);
35
+ await ensureDir(paths.reports);
36
+ await ensureDir(paths.current);
37
+ for (const gitkeepPath of [
38
+ `${paths.sessions}/.gitkeep`,
39
+ `${paths.reports}/.gitkeep`,
40
+ `${paths.current}/.gitkeep`
41
+ ]) {
42
+ const result = await writeTextFileSafe(gitkeepPath, "");
43
+ if (result.status === "created")
44
+ created.push(result.path);
45
+ if (result.status === "skipped")
46
+ skipped.push(result.path);
47
+ }
48
+ const defaultConfig = createDefaultConfig({ repoRoot: options.repoRoot, now: options.now });
49
+ const configWrite = await writeJsonFileSafe(paths.config, defaultConfig);
50
+ if (configWrite.status === "created")
51
+ created.push(configWrite.path);
52
+ if (configWrite.status === "skipped")
53
+ skipped.push(configWrite.path);
54
+ const config = configWrite.status === "skipped"
55
+ ? await readJsonFile(paths.config)
56
+ : defaultConfig;
57
+ return {
58
+ paths,
59
+ config,
60
+ created,
61
+ skipped,
62
+ detections: {
63
+ agentloopkit: await pathExists(`${options.repoRoot}/.agentloop`),
64
+ projscan: await pathExists(`${options.repoRoot}/.projscanrc.json`)
65
+ }
66
+ };
67
+ }
68
+ export async function loadConfig(repoRoot) {
69
+ const paths = resolveAgentFlightPaths(repoRoot);
70
+ if (!(await pathExists(paths.config)))
71
+ return null;
72
+ return readJsonFile(paths.config);
73
+ }
74
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO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CAAC,QAAgB;IAC/C,MAAM,KAAK,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,OAAO,YAAY,CAAoB,KAAK,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { DoctorResult } from "../types/index.js";
2
+ export interface DoctorEvaluationInput {
3
+ nodeVersion: string;
4
+ npmVersion: string | null;
5
+ gitAvailable: boolean;
6
+ packageManager: string | null;
7
+ repoRoot: string | null;
8
+ agentFlightExists: boolean;
9
+ configValid: boolean;
10
+ writable: boolean;
11
+ currentSessionExists: boolean;
12
+ projscanAvailable: boolean;
13
+ agentloopkitAvailable: boolean;
14
+ scripts: {
15
+ test: boolean;
16
+ build: boolean;
17
+ typecheck: boolean;
18
+ lint: boolean;
19
+ };
20
+ }
21
+ export declare function evaluateDoctorChecks(input: DoctorEvaluationInput): DoctorResult;
22
+ //# sourceMappingURL=doctor.d.ts.map