openclaw-telegram-manager 2.8.0 → 2.10.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.
- package/README.md +9 -13
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +0 -33
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/autopilot.d.ts +11 -1
- package/dist/commands/autopilot.d.ts.map +1 -1
- package/dist/commands/autopilot.js +70 -11
- package/dist/commands/autopilot.js.map +1 -1
- package/dist/commands/daily-report-all.d.ts +28 -0
- package/dist/commands/daily-report-all.d.ts.map +1 -0
- package/dist/commands/daily-report-all.js +255 -0
- package/dist/commands/daily-report-all.js.map +1 -0
- package/dist/commands/daily-report.d.ts +1 -1
- package/dist/commands/daily-report.d.ts.map +1 -1
- package/dist/commands/daily-report.js +7 -5
- package/dist/commands/daily-report.js.map +1 -1
- package/dist/commands/doctor-all.d.ts +1 -0
- package/dist/commands/doctor-all.d.ts.map +1 -1
- package/dist/commands/doctor-all.js +22 -4
- package/dist/commands/doctor-all.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +12 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +0 -22
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +3 -5
- package/dist/commands/status.js.map +1 -1
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +2 -0
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/capsule.d.ts +4 -2
- package/dist/lib/capsule.d.ts.map +1 -1
- package/dist/lib/capsule.js +80 -37
- package/dist/lib/capsule.js.map +1 -1
- package/dist/lib/cron.d.ts +11 -0
- package/dist/lib/cron.d.ts.map +1 -1
- package/dist/lib/cron.js +40 -0
- package/dist/lib/cron.js.map +1 -1
- package/dist/lib/doctor-checks.d.ts +7 -11
- package/dist/lib/doctor-checks.d.ts.map +1 -1
- package/dist/lib/doctor-checks.js +34 -109
- package/dist/lib/doctor-checks.js.map +1 -1
- package/dist/lib/include-generator.d.ts.map +1 -1
- package/dist/lib/include-generator.js +6 -7
- package/dist/lib/include-generator.js.map +1 -1
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/registry.js +7 -0
- package/dist/lib/registry.js.map +1 -1
- package/dist/lib/telegram.d.ts.map +1 -1
- package/dist/lib/telegram.js +3 -2
- package/dist/lib/telegram.js.map +1 -1
- package/dist/lib/types.d.ts +4 -3
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +7 -11
- package/dist/lib/types.js.map +1 -1
- package/dist/plugin.js +828 -712
- package/dist/setup.js +4 -8
- package/dist/setup.js.map +1 -1
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js +23 -0
- package/dist/tool.js.map +1 -1
- package/package.json +1 -1
- package/skills/tm/SKILL.md +15 -9
package/README.md
CHANGED
|
@@ -57,23 +57,18 @@ In practice: if the AI resets and you ask "what are we working on?", it answers
|
|
|
57
57
|
|
|
58
58
|
## What gets tracked
|
|
59
59
|
|
|
60
|
-
Each topic gets its own folder with files the AI maintains automatically:
|
|
60
|
+
Each topic gets its own folder with three files the AI maintains automatically:
|
|
61
61
|
|
|
62
62
|
| File | Purpose |
|
|
63
63
|
|------|---------|
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
64
|
+
| `README.md` | What this topic is about, goals, key resources, and type-specific sections |
|
|
65
|
+
| `STATUS.md` | Last activity, next actions, upcoming work, backlog, and completed tasks |
|
|
66
66
|
| `LEARNINGS.md` | Insights, mistakes, workarounds |
|
|
67
|
-
| `COMMANDS.md` | Build/deploy/test commands |
|
|
68
|
-
| `LINKS.md` | URLs and endpoints |
|
|
69
|
-
| `CRON.md` | Scheduled jobs |
|
|
70
|
-
| `NOTES.md` | Anything else worth keeping |
|
|
71
|
-
| `README.md` | What this topic is about |
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
- **Coding** adds
|
|
75
|
-
- **Research** adds
|
|
76
|
-
- **Marketing** adds
|
|
68
|
+
The README includes type-specific sections depending on the topic:
|
|
69
|
+
- **Coding** adds Architecture, Deployment, and Commands sections
|
|
70
|
+
- **Research** adds Sources and Findings sections
|
|
71
|
+
- **Marketing** adds Campaigns and Metrics sections
|
|
77
72
|
|
|
78
73
|
These files are committed to your workspace git repo so they persist and have history. Operational files (the internal registry and audit log) are automatically added to `.gitignore` during setup.
|
|
79
74
|
|
|
@@ -89,6 +84,7 @@ You don't need any of these — everything runs automatically. They're there if
|
|
|
89
84
|
| `/tm doctor` | Run health checks |
|
|
90
85
|
| `/tm doctor --all` | Health check all topics at once |
|
|
91
86
|
| `/tm daily-report` | Post a daily summary |
|
|
87
|
+
| `/tm daily-report --all` | Post daily summaries for all topics |
|
|
92
88
|
| `/tm list` | List all topics |
|
|
93
89
|
|
|
94
90
|
**Make changes**
|
|
@@ -112,7 +108,7 @@ You don't need any of these — everything runs automatically. They're there if
|
|
|
112
108
|
|
|
113
109
|
Two roles:
|
|
114
110
|
- **User** — can manage topics they have access to
|
|
115
|
-
- **Admin** — can run `doctor --all` and manage anyone's topics
|
|
111
|
+
- **Admin** — can run `doctor --all`, `daily-report --all`, and manage anyone's topics
|
|
116
112
|
|
|
117
113
|
The first person to run `/tm init` automatically becomes admin.
|
|
118
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/commands/archive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/commands/archive.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/D,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAE/E;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAEjF"}
|
package/dist/commands/archive.js
CHANGED
|
@@ -4,7 +4,6 @@ import { topicKey } from '../lib/types.js';
|
|
|
4
4
|
import { appendAudit, buildAuditEntry } from '../lib/audit.js';
|
|
5
5
|
import { generateInclude } from '../lib/include-generator.js';
|
|
6
6
|
import { triggerRestart, getConfigWrites } from '../lib/config-restart.js';
|
|
7
|
-
import { removeCronJob, registerDailyReportCron } from '../lib/cron.js';
|
|
8
7
|
export async function handleArchive(ctx) {
|
|
9
8
|
return handleArchiveToggle(ctx, true);
|
|
10
9
|
}
|
|
@@ -44,38 +43,6 @@ async function handleArchiveToggle(ctx, archive) {
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
|
-
// Manage cron job: remove on archive, re-register on unarchive (non-critical)
|
|
48
|
-
if (archive && entry.cronJobId) {
|
|
49
|
-
await removeCronJob(rpc, entry.cronJobId, logger);
|
|
50
|
-
await withRegistry(workspaceDir, (data) => {
|
|
51
|
-
const topic = data.topics[key];
|
|
52
|
-
if (topic) {
|
|
53
|
-
topic.cronJobId = null;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else if (!archive && !entry.cronJobId) {
|
|
58
|
-
try {
|
|
59
|
-
const cronResult = await registerDailyReportCron(rpc, {
|
|
60
|
-
topicName: entry.name,
|
|
61
|
-
slug: entry.slug,
|
|
62
|
-
groupId,
|
|
63
|
-
threadId,
|
|
64
|
-
}, logger);
|
|
65
|
-
if (cronResult.jobId) {
|
|
66
|
-
await withRegistry(workspaceDir, (data) => {
|
|
67
|
-
const topic = data.topics[key];
|
|
68
|
-
if (topic) {
|
|
69
|
-
topic.cronJobId = cronResult.jobId;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
76
|
-
logger.error(`[archive] Cron re-registration failed: ${msg}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
46
|
// Regenerate include file so config stays in sync
|
|
80
47
|
let restartMsg = '';
|
|
81
48
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/commands/archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/commands/archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3E,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAmB;IACrD,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAmB;IACvD,OAAO,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,K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I,EAAE,qBAAqB,SAAS,EAAE,CAAC,CAC/E,CAAC;IAEF,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;IACnD,OAAO;QACL,IAAI,EAAE,WAAW,KAAK,CAAC,IAAI,MAAM,MAAM,IAAI,UAAU,EAAE;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { CommandContext, CommandResult } from './help.js';
|
|
2
2
|
export declare const MARKER_START = "<!-- TM_AUTOPILOT_START -->";
|
|
3
3
|
export declare const MARKER_END = "<!-- TM_AUTOPILOT_END -->";
|
|
4
|
-
export declare const HEARTBEAT_BLOCK = "<!-- TM_AUTOPILOT_START -->\n## Topic Manager \u2014 Balanced Autopilot\n\
|
|
4
|
+
export declare const HEARTBEAT_BLOCK = "<!-- TM_AUTOPILOT_START -->\n## Topic Manager \u2014 Balanced Autopilot\n\nDaily reports and health checks are handled by the cron scheduler.\nNo action needed here (HEARTBEAT_OK).\n<!-- TM_AUTOPILOT_END -->";
|
|
5
5
|
export declare const HEARTBEAT_FILENAME = "HEARTBEAT.md";
|
|
6
6
|
export declare function handleAutopilot(ctx: CommandContext, args: string): Promise<CommandResult>;
|
|
7
|
+
import type { RpcInterface, Logger } from '../lib/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Register the combined daily cron job if not already registered.
|
|
10
|
+
* Stores the job ID in the registry's `dailyReportCronJobId`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureCombinedCron(workspaceDir: string, rpc: RpcInterface | null | undefined, logger: Logger): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Remove all per-topic cron jobs and clear their cronJobId fields.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleanupPerTopicCrons(workspaceDir: string, rpc: RpcInterface | null | undefined, logger: Logger): Promise<void>;
|
|
7
17
|
//# sourceMappingURL=autopilot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../../src/commands/autopilot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../../src/commands/autopilot.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI/D,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAC1D,eAAO,MAAM,UAAU,8BAA8B,CAAC;AAEtD,eAAO,MAAM,eAAe,oNAKd,CAAC;AAEf,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAIjD,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0B/F;AAgID,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAUf;AAmBD;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
|
@@ -3,19 +3,15 @@ import * as path from 'node:path';
|
|
|
3
3
|
import { readRegistry, withRegistry } from '../lib/registry.js';
|
|
4
4
|
import { checkAuthorization } from '../lib/auth.js';
|
|
5
5
|
import { relativeTime } from '../lib/telegram.js';
|
|
6
|
+
import { registerCombinedCron, removeCronJob } from '../lib/cron.js';
|
|
6
7
|
// ── Marker constants ────────────────────────────────────────────────
|
|
7
8
|
export const MARKER_START = '<!-- TM_AUTOPILOT_START -->';
|
|
8
9
|
export const MARKER_END = '<!-- TM_AUTOPILOT_END -->';
|
|
9
10
|
export const HEARTBEAT_BLOCK = `${MARKER_START}
|
|
10
11
|
## Topic Manager — Balanced Autopilot
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
1. CALL \`topic_manager\` with command "doctor --all" to health-check all active topics.
|
|
15
|
-
This runs health checks AND posts daily progress reports for each eligible topic automatically.
|
|
16
|
-
2. For each topic where STATUS.md "Last done (UTC)" is >3 days old:
|
|
17
|
-
post a brief nudge in that topic asking the user for a status update.
|
|
18
|
-
3. If no actions were taken in steps 1-2, do nothing (HEARTBEAT_OK).
|
|
13
|
+
Daily reports and health checks are handled by the cron scheduler.
|
|
14
|
+
No action needed here (HEARTBEAT_OK).
|
|
19
15
|
${MARKER_END}`;
|
|
20
16
|
export const HEARTBEAT_FILENAME = 'HEARTBEAT.md';
|
|
21
17
|
// ── Main handler ────────────────────────────────────────────────────
|
|
@@ -43,7 +39,7 @@ export async function handleAutopilot(ctx, args) {
|
|
|
43
39
|
}
|
|
44
40
|
// ── Enable ──────────────────────────────────────────────────────────
|
|
45
41
|
async function handleEnable(ctx) {
|
|
46
|
-
const { workspaceDir } = ctx;
|
|
42
|
+
const { workspaceDir, rpc, logger } = ctx;
|
|
47
43
|
const heartbeatPath = path.join(workspaceDir, HEARTBEAT_FILENAME);
|
|
48
44
|
// Read or create HEARTBEAT.md
|
|
49
45
|
let content = '';
|
|
@@ -61,6 +57,8 @@ async function handleEnable(ctx) {
|
|
|
61
57
|
await withRegistry(workspaceDir, (data) => {
|
|
62
58
|
data.autopilotEnabled = true;
|
|
63
59
|
});
|
|
60
|
+
// Ensure combined cron is registered
|
|
61
|
+
await ensureCombinedCron(workspaceDir, rpc, logger);
|
|
64
62
|
return { text: 'Autopilot is already enabled.' };
|
|
65
63
|
}
|
|
66
64
|
// Append block to HEARTBEAT.md
|
|
@@ -69,15 +67,19 @@ async function handleEnable(ctx) {
|
|
|
69
67
|
await withRegistry(workspaceDir, (data) => {
|
|
70
68
|
data.autopilotEnabled = true;
|
|
71
69
|
});
|
|
70
|
+
// Register combined cron + cleanup per-topic crons
|
|
71
|
+
await ensureCombinedCron(workspaceDir, rpc, logger);
|
|
72
|
+
await cleanupPerTopicCrons(workspaceDir, rpc, logger);
|
|
72
73
|
return {
|
|
73
|
-
text: '**Autopilot enabled.**\
|
|
74
|
+
text: '**Autopilot enabled.**\nDaily reports and health checks will run automatically at 09:00 UTC.',
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
// ── Disable ─────────────────────────────────────────────────────────
|
|
77
78
|
async function handleDisable(ctx) {
|
|
78
|
-
const { workspaceDir } = ctx;
|
|
79
|
+
const { workspaceDir, rpc, logger } = ctx;
|
|
79
80
|
const heartbeatPath = path.join(workspaceDir, HEARTBEAT_FILENAME);
|
|
80
81
|
if (!fs.existsSync(heartbeatPath)) {
|
|
82
|
+
await removeCombinedCron(workspaceDir, rpc, logger);
|
|
81
83
|
await withRegistry(workspaceDir, (data) => {
|
|
82
84
|
data.autopilotEnabled = false;
|
|
83
85
|
});
|
|
@@ -85,6 +87,7 @@ async function handleDisable(ctx) {
|
|
|
85
87
|
}
|
|
86
88
|
let content = fs.readFileSync(heartbeatPath, 'utf-8');
|
|
87
89
|
if (!content.includes(MARKER_START)) {
|
|
90
|
+
await removeCombinedCron(workspaceDir, rpc, logger);
|
|
88
91
|
await withRegistry(workspaceDir, (data) => {
|
|
89
92
|
data.autopilotEnabled = false;
|
|
90
93
|
});
|
|
@@ -104,11 +107,13 @@ async function handleDisable(ctx) {
|
|
|
104
107
|
fs.unlinkSync(heartbeatPath);
|
|
105
108
|
}
|
|
106
109
|
}
|
|
110
|
+
// Remove combined cron
|
|
111
|
+
await removeCombinedCron(workspaceDir, rpc, logger);
|
|
107
112
|
await withRegistry(workspaceDir, (data) => {
|
|
108
113
|
data.autopilotEnabled = false;
|
|
109
114
|
});
|
|
110
115
|
return {
|
|
111
|
-
text: '**Autopilot disabled.**\nAutomatic health checks are now off.',
|
|
116
|
+
text: '**Autopilot disabled.**\nAutomatic daily reports and health checks are now off.',
|
|
112
117
|
};
|
|
113
118
|
}
|
|
114
119
|
// ── Status ──────────────────────────────────────────────────────────
|
|
@@ -119,12 +124,66 @@ async function handleStatus(ctx) {
|
|
|
119
124
|
const lastRun = registry.lastDoctorAllRunAt
|
|
120
125
|
? relativeTime(registry.lastDoctorAllRunAt)
|
|
121
126
|
: 'never';
|
|
127
|
+
const cronStatus = registry.dailyReportCronJobId
|
|
128
|
+
? 'active (09:00 UTC)'
|
|
129
|
+
: 'not registered';
|
|
122
130
|
const lines = [
|
|
123
131
|
`**Autopilot:** ${enabled ? 'enabled' : 'disabled'}`,
|
|
132
|
+
`**Daily cron:** ${cronStatus}`,
|
|
124
133
|
`**Last health check run:** ${lastRun}`,
|
|
125
134
|
];
|
|
126
135
|
return {
|
|
127
136
|
text: lines.join('\n'),
|
|
128
137
|
};
|
|
129
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Register the combined daily cron job if not already registered.
|
|
141
|
+
* Stores the job ID in the registry's `dailyReportCronJobId`.
|
|
142
|
+
*/
|
|
143
|
+
export async function ensureCombinedCron(workspaceDir, rpc, logger) {
|
|
144
|
+
const registry = readRegistry(workspaceDir);
|
|
145
|
+
if (registry.dailyReportCronJobId)
|
|
146
|
+
return;
|
|
147
|
+
const result = await registerCombinedCron(rpc, logger);
|
|
148
|
+
if (result.jobId) {
|
|
149
|
+
await withRegistry(workspaceDir, (data) => {
|
|
150
|
+
data.dailyReportCronJobId = result.jobId;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Remove the combined daily cron job and clear the registry field.
|
|
156
|
+
*/
|
|
157
|
+
async function removeCombinedCron(workspaceDir, rpc, logger) {
|
|
158
|
+
const registry = readRegistry(workspaceDir);
|
|
159
|
+
if (!registry.dailyReportCronJobId)
|
|
160
|
+
return;
|
|
161
|
+
await removeCronJob(rpc, registry.dailyReportCronJobId, logger);
|
|
162
|
+
await withRegistry(workspaceDir, (data) => {
|
|
163
|
+
data.dailyReportCronJobId = null;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Remove all per-topic cron jobs and clear their cronJobId fields.
|
|
168
|
+
*/
|
|
169
|
+
export async function cleanupPerTopicCrons(workspaceDir, rpc, logger) {
|
|
170
|
+
const registry = readRegistry(workspaceDir);
|
|
171
|
+
const topicsWithCron = Object.entries(registry.topics)
|
|
172
|
+
.filter(([, entry]) => entry.cronJobId !== null);
|
|
173
|
+
if (topicsWithCron.length === 0)
|
|
174
|
+
return;
|
|
175
|
+
for (const [, entry] of topicsWithCron) {
|
|
176
|
+
if (entry.cronJobId) {
|
|
177
|
+
await removeCronJob(rpc, entry.cronJobId, logger);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
await withRegistry(workspaceDir, (data) => {
|
|
181
|
+
for (const [key] of topicsWithCron) {
|
|
182
|
+
const entry = data.topics[key];
|
|
183
|
+
if (entry) {
|
|
184
|
+
entry.cronJobId = null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
130
189
|
//# sourceMappingURL=autopilot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autopilot.js","sourceRoot":"","sources":["../../src/commands/autopilot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"autopilot.js","sourceRoot":"","sources":["../../src/commands/autopilot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9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CommandContext, CommandResult } from './help.js';
|
|
3
|
+
export type DailyReportSkipReason = 'archived' | 'snoozed' | 'inactive' | 'already-reported-today';
|
|
4
|
+
export interface DailyReportEligibilityResult {
|
|
5
|
+
eligible: boolean;
|
|
6
|
+
skipReason?: DailyReportSkipReason;
|
|
7
|
+
}
|
|
8
|
+
interface TopicOutcome {
|
|
9
|
+
name: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
status: 'reported' | 'post-failed';
|
|
12
|
+
}
|
|
13
|
+
interface SkippedTopic {
|
|
14
|
+
name: string;
|
|
15
|
+
reason: DailyReportSkipReason;
|
|
16
|
+
}
|
|
17
|
+
export declare function getDailyReportEligibility(entry: TopicEntry, now: Date, statusTimestamp?: string | null): DailyReportEligibilityResult;
|
|
18
|
+
export interface DailyReportAllSummaryData {
|
|
19
|
+
reportedTopics: TopicOutcome[];
|
|
20
|
+
skippedTopics: SkippedTopic[];
|
|
21
|
+
postFailures: number;
|
|
22
|
+
migrationGroups: number;
|
|
23
|
+
errors: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function buildDailyReportAllSummary(data: DailyReportAllSummaryData): string;
|
|
26
|
+
export declare function handleDailyReportAll(ctx: CommandContext): Promise<CommandResult>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=daily-report-all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daily-report-all.d.ts","sourceRoot":"","sources":["../../src/commands/daily-report-all.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AASlD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI/D,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,wBAAwB,CAAC;AAEnG,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,aAAa,CAAC;CACpC;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAID,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,IAAI,EACT,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,4BAA4B,CA6B9B;AAkBD,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAID,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,MAAM,CAoFlF;AAID,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAkKtF"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { readRegistry, withRegistry } from '../lib/registry.js';
|
|
3
|
+
import { checkAuthorization } from '../lib/auth.js';
|
|
4
|
+
import { INACTIVE_AFTER_DAYS, MAX_POST_ERROR_LENGTH, } from '../lib/types.js';
|
|
5
|
+
import { buildDailyReport, createRateLimitedPoster, truncateMessage } from '../lib/telegram.js';
|
|
6
|
+
import { mostRecent, extractStatusTimestamp } from './doctor-all.js';
|
|
7
|
+
import { readFileOrNull, extractDoneSection, extractBlockers, extractNextActions, } from './daily-report.js';
|
|
8
|
+
// ── Eligibility ──────────────────────────────────────────────────────
|
|
9
|
+
export function getDailyReportEligibility(entry, now, statusTimestamp) {
|
|
10
|
+
if (entry.status === 'archived')
|
|
11
|
+
return { eligible: false, skipReason: 'archived' };
|
|
12
|
+
if (entry.snoozeUntil && new Date(entry.snoozeUntil).getTime() > now.getTime()) {
|
|
13
|
+
return { eligible: false, skipReason: 'snoozed' };
|
|
14
|
+
}
|
|
15
|
+
const lastActive = mostRecent(entry.lastMessageAt, statusTimestamp);
|
|
16
|
+
if (lastActive) {
|
|
17
|
+
const lastActiveMs = new Date(lastActive).getTime();
|
|
18
|
+
const inactiveMs = INACTIVE_AFTER_DAYS * 24 * 60 * 60 * 1000;
|
|
19
|
+
if (now.getTime() - lastActiveMs > inactiveMs) {
|
|
20
|
+
return { eligible: false, skipReason: 'inactive' };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Calendar-day dedup (UTC)
|
|
24
|
+
if (entry.lastDailyReportAt) {
|
|
25
|
+
const lastReport = new Date(entry.lastDailyReportAt);
|
|
26
|
+
if (lastReport.getUTCFullYear() === now.getUTCFullYear() &&
|
|
27
|
+
lastReport.getUTCMonth() === now.getUTCMonth() &&
|
|
28
|
+
lastReport.getUTCDate() === now.getUTCDate()) {
|
|
29
|
+
return { eligible: false, skipReason: 'already-reported-today' };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return { eligible: true };
|
|
33
|
+
}
|
|
34
|
+
// ── Summary builder ──────────────────────────────────────────────────
|
|
35
|
+
const SKIP_ICONS = {
|
|
36
|
+
archived: '\ud83d\udce6', // 📦
|
|
37
|
+
snoozed: '\ud83d\udca4', // 💤
|
|
38
|
+
inactive: '\ud83d\udd07', // 🔇
|
|
39
|
+
'already-reported-today': '\u23f0', // ⏰
|
|
40
|
+
};
|
|
41
|
+
const SKIP_LABELS = {
|
|
42
|
+
archived: 'archived',
|
|
43
|
+
snoozed: 'snoozed',
|
|
44
|
+
inactive: 'inactive',
|
|
45
|
+
'already-reported-today': 'already reported today',
|
|
46
|
+
};
|
|
47
|
+
const SUMMARY_SOFT_LIMIT = 3800;
|
|
48
|
+
export function buildDailyReportAllSummary(data) {
|
|
49
|
+
const { reportedTopics, skippedTopics, postFailures, migrationGroups, errors, } = data;
|
|
50
|
+
if (reportedTopics.length === 0 && skippedTopics.length === 0) {
|
|
51
|
+
return '**Daily Report Summary**\n\nNo topics registered yet.';
|
|
52
|
+
}
|
|
53
|
+
const lines = ['**Daily Report Summary**', ''];
|
|
54
|
+
// ── Reported topics ──
|
|
55
|
+
let renderedCount = 0;
|
|
56
|
+
for (const t of reportedTopics) {
|
|
57
|
+
let icon;
|
|
58
|
+
let label;
|
|
59
|
+
switch (t.status) {
|
|
60
|
+
case 'reported':
|
|
61
|
+
icon = '\u2705'; // ✅
|
|
62
|
+
label = 'reported';
|
|
63
|
+
break;
|
|
64
|
+
case 'post-failed':
|
|
65
|
+
icon = '\u26a0\ufe0f'; // ⚠️
|
|
66
|
+
label = 'failed to post';
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
const line = `${icon} ${t.name} \u2014 ${label}`;
|
|
70
|
+
if (lines.join('\n').length + line.length > SUMMARY_SOFT_LIMIT) {
|
|
71
|
+
const remaining = reportedTopics.length - renderedCount;
|
|
72
|
+
lines.push(`... and ${remaining} more`);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
lines.push(line);
|
|
76
|
+
renderedCount++;
|
|
77
|
+
}
|
|
78
|
+
// ── Skipped topics ──
|
|
79
|
+
if (skippedTopics.length > 0) {
|
|
80
|
+
lines.push('');
|
|
81
|
+
lines.push('\u23ed\ufe0f Skipped:'); // ⏭️
|
|
82
|
+
let skippedRendered = 0;
|
|
83
|
+
for (const t of skippedTopics) {
|
|
84
|
+
const icon = SKIP_ICONS[t.reason];
|
|
85
|
+
const label = SKIP_LABELS[t.reason];
|
|
86
|
+
const line = `${icon} ${t.name} \u2014 ${label}`;
|
|
87
|
+
if (lines.join('\n').length + line.length > SUMMARY_SOFT_LIMIT) {
|
|
88
|
+
const remaining = skippedTopics.length - skippedRendered;
|
|
89
|
+
lines.push(`... and ${remaining} more`);
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
lines.push(line);
|
|
93
|
+
skippedRendered++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// ── Post failures callout ──
|
|
97
|
+
if (postFailures > 0) {
|
|
98
|
+
lines.push('');
|
|
99
|
+
lines.push(`\u26a0\ufe0f ${postFailures} topic(s) failed to post`);
|
|
100
|
+
}
|
|
101
|
+
// ── Migration warning ──
|
|
102
|
+
if (migrationGroups > 0) {
|
|
103
|
+
lines.push('');
|
|
104
|
+
lines.push(`**Warning:** ${migrationGroups} group(s) had all topics fail. The group may have been migrated or deleted.`);
|
|
105
|
+
}
|
|
106
|
+
// ── Errors (internal) ──
|
|
107
|
+
if (errors.length > 0) {
|
|
108
|
+
lines.push('');
|
|
109
|
+
lines.push(`**Errors (${errors.length}):**`);
|
|
110
|
+
for (const e of errors.slice(0, 10)) {
|
|
111
|
+
lines.push(`- ${e}`);
|
|
112
|
+
}
|
|
113
|
+
if (errors.length > 10) {
|
|
114
|
+
lines.push(`... and ${errors.length - 10} more`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return truncateMessage(lines.join('\n'));
|
|
118
|
+
}
|
|
119
|
+
// ── Main handler ─────────────────────────────────────────────────────
|
|
120
|
+
export async function handleDailyReportAll(ctx) {
|
|
121
|
+
const { workspaceDir, logger } = ctx;
|
|
122
|
+
const registry = readRegistry(workspaceDir);
|
|
123
|
+
// Autopilot calls have no Telegram user context — fall back to first admin
|
|
124
|
+
const userId = ctx.userId ?? registry.topicManagerAdmins[0];
|
|
125
|
+
if (!userId) {
|
|
126
|
+
return { text: 'Something went wrong — could not identify your user account.' };
|
|
127
|
+
}
|
|
128
|
+
// Auth check (admin tier)
|
|
129
|
+
const auth = checkAuthorization(userId, 'daily-report-all', registry);
|
|
130
|
+
if (!auth.authorized) {
|
|
131
|
+
return { text: auth.message ?? 'Not authorized.' };
|
|
132
|
+
}
|
|
133
|
+
const now = new Date();
|
|
134
|
+
const projectsBase = path.join(workspaceDir, 'projects');
|
|
135
|
+
const allEntries = Object.entries(registry.topics);
|
|
136
|
+
const reportedTopics = [];
|
|
137
|
+
const skippedTopics = [];
|
|
138
|
+
const errors = [];
|
|
139
|
+
// Group tracking for migration detection
|
|
140
|
+
const groupPostResults = new Map();
|
|
141
|
+
const reports = [];
|
|
142
|
+
for (const [_key, entry] of allEntries) {
|
|
143
|
+
const capsuleDir = path.join(projectsBase, entry.slug);
|
|
144
|
+
const statusContent = readFileOrNull(path.join(capsuleDir, 'STATUS.md'));
|
|
145
|
+
const statusTs = statusContent ? extractStatusTimestamp(statusContent) : null;
|
|
146
|
+
const eligibility = getDailyReportEligibility(entry, now, statusTs);
|
|
147
|
+
if (!eligibility.eligible) {
|
|
148
|
+
skippedTopics.push({ name: entry.name, reason: eligibility.skipReason });
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const doneContent = extractDoneSection(statusContent);
|
|
153
|
+
const blockers = extractBlockers(statusContent);
|
|
154
|
+
const nextContent = extractNextActions(statusContent);
|
|
155
|
+
const reportData = {
|
|
156
|
+
name: entry.name,
|
|
157
|
+
doneContent,
|
|
158
|
+
blockersContent: blockers,
|
|
159
|
+
nextContent,
|
|
160
|
+
};
|
|
161
|
+
const reportText = buildDailyReport(reportData, 'html');
|
|
162
|
+
reports.push({
|
|
163
|
+
slug: entry.slug,
|
|
164
|
+
groupId: entry.groupId,
|
|
165
|
+
threadId: entry.threadId,
|
|
166
|
+
text: reportText,
|
|
167
|
+
});
|
|
168
|
+
// Track group post results for migration detection
|
|
169
|
+
const gk = entry.groupId;
|
|
170
|
+
if (!groupPostResults.has(gk)) {
|
|
171
|
+
groupPostResults.set(gk, { total: 0, failed: 0 });
|
|
172
|
+
}
|
|
173
|
+
groupPostResults.get(gk).total++;
|
|
174
|
+
reportedTopics.push({ name: entry.name, slug: entry.slug, status: 'reported' });
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
178
|
+
errors.push(`${entry.slug}: ${msg}`);
|
|
179
|
+
logger.error(`[daily-report-all] Error processing ${entry.slug}: ${msg}`);
|
|
180
|
+
const gk = entry.groupId;
|
|
181
|
+
if (!groupPostResults.has(gk)) {
|
|
182
|
+
groupPostResults.set(gk, { total: 0, failed: 0 });
|
|
183
|
+
}
|
|
184
|
+
groupPostResults.get(gk).total++;
|
|
185
|
+
groupPostResults.get(gk).failed++;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Migration detection: all topics in a group failed
|
|
189
|
+
const migrationGroups = [];
|
|
190
|
+
for (const [gid, stats] of groupPostResults) {
|
|
191
|
+
if (stats.total > 0 && stats.failed === stats.total) {
|
|
192
|
+
migrationGroups.push(gid);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Fan-out posting
|
|
196
|
+
let postFailures = 0;
|
|
197
|
+
const postFailedSlugs = new Set();
|
|
198
|
+
if (ctx.postFn && reports.length > 0) {
|
|
199
|
+
const rateLimitedPost = createRateLimitedPoster(ctx.postFn);
|
|
200
|
+
for (const report of reports) {
|
|
201
|
+
try {
|
|
202
|
+
await rateLimitedPost(report.groupId, report.threadId, report.text);
|
|
203
|
+
await withRegistry(workspaceDir, (data) => {
|
|
204
|
+
const key = `${report.groupId}:${report.threadId}`;
|
|
205
|
+
const entry = data.topics[key];
|
|
206
|
+
if (entry) {
|
|
207
|
+
entry.lastDailyReportAt = now.toISOString();
|
|
208
|
+
entry.lastPostError = null;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
catch (err) {
|
|
213
|
+
postFailures++;
|
|
214
|
+
postFailedSlugs.add(report.slug);
|
|
215
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
216
|
+
logger.error(`[daily-report-all] Post failed for ${report.slug}: ${msg}`);
|
|
217
|
+
await withRegistry(workspaceDir, (data) => {
|
|
218
|
+
const key = `${report.groupId}:${report.threadId}`;
|
|
219
|
+
const entry = data.topics[key];
|
|
220
|
+
if (entry) {
|
|
221
|
+
entry.lastPostError = msg.slice(0, MAX_POST_ERROR_LENGTH);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Update outcomes for post-failed topics
|
|
227
|
+
for (const outcome of reportedTopics) {
|
|
228
|
+
if (postFailedSlugs.has(outcome.slug) && outcome.status === 'reported') {
|
|
229
|
+
outcome.status = 'post-failed';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
else if (reports.length > 0) {
|
|
234
|
+
// No postFn — still update lastDailyReportAt
|
|
235
|
+
await withRegistry(workspaceDir, (data) => {
|
|
236
|
+
for (const report of reports) {
|
|
237
|
+
const key = `${report.groupId}:${report.threadId}`;
|
|
238
|
+
const entry = data.topics[key];
|
|
239
|
+
if (entry) {
|
|
240
|
+
entry.lastDailyReportAt = now.toISOString();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
text: buildDailyReportAllSummary({
|
|
247
|
+
reportedTopics,
|
|
248
|
+
skippedTopics,
|
|
249
|
+
postFailures,
|
|
250
|
+
migrationGroups: migrationGroups.length,
|
|
251
|
+
errors,
|
|
252
|
+
}),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=daily-report-all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daily-report-all.js","sourceRoot":"","sources":["../../src/commands/daily-report-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,uBA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AC;AACJ,CAAC"}
|
|
@@ -2,6 +2,6 @@ import type { CommandContext, CommandResult } from './help.js';
|
|
|
2
2
|
export declare function handleDailyReport(ctx: CommandContext): Promise<CommandResult>;
|
|
3
3
|
export declare function readFileOrNull(filePath: string): string | null;
|
|
4
4
|
export declare function extractDoneSection(statusContent: string | null): string;
|
|
5
|
-
export declare function extractBlockers(
|
|
5
|
+
export declare function extractBlockers(statusContent: string | null): string;
|
|
6
6
|
export declare function extractNextActions(statusContent: string | null): string;
|
|
7
7
|
//# sourceMappingURL=daily-report.d.ts.map
|