@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.
- package/dist/backends/command.d.ts +37 -0
- package/dist/backends/command.d.ts.map +1 -0
- package/dist/backends/command.js +79 -0
- package/dist/backends/command.js.map +1 -0
- package/dist/backends/index.d.ts +9 -0
- package/dist/backends/index.d.ts.map +1 -0
- package/dist/backends/index.js +37 -0
- package/dist/backends/index.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +191 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/action.d.ts +6 -0
- package/dist/commands/action.d.ts.map +1 -0
- package/dist/commands/action.js +171 -0
- package/dist/commands/action.js.map +1 -0
- package/dist/commands/cancelled.d.ts +5 -0
- package/dist/commands/cancelled.d.ts.map +1 -0
- package/dist/commands/cancelled.js +107 -0
- package/dist/commands/cancelled.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +323 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/preview.d.ts +4 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +108 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/release.d.ts +2 -0
- package/dist/commands/release.d.ts.map +1 -0
- package/dist/commands/release.js +89 -0
- package/dist/commands/release.js.map +1 -0
- package/dist/commands/report.d.ts +14 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +91 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/reset.d.ts +4 -0
- package/dist/commands/reset.d.ts.map +1 -0
- package/dist/commands/reset.js +155 -0
- package/dist/commands/reset.js.map +1 -0
- package/dist/commands/review.d.ts +2 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +73 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/setup-bot.d.ts +31 -0
- package/dist/commands/setup-bot.d.ts.map +1 -0
- package/dist/commands/setup-bot.js +429 -0
- package/dist/commands/setup-bot.js.map +1 -0
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +77 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +147 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/agent-output.d.ts +49 -0
- package/dist/lib/agent-output.d.ts.map +1 -0
- package/dist/lib/agent-output.js +256 -0
- package/dist/lib/agent-output.js.map +1 -0
- package/dist/lib/agent-report.d.ts +107 -0
- package/dist/lib/agent-report.d.ts.map +1 -0
- package/dist/lib/agent-report.js +233 -0
- package/dist/lib/agent-report.js.map +1 -0
- package/dist/lib/authorize.d.ts +3 -0
- package/dist/lib/authorize.d.ts.map +1 -0
- package/dist/lib/authorize.js +67 -0
- package/dist/lib/authorize.js.map +1 -0
- package/dist/lib/branches.d.ts +22 -0
- package/dist/lib/branches.d.ts.map +1 -0
- package/dist/lib/branches.js +82 -0
- package/dist/lib/branches.js.map +1 -0
- package/dist/lib/claim.d.ts +22 -0
- package/dist/lib/claim.d.ts.map +1 -0
- package/dist/lib/claim.js +129 -0
- package/dist/lib/claim.js.map +1 -0
- package/dist/lib/completion.d.ts +5 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/completion.js +63 -0
- package/dist/lib/completion.js.map +1 -0
- package/dist/lib/deployments.d.ts +21 -0
- package/dist/lib/deployments.d.ts.map +1 -0
- package/dist/lib/deployments.js +104 -0
- package/dist/lib/deployments.js.map +1 -0
- package/dist/lib/event-handler.d.ts +74 -0
- package/dist/lib/event-handler.d.ts.map +1 -0
- package/dist/lib/event-handler.js +1002 -0
- package/dist/lib/event-handler.js.map +1 -0
- package/dist/lib/events.d.ts +72 -0
- package/dist/lib/events.d.ts.map +1 -0
- package/dist/lib/events.js +3 -0
- package/dist/lib/events.js.map +1 -0
- package/dist/lib/gh-cli-client.d.ts +46 -0
- package/dist/lib/gh-cli-client.d.ts.map +1 -0
- package/dist/lib/gh-cli-client.js +260 -0
- package/dist/lib/gh-cli-client.js.map +1 -0
- package/dist/lib/git.d.ts +42 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +247 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/github-client.d.ts +98 -0
- package/dist/lib/github-client.d.ts.map +1 -0
- package/dist/lib/github-client.js +3 -0
- package/dist/lib/github-client.js.map +1 -0
- package/dist/lib/github.d.ts +82 -0
- package/dist/lib/github.d.ts.map +1 -0
- package/dist/lib/github.js +202 -0
- package/dist/lib/github.js.map +1 -0
- package/dist/lib/issue-file.d.ts +15 -0
- package/dist/lib/issue-file.d.ts.map +1 -0
- package/dist/lib/issue-file.js +84 -0
- package/dist/lib/issue-file.js.map +1 -0
- package/dist/lib/labels.d.ts +14 -0
- package/dist/lib/labels.d.ts.map +1 -0
- package/dist/lib/labels.js +70 -0
- package/dist/lib/labels.js.map +1 -0
- package/dist/lib/log.d.ts +11 -0
- package/dist/lib/log.d.ts.map +1 -0
- package/dist/lib/log.js +53 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/octokit-client.d.ts +112 -0
- package/dist/lib/octokit-client.d.ts.map +1 -0
- package/dist/lib/octokit-client.js +507 -0
- package/dist/lib/octokit-client.js.map +1 -0
- package/dist/lib/preview-verify.d.ts +48 -0
- package/dist/lib/preview-verify.d.ts.map +1 -0
- package/dist/lib/preview-verify.js +148 -0
- package/dist/lib/preview-verify.js.map +1 -0
- package/dist/lib/preview.d.ts +33 -0
- package/dist/lib/preview.d.ts.map +1 -0
- package/dist/lib/preview.js +308 -0
- package/dist/lib/preview.js.map +1 -0
- package/dist/lib/reconcile.d.ts +14 -0
- package/dist/lib/reconcile.d.ts.map +1 -0
- package/dist/lib/reconcile.js +114 -0
- package/dist/lib/reconcile.js.map +1 -0
- package/dist/lib/review.d.ts +38 -0
- package/dist/lib/review.d.ts.map +1 -0
- package/dist/lib/review.js +284 -0
- package/dist/lib/review.js.map +1 -0
- package/dist/lib/stale-prs.d.ts +31 -0
- package/dist/lib/stale-prs.d.ts.map +1 -0
- package/dist/lib/stale-prs.js +161 -0
- package/dist/lib/stale-prs.js.map +1 -0
- package/dist/lib/state-store.d.ts +23 -0
- package/dist/lib/state-store.d.ts.map +1 -0
- package/dist/lib/state-store.js +3 -0
- package/dist/lib/state-store.js.map +1 -0
- package/dist/lib/state.d.ts +23 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +57 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/status-comment.d.ts +14 -0
- package/dist/lib/status-comment.d.ts.map +1 -0
- package/dist/lib/status-comment.js +195 -0
- package/dist/lib/status-comment.js.map +1 -0
- package/dist/lib/stores/file-store.d.ts +22 -0
- package/dist/lib/stores/file-store.d.ts.map +1 -0
- package/dist/lib/stores/file-store.js +172 -0
- package/dist/lib/stores/file-store.js.map +1 -0
- package/dist/lib/stores/index.d.ts +13 -0
- package/dist/lib/stores/index.d.ts.map +1 -0
- package/dist/lib/stores/index.js +20 -0
- package/dist/lib/stores/index.js.map +1 -0
- package/dist/lib/task-recovery.d.ts +22 -0
- package/dist/lib/task-recovery.d.ts.map +1 -0
- package/dist/lib/task-recovery.js +172 -0
- package/dist/lib/task-recovery.js.map +1 -0
- package/dist/lib/templates.d.ts +8 -0
- package/dist/lib/templates.d.ts.map +1 -0
- package/dist/lib/templates.js +58 -0
- package/dist/lib/templates.js.map +1 -0
- package/dist/lib/thread.d.ts +13 -0
- package/dist/lib/thread.d.ts.map +1 -0
- package/dist/lib/thread.js +75 -0
- package/dist/lib/thread.js.map +1 -0
- package/dist/lib/verify.d.ts +31 -0
- package/dist/lib/verify.d.ts.map +1 -0
- package/dist/lib/verify.js +90 -0
- package/dist/lib/verify.js.map +1 -0
- package/dist/lib/version.d.ts +9 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +134 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/lib/webhook.d.ts +39 -0
- package/dist/lib/webhook.d.ts.map +1 -0
- package/dist/lib/webhook.js +248 -0
- package/dist/lib/webhook.js.map +1 -0
- package/dist/lib/worker.d.ts +42 -0
- package/dist/lib/worker.d.ts.map +1 -0
- package/dist/lib/worker.js +9 -0
- package/dist/lib/worker.js.map +1 -0
- package/dist/lib/workers/index.d.ts +11 -0
- package/dist/lib/workers/index.d.ts.map +1 -0
- package/dist/lib/workers/index.js +18 -0
- package/dist/lib/workers/index.js.map +1 -0
- package/dist/lib/workers/subprocess.d.ts +8 -0
- package/dist/lib/workers/subprocess.d.ts.map +1 -0
- package/dist/lib/workers/subprocess.js +105 -0
- package/dist/lib/workers/subprocess.js.map +1 -0
- package/dist/lib/worktree.d.ts +21 -0
- package/dist/lib/worktree.d.ts.map +1 -0
- package/dist/lib/worktree.js +113 -0
- package/dist/lib/worktree.js.map +1 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -4
- package/templates/foundry.yml +121 -0
- package/templates/vercel-preview-url.sh +61 -0
- package/README.md +0 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command agent backend — runs an arbitrary configured command.
|
|
3
|
+
*
|
|
4
|
+
* Template variables: {worktree}, {issue_url}, {issue_number}, {repo}, {title},
|
|
5
|
+
* {body}, {log_dir}, {state_dir}, {permission_mode}.
|
|
6
|
+
*
|
|
7
|
+
* {title} and {body} are written by whoever opened the issue and end up in a
|
|
8
|
+
* shell command line, so they are escaped for use INSIDE DOUBLE QUOTES. Put
|
|
9
|
+
* them nowhere else. Better, do not interpolate them at all: every launch also
|
|
10
|
+
* gets FOUNDRY_ISSUE_TITLE, FOUNDRY_ISSUE_BODY, FOUNDRY_ISSUE_NUMBER and
|
|
11
|
+
* FOUNDRY_ISSUE_URL in its environment, and "$FOUNDRY_ISSUE_TITLE" is never
|
|
12
|
+
* re-evaluated by the shell.
|
|
13
|
+
*/
|
|
14
|
+
import type { AgentBackend, AgentBackendDef } from '../types.js';
|
|
15
|
+
/** Escape untrusted text for a bash double-quoted string: \\ " $ and ` lose their meaning. */
|
|
16
|
+
export declare function escapeForDoubleQuotes(value: string): string;
|
|
17
|
+
export declare function createCommandBackend(name: string, def: AgentBackendDef & {
|
|
18
|
+
command: string;
|
|
19
|
+
}): AgentBackend;
|
|
20
|
+
/**
|
|
21
|
+
* Claude Code preset — a pre-configured command backend.
|
|
22
|
+
*
|
|
23
|
+
* `--json-schema "$FOUNDRY_REPORT_SCHEMA"` makes Claude Code end the run with a
|
|
24
|
+
* schema-validated report (see lib/agent-report.ts). AskUserQuestion is
|
|
25
|
+
* disallowed because nobody is there to answer it; questions go in the report.
|
|
26
|
+
* `< /dev/null` stops the CLI waiting three seconds for stdin.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The developer brief, appended to the agent's system prompt by the preset.
|
|
30
|
+
* This is the standing instruction a stakeholder would give a developer; the
|
|
31
|
+
* per-issue brief is the issue itself.
|
|
32
|
+
*/
|
|
33
|
+
export declare const AGENT_BRIEF: string;
|
|
34
|
+
export declare const CLAUDE_CODE_PRESET: AgentBackendDef & {
|
|
35
|
+
command: string;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/backends/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAqB,MAAM,aAAa,CAAC;AAEpF,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAmBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAyB3G;AAED;;;;;;;GAOG;AACH;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAQb,CAAC;AAEZ,eAAO,MAAM,kBAAkB,EAAE,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAInE,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLAUDE_CODE_PRESET = exports.AGENT_BRIEF = void 0;
|
|
4
|
+
exports.escapeForDoubleQuotes = escapeForDoubleQuotes;
|
|
5
|
+
exports.createCommandBackend = createCommandBackend;
|
|
6
|
+
/** Escape untrusted text for a bash double-quoted string: \\ " $ and ` lose their meaning. */
|
|
7
|
+
function escapeForDoubleQuotes(value) {
|
|
8
|
+
return value.replace(/[\\"$`]/g, c => '\\' + c);
|
|
9
|
+
}
|
|
10
|
+
function interpolate(template, params, escapeUntrusted) {
|
|
11
|
+
const untrusted = (v) => (escapeUntrusted ? escapeForDoubleQuotes(v) : v);
|
|
12
|
+
const vars = {
|
|
13
|
+
worktree: params.worktree,
|
|
14
|
+
issue_url: params.issue_url,
|
|
15
|
+
issue_number: String(params.issue_number),
|
|
16
|
+
repo: params.repo,
|
|
17
|
+
title: untrusted(params.title),
|
|
18
|
+
body: untrusted((params.body ?? '').slice(0, 4000)),
|
|
19
|
+
log_dir: params.log_dir,
|
|
20
|
+
state_dir: params.state_dir,
|
|
21
|
+
permission_mode: params.permission_mode ?? '--dangerously-skip-permissions',
|
|
22
|
+
};
|
|
23
|
+
// Function replacer: a `$&` or `$1` inside a value must not be read as a replacement pattern.
|
|
24
|
+
return template.replace(/\{([a-z_]+)\}/g, (match, name) => (name in vars ? vars[name] : match));
|
|
25
|
+
}
|
|
26
|
+
function createCommandBackend(name, def) {
|
|
27
|
+
return {
|
|
28
|
+
name,
|
|
29
|
+
resolveCommand(params) {
|
|
30
|
+
return interpolate(def.command, params, true);
|
|
31
|
+
},
|
|
32
|
+
resolveEnv(params) {
|
|
33
|
+
// Environment values are handed to the process directly, never parsed by a shell.
|
|
34
|
+
const env = {
|
|
35
|
+
FOUNDRY_AGENT_BRIEF: exports.AGENT_BRIEF,
|
|
36
|
+
FOUNDRY_RESUME_CONTEXT: '',
|
|
37
|
+
FOUNDRY_MAX_TURNS: '150',
|
|
38
|
+
FOUNDRY_ISSUE_NUMBER: String(params.issue_number),
|
|
39
|
+
FOUNDRY_ISSUE_URL: params.issue_url,
|
|
40
|
+
FOUNDRY_ISSUE_TITLE: params.title,
|
|
41
|
+
FOUNDRY_ISSUE_BODY: params.body ?? '',
|
|
42
|
+
};
|
|
43
|
+
if (def.env) {
|
|
44
|
+
for (const [k, v] of Object.entries(def.env)) {
|
|
45
|
+
env[k] = interpolate(v, params, false);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return env;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Claude Code preset — a pre-configured command backend.
|
|
54
|
+
*
|
|
55
|
+
* `--json-schema "$FOUNDRY_REPORT_SCHEMA"` makes Claude Code end the run with a
|
|
56
|
+
* schema-validated report (see lib/agent-report.ts). AskUserQuestion is
|
|
57
|
+
* disallowed because nobody is there to answer it; questions go in the report.
|
|
58
|
+
* `< /dev/null` stops the CLI waiting three seconds for stdin.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* The developer brief, appended to the agent's system prompt by the preset.
|
|
62
|
+
* This is the standing instruction a stakeholder would give a developer; the
|
|
63
|
+
* per-issue brief is the issue itself.
|
|
64
|
+
*/
|
|
65
|
+
exports.AGENT_BRIEF = [
|
|
66
|
+
'You are the developer assigned to this GitHub issue. The person who wrote it is a stakeholder, not a programmer, and will review your work as a pull request.',
|
|
67
|
+
'Read the issue file before changing anything: it holds the issue and every comment the humans have made, in order. Later comments refine or override earlier ones.',
|
|
68
|
+
'Make reasonable implementation decisions yourself and list each one under `assumptions` in your report. Ask a question only when the answer materially changes the work, and offer concrete options.',
|
|
69
|
+
'Change only what the issue needs. Follow the conventions already in the repository.',
|
|
70
|
+
'Commit as you go with clear messages. Never push, open pull requests, or change labels; Foundry does that.',
|
|
71
|
+
'If `.joynt-foundry.yml` lists verify commands, run them before reporting done and fix what they find.',
|
|
72
|
+
'End by reporting your outcome truthfully with the required schema: done, needs_input, plan_ready, or blocked.',
|
|
73
|
+
].join(' ');
|
|
74
|
+
exports.CLAUDE_CODE_PRESET = {
|
|
75
|
+
type: 'command',
|
|
76
|
+
command: 'claude {permission_mode} -p "You are working on issue #{issue_number}: $FOUNDRY_ISSUE_TITLE. Read the issue first: its title, body, and every human comment so far are in the file $FOUNDRY_ISSUE_FILE (the live issue is at {issue_url} when you have network access). $FOUNDRY_RESUME_CONTEXT" --append-system-prompt "$FOUNDRY_AGENT_BRIEF" --max-turns "$FOUNDRY_MAX_TURNS" --json-schema "$FOUNDRY_REPORT_SCHEMA" --disallowedTools AskUserQuestion --verbose --output-format stream-json < /dev/null 2>&1 | tee {log_dir}/agent.log',
|
|
77
|
+
env: {},
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/backends/command.ts"],"names":[],"mappings":";;;AAgBA,sDAEC;AAmBD,oDAyBC;AA/CD,8FAA8F;AAC9F,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,QAAgB,EAAE,MAAyB,EAAE,eAAwB;IACxF,MAAM,S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AC,MAAM,CAAC,YAAY,CAAC;gBACjD,iBAAiB,EAAE,MAAM,CAAC,SAAS;gBACnC,mBAAmB,EAAE,MAAM,CAAC,KAAK;gBACjC,kBAAkB,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;aACtC,CAAC;YACF,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;gBACZ,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC7C,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH;;;;GAIG;AACU,QAAA,WAAW,GAAG;IACzB,+JAA+J;IAC/J,oKAAoK;IACpK,sMAAsM;IACtM,qFAAqF;IACrF,4GAA4G;IAC5G,uGAAuG;IACvG,+GAA+G;CAChH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEC,QAAA,kBAAkB,GAA0C;IACvE,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,2gBAA2gB;IACphB,GAAG,EAAE,EAAE;CACR,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent backend registry
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentBackend, FoundryConfig } from '../types.js';
|
|
5
|
+
import { CLAUDE_CODE_PRESET } from './command.js';
|
|
6
|
+
export declare function resolveBackend(config: FoundryConfig, backendName?: string): AgentBackend;
|
|
7
|
+
export declare function resolveBackendForIssue(config: FoundryConfig, issueLabels: string[]): AgentBackend;
|
|
8
|
+
export { CLAUDE_CODE_PRESET };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backends/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAExE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAsBxF;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,EAAE,GACpB,YAAY,CAUd;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLAUDE_CODE_PRESET = void 0;
|
|
4
|
+
exports.resolveBackend = resolveBackend;
|
|
5
|
+
exports.resolveBackendForIssue = resolveBackendForIssue;
|
|
6
|
+
const command_js_1 = require("./command.js");
|
|
7
|
+
Object.defineProperty(exports, "CLAUDE_CODE_PRESET", { enumerable: true, get: function () { return command_js_1.CLAUDE_CODE_PRESET; } });
|
|
8
|
+
function resolveBackend(config, backendName) {
|
|
9
|
+
const name = backendName ?? config.default_agent_backend;
|
|
10
|
+
const def = config.agent_backends[name];
|
|
11
|
+
if (!def) {
|
|
12
|
+
throw new Error(`Agent backend "${name}" not found in config. Available: ${Object.keys(config.agent_backends).join(', ')}`);
|
|
13
|
+
}
|
|
14
|
+
if (def.type === 'command') {
|
|
15
|
+
if (def.preset && def.preset !== 'claude-code') {
|
|
16
|
+
throw new Error(`Agent backend "${name}": unknown preset "${def.preset}". Available: claude-code`);
|
|
17
|
+
}
|
|
18
|
+
const command = def.command ?? (def.preset === 'claude-code' ? command_js_1.CLAUDE_CODE_PRESET.command : undefined);
|
|
19
|
+
if (!command) {
|
|
20
|
+
throw new Error(`Agent backend "${name}" needs a \`command\` or \`preset: claude-code\`.`);
|
|
21
|
+
}
|
|
22
|
+
return (0, command_js_1.createCommandBackend)(name, { ...def, command });
|
|
23
|
+
}
|
|
24
|
+
throw new Error(`Unknown backend type: ${def.type}`);
|
|
25
|
+
}
|
|
26
|
+
function resolveBackendForIssue(config, issueLabels) {
|
|
27
|
+
if (config.agent_label_map) {
|
|
28
|
+
for (const label of issueLabels) {
|
|
29
|
+
const mapped = config.agent_label_map[label];
|
|
30
|
+
if (mapped) {
|
|
31
|
+
return resolveBackend(config, mapped);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return resolveBackend(config);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backends/index.ts"],"names":[],"mappings":";;;AAMA,wCAsBC;AAED,wDAaC;AAvCD,6CAAwE;AAyC/D,mGAzCsB,+BAAkB,OAyCtB;AAvC3B,SAAgB,cAAc,CAAC,MAAqB,EAAE,WAAoB;IACxE,MAAM,IAAI,GAAG,WAAW,IAAI,MAAM,CAAC,qBAAqB,CAAC;IACzD,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAExC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,qCAAqC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3G,CAAC;IACJ,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,sBAAsB,GAAG,CAAC,MAAM,2BAA2B,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,+BAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACvG,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,mDAAmD,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,IAAA,iCAAoB,EAAC,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,sBAAsB,CACpC,MAAqB,EACrB,WAAqB;IAErB,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;QAC3B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC7C,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
/**
|
|
38
|
+
* Joynt Foundry CLI
|
|
39
|
+
*
|
|
40
|
+
* GitHub Issues → coding agent → verified pull requests.
|
|
41
|
+
*
|
|
42
|
+
* Foundry runs as a GitHub Action (`foundry action`, packaged by action.yml at
|
|
43
|
+
* the repo root). The other commands set a repo up, operate on tasks from any
|
|
44
|
+
* checkout, or manage the integration branch.
|
|
45
|
+
*/
|
|
46
|
+
const fs = __importStar(require("node:fs"));
|
|
47
|
+
const path = __importStar(require("node:path"));
|
|
48
|
+
const commander_1 = require("commander");
|
|
49
|
+
const log_js_1 = require("./lib/log.js");
|
|
50
|
+
const config_js_1 = require("./config.js");
|
|
51
|
+
const github_js_1 = require("./lib/github.js");
|
|
52
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8'));
|
|
53
|
+
const program = new commander_1.Command();
|
|
54
|
+
function collect(value, previous) {
|
|
55
|
+
return [...previous, value];
|
|
56
|
+
}
|
|
57
|
+
program
|
|
58
|
+
.name('foundry')
|
|
59
|
+
.description('Joynt Foundry — GitHub Issues → coding agent → verified pull requests')
|
|
60
|
+
.version(pkg.version)
|
|
61
|
+
.option('-v, --verbose', 'Enable verbose/debug output')
|
|
62
|
+
.option('--github-backend <backend>', 'GitHub API client: gh-cli or octokit (env: FOUNDRY_GITHUB_BACKEND)')
|
|
63
|
+
.hook('preAction', async (thisCommand, actionCommand) => {
|
|
64
|
+
const opts = thisCommand.opts();
|
|
65
|
+
// `report` is run by the agent itself and must not need GitHub credentials.
|
|
66
|
+
if (actionCommand.name() === 'report')
|
|
67
|
+
return;
|
|
68
|
+
if (opts.verbose)
|
|
69
|
+
(0, log_js_1.setVerbose)(true);
|
|
70
|
+
if (opts.githubBackend)
|
|
71
|
+
process.env.FOUNDRY_GITHUB_BACKEND = opts.githubBackend;
|
|
72
|
+
const config = (0, config_js_1.loadConfigSafe)() ?? undefined;
|
|
73
|
+
await (0, github_js_1.initClient)(config);
|
|
74
|
+
});
|
|
75
|
+
// ── Setup ─────────────────────────────────────────────────────────────
|
|
76
|
+
program
|
|
77
|
+
.command('init')
|
|
78
|
+
.description('Scaffold .joynt-foundry.yml, create the labels, create the integration branch')
|
|
79
|
+
.option('--skip-labels', 'Skip creating GitHub labels')
|
|
80
|
+
.option('--clean-labels', 'Remove non-Foundry labels before creating Foundry labels')
|
|
81
|
+
.action(async (opts) => {
|
|
82
|
+
const { runInit } = await import('./commands/init.js');
|
|
83
|
+
await runInit(opts);
|
|
84
|
+
});
|
|
85
|
+
program
|
|
86
|
+
.command('setup-bot')
|
|
87
|
+
.description('Create a GitHub App so Foundry acts under its own name (optional under the Action)')
|
|
88
|
+
.option('--server-url <url>', 'Webhook URL for the GitHub App (unused by the Action)')
|
|
89
|
+
.action(async (opts) => {
|
|
90
|
+
const { runSetupBot } = await import('./commands/setup-bot.js');
|
|
91
|
+
await runSetupBot(opts);
|
|
92
|
+
});
|
|
93
|
+
// ── The Action entry point ────────────────────────────────────────────
|
|
94
|
+
program
|
|
95
|
+
.command('action')
|
|
96
|
+
.description('Run the state machine for one GitHub event (GitHub Actions entry point)')
|
|
97
|
+
.option('--event-name <name>', 'GitHub event name (default: $GITHUB_EVENT_NAME)')
|
|
98
|
+
.option('--event-path <path>', 'Path to the event JSON payload (default: $GITHUB_EVENT_PATH)')
|
|
99
|
+
.action(async (opts) => {
|
|
100
|
+
const { runAction } = await import('./commands/action.js');
|
|
101
|
+
await runAction(opts);
|
|
102
|
+
});
|
|
103
|
+
program
|
|
104
|
+
.command('report')
|
|
105
|
+
.description('Submit the agent\'s outcome report (run by the agent, for backends without structured output)')
|
|
106
|
+
.requiredOption('--status <status>', 'done | needs_input | plan_ready | blocked')
|
|
107
|
+
.requiredOption('--summary <text>', 'What was done, or why the agent stopped')
|
|
108
|
+
.option('--assumption <text>', 'A decision made without asking (repeatable)', collect, [])
|
|
109
|
+
.option('--question <text>', 'A question for the human; options after " | " separated by ";" (repeatable)', collect, [])
|
|
110
|
+
.option('--plan <text>', 'The plan, for plan_ready')
|
|
111
|
+
.option('--plan-file <path>', 'Read the plan from a file')
|
|
112
|
+
.option('--file <path>', 'Where to write the report (default: $FOUNDRY_REPORT_FILE)')
|
|
113
|
+
.action(async (opts) => {
|
|
114
|
+
const { runReport } = await import('./commands/report.js');
|
|
115
|
+
await runReport(opts);
|
|
116
|
+
});
|
|
117
|
+
program
|
|
118
|
+
.command('cancelled')
|
|
119
|
+
.description('After a cancelled job: mark the task failed so the issue is not left in-progress (run from an `if: cancelled()` step)')
|
|
120
|
+
.option('--event-name <name>', 'GitHub event name (default: $GITHUB_EVENT_NAME)')
|
|
121
|
+
.option('--event-path <path>', 'Path to the event JSON payload (default: $GITHUB_EVENT_PATH)')
|
|
122
|
+
.action(async (opts) => {
|
|
123
|
+
const { runCancelled } = await import('./commands/cancelled.js');
|
|
124
|
+
await runCancelled(opts);
|
|
125
|
+
});
|
|
126
|
+
program
|
|
127
|
+
.command('reconcile')
|
|
128
|
+
.description('Mark in-progress issues with no live run as failed (also runs on the schedule trigger)')
|
|
129
|
+
.action(async () => {
|
|
130
|
+
const { loadConfig, getConfigDir } = await import('./config.js');
|
|
131
|
+
const { reconcile } = await import('./lib/reconcile.js');
|
|
132
|
+
const changed = await reconcile(loadConfig(), getConfigDir());
|
|
133
|
+
console.log(`${changed.length} issue(s) marked failed.`);
|
|
134
|
+
});
|
|
135
|
+
// ── Operate on a task from any checkout ───────────────────────────────
|
|
136
|
+
program
|
|
137
|
+
.command('reset <issue>')
|
|
138
|
+
.description('Remove the branch, PR, and preview for a task; `@foundry go` starts it again')
|
|
139
|
+
.option('--force', 'Actually execute (default is dry-run)')
|
|
140
|
+
.action(async (issue, opts) => {
|
|
141
|
+
const { runReset } = await import('./commands/reset.js');
|
|
142
|
+
await runReset(issue, opts);
|
|
143
|
+
});
|
|
144
|
+
const previewCmd = program
|
|
145
|
+
.command('preview')
|
|
146
|
+
.description('Manage a task\'s preview environment by hand');
|
|
147
|
+
previewCmd
|
|
148
|
+
.command('up <issue>')
|
|
149
|
+
.description('Trigger the preview deployment for a task')
|
|
150
|
+
.action(async (issue) => {
|
|
151
|
+
const { runPreviewUp } = await import('./commands/preview.js');
|
|
152
|
+
await runPreviewUp(issue);
|
|
153
|
+
});
|
|
154
|
+
previewCmd
|
|
155
|
+
.command('down <issue>')
|
|
156
|
+
.description('Tear down the preview environment for a task')
|
|
157
|
+
.action(async (issue) => {
|
|
158
|
+
const { runPreviewDown } = await import('./commands/preview.js');
|
|
159
|
+
await runPreviewDown(issue);
|
|
160
|
+
});
|
|
161
|
+
previewCmd
|
|
162
|
+
.command('status <issue>')
|
|
163
|
+
.description('Show preview URL, deployment id, and state for a task')
|
|
164
|
+
.action(async (issue) => {
|
|
165
|
+
const { runPreviewStatus } = await import('./commands/preview.js');
|
|
166
|
+
await runPreviewStatus(issue);
|
|
167
|
+
});
|
|
168
|
+
// ── Integration branch ────────────────────────────────────────────────
|
|
169
|
+
program
|
|
170
|
+
.command('review <target>')
|
|
171
|
+
.description('Rebase a PR onto integration, merge it, run the integration rebuild (PR number or URL)')
|
|
172
|
+
.action(async (target) => {
|
|
173
|
+
const { runReview } = await import('./commands/review.js');
|
|
174
|
+
await runReview(target);
|
|
175
|
+
});
|
|
176
|
+
program
|
|
177
|
+
.command('release <type>')
|
|
178
|
+
.description('Bump the unified version across version_sources (patch|minor|major)')
|
|
179
|
+
.action(async (type) => {
|
|
180
|
+
const { runRelease } = await import('./commands/release.js');
|
|
181
|
+
await runRelease(type);
|
|
182
|
+
});
|
|
183
|
+
program
|
|
184
|
+
.command('sync-integration')
|
|
185
|
+
.description('Merge main into integration after a hotfix release')
|
|
186
|
+
.action(async () => {
|
|
187
|
+
const { runSyncIntegration } = await import('./commands/sync.js');
|
|
188
|
+
await runSyncIntegration();
|
|
189
|
+
});
|
|
190
|
+
program.parse();
|
|
191
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;GAQG;AACH,4CAA8B;AAC9B,gDAAkC;AAClC,yCAAoC;AACpC,yCAA0C;AAC1C,2CAA6C;AAC7C,+CAA6C;AAE7C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,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AAS,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAC7D,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,kBAAkB,CAAC;KAC3B,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAClE,MAAM,kBAAkB,EAAE,CAAC;AAC7B,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/commands/action.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDlE"}
|
|
@@ -0,0 +1,171 @@
|
|
|
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.runAction = runAction;
|
|
37
|
+
/**
|
|
38
|
+
* foundry action — run the Foundry state machine for one GitHub event.
|
|
39
|
+
*
|
|
40
|
+
* Designed to be the entry point of the composite GitHub Action. A job is
|
|
41
|
+
* started by a GitHub event (comment created, PR closed, review submitted),
|
|
42
|
+
* this command maps the event to FoundryEvents, dispatches them through the
|
|
43
|
+
* EventHandler, and, when a handler launched an agent, waits for it and feeds
|
|
44
|
+
* the outcome back in. The job ends when the state machine has nothing left
|
|
45
|
+
* to do for this event.
|
|
46
|
+
*
|
|
47
|
+
* - No polling. One event in, one job.
|
|
48
|
+
* - The agent runs as a subprocess of this process (SubprocessWorker), so
|
|
49
|
+
* the job log is the agent transcript.
|
|
50
|
+
* - Local state starts empty every time. Tasks referenced by the event are
|
|
51
|
+
* rebuilt from GitHub (task-recovery.ts) before mapping.
|
|
52
|
+
* - Every transition finishes in this job or is handed on by dispatch;
|
|
53
|
+
* nothing waits for "the next run" (events caused by the job's token do
|
|
54
|
+
* not start one).
|
|
55
|
+
*/
|
|
56
|
+
const fs = __importStar(require("node:fs"));
|
|
57
|
+
const config_js_1 = require("../config.js");
|
|
58
|
+
const event_handler_js_1 = require("../lib/event-handler.js");
|
|
59
|
+
const webhook_js_1 = require("../lib/webhook.js");
|
|
60
|
+
const task_recovery_js_1 = require("../lib/task-recovery.js");
|
|
61
|
+
const completion_js_1 = require("../lib/completion.js");
|
|
62
|
+
const index_js_1 = require("../lib/workers/index.js");
|
|
63
|
+
const authorize_js_1 = require("../lib/authorize.js");
|
|
64
|
+
const state = __importStar(require("../lib/state.js"));
|
|
65
|
+
const log = __importStar(require("../lib/log.js"));
|
|
66
|
+
/** Safety valve: the completion loop never runs more than this many rounds per job. */
|
|
67
|
+
const MAX_COMPLETION_ROUNDS = 10;
|
|
68
|
+
async function runAction(opts) {
|
|
69
|
+
const eventName = opts.eventName ?? process.env.GITHUB_EVENT_NAME;
|
|
70
|
+
const eventPath = opts.eventPath ?? process.env.GITHUB_EVENT_PATH;
|
|
71
|
+
if (!eventName || !eventPath) {
|
|
72
|
+
throw new Error('foundry action needs GITHUB_EVENT_NAME and GITHUB_EVENT_PATH (or --event-name/--event-path).');
|
|
73
|
+
}
|
|
74
|
+
const payload = JSON.parse(fs.readFileSync(eventPath, 'utf-8'));
|
|
75
|
+
const action = payload.action ? `${eventName}.${payload.action}` : eventName;
|
|
76
|
+
const config = (0, config_js_1.loadConfig)();
|
|
77
|
+
const repoDir = (0, config_js_1.getConfigDir)();
|
|
78
|
+
if (eventName === 'schedule') {
|
|
79
|
+
const { reconcile } = await import('../lib/reconcile.js');
|
|
80
|
+
const changed = await reconcile(config, repoDir);
|
|
81
|
+
log.info(`Reconcile: ${changed.length} issue(s) marked failed.`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const payloadRepo = payload.repository?.full_name;
|
|
85
|
+
if (payloadRepo && payloadRepo !== config.repo) {
|
|
86
|
+
log.warn(`Event is for ${payloadRepo} but .joynt-foundry.yml says ${config.repo}.`);
|
|
87
|
+
}
|
|
88
|
+
log.info(`Foundry action: ${action} on ${config.repo}`);
|
|
89
|
+
// Rebuild the referenced task from GitHub so webhookToEvents can find it.
|
|
90
|
+
const issueNumber = (0, task_recovery_js_1.issueNumberFromPayload)(payload, config);
|
|
91
|
+
if (issueNumber !== null && !state.getTask(config.repo, issueNumber)) {
|
|
92
|
+
const recovered = await (0, task_recovery_js_1.recoverTask)(config, repoDir, issueNumber);
|
|
93
|
+
if (recovered) {
|
|
94
|
+
state.upsertTask(config.repo, recovered);
|
|
95
|
+
log.info(`Recovered task #${issueNumber} (${recovered.status}) from GitHub.`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const events = (0, webhook_js_1.webhookToEvents)(eventName, payload, config);
|
|
99
|
+
if (events.length === 0) {
|
|
100
|
+
log.info(`No Foundry events for ${action}. Nothing to do.`);
|
|
101
|
+
writeOutputs(config, issueNumber);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const handler = new event_handler_js_1.EventHandler(config, repoDir);
|
|
105
|
+
for (const event of events) {
|
|
106
|
+
if (event.type === 'command' && event.via === 'comment' && !(await (0, authorize_js_1.canCommand)(config, event.commentAuthor))) {
|
|
107
|
+
log.warn(`Ignoring "${event.command}" on #${event.issue} from ${event.commentAuthor}: write access to ${config.repo} is required.`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
log.info(`Handling ${describe(event)}`);
|
|
111
|
+
await handler.handleEvent(event);
|
|
112
|
+
await driveToCompletion(config, repoDir, handler);
|
|
113
|
+
}
|
|
114
|
+
writeOutputs(config, issueNumber);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* If a handler launched an agent, wait for it, classify the outcome, and hand
|
|
118
|
+
* it back to the handler. The handler may launch again (e.g. a future
|
|
119
|
+
* verify-retry round), so loop until no agent is running.
|
|
120
|
+
*/
|
|
121
|
+
async function driveToCompletion(config, repoDir, handler) {
|
|
122
|
+
const worker = (0, index_js_1.resolveWorker)('subprocess');
|
|
123
|
+
for (let round = 0; round < MAX_COMPLETION_ROUNDS; round++) {
|
|
124
|
+
const running = state.getAllTasks(config.repo)
|
|
125
|
+
.filter(t => t.status === 'agent-running' || t.status === 'resuming');
|
|
126
|
+
if (running.length === 0)
|
|
127
|
+
return;
|
|
128
|
+
for (const task of running) {
|
|
129
|
+
const handle = worker.handleFor(task.tmux_session);
|
|
130
|
+
if (!handle.wait) {
|
|
131
|
+
log.warn(`Worker for #${task.issue} cannot be awaited; leaving it.`);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
log.info(`Waiting for agent on #${task.issue}...`);
|
|
135
|
+
const code = await handle.wait();
|
|
136
|
+
log.info(`Agent for #${task.issue} exited (${code ?? 'signal'}). Analyzing outcome...`);
|
|
137
|
+
const fresh = state.getTask(config.repo, task.issue) ?? task;
|
|
138
|
+
await handler.handleEvent((0, completion_js_1.buildAgentCompletedEvent)(config, repoDir, fresh, code));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
log.warn(`Stopped after ${MAX_COMPLETION_ROUNDS} completion rounds.`);
|
|
142
|
+
}
|
|
143
|
+
function describe(event) {
|
|
144
|
+
switch (event.type) {
|
|
145
|
+
case 'command':
|
|
146
|
+
return `command "${event.command}" on #${event.issue} (${event.task ? event.task.status : 'unclaimed'}) by ${event.commentAuthor}`;
|
|
147
|
+
case 'pr_preview':
|
|
148
|
+
return `pr_preview ${event.action} for PR #${event.pr_number} (${event.branch} → ${event.base})`;
|
|
149
|
+
case 'pr_approved':
|
|
150
|
+
return `pr_approved: PR #${event.pr_number} (${event.branch} → ${event.base}) by ${event.reviewer}`;
|
|
151
|
+
default:
|
|
152
|
+
return `${event.type} #${event.task.issue}`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** Expose the outcome to later workflow steps via $GITHUB_OUTPUT. */
|
|
156
|
+
function writeOutputs(config, issueNumber) {
|
|
157
|
+
const out = process.env.GITHUB_OUTPUT;
|
|
158
|
+
if (!out)
|
|
159
|
+
return;
|
|
160
|
+
const task = issueNumber !== null ? state.getTask(config.repo, issueNumber) : undefined;
|
|
161
|
+
const lines = [
|
|
162
|
+
`issue=${issueNumber ?? ''}`,
|
|
163
|
+
`status=${task?.status ?? ''}`,
|
|
164
|
+
`branch=${task?.branch ?? ''}`,
|
|
165
|
+
`pr-url=${task?.pr_url ?? ''}`,
|
|
166
|
+
`log-dir=${issueNumber !== null ? state.getLogDir(config.repo, issueNumber) : ''}`,
|
|
167
|
+
`log-path=${issueNumber !== null ? (0, completion_js_1.agentLogPath)(config, issueNumber) : ''}`,
|
|
168
|
+
];
|
|
169
|
+
fs.appendFileSync(out, lines.join('\n') + '\n');
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/commands/action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,8BAyDC;AAjGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,4CAA8B;AAC9B,4CAAwD;AACxD,8DAAuD;AACvD,kDAAoD;AACpD,8DAA8E;AAC9E,wDAA8E;AAC9E,sDAAwD;AACxD,sDAAiD;AACjD,uDAAyC;AACzC,mDAAqC;AASrC,uFAAuF;AACvF,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAE1B,KAAK,UAAU,SAAS,CAAC,IAAmB;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAClE,MAAM,SA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