cc-claw 0.1.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/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "cc-claw",
3
+ "version": "0.1.0",
4
+ "description": "CC-Claw: Personal AI assistant on Telegram — multi-backend (Claude, Gemini, Codex), sub-agent orchestration, MCP management",
5
+ "type": "module",
6
+ "main": "dist/cli.js",
7
+ "bin": {
8
+ "cc-claw": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "skills/",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=20.0.0"
18
+ },
19
+ "scripts": {
20
+ "build": "tsup",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "test:coverage": "vitest run --coverage",
24
+ "prepublishOnly": "npm run build",
25
+ "start": "node dist/cli.js start",
26
+ "dev": "tsx src/cli.ts start",
27
+ "setup": "tsx src/cli.ts setup"
28
+ },
29
+ "keywords": [
30
+ "claude",
31
+ "telegram",
32
+ "bot",
33
+ "ai",
34
+ "assistant",
35
+ "claude-code",
36
+ "vertex-ai",
37
+ "agent"
38
+ ],
39
+ "license": "MIT",
40
+ "dependencies": {
41
+ "@modelcontextprotocol/sdk": "^1.27.1",
42
+ "better-sqlite3": "^12.6.2",
43
+ "commander": "^14.0.3",
44
+ "croner": "^9.0.0",
45
+ "dotenv": "^16.4.7",
46
+ "grammy": "^1.35.0",
47
+ "picocolors": "^1.1.1",
48
+ "zod": "^4.3.6"
49
+ },
50
+ "optionalDependencies": {
51
+ "groq-sdk": "^0.15.0"
52
+ },
53
+ "devDependencies": {
54
+ "@types/better-sqlite3": "^7.6.13",
55
+ "@types/bun": "^1.3.10",
56
+ "@types/node": "^25.3.5",
57
+ "@vitest/coverage-v8": "^4.0.18",
58
+ "tsup": "^8.5.1",
59
+ "tsx": "^4.21.0",
60
+ "typescript": "^5.7.3",
61
+ "vitest": "^4.0.18"
62
+ }
63
+ }
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: agent-claude
3
+ description: Capability manifest for Claude Code as a CC-Claw sub-agent
4
+ compatible_backends: all
5
+ ---
6
+
7
+ # Claude Code Sub-Agent
8
+
9
+ ## Strengths
10
+ - Exceptional code generation, analysis, and debugging
11
+ - Strong planning and architectural reasoning
12
+ - Native sub-agent support (Agent tool)
13
+ - Session resume via --resume flag
14
+ - Full permission mode support (yolo/safe/readonly/plan)
15
+ - Adjustable thinking depth (auto/off/low/medium/high/extra_high)
16
+
17
+ ## Limitations
18
+ - Process must be killed after receiving result (undici keep-alive holds socket for 300s)
19
+ - Higher token cost than alternatives for simple tasks
20
+ - GOOGLE_APPLICATION_CREDENTIALS must be removed from env
21
+
22
+ ## Optimal Task Types
23
+ - Complex code generation and multi-file changes
24
+ - Code review and architectural analysis
25
+ - Planning and design (use planner role with plan permission mode)
26
+ - Debugging and root cause analysis
27
+ - Tasks requiring deep reasoning (set thinking level high)
28
+
29
+ ## Models
30
+ - **opus-4.6**: Most capable, highest cost — use for complex reasoning
31
+ - **sonnet-4.6**: Strong balance of capability and cost — default choice
32
+ - **haiku-4.5**: Fast and cheap — use for simple, focused tasks
33
+
34
+ ## MCP Support
35
+ Full MCP support. Add via: `claude mcp add <name> -- <command> [args...]`
36
+
37
+ ## Tips for the Orchestrating Agent
38
+ - Use sonnet-4.6 for most tasks, opus-4.6 only when deep reasoning is needed
39
+ - Set thinking level high for debugging, low for simple edits
40
+ - Always kill process after result (shouldKillOnResult: true)
41
+ - For review-only tasks, use readonly permission mode
42
+ - Claude excels at tasks that require understanding intent and context
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: agent-codex
3
+ description: Capability manifest for Codex CLI as a CC-Claw sub-agent
4
+ compatible_backends: all
5
+ ---
6
+
7
+ # Codex CLI Sub-Agent
8
+
9
+ ## Strengths
10
+ - GPT-5.x model family (5.4, 5.3 Codex, 5.2 Codex)
11
+ - Strong code generation and refactoring
12
+ - Session resume via exec resume subcommand
13
+ - Sandbox mode for safe execution
14
+ - Reasoning effort control (low/medium/high/extra_high)
15
+
16
+ ## Limitations
17
+ - Resume uses different command pattern (exec resume <id> "prompt")
18
+ - Fewer native tools than Claude Code
19
+
20
+ ## Optimal Task Types
21
+ - Code generation and refactoring
22
+ - Test generation
23
+ - Code translation between languages
24
+ - Straightforward implementation tasks
25
+
26
+ ## Models
27
+ - **gpt-5.4**: Most capable — deep reasoning tasks
28
+ - **gpt-5.3-codex**: Balanced — general coding tasks
29
+ - **gpt-5.2-codex**: Fast — simple implementations
30
+
31
+ ## MCP Support
32
+ Full MCP support. Add via: `codex mcp add <name> -- <command> [args...]`
33
+
34
+ ## Tips for the Orchestrating Agent
35
+ - Good alternative to Claude for straightforward coding tasks
36
+ - Use sandbox mode (--sandbox) for untrusted or exploratory tasks
37
+ - Resume pattern differs: exec resume <session-id> "new prompt"
38
+ - Set reasoning effort high for complex tasks, low for boilerplate
39
+ - Consider for tasks where OpenAI models may have training advantages
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: agent-gemini
3
+ description: Capability manifest for Gemini CLI as a CC-Claw sub-agent
4
+ compatible_backends: all
5
+ ---
6
+
7
+ # Gemini CLI Sub-Agent
8
+
9
+ ## Strengths
10
+ - Excellent video and multimodal analysis
11
+ - Strong web search and information retrieval
12
+ - Google ecosystem integration (Drive, GCP)
13
+ - Session resume via --resume flag
14
+ - Large context window
15
+ - Thinking level support (HIGH/LOW)
16
+
17
+ ## Limitations
18
+ - Exits cleanly but may be slower than Claude for pure code tasks
19
+ - Fewer permission mode options than Claude
20
+
21
+ ## Optimal Task Types
22
+ - Video and image analysis (multimodal)
23
+ - Web research and documentation lookup
24
+ - Google Cloud Platform integration tasks
25
+ - Tasks requiring large context windows
26
+ - Information synthesis from multiple sources
27
+
28
+ ## Models
29
+ - **gemini-3.1-pro-preview**: Most capable — use for complex multimodal tasks
30
+ - **gemini-3-flash**: Fast and efficient — use for quick tasks
31
+
32
+ ## MCP Support
33
+ Full MCP support. Add via: `gemini mcp add <name> -- <command> [args...]`
34
+
35
+ ## Tips for the Orchestrating Agent
36
+ - Use Gemini for any task involving video, images, or multimodal input
37
+ - Prefer for web research tasks over other backends
38
+ - Use flash model for quick lookups, pro for deep analysis
39
+ - Gemini handles large context well — good for analyzing big files
40
+ - Consider for tasks that benefit from Google ecosystem access
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: onboard-cli
3
+ description: Onboard a new coding CLI as a CC-Claw sub-agent runner. Use when user asks to add, register, or onboard a new CLI tool.
4
+ compatible_backends: all
5
+ ---
6
+
7
+ # Onboard New CLI as Sub-Agent Runner
8
+
9
+ Follow this process to onboard a new coding CLI so CC-Claw can use it as a sub-agent.
10
+
11
+ ## Step 1: Verify Installation
12
+
13
+ Check if the CLI is installed:
14
+ ```bash
15
+ which <cli-name>
16
+ <cli-name> --version
17
+ ```
18
+
19
+ If not installed, tell the user and stop. Do NOT install software.
20
+
21
+ ## Step 2: Discover Capabilities
22
+
23
+ Run the help command to understand flags:
24
+ ```bash
25
+ <cli-name> --help
26
+ <cli-name> exec --help # or equivalent subcommand for non-interactive mode
27
+ ```
28
+
29
+ Look for:
30
+ - **Headless/non-interactive mode flag**: `-p`, `--prompt`, `exec`, etc.
31
+ - **Output format flag**: `--output-format stream-json`, `--json`, `-o stream-json`
32
+ - **Model selection flag**: `-m`, `--model`
33
+ - **Working directory flag**: `-C`, `--cd`, `--cwd`
34
+ - **Session resume flag**: `--resume`
35
+ - **Permission/sandbox flags**: `--yolo`, `--sandbox`, `--force`, `--permission-mode`
36
+ - **MCP management**: `<cli> mcp list`, `<cli> mcp add`, etc.
37
+
38
+ ## Step 3: Test NDJSON Output
39
+
40
+ Run the CLI with a simple test prompt to capture its output format:
41
+ ```bash
42
+ <cli-name> -p "Say hello and nothing else" --output-format stream-json 2>/dev/null | head -20
43
+ ```
44
+
45
+ Analyze the JSON lines to understand:
46
+ - How does `init` look? (session ID)
47
+ - How does `text` look? (assistant responses)
48
+ - How does `result` look? (final output)
49
+ - How does `usage` look? (token counts)
50
+
51
+ ## Step 4: Confirm with User
52
+
53
+ Present a summary:
54
+ - CLI name and version
55
+ - Detected capabilities (session resume, MCP, permissions, etc.)
56
+ - Detected output format
57
+ - Any limitations found
58
+
59
+ Ask the user to confirm before proceeding.
60
+
61
+ ## Step 5: Create Runner Config
62
+
63
+ Write the runner config to `~/.cc-claw/runners/<id>.json`:
64
+
65
+ ```json
66
+ {
67
+ "id": "<cli-name>",
68
+ "displayName": "<Display Name>",
69
+ "executable": "<cli-name>",
70
+ "executableFallbacks": [],
71
+ "spawnPattern": {
72
+ "promptFlag": ["-p"],
73
+ "outputFormatFlag": ["--output-format", "stream-json"],
74
+ "modelFlag": ["-m"],
75
+ "cwdFlag": ["-C"],
76
+ "sessionResumeFlag": ["--resume"],
77
+ "extraArgs": [],
78
+ "permModes": {
79
+ "yolo": ["<yolo-flags>"],
80
+ "safe": ["<safe-flags>"],
81
+ "readonly": ["<readonly-flags>"],
82
+ "plan": ["<plan-flags>"]
83
+ }
84
+ },
85
+ "outputParsing": {
86
+ "preset": "generic",
87
+ "fieldMappings": {
88
+ "initMatch": {"type": "init"},
89
+ "initSessionIdPath": "session_id",
90
+ "textMatch": {"type": "text"},
91
+ "textPath": "text",
92
+ "resultMatch": {"type": "result"},
93
+ "resultTextPath": "result",
94
+ "usageMatch": {"type": "usage"},
95
+ "usageInputPath": "usage.input_tokens",
96
+ "usageOutputPath": "usage.output_tokens",
97
+ "usageCachePath": "usage.cache_read_input_tokens"
98
+ }
99
+ },
100
+ "mcpCommands": {
101
+ "add": ["<cli>", "mcp", "add", "{name}", "--", "{command}"],
102
+ "remove": ["<cli>", "mcp", "remove", "{name}"],
103
+ "list": ["<cli>", "mcp", "list"]
104
+ },
105
+ "mcpConfigInjection": "none",
106
+ "capabilities": {
107
+ "supportsSessionResume": true,
108
+ "supportsMcp": true,
109
+ "supportsNdjson": true,
110
+ "supportsPermissionModes": true,
111
+ "maxConcurrentSessions": 4,
112
+ "specialties": []
113
+ },
114
+ "shouldKillOnResult": false
115
+ }
116
+ ```
117
+
118
+ Adapt ALL fields based on what you discovered in Steps 2-3. Do NOT use placeholder values.
119
+
120
+ ## Step 6: Create Capability Skill
121
+
122
+ Write a capability manifest to `~/.cc-claw/workspace/skills/agent-<id>.md`:
123
+
124
+ ```markdown
125
+ ---
126
+ name: agent-<id>
127
+ description: Capability manifest for <Display Name> as a CC-Claw sub-agent
128
+ compatible_backends: all
129
+ ---
130
+
131
+ # <Display Name> Sub-Agent
132
+
133
+ ## Strengths
134
+ - (discovered strengths)
135
+
136
+ ## Limitations
137
+ - (discovered limitations)
138
+
139
+ ## Optimal Task Types
140
+ - (based on capabilities)
141
+
142
+ ## Tips for the Orchestrating Agent
143
+ - (practical usage advice)
144
+ ```
145
+
146
+ ## Step 7: Verify
147
+
148
+ Tell the user the runner has been created and they should run `/runners` to verify it appears. The new runner loads automatically — no restart needed.
149
+
150
+ ## Important Rules
151
+
152
+ - NEVER install software. Only onboard CLIs that are already installed.
153
+ - ALWAYS test the CLI's output format empirically — don't guess.
154
+ - ALWAYS confirm with the user before writing config files.
155
+ - Fill in ALL config fields based on actual discovery, not templates.
156
+ - If the CLI doesn't support NDJSON output, it cannot be onboarded as a sub-agent runner.