@teamclaws/teamclaw 2026.8.0 → 2026.11.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.
Files changed (149) hide show
  1. package/cli.mjs +46 -15
  2. package/dist/api.js +1 -0
  3. package/dist/index.js +325 -0
  4. package/dist/src/config.js +412 -0
  5. package/dist/src/controller/clarification-routes.js +315 -0
  6. package/dist/src/controller/controller-capacity.js +14 -0
  7. package/dist/src/controller/controller-intake.js +895 -0
  8. package/dist/src/controller/controller-planning.js +813 -0
  9. package/dist/src/controller/controller-runs.js +175 -0
  10. package/dist/src/controller/controller-service.js +624 -0
  11. package/dist/src/controller/controller-tools.js +587 -0
  12. package/dist/src/controller/delivery-report.js +458 -0
  13. package/dist/src/controller/github-auth.js +564 -0
  14. package/dist/src/controller/http-server.js +284 -0
  15. package/dist/src/controller/kickoff-orchestrator.js +246 -0
  16. package/dist/src/controller/managed-gateway-process.js +286 -0
  17. package/dist/src/controller/message-delivery.js +28 -0
  18. package/dist/src/controller/message-router.js +38 -0
  19. package/dist/src/controller/message-routes.js +114 -0
  20. package/dist/src/controller/orchestration-manifest.js +151 -0
  21. package/dist/src/controller/preview-manager.js +586 -0
  22. package/dist/src/controller/preview-proxy.js +98 -0
  23. package/dist/src/controller/profile-switch.js +289 -0
  24. package/dist/src/controller/project-registry.js +294 -0
  25. package/dist/src/controller/prompt-injector.js +197 -0
  26. package/dist/src/controller/repo-routes.js +63 -0
  27. package/dist/src/controller/role-inference.js +246 -0
  28. package/dist/src/controller/route-table.js +1353 -0
  29. package/dist/src/controller/task-assignment.js +508 -0
  30. package/dist/src/controller/task-cleanup.js +258 -0
  31. package/dist/src/controller/task-execution.js +240 -0
  32. package/dist/src/controller/task-results.js +461 -0
  33. package/dist/src/controller/task-router.js +137 -0
  34. package/dist/src/controller/task-routes.js +703 -0
  35. package/dist/src/controller/teamauto-routes.js +124 -0
  36. package/dist/src/controller/tunnel-manager.js +548 -0
  37. package/dist/src/controller/ui-assets.js +68 -0
  38. package/dist/src/controller/websocket.js +42 -0
  39. package/dist/src/controller/worker-provisioning.js +1674 -0
  40. package/dist/src/controller/worker-routes.js +188 -0
  41. package/dist/src/discovery.js +86 -0
  42. package/dist/src/git-collaboration.js +694 -0
  43. package/dist/src/identity.js +132 -0
  44. package/dist/src/install-defaults.js +1 -0
  45. package/dist/src/interaction-contracts.js +531 -0
  46. package/dist/src/networking.js +91 -0
  47. package/dist/src/openclaw-workspace.js +925 -0
  48. package/dist/src/profile-loader.js +486 -0
  49. package/dist/src/profiles/banking.json +178 -0
  50. package/dist/src/profiles/crossborder-ecom.json +253 -0
  51. package/dist/src/profiles/insurance.json +157 -0
  52. package/dist/src/profiles/knowledge/hs-structure.md +97 -0
  53. package/dist/src/profiles/knowledge/incoterms-2020.md +188 -0
  54. package/dist/src/profiles/knowledge/vat-principles.md +85 -0
  55. package/dist/src/profiles/schema.json +201 -0
  56. package/dist/src/profiles/securities.json +137 -0
  57. package/dist/src/profiles/software-rd.json +264 -0
  58. package/dist/src/profiles/trading-co.json +200 -0
  59. package/dist/src/prompt-policy.js +386 -0
  60. package/dist/src/protocol.js +58 -0
  61. package/dist/src/role-ids.js +29 -0
  62. package/dist/src/roles.js +390 -0
  63. package/dist/src/session-roles.js +14 -0
  64. package/dist/src/state.js +361 -0
  65. package/dist/src/task-executor.js +1023 -0
  66. package/dist/src/teamauto/github-client.js +210 -0
  67. package/dist/src/teamauto/norms.js +85 -0
  68. package/dist/src/teamauto/repo-sync.js +423 -0
  69. package/dist/src/teamauto/scanner.js +207 -0
  70. package/dist/src/teamauto/schedule.js +123 -0
  71. package/dist/src/teamauto/scheduler.js +907 -0
  72. package/dist/src/teamauto/store.js +133 -0
  73. package/dist/src/types.js +290 -0
  74. package/dist/src/ui/app.js +4860 -0
  75. package/dist/src/ui/assets/teamclaw-app-icon.png +0 -0
  76. package/dist/src/ui/github-login.html +296 -0
  77. package/dist/src/ui/index.html +447 -0
  78. package/dist/src/ui/style.css +2805 -0
  79. package/dist/src/worker/http-handler.js +146 -0
  80. package/dist/src/worker/message-queue.js +24 -0
  81. package/dist/src/worker/prompt-injector.js +78 -0
  82. package/dist/src/worker/skill-installer.js +255 -0
  83. package/dist/src/worker/tools.js +541 -0
  84. package/dist/src/worker/worker-service.js +307 -0
  85. package/dist/src/workspace-browser.js +269 -0
  86. package/openclaw.plugin.json +28 -1
  87. package/package.json +3 -2
  88. package/src/config.ts +33 -2
  89. package/src/controller/clarification-routes.ts +404 -0
  90. package/src/controller/controller-intake.ts +1113 -0
  91. package/src/controller/controller-planning.ts +1029 -0
  92. package/src/controller/controller-runs.ts +239 -0
  93. package/src/controller/controller-service.ts +295 -41
  94. package/src/controller/controller-tools.ts +11 -7
  95. package/src/controller/http-server.ts +294 -6971
  96. package/src/controller/kickoff-orchestrator.ts +70 -7
  97. package/src/controller/message-delivery.ts +49 -0
  98. package/src/controller/message-routes.ts +137 -0
  99. package/src/controller/orchestration-manifest.ts +6 -29
  100. package/src/controller/preview-proxy.ts +127 -0
  101. package/src/controller/profile-switch.ts +366 -0
  102. package/src/controller/project-registry.ts +361 -0
  103. package/src/controller/prompt-injector.ts +23 -8
  104. package/src/controller/repo-routes.ts +91 -0
  105. package/src/controller/role-inference.ts +260 -22
  106. package/src/controller/route-table.ts +1616 -0
  107. package/src/controller/task-assignment.ts +618 -0
  108. package/src/controller/task-cleanup.ts +344 -0
  109. package/src/controller/task-execution.ts +356 -0
  110. package/src/controller/task-results.ts +544 -0
  111. package/src/controller/task-router.ts +98 -6
  112. package/src/controller/task-routes.ts +812 -0
  113. package/src/controller/teamauto-routes.ts +121 -0
  114. package/src/controller/ui-assets.ts +70 -0
  115. package/src/controller/websocket.ts +13 -1
  116. package/src/controller/worker-provisioning.ts +32 -4
  117. package/src/controller/worker-routes.ts +241 -0
  118. package/src/identity.ts +3 -2
  119. package/src/interaction-contracts.ts +7 -7
  120. package/src/openclaw-workspace.ts +44 -18
  121. package/src/profile-loader.ts +650 -0
  122. package/src/profiles/banking.json +178 -0
  123. package/src/profiles/crossborder-ecom.json +253 -0
  124. package/src/profiles/insurance.json +157 -0
  125. package/src/profiles/knowledge/hs-structure.md +97 -0
  126. package/src/profiles/knowledge/incoterms-2020.md +188 -0
  127. package/src/profiles/knowledge/vat-principles.md +85 -0
  128. package/src/profiles/schema.json +201 -0
  129. package/src/profiles/securities.json +137 -0
  130. package/src/profiles/software-rd.json +264 -0
  131. package/src/profiles/trading-co.json +200 -0
  132. package/src/prompt-policy.ts +27 -13
  133. package/src/role-ids.ts +31 -0
  134. package/src/roles.ts +60 -14
  135. package/src/session-roles.ts +14 -0
  136. package/src/state.ts +236 -9
  137. package/src/task-executor.ts +7 -18
  138. package/src/teamauto/github-client.ts +21 -0
  139. package/src/teamauto/repo-sync.ts +246 -6
  140. package/src/teamauto/scanner.ts +47 -13
  141. package/src/teamauto/scheduler.ts +259 -16
  142. package/src/teamauto/store.ts +12 -0
  143. package/src/types.ts +133 -16
  144. package/src/ui/app.js +592 -24
  145. package/src/ui/index.html +44 -11
  146. package/src/ui/style.css +194 -0
  147. package/src/worker/prompt-injector.ts +48 -8
  148. package/src/worker/skill-installer.ts +3 -1
  149. package/src/worker/worker-service.ts +83 -3
@@ -0,0 +1,68 @@
1
+ // PR-A of issue #204 (http-server monolith split): static web UI asset
2
+ // serving extracted verbatim from controller/http-server.ts. Zero behavior
3
+ // change - the route shells in http-server call these functions unchanged.
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import { createHash } from "node:crypto";
7
+ import { sendError } from "../protocol.js";
8
+ // Tunnel/CDN caches rewrite the origin's Cache-Control: no-cache into a long
9
+ // browser freeze for cacheable extensions like .js (observed: Cloudflare
10
+ // Browser Cache TTL max-age=14400 on tunneled UI assets). A UI update then
11
+ // never reaches visitors through the tunnel. Serving content-versioned URLs
12
+ // (?v=<hash>) makes every UI deploy a URL no browser or edge has ever seen,
13
+ // so stale-cache behavior cannot recur.
14
+ const uiAssetVersionCache = new Map();
15
+ function uiAssetVersion(uiPath, file) {
16
+ const full = path.join(uiPath, file);
17
+ try {
18
+ const mtimeMs = fs.statSync(full).mtimeMs;
19
+ const cached = uiAssetVersionCache.get(full);
20
+ if (cached && cached.mtimeMs === mtimeMs)
21
+ return cached.version;
22
+ const version = createHash("sha1").update(fs.readFileSync(full)).digest("hex").slice(0, 10);
23
+ uiAssetVersionCache.set(full, { mtimeMs, version });
24
+ return version;
25
+ }
26
+ catch {
27
+ return String(Date.now()); // unreadable asset: bust for this request
28
+ }
29
+ }
30
+ const UI_HTML_ASSET_REFS = [
31
+ "/ui/style.css",
32
+ "/ui/app.js",
33
+ "/ui/assets/teamclaw-app-icon.png",
34
+ ];
35
+ export function serveVersionedHtml(res, htmlPath) {
36
+ try {
37
+ const uiPath = path.dirname(htmlPath);
38
+ let html = fs.readFileSync(htmlPath, "utf8");
39
+ for (const ref of UI_HTML_ASSET_REFS) {
40
+ html = html.split(`"${ref}"`).join(`"${ref}?v=${uiAssetVersion(uiPath, ref.slice("/ui/".length))}"`);
41
+ }
42
+ res.writeHead(200, {
43
+ "Content-Type": "text/html; charset=utf-8",
44
+ "Access-Control-Allow-Origin": "*",
45
+ "Cache-Control": "no-cache",
46
+ });
47
+ res.end(html);
48
+ }
49
+ catch {
50
+ sendError(res, 404, "File not found");
51
+ }
52
+ }
53
+ export function serveStaticFile(res, filePath, contentType) {
54
+ try {
55
+ const content = fs.readFileSync(filePath);
56
+ res.writeHead(200, {
57
+ "Content-Type": contentType,
58
+ "Access-Control-Allow-Origin": "*",
59
+ // UI assets change with every plugin deploy on a localhost controller;
60
+ // always revalidate so browsers never stick to a stale app.js.
61
+ "Cache-Control": "no-cache",
62
+ });
63
+ res.end(content);
64
+ }
65
+ catch {
66
+ sendError(res, 404, "File not found");
67
+ }
68
+ }
@@ -0,0 +1,42 @@
1
+ import { WebSocketServer, WebSocket } from "ws";
2
+ export class TeamWebSocketServer {
3
+ wss = null;
4
+ logger;
5
+ constructor(logger) {
6
+ this.logger = logger;
7
+ }
8
+ attach(server) {
9
+ this.wss = new WebSocketServer({ server, path: "/ws" });
10
+ this.wss.on("connection", (ws) => {
11
+ this.logger.info("WebSocket: client connected");
12
+ ws.on("close", () => {
13
+ this.logger.info("WebSocket: client disconnected");
14
+ });
15
+ });
16
+ this.wss.on("error", (err) => {
17
+ this.logger.warn(`WebSocket: error: ${String(err)}`);
18
+ });
19
+ }
20
+ broadcastUpdate(event) {
21
+ if (!this.wss)
22
+ return;
23
+ const data = JSON.stringify(event);
24
+ for (const client of this.wss.clients) {
25
+ if (client.readyState === WebSocket.OPEN) {
26
+ client.send(data);
27
+ }
28
+ }
29
+ }
30
+ close() {
31
+ if (this.wss) {
32
+ for (const client of this.wss.clients) {
33
+ client.close();
34
+ }
35
+ this.wss.close();
36
+ this.wss = null;
37
+ }
38
+ }
39
+ getClientCount() {
40
+ return this.wss ? this.wss.clients.size : 0;
41
+ }
42
+ }