@1claw/cli 0.34.7 → 0.35.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/README.md +61 -4
- package/dist/bin/1claw.js +0 -0
- package/dist/src/commands/containers.d.ts +3 -0
- package/dist/src/commands/containers.d.ts.map +1 -0
- package/dist/src/commands/containers.js +130 -0
- package/dist/src/commands/containers.js.map +1 -0
- package/dist/src/commands/daemon.js +17 -9
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deploy.d.ts +3 -0
- package/dist/src/commands/deploy.d.ts.map +1 -0
- package/dist/src/commands/deploy.js +158 -0
- package/dist/src/commands/deploy.js.map +1 -0
- package/dist/src/commands/eject.d.ts +3 -0
- package/dist/src/commands/eject.d.ts.map +1 -0
- package/dist/src/commands/eject.js +84 -0
- package/dist/src/commands/eject.js.map +1 -0
- package/dist/src/commands/init.d.ts +3 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +475 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/publish.d.ts +3 -0
- package/dist/src/commands/publish.d.ts.map +1 -0
- package/dist/src/commands/publish.js +153 -0
- package/dist/src/commands/publish.js.map +1 -0
- package/dist/src/deploy/google-cloud/main.tf +74 -0
- package/dist/src/deploy/google-cloud/outputs.tf +9 -0
- package/dist/src/deploy/google-cloud/variables.tf +44 -0
- package/dist/src/docker/base/Dockerfile +34 -0
- package/dist/src/docker/base/chat-ui/index.html +110 -0
- package/dist/src/docker/base/chat-ui/server.js +233 -0
- package/dist/src/docker/base/entrypoint.sh +61 -0
- package/dist/src/docker/base/healthcheck.sh +2 -0
- package/dist/src/docker/compose.yaml +20 -0
- package/dist/src/docker/templates/Dockerfile.tmpl +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/container-config.d.ts +43 -0
- package/dist/src/lib/container-config.d.ts.map +1 -0
- package/dist/src/lib/container-config.js +98 -0
- package/dist/src/lib/container-config.js.map +1 -0
- package/dist/src/lib/daemon-control.d.ts +10 -0
- package/dist/src/lib/daemon-control.d.ts.map +1 -0
- package/dist/src/lib/daemon-control.js +58 -0
- package/dist/src/lib/daemon-control.js.map +1 -0
- package/dist/src/lib/docker-client.d.ts +58 -0
- package/dist/src/lib/docker-client.d.ts.map +1 -0
- package/dist/src/lib/docker-client.js +193 -0
- package/dist/src/lib/docker-client.js.map +1 -0
- package/dist/src/lib/image-build.d.ts +30 -0
- package/dist/src/lib/image-build.d.ts.map +1 -0
- package/dist/src/lib/image-build.js +74 -0
- package/dist/src/lib/image-build.js.map +1 -0
- package/dist/src/lib/paths.d.ts +14 -0
- package/dist/src/lib/paths.d.ts.map +1 -0
- package/dist/src/lib/paths.js +38 -0
- package/dist/src/lib/paths.js.map +1 -0
- package/dist/src/modules/ampersend/config.json +8 -0
- package/dist/src/modules/ampersend/module.yaml +32 -0
- package/dist/src/modules/ampersend/startup.sh +4 -0
- package/dist/src/modules/elizaos/config.json +7 -0
- package/dist/src/modules/elizaos/module.yaml +30 -0
- package/dist/src/modules/elizaos/startup.sh +3 -0
- package/dist/src/modules/langchain/module.yaml +30 -0
- package/dist/src/modules/langchain/startup.sh +3 -0
- package/dist/src/modules/onchain/module.yaml +28 -0
- package/dist/src/modules/onchain/startup.sh +3 -0
- package/dist/src/modules/registry.d.ts +48 -0
- package/dist/src/modules/registry.d.ts.map +1 -0
- package/dist/src/modules/registry.js +201 -0
- package/dist/src/modules/registry.js.map +1 -0
- package/dist/src/modules/scaffold-agent/module.yaml +30 -0
- package/dist/src/modules/scaffold-agent/startup.sh +3 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/commands/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MA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CAAC,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,8CAA8C,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3D,UAAU,CACN,uEAAuE,CAC1E,CAAC;QACN,CAAC;QACD,MAAM,GAAG,CAAC;IACd,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAC9B,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,YAAY,CAAC,YAAY,CAAC,CAAC;IAC3B,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,SAAS,CAAC,0EAA0E,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Generated by `1claw deploy --google-cloud`.
|
|
2
|
+
# Deploys a 1Claw agent container to Cloud Run with the agent API key stored in
|
|
3
|
+
# Secret Manager and injected as an environment variable at runtime.
|
|
4
|
+
terraform {
|
|
5
|
+
required_providers {
|
|
6
|
+
google = {
|
|
7
|
+
source = "hashicorp/google"
|
|
8
|
+
version = ">= 5.0"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
provider "google" {
|
|
14
|
+
project = var.project_id
|
|
15
|
+
region = var.region
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
resource "google_secret_manager_secret" "agent_key" {
|
|
19
|
+
secret_id = "${var.service_name}-agent-key"
|
|
20
|
+
replication {
|
|
21
|
+
auto {}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
resource "google_secret_manager_secret_version" "agent_key" {
|
|
26
|
+
secret = google_secret_manager_secret.agent_key.id
|
|
27
|
+
secret_data = var.agent_api_key
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
resource "google_cloud_run_v2_service" "agent" {
|
|
31
|
+
name = var.service_name
|
|
32
|
+
location = var.region
|
|
33
|
+
|
|
34
|
+
template {
|
|
35
|
+
containers {
|
|
36
|
+
image = var.image_tag
|
|
37
|
+
|
|
38
|
+
ports {
|
|
39
|
+
container_port = 3000
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Cloud mode: the container talks to the 1Claw API directly using the
|
|
43
|
+
# agent key injected from Secret Manager (no host daemon in the cloud).
|
|
44
|
+
env {
|
|
45
|
+
name = "ONECLAW_LOCAL_VAULT"
|
|
46
|
+
value = "false"
|
|
47
|
+
}
|
|
48
|
+
env {
|
|
49
|
+
name = "ONECLAW_AGENT_ID"
|
|
50
|
+
value = var.agent_id
|
|
51
|
+
}
|
|
52
|
+
env {
|
|
53
|
+
name = "ONECLAW_CONTAINER_MODULES"
|
|
54
|
+
value = var.modules
|
|
55
|
+
}
|
|
56
|
+
env {
|
|
57
|
+
name = "ONECLAW_AGENT_API_KEY"
|
|
58
|
+
value_source {
|
|
59
|
+
secret_key_ref {
|
|
60
|
+
secret = google_secret_manager_secret.agent_key.secret_id
|
|
61
|
+
version = "latest"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
resource "google_cloud_run_v2_service_iam_member" "invoker" {
|
|
70
|
+
name = google_cloud_run_v2_service.agent.name
|
|
71
|
+
location = google_cloud_run_v2_service.agent.location
|
|
72
|
+
role = "roles/run.invoker"
|
|
73
|
+
member = var.invoker_member
|
|
74
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
variable "project_id" {
|
|
2
|
+
type = string
|
|
3
|
+
description = "Google Cloud project ID"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
variable "region" {
|
|
7
|
+
type = string
|
|
8
|
+
description = "Cloud Run region"
|
|
9
|
+
default = "us-central1"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "service_name" {
|
|
13
|
+
type = string
|
|
14
|
+
description = "Cloud Run service name"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
variable "image_tag" {
|
|
18
|
+
type = string
|
|
19
|
+
description = "Container image (must be in a registry, e.g. docker.io/<user>/<name>:<tag>)"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
variable "agent_id" {
|
|
23
|
+
type = string
|
|
24
|
+
description = "1Claw agent ID (metadata only)"
|
|
25
|
+
default = ""
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
variable "modules" {
|
|
29
|
+
type = string
|
|
30
|
+
description = "Comma-separated module names baked into the image"
|
|
31
|
+
default = ""
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
variable "agent_api_key" {
|
|
35
|
+
type = string
|
|
36
|
+
description = "1Claw agent API key (ocv_...) stored in Secret Manager"
|
|
37
|
+
sensitive = true
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
variable "invoker_member" {
|
|
41
|
+
type = string
|
|
42
|
+
description = "IAM member allowed to invoke the service"
|
|
43
|
+
default = "allUsers"
|
|
44
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
FROM node:20-alpine AS base
|
|
2
|
+
|
|
3
|
+
RUN apk add --no-cache curl tini
|
|
4
|
+
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Install the 1Claw MCP server (local daemon mode). Best-effort: the chat UI
|
|
8
|
+
# talks to the daemon over the mounted socket directly, so the container is
|
|
9
|
+
# still healthy if the registry is unreachable at build time.
|
|
10
|
+
RUN npm install -g @1claw/mcp@latest || echo "WARN: @1claw/mcp install deferred to runtime"
|
|
11
|
+
|
|
12
|
+
# Baked-in chat UI (single Node http server + static HTML, zero deps).
|
|
13
|
+
COPY chat-ui /app/chat-ui
|
|
14
|
+
|
|
15
|
+
# Startup + health scripts
|
|
16
|
+
COPY entrypoint.sh /app/entrypoint.sh
|
|
17
|
+
COPY healthcheck.sh /app/healthcheck.sh
|
|
18
|
+
RUN chmod +x /app/entrypoint.sh /app/healthcheck.sh
|
|
19
|
+
|
|
20
|
+
# Module extension point: modules drop assets under /app/modules
|
|
21
|
+
RUN mkdir -p /app/modules /run/1claw
|
|
22
|
+
|
|
23
|
+
ENV NODE_ENV=production
|
|
24
|
+
ENV ONECLAW_LOCAL_VAULT=true
|
|
25
|
+
ENV ONECLAW_DAEMON_SOCKET=/run/1claw/daemon.sock
|
|
26
|
+
ENV CHAT_UI_PORT=3000
|
|
27
|
+
|
|
28
|
+
EXPOSE 3000
|
|
29
|
+
|
|
30
|
+
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=5 \
|
|
31
|
+
CMD /app/healthcheck.sh
|
|
32
|
+
|
|
33
|
+
ENTRYPOINT ["tini", "--"]
|
|
34
|
+
CMD ["/app/entrypoint.sh"]
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>1Claw Agent</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root { color-scheme: dark; }
|
|
9
|
+
* { box-sizing: border-box; }
|
|
10
|
+
body {
|
|
11
|
+
margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
12
|
+
background: #0b0d12; color: #e6e9ef; height: 100vh; display: flex; flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
header {
|
|
15
|
+
padding: 12px 18px; border-bottom: 1px solid #1c2230;
|
|
16
|
+
display: flex; align-items: center; gap: 12px; background: #0e1219;
|
|
17
|
+
}
|
|
18
|
+
header .dot { width: 9px; height: 9px; border-radius: 50%; background: #38d39f; box-shadow: 0 0 8px #38d39f; }
|
|
19
|
+
header h1 { font-size: 15px; margin: 0; font-weight: 600; }
|
|
20
|
+
header .meta { margin-left: auto; font-size: 12px; color: #7c869b; }
|
|
21
|
+
header .badge { background: #1c2230; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
|
|
22
|
+
#log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
|
|
23
|
+
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
|
|
24
|
+
.user { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 3px; }
|
|
25
|
+
.bot { align-self: flex-start; background: #161b25; border: 1px solid #1c2230; border-bottom-left-radius: 3px; }
|
|
26
|
+
.tool { align-self: flex-start; font-size: 11px; color: #8aa0c2; margin-top: -6px; }
|
|
27
|
+
form { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid #1c2230; background: #0e1219; }
|
|
28
|
+
input { flex: 1; background: #0b0d12; border: 1px solid #28303f; color: #e6e9ef; padding: 11px 14px; border-radius: 10px; font-size: 14px; outline: none; }
|
|
29
|
+
input:focus { border-color: #2563eb; }
|
|
30
|
+
button { background: #2563eb; color: #fff; border: none; padding: 0 18px; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600; }
|
|
31
|
+
button:disabled { opacity: .5; cursor: default; }
|
|
32
|
+
a { color: #6ea8fe; }
|
|
33
|
+
</style>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<header>
|
|
37
|
+
<span class="dot"></span>
|
|
38
|
+
<h1>1Claw Agent</h1>
|
|
39
|
+
<span class="meta" id="meta">connecting…</span>
|
|
40
|
+
</header>
|
|
41
|
+
<div id="log"></div>
|
|
42
|
+
<form id="form">
|
|
43
|
+
<input id="input" placeholder="Type a message or /help" autocomplete="off" autofocus />
|
|
44
|
+
<button id="send" type="submit">Send</button>
|
|
45
|
+
</form>
|
|
46
|
+
<script>
|
|
47
|
+
const log = document.getElementById("log");
|
|
48
|
+
const form = document.getElementById("form");
|
|
49
|
+
const input = document.getElementById("input");
|
|
50
|
+
const send = document.getElementById("send");
|
|
51
|
+
const meta = document.getElementById("meta");
|
|
52
|
+
|
|
53
|
+
function add(role, text, tool) {
|
|
54
|
+
if (tool) {
|
|
55
|
+
const t = document.createElement("div");
|
|
56
|
+
t.className = "tool";
|
|
57
|
+
t.textContent = "⚙ tool: " + tool;
|
|
58
|
+
log.appendChild(t);
|
|
59
|
+
}
|
|
60
|
+
const el = document.createElement("div");
|
|
61
|
+
el.className = "msg " + (role === "user" ? "user" : "bot");
|
|
62
|
+
el.textContent = text;
|
|
63
|
+
log.appendChild(el);
|
|
64
|
+
log.scrollTop = log.scrollHeight;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function loadInfo() {
|
|
68
|
+
try {
|
|
69
|
+
const r = await fetch("/api/info");
|
|
70
|
+
const info = await r.json();
|
|
71
|
+
const parts = [];
|
|
72
|
+
parts.push("mode=" + info.mode);
|
|
73
|
+
if (info.agentId) parts.push("agent=" + info.agentId.slice(0, 8) + "…");
|
|
74
|
+
if (info.modules && info.modules.length) parts.push("modules=" + info.modules.join(","));
|
|
75
|
+
parts.push(info.daemonReachable ? "daemon ✓" : "daemon —");
|
|
76
|
+
meta.innerHTML = parts.map((p) => '<span class="badge">' + p + "</span>").join("");
|
|
77
|
+
} catch {
|
|
78
|
+
meta.textContent = "offline";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
form.addEventListener("submit", async (e) => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const message = input.value.trim();
|
|
85
|
+
if (!message) return;
|
|
86
|
+
add("user", message);
|
|
87
|
+
input.value = "";
|
|
88
|
+
send.disabled = true;
|
|
89
|
+
try {
|
|
90
|
+
const r = await fetch("/api/chat", {
|
|
91
|
+
method: "POST",
|
|
92
|
+
headers: { "Content-Type": "application/json" },
|
|
93
|
+
body: JSON.stringify({ message }),
|
|
94
|
+
});
|
|
95
|
+
const data = await r.json();
|
|
96
|
+
add("bot", data.reply || "(no reply)", data.tool);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
add("bot", "Error: " + err.message);
|
|
99
|
+
} finally {
|
|
100
|
+
send.disabled = false;
|
|
101
|
+
input.focus();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
add("bot", "1Claw agent ready. Your credentials stay in the host daemon — this container never sees secret values. Type /help to begin.");
|
|
106
|
+
loadInfo();
|
|
107
|
+
setInterval(loadInfo, 15000);
|
|
108
|
+
</script>
|
|
109
|
+
</body>
|
|
110
|
+
</html>
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// 1Claw agent chat UI — a tiny, zero-dependency HTTP server.
|
|
3
|
+
//
|
|
4
|
+
// It serves a single-page chat interface and bridges browser requests to the
|
|
5
|
+
// host daemon over the mounted Unix socket. Secret VALUES never transit this
|
|
6
|
+
// process: the daemon injects them into outbound requests and returns only the
|
|
7
|
+
// upstream response. This server only ever sees secret NAMES and metadata.
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
const http = require("node:http");
|
|
11
|
+
const { readFileSync } = require("node:fs");
|
|
12
|
+
const { join } = require("node:path");
|
|
13
|
+
|
|
14
|
+
const PORT = parseInt(process.env.CHAT_UI_PORT || "3000", 10);
|
|
15
|
+
const SOCKET = process.env.ONECLAW_DAEMON_SOCKET || "/run/1claw/daemon.sock";
|
|
16
|
+
const AGENT_ID = process.env.ONECLAW_AGENT_ID || "";
|
|
17
|
+
const MODULES = (process.env.ONECLAW_CONTAINER_MODULES || "")
|
|
18
|
+
.split(",")
|
|
19
|
+
.map((m) => m.trim())
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
const MODE = process.env.ONECLAW_LOCAL_VAULT === "true" ? "local" : "cloud";
|
|
22
|
+
|
|
23
|
+
let INDEX_HTML = "<h1>1Claw Agent Running</h1>";
|
|
24
|
+
try {
|
|
25
|
+
INDEX_HTML = readFileSync(join(__dirname, "index.html"), "utf-8");
|
|
26
|
+
} catch {
|
|
27
|
+
/* fall back to placeholder */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Call the host daemon over the Unix socket. */
|
|
31
|
+
function daemonRequest(method, path, body) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const payload = body ? JSON.stringify(body) : undefined;
|
|
34
|
+
const req = http.request(
|
|
35
|
+
{
|
|
36
|
+
socketPath: SOCKET,
|
|
37
|
+
path,
|
|
38
|
+
method,
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
...(payload
|
|
42
|
+
? { "Content-Length": Buffer.byteLength(payload) }
|
|
43
|
+
: {}),
|
|
44
|
+
},
|
|
45
|
+
timeout: 10000,
|
|
46
|
+
},
|
|
47
|
+
(res) => {
|
|
48
|
+
const chunks = [];
|
|
49
|
+
res.on("data", (c) => chunks.push(c));
|
|
50
|
+
res.on("end", () => {
|
|
51
|
+
const text = Buffer.concat(chunks).toString("utf-8");
|
|
52
|
+
let parsed = null;
|
|
53
|
+
try {
|
|
54
|
+
parsed = text ? JSON.parse(text) : null;
|
|
55
|
+
} catch {
|
|
56
|
+
parsed = { raw: text };
|
|
57
|
+
}
|
|
58
|
+
resolve({ status: res.statusCode || 0, body: parsed });
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
req.on("error", reject);
|
|
63
|
+
req.on("timeout", () => req.destroy(new Error("daemon timeout")));
|
|
64
|
+
if (payload) req.write(payload);
|
|
65
|
+
req.end();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function json(res, status, obj) {
|
|
70
|
+
const body = JSON.stringify(obj);
|
|
71
|
+
res.writeHead(status, {
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
|
+
"Content-Length": Buffer.byteLength(body),
|
|
74
|
+
});
|
|
75
|
+
res.end(body);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function readBody(req) {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
const chunks = [];
|
|
81
|
+
let size = 0;
|
|
82
|
+
req.on("data", (c) => {
|
|
83
|
+
size += c.length;
|
|
84
|
+
if (size > 1024 * 1024) {
|
|
85
|
+
reject(new Error("body too large"));
|
|
86
|
+
req.destroy();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
chunks.push(c);
|
|
90
|
+
});
|
|
91
|
+
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
92
|
+
req.on("error", reject);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function daemonReachable() {
|
|
97
|
+
if (MODE !== "local") return false;
|
|
98
|
+
try {
|
|
99
|
+
const r = await daemonRequest("GET", "/health");
|
|
100
|
+
return r.status === 200;
|
|
101
|
+
} catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// A minimal, LLM-optional assistant. Demonstrates the daemon trust boundary
|
|
107
|
+
// with slash commands; if an LLM provider is wired in later it replaces this.
|
|
108
|
+
async function handleChat(message) {
|
|
109
|
+
const text = (message || "").trim();
|
|
110
|
+
|
|
111
|
+
if (text === "/help" || text === "") {
|
|
112
|
+
return {
|
|
113
|
+
reply:
|
|
114
|
+
"1Claw agent ready. Commands:\n" +
|
|
115
|
+
" /secrets — list secret names available via the daemon\n" +
|
|
116
|
+
" /info — show this agent's runtime info\n" +
|
|
117
|
+
" /proxy <name> <url> — make a request with the secret injected by the daemon\n" +
|
|
118
|
+
"Secret values never enter this container.",
|
|
119
|
+
tool: null,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (text === "/info") {
|
|
124
|
+
return {
|
|
125
|
+
reply: `Agent ${AGENT_ID || "(local)"} · mode=${MODE} · modules=${MODULES.join(", ") || "none"}`,
|
|
126
|
+
tool: "info",
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (text === "/secrets") {
|
|
131
|
+
try {
|
|
132
|
+
const r = await daemonRequest("GET", "/secrets");
|
|
133
|
+
if (r.status !== 200) {
|
|
134
|
+
return { reply: `Daemon returned ${r.status}`, tool: "list_secrets" };
|
|
135
|
+
}
|
|
136
|
+
const names = (r.body.secrets || []).map((s) => s.name);
|
|
137
|
+
return {
|
|
138
|
+
reply: names.length
|
|
139
|
+
? "Available secrets:\n" + names.map((n) => " • " + n).join("\n")
|
|
140
|
+
: "No secrets available to this agent.",
|
|
141
|
+
tool: "list_secrets",
|
|
142
|
+
};
|
|
143
|
+
} catch (err) {
|
|
144
|
+
return { reply: `Could not reach daemon: ${err.message}`, tool: "list_secrets" };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (text.startsWith("/proxy ")) {
|
|
149
|
+
const parts = text.split(/\s+/);
|
|
150
|
+
const secretName = parts[1];
|
|
151
|
+
const url = parts[2];
|
|
152
|
+
if (!secretName || !url) {
|
|
153
|
+
return { reply: "Usage: /proxy <secret-name> <url>", tool: null };
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
const r = await daemonRequest("POST", "/proxy", {
|
|
157
|
+
secretName,
|
|
158
|
+
url,
|
|
159
|
+
method: "GET",
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
reply:
|
|
163
|
+
r.status === 200
|
|
164
|
+
? `Proxied request (secret injected by daemon). Upstream status: ${r.body.status}`
|
|
165
|
+
: `Daemon denied request (${r.status}): ${r.body && r.body.error}`,
|
|
166
|
+
tool: "proxy_request",
|
|
167
|
+
};
|
|
168
|
+
} catch (err) {
|
|
169
|
+
return { reply: `Proxy error: ${err.message}`, tool: "proxy_request" };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
reply:
|
|
175
|
+
"No LLM provider is configured in this container yet. " +
|
|
176
|
+
"Try /help, /secrets, /info, or /proxy. " +
|
|
177
|
+
"Wire a model via a module to enable conversational replies.",
|
|
178
|
+
tool: null,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const server = http.createServer(async (req, res) => {
|
|
183
|
+
const url = req.url || "/";
|
|
184
|
+
const method = req.method || "GET";
|
|
185
|
+
|
|
186
|
+
if (url === "/health") {
|
|
187
|
+
return json(res, 200, { status: "ok", agent: AGENT_ID || null, mode: MODE });
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (url === "/api/info" && method === "GET") {
|
|
191
|
+
return json(res, 200, {
|
|
192
|
+
agentId: AGENT_ID || null,
|
|
193
|
+
modules: MODULES,
|
|
194
|
+
mode: MODE,
|
|
195
|
+
daemonReachable: await daemonReachable(),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (url === "/api/secrets" && method === "GET") {
|
|
200
|
+
try {
|
|
201
|
+
const r = await daemonRequest("GET", "/secrets");
|
|
202
|
+
return json(res, r.status, r.body || { secrets: [] });
|
|
203
|
+
} catch (err) {
|
|
204
|
+
return json(res, 502, { error: `daemon unreachable: ${err.message}` });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (url === "/api/chat" && method === "POST") {
|
|
209
|
+
let body;
|
|
210
|
+
try {
|
|
211
|
+
body = JSON.parse((await readBody(req)) || "{}");
|
|
212
|
+
} catch {
|
|
213
|
+
return json(res, 400, { error: "invalid JSON" });
|
|
214
|
+
}
|
|
215
|
+
const result = await handleChat(body.message);
|
|
216
|
+
return json(res, 200, result);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (url === "/" || url === "/index.html") {
|
|
220
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
221
|
+
return res.end(INDEX_HTML);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
json(res, 404, { error: "not found" });
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
server.listen(PORT, "0.0.0.0", () => {
|
|
228
|
+
console.log(`[chat-ui] listening on :${PORT} (mode=${MODE})`);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
232
|
+
process.on(sig, () => server.close(() => process.exit(0)));
|
|
233
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# 1Claw agent container entrypoint.
|
|
3
|
+
# Supports two modes:
|
|
4
|
+
# local (ONECLAW_LOCAL_VAULT=true) → credentials injected by the host daemon
|
|
5
|
+
# over the mounted Unix socket. The key
|
|
6
|
+
# NEVER enters the container.
|
|
7
|
+
# cloud (ONECLAW_LOCAL_VAULT=false) → the agent API key is provided directly
|
|
8
|
+
# (e.g. via a Secret Manager mount).
|
|
9
|
+
set -e
|
|
10
|
+
|
|
11
|
+
CHAT_UI_PORT="${CHAT_UI_PORT:-3000}"
|
|
12
|
+
|
|
13
|
+
echo "─────────────────────────────────────────────"
|
|
14
|
+
echo " 1Claw agent container starting"
|
|
15
|
+
echo " Agent ID: ${ONECLAW_AGENT_ID:-not set}"
|
|
16
|
+
echo " Modules: ${ONECLAW_CONTAINER_MODULES:-none}"
|
|
17
|
+
|
|
18
|
+
if [ "$ONECLAW_LOCAL_VAULT" = "true" ]; then
|
|
19
|
+
echo " Mode: local (daemon socket)"
|
|
20
|
+
echo " Socket: $ONECLAW_DAEMON_SOCKET"
|
|
21
|
+
if [ ! -S "$ONECLAW_DAEMON_SOCKET" ]; then
|
|
22
|
+
echo ""
|
|
23
|
+
echo "ERROR: Daemon socket not found at $ONECLAW_DAEMON_SOCKET"
|
|
24
|
+
echo ""
|
|
25
|
+
echo "The 1Claw daemon must be running on the host with the socket mounted:"
|
|
26
|
+
echo " 1claw daemon start"
|
|
27
|
+
echo " docker run -v ~/.config/1claw/daemon.sock:/run/1claw/daemon.sock:ro ..."
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
echo "─────────────────────────────────────────────"
|
|
31
|
+
# Start the MCP server in local daemon mode (best-effort).
|
|
32
|
+
if command -v 1claw-mcp >/dev/null 2>&1; then
|
|
33
|
+
ONECLAW_LOCAL_VAULT=true 1claw-mcp --local 2>/tmp/mcp.log &
|
|
34
|
+
else
|
|
35
|
+
echo "NOTE: @1claw/mcp not installed in image; chat UI uses the daemon directly."
|
|
36
|
+
fi
|
|
37
|
+
else
|
|
38
|
+
echo " Mode: cloud (agent API key)"
|
|
39
|
+
if [ -z "$ONECLAW_AGENT_API_KEY" ]; then
|
|
40
|
+
echo ""
|
|
41
|
+
echo "ERROR: ONECLAW_AGENT_API_KEY is not set (cloud mode)."
|
|
42
|
+
echo "Provide it via a Secret Manager mount or -e ONECLAW_AGENT_API_KEY=..."
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
echo "─────────────────────────────────────────────"
|
|
46
|
+
if command -v 1claw-mcp >/dev/null 2>&1; then
|
|
47
|
+
1claw-mcp 2>/tmp/mcp.log &
|
|
48
|
+
fi
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Run module startup hooks (each module may drop an executable startup.sh).
|
|
52
|
+
for hook in /app/modules/*/startup.sh; do
|
|
53
|
+
if [ -x "$hook" ]; then
|
|
54
|
+
echo "Running module hook: $hook"
|
|
55
|
+
"$hook" || echo "WARN: module hook $hook exited non-zero"
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
|
|
59
|
+
# Start the chat UI (the container's health anchor) in the foreground.
|
|
60
|
+
echo "Ready: http://0.0.0.0:${CHAT_UI_PORT}"
|
|
61
|
+
exec node /app/chat-ui/server.js
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# docker-compose template for a 1Claw agent container (local daemon mode).
|
|
2
|
+
# Generated by `1claw eject`. The daemon must be running on the host:
|
|
3
|
+
# 1claw daemon start
|
|
4
|
+
services:
|
|
5
|
+
agent:
|
|
6
|
+
image: {{IMAGE}}
|
|
7
|
+
container_name: {{NAME}}
|
|
8
|
+
restart: unless-stopped
|
|
9
|
+
ports:
|
|
10
|
+
- "{{PORT}}:3000"
|
|
11
|
+
volumes:
|
|
12
|
+
# Host daemon socket — credentials are injected here; the container
|
|
13
|
+
# never receives the raw agent key.
|
|
14
|
+
- {{DAEMON_SOCKET}}:/run/1claw/daemon.sock:ro
|
|
15
|
+
environment:
|
|
16
|
+
ONECLAW_LOCAL_VAULT: "true"
|
|
17
|
+
ONECLAW_DAEMON_SOCKET: /run/1claw/daemon.sock
|
|
18
|
+
ONECLAW_AGENT_ID: "{{AGENT_ID}}"
|
|
19
|
+
ONECLAW_CONTAINER_MODULES: "{{MODULES}}"
|
|
20
|
+
CHAT_UI_PORT: "3000"
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDpC,wBAAgB,aAAa,IAAI,OAAO,CAiFvC"}
|
package/dist/src/index.js
CHANGED
|
@@ -26,6 +26,11 @@ import { webhookCommand } from "./commands/webhook.js";
|
|
|
26
26
|
import { platformCommand } from "./commands/platform.js";
|
|
27
27
|
import { deviceCommand } from "./commands/device.js";
|
|
28
28
|
import { approvalCommand } from "./commands/approval.js";
|
|
29
|
+
import { initCommand } from "./commands/init.js";
|
|
30
|
+
import { publishCommand } from "./commands/publish.js";
|
|
31
|
+
import { ejectCommand } from "./commands/eject.js";
|
|
32
|
+
import { containersCommand } from "./commands/containers.js";
|
|
33
|
+
import { deployCommand } from "./commands/deploy.js";
|
|
29
34
|
import { setOutputFormat, setApiUrl } from "./config.js";
|
|
30
35
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
31
36
|
// Compiled to dist/src/index.js → ../../package.json; ts-node from src/ → ../package.json
|
|
@@ -65,6 +70,12 @@ export function createProgram() {
|
|
|
65
70
|
program.addCommand(importCommand);
|
|
66
71
|
program.addCommand(localCommand);
|
|
67
72
|
program.addCommand(daemonCommand);
|
|
73
|
+
// Containerized agent runtime
|
|
74
|
+
program.addCommand(initCommand);
|
|
75
|
+
program.addCommand(publishCommand);
|
|
76
|
+
program.addCommand(ejectCommand);
|
|
77
|
+
program.addCommand(containersCommand);
|
|
78
|
+
program.addCommand(deployCommand);
|
|
68
79
|
// Config
|
|
69
80
|
program.addCommand(configCommand);
|
|
70
81
|
// Treasury
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,aAAa,EACb,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MA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