@gentbajko/slopify 1.3.1 → 1.4.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 +12 -6
- package/dist/adapter-registry.js +11 -1
- package/dist/adapters/host-cli/index.js +192 -0
- package/dist/adapters/host-cli/transport.js +135 -0
- package/dist/adapters/image/codex.js +15 -6
- package/dist/adapters/llm/claude-code-models.js +1 -0
- package/dist/adapters/llm/claude-code.js +7 -0
- package/dist/adapters/llm/cli-login-error.js +16 -0
- package/dist/adapters/llm/codex.js +10 -0
- package/dist/edge/cli.js +36 -0
- package/dist/edge/docker.js +109 -0
- package/dist/edge/host-cli.js +58 -0
- package/dist/edge/http/actions.js +1 -1
- package/dist/edge/http/diagnostics.js +5 -1
- package/dist/edge/http/host-cli.js +247 -0
- package/dist/edge/http/providers.js +5 -1
- package/dist/host-cli/environment.js +25 -0
- package/dist/host-cli/install.js +61 -0
- package/dist/host-cli/paths.js +68 -0
- package/dist/host-cli/runtime.js +78 -0
- package/dist/host-cli/server.js +98 -0
- package/dist/host-cli/service.js +200 -0
- package/dist/host-cli/status.js +134 -0
- package/dist/kernel/ports/host-cli.js +95 -0
- package/dist/kernel/ports/model.js +1 -0
- package/dist/kernel/runner/attempt.js +10 -1
- package/dist/main.js +7 -1
- package/dist/slices/settings/cli-paths.js +5 -0
- package/dist/slices/settings/cli-status.js +2 -0
- package/dist/slices/settings/readiness.js +15 -1
- package/dist/web/assets/{index-DsumGtv6.js → index-DV1LKwBP.js} +21 -21
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/scripts/docker-run.sh +8 -45
package/dist/web/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
7
|
<meta name="color-scheme" content="dark light" />
|
|
8
8
|
<title>Slopify</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DV1LKwBP.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DX1_chKs.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/package.json
CHANGED
package/scripts/docker-run.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
4
|
if [[ "$(uname -s)" != Linux ]]; then
|
|
5
|
-
echo "
|
|
5
|
+
echo "This Docker launcher requires Linux. Use plain Docker with API providers on this host." >&2
|
|
6
6
|
exit 1
|
|
7
7
|
fi
|
|
8
8
|
|
|
@@ -19,58 +19,21 @@ if [[ "$host_port" == 0 ]]; then published_port=""; fi
|
|
|
19
19
|
|
|
20
20
|
mounts=()
|
|
21
21
|
environment=()
|
|
22
|
-
|
|
23
|
-
if [[ -n $
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
local command_name=$1 expected_package=$2 target=$3
|
|
27
|
-
local launcher package_dir actual_package
|
|
28
|
-
launcher=$(command -v "$command_name") || return 0
|
|
29
|
-
launcher=$(readlink -f "$launcher")
|
|
30
|
-
package_dir=$(dirname "$(dirname "$launcher")")
|
|
31
|
-
if [[ ! -f "$package_dir/package.json" ]]; then
|
|
32
|
-
echo "Cannot bridge $command_name: expected an npm package around $launcher." >&2
|
|
33
|
-
exit 1
|
|
34
|
-
fi
|
|
35
|
-
actual_package=$(node -p 'require(process.argv[1]).name' "$package_dir/package.json")
|
|
36
|
-
if [[ "$actual_package" != "$expected_package" ]]; then
|
|
37
|
-
echo "Cannot bridge $command_name: $launcher is not from $expected_package." >&2
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
mounts+=(--mount "type=bind,source=$package_dir,target=$target,readonly")
|
|
41
|
-
installations+=("$(stat -Lc '%d:%i' "$package_dir")")
|
|
42
|
-
echo "Detected $command_name: $launcher" >&2
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
bridge_node_package codex @openai/codex /opt/host-clis/codex
|
|
46
|
-
bridge_node_package gemini @google/gemini-cli /opt/host-clis/gemini
|
|
47
|
-
|
|
48
|
-
# Model metadata is separate from login state. Mount only this file, never the
|
|
49
|
-
# user's Codex home, which also contains credentials and conversation history.
|
|
50
|
-
codex_models=${CODEX_HOME:-$HOME/.codex}/models_cache.json
|
|
51
|
-
if command -v codex >/dev/null 2>&1 && [[ -f "$codex_models" ]]; then
|
|
52
|
-
codex_models=$(readlink -f "$codex_models")
|
|
53
|
-
mounts+=(--mount "type=bind,source=$codex_models,target=/opt/host-cli-data/codex-models.json,readonly")
|
|
54
|
-
environment+=(--env SLOPIFY_CODEX_MODELS_FILE=/opt/host-cli-data/codex-models.json)
|
|
55
|
-
installations+=("$(stat -Lc '%d:%i' "$codex_models")")
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
if command -v claude >/dev/null 2>&1; then
|
|
59
|
-
claude_binary=$(readlink -f "$(command -v claude)")
|
|
60
|
-
if [[ "$(head -c 4 "$claude_binary")" != $'\177ELF' ]]; then
|
|
61
|
-
echo "Cannot bridge claude: this launcher is not a native Linux executable." >&2
|
|
22
|
+
bridge_directory=${SLOPIFY_HOST_CLI_DIR:-}
|
|
23
|
+
if [[ -n "$bridge_directory" ]]; then
|
|
24
|
+
if [[ ! -d "$bridge_directory" || ! -S "$bridge_directory/cli.sock" || ! -f "$bridge_directory/token" || "$bridge_directory" == *,* ]]; then
|
|
25
|
+
echo "Host CLI helper is not ready. Rerun the Slopify Docker launcher." >&2
|
|
62
26
|
exit 1
|
|
63
27
|
fi
|
|
64
|
-
mounts+=(--mount "type=bind,source=$
|
|
65
|
-
|
|
66
|
-
echo "Detected claude: $claude_binary" >&2
|
|
28
|
+
mounts+=(--mount "type=bind,source=$bridge_directory,target=/opt/slopify-host,readonly")
|
|
29
|
+
environment+=(--env SLOPIFY_HOST_CLI_DIR=/opt/slopify-host)
|
|
67
30
|
fi
|
|
68
31
|
|
|
69
32
|
if ! docker image inspect "$image" >/dev/null 2>&1; then docker pull "$image"; fi
|
|
70
33
|
image_id=$(docker image inspect --format '{{.Id}}' "$image")
|
|
71
34
|
# Changing an installation path or image requires new bind mounts. Re-running
|
|
72
35
|
# the launcher reconciles those automatically while keeping the named data volume.
|
|
73
|
-
signature=$(printf '%s\0' "$image_id" "$volume" "$host_port" "$
|
|
36
|
+
signature=$(printf '%s\0' "$image_id" "$volume" "$host_port" "$bridge_directory" "host-cli-protocol-1" | sha256sum | cut -d ' ' -f 1)
|
|
74
37
|
previous=""
|
|
75
38
|
if docker container inspect "$container" >/dev/null 2>&1; then
|
|
76
39
|
existing_signature=$(docker inspect --format '{{index .Config.Labels "io.slopify.launcher"}}' "$container")
|