@teamclaws/teamclaw 2026.4.4 → 2026.6.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 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 {
@@ -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.4.4",
5
+ "version": "2026.6.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamclaws/teamclaw",
3
- "version": "2026.4.4",
3
+ "version": "2026.6.0",
4
4
  "description": "OpenClaw virtual software team orchestration plugin",
5
5
  "private": false,
6
6
  "keywords": [
@@ -59,7 +59,7 @@
59
59
  "devDependencies": {
60
60
  "@types/node": "^24",
61
61
  "@types/ws": "^8.18.2",
62
- "typescript": "^5.9.0"
62
+ "typescript": "5.9"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
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
- logger.info(`Controller: resetting orphaned task ${task.id} (worker ${task.assignedWorkerId} ${worker ? "offline" : "missing"})`);
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,30 @@ 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
+ onActivity: (entry) => {
270
+ wsServer.broadcastUpdate({
271
+ type: "teamauto:activity",
272
+ data: { at: entry.at, repoId: entry.repoId, kind: entry.kind, text: entry.text },
273
+ });
274
+ },
275
+ });
276
+ await teamAutoSchedulerRef.start();
277
+ } catch (err) {
278
+ logger.warn(`Controller: TeamAuto scheduler failed to start: ${err instanceof Error ? err.message : String(err)}`);
279
+ }
280
+
237
281
  // Start mDNS advertising with the actual port
238
282
  await mdnsAdvertiser.start(actualPort, config.teamName);
239
283
 
@@ -329,6 +373,10 @@ export function createControllerService(deps: ControllerServiceDeps): OpenClawPl
329
373
  clearInterval(timeoutTimer);
330
374
  timeoutTimer = null;
331
375
  }
376
+ try {
377
+ await teamAutoSchedulerRef?.stop();
378
+ } catch { /* scheduler already stopped */ }
379
+ teamAutoSchedulerRef = null;
332
380
  if (workerProvisioningManager) {
333
381
  await workerProvisioningManager.stop();
334
382
  }