This repository was archived by the owner on Feb 20, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
50 lines (40 loc) · 1.57 KB
/
index.ts
File metadata and controls
50 lines (40 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Agent Loop Plugin - Main Entry Point
*
* Composes task continuation plugin into a unified experience.
* This is the main plugin that users should load.
*/
import type { Plugin, PluginInput } from "./packages/tools/types.js";
import { createLogger } from "./packages/tools/logger.js";
import { getEffectiveConfig } from "./config.js";
// Import plugin composers (exported for users)
import { createTaskContinuation } from "./packages/continuation/index.js";
// Re-export session context utilities for plugin authors
export { initSessionContext, sessionContext } from "./src/session-context.js";
/**
* Main agent-loop plugin
* Provides task continuation capabilities
*/
export const agentLoopPlugin: Plugin = async (input: PluginInput) => {
// Load configuration to determine debug level
const config = getEffectiveConfig();
// Create logger - use debug level if enabled, otherwise silent
const log = createLogger("agent-loop-plugin", config.debug ? "debug" : "silent");
log.info("Initializing agent-loop plugin", {
logFilePath: config.logFilePath ?? "default",
countdownSeconds: config.countdownSeconds,
});
// Create task continuation
const taskContinuation = createTaskContinuation(input, {});
return {
// Compose tools from task continuation plugin
tools: [],
event: async ({ event }) => {
// Delegate to task continuation plugin
await taskContinuation.handler({ event });
},
};
};
// Export creation functions
export { createTaskContinuation } from "./packages/continuation/index.js";
export default agentLoopPlugin;