clew-code 0.2.6 → 0.2.8

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 (57) hide show
  1. package/README.md +292 -264
  2. package/dist/main.js +2835 -2950
  3. package/docs/architecture.html +148 -145
  4. package/docs/architecture.th.html +79 -78
  5. package/docs/clew-code-architecture.html +1125 -0
  6. package/docs/commands.html +224 -223
  7. package/docs/commands.th.html +131 -130
  8. package/docs/configuration.html +147 -145
  9. package/docs/configuration.th.html +108 -106
  10. package/docs/css/styles.css +48 -42
  11. package/docs/daemon.html +129 -128
  12. package/docs/daemon.th.html +73 -72
  13. package/docs/features/bridge-mode.html +99 -98
  14. package/docs/features/bridge-mode.th.html +90 -89
  15. package/docs/features/evals.html +182 -181
  16. package/docs/features/evals.th.html +90 -89
  17. package/docs/features/peer.html +178 -177
  18. package/docs/features/searxng-search.html +151 -150
  19. package/docs/features/searxng-search.th.html +95 -94
  20. package/docs/features/sentry-setup.html +157 -156
  21. package/docs/features/sentry-setup.th.html +97 -96
  22. package/docs/index.html +299 -298
  23. package/docs/index.th.html +292 -290
  24. package/docs/installation.html +105 -103
  25. package/docs/installation.th.html +105 -103
  26. package/docs/internals/growthbook-ab-testing.html +113 -112
  27. package/docs/internals/growthbook-ab-testing.th.html +81 -80
  28. package/docs/internals/hidden-features.html +149 -147
  29. package/docs/internals/hidden-features.th.html +109 -107
  30. package/docs/js/main.js +83 -3
  31. package/docs/loop.html +181 -180
  32. package/docs/loop.th.html +227 -226
  33. package/docs/mcp.html +247 -246
  34. package/docs/mcp.th.html +207 -206
  35. package/docs/models.html +111 -110
  36. package/docs/models.th.html +61 -60
  37. package/docs/peer.html +236 -235
  38. package/docs/peer.th.html +280 -279
  39. package/docs/permission-model.html +102 -101
  40. package/docs/permission-model.th.html +67 -66
  41. package/docs/plugins.html +102 -101
  42. package/docs/plugins.th.html +79 -78
  43. package/docs/providers.html +126 -117
  44. package/docs/providers.th.html +80 -78
  45. package/docs/quick-start.html +93 -92
  46. package/docs/quick-start.th.html +40 -39
  47. package/docs/research-memory.html +82 -79
  48. package/docs/research-memory.th.html +72 -71
  49. package/docs/skills.html +117 -116
  50. package/docs/skills.th.html +90 -89
  51. package/docs/tools.html +170 -169
  52. package/docs/tools.th.html +84 -83
  53. package/docs/troubleshooting.html +106 -105
  54. package/docs/troubleshooting.th.html +85 -84
  55. package/package.json +3 -1
  56. package/docs/taste.html +0 -436
  57. package/docs/taste.th.html +0 -236
@@ -8,36 +8,36 @@
8
8
 
9
9
  /* ── Theme Variables ──────────────────────────────────────────────────── */
10
10
  :root {
11
- --bg-deep: #06060b;
12
- --bg-primary: #0a0a0f;
13
- --bg-surface: #101018;
14
- --bg-card: #181825;
15
- --bg-hover: #1e1e2e;
16
- --bg-elevated: #22223a;
17
-
18
- --text-primary: #e8e8ed;
19
- --text-secondary: #9b9ba8;
20
- --text-tertiary: #6b6b7a;
21
- --text-inverse: #0a0a0f;
22
-
23
- --accent: #7c5cfc;
24
- --accent-hover:#9678ff;
25
- --accent-muted:rgba(124, 92, 252, 0.12);
26
- --accent-glow: rgba(124, 92, 252, 0.2);
27
-
28
- --code-bg: #0d0d14;
29
- --code-text: #d4d4dc;
30
- --code-border: rgba(255, 255, 255, 0.06);
31
-
32
- --border-subtle: rgba(255, 255, 255, 0.06);
33
- --border-default: rgba(255, 255, 255, 0.1);
34
- --border-accent: rgba(124, 92, 252, 0.3);
35
-
36
- --info: #5898f4;
37
- --info-bg: rgba(88, 152, 244, 0.08);
38
- --warn: #f4a858;
11
+ --bg-deep: #07090d;
12
+ --bg-primary: #0b0e13;
13
+ --bg-surface: #11161d;
14
+ --bg-card: #151b24;
15
+ --bg-hover: #1b2430;
16
+ --bg-elevated: #202a36;
17
+
18
+ --text-primary: #eef2f6;
19
+ --text-secondary: #a7b1be;
20
+ --text-tertiary: #6f7b89;
21
+ --text-inverse: #071016;
22
+
23
+ --accent: #59d1c9;
24
+ --accent-hover:#79e1d9;
25
+ --accent-muted:rgba(89, 209, 201, 0.12);
26
+ --accent-glow: rgba(89, 209, 201, 0.2);
27
+
28
+ --code-bg: #080b10;
29
+ --code-text: #dce6ef;
30
+ --code-border: rgba(148, 163, 184, 0.16);
31
+
32
+ --border-subtle: rgba(148, 163, 184, 0.13);
33
+ --border-default: rgba(148, 163, 184, 0.22);
34
+ --border-accent: rgba(89, 209, 201, 0.34);
35
+
36
+ --info: #70a8ff;
37
+ --info-bg: rgba(112, 168, 255, 0.08);
38
+ --warn: #f3bc5f;
39
39
  --warn-bg: rgba(244, 168, 88, 0.08);
40
- --tip: #58c47c;
40
+ --tip: #72d38f;
41
41
  --tip-bg: rgba(88, 196, 124, 0.08);
42
42
  --danger: #e85454;
43
43
 
@@ -51,7 +51,7 @@
51
51
  --text-lg: 1.125rem;
52
52
  --text-xl: 1.5rem;
53
53
  --text-2xl: 2rem;
54
- --text-3xl: 2.75rem;
54
+ --text-3xl: 3.1rem;
55
55
 
56
56
  --leading-tight: 1.2;
57
57
  --leading-normal: 1.6;
@@ -72,7 +72,7 @@
72
72
  --header-h: 56px;
73
73
  --sidebar-w: 260px;
74
74
  --toc-w: 220px;
75
- --content-max: 820px;
75
+ --content-max: 900px;
76
76
 
77
77
  --z-header: 100;
78
78
  --z-sidebar: 90;
@@ -91,7 +91,9 @@ body {
91
91
  font-size: var(--text-base);
92
92
  line-height: var(--leading-normal);
93
93
  color: var(--text-primary);
94
- background: var(--bg-primary);
94
+ background:
95
+ linear-gradient(180deg, rgba(21, 27, 36, 0.98) 0%, var(--bg-primary) 240px),
96
+ var(--bg-primary);
95
97
  min-height: 100vh;
96
98
  }
97
99
 
@@ -132,7 +134,7 @@ kbd {
132
134
  top: 0; left: 0; right: 0;
133
135
  height: var(--header-h);
134
136
  z-index: var(--z-header);
135
- background: rgba(10, 10, 15, 0.85);
137
+ background: rgba(7, 9, 13, 0.86);
136
138
  backdrop-filter: blur(16px);
137
139
  -webkit-backdrop-filter: blur(16px);
138
140
  border-bottom: 1px solid var(--border-subtle);
@@ -157,7 +159,7 @@ kbd {
157
159
  font-size: 1rem;
158
160
  color: var(--text-primary);
159
161
  text-decoration: none;
160
- letter-spacing: -0.02em;
162
+ letter-spacing: 0;
161
163
  }
162
164
  .logo:hover { opacity: 0.85; text-decoration: none; }
163
165
 
@@ -219,7 +221,9 @@ kbd {
219
221
  top: var(--header-h); left: 0; bottom: 0;
220
222
  width: var(--sidebar-w);
221
223
  z-index: var(--z-sidebar);
222
- background: var(--bg-surface);
224
+ background: rgba(12, 16, 22, 0.96);
225
+ backdrop-filter: blur(16px);
226
+ -webkit-backdrop-filter: blur(16px);
223
227
  border-right: 1px solid var(--border-subtle);
224
228
  overflow-y: auto;
225
229
  padding: var(--space-lg) 0 var(--space-2xl);
@@ -343,7 +347,7 @@ kbd {
343
347
  font-family: var(--font-display);
344
348
  font-size: var(--text-2xl);
345
349
  font-weight: 700;
346
- letter-spacing: -0.02em;
350
+ letter-spacing: 0;
347
351
  margin-bottom: var(--space-sm);
348
352
  color: var(--text-primary);
349
353
  }
@@ -352,7 +356,7 @@ kbd {
352
356
  font-family: var(--font-display);
353
357
  font-size: var(--text-xl);
354
358
  font-weight: 700;
355
- letter-spacing: -0.01em;
359
+ letter-spacing: 0;
356
360
  margin: var(--space-2xl) 0 var(--space-md);
357
361
  color: var(--text-primary);
358
362
  }
@@ -543,7 +547,7 @@ kbd {
543
547
  font-size: var(--text-3xl);
544
548
  font-weight: 700;
545
549
  line-height: var(--leading-tight);
546
- letter-spacing: -0.03em;
550
+ letter-spacing: 0;
547
551
  margin-bottom: var(--space-md);
548
552
  color: var(--text-primary);
549
553
  }
@@ -612,7 +616,7 @@ kbd {
612
616
  .feature-card {
613
617
  padding: var(--space-lg);
614
618
  border-radius: 8px;
615
- background: var(--bg-card);
619
+ background: rgba(21, 27, 36, 0.9);
616
620
  border: 1px solid var(--border-subtle);
617
621
  transition: all var(--duration-base) ease;
618
622
  }
@@ -659,7 +663,7 @@ kbd {
659
663
  text-align: center;
660
664
  padding: var(--space-lg) var(--space-md);
661
665
  border-radius: 8px;
662
- background: var(--bg-card);
666
+ background: rgba(21, 27, 36, 0.9);
663
667
  border: 1px solid var(--border-subtle);
664
668
  }
665
669
 
@@ -667,7 +671,7 @@ kbd {
667
671
  font-family: var(--font-display);
668
672
  font-size: 1.75rem;
669
673
  font-weight: 700;
670
- letter-spacing: -0.02em;
674
+ letter-spacing: 0;
671
675
  color: var(--accent);
672
676
  line-height: 1.1;
673
677
  margin-bottom: 4px;
@@ -682,6 +686,7 @@ kbd {
682
686
  border-radius: 8px;
683
687
  overflow: hidden;
684
688
  margin: var(--space-xl) 0;
689
+ box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
685
690
  }
686
691
 
687
692
  .terminal-bar {
@@ -712,9 +717,10 @@ kbd {
712
717
  line-height: 1.6;
713
718
  color: var(--code-text);
714
719
  overflow-x: auto;
720
+ white-space: pre;
715
721
  }
716
722
 
717
- .terminal-body .line { display: block; white-space: pre-wrap; }
723
+ .terminal-body .line { display: block; white-space: pre; }
718
724
  .terminal-body .prompt { color: var(--accent); }
719
725
  .terminal-body .cmd { color: var(--text-primary); }
720
726
  .terminal-body .output { color: var(--text-tertiary); }
package/docs/daemon.html CHANGED
@@ -1,128 +1,129 @@
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.0">
6
- <title>Autonomous Daemon Clew</title>
7
- <meta name="description" content="24/7 autonomous background execution task queue, agent loop, supervisor integration, and recurring tasks.">
8
- <link rel="preconnect" href="https://fonts.googleapis.com">
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
- </head>
14
- <body>
15
- <header class="header"></header>
16
- <div class="app">
17
- <aside class="sidebar" id="sidebar"></aside>
18
- <div class="sidebar-overlay" id="sidebarOverlay"></div>
19
- <div class="content-wrap">
20
- <main class="content">
21
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Daemon Mode</span></div>
22
- <h1>Autonomous Daemon Mode</h1>
23
- <p class="section-subtitle">Run Clew as a 24/7 background daemon task queue, agent loop, health checks, and supervisor auto-respawn for unattended autonomous operation.</p>
24
-
25
- <p>The autonomous system lives in <code>src/services/autonomous/</code> and consists of four main components: the <strong>task queue</strong>, <strong>agent loop</strong>, <strong>daemon entry point</strong>, and <strong>supervisor integration</strong>.</p>
26
-
27
- <h2>Architecture</h2>
28
- <pre><code> + Task Queue (taskQueue.ts)
29
- | File-backed persistent queue
30
- | Priorities Leases Dead-letter
31
- |
32
- + Agent Loop (agentLoop.ts)
33
- | Dequeue Spawn worker Monitor Retry
34
- |
35
- + Daemon Mode (daemonMode.ts)
36
- | Background process entry point
37
- |
38
- + Supervisor (supervisorIntegration.ts)
39
- Health checks Auto-respawn State tracking</code></pre>
40
-
41
- <h2>Task Queue</h2>
42
- <p>The file-backed persistent queue (<code>src/services/autonomous/taskQueue.ts</code>) is the foundation of the autonomous system:</p>
43
- <ul>
44
- <li><strong>Persistence</strong> Tasks survive process restarts via on-disk storage</li>
45
- <li><strong>Priorities</strong> Urgent tasks skip ahead in the queue</li>
46
- <li><strong>Leases</strong> Tasks are leased to workers with TTL; expired leases are retried</li>
47
- <li><strong>Dead-letter</strong> Tasks that exhaust retries are moved to dead-letter for inspection</li>
48
- <li><strong>Scheduling</strong> One-shot and recurring (cron) tasks supported</li>
49
- </ul>
50
-
51
- <h2>Agent Loop</h2>
52
- <p>The continuous agent loop (<code>src/services/autonomous/agentLoop.ts</code>) runs in the background:</p>
53
- <ol>
54
- <li><strong>Dequeue</strong> Pull the highest-priority ready task</li>
55
- <li><strong>Spawn worker</strong> Launch a worker session for the task</li>
56
- <li><strong>Monitor</strong> Track progress, streaming output, and resource usage</li>
57
- <li><strong>Retry or complete</strong> On failure, retry with backoff; on success, record result</li>
58
- <li><strong>Repeat</strong> Check for new tasks and repeat the cycle</li>
59
- </ol>
60
-
61
- <h2>Daemon Entry Point</h2>
62
- <p><code>src/services/autonomous/daemonMode.ts</code> provides the background process entry point. When started in daemon mode, Clew:</p>
63
- <ul>
64
- <li>Detaches from the terminal and runs as a background process</li>
65
- <li>Logs output to a configurable log file</li>
66
- <li>Responds to signals for graceful shutdown</li>
67
- <li>Reports status to the supervisor for health tracking</li>
68
- </ul>
69
-
70
- <h2>Supervisor Integration</h2>
71
- <p><code>src/services/autonomous/supervisorIntegration.ts</code> ensures the daemon stays running:</p>
72
- <ul>
73
- <li><strong>Health checks</strong> Periodic heartbeat and resource checks</li>
74
- <li><strong>Auto-respawn</strong> Automatic restart on unexpected exit</li>
75
- <li><strong>State tracking</strong> Current status, running tasks, error counts</li>
76
- <li><strong>Graceful degradation</strong> Reduces polling frequency on repeated failures</li>
77
- </ul>
78
-
79
- <h2>Commands</h2>
80
- <table>
81
- <tr><th>Command</th><th>Description</th></tr>
82
- <tr><td><code>/daemon</code></td><td>Open interactive control panel; subcommands: start, stop, status, restart</td></tr>
83
- <tr><td><code>/task</code></td><td>Create scheduled or recurring tasks via interactive form</td></tr>
84
- <tr><td><code>/task list</code></td><td>List queued, running, and completed tasks</td></tr>
85
- <tr><td><code>/loop</code></td><td>Run a prompt or command on a recurring interval (<code>/loop 5m /check-deploy</code>)</td></tr>
86
- <tr><td><code>/agents</code></td><td>Manage agent configurations and daemon worker pools</td></tr>
87
- <tr><td><code>/tasks</code></td><td>List and manage background agent tasks</td></tr>
88
- </table>
89
-
90
- <h2>Task Scheduling</h2>
91
- <p>Scheduled tasks can be created through the interactive <code>/task</code> form or programmatically. Storage modes:</p>
92
- <ul>
93
- <li><strong>Durable</strong> Persists to <code>.claude/scheduled_tasks.json</code>, survives restarts</li>
94
- <li><strong>Session-only</strong> Kept in memory for the current session only</li>
95
- </ul>
96
-
97
- <p>Recurring tasks auto-expire after 30 days. One-shot tasks auto-delete after firing. Custom cron expressions are supported (standard 5-field format).</p>
98
-
99
- <pre><code>/task
100
- Name: Deploy health check
101
- Schedule: Daily
102
- Time: 09:00
103
- Prompt: Check deployment status and report
104
- Storage: Durable</code></pre>
105
-
106
- <h2>Architecture Files</h2>
107
- <table>
108
- <tr><th>File</th><th>Role</th></tr>
109
- <tr><td><code>src/services/autonomous/taskQueue.ts</code></td><td>Persistent task queue with priorities, leases, dead-letter</td></tr>
110
- <tr><td><code>src/services/autonomous/agentLoop.ts</code></td><td>Continuous 24/7 agent loop</td></tr>
111
- <tr><td><code>src/services/autonomous/daemonMode.ts</code></td><td>Background daemon entry point</td></tr>
112
- <tr><td><code>src/services/autonomous/supervisorIntegration.ts</code></td><td>Health checks, auto-respawn, state tracking</td></tr>
113
- </table>
114
-
115
- <footer class="footer">
116
- <span>Clew Code v0.2.4 Open Source</span>
117
- <div class="footer-links">
118
- <a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
119
- <a href="https://github.com/JonusNattapong/ClewCode/issues">Issues</a>
120
- </div>
121
- </footer>
122
- </main>
123
- <nav class="toc-sidebar"></nav>
124
- </div>
125
- </div>
126
- <script src="js/main.js"></script>
127
- </body>
128
- </html>
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.0">
6
+ <title>Autonomous Daemon — Clew</title>
7
+ <meta name="description" content="24/7 autonomous background execution — task queue, agent loop, supervisor integration, and recurring tasks.">
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <link rel="stylesheet" href="css/styles.css">
12
+ <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
+ </head>
14
+ <body>
15
+ <header class="header"></header>
16
+ <div class="app">
17
+ <aside class="sidebar" id="sidebar"></aside>
18
+ <div class="sidebar-overlay" id="sidebarOverlay"></div>
19
+ <div class="content-wrap">
20
+ <main class="content">
21
+ <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Daemon Mode</span></div>
22
+ <h1>Autonomous Daemon Mode</h1>
23
+ <p class="section-subtitle">Run Clew as a 24/7 background daemon — task queue, agent loop, health checks, and supervisor auto-respawn for unattended autonomous operation.</p>
24
+
25
+ <p>The autonomous system lives in <code>src/services/autonomous/</code> and consists of four main components: the <strong>task queue</strong>, <strong>agent loop</strong>, <strong>daemon entry point</strong>, and <strong>supervisor integration</strong>.</p>
26
+
27
+ <h2>Architecture</h2>
28
+ <pre><code> + Task Queue (taskQueue.ts)
29
+ | File-backed persistent queue
30
+ | Priorities Leases Dead-letter
31
+ |
32
+ + Agent Loop (agentLoop.ts)
33
+ | Dequeue Spawn worker Monitor Retry
34
+ |
35
+ + Daemon Mode (daemonMode.ts)
36
+ | Background process entry point
37
+ |
38
+ + Supervisor (supervisorIntegration.ts)
39
+ Health checks Auto-respawn State tracking</code></pre>
40
+
41
+ <h2>Task Queue</h2>
42
+ <p>The file-backed persistent queue (<code>src/services/autonomous/taskQueue.ts</code>) is the foundation of the autonomous system:</p>
43
+ <ul>
44
+ <li><strong>Persistence</strong> — Tasks survive process restarts via on-disk storage</li>
45
+ <li><strong>Priorities</strong> — Urgent tasks skip ahead in the queue</li>
46
+ <li><strong>Leases</strong> — Tasks are leased to workers with TTL; expired leases are retried</li>
47
+ <li><strong>Dead-letter</strong> — Tasks that exhaust retries are moved to dead-letter for inspection</li>
48
+ <li><strong>Scheduling</strong> — One-shot and recurring (cron) tasks supported</li>
49
+ </ul>
50
+
51
+ <h2>Agent Loop</h2>
52
+ <p>The continuous agent loop (<code>src/services/autonomous/agentLoop.ts</code>) runs in the background:</p>
53
+ <ol>
54
+ <li><strong>Dequeue</strong> — Pull the highest-priority ready task</li>
55
+ <li><strong>Spawn worker</strong> — Launch a worker session for the task</li>
56
+ <li><strong>Monitor</strong> — Track progress, streaming output, and resource usage</li>
57
+ <li><strong>Retry or complete</strong> — On failure, retry with backoff; on success, record result</li>
58
+ <li><strong>Repeat</strong> — Check for new tasks and repeat the cycle</li>
59
+ </ol>
60
+
61
+ <h2>Daemon Entry Point</h2>
62
+ <p><code>src/services/autonomous/daemonMode.ts</code> provides the background process entry point. When started in daemon mode, Clew:</p>
63
+ <ul>
64
+ <li>Detaches from the terminal and runs as a background process</li>
65
+ <li>Logs output to a configurable log file</li>
66
+ <li>Responds to signals for graceful shutdown</li>
67
+ <li>Reports status to the supervisor for health tracking</li>
68
+ </ul>
69
+
70
+ <h2>Supervisor Integration</h2>
71
+ <p><code>src/services/autonomous/supervisorIntegration.ts</code> ensures the daemon stays running:</p>
72
+ <ul>
73
+ <li><strong>Health checks</strong> — Periodic heartbeat and resource checks</li>
74
+ <li><strong>Auto-respawn</strong> — Automatic restart on unexpected exit</li>
75
+ <li><strong>State tracking</strong> — Current status, running tasks, error counts</li>
76
+ <li><strong>Graceful degradation</strong> — Reduces polling frequency on repeated failures</li>
77
+ </ul>
78
+
79
+ <h2>Commands</h2>
80
+ <table>
81
+ <tr><th>Command</th><th>Description</th></tr>
82
+ <tr><td><code>/daemon</code></td><td>Open interactive control panel; subcommands: start, stop, status, restart</td></tr>
83
+ <tr><td><code>/task</code></td><td>Create scheduled or recurring tasks via interactive form</td></tr>
84
+ <tr><td><code>/task list</code></td><td>List queued, running, and completed tasks</td></tr>
85
+ <tr><td><code>/loop</code></td><td>Run a prompt or command on a recurring interval (<code>/loop 5m /check-deploy</code>)</td></tr>
86
+ <tr><td><code>/agents</code></td><td>Manage agent configurations and daemon worker pools</td></tr>
87
+ <tr><td><code>/tasks</code></td><td>List and manage background agent tasks</td></tr>
88
+ </table>
89
+
90
+ <h2>Task Scheduling</h2>
91
+ <p>Scheduled tasks can be created through the interactive <code>/task</code> form or programmatically. Storage modes:</p>
92
+ <ul>
93
+ <li><strong>Durable</strong> — Persists to <code>.claude/scheduled_tasks.json</code>, survives restarts</li>
94
+ <li><strong>Session-only</strong> — Kept in memory for the current session only</li>
95
+ </ul>
96
+
97
+ <p>Recurring tasks auto-expire after 30 days. One-shot tasks auto-delete after firing. Custom cron expressions are supported (standard 5-field format).</p>
98
+
99
+ <pre><code>/task
100
+ Name: Deploy health check
101
+ Schedule: Daily
102
+ Time: 09:00
103
+ Prompt: Check deployment status and report
104
+ Storage: Durable</code></pre>
105
+
106
+ <h2>Architecture Files</h2>
107
+ <table>
108
+ <tr><th>File</th><th>Role</th></tr>
109
+ <tr><td><code>src/services/autonomous/taskQueue.ts</code></td><td>Persistent task queue with priorities, leases, dead-letter</td></tr>
110
+ <tr><td><code>src/services/autonomous/agentLoop.ts</code></td><td>Continuous 24/7 agent loop</td></tr>
111
+ <tr><td><code>src/services/autonomous/daemonMode.ts</code></td><td>Background daemon entry point</td></tr>
112
+ <tr><td><code>src/services/autonomous/supervisorIntegration.ts</code></td><td>Health checks, auto-respawn, state tracking</td></tr>
113
+ </table>
114
+
115
+ <footer class="footer">
116
+ <span>Clew Code v0.2.7 — Open Source</span>
117
+ <div class="footer-links">
118
+ <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
119
+ <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
120
+ </div>
121
+ </footer>
122
+ </main>
123
+ <nav class="toc-sidebar"></nav>
124
+ </div>
125
+ </div>
126
+ <script src="js/main.js"></script>
127
+ </body>
128
+ </html>
129
+
@@ -1,72 +1,73 @@
1
- <!DOCTYPE html>
2
- <html lang="th">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Daemon อัตโนมัติ Clew</title>
7
- <meta name="description" content="การดำเนินการพื้นหลังอัตโนมัติ 24/7 คิวงาน, วนซ้ำเอเจนต์, การรวมผู้ดูแล, และงานที่ทำซ้ำ">
8
- <link rel="preconnect" href="https://fonts.googleapis.com">
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
- </head>
14
- <body>
15
- <header class="header"></header>
16
- <div class="app">
17
- <aside class="sidebar" id="sidebar"></aside>
18
- <div class="sidebar-overlay" id="sidebarOverlay"></div>
19
- <div class="content-wrap">
20
- <main class="content">
21
- <div class="breadcrumbs"><a href="index.th.html">หน้าแรก</a><span class="sep">/</span><span>โหมด Daemon</span></div>
22
- <h1>โหมด Daemon อัตโนมัติ</h1>
23
- <p class="section-subtitle">รัน Clew เป็น daemon พื้นหลัง 24/7 คิวงาน, วนซ้ำเอเจนต์, การตรวจสอบสุขภาพ, และการเริ่มใหม่โดยอัตโนมัติ</p>
24
-
25
- <p>ระบบอัตโนมัติอยู่ใน <code>src/services/autonomous/</code> และประกอบด้วยสี่องค์ประกอบหลัก: <strong>คิวงาน</strong>, <strong>วนซ้ำเอเจนต์</strong>, <strong>จุดเข้า daemon</strong>, และ <strong>การรวมผู้ดูแล</strong></p>
26
-
27
- <h2>สถาปัตยกรรม</h2>
28
- <pre><code> + คิวงาน (taskQueue.ts)
29
- | คิวถาวรแบบไฟล์
30
- | ลำดับความสำคัญ การเช่า จดหมายตาย
31
- |
32
- + วนซ้ำเอเจนต์ (agentLoop.ts)
33
- | ดึงจากคิว สร้างเวิร์กเกอร์ ติดตาม ลองใหม่
34
- |
35
- + โหมด Daemon (daemonMode.ts)
36
- | จุดเข้ากระบวนการพื้นหลัง
37
- |
38
- + ผู้ดูแล (supervisorIntegration.ts)
39
- ตรวจสอบสุขภาพ เริ่มใหม่อัตโนมัติ ติดตามสถานะ</code></pre>
40
-
41
- <h2>คิวงาน</h2>
42
- <p>คิวถาวรแบบไฟล์ (<code>src/services/autonomous/taskQueue.ts</code>) เป็นรากฐานของระบบอัตโนมัติ:</p>
43
- <ul>
44
- <li><strong>ความคงทน</strong> งานอยู่รอดการรีสตาร์ทกระบวนการผ่านการจัดเก็บในดิสก์</li>
45
- <li><strong>ลำดับความสำคัญ</strong> งานเร่งด่วนข้ามคิวไปก่อน</li>
46
- <li><strong>การเช่า</strong> งานถูกเช่าให้เวิร์กเกอร์พร้อม TTL; การเช่าที่หมดอายุถูกลองใหม่</li>
47
- <li><strong>จดหมายตาย</strong> งานที่ใช้การลองจนหมดถูกย้ายไปตรวจสอบ</li>
48
- </ul>
49
-
50
- <h2>คำสั่ง</h2>
51
- <table>
52
- <tr><th>คำสั่ง</th><th>คำอธิบาย</th></tr>
53
- <tr><td><code>/daemon</code></td><td>เปิดแผงควบคุมแบบโต้ตอบ; คำสั่งย่อย: start, stop, status, restart</td></tr>
54
- <tr><td><code>/task</code></td><td>สร้างงานตามกำหนดการผ่านแบบฟอร์มโต้ตอบ</td></tr>
55
- <tr><td><code>/loop</code></td><td>รันคำสั่งซ้ำตามช่วงเวลา</td></tr>
56
- <tr><td><code>/agents</code></td><td>จัดการการตั้งค่าเอเจนต์และพูลเวิร์กเกอร์ daemon</td></tr>
57
- </table>
58
-
59
- <footer class="footer">
60
- <span>Clew Code v0.2.4 โอเพนซอร์ส</span>
61
- <div class="footer-links">
62
- <a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
63
- <a href="https://github.com/JonusNattapong/ClewCode/issues">ปัญหา</a>
64
- </div>
65
- </footer>
66
- </main>
67
- <nav class="toc-sidebar"></nav>
68
- </div>
69
- </div>
70
- <script src="js/main.js"></script>
71
- </body>
72
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="th">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Daemon อัตโนมัติ — Clew</title>
7
+ <meta name="description" content="การดำเนินการพื้นหลังอัตโนมัติ 24/7 — คิวงาน, วนซ้ำเอเจนต์, การรวมผู้ดูแล, และงานที่ทำซ้ำ">
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <link rel="stylesheet" href="css/styles.css">
12
+ <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
+ </head>
14
+ <body>
15
+ <header class="header"></header>
16
+ <div class="app">
17
+ <aside class="sidebar" id="sidebar"></aside>
18
+ <div class="sidebar-overlay" id="sidebarOverlay"></div>
19
+ <div class="content-wrap">
20
+ <main class="content">
21
+ <div class="breadcrumbs"><a href="index.th.html">หน้าแรก</a><span class="sep">/</span><span>โหมด Daemon</span></div>
22
+ <h1>โหมด Daemon อัตโนมัติ</h1>
23
+ <p class="section-subtitle">รัน Clew เป็น daemon พื้นหลัง 24/7 — คิวงาน, วนซ้ำเอเจนต์, การตรวจสอบสุขภาพ, และการเริ่มใหม่โดยอัตโนมัติ</p>
24
+
25
+ <p>ระบบอัตโนมัติอยู่ใน <code>src/services/autonomous/</code> และประกอบด้วยสี่องค์ประกอบหลัก: <strong>คิวงาน</strong>, <strong>วนซ้ำเอเจนต์</strong>, <strong>จุดเข้า daemon</strong>, และ <strong>การรวมผู้ดูแล</strong></p>
26
+
27
+ <h2>สถาปัตยกรรม</h2>
28
+ <pre><code> + คิวงาน (taskQueue.ts)
29
+ | คิวถาวรแบบไฟล์
30
+ | ลำดับความสำคัญ การเช่า จดหมายตาย
31
+ |
32
+ + วนซ้ำเอเจนต์ (agentLoop.ts)
33
+ | ดึงจากคิว สร้างเวิร์กเกอร์ ติดตาม ลองใหม่
34
+ |
35
+ + โหมด Daemon (daemonMode.ts)
36
+ | จุดเข้ากระบวนการพื้นหลัง
37
+ |
38
+ + ผู้ดูแล (supervisorIntegration.ts)
39
+ ตรวจสอบสุขภาพ เริ่มใหม่อัตโนมัติ ติดตามสถานะ</code></pre>
40
+
41
+ <h2>คิวงาน</h2>
42
+ <p>คิวถาวรแบบไฟล์ (<code>src/services/autonomous/taskQueue.ts</code>) เป็นรากฐานของระบบอัตโนมัติ:</p>
43
+ <ul>
44
+ <li><strong>ความคงทน</strong> — งานอยู่รอดการรีสตาร์ทกระบวนการผ่านการจัดเก็บในดิสก์</li>
45
+ <li><strong>ลำดับความสำคัญ</strong> — งานเร่งด่วนข้ามคิวไปก่อน</li>
46
+ <li><strong>การเช่า</strong> — งานถูกเช่าให้เวิร์กเกอร์พร้อม TTL; การเช่าที่หมดอายุถูกลองใหม่</li>
47
+ <li><strong>จดหมายตาย</strong> — งานที่ใช้การลองจนหมดถูกย้ายไปตรวจสอบ</li>
48
+ </ul>
49
+
50
+ <h2>คำสั่ง</h2>
51
+ <table>
52
+ <tr><th>คำสั่ง</th><th>คำอธิบาย</th></tr>
53
+ <tr><td><code>/daemon</code></td><td>เปิดแผงควบคุมแบบโต้ตอบ; คำสั่งย่อย: start, stop, status, restart</td></tr>
54
+ <tr><td><code>/task</code></td><td>สร้างงานตามกำหนดการผ่านแบบฟอร์มโต้ตอบ</td></tr>
55
+ <tr><td><code>/loop</code></td><td>รันคำสั่งซ้ำตามช่วงเวลา</td></tr>
56
+ <tr><td><code>/agents</code></td><td>จัดการการตั้งค่าเอเจนต์และพูลเวิร์กเกอร์ daemon</td></tr>
57
+ </table>
58
+
59
+ <footer class="footer">
60
+ <span>Clew Code v0.2.7 — โอเพนซอร์ส</span>
61
+ <div class="footer-links">
62
+ <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
63
+ <a href="https://github.com/ClewCode/ClewCode/issues">ปัญหา</a>
64
+ </div>
65
+ </footer>
66
+ </main>
67
+ <nav class="toc-sidebar"></nav>
68
+ </div>
69
+ </div>
70
+ <script src="js/main.js"></script>
71
+ </body>
72
+ </html>
73
+