@teamclaws/teamclaw 2026.8.0 → 2026.8.1

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.
Files changed (54) hide show
  1. package/dist/api.js +1 -0
  2. package/dist/index.js +325 -0
  3. package/dist/src/config.js +381 -0
  4. package/dist/src/controller/controller-capacity.js +14 -0
  5. package/dist/src/controller/controller-service.js +393 -0
  6. package/dist/src/controller/controller-tools.js +582 -0
  7. package/dist/src/controller/delivery-report.js +458 -0
  8. package/dist/src/controller/github-auth.js +564 -0
  9. package/dist/src/controller/http-server.js +6032 -0
  10. package/dist/src/controller/kickoff-orchestrator.js +220 -0
  11. package/dist/src/controller/managed-gateway-process.js +286 -0
  12. package/dist/src/controller/message-router.js +38 -0
  13. package/dist/src/controller/orchestration-manifest.js +173 -0
  14. package/dist/src/controller/preview-manager.js +586 -0
  15. package/dist/src/controller/prompt-injector.js +187 -0
  16. package/dist/src/controller/role-inference.js +35 -0
  17. package/dist/src/controller/task-router.js +67 -0
  18. package/dist/src/controller/tunnel-manager.js +548 -0
  19. package/dist/src/controller/websocket.js +42 -0
  20. package/dist/src/controller/worker-provisioning.js +1648 -0
  21. package/dist/src/discovery.js +86 -0
  22. package/dist/src/git-collaboration.js +694 -0
  23. package/dist/src/identity.js +131 -0
  24. package/dist/src/install-defaults.js +1 -0
  25. package/dist/src/interaction-contracts.js +531 -0
  26. package/dist/src/networking.js +91 -0
  27. package/dist/src/openclaw-workspace.js +903 -0
  28. package/dist/src/prompt-policy.js +373 -0
  29. package/dist/src/protocol.js +58 -0
  30. package/dist/src/roles.js +349 -0
  31. package/dist/src/state.js +183 -0
  32. package/dist/src/task-executor.js +1033 -0
  33. package/dist/src/teamauto/github-client.js +192 -0
  34. package/dist/src/teamauto/norms.js +85 -0
  35. package/dist/src/teamauto/repo-sync.js +201 -0
  36. package/dist/src/teamauto/scanner.js +179 -0
  37. package/dist/src/teamauto/schedule.js +123 -0
  38. package/dist/src/teamauto/scheduler.js +688 -0
  39. package/dist/src/teamauto/store.js +133 -0
  40. package/dist/src/types.js +243 -0
  41. package/dist/src/ui/app.js +4292 -0
  42. package/dist/src/ui/assets/teamclaw-app-icon.png +0 -0
  43. package/dist/src/ui/github-login.html +296 -0
  44. package/dist/src/ui/index.html +414 -0
  45. package/dist/src/ui/style.css +2611 -0
  46. package/dist/src/worker/http-handler.js +146 -0
  47. package/dist/src/worker/message-queue.js +24 -0
  48. package/dist/src/worker/prompt-injector.js +42 -0
  49. package/dist/src/worker/skill-installer.js +253 -0
  50. package/dist/src/worker/tools.js +541 -0
  51. package/dist/src/worker/worker-service.js +234 -0
  52. package/dist/src/workspace-browser.js +269 -0
  53. package/openclaw.plugin.json +1 -1
  54. package/package.json +1 -1
@@ -0,0 +1,296 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>TeamClaw - GitHub Login</title>
7
+ <style>
8
+ :root { color-scheme: dark; }
9
+ * { box-sizing: border-box; }
10
+ body {
11
+ margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
12
+ background: #0f1117; color: #e6e8ee;
13
+ font-family: -apple-system, "system-ui", "PingFang SC", "Microsoft YaHei", sans-serif;
14
+ padding: 24px;
15
+ }
16
+ main { width: 100%; max-width: 460px; background: #161923; border: 1px solid #2a2f3a; border-radius: 16px; padding: 32px 36px; text-align: center; }
17
+ h1 { font-size: 20px; margin: 0 0 6px; }
18
+ .sub { color: #a8b0c0; font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
19
+ .hidden { display: none !important; }
20
+ .btn {
21
+ display: inline-block; appearance: none; border: 1px solid #2a2f3a; border-radius: 8px;
22
+ background: #21262d; color: #e6e8ee; padding: 10px 18px; font-size: 14px; cursor: pointer; text-decoration: none;
23
+ }
24
+ .btn:hover { background: #283040; }
25
+ .btn-primary { background: #238636; border-color: #2ea043; font-weight: 600; }
26
+ .btn-primary:hover { background: #2ea043; }
27
+ .btn-block { display: block; width: 100%; margin-top: 14px; padding: 12px; font-size: 15px; }
28
+ .btn[disabled] { opacity: 0.5; cursor: default; }
29
+ .device-box { border: 1px dashed #3d4450; border-radius: 12px; padding: 18px 14px 14px; margin: 18px 0 4px; background: rgba(128,128,128,0.06); }
30
+ .device-code {
31
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
32
+ font-size: 36px; font-weight: 700; letter-spacing: 6px; margin: 8px 0 12px; user-select: all;
33
+ }
34
+ .copy-row {
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ gap: 10px;
39
+ margin: 4px 0 12px;
40
+ }
41
+
42
+ .copy-state {
43
+ color: #3fb950;
44
+ font-size: 13px;
45
+ }
46
+
47
+ .countdown { color: #a8b0c0; font-size: 13px; margin-top: 8px; }
48
+ .countdown b { color: #e6e8ee; }
49
+ .avatar { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 10px; }
50
+ .account { font-size: 16px; font-weight: 600; }
51
+ .meta { color: #a8b0c0; font-size: 13px; margin-top: 6px; }
52
+ .ok-badge { font-size: 34px; }
53
+ .error {
54
+ background: rgba(229,83,75,0.12); border: 1px solid rgba(229,83,75,0.5); color: #f0a6a2;
55
+ border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-top: 14px; text-align: left;
56
+ }
57
+ .footer-note { color: #6e7681; font-size: 12px; margin-top: 18px; }
58
+ a.link { color: #58a6ff; }
59
+ </style>
60
+ </head>
61
+ <body>
62
+ <main id="app">
63
+ <div id="view-loading">
64
+ <h1>TeamClaw GitHub</h1>
65
+ <p class="sub" id="t-loading">Loading...</p>
66
+ </div>
67
+
68
+ <div id="view-idle" class="hidden">
69
+ <h1 id="t-idle-title">Sign in with GitHub</h1>
70
+ <p class="sub" id="t-idle-sub">Authorize TeamClaw to access the GitHub API on your behalf. Device flow: no client secret needed.</p>
71
+ <button id="btn-start" class="btn btn-primary btn-block" type="button">Sign in with GitHub</button>
72
+ <div id="idle-error" class="error hidden"></div>
73
+ </div>
74
+
75
+ <div id="view-device" class="hidden">
76
+ <h1 id="t-device-title">Enter this code on GitHub</h1>
77
+ <p class="sub" id="t-device-sub">The code is copied to your clipboard. Open the GitHub device page below, paste the code there, and confirm.</p>
78
+ <div class="device-box">
79
+ <div class="device-code" id="device-code">------</div>
80
+ <div class="copy-row">
81
+ <span id="copy-state" class="copy-state hidden">Copied to clipboard</span>
82
+ <button id="btn-copy" class="btn" type="button">Copy code</button>
83
+ </div>
84
+ <div class="countdown" id="t-expires"><span id="t-expires-label">Expires in</span> <b id="countdown">--:--</b></div>
85
+ </div>
86
+ <a id="btn-open" class="btn btn-primary btn-block" href="https://github.com/login/device" target="_blank" rel="noopener">Open github.com/login/device</a>
87
+ <p class="footer-note" id="t-waiting">Waiting for authorization... this page updates automatically.</p>
88
+ </div>
89
+
90
+ <div id="view-success" class="hidden">
91
+ <div class="ok-badge">&#10003;</div>
92
+ <h1 id="t-success-title">Signed in to GitHub</h1>
93
+ <img id="account-avatar" class="avatar hidden" alt="">
94
+ <div class="account" id="account-login"></div>
95
+ <div class="meta" id="account-meta"></div>
96
+ <button id="btn-logout" class="btn btn-block" type="button">Sign out</button>
97
+ <p class="footer-note" id="t-close">You can close this page and return to TeamClaw.</p>
98
+ </div>
99
+ </main>
100
+
101
+ <script>
102
+ (function () {
103
+ "use strict";
104
+ var zh = (navigator.language || "").toLowerCase().indexOf("zh") === 0;
105
+ var STR = zh ? {
106
+ loading: "加载中...",
107
+ idleTitle: "使用 GitHub 登录",
108
+ idleSub: "授权 TeamClaw 以你的身份访问 GitHub API。设备流方式,无需 Client Secret。",
109
+ start: "使用 GitHub 登录",
110
+ deviceTitle: "在 GitHub 上输入此代码",
111
+ deviceSub: "代码已复制到剪贴板。点击下方按钮打开 GitHub 设备页,粘贴代码并确认。",
112
+ copy: "复制代码",
113
+ copied: "已复制到剪贴板",
114
+ copyFailed: "请手动复制代码",
115
+ open: "打开 github.com/login/device",
116
+ expires: "有效期剩余",
117
+ waiting: "等待授权中...本页面会自动更新。",
118
+ successTitle: "GitHub 登录成功",
119
+ signOut: "退出登录",
120
+ close: "可以关闭本页返回 TeamClaw。",
121
+ validUntil: "令牌有效期至",
122
+ noExpiry: "令牌长期有效"
123
+ } : {
124
+ loading: "Loading...",
125
+ idleTitle: "Sign in with GitHub",
126
+ idleSub: "Authorize TeamClaw to access the GitHub API on your behalf. Device flow: no client secret needed.",
127
+ start: "Sign in with GitHub",
128
+ deviceTitle: "Enter this code on GitHub",
129
+ deviceSub: "The code is copied to your clipboard. Open the GitHub device page below, paste the code, and confirm.",
130
+ copy: "Copy code",
131
+ copied: "Copied to clipboard",
132
+ copyFailed: "Copy failed - select the code manually",
133
+ open: "Open github.com/login/device",
134
+ expires: "Expires in",
135
+ waiting: "Waiting for authorization... this page updates automatically.",
136
+ successTitle: "Signed in to GitHub",
137
+ signOut: "Sign out",
138
+ close: "You can close this page and return to TeamClaw.",
139
+ validUntil: "Token valid until",
140
+ noExpiry: "Token does not expire"
141
+ };
142
+
143
+ var API = "/api/v1/auth/github";
144
+ var $ = function (id) { return document.getElementById(id); };
145
+ var views = { loading: $("view-loading"), idle: $("view-idle"), device: $("view-device"), success: $("view-success") };
146
+ function show(name) { Object.keys(views).forEach(function (k) { views[k].classList.toggle("hidden", k !== name); }); }
147
+
148
+ $("t-loading").textContent = STR.loading;
149
+ $("t-idle-title").textContent = STR.idleTitle;
150
+ $("t-idle-sub").textContent = STR.idleSub;
151
+ $("btn-start").textContent = STR.start;
152
+ $("t-device-title").textContent = STR.deviceTitle;
153
+ $("t-device-sub").textContent = STR.deviceSub;
154
+ $("btn-copy").textContent = STR.copy;
155
+ $("btn-open").textContent = STR.open;
156
+ $("copy-state").textContent = STR.copied;
157
+ $("t-waiting").textContent = STR.waiting;
158
+ $("t-success-title").textContent = STR.successTitle;
159
+ $("btn-logout").textContent = STR.signOut;
160
+ $("t-close").textContent = STR.close;
161
+
162
+ var countdownTimer = null;
163
+ function setCountdown(expiresAt) {
164
+ if (countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; }
165
+ var label = $("t-expires-label");
166
+ if (label) { label.textContent = STR.expires; }
167
+ function tick() {
168
+ var el = $("countdown");
169
+ if (!el) return;
170
+ var left = Math.max(0, Math.floor((expiresAt - Date.now()) / 1000));
171
+ var m = Math.floor(left / 60), s = left % 60;
172
+ el.textContent = (m < 10 ? "0" + m : m) + ":" + (s < 10 ? "0" + s : s);
173
+ if (left <= 0 && countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; refresh(); }
174
+ }
175
+ tick();
176
+ countdownTimer = setInterval(tick, 1000);
177
+ }
178
+
179
+ function showCopiedState(ok) {
180
+ var state = $("copy-state");
181
+ if (!state) return;
182
+ state.textContent = ok ? STR.copied : STR.copyFailed;
183
+ state.classList.remove("hidden");
184
+ }
185
+
186
+ function copyCode(value) {
187
+ if (!value) return;
188
+ if (navigator.clipboard && navigator.clipboard.writeText) {
189
+ navigator.clipboard.writeText(value).then(function () {
190
+ showCopiedState(true);
191
+ }).catch(function () {
192
+ showCopiedState(false);
193
+ });
194
+ return;
195
+ }
196
+ try {
197
+ var helper = document.createElement("textarea");
198
+ helper.value = value;
199
+ helper.style.position = "fixed";
200
+ helper.style.opacity = "0";
201
+ document.body.appendChild(helper);
202
+ helper.select();
203
+ document.execCommand("copy");
204
+ document.body.removeChild(helper);
205
+ showCopiedState(true);
206
+ } catch (e) {
207
+ showCopiedState(false);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Render the device-code view. autoCopy is true only when a real user
213
+ * click just produced the code: clipboard writes need the document
214
+ * focused and (in some engines) transient user activation, so we never
215
+ * attempt them from background polling.
216
+ */
217
+ function showDevice(device, autoCopy) {
218
+ var codeEl = $("device-code");
219
+ codeEl.textContent = device.userCode || "------";
220
+ var openBtn = $("btn-open");
221
+ if (openBtn) { openBtn.href = device.verificationUri; }
222
+ show("device");
223
+ try { setCountdown(device.expiresAt); } catch (e) { /* countdown is cosmetic - never hide the code */ }
224
+ if (autoCopy) { copyCode(device.userCode || ""); }
225
+ }
226
+
227
+ function render(status) {
228
+ if (status.authenticated && status.account) {
229
+ if (countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; }
230
+ var av = $("account-avatar");
231
+ if (status.account.avatarUrl) { av.src = status.account.avatarUrl; av.classList.remove("hidden"); } else { av.classList.add("hidden"); }
232
+ $("account-login").textContent = "@" + status.account.login;
233
+ $("account-meta").textContent = status.expiresAt
234
+ ? STR.validUntil + " " + new Date(status.expiresAt).toLocaleString()
235
+ : STR.noExpiry;
236
+ show("success");
237
+ return;
238
+ }
239
+ if (status.device) {
240
+ // Poll path: display only. No clipboard attempt, no navigation.
241
+ showDevice(status.device, false);
242
+ return;
243
+ }
244
+ if (countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; }
245
+ show("idle");
246
+ }
247
+
248
+ var refreshing = false;
249
+ function refresh() {
250
+ if (refreshing) return Promise.resolve();
251
+ refreshing = true;
252
+ return fetch(API + "/status").then(function (r) { return r.json(); }).then(function (status) {
253
+ refreshing = false;
254
+ render(status);
255
+ }).catch(function () { refreshing = false; });
256
+ }
257
+
258
+ $("btn-start").addEventListener("click", function () {
259
+ var btn = $("btn-start");
260
+ var errBox = $("idle-error");
261
+ errBox.classList.add("hidden");
262
+ btn.disabled = true;
263
+ btn.textContent = STR.loading;
264
+ // Two-step flow: this click only requests the device code and renders
265
+ // it (with a gesture-chained clipboard copy). The user then explicitly
266
+ // clicks the open button to jump to GitHub - no automatic navigation.
267
+ fetch(API + "/login", { method: "POST" }).then(function (r) {
268
+ return r.json().then(function (body) { return { ok: r.ok, body: body }; });
269
+ }).then(function (result) {
270
+ if (!result.ok) { throw new Error(result.body && result.body.error ? result.body.error : "login failed"); }
271
+ if (result.body && result.body.userCode) {
272
+ showDevice(result.body, true);
273
+ }
274
+ return refresh();
275
+ }).catch(function (err) {
276
+ errBox.textContent = err instanceof Error ? err.message : String(err);
277
+ errBox.classList.remove("hidden");
278
+ }).finally(function () { btn.disabled = false; btn.textContent = STR.start; });
279
+ });
280
+
281
+ $("btn-copy").addEventListener("click", function () {
282
+ copyCode($("device-code").textContent);
283
+ });
284
+
285
+ $("btn-logout").addEventListener("click", function () {
286
+ var btn = $("btn-logout");
287
+ btn.disabled = true;
288
+ fetch(API + "/logout", { method: "POST" }).then(function () { return refresh(); }).finally(function () { btn.disabled = false; });
289
+ });
290
+
291
+ refresh();
292
+ setInterval(refresh, 2500);
293
+ })();
294
+ </script>
295
+ </body>
296
+ </html>