@1claw/cli 0.36.1 → 0.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,45 +1,58 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# 1Claw agent container entrypoint.
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
3
|
+
#
|
|
4
|
+
# Credentials are brokered one of two ways:
|
|
5
|
+
# daemon-brokered → a host daemon Unix socket is mounted at
|
|
6
|
+
# $ONECLAW_DAEMON_SOCKET. The daemon injects the agent key
|
|
7
|
+
# (and any provider keys) into outbound requests. The keys
|
|
8
|
+
# NEVER enter the container. Used by `1claw init --docker`
|
|
9
|
+
# for both cloud and local modes.
|
|
10
|
+
# direct → no daemon socket; the agent API key is provided directly
|
|
11
|
+
# via $ONECLAW_AGENT_API_KEY (e.g. a Secret Manager mount on
|
|
12
|
+
# Cloud Run via `1claw deploy`).
|
|
9
13
|
set -e
|
|
10
14
|
|
|
11
15
|
CHAT_UI_PORT="${CHAT_UI_PORT:-3000}"
|
|
16
|
+
DAEMON_SOCKET="${ONECLAW_DAEMON_SOCKET:-/run/1claw/daemon.sock}"
|
|
12
17
|
|
|
13
18
|
echo "─────────────────────────────────────────────"
|
|
14
19
|
echo " 1Claw agent container starting"
|
|
15
20
|
echo " Agent ID: ${ONECLAW_AGENT_ID:-not set}"
|
|
16
21
|
echo " Modules: ${ONECLAW_CONTAINER_MODULES:-none}"
|
|
17
22
|
|
|
18
|
-
if [ "$
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
23
|
+
if [ -S "$DAEMON_SOCKET" ]; then
|
|
24
|
+
# Daemon socket present → host daemon brokers all credentials. This is the
|
|
25
|
+
# default for `1claw init --docker` (cloud and local). The agent/provider
|
|
26
|
+
# keys stay on the host and never enter the container.
|
|
27
|
+
echo " Mode: ${ONECLAW_MODE:-cloud} (daemon socket)"
|
|
28
|
+
echo " Socket: $DAEMON_SOCKET"
|
|
30
29
|
echo "─────────────────────────────────────────────"
|
|
31
30
|
# Start the MCP server in local daemon mode (best-effort).
|
|
32
31
|
if command -v 1claw-mcp >/dev/null 2>&1; then
|
|
33
|
-
ONECLAW_LOCAL_VAULT=true 1claw-mcp --local 2>/tmp/mcp.log &
|
|
32
|
+
ONECLAW_LOCAL_VAULT=true ONECLAW_DAEMON_SOCKET="$DAEMON_SOCKET" 1claw-mcp --local 2>/tmp/mcp.log &
|
|
34
33
|
else
|
|
35
34
|
echo "NOTE: @1claw/mcp not installed in image; chat UI uses the daemon directly."
|
|
36
35
|
fi
|
|
36
|
+
elif [ "$ONECLAW_LOCAL_VAULT" = "true" ]; then
|
|
37
|
+
# Local mode explicitly requested but no socket is mounted → misconfiguration.
|
|
38
|
+
echo ""
|
|
39
|
+
echo "ERROR: Daemon socket not found at $DAEMON_SOCKET"
|
|
40
|
+
echo ""
|
|
41
|
+
echo "The 1Claw daemon must be running on the host with the socket mounted:"
|
|
42
|
+
echo " 1claw daemon start"
|
|
43
|
+
echo " docker run -v ~/.config/1claw/daemon.sock:/run/1claw/daemon.sock:ro ..."
|
|
44
|
+
exit 1
|
|
37
45
|
else
|
|
38
|
-
|
|
46
|
+
# No daemon socket → standalone deploy. The agent API key must be supplied
|
|
47
|
+
# directly (e.g. Secret Manager mount).
|
|
48
|
+
echo " Mode: cloud (direct agent API key)"
|
|
39
49
|
if [ -z "$ONECLAW_AGENT_API_KEY" ]; then
|
|
40
50
|
echo ""
|
|
41
|
-
echo "ERROR: ONECLAW_AGENT_API_KEY is not set
|
|
42
|
-
echo "
|
|
51
|
+
echo "ERROR: No daemon socket mounted and ONECLAW_AGENT_API_KEY is not set."
|
|
52
|
+
echo ""
|
|
53
|
+
echo "Either run via '1claw init --docker' (mounts the host daemon socket),"
|
|
54
|
+
echo "or provide the key directly: -e ONECLAW_AGENT_API_KEY=... (or a Secret"
|
|
55
|
+
echo "Manager mount)."
|
|
43
56
|
exit 1
|
|
44
57
|
fi
|
|
45
58
|
echo "─────────────────────────────────────────────"
|
|
@@ -5,7 +5,7 @@ export declare const DEFAULT_BASE_IMAGE = "1claw/agent:stable";
|
|
|
5
5
|
* this whenever those change so an existing `1claw/agent:stable` is rebuilt
|
|
6
6
|
* instead of silently reused. Stamped into the image as a label.
|
|
7
7
|
*/
|
|
8
|
-
export declare const BASE_IMAGE_VERSION = "
|
|
8
|
+
export declare const BASE_IMAGE_VERSION = "4";
|
|
9
9
|
/** Build the base image from the bundled Docker context. */
|
|
10
10
|
export declare function buildBaseImage(tag?: string, onProgress?: (line: string) => void): Promise<string>;
|
|
11
11
|
/**
|
|
@@ -10,7 +10,7 @@ export const DEFAULT_BASE_IMAGE = "1claw/agent:stable";
|
|
|
10
10
|
* this whenever those change so an existing `1claw/agent:stable` is rebuilt
|
|
11
11
|
* instead of silently reused. Stamped into the image as a label.
|
|
12
12
|
*/
|
|
13
|
-
export const BASE_IMAGE_VERSION = "
|
|
13
|
+
export const BASE_IMAGE_VERSION = "4";
|
|
14
14
|
const BASE_VERSION_LABEL = "org.1claw.base-version";
|
|
15
15
|
/** Build the base image from the bundled Docker context. */
|
|
16
16
|
export async function buildBaseImage(tag = DEFAULT_BASE_IMAGE, onProgress) {
|