@cortices/agent 0.4.4 → 0.4.6-beta.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/bin/cortices.mjs +38 -1
- package/dist/claude-daemon.mjs +1 -1
- package/dist/codex-daemon.mjs +1 -1
- package/dist/cortices-daemon.mjs +1 -1
- package/dist/opencode-daemon.mjs +1 -1
- package/dist/scripts/memory.mjs +1 -1
- package/dist/scripts/plan.mjs +1 -1
- package/dist/scripts/schedule.mjs +1 -1
- package/dist/scripts/service.mjs +1 -1
- package/dist/sdk.mjs +1 -1
- package/dist/wasm/cortices_core.js +1 -1
- package/dist/wasm/cortices_core_bg.wasm +0 -0
- package/package.json +1 -1
package/bin/cortices.mjs
CHANGED
|
@@ -9,6 +9,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
9
9
|
|
|
10
10
|
const args = process.argv.slice(2)
|
|
11
11
|
const SERVICE_COMMANDS = ['install', 'uninstall', 'restart', 'list', 'status']
|
|
12
|
+
const TOOL_COMMANDS = ['schedule', 'plan', 'memory', 'notify']
|
|
12
13
|
|
|
13
14
|
// Show top-level help
|
|
14
15
|
if (args.length === 0 || args[0] === '-h' || args[0] === '--help') {
|
|
@@ -18,7 +19,7 @@ Usage:
|
|
|
18
19
|
cortices <command> [options]
|
|
19
20
|
cortices [options] Run agent in foreground (default: claude)
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
Service commands:
|
|
22
23
|
install Install agent as a background service
|
|
23
24
|
uninstall Remove agent service
|
|
24
25
|
restart Restart agent service(s)
|
|
@@ -26,6 +27,12 @@ Commands:
|
|
|
26
27
|
list List installed agent services
|
|
27
28
|
status Show agent service status
|
|
28
29
|
|
|
30
|
+
Agent tools:
|
|
31
|
+
schedule Manage scheduled tasks
|
|
32
|
+
plan Manage long-running plans
|
|
33
|
+
memory Manage user memories
|
|
34
|
+
notify Send notifications to dashboard
|
|
35
|
+
|
|
29
36
|
Run options:
|
|
30
37
|
--agent TYPE Agent backend: claude (default), codex, opencode, native
|
|
31
38
|
--dir DIR Working directory (default: current directory)
|
|
@@ -37,10 +44,40 @@ Examples:
|
|
|
37
44
|
cortices install --api-key ck_xxx --dir /path/to/project --name my-agent
|
|
38
45
|
cortices restart my-agent
|
|
39
46
|
cortices list
|
|
47
|
+
cortices schedule list
|
|
48
|
+
cortices notify send --title "Build failed" --severity warning
|
|
40
49
|
cortices --api-key ck_xxx --dir /path/to/project # run in foreground`)
|
|
41
50
|
process.exit(0)
|
|
42
51
|
}
|
|
43
52
|
|
|
53
|
+
// ── Agent tool subcommands ──────────────────────────────────────────────────
|
|
54
|
+
if (args[0] && TOOL_COMMANDS.includes(args[0])) {
|
|
55
|
+
const tool = args[0]
|
|
56
|
+
const toolArgs = args.slice(1)
|
|
57
|
+
|
|
58
|
+
// Resolve script: prefer compiled dist, fall back to source
|
|
59
|
+
const scriptMjs = resolve(__dirname, '..', 'dist', 'scripts', `${tool}.mjs`)
|
|
60
|
+
const scriptTs = resolve(__dirname, '..', 'scripts', `${tool}.ts`)
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
if (existsSync(scriptMjs)) {
|
|
64
|
+
execFileSync('node', [scriptMjs, ...toolArgs], {
|
|
65
|
+
stdio: 'inherit', env: process.env,
|
|
66
|
+
})
|
|
67
|
+
} else if (existsSync(scriptTs)) {
|
|
68
|
+
execFileSync('npx', ['tsx', scriptTs, ...toolArgs], {
|
|
69
|
+
stdio: 'inherit', env: process.env,
|
|
70
|
+
})
|
|
71
|
+
} else {
|
|
72
|
+
console.error(`Script not found for '${tool}'. Run 'npm run build' in the agent directory.`)
|
|
73
|
+
process.exit(1)
|
|
74
|
+
}
|
|
75
|
+
} catch (e) {
|
|
76
|
+
process.exit(e.status || 1)
|
|
77
|
+
}
|
|
78
|
+
process.exit(0)
|
|
79
|
+
}
|
|
80
|
+
|
|
44
81
|
// Determine agent type from --agent flag (default: claude)
|
|
45
82
|
let agentType = 'claude'
|
|
46
83
|
const agentIdx = args.indexOf('--agent')
|