clew-code 0.2.11 → 0.2.14
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/dist/main.js +2596 -2527
- package/docs/architecture.html +148 -148
- package/docs/architecture.th.html +79 -79
- package/docs/clew-code-architecture.html +6 -6
- package/docs/commands.html +225 -224
- package/docs/commands.th.html +132 -131
- package/docs/configuration.html +147 -147
- package/docs/configuration.th.html +108 -108
- package/docs/daemon.html +129 -129
- package/docs/daemon.th.html +73 -73
- package/docs/features/bridge-mode.html +99 -99
- package/docs/features/bridge-mode.th.html +90 -90
- package/docs/features/evals.html +182 -182
- package/docs/features/evals.th.html +90 -90
- package/docs/features/peer.html +178 -178
- package/docs/features/searxng-search.html +151 -151
- package/docs/features/searxng-search.th.html +95 -95
- package/docs/features/sentry-setup.html +157 -157
- package/docs/features/sentry-setup.th.html +97 -97
- package/docs/index.html +298 -299
- package/docs/index.th.html +292 -292
- package/docs/installation.html +105 -105
- package/docs/installation.th.html +105 -105
- package/docs/internals/growthbook-ab-testing.html +113 -113
- package/docs/internals/growthbook-ab-testing.th.html +81 -81
- package/docs/internals/hidden-features.html +175 -149
- package/docs/internals/hidden-features.th.html +135 -109
- package/docs/loop.html +181 -181
- package/docs/loop.th.html +227 -227
- package/docs/mcp.html +247 -247
- package/docs/mcp.th.html +207 -207
- package/docs/models.html +110 -111
- package/docs/models.th.html +61 -61
- package/docs/peer.html +236 -236
- package/docs/peer.th.html +280 -280
- package/docs/permission-model.html +102 -102
- package/docs/permission-model.th.html +67 -67
- package/docs/plugins.html +102 -102
- package/docs/plugins.th.html +79 -79
- package/docs/providers.html +126 -126
- package/docs/providers.th.html +80 -80
- package/docs/quick-start.html +93 -93
- package/docs/quick-start.th.html +1 -1
- package/docs/research-memory.html +82 -82
- package/docs/research-memory.th.html +72 -72
- package/docs/skills.html +117 -117
- package/docs/skills.th.html +90 -90
- package/docs/tools.html +170 -170
- package/docs/tools.th.html +84 -84
- package/docs/troubleshooting.html +106 -106
- package/docs/troubleshooting.th.html +85 -85
- package/package.json +162 -164
package/docs/daemon.html
CHANGED
|
@@ -1,129 +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
|
|
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
|
+
<!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 0.2.13 — 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
|
+
|
package/docs/daemon.th.html
CHANGED
|
@@ -1,73 +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
|
|
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
|
-
|
|
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 0.2.13 — โà¸à¹€à¸žà¸™à¸‹à¸à¸£à¹Œà¸ª</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
|
+
|