@ipul-labs/forge 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +273 -0
- package/bin/README.md +210 -0
- package/bin/cli/analyze.js +516 -0
- package/bin/cli/apply.js +264 -0
- package/bin/cli/cifix.js +300 -0
- package/bin/cli/close.js +125 -0
- package/bin/cli/doctor.js +161 -0
- package/bin/cli/init.js +306 -0
- package/bin/cli/ink.js +57 -0
- package/bin/cli/issue.js +116 -0
- package/bin/cli/issues.js +155 -0
- package/bin/cli/merge.js +175 -0
- package/bin/cli/refine.js +253 -0
- package/bin/cli/repos.js +91 -0
- package/bin/cli/resolution.js +126 -0
- package/bin/cli/session.js +230 -0
- package/bin/cli/sessionStore.js +214 -0
- package/bin/cli/ship.js +762 -0
- package/bin/cli/utils.js +145 -0
- package/bin/cli/validate.js +280 -0
- package/bin/cli/watch.js +274 -0
- package/bin/forge-agent.js +174 -0
- package/dist/assets/index-CNTCMbW9.js +80 -0
- package/dist/assets/index-InpYS-zg.css +1 -0
- package/dist/favicon.svg +8 -0
- package/dist/index.html +19 -0
- package/dist-lib/favicon.svg +8 -0
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/style.css +1 -0
- package/dist-lib/ui.d.ts +2 -0
- package/dist-lib/ui.js +7390 -0
- package/dist-lib/views/Forge/ForgeDashboard.d.ts +5 -0
- package/dist-lib/views/Forge/activeJobs.d.ts +29 -0
- package/dist-lib/views/Forge/analysisCache.d.ts +64 -0
- package/dist-lib/views/Forge/api.d.ts +4 -0
- package/dist-lib/views/Forge/components/AnalysisProgress.d.ts +13 -0
- package/dist-lib/views/Forge/components/CITerminal.d.ts +44 -0
- package/dist-lib/views/Forge/components/DiffViewer.d.ts +37 -0
- package/dist-lib/views/Forge/components/ForgeConnect.d.ts +6 -0
- package/dist-lib/views/Forge/components/IssueList.d.ts +28 -0
- package/dist-lib/views/Forge/components/MRStatus.d.ts +9 -0
- package/dist-lib/views/Forge/components/NewTaskModal.d.ts +1 -0
- package/dist-lib/views/Forge/components/OpenMRList.d.ts +11 -0
- package/dist-lib/views/Forge/components/PipelineStatus.d.ts +12 -0
- package/dist-lib/views/Forge/components/PipelinesList.d.ts +9 -0
- package/dist-lib/views/Forge/components/RolloutStatus.d.ts +5 -0
- package/dist-lib/views/Forge/components/UsageWidget.d.ts +8 -0
- package/dist-lib/views/Forge/components/ValidationPanel.d.ts +22 -0
- package/dist-lib/views/Forge/context/ForgeProvider.d.ts +23 -0
- package/dist-lib/views/Forge/hooks/useConfig.d.ts +54 -0
- package/dist-lib/views/Forge/hooks/useForgeDashboard.d.ts +107 -0
- package/dist-lib/views/Forge/hooks/useForgeQuota.d.ts +22 -0
- package/dist-lib/views/Forge/phases/AnalyzingView.d.ts +1 -0
- package/dist-lib/views/Forge/phases/IdleView.d.ts +1 -0
- package/dist-lib/views/Forge/phases/MonitoringIssueTab.d.ts +1 -0
- package/dist-lib/views/Forge/phases/MonitoringPipelineTab.d.ts +1 -0
- package/dist-lib/views/Forge/phases/MonitoringView.d.ts +1 -0
- package/dist-lib/views/Forge/phases/ReviewingView.d.ts +1 -0
- package/dist-lib/views/Forge/phases/SelectedIssueTab.d.ts +11 -0
- package/dist-lib/views/Forge/phases/SelectedMRTab.d.ts +1 -0
- package/dist-lib/views/Forge/phases/SelectedView.d.ts +1 -0
- package/dist-lib/views/Forge/phases/shared/CloseIssueConfirm.d.ts +1 -0
- package/dist-lib/views/Forge/phases/shared/DetailTabs.d.ts +14 -0
- package/dist-lib/views/Forge/phases/shared/EnvironmentsPanel.d.ts +9 -0
- package/dist-lib/views/Forge/phases/shared/ForgeActivity.d.ts +1 -0
- package/dist-lib/views/Forge/phases/shared/IssueHeaderBlock.d.ts +13 -0
- package/dist-lib/views/Forge/phases/shared/MergedMRList.d.ts +4 -0
- package/dist-lib/views/Forge/phases/shared/PreviousAnalyses.d.ts +1 -0
- package/dist-lib/views/Forge/phases/shared/ResolutionCheckPanel.d.ts +6 -0
- package/dist-lib/views/Forge/settings/ConnectionRow.d.ts +16 -0
- package/dist-lib/views/Forge/settings/ConnectionsSection.d.ts +7 -0
- package/dist-lib/views/Forge/settings/DefaultsSection.d.ts +7 -0
- package/dist-lib/views/Forge/settings/ReposSection.d.ts +7 -0
- package/dist-lib/views/Forge/settings/SettingsView.d.ts +1 -0
- package/dist-lib/views/Forge/shell/ConfigBar.d.ts +1 -0
- package/dist-lib/views/Forge/shell/ForgeRouter.d.ts +9 -0
- package/dist-lib/views/Forge/shell/ForgeShell.d.ts +7 -0
- package/dist-lib/views/Forge/shell/Sidebar.d.ts +1 -0
- package/dist-lib/views/Forge/shell/SidebarFooterMenu.d.ts +1 -0
- package/dist-lib/views/Forge/shell/SidebarNav.d.ts +1 -0
- package/dist-lib/views/Forge/shell/SidebarNavItem.d.ts +10 -0
- package/dist-lib/views/Forge/shell/TopBar.d.ts +5 -0
- package/dist-lib/views/Forge/types.d.ts +235 -0
- package/dist-lib/views/Forge/utils.d.ts +11 -0
- package/package.json +88 -0
- package/server/forge/core/ForgeAgent.js +1144 -0
- package/server/forge/core/agentClient.js +36 -0
- package/server/forge/core/branchName.js +41 -0
- package/server/forge/core/claudeClient.js +356 -0
- package/server/forge/core/configStore.js +214 -0
- package/server/forge/core/gitlabClient.js +340 -0
- package/server/forge/core/jobs.js +180 -0
- package/server/forge/core/k8s.js +54 -0
- package/server/forge/core/localRepo.js +136 -0
- package/server/forge/core/openclawClient.js +125 -0
- package/server/forge/core/prompts.js +369 -0
- package/server/forge/core/providers/azuredevops.js +408 -0
- package/server/forge/core/providers/base.js +208 -0
- package/server/forge/core/providers/github.js +349 -0
- package/server/forge/core/providers/gitlab.js +529 -0
- package/server/forge/core/providers/index.js +47 -0
- package/server/forge/core/quotaClient.js +101 -0
- package/server/forge/core/validator/attribute.js +84 -0
- package/server/forge/core/validator/clone.js +91 -0
- package/server/forge/core/validator/cmd.js +98 -0
- package/server/forge/core/validator/fs.js +9 -0
- package/server/forge/core/validator/overlay.js +52 -0
- package/server/forge/core/validator/projectType.js +87 -0
- package/server/forge/core/validator/runners/go.js +107 -0
- package/server/forge/core/validator/runners/node.js +84 -0
- package/server/forge/core/validator/tdd.js +105 -0
- package/server/forge/core/validator.js +166 -0
- package/server/forge/routes.js +1012 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { projectRoot, parsePort, readPkg } from "./cli/utils.js";
|
|
5
|
+
import { cmdDoctor } from "./cli/doctor.js";
|
|
6
|
+
import { cmdIssues } from "./cli/issues.js";
|
|
7
|
+
import { cmdAnalyze } from "./cli/analyze.js";
|
|
8
|
+
import { cmdInit } from "./cli/init.js";
|
|
9
|
+
import { cmdRepos } from "./cli/repos.js";
|
|
10
|
+
import { cmdSession, cmdShow } from "./cli/session.js";
|
|
11
|
+
import { cmdValidate } from "./cli/validate.js";
|
|
12
|
+
import { cmdApply } from "./cli/apply.js";
|
|
13
|
+
import { cmdRefine } from "./cli/refine.js";
|
|
14
|
+
import { cmdWatch } from "./cli/watch.js";
|
|
15
|
+
import { cmdCiFix } from "./cli/cifix.js";
|
|
16
|
+
import { cmdMerge } from "./cli/merge.js";
|
|
17
|
+
import { cmdResolutionCheck } from "./cli/resolution.js";
|
|
18
|
+
import { cmdClose } from "./cli/close.js";
|
|
19
|
+
import { cmdShip } from "./cli/ship.js";
|
|
20
|
+
import { cmdIssue } from "./cli/issue.js";
|
|
21
|
+
|
|
22
|
+
function usage() {
|
|
23
|
+
process.stdout.write(`
|
|
24
|
+
forge-agent — AI-powered code change & deploy control panel
|
|
25
|
+
|
|
26
|
+
Usage
|
|
27
|
+
forge-agent <command> [options]
|
|
28
|
+
|
|
29
|
+
Commands
|
|
30
|
+
ship <iid> ★ End-to-end: analyze → review → validate → apply →
|
|
31
|
+
watch CI → merge → watch deploy → close (gates at every
|
|
32
|
+
state-changing step). Resumable via session.
|
|
33
|
+
init Interactive setup — writes .env + ~/.forge/config.json
|
|
34
|
+
start Boot the Forge server at http://localhost:$PORT
|
|
35
|
+
repos Manage configured repos (list | add | set-default | remove)
|
|
36
|
+
issues List open issues (--label X, --mine, --limit N)
|
|
37
|
+
issue <iid> Show full description, labels, author, web URL
|
|
38
|
+
analyze <iid> Run issue analysis; caches result to ~/.forge/sessions
|
|
39
|
+
show [<iid>] Re-render the cached analysis for <iid> (or HEAD)
|
|
40
|
+
refine [<iid>] Iterate the cached analysis with feedback (--feedback "...")
|
|
41
|
+
validate [<iid>] Run lint/typecheck/test against the cached proposal
|
|
42
|
+
apply [<iid>] Push branch + open MR per repo (confirms by default)
|
|
43
|
+
watch [<iid>] Poll the MR pipeline until it succeeds or fails
|
|
44
|
+
ci-fix [<iid>] Re-analyse with failed-pipeline logs; push to existing branch
|
|
45
|
+
merge [<iid>] Merge the MR (confirms by default; --auto arms auto-merge)
|
|
46
|
+
resolution-check Verify the merged MR actually closes the issue
|
|
47
|
+
close [<iid>] Close the issue (confirms by default)
|
|
48
|
+
session Inspect cached sessions (list | show | clean)
|
|
49
|
+
doctor Check prerequisites (node, git, claude CLI, token, config)
|
|
50
|
+
version Print version
|
|
51
|
+
help Show this help
|
|
52
|
+
|
|
53
|
+
Options
|
|
54
|
+
-p, --port <n> Port for start (overrides $PORT; default 5001)
|
|
55
|
+
--repo <group/repo> Primary repo for issues/analyze (overrides default)
|
|
56
|
+
--secondary <repo> Additional repo for cross-repo analyze (repeatable)
|
|
57
|
+
--all-repos Include every configured repo as a secondary
|
|
58
|
+
--model <id> Claude model for analyze
|
|
59
|
+
--agent <name> Agent backend for analyze: claude | openclaw (default claude)
|
|
60
|
+
--prompt <text> Extra user prompt injected into analysis
|
|
61
|
+
--limit <n> Cap issue count for issues
|
|
62
|
+
--json JSON output (NDJSON for analyze; array for issues)
|
|
63
|
+
--quiet Suppress progress; print only final result
|
|
64
|
+
--force Overwrite existing files (init)
|
|
65
|
+
--yes Skip the confirmation gate on apply (also: FORGE_YES=1)
|
|
66
|
+
--validate Run validate before apply, refuse to apply if red
|
|
67
|
+
--feedback <text> Refine feedback (refine command)
|
|
68
|
+
|
|
69
|
+
Examples
|
|
70
|
+
forge-agent init
|
|
71
|
+
forge-agent start --port 5055
|
|
72
|
+
forge-agent repos add group/other-repo
|
|
73
|
+
forge-agent repos set-default group/other-repo
|
|
74
|
+
forge-agent issues --limit 10
|
|
75
|
+
forge-agent analyze 42 --repo group/repo
|
|
76
|
+
forge-agent analyze 42 --json | jq .
|
|
77
|
+
forge-agent doctor
|
|
78
|
+
|
|
79
|
+
`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function cmdVersion() {
|
|
83
|
+
const pkg = await readPkg();
|
|
84
|
+
console.log(pkg.version);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function cmdStart({ port }) {
|
|
88
|
+
process.env.NODE_ENV = process.env.NODE_ENV ?? "production";
|
|
89
|
+
if (port != null) process.env.PORT = String(port);
|
|
90
|
+
|
|
91
|
+
const spa = path.join(projectRoot, "dist", "index.html");
|
|
92
|
+
if (!existsSync(spa)) {
|
|
93
|
+
console.error("Frontend build not found. Run: npm run build:app");
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
await import(path.join(projectRoot, "server.js"));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function main() {
|
|
101
|
+
try {
|
|
102
|
+
const { config } = await import("dotenv");
|
|
103
|
+
config({ quiet: true });
|
|
104
|
+
} catch {
|
|
105
|
+
/* dotenv optional at CLI load */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const argv = process.argv.slice(2);
|
|
109
|
+
const cmd = argv[0];
|
|
110
|
+
const flags = {
|
|
111
|
+
force: argv.includes("--force"),
|
|
112
|
+
port: parsePort(argv),
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
switch (cmd) {
|
|
116
|
+
case "init":
|
|
117
|
+
return cmdInit(flags);
|
|
118
|
+
case "start":
|
|
119
|
+
return cmdStart(flags);
|
|
120
|
+
case "repos":
|
|
121
|
+
return cmdRepos(argv);
|
|
122
|
+
case "issues":
|
|
123
|
+
return cmdIssues(argv);
|
|
124
|
+
case "issue":
|
|
125
|
+
return cmdIssue(argv);
|
|
126
|
+
case "analyze":
|
|
127
|
+
return cmdAnalyze(argv);
|
|
128
|
+
case "show":
|
|
129
|
+
return cmdShow(argv);
|
|
130
|
+
case "refine":
|
|
131
|
+
return cmdRefine(argv);
|
|
132
|
+
case "validate":
|
|
133
|
+
return cmdValidate(argv);
|
|
134
|
+
case "apply":
|
|
135
|
+
return cmdApply(argv);
|
|
136
|
+
case "watch":
|
|
137
|
+
return cmdWatch(argv);
|
|
138
|
+
case "ci-fix":
|
|
139
|
+
case "cifix":
|
|
140
|
+
return cmdCiFix(argv);
|
|
141
|
+
case "merge":
|
|
142
|
+
return cmdMerge(argv);
|
|
143
|
+
case "resolution-check":
|
|
144
|
+
case "resolution":
|
|
145
|
+
return cmdResolutionCheck(argv);
|
|
146
|
+
case "close":
|
|
147
|
+
return cmdClose(argv);
|
|
148
|
+
case "ship":
|
|
149
|
+
return cmdShip(argv);
|
|
150
|
+
case "session":
|
|
151
|
+
return cmdSession(argv);
|
|
152
|
+
case "doctor":
|
|
153
|
+
return cmdDoctor(flags);
|
|
154
|
+
case "version":
|
|
155
|
+
case "--version":
|
|
156
|
+
case "-v":
|
|
157
|
+
return cmdVersion();
|
|
158
|
+
case "help":
|
|
159
|
+
case "--help":
|
|
160
|
+
case "-h":
|
|
161
|
+
case undefined:
|
|
162
|
+
usage();
|
|
163
|
+
return;
|
|
164
|
+
default:
|
|
165
|
+
console.error(`Unknown command: ${cmd}\n`);
|
|
166
|
+
usage();
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
main().catch((err) => {
|
|
172
|
+
console.error(err.stack || err.message || err);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
});
|