clementine-agent 1.0.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/.env.example +44 -0
- package/LICENSE +21 -0
- package/README.md +795 -0
- package/dist/agent/agent-manager.d.ts +69 -0
- package/dist/agent/agent-manager.js +441 -0
- package/dist/agent/assistant.d.ts +225 -0
- package/dist/agent/assistant.js +3888 -0
- package/dist/agent/auto-update.d.ts +32 -0
- package/dist/agent/auto-update.js +186 -0
- package/dist/agent/daily-planner.d.ts +24 -0
- package/dist/agent/daily-planner.js +379 -0
- package/dist/agent/execution-advisor.d.ts +10 -0
- package/dist/agent/execution-advisor.js +272 -0
- package/dist/agent/hooks.d.ts +45 -0
- package/dist/agent/hooks.js +564 -0
- package/dist/agent/insight-engine.d.ts +66 -0
- package/dist/agent/insight-engine.js +225 -0
- package/dist/agent/intent-classifier.d.ts +48 -0
- package/dist/agent/intent-classifier.js +214 -0
- package/dist/agent/link-extractor.d.ts +19 -0
- package/dist/agent/link-extractor.js +90 -0
- package/dist/agent/mcp-bridge.d.ts +62 -0
- package/dist/agent/mcp-bridge.js +435 -0
- package/dist/agent/metacognition.d.ts +66 -0
- package/dist/agent/metacognition.js +221 -0
- package/dist/agent/orchestrator.d.ts +81 -0
- package/dist/agent/orchestrator.js +790 -0
- package/dist/agent/profiles.d.ts +22 -0
- package/dist/agent/profiles.js +91 -0
- package/dist/agent/prompt-cache.d.ts +24 -0
- package/dist/agent/prompt-cache.js +68 -0
- package/dist/agent/prompt-evolver.d.ts +28 -0
- package/dist/agent/prompt-evolver.js +279 -0
- package/dist/agent/role-scaffolds.d.ts +28 -0
- package/dist/agent/role-scaffolds.js +433 -0
- package/dist/agent/safe-restart.d.ts +41 -0
- package/dist/agent/safe-restart.js +150 -0
- package/dist/agent/self-improve.d.ts +66 -0
- package/dist/agent/self-improve.js +1706 -0
- package/dist/agent/session-event-log.d.ts +114 -0
- package/dist/agent/session-event-log.js +233 -0
- package/dist/agent/skill-extractor.d.ts +72 -0
- package/dist/agent/skill-extractor.js +435 -0
- package/dist/agent/source-mods.d.ts +61 -0
- package/dist/agent/source-mods.js +230 -0
- package/dist/agent/source-preflight.d.ts +25 -0
- package/dist/agent/source-preflight.js +100 -0
- package/dist/agent/stall-guard.d.ts +62 -0
- package/dist/agent/stall-guard.js +109 -0
- package/dist/agent/strategic-planner.d.ts +60 -0
- package/dist/agent/strategic-planner.js +352 -0
- package/dist/agent/team-bus.d.ts +89 -0
- package/dist/agent/team-bus.js +556 -0
- package/dist/agent/team-router.d.ts +26 -0
- package/dist/agent/team-router.js +37 -0
- package/dist/agent/tool-loop-detector.d.ts +59 -0
- package/dist/agent/tool-loop-detector.js +242 -0
- package/dist/agent/workflow-runner.d.ts +36 -0
- package/dist/agent/workflow-runner.js +317 -0
- package/dist/agent/workflow-variables.d.ts +16 -0
- package/dist/agent/workflow-variables.js +62 -0
- package/dist/channels/discord-agent-bot.d.ts +101 -0
- package/dist/channels/discord-agent-bot.js +881 -0
- package/dist/channels/discord-bot-manager.d.ts +80 -0
- package/dist/channels/discord-bot-manager.js +262 -0
- package/dist/channels/discord-utils.d.ts +51 -0
- package/dist/channels/discord-utils.js +293 -0
- package/dist/channels/discord.d.ts +12 -0
- package/dist/channels/discord.js +1832 -0
- package/dist/channels/slack-agent-bot.d.ts +73 -0
- package/dist/channels/slack-agent-bot.js +320 -0
- package/dist/channels/slack-bot-manager.d.ts +66 -0
- package/dist/channels/slack-bot-manager.js +236 -0
- package/dist/channels/slack-utils.d.ts +39 -0
- package/dist/channels/slack-utils.js +189 -0
- package/dist/channels/slack.d.ts +11 -0
- package/dist/channels/slack.js +196 -0
- package/dist/channels/telegram.d.ts +10 -0
- package/dist/channels/telegram.js +235 -0
- package/dist/channels/webhook.d.ts +9 -0
- package/dist/channels/webhook.js +78 -0
- package/dist/channels/whatsapp.d.ts +11 -0
- package/dist/channels/whatsapp.js +181 -0
- package/dist/cli/chat.d.ts +14 -0
- package/dist/cli/chat.js +220 -0
- package/dist/cli/cron.d.ts +17 -0
- package/dist/cli/cron.js +552 -0
- package/dist/cli/dashboard.d.ts +15 -0
- package/dist/cli/dashboard.js +17677 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +2474 -0
- package/dist/cli/routes/delegations.d.ts +19 -0
- package/dist/cli/routes/delegations.js +154 -0
- package/dist/cli/routes/digest.d.ts +17 -0
- package/dist/cli/routes/digest.js +375 -0
- package/dist/cli/routes/goals.d.ts +14 -0
- package/dist/cli/routes/goals.js +258 -0
- package/dist/cli/routes/workflows.d.ts +18 -0
- package/dist/cli/routes/workflows.js +97 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +619 -0
- package/dist/cli/tunnel.d.ts +35 -0
- package/dist/cli/tunnel.js +141 -0
- package/dist/config.d.ts +145 -0
- package/dist/config.js +278 -0
- package/dist/events/bus.d.ts +43 -0
- package/dist/events/bus.js +136 -0
- package/dist/gateway/cron-scheduler.d.ts +166 -0
- package/dist/gateway/cron-scheduler.js +1767 -0
- package/dist/gateway/delivery-queue.d.ts +30 -0
- package/dist/gateway/delivery-queue.js +110 -0
- package/dist/gateway/heartbeat-scheduler.d.ts +99 -0
- package/dist/gateway/heartbeat-scheduler.js +1298 -0
- package/dist/gateway/heartbeat.d.ts +3 -0
- package/dist/gateway/heartbeat.js +3 -0
- package/dist/gateway/lanes.d.ts +24 -0
- package/dist/gateway/lanes.js +76 -0
- package/dist/gateway/notifications.d.ts +29 -0
- package/dist/gateway/notifications.js +75 -0
- package/dist/gateway/router.d.ts +210 -0
- package/dist/gateway/router.js +1330 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1015 -0
- package/dist/memory/chunker.d.ts +28 -0
- package/dist/memory/chunker.js +226 -0
- package/dist/memory/consolidation.d.ts +44 -0
- package/dist/memory/consolidation.js +171 -0
- package/dist/memory/context-assembler.d.ts +50 -0
- package/dist/memory/context-assembler.js +149 -0
- package/dist/memory/embeddings.d.ts +38 -0
- package/dist/memory/embeddings.js +180 -0
- package/dist/memory/graph-store.d.ts +66 -0
- package/dist/memory/graph-store.js +613 -0
- package/dist/memory/mmr.d.ts +21 -0
- package/dist/memory/mmr.js +75 -0
- package/dist/memory/search.d.ts +26 -0
- package/dist/memory/search.js +67 -0
- package/dist/memory/store.d.ts +530 -0
- package/dist/memory/store.js +2022 -0
- package/dist/security/integrity.d.ts +24 -0
- package/dist/security/integrity.js +58 -0
- package/dist/security/patterns.d.ts +34 -0
- package/dist/security/patterns.js +110 -0
- package/dist/security/scanner.d.ts +32 -0
- package/dist/security/scanner.js +263 -0
- package/dist/tools/admin-tools.d.ts +12 -0
- package/dist/tools/admin-tools.js +1278 -0
- package/dist/tools/external-tools.d.ts +11 -0
- package/dist/tools/external-tools.js +1327 -0
- package/dist/tools/goal-tools.d.ts +9 -0
- package/dist/tools/goal-tools.js +159 -0
- package/dist/tools/mcp-server.d.ts +13 -0
- package/dist/tools/mcp-server.js +141 -0
- package/dist/tools/memory-tools.d.ts +10 -0
- package/dist/tools/memory-tools.js +568 -0
- package/dist/tools/session-tools.d.ts +6 -0
- package/dist/tools/session-tools.js +146 -0
- package/dist/tools/shared.d.ts +216 -0
- package/dist/tools/shared.js +340 -0
- package/dist/tools/team-tools.d.ts +6 -0
- package/dist/tools/team-tools.js +447 -0
- package/dist/tools/tool-meta.d.ts +34 -0
- package/dist/tools/tool-meta.js +133 -0
- package/dist/tools/vault-tools.d.ts +8 -0
- package/dist/tools/vault-tools.js +457 -0
- package/dist/types.d.ts +716 -0
- package/dist/types.js +16 -0
- package/dist/vault-migrations/0001-add-execution-framework.d.ts +10 -0
- package/dist/vault-migrations/0001-add-execution-framework.js +47 -0
- package/dist/vault-migrations/0002-add-agentic-communication.d.ts +12 -0
- package/dist/vault-migrations/0002-add-agentic-communication.js +79 -0
- package/dist/vault-migrations/0003-update-execution-pipeline-narration.d.ts +11 -0
- package/dist/vault-migrations/0003-update-execution-pipeline-narration.js +73 -0
- package/dist/vault-migrations/helpers.d.ts +14 -0
- package/dist/vault-migrations/helpers.js +44 -0
- package/dist/vault-migrations/runner.d.ts +14 -0
- package/dist/vault-migrations/runner.js +139 -0
- package/dist/vault-migrations/types.d.ts +42 -0
- package/dist/vault-migrations/types.js +9 -0
- package/install.sh +320 -0
- package/package.json +84 -0
- package/scripts/postinstall.js +125 -0
- package/vault/00-System/AGENTS.md +66 -0
- package/vault/00-System/CRON.md +71 -0
- package/vault/00-System/HEARTBEAT.md +58 -0
- package/vault/00-System/MEMORY.md +16 -0
- package/vault/00-System/SOUL.md +96 -0
- package/vault/05-Tasks/TASKS.md +19 -0
- package/vault/06-Templates/_Daily-Template.md +28 -0
- package/vault/06-Templates/_People-Template.md +22 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clementine TypeScript — Event Bus.
|
|
3
|
+
*
|
|
4
|
+
* Typed pub/sub system for decoupling gateway lifecycle events from consumers.
|
|
5
|
+
* Plugins, logging, metrics, and UI can subscribe without modifying core code.
|
|
6
|
+
*
|
|
7
|
+
* Events are fire-and-forget (async handlers don't block the emitter).
|
|
8
|
+
* "before" events return a boolean — false cancels the operation.
|
|
9
|
+
*/
|
|
10
|
+
import pino from 'pino';
|
|
11
|
+
const logger = pino({ name: 'clementine.events' });
|
|
12
|
+
class EventBus {
|
|
13
|
+
listeners = new Map();
|
|
14
|
+
beforeHandlers = new Map();
|
|
15
|
+
/**
|
|
16
|
+
* Subscribe to an event. Handler is called asynchronously (fire-and-forget).
|
|
17
|
+
* Returns an unsubscribe function.
|
|
18
|
+
*/
|
|
19
|
+
on(event, handler) {
|
|
20
|
+
const subs = this.listeners.get(event) ?? [];
|
|
21
|
+
const sub = { handler: handler, once: false };
|
|
22
|
+
subs.push(sub);
|
|
23
|
+
this.listeners.set(event, subs);
|
|
24
|
+
return () => {
|
|
25
|
+
const list = this.listeners.get(event);
|
|
26
|
+
if (list) {
|
|
27
|
+
const idx = list.indexOf(sub);
|
|
28
|
+
if (idx !== -1)
|
|
29
|
+
list.splice(idx, 1);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Subscribe to an event, but only fire once. */
|
|
34
|
+
once(event, handler) {
|
|
35
|
+
const subs = this.listeners.get(event) ?? [];
|
|
36
|
+
const sub = { handler: handler, once: true };
|
|
37
|
+
subs.push(sub);
|
|
38
|
+
this.listeners.set(event, subs);
|
|
39
|
+
return () => {
|
|
40
|
+
const list = this.listeners.get(event);
|
|
41
|
+
if (list) {
|
|
42
|
+
const idx = list.indexOf(sub);
|
|
43
|
+
if (idx !== -1)
|
|
44
|
+
list.splice(idx, 1);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Register a "before" handler that can cancel an operation.
|
|
50
|
+
* If any before handler returns false, the operation is cancelled.
|
|
51
|
+
*/
|
|
52
|
+
before(event, handler) {
|
|
53
|
+
const handlers = this.beforeHandlers.get(event) ?? [];
|
|
54
|
+
const entry = { handler: handler, once: false };
|
|
55
|
+
handlers.push(entry);
|
|
56
|
+
this.beforeHandlers.set(event, handlers);
|
|
57
|
+
return () => {
|
|
58
|
+
const list = this.beforeHandlers.get(event);
|
|
59
|
+
if (list) {
|
|
60
|
+
const idx = list.findIndex(e => e === entry);
|
|
61
|
+
if (idx !== -1)
|
|
62
|
+
list.splice(idx, 1);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Emit an event asynchronously. Handlers run in parallel, errors are logged but don't propagate.
|
|
68
|
+
*/
|
|
69
|
+
emit(event, payload) {
|
|
70
|
+
const subs = this.listeners.get(event);
|
|
71
|
+
if (!subs || subs.length === 0)
|
|
72
|
+
return;
|
|
73
|
+
// Snapshot handlers and remove once-listeners
|
|
74
|
+
const handlers = [...subs];
|
|
75
|
+
for (let i = subs.length - 1; i >= 0; i--) {
|
|
76
|
+
if (subs[i].once)
|
|
77
|
+
subs.splice(i, 1);
|
|
78
|
+
}
|
|
79
|
+
for (const sub of handlers) {
|
|
80
|
+
try {
|
|
81
|
+
const result = sub.handler(payload);
|
|
82
|
+
if (result instanceof Promise) {
|
|
83
|
+
result.catch(err => logger.warn({ err, event }, 'Event handler error'));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
logger.warn({ err, event }, 'Event handler error (sync)');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Run "before" handlers sequentially. Returns true if all pass, false if any cancels.
|
|
93
|
+
*/
|
|
94
|
+
async emitBefore(event, payload) {
|
|
95
|
+
const handlers = this.beforeHandlers.get(event);
|
|
96
|
+
if (!handlers || handlers.length === 0)
|
|
97
|
+
return true;
|
|
98
|
+
for (const entry of [...handlers]) {
|
|
99
|
+
try {
|
|
100
|
+
const result = entry.handler(payload);
|
|
101
|
+
const allowed = result instanceof Promise ? await result : result;
|
|
102
|
+
if (!allowed) {
|
|
103
|
+
logger.info({ event }, 'Operation cancelled by before handler');
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
logger.warn({ err, event }, 'Before handler error — allowing operation');
|
|
109
|
+
}
|
|
110
|
+
if (entry.once) {
|
|
111
|
+
const idx = handlers.indexOf(entry);
|
|
112
|
+
if (idx !== -1)
|
|
113
|
+
handlers.splice(idx, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
/** Remove all listeners for an event, or all events if no event specified. */
|
|
119
|
+
clear(event) {
|
|
120
|
+
if (event) {
|
|
121
|
+
this.listeners.delete(event);
|
|
122
|
+
this.beforeHandlers.delete(event);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.listeners.clear();
|
|
126
|
+
this.beforeHandlers.clear();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Get count of listeners for an event (useful for debugging). */
|
|
130
|
+
listenerCount(event) {
|
|
131
|
+
return (this.listeners.get(event)?.length ?? 0) + (this.beforeHandlers.get(event)?.length ?? 0);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Singleton event bus — shared across the entire process. */
|
|
135
|
+
export const events = new EventBus();
|
|
136
|
+
//# sourceMappingURL=bus.js.map
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clementine TypeScript — Cron scheduler (autonomous execution).
|
|
3
|
+
*
|
|
4
|
+
* CronScheduler: precise scheduled tasks using node-cron
|
|
5
|
+
*
|
|
6
|
+
* Also contains shared parsers (parseCronJobs, parseAgentCronJobs, validateCronYaml),
|
|
7
|
+
* retry helpers, CronRunLog, and daily-note logging utilities used by both schedulers.
|
|
8
|
+
*/
|
|
9
|
+
import type { CronJobDefinition, CronRunEntry, SelfImproveConfig, SelfImproveExperiment, SelfImproveState, WorkflowDefinition } from '../types.js';
|
|
10
|
+
import type { NotificationDispatcher } from './notifications.js';
|
|
11
|
+
import type { Gateway } from './router.js';
|
|
12
|
+
/** Local-time YYYY-MM-DD for daily note path. */
|
|
13
|
+
export declare function todayISO(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Append a line to today's daily note under ## Interactions.
|
|
16
|
+
* Creates the section if it doesn't exist. Non-fatal — never throws.
|
|
17
|
+
*/
|
|
18
|
+
export declare function logToDailyNote(line: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Parse cron job definitions from vault/00-System/CRON.md frontmatter.
|
|
21
|
+
* Used by both the in-process CronScheduler and the standalone CLI runner.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseCronJobs(): CronJobDefinition[];
|
|
24
|
+
/**
|
|
25
|
+
* Parse cron jobs from agent-scoped CRON.md files.
|
|
26
|
+
* Scans each agent subdirectory for CRON.md, prefixes job names with agent slug.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseAgentCronJobs(agentsDir: string): CronJobDefinition[];
|
|
29
|
+
/**
|
|
30
|
+
* Validate that a CRON.md string parses without YAML errors.
|
|
31
|
+
* Call this before writing to prevent corrupted files from crashing the daemon.
|
|
32
|
+
* Returns null on success, or the error message on failure.
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateCronYaml(content: string): string | null;
|
|
35
|
+
export declare function classifyError(err: unknown): 'transient' | 'permanent';
|
|
36
|
+
/**
|
|
37
|
+
* Classify a TerminalReason from the SDK into a retry strategy.
|
|
38
|
+
* More precise than classifyError() which relies on regex.
|
|
39
|
+
*/
|
|
40
|
+
export declare function classifyTerminalReason(reason: string): 'transient' | 'permanent';
|
|
41
|
+
/**
|
|
42
|
+
* JSONL-based per-job run log. Auto-prunes to keep files under 2 MB
|
|
43
|
+
* and 2000 lines (whichever limit hits first).
|
|
44
|
+
*/
|
|
45
|
+
export declare class CronRunLog {
|
|
46
|
+
private readonly dir;
|
|
47
|
+
private static readonly MAX_BYTES;
|
|
48
|
+
private static readonly MAX_LINES;
|
|
49
|
+
constructor(baseDir?: string);
|
|
50
|
+
private logPath;
|
|
51
|
+
append(entry: CronRunEntry): void;
|
|
52
|
+
readRecent(jobName: string, count?: number): CronRunEntry[];
|
|
53
|
+
consecutiveErrors(jobName: string): number;
|
|
54
|
+
private maybePrune;
|
|
55
|
+
}
|
|
56
|
+
export declare class CronScheduler {
|
|
57
|
+
private gateway;
|
|
58
|
+
private dispatcher;
|
|
59
|
+
private jobs;
|
|
60
|
+
private disabledJobs;
|
|
61
|
+
private scheduledTasks;
|
|
62
|
+
private runningJobs;
|
|
63
|
+
private completedJobs;
|
|
64
|
+
private watching;
|
|
65
|
+
readonly runLog: CronRunLog;
|
|
66
|
+
private workflowDefs;
|
|
67
|
+
private workflowTasks;
|
|
68
|
+
private runningWorkflows;
|
|
69
|
+
private watchingWorkflows;
|
|
70
|
+
private triggerDir;
|
|
71
|
+
private goalTriggerDir;
|
|
72
|
+
private triggerTimer;
|
|
73
|
+
private statusChangeListeners;
|
|
74
|
+
constructor(gateway: Gateway, dispatcher: NotificationDispatcher);
|
|
75
|
+
/** Load job definitions from CRON.md and agent dirs without scheduling tasks. */
|
|
76
|
+
private loadJobDefinitions;
|
|
77
|
+
/** Register a listener that fires when system state changes (job start/finish, self-improve, etc). */
|
|
78
|
+
onStatusChange(cb: () => void): void;
|
|
79
|
+
private emitStatusChange;
|
|
80
|
+
start(): void;
|
|
81
|
+
stop(): void;
|
|
82
|
+
/** Watch CRON.md for changes and auto-reload jobs. */
|
|
83
|
+
private watchCronFile;
|
|
84
|
+
private unwatchCronFile;
|
|
85
|
+
/** Watch agents directory for cron/workflow changes and auto-reload. */
|
|
86
|
+
private watchingAgents;
|
|
87
|
+
private watchAgentsDir;
|
|
88
|
+
private unwatchAgentsDir;
|
|
89
|
+
reloadJobs(): void;
|
|
90
|
+
private runJob;
|
|
91
|
+
/**
|
|
92
|
+
* Log an advisor event to the events JSONL file for dashboard surfacing.
|
|
93
|
+
*/
|
|
94
|
+
private logAdvisorEvent;
|
|
95
|
+
/**
|
|
96
|
+
* Check if an agent's recent cron reflections show consistently low quality.
|
|
97
|
+
* If the last N runs average below the threshold, auto-append a "lessons learned"
|
|
98
|
+
* section to the agent's profile. This is additive (not destructive) — it
|
|
99
|
+
* only appends insights, never overwrites the core agent prompt.
|
|
100
|
+
*/
|
|
101
|
+
private checkAgentLearning;
|
|
102
|
+
runManual(jobName: string): Promise<string>;
|
|
103
|
+
/** Filter out cron responses that are truly empty or nothing-to-report. */
|
|
104
|
+
/** Strip internal reasoning/thinking prefixes from cron output before sending to Discord. */
|
|
105
|
+
private static stripThinkingPrefixes;
|
|
106
|
+
private static isCronNoise;
|
|
107
|
+
/** Format cron error messages for clean notifications. */
|
|
108
|
+
private static formatCronError;
|
|
109
|
+
listJobs(): string;
|
|
110
|
+
getJobNames(): string[];
|
|
111
|
+
getJob(jobName: string): CronJobDefinition | undefined;
|
|
112
|
+
isJobRunning(jobName: string): boolean;
|
|
113
|
+
getRunningJobs(): string[];
|
|
114
|
+
getRunningWorkflowNames(): string[];
|
|
115
|
+
/** Return all job definitions with enabled/disabled state for the status embed. */
|
|
116
|
+
getJobDefinitions(): Array<CronJobDefinition & {
|
|
117
|
+
active: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
/** Get today's run stats: total runs, successes, failures (since local midnight). */
|
|
120
|
+
getTodayStats(): {
|
|
121
|
+
total: number;
|
|
122
|
+
ok: number;
|
|
123
|
+
errors: number;
|
|
124
|
+
skipped: number;
|
|
125
|
+
};
|
|
126
|
+
disableJob(jobName: string): string;
|
|
127
|
+
enableJob(jobName: string): string;
|
|
128
|
+
reloadWorkflows(): void;
|
|
129
|
+
private watchWorkflowDir;
|
|
130
|
+
private unwatchWorkflowDir;
|
|
131
|
+
/** Watch the triggers directory for MCP-initiated job runs and goal work sessions. */
|
|
132
|
+
private watchTriggers;
|
|
133
|
+
/** Process any pending trigger files and run the corresponding jobs. */
|
|
134
|
+
private processTriggers;
|
|
135
|
+
/** Process any pending goal work trigger files. Routes through the execution advisor. */
|
|
136
|
+
private processGoalTriggers;
|
|
137
|
+
/**
|
|
138
|
+
* Log goal work session outcome to a per-goal progress JSONL file.
|
|
139
|
+
* Creates the causal link: "action X was attempted for goal Y, result was Z."
|
|
140
|
+
*/
|
|
141
|
+
private logGoalOutcome;
|
|
142
|
+
/**
|
|
143
|
+
* Apply non-destructive cron changes suggested by the daily planner.
|
|
144
|
+
* Only auto-applies suggestions that reference a high-priority goal with autoSchedule=true.
|
|
145
|
+
* Supports: 'add' (new job), 'enable', 'disable'. Does NOT support 'delete' or 'modify'.
|
|
146
|
+
*/
|
|
147
|
+
applySuggestedCronChanges(suggestions: Array<{
|
|
148
|
+
job: string;
|
|
149
|
+
change: string;
|
|
150
|
+
reason: string;
|
|
151
|
+
}>): void;
|
|
152
|
+
runWorkflow(name: string, inputs?: Record<string, string>): Promise<string>;
|
|
153
|
+
getWorkflowNames(): string[];
|
|
154
|
+
getWorkflow(name: string): WorkflowDefinition | undefined;
|
|
155
|
+
isWorkflowRunning(name: string): boolean;
|
|
156
|
+
listWorkflows(): string;
|
|
157
|
+
runSelfImproveLoop(config?: Partial<SelfImproveConfig>, onProposal?: (experiment: SelfImproveExperiment) => Promise<void>): Promise<SelfImproveState>;
|
|
158
|
+
applySelfImproveChange(experimentId: string): Promise<string>;
|
|
159
|
+
denySelfImproveChange(experimentId: string): string;
|
|
160
|
+
getSelfImproveStatus(): SelfImproveState;
|
|
161
|
+
getSelfImproveHistory(limit?: number): SelfImproveExperiment[];
|
|
162
|
+
getSelfImprovePending(): Array<SelfImproveExperiment & {
|
|
163
|
+
before: string;
|
|
164
|
+
}>;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=cron-scheduler.d.ts.map
|