@joynt/foundry 0.0.0-stage → 0.1.51

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 (216) hide show
  1. package/dist/backends/command.d.ts +37 -0
  2. package/dist/backends/command.d.ts.map +1 -0
  3. package/dist/backends/command.js +79 -0
  4. package/dist/backends/command.js.map +1 -0
  5. package/dist/backends/index.d.ts +9 -0
  6. package/dist/backends/index.d.ts.map +1 -0
  7. package/dist/backends/index.js +37 -0
  8. package/dist/backends/index.js.map +1 -0
  9. package/dist/cli.d.ts +3 -0
  10. package/dist/cli.d.ts.map +1 -0
  11. package/dist/cli.js +191 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/commands/action.d.ts +6 -0
  14. package/dist/commands/action.d.ts.map +1 -0
  15. package/dist/commands/action.js +171 -0
  16. package/dist/commands/action.js.map +1 -0
  17. package/dist/commands/cancelled.d.ts +5 -0
  18. package/dist/commands/cancelled.d.ts.map +1 -0
  19. package/dist/commands/cancelled.js +107 -0
  20. package/dist/commands/cancelled.js.map +1 -0
  21. package/dist/commands/init.d.ts +5 -0
  22. package/dist/commands/init.d.ts.map +1 -0
  23. package/dist/commands/init.js +323 -0
  24. package/dist/commands/init.js.map +1 -0
  25. package/dist/commands/preview.d.ts +4 -0
  26. package/dist/commands/preview.d.ts.map +1 -0
  27. package/dist/commands/preview.js +108 -0
  28. package/dist/commands/preview.js.map +1 -0
  29. package/dist/commands/release.d.ts +2 -0
  30. package/dist/commands/release.d.ts.map +1 -0
  31. package/dist/commands/release.js +89 -0
  32. package/dist/commands/release.js.map +1 -0
  33. package/dist/commands/report.d.ts +14 -0
  34. package/dist/commands/report.d.ts.map +1 -0
  35. package/dist/commands/report.js +91 -0
  36. package/dist/commands/report.js.map +1 -0
  37. package/dist/commands/reset.d.ts +4 -0
  38. package/dist/commands/reset.d.ts.map +1 -0
  39. package/dist/commands/reset.js +155 -0
  40. package/dist/commands/reset.js.map +1 -0
  41. package/dist/commands/review.d.ts +2 -0
  42. package/dist/commands/review.d.ts.map +1 -0
  43. package/dist/commands/review.js +73 -0
  44. package/dist/commands/review.js.map +1 -0
  45. package/dist/commands/setup-bot.d.ts +31 -0
  46. package/dist/commands/setup-bot.d.ts.map +1 -0
  47. package/dist/commands/setup-bot.js +429 -0
  48. package/dist/commands/setup-bot.js.map +1 -0
  49. package/dist/commands/sync.d.ts +2 -0
  50. package/dist/commands/sync.d.ts.map +1 -0
  51. package/dist/commands/sync.js +77 -0
  52. package/dist/commands/sync.js.map +1 -0
  53. package/dist/config.d.ts +9 -0
  54. package/dist/config.d.ts.map +1 -0
  55. package/dist/config.js +147 -0
  56. package/dist/config.js.map +1 -0
  57. package/dist/index.d.ts +15 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +29 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/lib/agent-output.d.ts +49 -0
  62. package/dist/lib/agent-output.d.ts.map +1 -0
  63. package/dist/lib/agent-output.js +256 -0
  64. package/dist/lib/agent-output.js.map +1 -0
  65. package/dist/lib/agent-report.d.ts +107 -0
  66. package/dist/lib/agent-report.d.ts.map +1 -0
  67. package/dist/lib/agent-report.js +233 -0
  68. package/dist/lib/agent-report.js.map +1 -0
  69. package/dist/lib/authorize.d.ts +3 -0
  70. package/dist/lib/authorize.d.ts.map +1 -0
  71. package/dist/lib/authorize.js +67 -0
  72. package/dist/lib/authorize.js.map +1 -0
  73. package/dist/lib/branches.d.ts +22 -0
  74. package/dist/lib/branches.d.ts.map +1 -0
  75. package/dist/lib/branches.js +82 -0
  76. package/dist/lib/branches.js.map +1 -0
  77. package/dist/lib/claim.d.ts +22 -0
  78. package/dist/lib/claim.d.ts.map +1 -0
  79. package/dist/lib/claim.js +129 -0
  80. package/dist/lib/claim.js.map +1 -0
  81. package/dist/lib/completion.d.ts +5 -0
  82. package/dist/lib/completion.d.ts.map +1 -0
  83. package/dist/lib/completion.js +63 -0
  84. package/dist/lib/completion.js.map +1 -0
  85. package/dist/lib/deployments.d.ts +21 -0
  86. package/dist/lib/deployments.d.ts.map +1 -0
  87. package/dist/lib/deployments.js +104 -0
  88. package/dist/lib/deployments.js.map +1 -0
  89. package/dist/lib/event-handler.d.ts +74 -0
  90. package/dist/lib/event-handler.d.ts.map +1 -0
  91. package/dist/lib/event-handler.js +1002 -0
  92. package/dist/lib/event-handler.js.map +1 -0
  93. package/dist/lib/events.d.ts +72 -0
  94. package/dist/lib/events.d.ts.map +1 -0
  95. package/dist/lib/events.js +3 -0
  96. package/dist/lib/events.js.map +1 -0
  97. package/dist/lib/gh-cli-client.d.ts +46 -0
  98. package/dist/lib/gh-cli-client.d.ts.map +1 -0
  99. package/dist/lib/gh-cli-client.js +260 -0
  100. package/dist/lib/gh-cli-client.js.map +1 -0
  101. package/dist/lib/git.d.ts +42 -0
  102. package/dist/lib/git.d.ts.map +1 -0
  103. package/dist/lib/git.js +247 -0
  104. package/dist/lib/git.js.map +1 -0
  105. package/dist/lib/github-client.d.ts +98 -0
  106. package/dist/lib/github-client.d.ts.map +1 -0
  107. package/dist/lib/github-client.js +3 -0
  108. package/dist/lib/github-client.js.map +1 -0
  109. package/dist/lib/github.d.ts +82 -0
  110. package/dist/lib/github.d.ts.map +1 -0
  111. package/dist/lib/github.js +202 -0
  112. package/dist/lib/github.js.map +1 -0
  113. package/dist/lib/issue-file.d.ts +15 -0
  114. package/dist/lib/issue-file.d.ts.map +1 -0
  115. package/dist/lib/issue-file.js +84 -0
  116. package/dist/lib/issue-file.js.map +1 -0
  117. package/dist/lib/labels.d.ts +14 -0
  118. package/dist/lib/labels.d.ts.map +1 -0
  119. package/dist/lib/labels.js +70 -0
  120. package/dist/lib/labels.js.map +1 -0
  121. package/dist/lib/log.d.ts +11 -0
  122. package/dist/lib/log.d.ts.map +1 -0
  123. package/dist/lib/log.js +53 -0
  124. package/dist/lib/log.js.map +1 -0
  125. package/dist/lib/octokit-client.d.ts +112 -0
  126. package/dist/lib/octokit-client.d.ts.map +1 -0
  127. package/dist/lib/octokit-client.js +507 -0
  128. package/dist/lib/octokit-client.js.map +1 -0
  129. package/dist/lib/preview-verify.d.ts +48 -0
  130. package/dist/lib/preview-verify.d.ts.map +1 -0
  131. package/dist/lib/preview-verify.js +148 -0
  132. package/dist/lib/preview-verify.js.map +1 -0
  133. package/dist/lib/preview.d.ts +33 -0
  134. package/dist/lib/preview.d.ts.map +1 -0
  135. package/dist/lib/preview.js +308 -0
  136. package/dist/lib/preview.js.map +1 -0
  137. package/dist/lib/reconcile.d.ts +14 -0
  138. package/dist/lib/reconcile.d.ts.map +1 -0
  139. package/dist/lib/reconcile.js +114 -0
  140. package/dist/lib/reconcile.js.map +1 -0
  141. package/dist/lib/review.d.ts +38 -0
  142. package/dist/lib/review.d.ts.map +1 -0
  143. package/dist/lib/review.js +284 -0
  144. package/dist/lib/review.js.map +1 -0
  145. package/dist/lib/stale-prs.d.ts +31 -0
  146. package/dist/lib/stale-prs.d.ts.map +1 -0
  147. package/dist/lib/stale-prs.js +161 -0
  148. package/dist/lib/stale-prs.js.map +1 -0
  149. package/dist/lib/state-store.d.ts +23 -0
  150. package/dist/lib/state-store.d.ts.map +1 -0
  151. package/dist/lib/state-store.js +3 -0
  152. package/dist/lib/state-store.js.map +1 -0
  153. package/dist/lib/state.d.ts +23 -0
  154. package/dist/lib/state.d.ts.map +1 -0
  155. package/dist/lib/state.js +57 -0
  156. package/dist/lib/state.js.map +1 -0
  157. package/dist/lib/status-comment.d.ts +14 -0
  158. package/dist/lib/status-comment.d.ts.map +1 -0
  159. package/dist/lib/status-comment.js +195 -0
  160. package/dist/lib/status-comment.js.map +1 -0
  161. package/dist/lib/stores/file-store.d.ts +22 -0
  162. package/dist/lib/stores/file-store.d.ts.map +1 -0
  163. package/dist/lib/stores/file-store.js +172 -0
  164. package/dist/lib/stores/file-store.js.map +1 -0
  165. package/dist/lib/stores/index.d.ts +13 -0
  166. package/dist/lib/stores/index.d.ts.map +1 -0
  167. package/dist/lib/stores/index.js +20 -0
  168. package/dist/lib/stores/index.js.map +1 -0
  169. package/dist/lib/task-recovery.d.ts +22 -0
  170. package/dist/lib/task-recovery.d.ts.map +1 -0
  171. package/dist/lib/task-recovery.js +172 -0
  172. package/dist/lib/task-recovery.js.map +1 -0
  173. package/dist/lib/templates.d.ts +8 -0
  174. package/dist/lib/templates.d.ts.map +1 -0
  175. package/dist/lib/templates.js +58 -0
  176. package/dist/lib/templates.js.map +1 -0
  177. package/dist/lib/thread.d.ts +13 -0
  178. package/dist/lib/thread.d.ts.map +1 -0
  179. package/dist/lib/thread.js +75 -0
  180. package/dist/lib/thread.js.map +1 -0
  181. package/dist/lib/verify.d.ts +31 -0
  182. package/dist/lib/verify.d.ts.map +1 -0
  183. package/dist/lib/verify.js +90 -0
  184. package/dist/lib/verify.js.map +1 -0
  185. package/dist/lib/version.d.ts +9 -0
  186. package/dist/lib/version.d.ts.map +1 -0
  187. package/dist/lib/version.js +134 -0
  188. package/dist/lib/version.js.map +1 -0
  189. package/dist/lib/webhook.d.ts +39 -0
  190. package/dist/lib/webhook.d.ts.map +1 -0
  191. package/dist/lib/webhook.js +248 -0
  192. package/dist/lib/webhook.js.map +1 -0
  193. package/dist/lib/worker.d.ts +42 -0
  194. package/dist/lib/worker.d.ts.map +1 -0
  195. package/dist/lib/worker.js +9 -0
  196. package/dist/lib/worker.js.map +1 -0
  197. package/dist/lib/workers/index.d.ts +11 -0
  198. package/dist/lib/workers/index.d.ts.map +1 -0
  199. package/dist/lib/workers/index.js +18 -0
  200. package/dist/lib/workers/index.js.map +1 -0
  201. package/dist/lib/workers/subprocess.d.ts +8 -0
  202. package/dist/lib/workers/subprocess.d.ts.map +1 -0
  203. package/dist/lib/workers/subprocess.js +105 -0
  204. package/dist/lib/workers/subprocess.js.map +1 -0
  205. package/dist/lib/worktree.d.ts +21 -0
  206. package/dist/lib/worktree.d.ts.map +1 -0
  207. package/dist/lib/worktree.js +113 -0
  208. package/dist/lib/worktree.js.map +1 -0
  209. package/dist/types.d.ts +201 -0
  210. package/dist/types.d.ts.map +1 -0
  211. package/dist/types.js +6 -0
  212. package/dist/types.js.map +1 -0
  213. package/package.json +44 -4
  214. package/templates/foundry.yml +121 -0
  215. package/templates/vercel-preview-url.sh +61 -0
  216. package/README.md +0 -3
package/dist/config.js ADDED
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULTS = exports.CONFIG_FILENAME = void 0;
37
+ exports.findConfigPath = findConfigPath;
38
+ exports.loadConfig = loadConfig;
39
+ exports.loadConfigSafe = loadConfigSafe;
40
+ exports.getConfigDir = getConfigDir;
41
+ /**
42
+ * Configuration loader for .joynt-foundry.yml
43
+ */
44
+ const fs = __importStar(require("node:fs"));
45
+ const path = __importStar(require("node:path"));
46
+ const yaml_1 = require("yaml");
47
+ const CONFIG_FILENAME = '.joynt-foundry.yml';
48
+ exports.CONFIG_FILENAME = CONFIG_FILENAME;
49
+ const DEFAULTS = {
50
+ repo: '',
51
+ labels: {
52
+ in_progress: 'state:in-progress',
53
+ done: 'state:done',
54
+ ready_for_review: 'state:ready-for-human-review',
55
+ waiting_for_input: 'state:waiting-for-input',
56
+ failed: 'state:failed',
57
+ plan_review: 'state:plan-review',
58
+ },
59
+ mode_labels: {
60
+ plan: 'mode:plan',
61
+ auto: 'mode:auto',
62
+ default: 'mode:default',
63
+ },
64
+ branches: {
65
+ integration: 'integration',
66
+ production: 'main',
67
+ },
68
+ branch_template: 'feature/{issue}-{slug}',
69
+ worktree_base: './wts',
70
+ max_input_rounds: 3,
71
+ agent_max_turns: 150,
72
+ reconcile_stale_minutes: 120,
73
+ verify: [],
74
+ verify_preview: [],
75
+ integration_rebuild: '',
76
+ comment_triggers: {
77
+ go: '@foundry go',
78
+ restart: '@foundry restart',
79
+ stop: '@foundry stop',
80
+ },
81
+ version_sources: [],
82
+ tag_prefix: 'v',
83
+ default_agent_backend: 'command',
84
+ agent_backends: {
85
+ command: {
86
+ type: 'command',
87
+ command: 'echo "No agent command configured. Set agent_backends in .joynt-foundry.yml"',
88
+ },
89
+ },
90
+ github_backend: 'octokit',
91
+ };
92
+ exports.DEFAULTS = DEFAULTS;
93
+ /**
94
+ * Deep merge b into a (a is base, b overrides).
95
+ */
96
+ function deepMerge(a, b) {
97
+ const result = { ...a };
98
+ for (const key of Object.keys(b)) {
99
+ if (b[key] !== null &&
100
+ typeof b[key] === 'object' &&
101
+ !Array.isArray(b[key]) &&
102
+ typeof a[key] === 'object' &&
103
+ !Array.isArray(a[key])) {
104
+ result[key] = deepMerge(a[key], b[key]);
105
+ }
106
+ else {
107
+ result[key] = b[key];
108
+ }
109
+ }
110
+ return result;
111
+ }
112
+ function findConfigPath(startDir) {
113
+ let dir = startDir ?? process.cwd();
114
+ while (true) {
115
+ const candidate = path.join(dir, CONFIG_FILENAME);
116
+ if (fs.existsSync(candidate))
117
+ return candidate;
118
+ const parent = path.dirname(dir);
119
+ if (parent === dir)
120
+ return null;
121
+ dir = parent;
122
+ }
123
+ }
124
+ function loadConfig(startDir) {
125
+ const configPath = findConfigPath(startDir);
126
+ if (!configPath) {
127
+ throw new Error(`No ${CONFIG_FILENAME} found. Run \`foundry init\` to create one.`);
128
+ }
129
+ const raw = fs.readFileSync(configPath, 'utf-8');
130
+ const parsed = (0, yaml_1.parse)(raw) ?? {};
131
+ return deepMerge(DEFAULTS, parsed);
132
+ }
133
+ function loadConfigSafe(startDir) {
134
+ try {
135
+ return loadConfig(startDir);
136
+ }
137
+ catch {
138
+ return null;
139
+ }
140
+ }
141
+ function getConfigDir(startDir) {
142
+ const configPath = findConfigPath(startDir);
143
+ if (!configPath)
144
+ return process.cwd();
145
+ return path.dirname(configPath);
146
+ }
147
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,wCASC;AAED,gCAUC;AAED,wCAMC;AAED,oCAIC;AA9GD;;GAEG;AACH,4CAA8B;AAC9B,gDAAkC;AAClC,+BAA0C;AAG1C,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAwGpC,0CAAe;AAtGxB,MAAM,QAAQ,GAAkB;IAC9B,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,YAAY;QAClB,gBAAgB,EAAE,8BAA8B;QAChD,iBAAiB,EAAE,yBAAyB;QAC5C,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,mBAAmB;KACjC;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;Q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C5C,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU;QAAE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Joynt Foundry — public API exports.
3
+ */
4
+ export type { FoundryConfig, AgentBackendDef, TaskState, RunnerState, AgentBackend, AgentLaunchParams, GitHubIssue, } from './types.js';
5
+ export { loadConfig, loadConfigSafe, findConfigPath } from './config.js';
6
+ export { resolveBackend, resolveBackendForIssue } from './backends/index.js';
7
+ export type { StateStore } from './lib/state-store.js';
8
+ export { resolveStateStore, FileStateStore } from './lib/stores/index.js';
9
+ export type { Worker, WorkerHandle, WorkerSpawnOpts } from './lib/worker.js';
10
+ export { resolveWorker } from './lib/workers/index.js';
11
+ export { SubprocessWorker } from './lib/workers/subprocess.js';
12
+ export { recoverTask, issueNumberFromPayload, issueNumberFromBranch } from './lib/task-recovery.js';
13
+ export { buildAgentCompletedEvent } from './lib/completion.js';
14
+ export { resolveBaseBranch, integrationBranch, productionBranch, MissingBranchError } from './lib/branches.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EACV,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingBranchError = exports.productionBranch = exports.integrationBranch = exports.resolveBaseBranch = exports.buildAgentCompletedEvent = exports.issueNumberFromBranch = exports.issueNumberFromPayload = exports.recoverTask = exports.SubprocessWorker = exports.resolveWorker = exports.FileStateStore = exports.resolveStateStore = exports.resolveBackendForIssue = exports.resolveBackend = exports.findConfigPath = exports.loadConfigSafe = exports.loadConfig = void 0;
4
+ var config_js_1 = require("./config.js");
5
+ Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_js_1.loadConfig; } });
6
+ Object.defineProperty(exports, "loadConfigSafe", { enumerable: true, get: function () { return config_js_1.loadConfigSafe; } });
7
+ Object.defineProperty(exports, "findConfigPath", { enumerable: true, get: function () { return config_js_1.findConfigPath; } });
8
+ var index_js_1 = require("./backends/index.js");
9
+ Object.defineProperty(exports, "resolveBackend", { enumerable: true, get: function () { return index_js_1.resolveBackend; } });
10
+ Object.defineProperty(exports, "resolveBackendForIssue", { enumerable: true, get: function () { return index_js_1.resolveBackendForIssue; } });
11
+ var index_js_2 = require("./lib/stores/index.js");
12
+ Object.defineProperty(exports, "resolveStateStore", { enumerable: true, get: function () { return index_js_2.resolveStateStore; } });
13
+ Object.defineProperty(exports, "FileStateStore", { enumerable: true, get: function () { return index_js_2.FileStateStore; } });
14
+ var index_js_3 = require("./lib/workers/index.js");
15
+ Object.defineProperty(exports, "resolveWorker", { enumerable: true, get: function () { return index_js_3.resolveWorker; } });
16
+ var subprocess_js_1 = require("./lib/workers/subprocess.js");
17
+ Object.defineProperty(exports, "SubprocessWorker", { enumerable: true, get: function () { return subprocess_js_1.SubprocessWorker; } });
18
+ var task_recovery_js_1 = require("./lib/task-recovery.js");
19
+ Object.defineProperty(exports, "recoverTask", { enumerable: true, get: function () { return task_recovery_js_1.recoverTask; } });
20
+ Object.defineProperty(exports, "issueNumberFromPayload", { enumerable: true, get: function () { return task_recovery_js_1.issueNumberFromPayload; } });
21
+ Object.defineProperty(exports, "issueNumberFromBranch", { enumerable: true, get: function () { return task_recovery_js_1.issueNumberFromBranch; } });
22
+ var completion_js_1 = require("./lib/completion.js");
23
+ Object.defineProperty(exports, "buildAgentCompletedEvent", { enumerable: true, get: function () { return completion_js_1.buildAgentCompletedEvent; } });
24
+ var branches_js_1 = require("./lib/branches.js");
25
+ Object.defineProperty(exports, "resolveBaseBranch", { enumerable: true, get: function () { return branches_js_1.resolveBaseBranch; } });
26
+ Object.defineProperty(exports, "integrationBranch", { enumerable: true, get: function () { return branches_js_1.integrationBranch; } });
27
+ Object.defineProperty(exports, "productionBranch", { enumerable: true, get: function () { return branches_js_1.productionBranch; } });
28
+ Object.defineProperty(exports, "MissingBranchError", { enumerable: true, get: function () { return branches_js_1.MissingBranchError; } });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAaA,yCAAyE;AAAhE,uGAAA,UAAU,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,2GAAA,cAAc,OAAA;AACnD,gDAA6E;AAApE,0GAAA,cAAc,OAAA;AAAE,kHAAA,sBAAsB,OAAA;AAE/C,kDAA0E;AAAjE,6GAAA,iBAAiB,OAAA;AAAE,0GAAA,cAAc,OAAA;AAE1C,mDAAuD;AAA9C,yGAAA,aAAa,OAAA;AACtB,6DAA+D;AAAtD,iHAAA,gBAAgB,OAAA;AACzB,2DAAoG;AAA3F,+GAAA,WAAW,OAAA;AAAE,0HAAA,sBAAsB,OAAA;AAAE,yHAAA,qBAAqB,OAAA;AACnE,qDAA+D;AAAtD,yHAAA,wBAAwB,OAAA;AACjC,iDAA+G;AAAtG,gHAAA,iBAAiB,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAAE,iHAAA,kBAAkB,OAAA"}
@@ -0,0 +1,49 @@
1
+ import type { AgentOutcome } from '../types.js';
2
+ interface StreamEvent {
3
+ type: string;
4
+ subtype?: string;
5
+ session_id?: string;
6
+ /** Non-null on events that belong to a subagent rather than the main conversation. */
7
+ parent_tool_use_id?: string | null;
8
+ is_error?: boolean;
9
+ structured_output?: unknown;
10
+ message?: {
11
+ role?: string;
12
+ content?: Array<{
13
+ type: string;
14
+ text?: string;
15
+ name?: string;
16
+ input?: Record<string, any>;
17
+ }>;
18
+ };
19
+ [key: string]: any;
20
+ }
21
+ export declare function parseStreamJsonLog(logPath: string): StreamEvent[];
22
+ export declare function extractSessionId(events: StreamEvent[]): string | null;
23
+ /**
24
+ * The last text the main conversation produced. Subagent events are skipped:
25
+ * a subagent's closing sentence is not the agent's conclusion. Used for
26
+ * display and diagnostics only, never for branching.
27
+ */
28
+ export declare function extractFinalAssistantMessage(events: StreamEvent[]): string | null;
29
+ /** Cost and size of the run, as the agent CLI reports them on its result event. */
30
+ export declare function extractUsage(result: StreamEvent): {
31
+ cost_usd?: number;
32
+ turns?: number;
33
+ duration_ms?: number;
34
+ } | undefined;
35
+ /** The final `result` event of the main conversation, if the run got that far. */
36
+ export declare function findResultEvent(events: StreamEvent[]): StreamEvent | null;
37
+ /** True when the run itself failed (auth, max turns, crash), as the agent CLI reports it. */
38
+ export declare function resultIsError(result: StreamEvent): boolean;
39
+ export interface DetermineOutcomeOptions {
40
+ permissionMode?: string;
41
+ /** Exit code of the agent process, when the caller waited on it. Null when killed by a signal. */
42
+ exitCode?: number | null;
43
+ /** Where `foundry report` writes; consulted when the transcript carries no structured output. */
44
+ reportFile?: string;
45
+ }
46
+ export declare function determineOutcome(logPath: string, worktreePath: string, baseBranch: string, options?: DetermineOutcomeOptions): AgentOutcome;
47
+ export declare function formatInputRequestComment(outcome: AgentOutcome, inputRound: number): string;
48
+ export {};
49
+ //# sourceMappingURL=agent-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-output.d.ts","sourceRoot":"","sources":["../../src/lib/agent-output.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAKrE,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SAC7B,CAAC,CAAC;KACJ,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAID,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAiBjE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,GAAG,IAAI,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,GAAG,IAAI,CAgBjF;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAMzH;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,GAAG,IAAI,CAKzE;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAG1D;AAmBD,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kGAAkG;IAClG,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAUD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,uBAAuB,GAChC,YAAY,CA6Ed;AAID,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,GACjB,MAAM,CAgCR"}
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.parseStreamJsonLog = parseStreamJsonLog;
37
+ exports.extractSessionId = extractSessionId;
38
+ exports.extractFinalAssistantMessage = extractFinalAssistantMessage;
39
+ exports.extractUsage = extractUsage;
40
+ exports.findResultEvent = findResultEvent;
41
+ exports.resultIsError = resultIsError;
42
+ exports.determineOutcome = determineOutcome;
43
+ exports.formatInputRequestComment = formatInputRequestComment;
44
+ /**
45
+ * Agent outcome determination.
46
+ *
47
+ * What happens after an agent exits is decided from three kinds of evidence,
48
+ * none of which is the agent's prose:
49
+ *
50
+ * - facts Foundry can check itself: did the run error, are there commits;
51
+ * - the agent's typed report (see agent-report.ts): done, needs_input,
52
+ * plan_ready, or blocked;
53
+ * - contradictions between the two, which fail closed.
54
+ *
55
+ * Claude Code in `-p --output-format stream-json` mode emits NDJSON events;
56
+ * this module reads them for the result event, the session id, and the
57
+ * structured report. Agents that emit nothing parseable are still supported
58
+ * through the report file.
59
+ */
60
+ const fs = __importStar(require("node:fs"));
61
+ const node_child_process_1 = require("node:child_process");
62
+ const agent_report_js_1 = require("./agent-report.js");
63
+ // ── Parsing ──────────────────────────────────────────────────────────────
64
+ function parseStreamJsonLog(logPath) {
65
+ if (!fs.existsSync(logPath))
66
+ return [];
67
+ const raw = fs.readFileSync(logPath, 'utf-8');
68
+ const events = [];
69
+ for (const line of raw.split('\n')) {
70
+ const trimmed = line.trim();
71
+ if (!trimmed)
72
+ continue;
73
+ try {
74
+ events.push(JSON.parse(trimmed));
75
+ }
76
+ catch {
77
+ // Not every line is an event (stderr is tee'd into the same file).
78
+ }
79
+ }
80
+ return events;
81
+ }
82
+ function extractSessionId(events) {
83
+ for (const event of events) {
84
+ if (event.type === 'system' && event.subtype === 'init' && event.session_id) {
85
+ return event.session_id;
86
+ }
87
+ }
88
+ return null;
89
+ }
90
+ /**
91
+ * The last text the main conversation produced. Subagent events are skipped:
92
+ * a subagent's closing sentence is not the agent's conclusion. Used for
93
+ * display and diagnostics only, never for branching.
94
+ */
95
+ function extractFinalAssistantMessage(events) {
96
+ let lastAssistantText = null;
97
+ for (const event of events) {
98
+ if (event.parent_tool_use_id)
99
+ continue;
100
+ if (event.type === 'assistant' && event.message?.role === 'assistant') {
101
+ const textParts = (event.message.content ?? [])
102
+ .filter(c => c.type === 'text' && c.text)
103
+ .map(c => c.text);
104
+ if (textParts.length > 0) {
105
+ lastAssistantText = textParts.join('\n');
106
+ }
107
+ }
108
+ }
109
+ return lastAssistantText;
110
+ }
111
+ /** Cost and size of the run, as the agent CLI reports them on its result event. */
112
+ function extractUsage(result) {
113
+ const u = {};
114
+ if (typeof result.total_cost_usd === 'number')
115
+ u.cost_usd = result.total_cost_usd;
116
+ if (typeof result.num_turns === 'number')
117
+ u.turns = result.num_turns;
118
+ if (typeof result.duration_ms === 'number')
119
+ u.duration_ms = result.duration_ms;
120
+ return Object.keys(u).length > 0 ? u : undefined;
121
+ }
122
+ /** The final `result` event of the main conversation, if the run got that far. */
123
+ function findResultEvent(events) {
124
+ for (let i = events.length - 1; i >= 0; i--) {
125
+ if (events[i].type === 'result' && !events[i].parent_tool_use_id)
126
+ return events[i];
127
+ }
128
+ return null;
129
+ }
130
+ /** True when the run itself failed (auth, max turns, crash), as the agent CLI reports it. */
131
+ function resultIsError(result) {
132
+ if (result.is_error === true)
133
+ return true;
134
+ return typeof result.subtype === 'string' && result.subtype !== 'success';
135
+ }
136
+ // ── Facts ────────────────────────────────────────────────────────────────
137
+ function hasCommitsBeyondBase(worktreePath, baseBranch) {
138
+ try {
139
+ const count = (0, node_child_process_1.execFileSync)('git', ['rev-list', '--count', `${baseBranch}..HEAD`], {
140
+ cwd: worktreePath,
141
+ encoding: 'utf-8',
142
+ timeout: 10_000,
143
+ }).trim();
144
+ return Number(count) > 0;
145
+ }
146
+ catch {
147
+ return false;
148
+ }
149
+ }
150
+ function toQuestionData(report) {
151
+ return (report.questions ?? []).map(q => ({
152
+ question: q.question,
153
+ options: (q.options ?? []).map(o => ({ label: o.label, description: o.description ?? '' })),
154
+ multiSelect: q.multi_select === true,
155
+ }));
156
+ }
157
+ function determineOutcome(logPath, worktreePath, baseBranch, options) {
158
+ const events = parseStreamJsonLog(logPath);
159
+ const sessionId = extractSessionId(events);
160
+ const finalMessage = extractFinalAssistantMessage(events);
161
+ const result = findResultEvent(events);
162
+ const usage = result ? extractUsage(result) : undefined;
163
+ const fail = (reason, report = null) => ({
164
+ type: 'errored',
165
+ session_id: sessionId,
166
+ final_message: finalMessage ? `${reason}\n\nLast agent output:\n${finalMessage}` : reason,
167
+ ask_user_questions: null,
168
+ report,
169
+ reason,
170
+ usage,
171
+ });
172
+ // 1. The run itself failed.
173
+ if (result && resultIsError(result)) {
174
+ const detail = typeof result.result === 'string' && result.result ? `: ${result.result}` : '';
175
+ // The CLI reports some failures (e.g. authentication) with subtype "success"
176
+ // and is_error set; naming that subtype reads as a contradiction.
177
+ const subtype = result.subtype && result.subtype !== 'success' ? ` (${result.subtype})` : '';
178
+ return fail(`The agent run failed${subtype}${detail}`);
179
+ }
180
+ // 2. The agent's report: structured output first, then the report file.
181
+ let parsed = null;
182
+ if (result && result.structured_output !== undefined && result.structured_output !== null) {
183
+ parsed = (0, agent_report_js_1.validateReport)(result.structured_output);
184
+ }
185
+ else if (options?.reportFile) {
186
+ parsed = (0, agent_report_js_1.readReportFile)(options.reportFile);
187
+ }
188
+ if (!parsed) {
189
+ const code = options?.exitCode;
190
+ if (typeof code === 'number' && code !== 0) {
191
+ return fail(`The agent process exited with code ${code} and submitted no report.`);
192
+ }
193
+ if (code === null) {
194
+ return fail('The agent process was killed by a signal and submitted no report.');
195
+ }
196
+ return fail(result
197
+ ? 'The agent finished without submitting a report. Its backend command must pass `--json-schema "$FOUNDRY_REPORT_SCHEMA"` (Claude Code) or run `foundry report` before exiting.'
198
+ : 'The agent exited without a result and without a report.');
199
+ }
200
+ if (!parsed.ok) {
201
+ return fail(`The agent's report was invalid: ${parsed.error}.`);
202
+ }
203
+ const report = parsed.report;
204
+ const base = { session_id: sessionId, report, usage };
205
+ const planMode = options?.permissionMode === '--permission-mode plan';
206
+ // 3. Branch on the typed status, checked against facts.
207
+ switch (report.status) {
208
+ case 'needs_input':
209
+ return { ...base, type: 'needs-input', final_message: report.summary, ask_user_questions: toQuestionData(report) };
210
+ case 'blocked':
211
+ return { ...base, type: 'blocked', final_message: report.summary, ask_user_questions: null, reason: report.summary };
212
+ case 'plan_ready':
213
+ return { ...base, type: 'plan-completed', final_message: report.plan ?? report.summary, ask_user_questions: null };
214
+ case 'done':
215
+ // In plan mode nothing can have been implemented; "done" means the plan is done.
216
+ if (planMode) {
217
+ return { ...base, type: 'plan-completed', final_message: report.plan ?? report.summary, ask_user_questions: null };
218
+ }
219
+ if (!hasCommitsBeyondBase(worktreePath, baseBranch)) {
220
+ return fail('The agent reported the task done, but the branch has no commits beyond its base.', report);
221
+ }
222
+ return { ...base, type: 'completed', final_message: report.summary, ask_user_questions: null };
223
+ }
224
+ }
225
+ // ── Comment formatting ───────────────────────────────────────────────────
226
+ function formatInputRequestComment(outcome, inputRound) {
227
+ const parts = [
228
+ '<!-- foundry-input-request -->',
229
+ `**Foundry Agent — Input Needed** (round ${inputRound})`,
230
+ '',
231
+ ];
232
+ const questions = outcome.ask_user_questions ?? [];
233
+ const summary = outcome.report?.summary;
234
+ if (summary && !(questions.length === 1 && questions[0].question === summary)) {
235
+ parts.push(summary, '');
236
+ }
237
+ if (questions.length > 0) {
238
+ for (let i = 0; i < questions.length; i++) {
239
+ const q = questions[i];
240
+ const selectType = q.options.length === 0 ? '' : q.multiSelect ? ' (select multiple)' : ' (select one)';
241
+ parts.push(`**${i + 1}. ${q.question}**${selectType}`);
242
+ for (const opt of q.options) {
243
+ parts.push(opt.description ? `- **${opt.label}** — ${opt.description}` : `- **${opt.label}**`);
244
+ }
245
+ parts.push('');
246
+ }
247
+ }
248
+ else if (outcome.final_message) {
249
+ parts.push(outcome.final_message, '');
250
+ }
251
+ parts.push('Comment `@foundry go` with your answer. The agent continues from where it stopped.');
252
+ parts.push('');
253
+ parts.push('Or: `@foundry restart` · `@foundry stop`');
254
+ return parts.join('\n');
255
+ }
256
+ //# sourceMappingURL=agent-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-output.js","sourceRoot":"","sources":["../../src/lib/agent-output.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,gDAiBC;AAED,4CAOC;AAOD,oEAgBC;AAGD,oCAMC;AAGD,0CAKC;AAGD,sCAGC;AAmCD,4CAkFC;AAID,8DAmCC;AAjRD;;;;;;;;;;;;;;;GAeG;AACH,4CAA8B;AAC9B,2DAAkD;AAElD,uDAAwG;AAwBxG,4EAA4E;AAE5E,SAAgB,kBAAkB,CAAC,OAAe;IAChD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAkB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
+ description?: string;
5
+ }
6
+ export interface AgentReportQuestion {
7
+ question: string;
8
+ options?: AgentReportOption[];
9
+ multi_select?: boolean;
10
+ }
11
+ export interface AgentReport {
12
+ status: AgentReportStatus;
13
+ summary: string;
14
+ assumptions?: string[];
15
+ questions?: AgentReportQuestion[];
16
+ plan?: string;
17
+ }
18
+ export declare const REPORT_STATUSES: AgentReportStatus[];
19
+ export declare const REPORT_SCHEMA_ENV = "FOUNDRY_REPORT_SCHEMA";
20
+ export declare const REPORT_FILE_ENV = "FOUNDRY_REPORT_FILE";
21
+ /**
22
+ * JSON Schema for the report. The descriptions are instructions to the agent;
23
+ * they are the only place the meaning of each status is defined.
24
+ */
25
+ export declare const AGENT_REPORT_SCHEMA: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly status: {
29
+ readonly type: "string";
30
+ readonly enum: AgentReportStatus[];
31
+ readonly description: string;
32
+ };
33
+ readonly summary: {
34
+ readonly type: "string";
35
+ readonly description: "What you did, or why you stopped. Written for the person reviewing the pull request. Plain prose, a few sentences.";
36
+ };
37
+ readonly assumptions: {
38
+ readonly type: "array";
39
+ readonly items: {
40
+ readonly type: "string";
41
+ };
42
+ readonly description: "Decisions you made without asking, one per entry, so the reviewer can check them.";
43
+ };
44
+ readonly questions: {
45
+ readonly type: "array";
46
+ readonly description: "Required when status is needs_input. Ask only what materially changes the work; offer options when you can.";
47
+ readonly items: {
48
+ readonly type: "object";
49
+ readonly properties: {
50
+ readonly question: {
51
+ readonly type: "string";
52
+ };
53
+ readonly options: {
54
+ readonly type: "array";
55
+ readonly items: {
56
+ readonly type: "object";
57
+ readonly properties: {
58
+ readonly label: {
59
+ readonly type: "string";
60
+ };
61
+ readonly description: {
62
+ readonly type: "string";
63
+ };
64
+ };
65
+ readonly required: readonly ["label"];
66
+ };
67
+ };
68
+ readonly multi_select: {
69
+ readonly type: "boolean";
70
+ };
71
+ };
72
+ readonly required: readonly ["question"];
73
+ };
74
+ };
75
+ readonly plan: {
76
+ readonly type: "string";
77
+ readonly description: "Required when status is plan_ready. The full plan in Markdown.";
78
+ };
79
+ };
80
+ readonly required: readonly ["status", "summary"];
81
+ };
82
+ export declare function reportSchemaJson(): string;
83
+ export type ReportResult = {
84
+ ok: true;
85
+ report: AgentReport;
86
+ } | {
87
+ ok: false;
88
+ error: string;
89
+ };
90
+ /**
91
+ * Validate an untrusted value as an AgentReport. Structural errors are
92
+ * rejected. Two cross-field gaps are repaired deterministically rather than
93
+ * rejected, because the status is unambiguous and the content exists:
94
+ * needs_input with no questions asks the summary; plan_ready with no plan
95
+ * uses the summary as the plan.
96
+ */
97
+ export declare function validateReport(value: unknown): ReportResult;
98
+ export declare function reportFilePath(stateDir: string): string;
99
+ /** Read and validate a report file. Null when the file does not exist. */
100
+ export declare function readReportFile(file: string): ReportResult | null;
101
+ export declare function writeReportFile(file: string, report: AgentReport): void;
102
+ /**
103
+ * Environment for an agent launch, and a clean slate: a report left by a
104
+ * previous launch of the same task must never be read as this launch's.
105
+ */
106
+ export declare function prepareLaunch(stateDir: string): Record<string, string>;
107
+ //# sourceMappingURL=agent-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-report.d.ts","sourceRoot":"","sources":["../../src/lib/agent-report.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CA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