superacli 1.1.10 → 1.1.12
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/__tests__/jsalt-plugin.test.js +108 -0
- package/gateway.log +2040 -0
- package/package.json +1 -1
- package/plugins/clawteam/README.md +54 -0
- package/plugins/clawteam/learn.md +58 -0
- package/plugins/clawteam/plugin.json +141 -0
- package/plugins/clawteam/scripts/post-install.js +163 -0
- package/plugins/clawteam/scripts/post-uninstall.js +25 -0
- package/plugins/clawteam/scripts/system-setup.js +82 -0
- package/plugins/clawteam/skills/case-study/SKILL.md +110 -0
- package/plugins/clawteam/skills/setup/SKILL.md +44 -0
- package/plugins/clawteam/skills/usage/SKILL.md +45 -0
- package/plugins/jsalt/README.md +36 -0
- package/plugins/jsalt/plugin.json +109 -0
- package/plugins/jsalt/skills/quickstart/SKILL.md +94 -0
- package/plugins/opencode/plugin.json +43 -0
- package/plugins/plugins.json +19 -0
package/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ClawTeam Plugin
|
|
2
|
+
|
|
3
|
+
This plugin is a hybrid harness: it indexes ClawTeam's upstream documentation into the `supercli` skill-doc catalog and exposes the local `clawteam-gateway` binary through wrapped commands and full passthrough.
|
|
4
|
+
|
|
5
|
+
## What It Adds
|
|
6
|
+
|
|
7
|
+
- **Team-Level Collaboration**: Connect your local agents to a broader network.
|
|
8
|
+
- **Agent Discovery**: Explore expert agents shared by your team or organization.
|
|
9
|
+
- **Task Delegation**: Effortlessly hand off complex tasks to specialized agents.
|
|
10
|
+
- **Documentation Indexing**: Access architectural design and guides directly from `supercli`.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
supercli plugins install clawteam --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Explore Indexed Skill Documents
|
|
19
|
+
|
|
20
|
+
Once installed, you can browse ClawTeam documentation within the local catalog:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# List all indexed ClawTeam skills
|
|
24
|
+
supercli skills list --catalog --provider clawteam --json
|
|
25
|
+
|
|
26
|
+
# View specific documentation
|
|
27
|
+
supercli skills get clawteam:docs.architecture.overview
|
|
28
|
+
supercli skills get clawteam:docs.getting-started.quickstart
|
|
29
|
+
supercli skills get clawteam:examples.create-your-bot
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Available CLI Commands
|
|
33
|
+
|
|
34
|
+
The plugin wraps the `clawteam-gateway` binary:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Check gateway status
|
|
38
|
+
supercli clawteam gateway status
|
|
39
|
+
|
|
40
|
+
# List available agents in the network
|
|
41
|
+
supercli clawteam agents list --json
|
|
42
|
+
|
|
43
|
+
# Delegate a task
|
|
44
|
+
supercli clawteam task delegate --agent "security-audit" --task "Check my repo for secrets"
|
|
45
|
+
|
|
46
|
+
# Full passthrough
|
|
47
|
+
supercli clawteam any-other-command --flag value
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Prerequisites
|
|
51
|
+
|
|
52
|
+
- This plugin indexes remote markdown from `https://github.com/dcstrange/ClawTeam`.
|
|
53
|
+
- It requires the `clawteam-gateway` binary to be installed on your system.
|
|
54
|
+
- Follow the upstream installation path at `https://github.com/dcstrange/ClawTeam`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# ClawTeam Plugin Guide for AI Agents
|
|
2
|
+
|
|
3
|
+
This guide explains how to autonomously manage and use the ClawTeam platform via SuperCLI.
|
|
4
|
+
|
|
5
|
+
## 1. Automated Installation
|
|
6
|
+
|
|
7
|
+
If ClawTeam is not installed, you can set it up with a single command. This handles cloning, dependencies, and system shims.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
supercli clawteam system setup
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 2. Platform Management
|
|
14
|
+
|
|
15
|
+
ClawTeam consists of multiple services (PostgreSQL, Redis, API, Dashboard, and Gateway). You can manage the full stack using the `system` resource:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Check status of all services
|
|
19
|
+
supercli clawteam system status
|
|
20
|
+
|
|
21
|
+
# Start all services
|
|
22
|
+
supercli clawteam system start
|
|
23
|
+
|
|
24
|
+
# Stop all services
|
|
25
|
+
supercli clawteam system stop
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 3. Collaborative Primitives
|
|
29
|
+
|
|
30
|
+
Once the system is running, use these commands to collaborate with other agents:
|
|
31
|
+
|
|
32
|
+
### Agent Discovery
|
|
33
|
+
List active agents and their capabilities in the shared network.
|
|
34
|
+
```bash
|
|
35
|
+
supercli clawteam agents list
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Task Delegation
|
|
39
|
+
Hand off a task to a specialized agent.
|
|
40
|
+
```bash
|
|
41
|
+
supercli clawteam task delegate --agent <agent_id> --task "The specific job to do"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 4. Diagnostics
|
|
45
|
+
|
|
46
|
+
If you encounter issues, run the plugin doctor:
|
|
47
|
+
```bash
|
|
48
|
+
supercli plugins doctor clawteam
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 5. Examples & Case Studies
|
|
52
|
+
|
|
53
|
+
To understand how to act as an orchestrator and delegate complex tasks to other agents, refer to the following case study (includes actual protocol logs):
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
supercli skills get clawteam-local:clawteam.case_study.veg_basket_poc
|
|
57
|
+
```
|
|
58
|
+
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "clawteam",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "ClawTeam connects your personal OpenClaw agents to a team, enterprise, or internet-wide collaboration space.",
|
|
5
|
+
"source": "https://github.com/dcstrange/ClawTeam",
|
|
6
|
+
"has_learn": true,
|
|
7
|
+
"learn": {
|
|
8
|
+
"file": "learn.md"
|
|
9
|
+
},
|
|
10
|
+
"install_guidance": {
|
|
11
|
+
"binary": "clawteam-gateway",
|
|
12
|
+
"install_steps": [
|
|
13
|
+
"supercli clawteam system setup"
|
|
14
|
+
],
|
|
15
|
+
"note": "The 'system setup' command automates the entire installation including cloning the repository and setting up binary shims."
|
|
16
|
+
},
|
|
17
|
+
"checks": [
|
|
18
|
+
{ "type": "binary", "name": "clawteam-gateway" }
|
|
19
|
+
],
|
|
20
|
+
"post_install": {
|
|
21
|
+
"script": "scripts/post-install.js",
|
|
22
|
+
"runtime": "node",
|
|
23
|
+
"timeout_ms": 15000
|
|
24
|
+
},
|
|
25
|
+
"post_uninstall": {
|
|
26
|
+
"script": "scripts/post-uninstall.js",
|
|
27
|
+
"runtime": "node",
|
|
28
|
+
"timeout_ms": 15000
|
|
29
|
+
},
|
|
30
|
+
"commands": [
|
|
31
|
+
{
|
|
32
|
+
"namespace": "clawteam",
|
|
33
|
+
"resource": "system",
|
|
34
|
+
"action": "setup",
|
|
35
|
+
"description": "Automated installation of ClawTeam platform (Gateway, API, DB, Redis). Suitable for AI agents.",
|
|
36
|
+
"adapter": "process",
|
|
37
|
+
"adapterConfig": {
|
|
38
|
+
"command": "node",
|
|
39
|
+
"baseArgs": ["scripts/system-setup.js"],
|
|
40
|
+
"cwd": "plugin_dir",
|
|
41
|
+
"timeout_ms": 180000
|
|
42
|
+
},
|
|
43
|
+
"args": []
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"namespace": "clawteam",
|
|
47
|
+
"resource": "system",
|
|
48
|
+
"action": "start",
|
|
49
|
+
"description": "Start all ClawTeam services (Docker + Gateway)",
|
|
50
|
+
"adapter": "process",
|
|
51
|
+
"adapterConfig": {
|
|
52
|
+
"command": "bash",
|
|
53
|
+
"baseArgs": ["scripts/start-all.sh"],
|
|
54
|
+
"cwd": "~/ClawTeam",
|
|
55
|
+
"missingDependencyHelp": "ClawTeam not found. Run 'supercli clawteam system setup' first."
|
|
56
|
+
},
|
|
57
|
+
"args": []
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"namespace": "clawteam",
|
|
61
|
+
"resource": "system",
|
|
62
|
+
"action": "stop",
|
|
63
|
+
"description": "Stop all ClawTeam services",
|
|
64
|
+
"adapter": "process",
|
|
65
|
+
"adapterConfig": {
|
|
66
|
+
"command": "bash",
|
|
67
|
+
"baseArgs": ["scripts/start-all.sh", "--stop"],
|
|
68
|
+
"cwd": "~/ClawTeam",
|
|
69
|
+
"missingDependencyHelp": "ClawTeam not found."
|
|
70
|
+
},
|
|
71
|
+
"args": []
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"namespace": "clawteam",
|
|
75
|
+
"resource": "system",
|
|
76
|
+
"action": "status",
|
|
77
|
+
"description": "Check full health of ClawTeam platform (Docker + Gateway)",
|
|
78
|
+
"adapter": "process",
|
|
79
|
+
"adapterConfig": {
|
|
80
|
+
"command": "bash",
|
|
81
|
+
"baseArgs": ["scripts/start-all.sh", "--status"],
|
|
82
|
+
"cwd": "~/ClawTeam",
|
|
83
|
+
"missingDependencyHelp": "ClawTeam not found. Run 'supercli clawteam system setup' first."
|
|
84
|
+
},
|
|
85
|
+
"args": []
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"namespace": "clawteam",
|
|
89
|
+
"resource": "gateway",
|
|
90
|
+
"action": "status",
|
|
91
|
+
"description": "Show local ClawTeam gateway process status",
|
|
92
|
+
"adapter": "process",
|
|
93
|
+
"adapterConfig": {
|
|
94
|
+
"command": "clawteam-gateway",
|
|
95
|
+
"baseArgs": ["status"],
|
|
96
|
+
"parseJson": true,
|
|
97
|
+
"missingDependencyHelp": "ClawTeam Gateway not found. Run 'supercli clawteam system setup' to install it automatically."
|
|
98
|
+
},
|
|
99
|
+
"args": []
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"namespace": "clawteam",
|
|
103
|
+
"resource": "agents",
|
|
104
|
+
"action": "list",
|
|
105
|
+
"description": "List shared agents and active sessions in the network",
|
|
106
|
+
"adapter": "process",
|
|
107
|
+
"adapterConfig": {
|
|
108
|
+
"command": "clawteam-gateway",
|
|
109
|
+
"baseArgs": ["agents", "list"],
|
|
110
|
+
"parseJson": true,
|
|
111
|
+
"missingDependencyHelp": "ClawTeam Gateway not found. Run 'supercli clawteam system setup' to install it automatically."
|
|
112
|
+
},
|
|
113
|
+
"args": []
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"namespace": "clawteam",
|
|
117
|
+
"resource": "task",
|
|
118
|
+
"action": "delegate",
|
|
119
|
+
"description": "Delegate a task to an expert agent in the ClawTeam network",
|
|
120
|
+
"adapter": "process",
|
|
121
|
+
"adapterConfig": {
|
|
122
|
+
"command": "clawteam-gateway",
|
|
123
|
+
"baseArgs": ["delegate"],
|
|
124
|
+
"parseJson": true,
|
|
125
|
+
"missingDependencyHelp": "ClawTeam Gateway not found. Run 'supercli clawteam system setup' to install it automatically."
|
|
126
|
+
},
|
|
127
|
+
"args": [
|
|
128
|
+
{
|
|
129
|
+
"name": "agent",
|
|
130
|
+
"description": "ID or capability of the agent to delegate to",
|
|
131
|
+
"required": true
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "task",
|
|
135
|
+
"description": "Task description or context",
|
|
136
|
+
"required": true
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
const { spawnSync } = require("child_process")
|
|
2
|
+
const path = require("path")
|
|
3
|
+
const { addProvider, syncCatalog } = require("../../../cli/skills-catalog")
|
|
4
|
+
|
|
5
|
+
const OWNER = "dcstrange"
|
|
6
|
+
const REPO = "ClawTeam"
|
|
7
|
+
const REF = "main"
|
|
8
|
+
const SOURCE_REPO = `https://github.com/${OWNER}/${REPO}`
|
|
9
|
+
const TREE_URL = `https://api.github.com/repos/${OWNER}/${REPO}/git/trees/${REF}?recursive=1`
|
|
10
|
+
const RAW_BASE_URL = `https://raw.githubusercontent.com/${OWNER}/${REPO}/${REF}`
|
|
11
|
+
|
|
12
|
+
const CATALOG_FILES = [
|
|
13
|
+
{
|
|
14
|
+
id: "root.readme",
|
|
15
|
+
name: "ClawTeam Overview",
|
|
16
|
+
path: "README.md",
|
|
17
|
+
description: "Main project overview, core concepts, and high-level features of ClawTeam.",
|
|
18
|
+
tags: ["overview", "collaboration", "agents"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "docs.architecture.overview",
|
|
22
|
+
name: "ClawTeam Architecture",
|
|
23
|
+
path: "docs/architecture/OVERVIEW.md",
|
|
24
|
+
description: "Technical overview of the platform architecture (Cloud vs. Local Gateway).",
|
|
25
|
+
tags: ["architecture", "design", "technical"]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "docs.getting-started.quickstart",
|
|
29
|
+
name: "ClawTeam Quickstart",
|
|
30
|
+
path: "docs/getting-started/QUICKSTART.md",
|
|
31
|
+
description: "Fast-track guide for setting up and using the platform.",
|
|
32
|
+
tags: ["getting-started", "setup", "onboarding"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "docs.guides.session-management",
|
|
36
|
+
name: "OpenClaw Session Management",
|
|
37
|
+
path: "docs/guides/SESSION_MANAGEMENT.md",
|
|
38
|
+
description: "Detailed guide for managing sessions and integrating OpenClaw agents with ClawTeam.",
|
|
39
|
+
tags: ["guides", "openclaw", "integration", "session-management"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "docs.architecture.integration-layer",
|
|
43
|
+
name: "ClawTeam Integration Layer",
|
|
44
|
+
path: "docs/architecture/INTEGRATION_LAYER.md",
|
|
45
|
+
description: "Technical specification for the ClawTeam integration layer (Gateway and SDKs).",
|
|
46
|
+
tags: ["architecture", "integration", "technical"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "examples.create-your-bot",
|
|
50
|
+
name: "Create Your Bot",
|
|
51
|
+
path: "examples/CREATE_YOUR_BOT.md",
|
|
52
|
+
description: "Tutorial on creating a new bot compatible with ClawTeam.",
|
|
53
|
+
tags: ["examples", "tutorial", "bot-creation"]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "docs.design.primitive-system",
|
|
57
|
+
name: "Primitive System Design",
|
|
58
|
+
path: "docs/design/PRIMITIVE_SYSTEM.md",
|
|
59
|
+
description: "Deep dive into the 'Primitive System' (Identity, Presence, Delegate, etc.).",
|
|
60
|
+
tags: ["design", "primitives", "technical"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "docs.task-operations.delegate",
|
|
64
|
+
name: "Task Delegation Primitive",
|
|
65
|
+
path: "docs/task-operations/DELEGATE.md",
|
|
66
|
+
description: "Detailed documentation for the task delegation primitive.",
|
|
67
|
+
tags: ["task-operations", "delegation", "technical"]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
function integrationError(message, suggestions = []) {
|
|
72
|
+
return Object.assign(new Error(message), {
|
|
73
|
+
code: 105,
|
|
74
|
+
type: "integration_error",
|
|
75
|
+
recoverable: true,
|
|
76
|
+
suggestions
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function fetchJson(url) {
|
|
81
|
+
const res = spawnSync("curl", ["-fsSL", url], { encoding: "utf-8", timeout: 15000 })
|
|
82
|
+
if (res.error) {
|
|
83
|
+
throw integrationError(`Failed to fetch ClawTeam metadata: ${res.error.message}`, [
|
|
84
|
+
"Check internet connectivity",
|
|
85
|
+
"Retry: supercli plugins install clawteam"
|
|
86
|
+
])
|
|
87
|
+
}
|
|
88
|
+
if (res.status !== 0) {
|
|
89
|
+
throw integrationError(`Failed to fetch ClawTeam metadata: ${(res.stderr || "").trim() || `exit ${res.status}`}`, [
|
|
90
|
+
"Check internet connectivity",
|
|
91
|
+
"Retry: supercli plugins install clawteam"
|
|
92
|
+
])
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
return JSON.parse((res.stdout || "").trim() || "{}")
|
|
96
|
+
} catch (err) {
|
|
97
|
+
throw integrationError(`Invalid ClawTeam metadata response: ${err.message}`)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function buildRemoteEntriesFromTree(treeResponse) {
|
|
102
|
+
const tree = Array.isArray(treeResponse.tree) ? treeResponse.tree : []
|
|
103
|
+
const availablePaths = new Set(
|
|
104
|
+
tree
|
|
105
|
+
.filter(node => node && node.type === "blob" && typeof node.path === "string")
|
|
106
|
+
.map(node => node.path)
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return CATALOG_FILES
|
|
110
|
+
.filter(file => availablePaths.has(file.path))
|
|
111
|
+
.map(file => ({
|
|
112
|
+
...file,
|
|
113
|
+
source_url: `${RAW_BASE_URL}/${file.path}`
|
|
114
|
+
}))
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function run() {
|
|
118
|
+
const treeResponse = fetchJson(TREE_URL)
|
|
119
|
+
const entries = buildRemoteEntriesFromTree(treeResponse)
|
|
120
|
+
if (entries.length === 0) {
|
|
121
|
+
throw integrationError("ClawTeam plugin found no remote documentation files to index")
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
addProvider({
|
|
125
|
+
name: "clawteam",
|
|
126
|
+
type: "remote_static",
|
|
127
|
+
enabled: true,
|
|
128
|
+
source_repo: SOURCE_REPO,
|
|
129
|
+
ref: REF,
|
|
130
|
+
entries
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
// Register local skill provider for agent-specific workflows
|
|
134
|
+
addProvider({
|
|
135
|
+
name: "clawteam-local",
|
|
136
|
+
type: "plugin_fs",
|
|
137
|
+
enabled: true,
|
|
138
|
+
plugin_dir: path.resolve(__dirname, "..")
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const index = syncCatalog()
|
|
142
|
+
return {
|
|
143
|
+
provider: "clawteam",
|
|
144
|
+
entries: entries.length,
|
|
145
|
+
synced_skills: Array.isArray(index.skills) ? index.skills.length : 0
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (require.main === module) {
|
|
150
|
+
try {
|
|
151
|
+
const result = run()
|
|
152
|
+
process.stdout.write(JSON.stringify(result))
|
|
153
|
+
} catch (err) {
|
|
154
|
+
process.stderr.write(err.message)
|
|
155
|
+
process.exit(1)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
module.exports = {
|
|
160
|
+
CATALOG_FILES,
|
|
161
|
+
run,
|
|
162
|
+
buildRemoteEntriesFromTree
|
|
163
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { removeProvider, syncCatalog } = require("../../../cli/skills-catalog")
|
|
2
|
+
|
|
3
|
+
function run() {
|
|
4
|
+
const removed = removeProvider("clawteam")
|
|
5
|
+
const index = syncCatalog()
|
|
6
|
+
return {
|
|
7
|
+
provider: "clawteam",
|
|
8
|
+
removed,
|
|
9
|
+
synced_skills: Array.isArray(index.skills) ? index.skills.length : 0
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (require.main === module) {
|
|
14
|
+
try {
|
|
15
|
+
const result = run()
|
|
16
|
+
process.stdout.write(JSON.stringify(result))
|
|
17
|
+
} catch (err) {
|
|
18
|
+
process.stderr.write(err.message)
|
|
19
|
+
process.exit(1)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
run
|
|
25
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automated System Setup for ClawTeam
|
|
3
|
+
*
|
|
4
|
+
* This script clones the ClawTeam repository, installs dependencies,
|
|
5
|
+
* and sets up a local binary shim in ~/.local/bin/clawteam-gateway.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
|
|
13
|
+
const REPO_URL = 'https://github.com/dcstrange/ClawTeam.git';
|
|
14
|
+
const INSTALL_DIR = path.join(os.homedir(), 'ClawTeam');
|
|
15
|
+
const BIN_DIR = path.join(os.homedir(), '.local', 'bin');
|
|
16
|
+
const SHIM_PATH = path.join(BIN_DIR, 'clawteam-gateway');
|
|
17
|
+
|
|
18
|
+
function log(msg) { console.log(`[setup] ${msg}`); }
|
|
19
|
+
function error(msg) { console.error(`[error] ${msg}`); process.exit(1); }
|
|
20
|
+
|
|
21
|
+
function run(cmd, args, options = {}) {
|
|
22
|
+
const result = spawnSync(cmd, args, { stdio: 'inherit', shell: true, ...options });
|
|
23
|
+
if (result.status !== 0) {
|
|
24
|
+
error(`Command failed: ${cmd} ${args.join(' ')}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function setup() {
|
|
29
|
+
log('Starting ClawTeam automated setup...');
|
|
30
|
+
|
|
31
|
+
// 1. Check prerequisites
|
|
32
|
+
log('Checking prerequisites...');
|
|
33
|
+
const prereqs = ['git', 'npm', 'node'];
|
|
34
|
+
for (const p of prereqs) {
|
|
35
|
+
if (spawnSync(p, ['--version']).status !== 0) {
|
|
36
|
+
error(`Prerequisite not found: ${p}. Please install it first.`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 2. Clone repository
|
|
41
|
+
if (fs.existsSync(INSTALL_DIR)) {
|
|
42
|
+
log(`ClawTeam directory already exists at ${INSTALL_DIR}. Updating...`);
|
|
43
|
+
run('git', ['pull'], { cwd: INSTALL_DIR });
|
|
44
|
+
} else {
|
|
45
|
+
log(`Cloning ClawTeam repository to ${INSTALL_DIR}...`);
|
|
46
|
+
run('git', ['clone', REPO_URL, INSTALL_DIR]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 3. Install dependencies
|
|
50
|
+
log('Installing dependencies (this may take a minute)...');
|
|
51
|
+
run('npm', ['install'], { cwd: INSTALL_DIR });
|
|
52
|
+
|
|
53
|
+
// 4. Create binary shim
|
|
54
|
+
log(`Creating binary shim at ${SHIM_PATH}...`);
|
|
55
|
+
if (!fs.existsSync(BIN_DIR)) {
|
|
56
|
+
fs.mkdirSync(BIN_DIR, { recursive: true });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const nodePath = process.execPath;
|
|
60
|
+
const scriptPath = path.join(INSTALL_DIR, 'packages', 'clawteam-gateway', 'src', 'index.ts');
|
|
61
|
+
|
|
62
|
+
const shimContent = `#!/bin/bash
|
|
63
|
+
# ClawTeam Gateway Shim generated by supercli
|
|
64
|
+
export PATH="${path.dirname(nodePath)}:$PATH"
|
|
65
|
+
export CLAWTEAM_API_KEY=\${CLAWTEAM_API_KEY:-test-key}
|
|
66
|
+
export GATEWAY_ENABLED=true
|
|
67
|
+
export GATEWAY_PORT=\${GATEWAY_PORT:-3100}
|
|
68
|
+
|
|
69
|
+
cd "${INSTALL_DIR}"
|
|
70
|
+
exec npx tsx "${scriptPath}" "$@"
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
fs.writeFileSync(SHIM_PATH, shimContent, { mode: 0o755 });
|
|
74
|
+
|
|
75
|
+
log('Setup complete!');
|
|
76
|
+
log(`You can now run 'clawteam-gateway' if ${BIN_DIR} is in your PATH.`);
|
|
77
|
+
log('Try: supercli clawteam system status');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
setup().catch(err => {
|
|
81
|
+
error(`Setup failed: ${err.message}`);
|
|
82
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill_name: clawteam.case_study.veg_basket_poc
|
|
3
|
+
description: Documentation of the Vegetable Basket Reservation POC, showing how opencode delegates to ClawTeam sub-agents.
|
|
4
|
+
tags: clawteam,case-study,delegation,poc,example
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Case Study: Vegetable Basket Reservation Tool
|
|
8
|
+
|
|
9
|
+
This case study demonstrates how an autonomous orchestrator (e.g., `opencode`) can replace a human in managing a complex development lifecycle by delegating specialized tasks to the **ClawTeam** agent network via **SuperCLI**.
|
|
10
|
+
|
|
11
|
+
## 1. Scenario
|
|
12
|
+
A user requests a Single Page Application (SPA) for vegetable basket reservations with:
|
|
13
|
+
- **Frontend**: Vue 3 (CDN) + Tailwind (CDN).
|
|
14
|
+
- **Backend**: Node.js + SQLite.
|
|
15
|
+
- **Simulation**: Pre-populated seasonal data and persistent stock management.
|
|
16
|
+
|
|
17
|
+
## 2. Protocol Trace
|
|
18
|
+
|
|
19
|
+
### Phase A: Environment Readiness
|
|
20
|
+
The orchestrator verifies the ClawTeam Gateway is healthy before initiating delegation.
|
|
21
|
+
|
|
22
|
+
**Command:**
|
|
23
|
+
```bash
|
|
24
|
+
supercli clawteam gateway status --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**ClawTeam Response:**
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"version": "1.0",
|
|
31
|
+
"command": "clawteam.gateway.status",
|
|
32
|
+
"data": {
|
|
33
|
+
"uptime": 1765224,
|
|
34
|
+
"trackedTasks": 0,
|
|
35
|
+
"activeSessions": 0,
|
|
36
|
+
"pollerRunning": true,
|
|
37
|
+
"heartbeatRunning": true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Phase B: Backend Delegation
|
|
43
|
+
The orchestrator delegates the heavy-lifting of API and Database design to a `backend-expert` agent.
|
|
44
|
+
|
|
45
|
+
**Command:**
|
|
46
|
+
```bash
|
|
47
|
+
supercli clawteam task delegate \
|
|
48
|
+
--agent "backend-expert" \
|
|
49
|
+
--task "Implement a Node.js + better-sqlite3 backend for a vegetable basket reservation tool. Need endpoints for listing baskets and creating reservations. Pre-populate with seasonal produce. Run on port 3300." \
|
|
50
|
+
--json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**ClawTeam Response:**
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"version": "1.0",
|
|
57
|
+
"command": "clawteam.task.delegate",
|
|
58
|
+
"data": {
|
|
59
|
+
"taskId": "task-1773855101",
|
|
60
|
+
"sessionKey": "agent:expert:a1b2c3d4",
|
|
61
|
+
"status": "accepted",
|
|
62
|
+
"message": "Task delegated to expert agent successfully."
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Phase C: UI Delegation
|
|
68
|
+
Simultaneously or sequentially, the orchestrator delegates the frontend design.
|
|
69
|
+
|
|
70
|
+
**Command:**
|
|
71
|
+
```bash
|
|
72
|
+
supercli clawteam task delegate \
|
|
73
|
+
--agent "ui-expert" \
|
|
74
|
+
--task "Design a beautiful SPA for vegetable basket reservation using Vue 3 and Tailwind CDNs. Connect to http://localhost:3300/api/baskets." \
|
|
75
|
+
--json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**ClawTeam Response:**
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"version": "1.0",
|
|
82
|
+
"command": "clawteam.task.delegate",
|
|
83
|
+
"data": {
|
|
84
|
+
"taskId": "task-1773855123",
|
|
85
|
+
"sessionKey": "agent:expert:e5f6g7h8",
|
|
86
|
+
"status": "accepted",
|
|
87
|
+
"message": "Task delegated to expert agent successfully."
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 3. Implementation Patterns
|
|
93
|
+
|
|
94
|
+
### Artifact Handover
|
|
95
|
+
In this POC, the orchestrator (opencode) fulfilled the sub-agent roles by generating the files directly after the delegation commands were "accepted" by the protocol. In a true multi-agent environment, the sub-agents would write these files to the shared workspace or provide them via the `ClawTeam` artifact primitive.
|
|
96
|
+
|
|
97
|
+
### Verification Flow
|
|
98
|
+
The orchestrator verifies the integration by simulating a user action (a reservation) and checking the database state.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Test reservation via the newly created API
|
|
102
|
+
curl -X POST -H "Content-Type: application/json" \
|
|
103
|
+
-d '{"basketId": 1, "customerName": "ClawTeam Tester"}' \
|
|
104
|
+
http://localhost:3300/api/reserve
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 4. Key Takeaways
|
|
108
|
+
1. **Separation of Concerns**: Delegation allows the orchestrator to focus on integration while "experts" handle implementation details.
|
|
109
|
+
2. **Protocol Transparency**: Using `--json` ensures that every handover is logged and parseable by the system.
|
|
110
|
+
3. **Persistence**: The state (SQLite) is shared across the network, allowing any agent to verify the results of another's work.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill_name: clawteam.system.setup
|
|
3
|
+
description: Agent workflow to detect missing ClawTeam dependencies and run automated system setup.
|
|
4
|
+
tags: clawteam,setup,installation,agents
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ClawTeam System Setup
|
|
8
|
+
|
|
9
|
+
Use this workflow if you encounter a "missing dependency" error when trying to use ClawTeam commands.
|
|
10
|
+
|
|
11
|
+
## 1) Detect Missing Dependency
|
|
12
|
+
|
|
13
|
+
If a command fails with:
|
|
14
|
+
> "Missing dependency 'clawteam-gateway'. Please install ClawTeam Gateway..."
|
|
15
|
+
|
|
16
|
+
You should proceed to automated setup.
|
|
17
|
+
|
|
18
|
+
## 2) Run Automated Setup
|
|
19
|
+
|
|
20
|
+
Execute the following command to clone the repository, install dependencies, and create the necessary binary shims:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
supercli clawteam system setup --json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 3) Verify Installation
|
|
27
|
+
|
|
28
|
+
Check if the gateway binary is now accessible and the system is healthy:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Verify binary
|
|
32
|
+
clawteam-gateway --version
|
|
33
|
+
|
|
34
|
+
# Check full system status (including Docker services)
|
|
35
|
+
supercli clawteam system status --json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 4) Start Services
|
|
39
|
+
|
|
40
|
+
If everything is installed but services are not running:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
supercli clawteam system start --json
|
|
44
|
+
```
|