@orgloop/agentctl 1.1.0 → 1.2.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 +145 -3
- package/dist/adapters/claude-code.js +9 -9
- package/dist/adapters/codex.d.ts +72 -0
- package/dist/adapters/codex.js +692 -0
- package/dist/adapters/openclaw.d.ts +60 -9
- package/dist/adapters/openclaw.js +195 -38
- package/dist/adapters/opencode.d.ts +143 -0
- package/dist/adapters/opencode.js +672 -0
- package/dist/adapters/pi-rust.d.ts +89 -0
- package/dist/adapters/pi-rust.js +743 -0
- package/dist/adapters/pi.d.ts +96 -0
- package/dist/adapters/pi.js +855 -0
- package/dist/cli.js +277 -59
- package/dist/core/types.d.ts +1 -0
- package/dist/daemon/server.js +34 -4
- package/dist/daemon/session-tracker.d.ts +11 -0
- package/dist/daemon/session-tracker.js +76 -4
- package/dist/daemon/state.d.ts +1 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +4 -0
- package/dist/launch-orchestrator.d.ts +60 -0
- package/dist/launch-orchestrator.js +198 -0
- package/dist/matrix-parser.d.ts +40 -0
- package/dist/matrix-parser.js +69 -0
- package/dist/utils/partial-read.d.ts +20 -0
- package/dist/utils/partial-read.js +66 -0
- package/dist/worktree.d.ts +22 -0
- package/dist/worktree.js +68 -0
- package/package.json +3 -2
package/dist/worktree.js
CHANGED
|
@@ -63,3 +63,71 @@ export async function removeWorktree(repo, worktreePath) {
|
|
|
63
63
|
cwd: repoResolved,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* List all git worktrees for a repo.
|
|
68
|
+
* Parses `git worktree list --porcelain` output.
|
|
69
|
+
*/
|
|
70
|
+
export async function listWorktrees(repo) {
|
|
71
|
+
const repoResolved = path.resolve(repo);
|
|
72
|
+
const { stdout } = await execFileAsync("git", ["worktree", "list", "--porcelain"], { cwd: repoResolved });
|
|
73
|
+
const entries = [];
|
|
74
|
+
let current = {};
|
|
75
|
+
for (const line of stdout.split("\n")) {
|
|
76
|
+
if (line.startsWith("worktree ")) {
|
|
77
|
+
if (current.path)
|
|
78
|
+
entries.push(current);
|
|
79
|
+
current = { path: line.replace("worktree ", ""), bare: false };
|
|
80
|
+
}
|
|
81
|
+
else if (line.startsWith("HEAD ")) {
|
|
82
|
+
current.head = line.replace("HEAD ", "");
|
|
83
|
+
}
|
|
84
|
+
else if (line.startsWith("branch ")) {
|
|
85
|
+
current.branch = line.replace("branch refs/heads/", "");
|
|
86
|
+
}
|
|
87
|
+
else if (line === "bare") {
|
|
88
|
+
current.bare = true;
|
|
89
|
+
}
|
|
90
|
+
else if (line === "" && current.path) {
|
|
91
|
+
// End of entry
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (current.path)
|
|
95
|
+
entries.push(current);
|
|
96
|
+
return entries;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Remove a worktree and optionally delete its branch.
|
|
100
|
+
*/
|
|
101
|
+
export async function cleanWorktree(repo, worktreePath, opts) {
|
|
102
|
+
const repoResolved = path.resolve(repo);
|
|
103
|
+
// Get the branch name before removing
|
|
104
|
+
let branch;
|
|
105
|
+
if (opts?.deleteBranch) {
|
|
106
|
+
try {
|
|
107
|
+
const { stdout } = await execFileAsync("git", ["rev-parse", "--abbrev-ref", "HEAD"], { cwd: worktreePath });
|
|
108
|
+
branch = stdout.trim();
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// Worktree might be broken — still try to remove
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
await execFileAsync("git", ["worktree", "remove", "--force", worktreePath], {
|
|
115
|
+
cwd: repoResolved,
|
|
116
|
+
});
|
|
117
|
+
const result = {
|
|
118
|
+
removedPath: worktreePath,
|
|
119
|
+
};
|
|
120
|
+
// Delete the branch if requested
|
|
121
|
+
if (branch && opts?.deleteBranch) {
|
|
122
|
+
try {
|
|
123
|
+
await execFileAsync("git", ["branch", "-D", branch], {
|
|
124
|
+
cwd: repoResolved,
|
|
125
|
+
});
|
|
126
|
+
result.deletedBranch = branch;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Branch might already be gone
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orgloop/agentctl",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Universal agent supervision interface — monitor and control AI coding agents from a single CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"commander": "^14.0.3",
|
|
50
50
|
"tsx": "^4.21.0",
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
|
-
"vitest": "^4.0.18"
|
|
52
|
+
"vitest": "^4.0.18",
|
|
53
|
+
"yaml": "^2.8.2"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@biomejs/biome": "^2.4.2"
|