@agent-link/agent 0.1.89 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude.d.ts +11 -0
- package/dist/claude.js +69 -20
- package/dist/claude.js.map +1 -1
- package/dist/connection.js +136 -1
- package/dist/connection.js.map +1 -1
- package/dist/history.d.ts +2 -0
- package/dist/history.js +1 -1
- package/dist/history.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +18 -0
- package/dist/memory.js +71 -0
- package/dist/memory.js.map +1 -0
- package/dist/scheduler.d.ts +84 -0
- package/dist/scheduler.js +559 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/team-types.d.ts +10 -2
- package/dist/team.d.ts +13 -5
- package/dist/team.js +18 -18
- package/dist/team.js.map +1 -1
- package/package.json +3 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,iBAAiB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,CAAC,CAAC;QACnE,CAAC;aAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,OAAO,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;YACjF,OAAO,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YAC9D,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACrF,CAAC;aAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YACpE,OAAO,CAAC,KAAK,CAAC,2EAA2E,CAAC,CAAC;QAC7F,CAAC;aAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACxE,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/memory.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface MemoryFileInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
size: number;
|
|
4
|
+
lastModified: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function listMemoryFiles(workDir: string): {
|
|
7
|
+
memoryDir: string | null;
|
|
8
|
+
files: MemoryFileInfo[];
|
|
9
|
+
};
|
|
10
|
+
export declare function updateMemoryFile(workDir: string, filename: string, content: string): {
|
|
11
|
+
success: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function deleteMemoryFile(workDir: string, filename: string): {
|
|
15
|
+
success: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/dist/memory.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { homedir } from 'os';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { existsSync, readdirSync, statSync, writeFileSync, unlinkSync, mkdirSync } from 'fs';
|
|
4
|
+
import { pathToProjectFolder } from './history.js';
|
|
5
|
+
function getMemoryDir(workDir) {
|
|
6
|
+
const projectsDir = join(homedir(), '.claude', 'projects');
|
|
7
|
+
const projectFolder = pathToProjectFolder(workDir);
|
|
8
|
+
return join(projectsDir, projectFolder, 'memory');
|
|
9
|
+
}
|
|
10
|
+
export function listMemoryFiles(workDir) {
|
|
11
|
+
const memoryDir = getMemoryDir(workDir);
|
|
12
|
+
if (!existsSync(memoryDir)) {
|
|
13
|
+
return { memoryDir: null, files: [] };
|
|
14
|
+
}
|
|
15
|
+
const files = [];
|
|
16
|
+
for (const name of readdirSync(memoryDir)) {
|
|
17
|
+
if (!name.endsWith('.md'))
|
|
18
|
+
continue;
|
|
19
|
+
const filePath = join(memoryDir, name);
|
|
20
|
+
try {
|
|
21
|
+
const stats = statSync(filePath);
|
|
22
|
+
if (stats.isFile()) {
|
|
23
|
+
files.push({ name, size: stats.size, lastModified: stats.mtime.getTime() });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch { /* skip */ }
|
|
27
|
+
}
|
|
28
|
+
// Sort: MEMORY.md first, then alphabetical
|
|
29
|
+
files.sort((a, b) => {
|
|
30
|
+
if (a.name === 'MEMORY.md')
|
|
31
|
+
return -1;
|
|
32
|
+
if (b.name === 'MEMORY.md')
|
|
33
|
+
return 1;
|
|
34
|
+
return a.name.localeCompare(b.name);
|
|
35
|
+
});
|
|
36
|
+
return { memoryDir, files };
|
|
37
|
+
}
|
|
38
|
+
export function updateMemoryFile(workDir, filename, content) {
|
|
39
|
+
if (filename.includes('/') || filename.includes('\\') || filename.includes('..')) {
|
|
40
|
+
return { success: false, error: 'Invalid filename' };
|
|
41
|
+
}
|
|
42
|
+
const memoryDir = getMemoryDir(workDir);
|
|
43
|
+
if (!existsSync(memoryDir)) {
|
|
44
|
+
mkdirSync(memoryDir, { recursive: true });
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
writeFileSync(join(memoryDir, filename), content, 'utf-8');
|
|
48
|
+
return { success: true };
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return { success: false, error: err.message };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function deleteMemoryFile(workDir, filename) {
|
|
55
|
+
if (filename.includes('/') || filename.includes('\\') || filename.includes('..')) {
|
|
56
|
+
return { success: false, error: 'Invalid filename' };
|
|
57
|
+
}
|
|
58
|
+
const memoryDir = getMemoryDir(workDir);
|
|
59
|
+
const filePath = join(memoryDir, filename);
|
|
60
|
+
if (!existsSync(filePath)) {
|
|
61
|
+
return { success: false, error: 'File not found' };
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
unlinkSync(filePath);
|
|
65
|
+
return { success: true };
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
return { success: false, error: err.message };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQnD,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,E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AAC;IACD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,CAAC;QACH,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loop (Scheduled Tasks) scheduler module.
|
|
3
|
+
*
|
|
4
|
+
* Manages Loop CRUD, cron scheduling, execution lifecycle, and output capture.
|
|
5
|
+
* Each Loop is a scheduled prompt sent to Claude on a cron schedule.
|
|
6
|
+
* Executions are persisted as JSONL files for later replay.
|
|
7
|
+
*/
|
|
8
|
+
import type { ClaudeMessage, HandleChatOptions } from './claude.js';
|
|
9
|
+
import type { HistoryMessage } from './history.js';
|
|
10
|
+
export interface Loop {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
prompt: string;
|
|
14
|
+
schedule: string;
|
|
15
|
+
scheduleType: 'manual' | 'hourly' | 'daily' | 'weekly' | 'cron';
|
|
16
|
+
scheduleConfig: {
|
|
17
|
+
hour?: number;
|
|
18
|
+
minute?: number;
|
|
19
|
+
dayOfWeek?: number;
|
|
20
|
+
};
|
|
21
|
+
workDir: string;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
lastExecution?: LoopExecutionSummary;
|
|
26
|
+
}
|
|
27
|
+
export interface LoopExecution {
|
|
28
|
+
id: string;
|
|
29
|
+
loopId: string;
|
|
30
|
+
status: 'running' | 'success' | 'error' | 'cancelled';
|
|
31
|
+
trigger: 'scheduled' | 'manual';
|
|
32
|
+
startedAt: string;
|
|
33
|
+
completedAt?: string;
|
|
34
|
+
durationMs?: number;
|
|
35
|
+
claudeSessionId?: string;
|
|
36
|
+
conversationId?: string;
|
|
37
|
+
summary?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
export type LoopExecutionSummary = Pick<LoopExecution, 'id' | 'status' | 'startedAt' | 'durationMs' | 'trigger'>;
|
|
41
|
+
type SendFn = (msg: Record<string, unknown>) => void;
|
|
42
|
+
type HandleChatFn = (conversationId: string | undefined, prompt: string, workDir: string, options?: HandleChatOptions) => void;
|
|
43
|
+
type CancelExecutionFn = (conversationId?: string) => void;
|
|
44
|
+
type AddOutputObserverFn = (fn: (conversationId: string, msg: ClaudeMessage) => boolean | void) => void;
|
|
45
|
+
type RemoveOutputObserverFn = (fn: (conversationId: string, msg: ClaudeMessage) => boolean | void) => void;
|
|
46
|
+
type AddCloseObserverFn = (fn: (conversationId: string, exitCode: number | null, resultReceived: boolean) => void) => void;
|
|
47
|
+
type RemoveCloseObserverFn = (fn: (conversationId: string, exitCode: number | null, resultReceived: boolean) => void) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Initialize the scheduler. Loads loops from disk, reconciles orphaned
|
|
50
|
+
* executions, and starts cron jobs for all enabled loops.
|
|
51
|
+
*/
|
|
52
|
+
export declare function initScheduler(deps: {
|
|
53
|
+
send: SendFn;
|
|
54
|
+
handleChat: HandleChatFn;
|
|
55
|
+
cancelExecution: CancelExecutionFn;
|
|
56
|
+
addOutputObserver: AddOutputObserverFn;
|
|
57
|
+
removeOutputObserver: RemoveOutputObserverFn;
|
|
58
|
+
addCloseObserver: AddCloseObserverFn;
|
|
59
|
+
removeCloseObserver: RemoveCloseObserverFn;
|
|
60
|
+
}): void;
|
|
61
|
+
/**
|
|
62
|
+
* Shutdown the scheduler. Stops all cron jobs.
|
|
63
|
+
* Running executions are NOT cancelled; they complete naturally.
|
|
64
|
+
*/
|
|
65
|
+
export declare function shutdownScheduler(): void;
|
|
66
|
+
export declare function createLoop(config: {
|
|
67
|
+
name: string;
|
|
68
|
+
prompt: string;
|
|
69
|
+
schedule: string;
|
|
70
|
+
scheduleType: Loop['scheduleType'];
|
|
71
|
+
scheduleConfig: Loop['scheduleConfig'];
|
|
72
|
+
workDir: string;
|
|
73
|
+
}): Loop;
|
|
74
|
+
export declare function updateLoop(loopId: string, updates: Partial<Pick<Loop, 'name' | 'prompt' | 'schedule' | 'scheduleType' | 'scheduleConfig' | 'enabled'>>): Loop | null;
|
|
75
|
+
export declare function deleteLoop(loopId: string): boolean;
|
|
76
|
+
export declare function listLoops(workDir?: string): Loop[];
|
|
77
|
+
export declare function getLoop(loopId: string): Loop | null;
|
|
78
|
+
export declare function listLoopExecutions(loopId: string, limit?: number): LoopExecution[];
|
|
79
|
+
export declare function getLoopExecutionMessages(loopId: string, executionId: string): HistoryMessage[];
|
|
80
|
+
export declare function runLoopNow(loopId: string): void;
|
|
81
|
+
export declare function cancelLoopExecution(loopId: string): void;
|
|
82
|
+
/** Get currently running executions (for status queries). */
|
|
83
|
+
export declare function getRunningExecutions(): Map<string, LoopExecution>;
|
|
84
|
+
export {};
|