casabot 1.0.0 → 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 +10 -3
- 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/tui/app.js
CHANGED
|
@@ -6,14 +6,14 @@ function truncateOutput(content, maxLines = 5) {
|
|
|
6
6
|
const lines = content.split("\n");
|
|
7
7
|
if (lines.length <= maxLines)
|
|
8
8
|
return content;
|
|
9
|
-
return lines.slice(0, maxLines).join("\n") + `\n ... (${lines.length - maxLines}
|
|
9
|
+
return lines.slice(0, maxLines).join("\n") + `\n ... (${lines.length - maxLines} more lines)`;
|
|
10
10
|
}
|
|
11
11
|
function MessageView({ message }) {
|
|
12
12
|
if (message.role === "user") {
|
|
13
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "
|
|
13
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "User: " }), _jsx(Text, { children: message.content })] }));
|
|
14
14
|
}
|
|
15
15
|
if (message.role === "tool") {
|
|
16
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, bold: true, children: "[
|
|
16
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, bold: true, children: "[Tool Result]" }), _jsx(Text, { dimColor: true, children: truncateOutput(message.content) })] }));
|
|
17
17
|
}
|
|
18
18
|
if (message.role === "assistant") {
|
|
19
19
|
if (message.toolCalls?.length) {
|
|
@@ -56,7 +56,7 @@ function App({ provider, conversation, skills }) {
|
|
|
56
56
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
57
57
|
setMessages((prev) => [
|
|
58
58
|
...prev,
|
|
59
|
-
{ role: "assistant", content: `❌
|
|
59
|
+
{ role: "assistant", content: `❌ Error occurred: ${errorMsg}` },
|
|
60
60
|
]);
|
|
61
61
|
}
|
|
62
62
|
setIsProcessing(false);
|
|
@@ -80,7 +80,7 @@ function App({ provider, conversation, skills }) {
|
|
|
80
80
|
setInput((prev) => prev + ch);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "🌟 CasAbot > " }), _jsx(Text, { dimColor: true, children: "Cassiopeia A \u2014
|
|
83
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "🌟 CasAbot > " }), _jsx(Text, { dimColor: true, children: "Cassiopeia A \u2014 Freely creates everything, like a supernova explosion." })] }), messages.map((msg, i) => (_jsx(MessageView, { message: msg }, i))), isProcessing && (_jsx(Text, { color: "yellow", children: "⏳ Processing..." })), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "green", bold: true, children: "❯ " }), _jsx(Text, { children: input }), !isProcessing && _jsx(Text, { dimColor: true, children: "█" })] })] }));
|
|
84
84
|
}
|
|
85
85
|
export function startTUI(provider, conversation, skills) {
|
|
86
86
|
render(_jsx(App, { provider: provider, conversation: conversation, skills: skills }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "casabot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "CasAbot — Skill-driven multi-agent orchestrator system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,14 @@
|
|
|
16
16
|
"reset": "tsx src/cli/index.ts reset",
|
|
17
17
|
"prepare": "npm run build"
|
|
18
18
|
},
|
|
19
|
-
"keywords": [
|
|
19
|
+
"keywords": [
|
|
20
|
+
"ai",
|
|
21
|
+
"agent",
|
|
22
|
+
"multi-agent",
|
|
23
|
+
"orchestrator",
|
|
24
|
+
"tui",
|
|
25
|
+
"cli"
|
|
26
|
+
],
|
|
20
27
|
"author": "",
|
|
21
28
|
"license": "Apache-2.0",
|
|
22
29
|
"dependencies": {
|
|
@@ -24,7 +31,7 @@
|
|
|
24
31
|
"chalk": "^5.4.1",
|
|
25
32
|
"commander": "^13.1.0",
|
|
26
33
|
"gray-matter": "^4.0.3",
|
|
27
|
-
"ink": "^
|
|
34
|
+
"ink": "^6.6.0",
|
|
28
35
|
"marked": "^15.0.12",
|
|
29
36
|
"marked-terminal": "^7.3.0",
|
|
30
37
|
"openai": "^5.1.0",
|
package/skills/agent/SKILL.md
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: base
|
|
2
|
+
name: Agent Creation & Management
|
|
3
|
+
description: Manual for base to create and manage sub-agents
|
|
4
4
|
metadata:
|
|
5
5
|
casabot:
|
|
6
6
|
requires:
|
|
7
7
|
bins: [podman]
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# Agent Creation & Management
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
This manual explains how the base agent creates and manages podman-based sub-agents.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
## 1. podman
|
|
16
|
+
## 1. Install podman
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
podman must be installed before creating sub-agents.
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
#
|
|
21
|
+
# Check installation
|
|
22
22
|
which podman
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# If not installed (Debian/Ubuntu)
|
|
25
25
|
sudo apt update && sudo apt install -y podman
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# If not installed (Fedora/RHEL)
|
|
28
28
|
sudo dnf install -y podman
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## 2. podman
|
|
31
|
+
## 2. Configure podman storage
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Check the path where container images and layers are stored, and verify sufficient disk space.
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
#
|
|
36
|
+
# Check storage path
|
|
37
37
|
podman info --format '{{.Store.GraphRoot}}'
|
|
38
38
|
|
|
39
|
-
#
|
|
39
|
+
# Check disk usage
|
|
40
40
|
df -h $(podman info --format '{{.Store.GraphRoot}}')
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
If space is insufficient, change `graphroot` in `~/.config/containers/storage.conf`.
|
|
44
44
|
|
|
45
|
-
## 3.
|
|
45
|
+
## 3. Create sub-agent container
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
All sub-agent containers must be assigned the `casabot` label.
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
#
|
|
50
|
+
# Create a new agent container
|
|
51
51
|
podman run -d \
|
|
52
52
|
--name <agent-name> \
|
|
53
53
|
--label casabot=true \
|
|
@@ -56,125 +56,127 @@ podman run -d \
|
|
|
56
56
|
node:20-slim sleep infinity
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
###
|
|
60
|
-
- `--label casabot=true`:
|
|
61
|
-
- `-v ~/casabot/workspaces/<agent-name>:/workspace`:
|
|
62
|
-
- `-v ~/casabot/skills:/skills:ro`:
|
|
59
|
+
### Required rules
|
|
60
|
+
- `--label casabot=true`: Used to identify all CasAbot sub-agents.
|
|
61
|
+
- `-v ~/casabot/workspaces/<agent-name>:/workspace`: Mounts a dedicated workspace for each agent.
|
|
62
|
+
- `-v ~/casabot/skills:/skills:ro`: Shares the skills directory as read-only.
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
After creating the container, copy and run the agent script:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
podman cp <script-path> <agent-name>:/workspace/agent.js
|
|
68
68
|
podman exec <agent-name> node /workspace/agent.js
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
## 4.
|
|
71
|
+
## 4. Pass provider settings
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
> **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.
|
|
74
|
+
|
|
75
|
+
Pass LLM provider information to sub-agents via environment variables.
|
|
74
76
|
|
|
75
77
|
```bash
|
|
76
|
-
#
|
|
78
|
+
# Pass API key and model via environment variables
|
|
77
79
|
podman exec \
|
|
78
|
-
-e PROVIDER_TYPE
|
|
80
|
+
-e PROVIDER_TYPE=<provider-type> \
|
|
79
81
|
-e API_KEY=<key> \
|
|
80
82
|
-e MODEL=<model> \
|
|
81
83
|
-e ENDPOINT=<endpoint> \
|
|
82
84
|
<agent-name> node /workspace/agent.js
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
Or set them in advance with `-e` options when creating the container:
|
|
86
88
|
|
|
87
89
|
```bash
|
|
88
90
|
podman run -d \
|
|
89
91
|
--name <agent-name> \
|
|
90
92
|
--label casabot=true \
|
|
91
|
-
-e PROVIDER_TYPE
|
|
93
|
+
-e PROVIDER_TYPE=<provider-type> \
|
|
92
94
|
-e API_KEY=<key> \
|
|
93
|
-
-e MODEL
|
|
95
|
+
-e MODEL=<model> \
|
|
94
96
|
-v ~/casabot/workspaces/<agent-name>:/workspace \
|
|
95
97
|
-v ~/casabot/skills:/skills:ro \
|
|
96
98
|
node:20-slim sleep infinity
|
|
97
99
|
```
|
|
98
100
|
|
|
99
|
-
## 5.
|
|
101
|
+
## 5. Pass skills
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
Mount with `-v ~/casabot/skills:/skills:ro` when creating the container so sub-agents can read skill documents.
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
How to read skills inside a sub-agent:
|
|
104
106
|
|
|
105
107
|
```bash
|
|
106
|
-
#
|
|
108
|
+
# Inside the container
|
|
107
109
|
cat /skills/agent/SKILL.md
|
|
108
110
|
cat /skills/memory/SKILL.md
|
|
109
111
|
ls /skills/
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
## 6.
|
|
114
|
+
## 6. List agents
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
Query all containers with the `casabot` label.
|
|
115
117
|
|
|
116
118
|
```bash
|
|
117
|
-
#
|
|
119
|
+
# List running agents
|
|
118
120
|
podman ps --filter "label=casabot" --format "{{.Names}}\t{{.Status}}"
|
|
119
121
|
|
|
120
|
-
#
|
|
122
|
+
# All agents (including stopped)
|
|
121
123
|
podman ps -a --filter "label=casabot" --format "table {{.Names}}\t{{.Status}}\t{{.Created}}"
|
|
122
124
|
```
|
|
123
125
|
|
|
124
|
-
## 7.
|
|
126
|
+
## 7. Destroy and clean up agents
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
Clean up agents that are no longer needed.
|
|
127
129
|
|
|
128
130
|
```bash
|
|
129
|
-
#
|
|
131
|
+
# Stop and remove container
|
|
130
132
|
podman stop <agent-name> && podman rm <agent-name>
|
|
131
133
|
|
|
132
|
-
#
|
|
134
|
+
# To also clean up the workspace
|
|
133
135
|
rm -rf ~/casabot/workspaces/<agent-name>
|
|
134
136
|
```
|
|
135
137
|
|
|
136
|
-
###
|
|
138
|
+
### Bulk cleanup
|
|
137
139
|
|
|
138
140
|
```bash
|
|
139
|
-
#
|
|
141
|
+
# Stop and remove all CasAbot agents
|
|
140
142
|
podman ps -a --filter "label=casabot" --format "{{.Names}}" | xargs -r podman stop
|
|
141
143
|
podman ps -a --filter "label=casabot" --format "{{.Names}}" | xargs -r podman rm
|
|
142
144
|
```
|
|
143
145
|
|
|
144
|
-
## 8.
|
|
146
|
+
## 8. Delegate tasks
|
|
145
147
|
|
|
146
|
-
|
|
148
|
+
How to pass tasks to sub-agents.
|
|
147
149
|
|
|
148
150
|
```bash
|
|
149
|
-
#
|
|
151
|
+
# Pass task via stdin
|
|
150
152
|
echo "<task-description>" | podman exec -i <agent-name> node /workspace/agent.js
|
|
151
153
|
|
|
152
|
-
#
|
|
154
|
+
# Pass task via file
|
|
153
155
|
echo "<task-description>" > ~/casabot/workspaces/<agent-name>/task.txt
|
|
154
156
|
podman exec <agent-name> node /workspace/agent.js --task /workspace/task.txt
|
|
155
157
|
```
|
|
156
158
|
|
|
157
|
-
###
|
|
158
|
-
- base
|
|
159
|
-
-
|
|
160
|
-
-
|
|
159
|
+
### Delegation principles
|
|
160
|
+
- base is an orchestrator. Delegate actual work to sub-agents.
|
|
161
|
+
- If no suitable sub-agent exists, create a new one and delegate.
|
|
162
|
+
- Write task descriptions clearly and specifically.
|
|
161
163
|
|
|
162
|
-
## 9.
|
|
164
|
+
## 9. Collect results
|
|
163
165
|
|
|
164
|
-
|
|
166
|
+
Check the results of sub-agent work.
|
|
165
167
|
|
|
166
168
|
```bash
|
|
167
|
-
#
|
|
169
|
+
# Check agent logs
|
|
168
170
|
podman logs <agent-name>
|
|
169
171
|
|
|
170
|
-
#
|
|
172
|
+
# Check recent logs only
|
|
171
173
|
podman logs --tail 50 <agent-name>
|
|
172
174
|
|
|
173
|
-
#
|
|
175
|
+
# Check workspace output files
|
|
174
176
|
ls ~/casabot/workspaces/<agent-name>/output/
|
|
175
177
|
|
|
176
|
-
#
|
|
178
|
+
# Read result file contents
|
|
177
179
|
cat ~/casabot/workspaces/<agent-name>/output/result.txt
|
|
178
180
|
```
|
|
179
181
|
|
|
180
|
-
|
|
182
|
+
After collecting results, summarize and report to the user.
|
package/skills/chat/SKILL.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: Conversation Management
|
|
3
|
+
description: Manual for managing conversation sessions and integrating with external services
|
|
4
4
|
metadata:
|
|
5
5
|
casabot:
|
|
6
6
|
requires:
|
|
7
7
|
bins: []
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# Conversation Management
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
This manual explains how to create, view, and search conversation sessions, and how to integrate with external services.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
## 1.
|
|
16
|
+
## 1. Session Management
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### Session Structure
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Each conversation session is automatically saved as a JSON file in the `~/casabot/history/` directory.
|
|
21
21
|
|
|
22
22
|
```json
|
|
23
23
|
{
|
|
24
|
-
"id": "
|
|
24
|
+
"id": "unique session ID",
|
|
25
25
|
"startedAt": "2024-01-15T09:30:00.000Z",
|
|
26
26
|
"messages": [
|
|
27
27
|
{
|
|
28
28
|
"role": "user | assistant | system | tool",
|
|
29
|
-
"content": "
|
|
29
|
+
"content": "message content",
|
|
30
30
|
"toolCalls": [],
|
|
31
31
|
"toolCallId": ""
|
|
32
32
|
}
|
|
@@ -34,117 +34,117 @@ metadata:
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
###
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
37
|
+
### Session Lifecycle
|
|
38
|
+
- **Creation**: A new session is automatically created when you run the `casabot` command.
|
|
39
|
+
- **Persistence**: Messages are automatically appended as the conversation progresses.
|
|
40
|
+
- **Termination**: The session closes when the program exits.
|
|
41
|
+
- **Preservation**: Logs are permanently preserved in the history directory after termination.
|
|
42
42
|
|
|
43
|
-
## 2.
|
|
43
|
+
## 2. Loading Conversations
|
|
44
44
|
|
|
45
|
-
###
|
|
45
|
+
### View recent conversation list
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
#
|
|
48
|
+
# Recent 20 conversations (newest first)
|
|
49
49
|
ls -lt ~/casabot/history/ | head -20
|
|
50
50
|
|
|
51
|
-
#
|
|
51
|
+
# Check filenames and sizes
|
|
52
52
|
ls -lhS ~/casabot/history/
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### View specific conversation
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
#
|
|
58
|
+
# View full conversation (formatted)
|
|
59
59
|
cat ~/casabot/history/<conversation-id>.json | jq '.messages[] | {role, content: .content[:100]}'
|
|
60
60
|
|
|
61
|
-
#
|
|
61
|
+
# View only user messages
|
|
62
62
|
cat ~/casabot/history/<conversation-id>.json | jq '.messages[] | select(.role == "user") | .content'
|
|
63
63
|
|
|
64
|
-
#
|
|
64
|
+
# View only assistant responses
|
|
65
65
|
cat ~/casabot/history/<conversation-id>.json | jq '.messages[] | select(.role == "assistant") | .content'
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### Check session metadata
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
#
|
|
71
|
+
# Session ID and start time
|
|
72
72
|
cat ~/casabot/history/<conversation-id>.json | jq '{id, startedAt, messageCount: (.messages | length)}'
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
## 3.
|
|
75
|
+
## 3. Searching Previous Conversations
|
|
76
76
|
|
|
77
|
-
###
|
|
77
|
+
### Search by keyword
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
#
|
|
81
|
-
grep -rl "
|
|
80
|
+
# Search all conversations for a keyword
|
|
81
|
+
grep -rl "keyword" ~/casabot/history/
|
|
82
82
|
|
|
83
|
-
#
|
|
84
|
-
grep -l "
|
|
83
|
+
# View context of conversations containing the keyword
|
|
84
|
+
grep -l "keyword" ~/casabot/history/*.json | while read f; do
|
|
85
85
|
echo "=== $(basename $f) ==="
|
|
86
|
-
cat "$f" | jq '.messages[] | select(.content | contains("
|
|
86
|
+
cat "$f" | jq '.messages[] | select(.content | contains("keyword")) | {role, content: .content[:200]}'
|
|
87
87
|
done
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
###
|
|
90
|
+
### Search by date
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
#
|
|
93
|
+
# Conversations after a specific date
|
|
94
94
|
find ~/casabot/history/ -name "*.json" -newermt "2024-01-15" -type f
|
|
95
95
|
|
|
96
|
-
#
|
|
96
|
+
# Today's conversations only
|
|
97
97
|
find ~/casabot/history/ -name "*.json" -newermt "$(date +%Y-%m-%d)" -type f
|
|
98
98
|
|
|
99
|
-
#
|
|
99
|
+
# Conversations from the last 7 days
|
|
100
100
|
find ~/casabot/history/ -name "*.json" -mtime -7 -type f
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
###
|
|
103
|
+
### Search by role
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
#
|
|
106
|
+
# Find conversations with tool calls
|
|
107
107
|
grep -rl "toolCalls" ~/casabot/history/ | head -10
|
|
108
108
|
|
|
109
|
-
#
|
|
109
|
+
# Find conversations where a specific tool was used
|
|
110
110
|
grep -rl "run_command" ~/casabot/history/
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
## 4.
|
|
113
|
+
## 4. Conversation Statistics
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
#
|
|
116
|
+
# Total number of conversations
|
|
117
117
|
ls ~/casabot/history/*.json 2>/dev/null | wc -l
|
|
118
118
|
|
|
119
|
-
#
|
|
119
|
+
# Longest conversations (by message count)
|
|
120
120
|
for f in ~/casabot/history/*.json; do
|
|
121
121
|
echo "$(cat "$f" | jq '.messages | length') $(basename $f)"
|
|
122
122
|
done | sort -rn | head -10
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
## 5.
|
|
125
|
+
## 5. External Service Integration
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
CasAbot can be used through integration with external messaging services (WhatsApp, Discord, Telegram, Slack, etc.).
|
|
128
128
|
|
|
129
|
-
###
|
|
129
|
+
### Integration Architecture
|
|
130
130
|
|
|
131
131
|
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
External Service → [Integration Sub-Agent] → base agent → [Task Sub-Agents]
|
|
133
|
+
↓
|
|
134
|
+
Response to user
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
###
|
|
137
|
+
### Integration Setup Steps
|
|
138
138
|
|
|
139
|
-
1.
|
|
140
|
-
2.
|
|
141
|
-
3.
|
|
142
|
-
4.
|
|
139
|
+
1. **Create integration sub-agent** — Refer to the `agent` skill to create a dedicated integration container.
|
|
140
|
+
2. **Configure service API/bot** — Set up the bot token or webhook URL for the target service.
|
|
141
|
+
3. **Receive messages** — When a message is received from the service, forward it to base.
|
|
142
|
+
4. **Send responses** — Send base's response back to the service.
|
|
143
143
|
|
|
144
|
-
###
|
|
144
|
+
### Example: Webhook-based integration
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
|
-
#
|
|
147
|
+
# Create integration agent (see agent skill)
|
|
148
148
|
podman run -d \
|
|
149
149
|
--name webhook-bridge \
|
|
150
150
|
--label casabot=true \
|
|
@@ -153,13 +153,13 @@ podman run -d \
|
|
|
153
153
|
-v ~/casabot/skills:/skills:ro \
|
|
154
154
|
node:20-slim sleep infinity
|
|
155
155
|
|
|
156
|
-
#
|
|
156
|
+
# Deploy webhook server script to agent
|
|
157
157
|
podman cp webhook-server.js webhook-bridge:/workspace/
|
|
158
158
|
podman exec -d webhook-bridge node /workspace/webhook-server.js
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
## 6.
|
|
161
|
+
## 6. Important Notes
|
|
162
162
|
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
163
|
+
- **Do not modify history files**: Files in `~/casabot/history/` are raw logs. If you need modifications, create a separate copy.
|
|
164
|
+
- **Use memory for notes**: If you need to record important information from conversations, refer to the `memory` skill.
|
|
165
|
+
- **Managing large volumes of history**: If logs accumulate, archive or compress older files.
|