casabot 1.0.1 → 1.0.2
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/agent/base.js +23 -23
- package/dist/agent/tools.js +4 -4
- package/dist/cli/index.js +12 -12
- package/dist/cli/setup.js +133 -127
- package/dist/skills/loader.js +3 -3
- package/dist/tui/app.js +5 -5
- package/package.json +1 -1
- package/skills/agent/SKILL.md +60 -58
- package/skills/chat/SKILL.md +59 -59
- package/skills/config/SKILL.md +84 -82
- package/skills/memory/SKILL.md +120 -120
- package/skills/service/SKILL.md +61 -61
- package/src/agent/base.ts +27 -27
- package/src/agent/tools.ts +4 -4
- package/src/cli/index.ts +12 -12
- package/src/cli/setup.ts +133 -127
- package/src/skills/loader.ts +3 -3
- package/src/tui/app.tsx +6 -6
package/dist/agent/base.js
CHANGED
|
@@ -5,30 +5,30 @@ import { CASABOT_HOME } from "../config/manager.js";
|
|
|
5
5
|
const MAX_ITERATIONS = 20;
|
|
6
6
|
export function buildSystemPrompt(skills) {
|
|
7
7
|
const skillList = formatSkillsForPrompt(skills);
|
|
8
|
-
return
|
|
8
|
+
return `You are the base agent of CasAbot. Cassiopeia A — Freely creates everything, like a supernova explosion.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
1.
|
|
12
|
-
2.
|
|
13
|
-
3.
|
|
14
|
-
4.
|
|
10
|
+
## Core Principles
|
|
11
|
+
1. You are an orchestrator. Do not perform actual tasks directly.
|
|
12
|
+
2. Refer to skill documents first. Read the relevant SKILL.md and follow the instructions.
|
|
13
|
+
3. Delegate to an appropriate sub-agent if one exists; otherwise, create a new one and delegate.
|
|
14
|
+
4. Only perform orchestration (agent creation/delegation/management) directly.
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
- \`run_command\`:
|
|
16
|
+
## Available Tools
|
|
17
|
+
- \`run_command\`: Executes a command in the terminal. Use this single tool to read skills, manage sub-agents, and perform all orchestration.
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
1.
|
|
21
|
-
2.
|
|
22
|
-
3.
|
|
23
|
-
4.
|
|
19
|
+
## Workflow
|
|
20
|
+
1. Analyze the user's request.
|
|
21
|
+
2. Read relevant skill documents: \`cat <skill-path>\`
|
|
22
|
+
3. Create sub-agents or delegate to existing ones following skill instructions.
|
|
23
|
+
4. Collect results and report back to the user.
|
|
24
24
|
|
|
25
|
-
## CasAbot
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
25
|
+
## CasAbot Directory Structure
|
|
26
|
+
- Home: ${CASABOT_HOME}
|
|
27
|
+
- Skills: ${CASABOT_HOME}/skills/
|
|
28
|
+
- Workspaces: ${CASABOT_HOME}/workspaces/
|
|
29
|
+
- Conversation History: ${CASABOT_HOME}/history/
|
|
30
|
+
- Memory (Memos): ${CASABOT_HOME}/memory/
|
|
31
|
+
- Config: ${CASABOT_HOME}/casabot.json
|
|
32
32
|
|
|
33
33
|
## ${skillList}
|
|
34
34
|
`;
|
|
@@ -57,11 +57,11 @@ export async function* runAgent(provider, userMessage, conversation, skills) {
|
|
|
57
57
|
result = await executeCommand(args.command);
|
|
58
58
|
}
|
|
59
59
|
catch {
|
|
60
|
-
result =
|
|
60
|
+
result = `Error: Failed to parse tool arguments — ${toolCall.arguments}`;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
result =
|
|
64
|
+
result = `Unknown tool: ${toolCall.name}`;
|
|
65
65
|
}
|
|
66
66
|
const toolMsg = {
|
|
67
67
|
role: "tool",
|
|
@@ -74,7 +74,7 @@ export async function* runAgent(provider, userMessage, conversation, skills) {
|
|
|
74
74
|
}
|
|
75
75
|
const limitMsg = {
|
|
76
76
|
role: "assistant",
|
|
77
|
-
content: "⚠️
|
|
77
|
+
content: "⚠️ Maximum iteration count reached. Please try your request again.",
|
|
78
78
|
};
|
|
79
79
|
await appendMessage(conversation, limitMsg);
|
|
80
80
|
yield limitMsg;
|
package/dist/agent/tools.js
CHANGED
|
@@ -5,13 +5,13 @@ const MAX_BUFFER = 10 * 1024 * 1024;
|
|
|
5
5
|
const TIMEOUT_MS = 60_000;
|
|
6
6
|
export const TERMINAL_TOOL = {
|
|
7
7
|
name: "run_command",
|
|
8
|
-
description: "
|
|
8
|
+
description: "Executes a command in the terminal. Use this to read skill documents, manage sub-agents, or perform system tasks.",
|
|
9
9
|
parameters: {
|
|
10
10
|
type: "object",
|
|
11
11
|
properties: {
|
|
12
12
|
command: {
|
|
13
13
|
type: "string",
|
|
14
|
-
description: "
|
|
14
|
+
description: "Terminal command to execute",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
required: ["command"],
|
|
@@ -25,12 +25,12 @@ export async function executeCommand(command) {
|
|
|
25
25
|
shell: "/bin/bash",
|
|
26
26
|
});
|
|
27
27
|
const output = [stdout, stderr].filter(Boolean).join("\n");
|
|
28
|
-
return output || "(
|
|
28
|
+
return output || "(Command completed with no output)";
|
|
29
29
|
}
|
|
30
30
|
catch (err) {
|
|
31
31
|
const error = err;
|
|
32
32
|
const parts = [error.stdout, error.stderr, error.message].filter(Boolean);
|
|
33
|
-
return
|
|
33
|
+
return `Error occurred:\n${parts.join("\n")}`;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=tools.js.map
|
package/dist/cli/index.js
CHANGED
|
@@ -9,33 +9,33 @@ import { setupWizard } from "./setup.js";
|
|
|
9
9
|
const program = new Command();
|
|
10
10
|
program
|
|
11
11
|
.name("casabot")
|
|
12
|
-
.description("CasAbot —
|
|
12
|
+
.description("CasAbot — Skill-based Multi-Agent Orchestrator")
|
|
13
13
|
.version("1.0.0");
|
|
14
14
|
program
|
|
15
15
|
.command("setup")
|
|
16
|
-
.description("
|
|
16
|
+
.description("Initial setup (providers, models, and all settings)")
|
|
17
17
|
.action(async () => {
|
|
18
18
|
try {
|
|
19
19
|
await setupWizard();
|
|
20
20
|
}
|
|
21
21
|
catch (err) {
|
|
22
22
|
const msg = err instanceof Error ? err.message : String(err);
|
|
23
|
-
console.error(`❌
|
|
23
|
+
console.error(`❌ Error during setup: ${msg}`);
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
program
|
|
28
28
|
.command("reset")
|
|
29
|
-
.description("
|
|
29
|
+
.description("Reset to default settings")
|
|
30
30
|
.action(async () => {
|
|
31
31
|
try {
|
|
32
32
|
await saveConfig(getDefaultConfig());
|
|
33
|
-
console.log("✅
|
|
34
|
-
console.log("'casabot setup'
|
|
33
|
+
console.log("✅ Settings have been reset.");
|
|
34
|
+
console.log("Run 'casabot setup' to reconfigure.");
|
|
35
35
|
}
|
|
36
36
|
catch (err) {
|
|
37
37
|
const msg = err instanceof Error ? err.message : String(err);
|
|
38
|
-
console.error(`❌
|
|
38
|
+
console.error(`❌ Error during reset: ${msg}`);
|
|
39
39
|
process.exit(1);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -45,14 +45,14 @@ program
|
|
|
45
45
|
await ensureDirectories();
|
|
46
46
|
const config = await loadConfig();
|
|
47
47
|
if (!config.activeProvider || config.providers.length === 0) {
|
|
48
|
-
console.log("⚠️
|
|
49
|
-
console.log("'casabot setup'
|
|
48
|
+
console.log("⚠️ No provider configured.");
|
|
49
|
+
console.log("Run 'casabot setup' first.\n");
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
52
|
const providerConfig = config.providers.find((p) => p.name === config.activeProvider);
|
|
53
53
|
if (!providerConfig) {
|
|
54
|
-
console.error(`❌
|
|
55
|
-
console.error("'casabot setup'
|
|
54
|
+
console.error(`❌ Active provider '${config.activeProvider}' not found.`);
|
|
55
|
+
console.error("Run 'casabot setup' to reconfigure.");
|
|
56
56
|
process.exit(1);
|
|
57
57
|
}
|
|
58
58
|
const provider = createProvider(providerConfig);
|
|
@@ -62,7 +62,7 @@ program
|
|
|
62
62
|
}
|
|
63
63
|
catch (err) {
|
|
64
64
|
const msg = err instanceof Error ? err.message : String(err);
|
|
65
|
-
console.error(`❌
|
|
65
|
+
console.error(`❌ Error during startup: ${msg}`);
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
});
|
package/dist/cli/setup.js
CHANGED
|
@@ -10,171 +10,177 @@ function askQuestion(rl, question) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
const PROVIDER_OPTIONS = [
|
|
13
|
-
{ label: "OpenAI", type: "openai", defaultModel: "gpt-
|
|
14
|
-
{ label: "Anthropic", type: "anthropic", defaultModel: "claude-
|
|
15
|
-
{ label: "Hugging Face", type: "huggingface", defaultModel: "
|
|
16
|
-
{ label: "OpenRouter", type: "openrouter", defaultModel: "
|
|
17
|
-
{ label: "Custom (OpenAI
|
|
18
|
-
{ label: "Custom (Anthropic
|
|
13
|
+
{ label: "OpenAI", type: "openai", defaultModel: "gpt-5.2-codex" },
|
|
14
|
+
{ label: "Anthropic", type: "anthropic", defaultModel: "claude-opus-4-6" },
|
|
15
|
+
{ label: "Hugging Face", type: "huggingface", defaultModel: "" },
|
|
16
|
+
{ label: "OpenRouter", type: "openrouter", defaultModel: "" },
|
|
17
|
+
{ label: "Custom (OpenAI compatible)", type: "custom-openai", defaultModel: "" },
|
|
18
|
+
{ label: "Custom (Anthropic compatible)", type: "custom-anthropic", defaultModel: "" },
|
|
19
19
|
];
|
|
20
20
|
async function installDefaultSkills() {
|
|
21
21
|
const defaultSkills = {
|
|
22
22
|
agent: {
|
|
23
|
-
name: "
|
|
24
|
-
description: "base
|
|
25
|
-
content: `#
|
|
23
|
+
name: "Agent Creation & Management",
|
|
24
|
+
description: "Manual for base to create and manage sub-agents",
|
|
25
|
+
content: `# Agent Creation & Management
|
|
26
26
|
|
|
27
|
-
## podman
|
|
27
|
+
## Install podman
|
|
28
28
|
\`\`\`bash
|
|
29
|
-
#
|
|
29
|
+
# Check installation
|
|
30
30
|
which podman || sudo apt install -y podman
|
|
31
31
|
\`\`\`
|
|
32
32
|
|
|
33
|
-
## podman
|
|
33
|
+
## Configure podman storage
|
|
34
34
|
\`\`\`bash
|
|
35
|
-
#
|
|
35
|
+
# Check storage path
|
|
36
36
|
podman info --format '{{.Store.GraphRoot}}'
|
|
37
37
|
\`\`\`
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Create sub-agent container
|
|
40
40
|
\`\`\`bash
|
|
41
|
-
#
|
|
41
|
+
# Create a new agent container
|
|
42
42
|
podman run -d --name <agent-name> \\
|
|
43
43
|
-v ~/casabot/workspaces/<agent-name>:/workspace \\
|
|
44
44
|
-v ~/casabot/skills:/skills:ro \\
|
|
45
45
|
node:20-slim sleep infinity
|
|
46
46
|
|
|
47
|
-
#
|
|
47
|
+
# Copy and run agent script
|
|
48
48
|
podman cp <script-path> <agent-name>:/workspace/agent.js
|
|
49
49
|
podman exec <agent-name> node /workspace/agent.js
|
|
50
50
|
\`\`\`
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Pass provider settings
|
|
53
|
+
|
|
54
|
+
> **Important:** Read the current provider settings from \`~/casabot/casabot.json\` or ask the user for the provider type, API key, and model name. Do not hardcode these values.
|
|
55
|
+
|
|
53
56
|
\`\`\`bash
|
|
54
|
-
#
|
|
55
|
-
podman exec -e API_KEY=<key> -e MODEL=<model> <agent-name> node /workspace/agent.js
|
|
57
|
+
# Pass API key via environment variables
|
|
58
|
+
podman exec -e PROVIDER_TYPE=<provider-type> -e API_KEY=<key> -e MODEL=<model> <agent-name> node /workspace/agent.js
|
|
56
59
|
\`\`\`
|
|
57
60
|
|
|
58
|
-
##
|
|
59
|
-
|
|
61
|
+
## Pass skills
|
|
62
|
+
Mount with \`-v ~/casabot/skills:/skills:ro\` when creating the container so the agent can read skills.
|
|
60
63
|
|
|
61
|
-
##
|
|
64
|
+
## List agents
|
|
62
65
|
\`\`\`bash
|
|
63
66
|
podman ps --filter "label=casabot" --format "{{.Names}}\\t{{.Status}}"
|
|
64
67
|
\`\`\`
|
|
65
68
|
|
|
66
|
-
##
|
|
69
|
+
## Destroy and clean up agents
|
|
67
70
|
\`\`\`bash
|
|
68
71
|
podman stop <agent-name> && podman rm <agent-name>
|
|
69
|
-
#
|
|
72
|
+
# To also clean up the workspace:
|
|
70
73
|
rm -rf ~/casabot/workspaces/<agent-name>
|
|
71
74
|
\`\`\`
|
|
72
75
|
|
|
73
|
-
##
|
|
76
|
+
## Delegate tasks
|
|
74
77
|
\`\`\`bash
|
|
75
|
-
#
|
|
78
|
+
# Pass task to agent (via stdin)
|
|
76
79
|
echo "<task-description>" | podman exec -i <agent-name> node /workspace/agent.js
|
|
77
80
|
\`\`\`
|
|
78
81
|
|
|
79
|
-
##
|
|
82
|
+
## Collect results
|
|
80
83
|
\`\`\`bash
|
|
81
|
-
#
|
|
84
|
+
# Check agent output
|
|
82
85
|
podman logs <agent-name>
|
|
83
|
-
#
|
|
86
|
+
# Check workspace result files
|
|
84
87
|
ls ~/casabot/workspaces/<agent-name>/output/
|
|
85
88
|
\`\`\``,
|
|
86
89
|
},
|
|
87
90
|
config: {
|
|
88
|
-
name: "CasAbot
|
|
89
|
-
description: "
|
|
90
|
-
content: `# CasAbot
|
|
91
|
+
name: "CasAbot Configuration",
|
|
92
|
+
description: "Manual for understanding CasAbot's structure and configuration",
|
|
93
|
+
content: `# CasAbot Configuration
|
|
91
94
|
|
|
92
|
-
##
|
|
95
|
+
## Directory Structure
|
|
93
96
|
\`\`\`
|
|
94
97
|
~/casabot/
|
|
95
|
-
├── casabot.json #
|
|
96
|
-
├── skills/ #
|
|
98
|
+
├── casabot.json # All settings
|
|
99
|
+
├── skills/ # Skills directory (contains SKILL.md)
|
|
97
100
|
│ ├── agent/
|
|
98
101
|
│ ├── config/
|
|
99
102
|
│ ├── chat/
|
|
100
103
|
│ ├── service/
|
|
101
104
|
│ └── memory/
|
|
102
|
-
├── workspaces/ #
|
|
103
|
-
├── history/ #
|
|
104
|
-
└── memory/ #
|
|
105
|
+
├── workspaces/ # Per-agent workspaces
|
|
106
|
+
├── history/ # Full conversation logs (raw logs)
|
|
107
|
+
└── memory/ # Agent-written memos (.md)
|
|
105
108
|
\`\`\`
|
|
106
109
|
|
|
107
|
-
## casabot.json
|
|
110
|
+
## casabot.json Schema
|
|
108
111
|
\`\`\`json
|
|
109
112
|
{
|
|
110
113
|
"providers": [
|
|
111
114
|
{
|
|
112
|
-
"name": "
|
|
115
|
+
"name": "provider name",
|
|
113
116
|
"type": "openai | anthropic | huggingface | openrouter | custom-openai | custom-anthropic",
|
|
114
|
-
"apiKey": "API
|
|
115
|
-
"endpoint": "
|
|
116
|
-
"model": "
|
|
117
|
+
"apiKey": "API key",
|
|
118
|
+
"endpoint": "custom endpoint (optional)",
|
|
119
|
+
"model": "model name",
|
|
117
120
|
"isDefault": true
|
|
118
121
|
}
|
|
119
122
|
],
|
|
120
|
-
"activeProvider": "
|
|
121
|
-
"baseModel": "
|
|
123
|
+
"activeProvider": "active provider name",
|
|
124
|
+
"baseModel": "base model name"
|
|
122
125
|
}
|
|
123
126
|
\`\`\`
|
|
124
127
|
|
|
125
|
-
##
|
|
126
|
-
|
|
128
|
+
## Adding a Provider
|
|
129
|
+
|
|
130
|
+
> **Important:** Read \`~/casabot/casabot.json\` to check the current provider and model settings before making changes. Ask the user which provider, model, and API key to use if not specified.
|
|
131
|
+
|
|
132
|
+
Add a new entry to the providers array in casabot.json:
|
|
127
133
|
\`\`\`bash
|
|
128
|
-
# casabot.json
|
|
129
|
-
cat ~/casabot/casabot.json | jq '.providers += [{"name":"
|
|
134
|
+
# Edit casabot.json
|
|
135
|
+
cat ~/casabot/casabot.json | jq '.providers += [{"name":"<provider-name>","type":"<provider-type>","apiKey":"<api-key>","model":"<model-name>","isDefault":false}]' > /tmp/casabot.json && mv /tmp/casabot.json ~/casabot/casabot.json
|
|
130
136
|
\`\`\`
|
|
131
137
|
|
|
132
|
-
##
|
|
133
|
-
activeProvider
|
|
138
|
+
## Changing Provider
|
|
139
|
+
Change the activeProvider value:
|
|
134
140
|
\`\`\`bash
|
|
135
|
-
cat ~/casabot/casabot.json | jq '.activeProvider = "
|
|
141
|
+
cat ~/casabot/casabot.json | jq '.activeProvider = "<provider-name>"' > /tmp/casabot.json && mv /tmp/casabot.json ~/casabot/casabot.json
|
|
136
142
|
\`\`\``,
|
|
137
143
|
},
|
|
138
144
|
chat: {
|
|
139
|
-
name: "
|
|
140
|
-
description: "
|
|
141
|
-
content: `#
|
|
145
|
+
name: "Conversation Management",
|
|
146
|
+
description: "Manual for managing conversation sessions and integrating with external services",
|
|
147
|
+
content: `# Conversation Management
|
|
142
148
|
|
|
143
|
-
##
|
|
144
|
-
|
|
149
|
+
## Session Management
|
|
150
|
+
Conversation logs are stored as JSON files in ~/casabot/history/.
|
|
145
151
|
|
|
146
|
-
##
|
|
152
|
+
## Loading Conversations
|
|
147
153
|
\`\`\`bash
|
|
148
|
-
#
|
|
154
|
+
# Recent conversation list
|
|
149
155
|
ls -lt ~/casabot/history/ | head -20
|
|
150
156
|
|
|
151
|
-
#
|
|
157
|
+
# View specific conversation
|
|
152
158
|
cat ~/casabot/history/<conversation-id>.json | jq '.messages[] | {role, content: .content[:100]}'
|
|
153
159
|
\`\`\`
|
|
154
160
|
|
|
155
|
-
##
|
|
161
|
+
## Searching Previous Conversations
|
|
156
162
|
\`\`\`bash
|
|
157
|
-
#
|
|
158
|
-
grep -rl "
|
|
163
|
+
# Search conversations by keyword
|
|
164
|
+
grep -rl "keyword" ~/casabot/history/
|
|
159
165
|
|
|
160
|
-
#
|
|
166
|
+
# Find conversations after a specific date
|
|
161
167
|
find ~/casabot/history/ -newer <date-reference-file> -name "*.json"
|
|
162
168
|
\`\`\`
|
|
163
169
|
|
|
164
|
-
##
|
|
165
|
-
|
|
166
|
-
1.
|
|
167
|
-
2.
|
|
168
|
-
3.
|
|
170
|
+
## External Service Integration
|
|
171
|
+
Integration with external services (WhatsApp, Discord, etc.) is handled through sub-agents:
|
|
172
|
+
1. Create an integration sub-agent (see agent skill)
|
|
173
|
+
2. Set up the service's API/bot
|
|
174
|
+
3. When a message is received, forward it to base and send the response back to the service`,
|
|
169
175
|
},
|
|
170
176
|
service: {
|
|
171
|
-
name: "
|
|
172
|
-
description: "
|
|
173
|
-
content: `#
|
|
177
|
+
name: "System Service Registration",
|
|
178
|
+
description: "Manual for configuring auto-start and service integration",
|
|
179
|
+
content: `# System Service Registration
|
|
174
180
|
|
|
175
|
-
## base
|
|
181
|
+
## Auto-start base (systemd)
|
|
176
182
|
\`\`\`bash
|
|
177
|
-
# systemd
|
|
183
|
+
# Create systemd service file
|
|
178
184
|
cat > ~/.config/systemd/user/casabot.service << 'EOF'
|
|
179
185
|
[Unit]
|
|
180
186
|
Description=CasAbot Base Agent
|
|
@@ -191,78 +197,78 @@ WorkingDirectory=%h/casabot
|
|
|
191
197
|
WantedBy=default.target
|
|
192
198
|
EOF
|
|
193
199
|
|
|
194
|
-
#
|
|
200
|
+
# Enable and start service
|
|
195
201
|
systemctl --user daemon-reload
|
|
196
202
|
systemctl --user enable casabot
|
|
197
203
|
systemctl --user start casabot
|
|
198
204
|
\`\`\`
|
|
199
205
|
|
|
200
|
-
##
|
|
206
|
+
## Check service status
|
|
201
207
|
\`\`\`bash
|
|
202
208
|
systemctl --user status casabot
|
|
203
209
|
journalctl --user -u casabot -f
|
|
204
210
|
\`\`\`
|
|
205
211
|
|
|
206
|
-
##
|
|
207
|
-
|
|
212
|
+
## Auto-start specific agents
|
|
213
|
+
Add the \`--restart=always\` option to agent containers:
|
|
208
214
|
\`\`\`bash
|
|
209
215
|
podman run -d --restart=always --name <agent-name> ...
|
|
210
216
|
\`\`\`
|
|
211
217
|
|
|
212
|
-
##
|
|
213
|
-
cron
|
|
218
|
+
## Automate external service integration
|
|
219
|
+
Use cron or systemd timers to set up periodic tasks:
|
|
214
220
|
\`\`\`bash
|
|
215
|
-
# crontab
|
|
221
|
+
# Edit crontab
|
|
216
222
|
crontab -e
|
|
217
|
-
#
|
|
223
|
+
# Run monitoring agent every 5 minutes
|
|
218
224
|
*/5 * * * * podman exec monitor node /workspace/check.js
|
|
219
225
|
\`\`\``,
|
|
220
226
|
},
|
|
221
227
|
memory: {
|
|
222
|
-
name: "
|
|
223
|
-
description: "base
|
|
224
|
-
content: `#
|
|
228
|
+
name: "Memory",
|
|
229
|
+
description: "Manual for base and sub-agents to write and query memory",
|
|
230
|
+
content: `# Memory
|
|
225
231
|
|
|
226
|
-
##
|
|
227
|
-
-
|
|
228
|
-
-
|
|
232
|
+
## Difference between History and Memory
|
|
233
|
+
- **History**: ~/casabot/history/ — Raw logs of entire conversations (auto-saved, read-only)
|
|
234
|
+
- **Memory**: ~/casabot/memory/ — Memos written directly by agents (.md files)
|
|
229
235
|
|
|
230
|
-
##
|
|
236
|
+
## Memory file location
|
|
231
237
|
~/casabot/memory/
|
|
232
238
|
|
|
233
|
-
##
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
239
|
+
## Writing rules
|
|
240
|
+
- File format: Markdown (.md)
|
|
241
|
+
- Filename: \`YYYY-MM-DD-topic.md\` or \`topic.md\`
|
|
242
|
+
- Content: Free format, but ideally includes:
|
|
243
|
+
- Date/time
|
|
244
|
+
- Author (which agent wrote it)
|
|
245
|
+
- Summary
|
|
246
|
+
- Details
|
|
241
247
|
|
|
242
|
-
###
|
|
248
|
+
### Writing example
|
|
243
249
|
\`\`\`bash
|
|
244
|
-
cat > ~/casabot/memory/2024-01-15
|
|
245
|
-
#
|
|
246
|
-
-
|
|
247
|
-
-
|
|
250
|
+
cat > ~/casabot/memory/2024-01-15-project-analysis.md << 'EOF'
|
|
251
|
+
# Project Analysis Results
|
|
252
|
+
- Author: code-reviewer
|
|
253
|
+
- Date: 2024-01-15
|
|
248
254
|
|
|
249
|
-
##
|
|
250
|
-
|
|
255
|
+
## Summary
|
|
256
|
+
Analysis results of the user's project code...
|
|
251
257
|
|
|
252
|
-
##
|
|
258
|
+
## Details
|
|
253
259
|
...
|
|
254
260
|
EOF
|
|
255
261
|
\`\`\`
|
|
256
262
|
|
|
257
|
-
##
|
|
263
|
+
## Querying and searching memory
|
|
258
264
|
\`\`\`bash
|
|
259
|
-
#
|
|
265
|
+
# List all memory files
|
|
260
266
|
ls -lt ~/casabot/memory/
|
|
261
267
|
|
|
262
|
-
#
|
|
263
|
-
grep -rl "
|
|
268
|
+
# Search by keyword
|
|
269
|
+
grep -rl "keyword" ~/casabot/memory/
|
|
264
270
|
|
|
265
|
-
#
|
|
271
|
+
# Read specific memory file
|
|
266
272
|
cat ~/casabot/memory/<filename>.md
|
|
267
273
|
\`\`\``,
|
|
268
274
|
},
|
|
@@ -292,39 +298,39 @@ export async function setupWizard() {
|
|
|
292
298
|
output: process.stdout,
|
|
293
299
|
});
|
|
294
300
|
try {
|
|
295
|
-
console.log("\n🌟 CasAbot
|
|
296
|
-
console.log("
|
|
301
|
+
console.log("\n🌟 Starting CasAbot setup.\n");
|
|
302
|
+
console.log("Select a provider:");
|
|
297
303
|
PROVIDER_OPTIONS.forEach((opt, i) => {
|
|
298
304
|
console.log(` ${i + 1}. ${opt.label}`);
|
|
299
305
|
});
|
|
300
|
-
const choiceStr = await askQuestion(rl, `\
|
|
306
|
+
const choiceStr = await askQuestion(rl, `\nChoice (1-${PROVIDER_OPTIONS.length}): `);
|
|
301
307
|
const choice = parseInt(choiceStr, 10) - 1;
|
|
302
308
|
if (choice < 0 || choice >= PROVIDER_OPTIONS.length) {
|
|
303
|
-
console.error("❌
|
|
309
|
+
console.error("❌ Invalid selection.");
|
|
304
310
|
return;
|
|
305
311
|
}
|
|
306
312
|
const selected = PROVIDER_OPTIONS[choice];
|
|
307
313
|
const apiKey = await askQuestion(rl, "API Key: ");
|
|
308
314
|
if (!apiKey) {
|
|
309
|
-
console.error("❌ API Key
|
|
315
|
+
console.error("❌ API Key is required.");
|
|
310
316
|
return;
|
|
311
317
|
}
|
|
312
318
|
let endpoint;
|
|
313
319
|
if (selected.type === "custom-openai" || selected.type === "custom-anthropic") {
|
|
314
|
-
endpoint = await askQuestion(rl, "
|
|
320
|
+
endpoint = await askQuestion(rl, "Endpoint URL: ");
|
|
315
321
|
if (!endpoint) {
|
|
316
|
-
console.error("❌
|
|
322
|
+
console.error("❌ Custom providers require an endpoint.");
|
|
317
323
|
return;
|
|
318
324
|
}
|
|
319
325
|
}
|
|
320
|
-
const defaultModelHint = selected.defaultModel ? ` (
|
|
321
|
-
const modelInput = await askQuestion(rl,
|
|
326
|
+
const defaultModelHint = selected.defaultModel ? ` (default: ${selected.defaultModel})` : "";
|
|
327
|
+
const modelInput = await askQuestion(rl, `Model${defaultModelHint}: `);
|
|
322
328
|
const model = modelInput || selected.defaultModel;
|
|
323
329
|
if (!model) {
|
|
324
|
-
console.error("❌
|
|
330
|
+
console.error("❌ Model name is required.");
|
|
325
331
|
return;
|
|
326
332
|
}
|
|
327
|
-
const nameInput = await askQuestion(rl,
|
|
333
|
+
const nameInput = await askQuestion(rl, `Provider name (default: ${selected.type}): `);
|
|
328
334
|
const providerName = nameInput || selected.type;
|
|
329
335
|
const providerConfig = {
|
|
330
336
|
name: providerName,
|
|
@@ -341,13 +347,13 @@ export async function setupWizard() {
|
|
|
341
347
|
config.activeProvider = providerName;
|
|
342
348
|
config.baseModel = model;
|
|
343
349
|
await saveConfig(config);
|
|
344
|
-
console.log("\n📦
|
|
350
|
+
console.log("\n📦 Installing default skills...");
|
|
345
351
|
await installDefaultSkills();
|
|
346
|
-
console.log("\n✅
|
|
347
|
-
console.log(`
|
|
348
|
-
console.log(`
|
|
349
|
-
console.log(`
|
|
350
|
-
console.log("\
|
|
352
|
+
console.log("\n✅ Setup complete!");
|
|
353
|
+
console.log(` Provider: ${providerName} (${selected.label})`);
|
|
354
|
+
console.log(` Model: ${model}`);
|
|
355
|
+
console.log(` Config file: ~/casabot/casabot.json`);
|
|
356
|
+
console.log("\nRun 'casabot' to get started.\n");
|
|
351
357
|
}
|
|
352
358
|
finally {
|
|
353
359
|
rl.close();
|
package/dist/skills/loader.js
CHANGED
|
@@ -35,13 +35,13 @@ export async function loadSkills() {
|
|
|
35
35
|
}
|
|
36
36
|
export function formatSkillsForPrompt(skills) {
|
|
37
37
|
if (skills.length === 0)
|
|
38
|
-
return "
|
|
39
|
-
const lines = ["
|
|
38
|
+
return "No skills available.";
|
|
39
|
+
const lines = ["Available Skills:"];
|
|
40
40
|
for (const skill of skills) {
|
|
41
41
|
lines.push(`\n### ${skill.name}`);
|
|
42
42
|
if (skill.description)
|
|
43
43
|
lines.push(skill.description);
|
|
44
|
-
lines.push(
|
|
44
|
+
lines.push(`Path: ${skill.path}`);
|
|
45
45
|
}
|
|
46
46
|
return lines.join("\n");
|
|
47
47
|
}
|