@1claw/cli 0.36.6 → 0.37.1
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/README.md +66 -1
- package/dist/bundled-templates/registry.yaml +62 -0
- package/dist/bundled-templates/templates/agentkit/Dockerfile +28 -0
- package/dist/bundled-templates/templates/agentkit/README.md +36 -0
- package/dist/bundled-templates/templates/agentkit/agent.py +83 -0
- package/dist/bundled-templates/templates/agentkit/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/agentkit/requirements.txt +5 -0
- package/dist/bundled-templates/templates/agentkit/template.yaml +24 -0
- package/dist/bundled-templates/templates/agno/Dockerfile +28 -0
- package/dist/bundled-templates/templates/agno/README.md +36 -0
- package/dist/bundled-templates/templates/agno/agent.py +86 -0
- package/dist/bundled-templates/templates/agno/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/agno/requirements.txt +2 -0
- package/dist/bundled-templates/templates/agno/template.yaml +24 -0
- package/dist/bundled-templates/templates/coder/Dockerfile +28 -0
- package/dist/bundled-templates/templates/coder/README.md +36 -0
- package/dist/bundled-templates/templates/coder/agent.py +119 -0
- package/dist/bundled-templates/templates/coder/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/coder/requirements.txt +4 -0
- package/dist/bundled-templates/templates/coder/template.yaml +24 -0
- package/dist/bundled-templates/templates/crewai/Dockerfile +28 -0
- package/dist/bundled-templates/templates/crewai/README.md +29 -0
- package/dist/bundled-templates/templates/crewai/agent.py +109 -0
- package/dist/bundled-templates/templates/crewai/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/crewai/requirements.txt +3 -0
- package/dist/bundled-templates/templates/crewai/template.yaml +24 -0
- package/dist/bundled-templates/templates/elizaos/Dockerfile +31 -0
- package/dist/bundled-templates/templates/elizaos/README.md +36 -0
- package/dist/bundled-templates/templates/elizaos/agent.ts +100 -0
- package/dist/bundled-templates/templates/elizaos/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/elizaos/package.json +18 -0
- package/dist/bundled-templates/templates/elizaos/template.yaml +25 -0
- package/dist/bundled-templates/templates/elizaos/tsconfig.json +12 -0
- package/dist/bundled-templates/templates/langchain/Dockerfile +28 -0
- package/dist/bundled-templates/templates/langchain/README.md +37 -0
- package/dist/bundled-templates/templates/langchain/agent.py +115 -0
- package/dist/bundled-templates/templates/langchain/entrypoint.sh +36 -0
- package/dist/bundled-templates/templates/langchain/requirements.txt +4 -0
- package/dist/bundled-templates/templates/langchain/template.yaml +24 -0
- package/dist/bundled-templates/templates/llamaindex/Dockerfile +28 -0
- package/dist/bundled-templates/templates/llamaindex/README.md +36 -0
- package/dist/bundled-templates/templates/llamaindex/agent.py +97 -0
- package/dist/bundled-templates/templates/llamaindex/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/llamaindex/requirements.txt +3 -0
- package/dist/bundled-templates/templates/llamaindex/template.yaml +24 -0
- package/dist/bundled-templates/templates/mastra/Dockerfile +31 -0
- package/dist/bundled-templates/templates/mastra/README.md +31 -0
- package/dist/bundled-templates/templates/mastra/agent.ts +112 -0
- package/dist/bundled-templates/templates/mastra/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/mastra/package.json +17 -0
- package/dist/bundled-templates/templates/mastra/template.yaml +25 -0
- package/dist/bundled-templates/templates/mastra/tsconfig.json +12 -0
- package/dist/bundled-templates/templates/openai-agents/Dockerfile +28 -0
- package/dist/bundled-templates/templates/openai-agents/README.md +29 -0
- package/dist/bundled-templates/templates/openai-agents/agent.py +98 -0
- package/dist/bundled-templates/templates/openai-agents/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/openai-agents/requirements.txt +3 -0
- package/dist/bundled-templates/templates/openai-agents/template.yaml +24 -0
- package/dist/bundled-templates/templates/pydantic-ai/Dockerfile +28 -0
- package/dist/bundled-templates/templates/pydantic-ai/README.md +36 -0
- package/dist/bundled-templates/templates/pydantic-ai/agent.py +110 -0
- package/dist/bundled-templates/templates/pydantic-ai/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/pydantic-ai/requirements.txt +2 -0
- package/dist/bundled-templates/templates/pydantic-ai/template.yaml +24 -0
- package/dist/bundled-templates/templates/smolagents/Dockerfile +28 -0
- package/dist/bundled-templates/templates/smolagents/README.md +36 -0
- package/dist/bundled-templates/templates/smolagents/agent.py +97 -0
- package/dist/bundled-templates/templates/smolagents/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/smolagents/requirements.txt +2 -0
- package/dist/bundled-templates/templates/smolagents/template.yaml +24 -0
- package/dist/bundled-templates/templates/typescript-sdk/Dockerfile +31 -0
- package/dist/bundled-templates/templates/typescript-sdk/README.md +29 -0
- package/dist/bundled-templates/templates/typescript-sdk/agent.ts +130 -0
- package/dist/bundled-templates/templates/typescript-sdk/entrypoint.sh +34 -0
- package/dist/bundled-templates/templates/typescript-sdk/package.json +17 -0
- package/dist/bundled-templates/templates/typescript-sdk/template.yaml +25 -0
- package/dist/bundled-templates/templates/typescript-sdk/tsconfig.json +12 -0
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +10 -255
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/spawn.d.ts +3 -0
- package/dist/src/commands/spawn.d.ts.map +1 -0
- package/dist/src/commands/spawn.js +408 -0
- package/dist/src/commands/spawn.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/container-config.d.ts +3 -1
- package/dist/src/lib/container-config.d.ts.map +1 -1
- package/dist/src/lib/container-config.js +3 -2
- package/dist/src/lib/container-config.js.map +1 -1
- package/dist/src/lib/module-deprecation.d.ts +8 -0
- package/dist/src/lib/module-deprecation.d.ts.map +1 -0
- package/dist/src/lib/module-deprecation.js +15 -0
- package/dist/src/lib/module-deprecation.js.map +1 -0
- package/dist/src/lib/paths.d.ts +12 -0
- package/dist/src/lib/paths.d.ts.map +1 -1
- package/dist/src/lib/paths.js +42 -1
- package/dist/src/lib/paths.js.map +1 -1
- package/dist/src/lib/provisioning.d.ts +30 -0
- package/dist/src/lib/provisioning.d.ts.map +1 -0
- package/dist/src/lib/provisioning.js +256 -0
- package/dist/src/lib/provisioning.js.map +1 -0
- package/dist/src/registry.yaml +62 -0
- package/dist/src/templates/agentkit/Dockerfile +34 -0
- package/dist/src/templates/agentkit/README.md +36 -0
- package/dist/src/templates/agentkit/agent.py +83 -0
- package/dist/src/templates/agentkit/entrypoint.sh +34 -0
- package/dist/src/templates/agentkit/requirements.txt +5 -0
- package/dist/src/templates/agentkit/template.yaml +24 -0
- package/dist/src/templates/agno/Dockerfile +34 -0
- package/dist/src/templates/agno/README.md +36 -0
- package/dist/src/templates/agno/agent.py +86 -0
- package/dist/src/templates/agno/entrypoint.sh +34 -0
- package/dist/src/templates/agno/requirements.txt +2 -0
- package/dist/src/templates/agno/template.yaml +24 -0
- package/dist/src/templates/coder/Dockerfile +34 -0
- package/dist/src/templates/coder/README.md +36 -0
- package/dist/src/templates/coder/agent.py +119 -0
- package/dist/src/templates/coder/entrypoint.sh +34 -0
- package/dist/src/templates/coder/requirements.txt +4 -0
- package/dist/src/templates/coder/template.yaml +24 -0
- package/dist/src/templates/crewai/Dockerfile +34 -0
- package/dist/src/templates/crewai/README.md +29 -0
- package/dist/src/templates/crewai/agent.py +109 -0
- package/dist/src/templates/crewai/entrypoint.sh +34 -0
- package/dist/src/templates/crewai/requirements.txt +3 -0
- package/dist/src/templates/crewai/template.yaml +24 -0
- package/dist/src/templates/elizaos/Dockerfile +31 -0
- package/dist/src/templates/elizaos/README.md +36 -0
- package/dist/src/templates/elizaos/agent.ts +100 -0
- package/dist/src/templates/elizaos/entrypoint.sh +34 -0
- package/dist/src/templates/elizaos/package.json +18 -0
- package/dist/src/templates/elizaos/template.yaml +25 -0
- package/dist/src/templates/elizaos/tsconfig.json +12 -0
- package/dist/src/templates/fetcher.d.ts +20 -0
- package/dist/src/templates/fetcher.d.ts.map +1 -0
- package/dist/src/templates/fetcher.js +189 -0
- package/dist/src/templates/fetcher.js.map +1 -0
- package/dist/src/templates/langchain/Dockerfile +34 -0
- package/dist/src/templates/langchain/README.md +37 -0
- package/dist/src/templates/langchain/agent.py +115 -0
- package/dist/src/templates/langchain/entrypoint.sh +36 -0
- package/dist/src/templates/langchain/requirements.txt +4 -0
- package/dist/src/templates/langchain/template.yaml +24 -0
- package/dist/src/templates/llamaindex/Dockerfile +34 -0
- package/dist/src/templates/llamaindex/README.md +36 -0
- package/dist/src/templates/llamaindex/agent.py +97 -0
- package/dist/src/templates/llamaindex/entrypoint.sh +34 -0
- package/dist/src/templates/llamaindex/requirements.txt +3 -0
- package/dist/src/templates/llamaindex/template.yaml +24 -0
- package/dist/src/templates/mastra/Dockerfile +31 -0
- package/dist/src/templates/mastra/README.md +31 -0
- package/dist/src/templates/mastra/agent.ts +112 -0
- package/dist/src/templates/mastra/entrypoint.sh +34 -0
- package/dist/src/templates/mastra/package.json +17 -0
- package/dist/src/templates/mastra/template.yaml +25 -0
- package/dist/src/templates/mastra/tsconfig.json +12 -0
- package/dist/src/templates/openai-agents/Dockerfile +34 -0
- package/dist/src/templates/openai-agents/README.md +29 -0
- package/dist/src/templates/openai-agents/agent.py +98 -0
- package/dist/src/templates/openai-agents/entrypoint.sh +34 -0
- package/dist/src/templates/openai-agents/requirements.txt +3 -0
- package/dist/src/templates/openai-agents/template.yaml +24 -0
- package/dist/src/templates/pydantic-ai/Dockerfile +34 -0
- package/dist/src/templates/pydantic-ai/README.md +36 -0
- package/dist/src/templates/pydantic-ai/agent.py +110 -0
- package/dist/src/templates/pydantic-ai/entrypoint.sh +34 -0
- package/dist/src/templates/pydantic-ai/requirements.txt +2 -0
- package/dist/src/templates/pydantic-ai/template.yaml +24 -0
- package/dist/src/templates/registry.d.ts +48 -0
- package/dist/src/templates/registry.d.ts.map +1 -0
- package/dist/src/templates/registry.js +168 -0
- package/dist/src/templates/registry.js.map +1 -0
- package/dist/src/templates/smolagents/Dockerfile +34 -0
- package/dist/src/templates/smolagents/README.md +36 -0
- package/dist/src/templates/smolagents/agent.py +97 -0
- package/dist/src/templates/smolagents/entrypoint.sh +34 -0
- package/dist/src/templates/smolagents/requirements.txt +2 -0
- package/dist/src/templates/smolagents/template.yaml +24 -0
- package/dist/src/templates/typescript-sdk/Dockerfile +31 -0
- package/dist/src/templates/typescript-sdk/README.md +29 -0
- package/dist/src/templates/typescript-sdk/agent.ts +130 -0
- package/dist/src/templates/typescript-sdk/entrypoint.sh +34 -0
- package/dist/src/templates/typescript-sdk/package.json +17 -0
- package/dist/src/templates/typescript-sdk/template.yaml +25 -0
- package/dist/src/templates/typescript-sdk/tsconfig.json +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @1claw/cli (v0.
|
|
1
|
+
# @1claw/cli (v0.37.0)
|
|
2
2
|
|
|
3
3
|
Command-line interface for [1Claw](https://1claw.xyz) — HSM-backed secret management for AI agents and humans.
|
|
4
4
|
|
|
@@ -718,6 +718,71 @@ conflicts: [] # e.g. [other-tool] to forbid combining
|
|
|
718
718
|
|
|
719
719
|
**Don't want to modify the CLI?** Use **`1claw eject`** to export the generated `Dockerfile`, the module asset tree, and a `docker-compose.yaml` (daemon socket pre-wired), then edit the Dockerfile freely and build/publish it yourself with `1claw publish --context ./out --tag <user>/<image>:tag`. This is the supported path for fully custom images.
|
|
720
720
|
|
|
721
|
+
## Agent Templates (`spawn`)
|
|
722
|
+
|
|
723
|
+
`1claw spawn` creates a framework-specific AI agent from a pre-built template. Each template ships a Dockerfile, starter code, and entrypoint pre-wired with 1Claw MCP and Shroud. The container follows the same daemon-socket security model as `init --docker` — **the container never sees raw API keys.**
|
|
724
|
+
|
|
725
|
+
```bash
|
|
726
|
+
1claw spawn langchain # LangChain agent with Shroud LLM routing
|
|
727
|
+
1claw spawn crewai --llm-api-key sk-... # CrewAI multi-agent crew with your API key
|
|
728
|
+
1claw spawn openai-agents --local # OpenAI Agents SDK, fully offline
|
|
729
|
+
1claw spawn --list # List all available templates
|
|
730
|
+
1claw spawn --refresh # Force-refresh templates from GitHub
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
### Available templates
|
|
734
|
+
|
|
735
|
+
**Python:**
|
|
736
|
+
|
|
737
|
+
| Template | Framework |
|
|
738
|
+
|----------|-----------|
|
|
739
|
+
| `langchain` | LangChain / LangGraph |
|
|
740
|
+
| `crewai` | CrewAI |
|
|
741
|
+
| `openai-agents` | OpenAI Agents SDK |
|
|
742
|
+
| `agentkit` | Coinbase AgentKit |
|
|
743
|
+
| `smolagents` | HuggingFace smolagents |
|
|
744
|
+
| `llamaindex` | LlamaIndex |
|
|
745
|
+
| `pydantic-ai` | Pydantic AI |
|
|
746
|
+
| `agno` | Agno |
|
|
747
|
+
| `coder` | Coder |
|
|
748
|
+
|
|
749
|
+
**TypeScript:**
|
|
750
|
+
|
|
751
|
+
| Template | Framework |
|
|
752
|
+
|----------|-----------|
|
|
753
|
+
| `typescript-sdk` | @1claw/sdk + Vercel AI SDK |
|
|
754
|
+
| `mastra` | Mastra |
|
|
755
|
+
| `elizaos` | ElizaOS |
|
|
756
|
+
|
|
757
|
+
### LLM authentication
|
|
758
|
+
|
|
759
|
+
Templates support the same three LLM authentication methods as `init --docker`:
|
|
760
|
+
|
|
761
|
+
```bash
|
|
762
|
+
# BYOK — provider key stored in 1Claw vault (Shroud auto-fetches):
|
|
763
|
+
1claw spawn langchain --llm-api-key sk-...
|
|
764
|
+
|
|
765
|
+
# BYOK — provider key stored in local vault (daemon injects):
|
|
766
|
+
1claw spawn langchain --llm-api-key sk-... --llm-key-store local
|
|
767
|
+
|
|
768
|
+
# Token Billing — enable in Dashboard, no provider key needed:
|
|
769
|
+
1claw spawn langchain
|
|
770
|
+
|
|
771
|
+
# Anthropic WIF — OIDC federation (configure in Dashboard):
|
|
772
|
+
1claw spawn langchain --llm-provider anthropic
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
### Templates vs modules
|
|
776
|
+
|
|
777
|
+
- **Templates** (`1claw spawn <name>`) are complete project scaffolds — they include a Dockerfile, starter code (e.g. `agent.py`), and entrypoint. Use a template to bootstrap a new framework-specific agent.
|
|
778
|
+
- **Modules** (`1claw init --docker --module=<name>`) are composable Docker layers added on top of the base `1claw/agent:stable` image. Use modules to add capabilities (payments, on-chain tools) to the base agent.
|
|
779
|
+
|
|
780
|
+
You can combine both: spawn a template, then add modules with `init --docker --module=...` on the resulting container.
|
|
781
|
+
|
|
782
|
+
### Community templates
|
|
783
|
+
|
|
784
|
+
Templates live in the [`1clawAI/agent-templates`](https://github.com/1clawAI/agent-templates) repository. To contribute a new template, see the [CONTRIBUTING.md](https://github.com/1clawAI/agent-templates/blob/main/CONTRIBUTING.md) guide.
|
|
785
|
+
|
|
721
786
|
### Container state & lifecycle
|
|
722
787
|
|
|
723
788
|
Each container's state lives at `~/.config/1claw/containers/{name}.json` (mode `0600`) and is the source of truth for `info`, `start`, `restart`, `publish`, `eject`, and `deploy`. It records the agent/vault IDs, modules, port, image, and a persisted **run spec** (image, env var *names*, mounts, labels — never secret values) so `start`/`restart` can recreate a container that was removed.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
templates:
|
|
3
|
+
- name: langchain
|
|
4
|
+
display_name: "LangChain / LangGraph"
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
language: python
|
|
7
|
+
description: "Python agent using LangChain with 1Claw MCP for secrets and signing"
|
|
8
|
+
- name: crewai
|
|
9
|
+
display_name: "CrewAI"
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
language: python
|
|
12
|
+
description: "Multi-agent crew with 1Claw-managed secrets"
|
|
13
|
+
- name: openai-agents
|
|
14
|
+
display_name: "OpenAI Agents SDK"
|
|
15
|
+
version: 1.0.0
|
|
16
|
+
language: python
|
|
17
|
+
description: "OpenAI Agents SDK with tool calling and 1Claw MCP integration"
|
|
18
|
+
- name: elizaos
|
|
19
|
+
display_name: "ElizaOS"
|
|
20
|
+
version: 1.0.0
|
|
21
|
+
language: node
|
|
22
|
+
description: "ElizaOS character runtime with vault-backed secrets"
|
|
23
|
+
- name: agentkit
|
|
24
|
+
display_name: "Coinbase AgentKit"
|
|
25
|
+
version: 1.0.0
|
|
26
|
+
language: python
|
|
27
|
+
description: "Coinbase AgentKit for onchain agents with 1Claw key management"
|
|
28
|
+
- name: smolagents
|
|
29
|
+
display_name: "HuggingFace smolagents"
|
|
30
|
+
version: 1.0.0
|
|
31
|
+
language: python
|
|
32
|
+
description: "HuggingFace lightweight agents with 1Claw secrets"
|
|
33
|
+
- name: llamaindex
|
|
34
|
+
display_name: "LlamaIndex"
|
|
35
|
+
version: 1.0.0
|
|
36
|
+
language: python
|
|
37
|
+
description: "LlamaIndex agent with tool integration and 1Claw MCP"
|
|
38
|
+
- name: pydantic-ai
|
|
39
|
+
display_name: "Pydantic AI"
|
|
40
|
+
version: 1.0.0
|
|
41
|
+
language: python
|
|
42
|
+
description: "Type-safe Python agent with structured output"
|
|
43
|
+
- name: agno
|
|
44
|
+
display_name: "Agno"
|
|
45
|
+
version: 1.0.0
|
|
46
|
+
language: python
|
|
47
|
+
description: "Agno multi-modal agent with 1Claw secrets"
|
|
48
|
+
- name: mastra
|
|
49
|
+
display_name: "Mastra"
|
|
50
|
+
version: 1.0.0
|
|
51
|
+
language: node
|
|
52
|
+
description: "TypeScript-first AI agent framework"
|
|
53
|
+
- name: typescript-sdk
|
|
54
|
+
display_name: "TypeScript SDK"
|
|
55
|
+
version: 1.0.0
|
|
56
|
+
language: node
|
|
57
|
+
description: "Plain TypeScript agent using @1claw/sdk with Shroud LLM routing"
|
|
58
|
+
- name: coder
|
|
59
|
+
display_name: "Coder"
|
|
60
|
+
version: 1.0.0
|
|
61
|
+
language: python
|
|
62
|
+
description: "Coder workspace automation agent"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
4
|
+
curl tini && \
|
|
5
|
+
rm -rf /var/lib/apt/lists/*
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
COPY requirements.txt .
|
|
10
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
11
|
+
|
|
12
|
+
COPY agent.py .
|
|
13
|
+
COPY entrypoint.sh .
|
|
14
|
+
RUN chmod +x entrypoint.sh
|
|
15
|
+
|
|
16
|
+
RUN mkdir -p /run/1claw
|
|
17
|
+
|
|
18
|
+
ENV NODE_ENV=production
|
|
19
|
+
ENV ONECLAW_DAEMON_SOCKET=/run/1claw/daemon.sock
|
|
20
|
+
ENV ONECLAW_FRAMEWORK=agentkit
|
|
21
|
+
|
|
22
|
+
EXPOSE 3000
|
|
23
|
+
|
|
24
|
+
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=5 \
|
|
25
|
+
CMD curl -sf http://localhost:3000/health || exit 1
|
|
26
|
+
|
|
27
|
+
ENTRYPOINT ["tini", "--"]
|
|
28
|
+
CMD ["./entrypoint.sh"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Coinbase AgentKit Template
|
|
2
|
+
|
|
3
|
+
A Python agent using [Coinbase AgentKit](https://github.com/coinbase/agentkit) for onchain operations with 1Claw key management.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
1claw spawn agentkit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with your own API key:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
1claw spawn agentkit --llm-api-key sk-...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What's included
|
|
18
|
+
|
|
19
|
+
- **agent.py** — AgentKit-powered LangGraph agent with onchain tools
|
|
20
|
+
- **Flask server** on port 3000 with `/chat` and `/health` endpoints
|
|
21
|
+
- **Shroud integration** — LLM calls are routed through Shroud for inspection
|
|
22
|
+
- **MCP server** — started automatically for tool access to 1Claw vault
|
|
23
|
+
|
|
24
|
+
## Customizing
|
|
25
|
+
|
|
26
|
+
Edit `agent.py` to configure AgentKit actions (deploy tokens, transfer,
|
|
27
|
+
check balances, etc.). Set CDP API credentials via the 1Claw vault for
|
|
28
|
+
Coinbase Developer Platform integration.
|
|
29
|
+
|
|
30
|
+
## LLM authentication
|
|
31
|
+
|
|
32
|
+
The template supports three methods (configured at spawn time):
|
|
33
|
+
|
|
34
|
+
1. **BYOK** — `1claw spawn agentkit --llm-api-key sk-...`
|
|
35
|
+
2. **Token Billing** — enable in Dashboard, no key needed
|
|
36
|
+
3. **Anthropic WIF** — OIDC federation for Anthropic models
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Coinbase AgentKit agent pre-wired with 1Claw MCP for secrets and signing.
|
|
3
|
+
|
|
4
|
+
LLM calls are routed through Shroud when ONECLAW_LLM_VIA_SHROUD is set.
|
|
5
|
+
The container never sees raw API keys — they are injected by the host daemon.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from flask import Flask, request, jsonify
|
|
10
|
+
from langchain_openai import ChatOpenAI
|
|
11
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig
|
|
12
|
+
from coinbase_agentkit_langchain import get_langchain_tools
|
|
13
|
+
from langgraph.prebuilt import create_react_agent
|
|
14
|
+
|
|
15
|
+
app = Flask(__name__)
|
|
16
|
+
|
|
17
|
+
SHROUD_URL = os.environ.get("ONECLAW_SHROUD_URL", "https://shroud.1claw.xyz")
|
|
18
|
+
LLM_VIA_SHROUD = os.environ.get("ONECLAW_LLM_VIA_SHROUD", "").lower() == "true"
|
|
19
|
+
MODEL = os.environ.get("ONECLAW_SHROUD_MODEL", "gpt-4o-mini")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def create_agent():
|
|
23
|
+
"""Build an AgentKit-powered LangGraph agent. Returns None if no LLM."""
|
|
24
|
+
if not LLM_VIA_SHROUD:
|
|
25
|
+
return None
|
|
26
|
+
|
|
27
|
+
llm = ChatOpenAI(
|
|
28
|
+
model=MODEL,
|
|
29
|
+
base_url=f"{SHROUD_URL}/v1",
|
|
30
|
+
api_key="shroud-injected",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
agentkit = AgentKit(AgentKitConfig())
|
|
34
|
+
tools = get_langchain_tools(agentkit)
|
|
35
|
+
return create_react_agent(llm, tools=tools)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
agent_executor = create_agent()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@app.route("/health")
|
|
42
|
+
def health():
|
|
43
|
+
return jsonify({"status": "ok", "framework": "agentkit", "llm_wired": LLM_VIA_SHROUD})
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@app.route("/chat", methods=["POST"])
|
|
47
|
+
def chat():
|
|
48
|
+
data = request.get_json(silent=True) or {}
|
|
49
|
+
message = data.get("message", "").strip()
|
|
50
|
+
if not message:
|
|
51
|
+
return jsonify({"error": "No message provided"}), 400
|
|
52
|
+
|
|
53
|
+
if not agent_executor:
|
|
54
|
+
return jsonify({
|
|
55
|
+
"response": "No LLM configured. Use --llm-api-key or enable Token Billing.",
|
|
56
|
+
"framework": "agentkit",
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
result = agent_executor.invoke({"messages": [{"role": "user", "content": message}]})
|
|
61
|
+
output = result["messages"][-1].content if result.get("messages") else str(result)
|
|
62
|
+
return jsonify({"response": output, "framework": "agentkit"})
|
|
63
|
+
except Exception as e:
|
|
64
|
+
return jsonify({"error": str(e)}), 500
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@app.route("/")
|
|
68
|
+
def index():
|
|
69
|
+
return """<!DOCTYPE html>
|
|
70
|
+
<html><head><title>1Claw AgentKit Agent</title></head>
|
|
71
|
+
<body style="font-family:system-ui;max-width:600px;margin:40px auto;padding:0 20px">
|
|
72
|
+
<h1>1Claw Coinbase AgentKit</h1>
|
|
73
|
+
<p>Send messages via <code>POST /chat</code> with <code>{"message": "..."}</code></p>
|
|
74
|
+
<p>Health: <a href="/health">/health</a></p>
|
|
75
|
+
<p style="color:#666;font-size:0.9em">
|
|
76
|
+
Credentials stay in the host daemon — this container never sees secret values.
|
|
77
|
+
</p></body></html>"""
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
port = int(os.environ.get("CHAT_UI_PORT", "3000"))
|
|
82
|
+
print(f"AgentKit agent listening on http://0.0.0.0:{port}")
|
|
83
|
+
app.run(host="0.0.0.0", port=port)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
DAEMON_SOCKET="${ONECLAW_DAEMON_SOCKET:-/run/1claw/daemon.sock}"
|
|
5
|
+
CHAT_UI_PORT="${CHAT_UI_PORT:-3000}"
|
|
6
|
+
|
|
7
|
+
echo "─────────────────────────────────────────────"
|
|
8
|
+
echo " 1Claw AgentKit Agent"
|
|
9
|
+
echo " Framework: agentkit"
|
|
10
|
+
echo " Agent ID: ${ONECLAW_AGENT_ID:-not set}"
|
|
11
|
+
|
|
12
|
+
if [ -S "$DAEMON_SOCKET" ]; then
|
|
13
|
+
echo " Mode: ${ONECLAW_MODE:-cloud} (daemon socket)"
|
|
14
|
+
echo " Socket: $DAEMON_SOCKET"
|
|
15
|
+
else
|
|
16
|
+
echo " Mode: standalone (no daemon socket)"
|
|
17
|
+
fi
|
|
18
|
+
echo "─────────────────────────────────────────────"
|
|
19
|
+
|
|
20
|
+
if [ "$ONECLAW_LLM_VIA_SHROUD" = "true" ]; then
|
|
21
|
+
export OPENAI_BASE_URL="${ONECLAW_SHROUD_URL}/v1"
|
|
22
|
+
echo "LLM routed through Shroud: ${ONECLAW_SHROUD_PROVIDER}/${ONECLAW_SHROUD_MODEL}"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [ -S "$DAEMON_SOCKET" ]; then
|
|
26
|
+
if command -v 1claw-mcp >/dev/null 2>&1; then
|
|
27
|
+
ONECLAW_LOCAL_VAULT=true ONECLAW_DAEMON_SOCKET="$DAEMON_SOCKET" \
|
|
28
|
+
1claw-mcp --local 2>/tmp/mcp.log &
|
|
29
|
+
echo "MCP server started in background."
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo "Ready: http://0.0.0.0:${CHAT_UI_PORT}"
|
|
34
|
+
exec python agent.py
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: agentkit
|
|
2
|
+
display_name: "Coinbase AgentKit"
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Coinbase AgentKit for onchain agents with 1Claw key management"
|
|
5
|
+
author: 1Claw
|
|
6
|
+
language: python
|
|
7
|
+
homepage: https://github.com/coinbase/agentkit
|
|
8
|
+
|
|
9
|
+
docker:
|
|
10
|
+
base_image: python:3.12-slim
|
|
11
|
+
context_files:
|
|
12
|
+
- Dockerfile
|
|
13
|
+
- requirements.txt
|
|
14
|
+
- agent.py
|
|
15
|
+
- entrypoint.sh
|
|
16
|
+
env:
|
|
17
|
+
ONECLAW_FRAMEWORK: agentkit
|
|
18
|
+
health_endpoint: /health
|
|
19
|
+
health_port: 3000
|
|
20
|
+
|
|
21
|
+
post_spawn_message: |
|
|
22
|
+
Edit agent.py to customize your AgentKit agent's onchain capabilities.
|
|
23
|
+
Your 1Claw MCP server is available at the daemon socket.
|
|
24
|
+
LLM calls are routed through Shroud for inspection and redaction.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
4
|
+
curl tini && \
|
|
5
|
+
rm -rf /var/lib/apt/lists/*
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
COPY requirements.txt .
|
|
10
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
11
|
+
|
|
12
|
+
COPY agent.py .
|
|
13
|
+
COPY entrypoint.sh .
|
|
14
|
+
RUN chmod +x entrypoint.sh
|
|
15
|
+
|
|
16
|
+
RUN mkdir -p /run/1claw
|
|
17
|
+
|
|
18
|
+
ENV NODE_ENV=production
|
|
19
|
+
ENV ONECLAW_DAEMON_SOCKET=/run/1claw/daemon.sock
|
|
20
|
+
ENV ONECLAW_FRAMEWORK=agno
|
|
21
|
+
|
|
22
|
+
EXPOSE 3000
|
|
23
|
+
|
|
24
|
+
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=5 \
|
|
25
|
+
CMD curl -sf http://localhost:3000/health || exit 1
|
|
26
|
+
|
|
27
|
+
ENTRYPOINT ["tini", "--"]
|
|
28
|
+
CMD ["./entrypoint.sh"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Agno Template
|
|
2
|
+
|
|
3
|
+
A Python agent using [Agno](https://docs.agno.com) — a multi-modal agent framework — with 1Claw MCP for secrets management.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
1claw spawn agno
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with your own API key:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
1claw spawn agno --llm-api-key sk-...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What's included
|
|
18
|
+
|
|
19
|
+
- **agent.py** — Agno agent with OpenAI-compatible model routing
|
|
20
|
+
- **Flask server** on port 3000 with `/chat` and `/health` endpoints
|
|
21
|
+
- **Shroud integration** — LLM calls are routed through Shroud for inspection
|
|
22
|
+
- **MCP server** — started automatically for tool access to 1Claw vault
|
|
23
|
+
|
|
24
|
+
## Customizing
|
|
25
|
+
|
|
26
|
+
Edit `agent.py` to add tools, configure knowledge bases, or enable
|
|
27
|
+
multi-modal capabilities (vision, audio). Agno supports teams of agents,
|
|
28
|
+
structured output, and memory.
|
|
29
|
+
|
|
30
|
+
## LLM authentication
|
|
31
|
+
|
|
32
|
+
The template supports three methods (configured at spawn time):
|
|
33
|
+
|
|
34
|
+
1. **BYOK** — `1claw spawn agno --llm-api-key sk-...`
|
|
35
|
+
2. **Token Billing** — enable in Dashboard, no key needed
|
|
36
|
+
3. **Anthropic WIF** — OIDC federation for Anthropic models
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agno multi-modal agent pre-wired with 1Claw MCP for secrets and signing.
|
|
3
|
+
|
|
4
|
+
LLM calls are routed through Shroud when ONECLAW_LLM_VIA_SHROUD is set.
|
|
5
|
+
The container never sees raw API keys — they are injected by the host daemon.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from flask import Flask, request, jsonify
|
|
10
|
+
from agno.agent import Agent
|
|
11
|
+
from agno.models.openai import OpenAILike
|
|
12
|
+
|
|
13
|
+
app = Flask(__name__)
|
|
14
|
+
|
|
15
|
+
SHROUD_URL = os.environ.get("ONECLAW_SHROUD_URL", "https://shroud.1claw.xyz")
|
|
16
|
+
LLM_VIA_SHROUD = os.environ.get("ONECLAW_LLM_VIA_SHROUD", "").lower() == "true"
|
|
17
|
+
MODEL = os.environ.get("ONECLAW_SHROUD_MODEL", "gpt-4o-mini")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def create_agent() -> Agent | None:
|
|
21
|
+
"""Build the Agno agent. Returns None if no LLM."""
|
|
22
|
+
if not LLM_VIA_SHROUD:
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
model = OpenAILike(
|
|
26
|
+
id=MODEL,
|
|
27
|
+
api_key="shroud-injected",
|
|
28
|
+
base_url=f"{SHROUD_URL}/v1",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
return Agent(
|
|
32
|
+
model=model,
|
|
33
|
+
description="A helpful AI agent running inside a secure 1Claw container.",
|
|
34
|
+
instructions=[
|
|
35
|
+
"You have access to tools for greeting and inspecting the environment.",
|
|
36
|
+
],
|
|
37
|
+
markdown=True,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
agent = create_agent()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@app.route("/health")
|
|
45
|
+
def health():
|
|
46
|
+
return jsonify({"status": "ok", "framework": "agno", "llm_wired": LLM_VIA_SHROUD})
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@app.route("/chat", methods=["POST"])
|
|
50
|
+
def chat():
|
|
51
|
+
data = request.get_json(silent=True) or {}
|
|
52
|
+
message = data.get("message", "").strip()
|
|
53
|
+
if not message:
|
|
54
|
+
return jsonify({"error": "No message provided"}), 400
|
|
55
|
+
|
|
56
|
+
if not agent:
|
|
57
|
+
return jsonify({
|
|
58
|
+
"response": "No LLM configured. Use --llm-api-key or enable Token Billing.",
|
|
59
|
+
"framework": "agno",
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
try:
|
|
63
|
+
response = agent.run(message)
|
|
64
|
+
output = response.content if hasattr(response, "content") else str(response)
|
|
65
|
+
return jsonify({"response": output, "framework": "agno"})
|
|
66
|
+
except Exception as e:
|
|
67
|
+
return jsonify({"error": str(e)}), 500
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@app.route("/")
|
|
71
|
+
def index():
|
|
72
|
+
return """<!DOCTYPE html>
|
|
73
|
+
<html><head><title>1Claw Agno Agent</title></head>
|
|
74
|
+
<body style="font-family:system-ui;max-width:600px;margin:40px auto;padding:0 20px">
|
|
75
|
+
<h1>1Claw Agno Agent</h1>
|
|
76
|
+
<p>Send messages via <code>POST /chat</code> with <code>{"message": "..."}</code></p>
|
|
77
|
+
<p>Health: <a href="/health">/health</a></p>
|
|
78
|
+
<p style="color:#666;font-size:0.9em">
|
|
79
|
+
Credentials stay in the host daemon — this container never sees secret values.
|
|
80
|
+
</p></body></html>"""
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
port = int(os.environ.get("CHAT_UI_PORT", "3000"))
|
|
85
|
+
print(f"Agno agent listening on http://0.0.0.0:{port}")
|
|
86
|
+
app.run(host="0.0.0.0", port=port)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
DAEMON_SOCKET="${ONECLAW_DAEMON_SOCKET:-/run/1claw/daemon.sock}"
|
|
5
|
+
CHAT_UI_PORT="${CHAT_UI_PORT:-3000}"
|
|
6
|
+
|
|
7
|
+
echo "─────────────────────────────────────────────"
|
|
8
|
+
echo " 1Claw Agno Agent"
|
|
9
|
+
echo " Framework: agno"
|
|
10
|
+
echo " Agent ID: ${ONECLAW_AGENT_ID:-not set}"
|
|
11
|
+
|
|
12
|
+
if [ -S "$DAEMON_SOCKET" ]; then
|
|
13
|
+
echo " Mode: ${ONECLAW_MODE:-cloud} (daemon socket)"
|
|
14
|
+
echo " Socket: $DAEMON_SOCKET"
|
|
15
|
+
else
|
|
16
|
+
echo " Mode: standalone (no daemon socket)"
|
|
17
|
+
fi
|
|
18
|
+
echo "─────────────────────────────────────────────"
|
|
19
|
+
|
|
20
|
+
if [ "$ONECLAW_LLM_VIA_SHROUD" = "true" ]; then
|
|
21
|
+
export OPENAI_BASE_URL="${ONECLAW_SHROUD_URL}/v1"
|
|
22
|
+
echo "LLM routed through Shroud: ${ONECLAW_SHROUD_PROVIDER}/${ONECLAW_SHROUD_MODEL}"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [ -S "$DAEMON_SOCKET" ]; then
|
|
26
|
+
if command -v 1claw-mcp >/dev/null 2>&1; then
|
|
27
|
+
ONECLAW_LOCAL_VAULT=true ONECLAW_DAEMON_SOCKET="$DAEMON_SOCKET" \
|
|
28
|
+
1claw-mcp --local 2>/tmp/mcp.log &
|
|
29
|
+
echo "MCP server started in background."
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
echo "Ready: http://0.0.0.0:${CHAT_UI_PORT}"
|
|
34
|
+
exec python agent.py
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: agno
|
|
2
|
+
display_name: "Agno"
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Agno multi-modal agent with 1Claw secrets"
|
|
5
|
+
author: 1Claw
|
|
6
|
+
language: python
|
|
7
|
+
homepage: https://docs.agno.com
|
|
8
|
+
|
|
9
|
+
docker:
|
|
10
|
+
base_image: python:3.12-slim
|
|
11
|
+
context_files:
|
|
12
|
+
- Dockerfile
|
|
13
|
+
- requirements.txt
|
|
14
|
+
- agent.py
|
|
15
|
+
- entrypoint.sh
|
|
16
|
+
env:
|
|
17
|
+
ONECLAW_FRAMEWORK: agno
|
|
18
|
+
health_endpoint: /health
|
|
19
|
+
health_port: 3000
|
|
20
|
+
|
|
21
|
+
post_spawn_message: |
|
|
22
|
+
Edit agent.py to add tools and configure your Agno agent.
|
|
23
|
+
Your 1Claw MCP server is available at the daemon socket.
|
|
24
|
+
LLM calls are routed through Shroud for inspection and redaction.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
4
|
+
curl tini git && \
|
|
5
|
+
rm -rf /var/lib/apt/lists/*
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
COPY requirements.txt .
|
|
10
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
11
|
+
|
|
12
|
+
COPY agent.py .
|
|
13
|
+
COPY entrypoint.sh .
|
|
14
|
+
RUN chmod +x entrypoint.sh
|
|
15
|
+
|
|
16
|
+
RUN mkdir -p /run/1claw
|
|
17
|
+
|
|
18
|
+
ENV NODE_ENV=production
|
|
19
|
+
ENV ONECLAW_DAEMON_SOCKET=/run/1claw/daemon.sock
|
|
20
|
+
ENV ONECLAW_FRAMEWORK=coder
|
|
21
|
+
|
|
22
|
+
EXPOSE 3000
|
|
23
|
+
|
|
24
|
+
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=5 \
|
|
25
|
+
CMD curl -sf http://localhost:3000/health || exit 1
|
|
26
|
+
|
|
27
|
+
ENTRYPOINT ["tini", "--"]
|
|
28
|
+
CMD ["./entrypoint.sh"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Coder Template
|
|
2
|
+
|
|
3
|
+
A Python agent for automating [Coder](https://coder.com) workspace management with 1Claw MCP for secrets.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
1claw spawn coder
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with your own API key:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
1claw spawn coder --llm-api-key sk-...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What's included
|
|
18
|
+
|
|
19
|
+
- **agent.py** — Coder workspace automation agent with workspace listing
|
|
20
|
+
- **Flask server** on port 3000 with `/chat` and `/health` endpoints
|
|
21
|
+
- **Shroud integration** — LLM calls are routed through Shroud for inspection
|
|
22
|
+
- **MCP server** — started automatically for tool access to 1Claw vault
|
|
23
|
+
|
|
24
|
+
## Customizing
|
|
25
|
+
|
|
26
|
+
Edit `agent.py` to add Coder API actions: create workspaces, start/stop
|
|
27
|
+
builds, manage templates, or automate dev environments. Store
|
|
28
|
+
`CODER_URL` and `CODER_SESSION_TOKEN` in your 1Claw vault.
|
|
29
|
+
|
|
30
|
+
## LLM authentication
|
|
31
|
+
|
|
32
|
+
The template supports three methods (configured at spawn time):
|
|
33
|
+
|
|
34
|
+
1. **BYOK** — `1claw spawn coder --llm-api-key sk-...`
|
|
35
|
+
2. **Token Billing** — enable in Dashboard, no key needed
|
|
36
|
+
3. **Anthropic WIF** — OIDC federation for Anthropic models
|