@curie-agent/core 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/src/compaction.d.ts +76 -0
  3. package/dist/src/compaction.d.ts.map +1 -0
  4. package/dist/src/compaction.js +229 -0
  5. package/dist/src/compaction.js.map +1 -0
  6. package/dist/src/context-budget.d.ts +72 -0
  7. package/dist/src/context-budget.d.ts.map +1 -0
  8. package/dist/src/context-budget.js +132 -0
  9. package/dist/src/context-budget.js.map +1 -0
  10. package/dist/src/event-bus.d.ts +20 -0
  11. package/dist/src/event-bus.d.ts.map +1 -1
  12. package/dist/src/event-bus.js.map +1 -1
  13. package/dist/src/index.d.ts +8 -5
  14. package/dist/src/index.d.ts.map +1 -1
  15. package/dist/src/index.js +6 -4
  16. package/dist/src/index.js.map +1 -1
  17. package/dist/src/reminder-parser.d.ts +6 -0
  18. package/dist/src/reminder-parser.d.ts.map +1 -1
  19. package/dist/src/reminder-parser.js +85 -105
  20. package/dist/src/reminder-parser.js.map +1 -1
  21. package/dist/src/settings.d.ts +13 -0
  22. package/dist/src/settings.d.ts.map +1 -1
  23. package/dist/src/settings.js +37 -12
  24. package/dist/src/settings.js.map +1 -1
  25. package/dist/src/subagent-executor.d.ts +8 -0
  26. package/dist/src/subagent-executor.d.ts.map +1 -1
  27. package/dist/src/subagent-executor.js +20 -6
  28. package/dist/src/subagent-executor.js.map +1 -1
  29. package/dist/src/task-manager.d.ts +53 -12
  30. package/dist/src/task-manager.d.ts.map +1 -1
  31. package/dist/src/task-manager.js +225 -124
  32. package/dist/src/task-manager.js.map +1 -1
  33. package/dist/src/task-migration.d.ts +29 -2
  34. package/dist/src/task-migration.d.ts.map +1 -1
  35. package/dist/src/task-migration.js +115 -7
  36. package/dist/src/task-migration.js.map +1 -1
  37. package/dist/src/turn-loop.d.ts +22 -2
  38. package/dist/src/turn-loop.d.ts.map +1 -1
  39. package/dist/src/turn-loop.js +222 -95
  40. package/dist/src/turn-loop.js.map +1 -1
  41. package/package.json +1 -1
  42. package/templates/settings.json +100 -91
  43. package/dist/src/cron-manager.d.ts +0 -92
  44. package/dist/src/cron-manager.d.ts.map +0 -1
  45. package/dist/src/cron-manager.js +0 -410
  46. package/dist/src/cron-manager.js.map +0 -1
  47. package/dist/src/task-executor.d.ts +0 -31
  48. package/dist/src/task-executor.d.ts.map +0 -1
  49. package/dist/src/task-executor.js +0 -91
  50. package/dist/src/task-executor.js.map +0 -1
  51. package/dist/src/token-monitor.d.ts +0 -50
  52. package/dist/src/token-monitor.d.ts.map +0 -1
  53. package/dist/src/token-monitor.js +0 -119
  54. package/dist/src/token-monitor.js.map +0 -1
@@ -1,91 +1,100 @@
1
- {
2
- "model": "qwen3.6-27B-MTP",
3
- "effort": "high",
4
- "mode": "auto",
5
- "theme": "gruvbox",
6
- "statusline": true,
7
- "debug": false,
8
- "current_provider": "local",
9
- "providers": {
10
- "anthropic": {
11
- "api_key": "sk-12345",
12
- "url": "https://api.anthropic.com",
13
- "model": "claude-sonnet-4-6",
14
- "model_cost": "3;15",
15
- "model_context_window": 1000000
16
- },
17
- "openai": {
18
- "api_key": "sk-12345",
19
- "url": "https://api.openai.com/v1",
20
- "model": "gpt-5.4",
21
- "model_cost": "2.5;15|272000<5;22.5",
22
- "model_context_window": 1000000
23
- },
24
- "openrouter": {
25
- "api_key": "sk-12345",
26
- "url": "https://openrouter.ai/api/v1",
27
- "model": "qwen/qwen3.6-plus",
28
- "model_cost": "0.325;1.95|256000<1.3;3.9",
29
- "model_context_window": 1000000
30
- },
31
- "google": {
32
- "api_key": "sk-12345",
33
- "url": " https://generativelanguage.googleapis.com",
34
- "model": "gemini-3-flash-preview",
35
- "model_cost": "0.5;3",
36
- "model_context_window": 1000000
37
- },
38
- "ollama": {
39
- "api_key": "sk-12345",
40
- "url": "http://192.168.255.235:11434/api",
41
- "model": "gemma4-31B",
42
- "model_cost": "0;0",
43
- "model_context_window": 262144
44
- },
45
- "local": {
46
- "api_key": "sk-12345",
47
- "url": "http://172.26.217.161:8080",
48
- "model": "qwen3.6-27B-MTP",
49
- "model_cost": "0;0",
50
- "model_context_window": 262144
51
- }
52
- },
53
- "channels": {
54
- "bot_token": "012345",
55
- "user_id": "012345",
56
- "chat_id": "012345",
57
- "allow_groups": false,
58
- "tab_active": "telegram:012345"
59
- },
60
- "tools_per_call": 20,
61
- "websearch_per_call": 10,
62
- "system_prompt_files": ["AGENTS.md", "SOUL.md", "USER.md", "MEMORY.md"],
63
- "brave_search_api_key": "BSAP012345",
64
- "heartbeat": {
65
- "schedule": "on",
66
- "mode": "auto",
67
- "intraday": "7:55,9:55,11:55,13:55,15:55,17:55",
68
- "daily": "7:15",
69
- "weekly": "friday@21:00",
70
- "monthly": "1@6:50",
71
- "dreaming": "23:01"
72
- },
73
- "mcp_servers": {
74
-
75
- },
76
- "safety": {
77
- "path_guard": "on",
78
- "path_allowlist": [],
79
- "command_guard": "on",
80
- "snapshots": "on"
81
- },
82
- "auto_compact": {
83
- "enabled": "on",
84
- "threshold": 75,
85
- "warn_threshold": 60,
86
- "forced_threshold": 85
87
- },
88
- "pricing_tier_warn": "on",
89
- "web_ip": "0.0.0.0",
90
- "daemon_token": "012345"
91
- }
1
+ {
2
+ "model": "qwen3.6-27B-MTP",
3
+ "effort": "high",
4
+ "mode": "auto",
5
+ "theme": "gruvbox",
6
+ "statusline": true,
7
+ "debug": false,
8
+ "current_provider": "local",
9
+ "providers": {
10
+ "anthropic": {
11
+ "api_key": "sk-12345",
12
+ "url": "https://api.anthropic.com",
13
+ "model": "claude-sonnet-4-6",
14
+ "model_cost": "3;15",
15
+ "model_context_window": 1000000,
16
+ "max_output_tokens": 32768
17
+ },
18
+ "openai": {
19
+ "api_key": "sk-12345",
20
+ "url": "https://api.openai.com/v1",
21
+ "model": "gpt-5.4",
22
+ "model_cost": "2.5;15|272000<5;22.5",
23
+ "model_context_window": 1000000,
24
+ "max_output_tokens": 32768
25
+ },
26
+ "openrouter": {
27
+ "api_key": "sk-12345",
28
+ "url": "https://openrouter.ai/api/v1",
29
+ "model": "qwen/qwen3.6-plus",
30
+ "model_cost": "0.325;1.95|256000<1.3;3.9",
31
+ "model_context_window": 1000000,
32
+ "max_output_tokens": 32768
33
+ },
34
+ "google": {
35
+ "api_key": "sk-12345",
36
+ "url": " https://generativelanguage.googleapis.com",
37
+ "model": "gemini-3-flash-preview",
38
+ "model_cost": "0.5;3",
39
+ "model_context_window": 1000000,
40
+ "max_output_tokens": 32768
41
+ },
42
+ "ollama": {
43
+ "api_key": "sk-12345",
44
+ "url": "http://192.168.255.235:11434/api",
45
+ "model": "gemma4-31B",
46
+ "model_cost": "0;0",
47
+ "model_context_window": 262144,
48
+ "max_output_tokens": 8192
49
+ },
50
+ "local": {
51
+ "api_key": "sk-12345",
52
+ "url": "http://172.26.217.161:8080",
53
+ "model": "qwen3.6-27B-MTP",
54
+ "model_cost": "0;0",
55
+ "model_context_window": 262144,
56
+ "max_output_tokens": 8192
57
+ }
58
+ },
59
+ "channels": {
60
+ "bot_token": "012345",
61
+ "user_id": "012345",
62
+ "chat_id": "012345",
63
+ "allow_groups": false,
64
+ "tab_active": "telegram:012345"
65
+ },
66
+ "tools_per_call": 20,
67
+ "websearch_per_call": 10,
68
+ "tools_per_run": 200,
69
+ "websearch_per_run": 60,
70
+ "system_prompt_files": ["AGENTS.md", "SOUL.md", "USER.md", "MEMORY.md"],
71
+ "brave_search_api_key": "BSAP012345",
72
+ "heartbeat": {
73
+ "schedule": "on",
74
+ "mode": "auto",
75
+ "intraday": "7:55,9:55,11:55,13:55,15:55,17:55",
76
+ "daily": "7:15",
77
+ "weekly": "friday@21:00",
78
+ "monthly": "1@6:50",
79
+ "dreaming": "23:01"
80
+ },
81
+ "mcp_servers": {
82
+
83
+ },
84
+ "safety": {
85
+ "path_guard": "on",
86
+ "path_allowlist": [],
87
+ "command_guard": "on",
88
+ "snapshots": "on"
89
+ },
90
+ "auto_compact": {
91
+ "enabled": "on",
92
+ "threshold": 75,
93
+ "warn_threshold": 60,
94
+ "forced_threshold": 85,
95
+ "model": ""
96
+ },
97
+ "pricing_tier_warn": "on",
98
+ "web_ip": "0.0.0.0",
99
+ "daemon_token": "012345"
100
+ }
@@ -1,92 +0,0 @@
1
- export type ScheduleType = 'intraday' | 'daily' | 'weekly' | 'monthly' | 'dreaming';
2
- /** Human-readable label for a schedule type. */
3
- export declare function scheduleLabel(type: ScheduleType): string;
4
- export type CronTaskType = 'reminder' | 'heartbeat' | 'task';
5
- export type CronTaskStatus = 'pending' | 'fired' | 'executing' | 'completed' | 'failed' | 'cancelled';
6
- export interface CronTask {
7
- id: string;
8
- type: CronTaskType;
9
- scheduledAt: number;
10
- message: string;
11
- /** Schedule definition for heartbeat tasks. */
12
- schedule?: {
13
- type: ScheduleType;
14
- value: string;
15
- };
16
- status: CronTaskStatus;
17
- createdAt: number;
18
- /** Populated when a task finishes execution. */
19
- completedAt?: number;
20
- /** Optional metadata to route notifications to the originating session. */
21
- sessionId?: string;
22
- }
23
- export interface CronFile {
24
- version: 1;
25
- tasks: CronTask[];
26
- }
27
- type ReminderCallback = (task: CronTask) => void | Promise<void>;
28
- type DebugCallback = (message: string) => void;
29
- interface DebugCallbackHolder {
30
- current: DebugCallback | null | undefined;
31
- }
32
- /** Compute the next fire time for a schedule. Returns epoch ms. */
33
- export declare function computeNextFire(schedule: CronTask['schedule'], now: number): number;
34
- /**
35
- * Evaluate all four heartbeat schedule settings and return the one
36
- * with the earliest next fire time. Returns null if all are empty.
37
- */
38
- export declare function pickNextSchedule(settings: {
39
- HEARTBEAT_INTRADAY?: string;
40
- HEARTBEAT_DAILY?: string;
41
- HEARTBEAT_WEEKLY?: string;
42
- HEARTBEAT_MONTHLY?: string;
43
- HEARTBEAT_DREAMING?: string;
44
- }, now?: number): {
45
- type: ScheduleType;
46
- value: string;
47
- } | null;
48
- export declare class CronManager {
49
- private data;
50
- private checkerTimer;
51
- private onReminderFired;
52
- private debugHolder;
53
- private ttlMs;
54
- private filePath;
55
- /** Set of task IDs currently being executed (prevents re-firing). */
56
- private executing;
57
- constructor(ttlMsOrFilePath?: number | string, filePath?: string);
58
- load(): CronFile;
59
- save(): void;
60
- createReminder(message: string, scheduledAt: number, sessionId?: string): CronTask;
61
- cancelReminder(id: string): boolean;
62
- listReminders(filter?: CronTaskStatus): CronTask[];
63
- clearCompleted(): number;
64
- createTask(message: string, scheduledAt: number): CronTask;
65
- updateTaskStatus(id: string, status: 'executing' | 'completed' | 'failed'): boolean;
66
- listTasks(filter?: 'pending' | 'executing' | 'completed' | 'failed' | 'cancelled'): CronTask[];
67
- /** Remove fired/cancelled tasks older than the cutoff. Pending tasks always kept. */
68
- pruneOld(cutoff: number): number;
69
- createHeartbeat(message: string, schedule: {
70
- type: ScheduleType;
71
- value: string;
72
- }): CronTask;
73
- /** Update the schedule of all pending heartbeat tasks matching the given schedule type. */
74
- updateHeartbeatSchedule(scheduleType: ScheduleType, value: string): void;
75
- /**
76
- * Find the unified heartbeat task and re-evaluate all four schedule
77
- * settings to pick the next earliest fire time. Called after a
78
- * schedule setting changes or after a heartbeat fires.
79
- */
80
- rescheduleFromSettings(settings: {
81
- HEARTBEAT_INTRADAY?: string;
82
- HEARTBEAT_DAILY?: string;
83
- HEARTBEAT_WEEKLY?: string;
84
- HEARTBEAT_MONTHLY?: string;
85
- HEARTBEAT_DREAMING?: string;
86
- }, now?: number): void;
87
- startChecker(intervalMs: number | undefined, callback: ReminderCallback, debugHolder?: DebugCallbackHolder): void;
88
- stopChecker(): void;
89
- get pendingCount(): number;
90
- }
91
- export {};
92
- //# sourceMappingURL=cron-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cron-manager.d.ts","sourceRoot":"","sources":["../../src/cron-manager.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAEp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