@teamclaws/teamclaw 2026.4.4 → 2026.5.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 +2 -0
- package/index.ts +16 -0
- package/openclaw.plugin.json +20 -1
- package/package.json +1 -1
- package/src/config.ts +19 -0
- package/src/controller/controller-service.ts +44 -2
- package/src/controller/github-auth.ts +699 -0
- package/src/controller/http-server.ts +337 -5
- package/src/controller/orchestration-manifest.ts +1 -0
- package/src/task-executor.ts +17 -1
- package/src/teamauto/github-client.ts +254 -0
- package/src/teamauto/norms.ts +103 -0
- package/src/teamauto/repo-sync.ts +218 -0
- package/src/teamauto/scanner.ts +221 -0
- package/src/teamauto/scheduler.ts +585 -0
- package/src/teamauto/store.ts +242 -0
- package/src/types.ts +39 -0
- package/src/ui/app.js +537 -9
- package/src/ui/github-login.html +296 -0
- package/src/ui/index.html +47 -1
- package/src/ui/style.css +199 -58
- package/src/worker/worker-service.ts +16 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ It supports:
|
|
|
10
10
|
- clarifications, workspace browsing, controller UI visibility, and a matching desktop client
|
|
11
11
|
- Git-based collaboration
|
|
12
12
|
- on-demand worker provisioning with `process`, `docker`, and `kubernetes`
|
|
13
|
+
- GitHub OAuth device-flow login and TeamAuto: scheduled issue/PR sweeps, joint multi-role full reviews, and write tasks delivered as pull requests from task-isolated git worktrees (read/write collaboration contract)
|
|
14
|
+
- checkpoint/resume: interrupted tasks continue where they stopped after a restart, reusing the same session and worktree
|
|
13
15
|
|
|
14
16
|
## Install
|
|
15
17
|
|
package/index.ts
CHANGED
|
@@ -118,6 +118,21 @@ function registerWorker(api: OpenClawPluginApi, config: ReturnType<typeof parseP
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
async function reportCheckpoint(taskId: string, checkpoint: { lastAssistantMessage: string; progressNote?: string; sessionKey: string }): Promise<void> {
|
|
122
|
+
if (!currentControllerUrl) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
await fetch(`${currentControllerUrl}/api/v1/tasks/${taskId}/checkpoint`, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: { "Content-Type": "application/json" },
|
|
129
|
+
body: JSON.stringify({ ...checkpoint, workerId: currentWorkerId ?? undefined }),
|
|
130
|
+
});
|
|
131
|
+
} catch {
|
|
132
|
+
// Checkpointing is best-effort; a lost heartbeat only costs resume freshness.
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
121
136
|
const getWorkerSessionKey = (assignment: TaskAssignmentPayload) =>
|
|
122
137
|
assignment.executionSessionKey?.trim() || `teamclaw-task-${assignment.taskId}`;
|
|
123
138
|
|
|
@@ -131,6 +146,7 @@ function registerWorker(api: OpenClawPluginApi, config: ReturnType<typeof parseP
|
|
|
131
146
|
getIdempotencyKey: (assignment) =>
|
|
132
147
|
assignment.executionIdempotencyKey?.trim() || `teamclaw-${assignment.taskId}`,
|
|
133
148
|
reportExecutionEvent,
|
|
149
|
+
reportCheckpoint,
|
|
134
150
|
});
|
|
135
151
|
|
|
136
152
|
function resolveProjectSyncPaths(projectDir: string | undefined): { sharedProjectDir: string; localProjectDir: string } | null {
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "teamclaw",
|
|
3
3
|
"name": "TeamClaw",
|
|
4
4
|
"description": "Virtual team collaboration - multiple OpenClaw instances form a virtual software company with role-based task routing.",
|
|
5
|
-
"version": "2026.
|
|
5
|
+
"version": "2026.5.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true
|
|
8
8
|
},
|
|
@@ -82,6 +82,15 @@
|
|
|
82
82
|
"label": "Git Author Email",
|
|
83
83
|
"help": "Author email for TeamClaw-managed workspace commits"
|
|
84
84
|
},
|
|
85
|
+
"githubClientId": {
|
|
86
|
+
"label": "GitHub Client ID",
|
|
87
|
+
"help": "GitHub App OAuth client ID used by the GitHub login feature"
|
|
88
|
+
},
|
|
89
|
+
"githubClientSecret": {
|
|
90
|
+
"label": "GitHub Client Secret",
|
|
91
|
+
"hint": "optional - prefer the TEAMCLAW_GITHUB_CLIENT_SECRET env var",
|
|
92
|
+
"help": "GitHub App OAuth client secret; the TEAMCLAW_GITHUB_CLIENT_SECRET environment variable takes precedence"
|
|
93
|
+
},
|
|
85
94
|
"agentIsolationMode": {
|
|
86
95
|
"label": "Agent Isolation Mode",
|
|
87
96
|
"help": "Use a dedicated TeamClaw agent/workspace by default, or the legacy shared main-agent mode"
|
|
@@ -253,6 +262,16 @@
|
|
|
253
262
|
"default": "teamclaw@local",
|
|
254
263
|
"description": "Git author email used for TeamClaw-managed workspace commits"
|
|
255
264
|
},
|
|
265
|
+
"githubClientId": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"default": "Iv23liqWmzrS3swGiIvK",
|
|
268
|
+
"description": "GitHub App OAuth client ID for the GitHub login feature"
|
|
269
|
+
},
|
|
270
|
+
"githubClientSecret": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"default": "",
|
|
273
|
+
"description": "GitHub App OAuth client secret; the TEAMCLAW_GITHUB_CLIENT_SECRET environment variable takes precedence"
|
|
274
|
+
},
|
|
256
275
|
"agentIsolationMode": {
|
|
257
276
|
"type": "string",
|
|
258
277
|
"enum": [
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -76,6 +76,16 @@ function buildConfigSchema() {
|
|
|
76
76
|
default: "teamclaw@local",
|
|
77
77
|
description: "Git author email used for TeamClaw-managed workspace commits",
|
|
78
78
|
},
|
|
79
|
+
githubClientId: {
|
|
80
|
+
type: "string" as const,
|
|
81
|
+
default: "Iv23liqWmzrS3swGiIvK",
|
|
82
|
+
description: "GitHub App OAuth client ID for the GitHub login feature",
|
|
83
|
+
},
|
|
84
|
+
githubClientSecret: {
|
|
85
|
+
type: "string" as const,
|
|
86
|
+
default: "",
|
|
87
|
+
description: "GitHub App OAuth client secret; the TEAMCLAW_GITHUB_CLIENT_SECRET environment variable takes precedence",
|
|
88
|
+
},
|
|
79
89
|
agentIsolationMode: {
|
|
80
90
|
type: "string" as const,
|
|
81
91
|
enum: ["independent", "main"],
|
|
@@ -259,6 +269,15 @@ function buildConfigSchema() {
|
|
|
259
269
|
label: "Git Author Email",
|
|
260
270
|
help: "Author email for TeamClaw-managed workspace commits",
|
|
261
271
|
},
|
|
272
|
+
githubClientId: {
|
|
273
|
+
label: "GitHub Client ID",
|
|
274
|
+
help: "GitHub App OAuth client ID used by the GitHub login feature",
|
|
275
|
+
},
|
|
276
|
+
githubClientSecret: {
|
|
277
|
+
label: "GitHub Client Secret",
|
|
278
|
+
hint: "optional - prefer the TEAMCLAW_GITHUB_CLIENT_SECRET env var",
|
|
279
|
+
help: "GitHub App OAuth client secret; the TEAMCLAW_GITHUB_CLIENT_SECRET environment variable takes precedence",
|
|
280
|
+
},
|
|
262
281
|
agentIsolationMode: {
|
|
263
282
|
label: "Agent Isolation Mode",
|
|
264
283
|
help: "Use a dedicated TeamClaw agent/workspace by default, or the legacy shared main-agent mode",
|
|
@@ -5,7 +5,7 @@ import type { KickoffAssessment, PluginConfig, RoleId, TeamState } from "../type
|
|
|
5
5
|
import { loadTeamState, saveTeamState } from "../state.js";
|
|
6
6
|
import { MDnsAdvertiser } from "../discovery.js";
|
|
7
7
|
import { WORKER_TIMEOUT_MS } from "../protocol.js";
|
|
8
|
-
import { createControllerHttpServer } from "./http-server.js";
|
|
8
|
+
import { createControllerHttpServer, autoAssignPendingTasks } from "./http-server.js";
|
|
9
9
|
import { TaskRouter } from "./task-router.js";
|
|
10
10
|
import { MessageRouter } from "./message-router.js";
|
|
11
11
|
import { TeamWebSocketServer } from "./websocket.js";
|
|
@@ -15,6 +15,8 @@ import { WorkerProvisioningManager } from "./worker-provisioning.js";
|
|
|
15
15
|
import { PreviewManager } from "./preview-manager.js";
|
|
16
16
|
import { runKickoffMeeting, buildKickoffAssessmentPrompt, ASSESSMENT_TIMEOUT_MS } from "./kickoff-orchestrator.js";
|
|
17
17
|
import { resolvePreferredLanAddress } from "../networking.js";
|
|
18
|
+
import { createTeamAutoScheduler, type TeamAutoScheduler } from "../teamauto/scheduler.js";
|
|
19
|
+
import { getGithubAuthManager } from "./github-auth.js";
|
|
18
20
|
|
|
19
21
|
export type KickoffHandler = (
|
|
20
22
|
candidateRoles: RoleId[],
|
|
@@ -50,6 +52,7 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
50
52
|
let wsServer: TeamWebSocketServer;
|
|
51
53
|
let timeoutTimer: ReturnType<typeof setInterval> | null = null;
|
|
52
54
|
let workerProvisioningManager: WorkerProvisioningManager | null = null;
|
|
55
|
+
let teamAutoSchedulerRef: TeamAutoScheduler | null = null;
|
|
53
56
|
let previewManager: PreviewManager;
|
|
54
57
|
|
|
55
58
|
return {
|
|
@@ -139,6 +142,9 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
139
142
|
|
|
140
143
|
// Clean up orphaned tasks — tasks assigned to workers that no longer
|
|
141
144
|
// exist OR that are offline (stale entries surviving from a previous run).
|
|
145
|
+
// Resume support: instead of silently restarting, keep the checkpoint and
|
|
146
|
+
// count resume attempts; past MAX the task fails fast instead of looping.
|
|
147
|
+
const MAX_RESUME_ATTEMPTS = 3;
|
|
142
148
|
{
|
|
143
149
|
let orphanCleaned = false;
|
|
144
150
|
for (const task of Object.values(teamState.tasks)) {
|
|
@@ -148,9 +154,22 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
148
154
|
) {
|
|
149
155
|
const worker = teamState.workers[task.assignedWorkerId];
|
|
150
156
|
if (!worker || worker.status === "offline") {
|
|
151
|
-
|
|
157
|
+
const attempt = (task.resumeAttempt ?? 0) + 1;
|
|
158
|
+
if (attempt > MAX_RESUME_ATTEMPTS) {
|
|
159
|
+
logger.warn(`Controller: task ${task.id} exceeded ${MAX_RESUME_ATTEMPTS} resume attempts - failing`);
|
|
160
|
+
task.status = "failed";
|
|
161
|
+
task.error = `resumed ${MAX_RESUME_ATTEMPTS} times without completing (last checkpoint: ${task.checkpoint?.lastAssistantMessage?.slice(0, 200) ?? "none"})`;
|
|
162
|
+
task.updatedAt = Date.now();
|
|
163
|
+
orphanCleaned = true;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
logger.info(`Controller: resetting orphaned task ${task.id} for resume attempt ${attempt} (worker ${task.assignedWorkerId} ${worker ? "offline" : "missing"})`);
|
|
152
167
|
task.status = "pending";
|
|
153
168
|
task.assignedWorkerId = undefined;
|
|
169
|
+
task.resumeAttempt = attempt;
|
|
170
|
+
if (task.checkpoint) {
|
|
171
|
+
task.checkpoint.attempt = attempt;
|
|
172
|
+
}
|
|
154
173
|
task.updatedAt = Date.now();
|
|
155
174
|
orphanCleaned = true;
|
|
156
175
|
}
|
|
@@ -189,6 +208,7 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
189
208
|
workerProvisioningManager,
|
|
190
209
|
previewManager,
|
|
191
210
|
getKickoffHandler: () => serviceKickoffHandler,
|
|
211
|
+
getTeamAutoScheduler: () => teamAutoSchedulerRef,
|
|
192
212
|
});
|
|
193
213
|
|
|
194
214
|
const PORT_RETRY_STEP = 10;
|
|
@@ -234,6 +254,24 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
234
254
|
workerProvisioningManager.setActualPort(actualPort);
|
|
235
255
|
}
|
|
236
256
|
|
|
257
|
+
// TeamAuto: autonomous repo collaboration (bind repos via /api/v1/teamauto/*).
|
|
258
|
+
try {
|
|
259
|
+
const auth = getGithubAuthManager(config, logger);
|
|
260
|
+
const httpDepsForAutoAssign = { config, logger, getTeamState: () => teamState, updateTeamState: updateState, taskRouter, messageRouter, wsServer } as Parameters<typeof autoAssignPendingTasks>[0];
|
|
261
|
+
teamAutoSchedulerRef = createTeamAutoScheduler({
|
|
262
|
+
logger,
|
|
263
|
+
auth,
|
|
264
|
+
getTeamState: () => teamState,
|
|
265
|
+
updateTeamState: updateState,
|
|
266
|
+
onTasksCreated: async () => {
|
|
267
|
+
await autoAssignPendingTasks(httpDepsForAutoAssign);
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
await teamAutoSchedulerRef.start();
|
|
271
|
+
} catch (err) {
|
|
272
|
+
logger.warn(`Controller: TeamAuto scheduler failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
273
|
+
}
|
|
274
|
+
|
|
237
275
|
// Start mDNS advertising with the actual port
|
|
238
276
|
await mdnsAdvertiser.start(actualPort, config.teamName);
|
|
239
277
|
|
|
@@ -329,6 +367,10 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
|
|
|
329
367
|
clearInterval(timeoutTimer);
|
|
330
368
|
timeoutTimer = null;
|
|
331
369
|
}
|
|
370
|
+
try {
|
|
371
|
+
await teamAutoSchedulerRef?.stop();
|
|
372
|
+
} catch { /* scheduler already stopped */ }
|
|
373
|
+
teamAutoSchedulerRef = null;
|
|
332
374
|
if (workerProvisioningManager) {
|
|
333
375
|
await workerProvisioningManager.stop();
|
|
334
376
|
}
|