metame-cli 1.5.8 → 1.5.10

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/scripts/daemon.js CHANGED
@@ -146,6 +146,7 @@ const { createAgentCommandHandler } = require('./daemon-agent-commands');
146
146
  const { createSessionCommandHandler } = require('./daemon-session-commands');
147
147
  const { createSessionStore } = require('./daemon-session-store');
148
148
  const { createCheckpointUtils } = require('./daemon-checkpoints');
149
+ const { createWorktreeUtils } = require('./daemon-worktrees');
149
150
  const { createBridgeStarter } = require('./daemon-bridges');
150
151
  const { buildTeamRosterHint, buildEnrichedPrompt, updateDispatchContextFiles } = require('./daemon-team-dispatch');
151
152
  const {
@@ -164,6 +165,8 @@ const { createNotifier } = require('./daemon-notify');
164
165
  const { createClaudeEngine } = require('./daemon-claude-engine');
165
166
  const { createEngineRuntimeFactory, detectDefaultEngine, resolveEngineModel, ENGINE_MODEL_CONFIG } = require('./daemon-engine-runtime');
166
167
  const { createCommandRouter } = require('./daemon-command-router');
168
+ const { createMessagePipeline } = require('./daemon-message-pipeline');
169
+ const { createWarmPool } = require('./daemon-warm-pool');
167
170
  const { createTaskScheduler } = require('./daemon-task-scheduler');
168
171
  const { createAgentTools } = require('./daemon-agent-tools');
169
172
  if (!yaml) {
@@ -234,6 +237,11 @@ const {
234
237
  cleanupCheckpoints,
235
238
  } = createCheckpointUtils({ execSync, execFile, path, log });
236
239
 
240
+ const {
241
+ resolveWorktreeKey: _resolveWorktreeKey,
242
+ getOrCreateWorktree,
243
+ } = createWorktreeUtils({ fs, path, execFile, log, HOME });
244
+
237
245
  // ---------------------------------------------------------
238
246
  // CONFIG & STATE
239
247
  // ---------------------------------------------------------
@@ -2154,6 +2162,9 @@ const { handleSessionCommand } = createSessionCommandHandler({
2154
2162
  // Message queue for messages received while a task is running
2155
2163
  const messageQueue = new Map(); // chatId -> { messages: string[], notified: false }
2156
2164
 
2165
+ // Warm process pool for eliminating Claude CLI cold-start latency
2166
+ const warmPool = createWarmPool({ log });
2167
+
2157
2168
  const { spawnClaudeAsync, askClaude } = createClaudeEngine({
2158
2169
  fs,
2159
2170
  path,
@@ -2199,6 +2210,7 @@ const { spawnClaudeAsync, askClaude } = createClaudeEngine({
2199
2210
  fallbackThrottleMs: FALLBACK_THROTTLE_MS,
2200
2211
  getEngineRuntime,
2201
2212
  getDefaultEngine,
2213
+ warmPool,
2202
2214
  });
2203
2215
 
2204
2216
  const agentTools = createAgentTools({
@@ -2269,6 +2281,9 @@ const { handleAgentCommand } = createAgentCommandHandler({
2269
2281
  // Caffeinate process for /nosleep toggle (macOS only)
2270
2282
  let caffeinateProcess = null;
2271
2283
 
2284
+ // pipeline ref — late-bound after createMessagePipeline (circular: router needs pipeline, pipeline needs handleCommand)
2285
+ const _pipelineRef = { current: null };
2286
+
2272
2287
  const { handleExecCommand } = createExecCommandHandler({
2273
2288
  fs,
2274
2289
  path,
@@ -2276,7 +2291,7 @@ const { handleExecCommand } = createExecCommandHandler({
2276
2291
  HOME,
2277
2292
  checkCooldown,
2278
2293
  activeProcesses,
2279
- messageQueue,
2294
+ pipeline: _pipelineRef,
2280
2295
  findTask,
2281
2296
  checkPrecondition,
2282
2297
  buildProfilePreamble,
@@ -2303,7 +2318,7 @@ const { handleOpsCommand } = createOpsCommandHandler({
2303
2318
  log,
2304
2319
  loadConfig,
2305
2320
  loadState,
2306
- messageQueue,
2321
+ pipeline: _pipelineRef,
2307
2322
  activeProcesses,
2308
2323
  getSession,
2309
2324
  getSessionForEngine,
@@ -2338,7 +2353,7 @@ const { handleCommand } = createCommandRouter({
2338
2353
  providerMod,
2339
2354
  getNoSleepProcess: () => caffeinateProcess,
2340
2355
  activeProcesses,
2341
- messageQueue,
2356
+ pipeline: _pipelineRef,
2342
2357
  sleep,
2343
2358
  log,
2344
2359
  agentTools,
@@ -2351,6 +2366,15 @@ const { handleCommand } = createCommandRouter({
2351
2366
  // Bind handleCommand for agent dispatch (must come after handleCommand definition)
2352
2367
  setDispatchHandler(handleCommand);
2353
2368
 
2369
+ // Message pipeline: per-chatId serial execution
2370
+ const pipeline = createMessagePipeline({
2371
+ activeProcesses,
2372
+ handleCommand,
2373
+ resetCooldown,
2374
+ log,
2375
+ });
2376
+ _pipelineRef.current = pipeline;
2377
+
2354
2378
  // ---------------------------------------------------------
2355
2379
  // BOT BRIDGES
2356
2380
  // ---------------------------------------------------------
@@ -2366,11 +2390,13 @@ const { startTelegramBridge, startFeishuBridge, startImessageBridge, startSiriBr
2366
2390
  getSession,
2367
2391
  restoreSessionFromReply,
2368
2392
  handleCommand,
2393
+ pipeline,
2369
2394
  pendingActivations,
2370
2395
  activeProcesses,
2371
2396
  messageQueue,
2372
2397
  sendRemoteDispatch,
2373
2398
  handleRemoteDispatchMessage,
2399
+ getOrCreateWorktree,
2374
2400
  });
2375
2401
 
2376
2402
  const { killExistingDaemon, writePid, cleanPid } = createPidManager({
@@ -2723,6 +2749,8 @@ async function main() {
2723
2749
  if (feishuBridge) feishuBridge.stop();
2724
2750
  // Stop QMD semantic search daemon if it was started
2725
2751
  try { require('./qmd-client').stopDaemon(); } catch { /* ignore */ }
2752
+ // Release warm pool processes before killing active ones
2753
+ warmPool.releaseAll();
2726
2754
  // Kill all tracked engine process groups before exiting (covers sub-agents too)
2727
2755
  for (const [cid, proc] of activeProcesses) {
2728
2756
  proc.aborted = true;
@@ -0,0 +1,72 @@
1
+ # 未被 daemon.js 直接引用的脚本文件审查
2
+
3
+ > 审查日期: 2026-03-17
4
+ > 目的: 确认哪些文件是活跃的、哪些可以安全删除
5
+
6
+ ---
7
+
8
+ ## 分类结果
9
+
10
+ ### ACTIVE — 被其他活跃模块间接引用(无需处理)
11
+
12
+ | 文件 | 引用方 | 说明 |
13
+ |------|--------|------|
14
+ | `session-analytics.js` | daemon-claude-engine, distill, memory-extract, session-summarize | 会话分析核心库 |
15
+ | `mentor-engine.js` | daemon-claude-engine, daemon-admin-commands | AI 导师引擎 |
16
+ | `intent-registry.js` | daemon-claude-engine, hooks/intent-engine | 意图识别注册表 |
17
+ | `daemon-command-session-route.js` | daemon-exec-commands, daemon-ops-commands | 会话路由解析 |
18
+ | `daemon-siri-bridge.js` | daemon-bridges.js | Siri HTTP 桥接 |
19
+ | `daemon-siri-imessage.js` | daemon-siri-bridge.js | iMessage 数据库读取 |
20
+ | `telegram-adapter.js` | daemon-bridges.js | Telegram 适配器 |
21
+ | `feishu-adapter.js` | daemon-bridges.js | 飞书适配器 |
22
+ | `session-summarize.js` | daemon.js (spawn) | 会话总结,由 daemon.js 第1158行 spawn 调用 |
23
+
24
+ ### HEARTBEAT — daemon.yaml 心跳任务调用(无需处理)
25
+
26
+ | 文件 | daemon.yaml 任务名 | 说明 |
27
+ |------|-------------------|------|
28
+ | `distill.js` (1447行) | `cognitive-distill` | 认知蒸馏引擎 |
29
+ | `memory-extract.js` (428行) | `memory-extract` | 记忆提取 |
30
+ | `memory-nightly-reflect.js` (607行) | (nightly task) | 夜间反思 |
31
+ | `self-reflect.js` (378行) | `self-reflect` | 自我反思 |
32
+
33
+ ### DEPENDENCY — 被心跳任务间接依赖(无需处理)
34
+
35
+ | 文件 | 被谁引用 | 说明 |
36
+ |------|----------|------|
37
+ | `signal-capture.js` | distill.js + Claude Code UserPromptSubmit hook | 信号捕获(hook + 数据源) |
38
+ | `pending-traits.js` (147行) | distill.js | 待处理特征 |
39
+ | `skill-changelog.js` | skill-evolution.js | 技能变更日志 |
40
+
41
+ ---
42
+
43
+ ### ORPHAN — 疑似孤儿文件,需要王总决策
44
+
45
+ | 文件 | 行数 | 分析 | 建议 |
46
+ |------|------|------|------|
47
+ | `daemon-reactive-lifecycle.js` | ~500 | 未被任何生产模块 require,仅被 test 和 verify 脚本引用。**但仍会被部署到 ~/.metame/**(不在 EXCLUDED_SCRIPTS 中)。是计划中的"反应式生命周期"功能,尚未集成 | **删除或归档**?如果不再计划实现。至少应加入 EXCLUDED_SCRIPTS 避免无用部署 |
48
+ | `verify-reactive-claude-md.js` | ~100 | 仅引用 daemon-reactive-lifecycle,单独的验证脚本 | 随 reactive-lifecycle 一起处理 |
49
+ | `sync-readme.js` | ~50 | 未被任何模块引用,是独立 README 翻译工具。已在 EXCLUDED_SCRIPTS 中,不会被部署到 ~/.metame/ | **保留为 CLI 工具**(无害)还是 **删除**? |
50
+
51
+ ---
52
+
53
+ ### plugin/scripts/ 孤儿文件(无对应源文件)
54
+
55
+ 这些文件只存在于 `plugin/scripts/`,在 `scripts/` 中没有源文件:
56
+
57
+ | 文件 | 说明 | 建议 |
58
+ |------|------|------|
59
+ | `auto-start-daemon.js` | SessionStart hook 自启动 daemon | 迁移到 `scripts/` 还是删除? |
60
+ | `distill-on-start.js` | 启动时 spawn 蒸馏 | 同上 |
61
+ | `inject-profile.js` | 注入 SYSTEM KERNEL 协议头 | 同上 |
62
+ | `setup.js` | 创建 ~/.claude_profile.yaml | 同上 |
63
+
64
+ > 风险:下次 `npm run sync:plugin` 会用 `scripts/` 覆盖 `plugin/scripts/`,这 4 个文件可能丢失。
65
+
66
+ ---
67
+
68
+ ## 需要王总确认的决策
69
+
70
+ 1. **daemon-reactive-lifecycle.js** — 这个反应式生命周期功能还计划集成吗?如果不做了就可以删掉。
71
+ 2. **sync-readme.js** — 是否还在用?
72
+ 3. **plugin/scripts/ 的 4 个孤儿** — 应该迁移到 `scripts/` 作为源文件,还是已经不需要了?
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Auto-Rules Intent Module
5
+ *
6
+ * Injects auto-promoted defensive rules distilled by memory-nightly-reflect.
7
+ * Rules live in ~/.metame/auto-rules.md — one-liners promoted from recurring
8
+ * hot-fact patterns (3+ occurrences in memory.db).
9
+ *
10
+ * Always fires when rules exist — no pattern detection needed.
11
+ * Overhead: ~10–15 one-liners ≈ 200 tokens per turn.
12
+ *
13
+ * File is cached for CACHE_TTL_MS to avoid per-prompt disk I/O.
14
+ * Cache refreshes automatically after nightly-reflect writes new rules.
15
+ */
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+ const os = require('os');
20
+
21
+ const RULES_FILE = path.join(os.homedir(), '.metame', 'auto-rules.md');
22
+ const CACHE_TTL_MS = 60 * 1000; // 1 minute — nightly-reflect runs once/day
23
+
24
+ let _cached = null;
25
+ let _cacheTs = 0;
26
+
27
+ function loadRules() {
28
+ const now = Date.now();
29
+ if (_cached !== null && now - _cacheTs < CACHE_TTL_MS) return _cached;
30
+
31
+ try {
32
+ const content = fs.readFileSync(RULES_FILE, 'utf8');
33
+ const rules = content
34
+ .split('\n')
35
+ .map(l => l.trim())
36
+ .filter(l => l && !l.startsWith('<!--'));
37
+ _cached = rules.length > 0 ? rules : [];
38
+ } catch {
39
+ _cached = [];
40
+ }
41
+
42
+ _cacheTs = now;
43
+ return _cached;
44
+ }
45
+
46
+ module.exports = function detectAutoRules() {
47
+ const rules = loadRules();
48
+ if (rules.length === 0) return null;
49
+ return ['[自动晋升规则 — 夜间蒸馏高频模式]', ...rules.map(r => `- ${r}`)].join('\n');
50
+ };
@@ -0,0 +1,101 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * verify-reactive-claude-md.js — Verification script for Package 1 acceptance.
5
+ *
6
+ * Proves that reactive dispatches go through handleCommand (not spawnClaude),
7
+ * and therefore CLAUDE.md is loaded from the project CWD.
8
+ *
9
+ * Run: node scripts/verify-reactive-claude-md.js
10
+ */
11
+
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+
15
+ const DAEMON_JS = path.join(__dirname, 'daemon.js');
16
+ const SCHEDULER_JS = path.join(__dirname, 'daemon-task-scheduler.js');
17
+
18
+ function verify() {
19
+ const results = [];
20
+
21
+ // Read source files
22
+ const daemonSrc = fs.readFileSync(DAEMON_JS, 'utf8');
23
+ const schedulerSrc = fs.existsSync(SCHEDULER_JS) ? fs.readFileSync(SCHEDULER_JS, 'utf8') : '';
24
+
25
+ // 1. Verify reactive dispatches go through _handleCommand (not spawnClaude)
26
+
27
+ // dispatchTask calls _handleCommand (not spawnClaude)
28
+ const handleCommandCall = daemonSrc.match(/_handleCommand\(nullBot,\s*dispatchChatId,\s*prompt/);
29
+ results.push({
30
+ check: 'dispatchTask uses _handleCommand (not spawnClaude)',
31
+ pass: !!handleCommandCall,
32
+ evidence: handleCommandCall ? handleCommandCall[0].slice(0, 80) : 'NOT FOUND',
33
+ });
34
+
35
+ // 2. Verify spawnClaude has CLAUDECODE: undefined (only heartbeat uses it)
36
+ // spawnClaude lives in daemon-task-scheduler.js, not daemon.js
37
+ const spawnClaudeEnv = schedulerSrc.match(/CLAUDECODE:\s*undefined/);
38
+ results.push({
39
+ check: 'spawnClaude (in scheduler) sets CLAUDECODE: undefined (heartbeat only)',
40
+ pass: !!spawnClaudeEnv,
41
+ evidence: spawnClaudeEnv ? 'CLAUDECODE: undefined found in scheduler spawnClaude env' : 'NOT FOUND',
42
+ });
43
+
44
+ // 3. Verify spawnClaude is NOT called from dispatchTask/handleDispatchItem
45
+ // (it's only in daemon-task-scheduler.js for heartbeat tasks)
46
+ const dispatchTaskFn = daemonSrc.match(/function dispatchTask[\s\S]*?^}/m);
47
+ const dispatchUsesSpawn = dispatchTaskFn && dispatchTaskFn[0].includes('spawnClaude');
48
+ results.push({
49
+ check: 'dispatchTask does NOT call spawnClaude',
50
+ pass: !dispatchUsesSpawn,
51
+ evidence: dispatchUsesSpawn ? 'FAIL: spawnClaude found in dispatchTask' : 'Confirmed: dispatchTask uses _handleCommand path',
52
+ });
53
+
54
+ // 4. Verify spawnClaude lives in task-scheduler (heartbeat), not in dispatch path
55
+ const schedulerHasSpawn = schedulerSrc.includes('spawnClaude');
56
+ results.push({
57
+ check: 'spawnClaude exists in daemon-task-scheduler.js (heartbeat path)',
58
+ pass: schedulerHasSpawn,
59
+ evidence: schedulerHasSpawn ? 'spawnClaude found in scheduler (correct: heartbeat only)' : 'NOT FOUND',
60
+ });
61
+
62
+ // 5. Verify _handleCommand is same as handleCommand (full session handler)
63
+ const setDispatchLine = daemonSrc.match(/function setDispatchHandler\(fn\)\s*\{\s*_handleCommand\s*=\s*fn/);
64
+ results.push({
65
+ check: '_handleCommand is bound to handleCommand via setDispatchHandler',
66
+ pass: !!setDispatchLine,
67
+ evidence: setDispatchLine ? 'setDispatchHandler(fn) { _handleCommand = fn }' : 'NOT FOUND',
68
+ });
69
+
70
+ // 6. Verify reactive handleDispatchItem goes through the same dispatchTask → _handleCommand path
71
+ const reactiveModule = fs.readFileSync(path.join(__dirname, 'daemon-reactive-lifecycle.js'), 'utf8');
72
+ const reactiveUsesHandleDispatch = reactiveModule.includes('deps.handleDispatchItem');
73
+ results.push({
74
+ check: 'Reactive module uses deps.handleDispatchItem (same dispatch path)',
75
+ pass: reactiveUsesHandleDispatch,
76
+ evidence: reactiveUsesHandleDispatch ? 'deps.handleDispatchItem found in reactive module' : 'NOT FOUND',
77
+ });
78
+
79
+ // Print results
80
+ console.log('\n=== CLAUDE.md Loading Verification ===\n');
81
+ let allPass = true;
82
+ for (const r of results) {
83
+ const icon = r.pass ? '✅' : '❌';
84
+ console.log(`${icon} ${r.check}`);
85
+ console.log(` ${r.evidence}\n`);
86
+ if (!r.pass) allPass = false;
87
+ }
88
+
89
+ console.log(allPass
90
+ ? '✅ CONCLUSION: Reactive dispatches go through handleCommand → CLAUDE.md is loaded from project CWD.'
91
+ : '❌ CONCLUSION: Some checks failed. CLAUDE.md loading NOT verified.');
92
+
93
+ // Also check that scientist project has a CLAUDE.md
94
+ const scientistClaude = path.join(process.env.HOME || '', 'AGI', 'AgentScientist', 'CLAUDE.md');
95
+ const hasClaude = fs.existsSync(scientistClaude);
96
+ console.log(`\n${hasClaude ? '✅' : '⚠️'} AgentScientist CLAUDE.md exists: ${scientistClaude}`);
97
+
98
+ process.exit(allPass ? 0 : 1);
99
+ }
100
+
101
+ verify();
@@ -1,356 +0,0 @@
1
- telegram:
2
- enabled: true
3
- bot_token: 8403757601:AAEouYu9BFDzg70EDjPlsHXbGJ2guNuH9Tg
4
- allowed_chat_ids:
5
- - 8572284648
6
- permissions:
7
- defaultMode: bypassPermissions
8
- chat_agent_map: {}
9
- feishu:
10
- enabled: true
11
- app_id: cli_a90a073b2ba1dbb4
12
- app_secret: Om2sn22xfMaM0Jfv4IGLNh0CftikG8mU
13
- operator_ids:
14
- - ou_f873edab380d4836f93cc9e9b9104f5a
15
- allowed_chat_ids:
16
- - oc_84be4bf1a1dabc6c1f0c22d0b6feaf8d
17
- - oc_2693fc5ca63064f144eca78264bcea48
18
- - oc_280f2c243f348d8f688580f882996bcd
19
- - oc_942de23c38ff876f73f163052fbdb68f
20
- - oc_987e0d01804ab9459272006416a935a8
21
- - oc_9dc62f6011b337b413eef81b4738883b
22
- - oc_8902c34a0fc52b28ada1a7c4e25aa22a
23
- - oc_e777c7e7a24335ecbf25ed129402af54
24
- - oc_5d76f02c21203c5ae1c19fd83c790ba4
25
- - oc_9cbeb5cfcef80ddffcf0419507391189
26
- - oc_bd0b81e62ff3576dc9b4c6670bb788d2
27
- - oc_e33569664c1c1224d44a864a4fb40dd2
28
- chat_agent_map:
29
- oc_84be4bf1a1dabc6c1f0c22d0b6feaf8d: metame
30
- oc_2693fc5ca63064f144eca78264bcea48: personal
31
- oc_280f2c243f348d8f688580f882996bcd: metame
32
- oc_942de23c38ff876f73f163052fbdb68f: digital_me
33
- oc_987e0d01804ab9459272006416a935a8: desktop
34
- oc_9dc62f6011b337b413eef81b4738883b: ___
35
- oc_8902c34a0fc52b28ada1a7c4e25aa22a: business
36
- oc_e777c7e7a24335ecbf25ed129402af54: personal
37
- oc_5d76f02c21203c5ae1c19fd83c790ba4: munger
38
- oc_9cbeb5cfcef80ddffcf0419507391189: achat_pm
39
- oc_bd0b81e62ff3576dc9b4c6670bb788d2: xianyu
40
- oc_e33569664c1c1224d44a864a4fb40dd2: drama_manager
41
- permissions:
42
- defaultMode: bypassPermissions
43
- projects:
44
- business:
45
- name: CEO · 商业决策
46
- icon: 💼
47
- color: orange
48
- cwd: ~/AGI/Business
49
- nicknames:
50
- - 艾布
51
- - CEO
52
- - 商业
53
- heartbeat_tasks: []
54
- team:
55
- - key: hunter
56
- name: 猎手 · 市场情报
57
- icon: 🔍
58
- color: green
59
- cwd: ~/AGI/Business/team/hunter
60
- nicknames:
61
- - 猎手
62
- - Hunter
63
- - key: builder
64
- name: 工匠 · MVP拼装
65
- icon: 🔧
66
- color: yellow
67
- cwd: ~/AGI/Business/team/builder
68
- nicknames:
69
- - 工匠
70
- - Builder
71
- - key: trojan
72
- name: 特洛伊 · 获客专家
73
- icon: 🎯
74
- color: red
75
- cwd: ~/AGI/Business/team/trojan
76
- nicknames:
77
- - 特洛伊
78
- - Trojan
79
- - key: closer
80
- name: 终结者 · 成交专家
81
- icon: 💰
82
- color: purple
83
- cwd: ~/AGI/Business/team/closer
84
- nicknames:
85
- - 终结者
86
- - Closer
87
- - key: xianyu
88
- name: 小鱼 · 咸鱼客服
89
- icon: 🐟
90
- color: cyan
91
- cwd: ~/AGI/Business/team/xianyu
92
- nicknames:
93
- - 小鱼
94
- - 咸鱼客服
95
- achat_pm:
96
- name: A哥 · AChat Protocol PM
97
- icon: 🔗
98
- color: blue
99
- cwd: ~/AGI/AChat
100
- nicknames:
101
- - A哥
102
- - 老A
103
- - 大A
104
- - achat
105
- heartbeat_tasks: []
106
- munger:
107
- name: 芒格 · 格栅思维顾问
108
- icon: 🧠
109
- color: teal
110
- cwd: ~/AGI/Munger
111
- nicknames:
112
- - 芒格
113
- - 查理
114
- - 私人顾问
115
- - munger
116
- heartbeat_tasks: []
117
- personal:
118
- name: personal
119
- icon: 💅
120
- color: carmine
121
- cwd: /Users/yaron
122
- engine: claude
123
- model: sonnet
124
- guard: user-only
125
- nicknames:
126
- - 小美
127
- - 助理
128
- - personal
129
- heartbeat_tasks: []
130
- digital_me:
131
- name: Digital Me
132
- icon: 📊
133
- color: grey
134
- cwd: ~/AGI/Digital_Me
135
- nicknames:
136
- - 小D
137
- - 3D
138
- - 自媒体
139
- heartbeat_tasks:
140
- - name: daily-topic-radar
141
- type: script
142
- command: bash /Users/yaron/AGI/TrendRadar/run-crawl.sh
143
- at: '09:00'
144
- require_idle: false
145
- notify: true
146
- enabled: true
147
- - name: weekend-review
148
- cwd: ~/AGI/Digital_Me
149
- model: haiku
150
- interval: 5m
151
- timeout: 120000
152
- notify: true
153
- enabled: true
154
- precondition: node -e "const fs=require('fs');const p=process.env.HOME+'/.metame/daemon_state.json';const key='weekend-review';const pad=n=>String(n).padStart(2,'0');const weekKey=d=>{const x=new Date(d);const day=(x.getDay()+6)%7;x.setHours(0,0,0,0);x.setDate(x.getDate()-day);return x.getFullYear()+'-'+pad(x.getMonth()+1)+'-'+pad(x.getDate());};const now=new Date();const dow=now.getDay();if(!(dow===0||dow===6))process.exit(1);if(now.getHours()!==22)process.exit(1);let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8'));}catch{}const t=(s.tasks||{})[key];if(t&&t.status==='success'&&t.last_run&&weekKey(t.last_run)===weekKey(now))process.exit(1);console.log('run');"
155
- prompt: |-
156
- 你是周末复盘助手。现在执行周末总结:先向用户索取本周关键数据,再给出下周选题方案提示词。
157
- 硬性要求:不臆测数据,不直接给结论。
158
- 输出结构(严格三段):
159
- 1) 【请补充本周数据】列出 6 项:发布篇数、总阅读、平均阅读、最高阅读文章(标题+阅读量)、最低阅读文章(标题+阅读量)、净增粉丝。
160
- 2) 【回填模板】给可直接复制填写的模板。
161
- 3) 【下周选题方案提示词(待数据版)】给一段可直接发给 AI 的提示词:收到上述数据后,输出下周 7 天选题计划(每天 1 个选题,含优先级、标题、核心观点、目标读者、验证指标)。
162
- 风格:简洁、可执行,全文不超过 18 行。
163
- allowedTools:
164
- - Read
165
- metame:
166
- name: 超级总管 Jarvis
167
- icon: 🤖
168
- color: blue
169
- cwd: ~/AGI/MetaMe
170
- nicknames:
171
- - 贾维斯
172
- - 老贾
173
- - 贾
174
- - Jarvis
175
- - jarvis
176
- heartbeat_tasks: null
177
- broadcast: true
178
- team:
179
- - key: jia
180
- name: Jarvis · 甲
181
- icon: 🤖
182
- color: green
183
- cwd: ~/AGI/MetaMe
184
- nicknames:
185
- - 甲
186
- auto_dispatch: true
187
- - key: yi
188
- name: Jarvis · 乙
189
- icon: 🤖
190
- color: yellow
191
- cwd: ~/AGI/MetaMe
192
- nicknames:
193
- - 乙
194
- auto_dispatch: true
195
- - key: bing
196
- name: Jarvis · 丙
197
- icon: 🤖
198
- color: red
199
- cwd: ~/AGI/MetaMe
200
- nicknames:
201
- - 丙
202
- auto_dispatch: true
203
- desktop:
204
- name: Desktop PM
205
- icon: 🚀
206
- color: indigo
207
- cwd: ~/AGI/metame-desktop
208
- nicknames:
209
- - 马经理
210
- - 老马
211
- - 桌面
212
- - Desktop
213
- heartbeat_tasks: []
214
- ___:
215
- name: 因斯坦
216
- cwd: /Users/yaron/Desktop/项目计划书/国自然青年
217
- nicknames:
218
- - 因斯坦
219
- drama_manager:
220
- name: 🎬 短剧总管
221
- icon: 🎬
222
- color: red
223
- cwd: ~/AGI/DramaFactory
224
- nicknames:
225
- - 短剧总管
226
- - 总管
227
- - drama
228
- heartbeat_tasks: []
229
- team:
230
- - key: drama_screenwriter
231
- name: ✍️ 编剧
232
- icon: ✍️
233
- color: orange
234
- cwd: ~/AGI/DramaFactory/team/screenwriter
235
- nicknames:
236
- - 编剧
237
- - key: drama_writer
238
- name: 📝 写手
239
- icon: 📝
240
- color: yellow
241
- cwd: ~/AGI/DramaFactory/team/writer
242
- nicknames:
243
- - 写手
244
- - key: drama_hook_rev
245
- name: 🪝 钩子审核
246
- icon: 🪝
247
- color: pink
248
- cwd: ~/AGI/DramaFactory/team/hook_rev
249
- nicknames:
250
- - 钩子审核员
251
- - 钩子审核
252
- - key: drama_drama_rev
253
- name: 🌶 狗血审核
254
- icon: 🌶
255
- color: magenta
256
- cwd: ~/AGI/DramaFactory/team/drama_rev
257
- nicknames:
258
- - 狗血审核员
259
- - 狗血审核
260
- - key: drama_format_rev
261
- name: 📐 格式审核
262
- icon: 📐
263
- color: grey
264
- cwd: ~/AGI/DramaFactory/team/format_rev
265
- nicknames:
266
- - 格式审核员
267
- - 格式审核
268
- heartbeat:
269
- tasks:
270
- - name: cognitive-distill
271
- type: script
272
- command: node ~/.metame/distill.js
273
- interval: 2h
274
- precondition: test -s ~/.metame/raw_signals.jsonl
275
- require_idle: true
276
- notify: false
277
- enabled: true
278
- - name: memory-extract
279
- type: script
280
- command: node ~/.metame/memory-extract.js
281
- interval: 12h
282
- timeout: 1800
283
- require_idle: true
284
- notify: false
285
- enabled: true
286
- - name: memory-gc
287
- type: script
288
- command: node ~/.metame/memory-gc.js
289
- at: '02:00'
290
- require_idle: true
291
- notify: false
292
- enabled: true
293
- - name: skill-evolve
294
- type: script
295
- command: node ~/.metame/skill-evolution.js
296
- interval: 24h
297
- precondition: test -s ~/.metame/skill_signals.jsonl
298
- require_idle: true
299
- notify: false
300
- enabled: true
301
- - name: self-reflect
302
- type: script
303
- command: node ~/.metame/self-reflect.js
304
- at: '23:00'
305
- require_idle: true
306
- notify: false
307
- enabled: true
308
- - name: nightly-reflect
309
- type: script
310
- command: node ~/.metame/memory-nightly-reflect.js
311
- at: '01:00'
312
- require_idle: true
313
- notify: false
314
- enabled: true
315
- - name: memory-index
316
- type: script
317
- command: node ~/.metame/memory-index.js
318
- at: '01:30'
319
- require_idle: true
320
- notify: false
321
- enabled: true
322
- budget:
323
- daily_limit: 100000
324
- warning_threshold: 0.8
325
- daemon:
326
- model: opus
327
- log_max_size: 1048576
328
- heartbeat_check_interval: 60
329
- skill_evolution_notify: false
330
- dangerously_skip_permissions: true
331
- session_allowed_tools:
332
- - Edit
333
- - Write
334
- - Read
335
- - Bash
336
- - Glob
337
- - Grep
338
- - WebFetch
339
- - WebSearch
340
- - Task
341
- - Skill
342
- - TodoRead
343
- - TodoWrite
344
- - NotebookEdit
345
- - mcp__playwright__*
346
- - mcp__trendradar__*
347
- - mcp__notionApi__*
348
- models:
349
- claude: sonnet
350
-
351
- # Intent Engine — UserPromptSubmit hook modules
352
- # Set any key to false to disable that intent module.
353
- hooks:
354
- team_dispatch: true # team member dispatch hints
355
- ops_assist: true # /undo /restart /logs /gc hints
356
- task_create: true # task scheduling hints