@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,123 @@
1
+ // Wall-clock aligned schedule resolution for TeamAuto sweeps.
2
+ //
3
+ // The previous implementation translated an expression into a plain
4
+ // interval and chained setTimeout()s from "now". Two problems:
5
+ //
6
+ // 1. Every gateway restart reset the countdown: with restarts less than
7
+ // one period apart, star-slash-30 never fired at all (observed
8
+ // 2026-11-02: three restarts within 30 minutes froze both repos).
9
+ // 2. Unrecognised expressions silently fell back to "first number of
10
+ // digits x 1 minute" - "0 9 * * *" (daily at nine) became a sweep
11
+ // every single minute.
12
+ //
13
+ // This module resolves schedules to the NEXT WALL-CLOCK boundary
14
+ // (local time, matching cron semantics) so a restart costs at most one
15
+ // partial period, and unsupported expressions throw ScheduleParseError
16
+ // instead of guessing a cadence.
17
+ //
18
+ // Supported expressions (5-field cron, local time):
19
+ // every N minutes: star-slash-N in the minute field
20
+ // hourly at minute M: "M * * * *"
21
+ // every N hours on :00: "0 star-slash-N * * *"
22
+ // daily at H:M: "M H * * *"
23
+ // @hourly @daily @weekly (Monday 00:00) @monthly (1st 00:00)
24
+ export class ScheduleParseError extends Error {
25
+ constructor(schedule) {
26
+ super(`unsupported schedule "${schedule}": use */N * * * *, M * * * *, 0 */N * * *, M H * * *, @hourly, @daily, @weekly or @monthly`);
27
+ this.name = "ScheduleParseError";
28
+ }
29
+ }
30
+ export function nextFireMs(schedule, now = Date.now()) {
31
+ const s = schedule.trim();
32
+ const next = new Date(now);
33
+ next.setSeconds(0, 0);
34
+ if (s === "@hourly") {
35
+ next.setMinutes(0);
36
+ if (next.getTime() <= now) {
37
+ next.setHours(next.getHours() + 1);
38
+ }
39
+ return next.getTime() - now;
40
+ }
41
+ if (s === "@daily") {
42
+ next.setHours(0, 0, 0, 0);
43
+ if (next.getTime() <= now) {
44
+ next.setDate(next.getDate() + 1);
45
+ }
46
+ return next.getTime() - now;
47
+ }
48
+ if (s === "@weekly") {
49
+ next.setHours(0, 0, 0, 0);
50
+ if (next.getTime() <= now) {
51
+ next.setDate(next.getDate() + 1);
52
+ }
53
+ // Monday = day 1. Day-0 first guarantees strictly-future even on Mondays.
54
+ while (next.getDay() !== 1) {
55
+ next.setDate(next.getDate() + 1);
56
+ }
57
+ return next.getTime() - now;
58
+ }
59
+ if (s === "@monthly") {
60
+ next.setDate(1);
61
+ next.setHours(0, 0, 0, 0);
62
+ if (next.getTime() <= now) {
63
+ next.setMonth(next.getMonth() + 1);
64
+ }
65
+ return next.getTime() - now;
66
+ }
67
+ const stepMin = s.match(/^\*\/(\d{1,2})\s+\*\s+\*\s+\*\s+\*$/);
68
+ if (stepMin) {
69
+ const n = Number(stepMin[1]);
70
+ if (n < 1 || n > 59) {
71
+ throw new ScheduleParseError(s);
72
+ }
73
+ if (next.getTime() <= now) {
74
+ next.setMinutes(next.getMinutes() + 1);
75
+ }
76
+ while (next.getMinutes() % n !== 0) {
77
+ next.setMinutes(next.getMinutes() + 1);
78
+ }
79
+ return next.getTime() - now;
80
+ }
81
+ const hourlyAt = s.match(/^(\d{1,2})\s+\*\s+\*\s+\*\s+\*$/);
82
+ if (hourlyAt) {
83
+ const m = Number(hourlyAt[1]);
84
+ if (m > 59) {
85
+ throw new ScheduleParseError(s);
86
+ }
87
+ next.setMinutes(m);
88
+ if (next.getTime() <= now) {
89
+ next.setHours(next.getHours() + 1);
90
+ }
91
+ return next.getTime() - now;
92
+ }
93
+ const hourStep = s.match(/^0\s+\*\/(\d{1,2})\s+\*\s+\*\s+\*$/);
94
+ if (hourStep) {
95
+ const n = Number(hourStep[1]);
96
+ if (n < 1 || n > 23) {
97
+ throw new ScheduleParseError(s);
98
+ }
99
+ next.setMinutes(0);
100
+ if (next.getTime() <= now) {
101
+ next.setHours(next.getHours() + 1);
102
+ }
103
+ while (next.getHours() % n !== 0) {
104
+ next.setHours(next.getHours() + 1);
105
+ }
106
+ return next.getTime() - now;
107
+ }
108
+ const daily = s.match(/^(\d{1,2})\s+(\d{1,2})\s+\*\s+\*\s+\*$/);
109
+ if (daily) {
110
+ const m = Number(daily[1]);
111
+ const h = Number(daily[2]);
112
+ if (m > 59 || h > 23) {
113
+ throw new ScheduleParseError(s);
114
+ }
115
+ next.setMinutes(m);
116
+ next.setHours(h);
117
+ if (next.getTime() <= now) {
118
+ next.setDate(next.getDate() + 1);
119
+ }
120
+ return next.getTime() - now;
121
+ }
122
+ throw new ScheduleParseError(s);
123
+ }