@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,4 +1,4 @@
1
- # @1claw/cli (v0.36.1)
1
+ # @1claw/cli (v0.36.2)
2
2
 
3
3
  Command-line interface for [1Claw](https://1claw.xyz) — HSM-backed secret management for AI agents and humans.
4
4
 
@@ -1,45 +1,58 @@
1
1
  #!/bin/sh
2
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).
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 [ "$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
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
- echo " Mode: cloud (agent API key)"
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 (cloud mode)."
42
- echo "Provide it via a Secret Manager mount or -e ONECLAW_AGENT_API_KEY=..."
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 = "3";
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 = "3";
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/cli",
3
- "version": "0.36.1",
3
+ "version": "0.36.2",
4
4
  "description": "CLI for 1Claw — secrets management for AI agents and humans",
5
5
  "license": "MIT",
6
6
  "repository": {