mycomesh-consumer 0.1.29 → 0.1.31
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/consumer.compose.yml +14 -3
- package/package.json +1 -1
- package/scripts/start-consumer.sh +7 -2
- package/src/cli.mjs +1 -1
- package/src/consumer.mjs +2 -2
package/consumer.compose.yml
CHANGED
|
@@ -37,11 +37,14 @@ services:
|
|
|
37
37
|
working_dir: /data
|
|
38
38
|
environment:
|
|
39
39
|
MYCOMESH_CONSUMER_DATA_DIR: /data
|
|
40
|
-
|
|
40
|
+
MYCOMESH_CONSUMER_PROTOCOL_VERSION: ${MYCOMESH_CONSUMER_PROTOCOL_VERSION:-8}
|
|
41
|
+
MYCOMESH_CONSUMER_NETWORK_CONFIG: ${MYCOMESH_CONSUMER_NETWORK_CONFIG:-/app/deployments/sepolia-provider-network-v8.json}
|
|
41
42
|
MYCOMESH_CONSUMER_PUBLIC_BASE_URL: http://127.0.0.1:8110/v1
|
|
42
43
|
MYCOMESH_V7_RELAY_URLS: ${MYCOMESH_V7_RELAY_URLS:-https://bridge.mycomesh.xyz}
|
|
43
44
|
MYCOMESH_V7_MAX_FEE_UNITS: ${MYCOMESH_V7_MAX_FEE_UNITS:-100000}
|
|
44
45
|
MYCOMESH_V7_REQUEST_TIMEOUT_SECONDS: ${MYCOMESH_V7_REQUEST_TIMEOUT_SECONDS:-300}
|
|
46
|
+
MYCOMESH_V8_RELAY_URLS: ${MYCOMESH_V8_RELAY_URLS:-https://bridge.mycomesh.xyz}
|
|
47
|
+
MYCOMESH_V8_MAX_FEE_UNITS: ${MYCOMESH_V8_MAX_FEE_UNITS:-100000}
|
|
45
48
|
HTTP_PROXY: ${MYCOMESH_CONSUMER_HTTP_PROXY:-}
|
|
46
49
|
HTTPS_PROXY: ${MYCOMESH_CONSUMER_HTTPS_PROXY:-}
|
|
47
50
|
ALL_PROXY: ${MYCOMESH_CONSUMER_ALL_PROXY:-}
|
|
@@ -72,8 +75,16 @@ services:
|
|
|
72
75
|
timeout: 5s
|
|
73
76
|
retries: 4
|
|
74
77
|
start_period: 10s
|
|
75
|
-
entrypoint: ["
|
|
76
|
-
command:
|
|
78
|
+
entrypoint: ["sh", "-ec"]
|
|
79
|
+
command:
|
|
80
|
+
- >-
|
|
81
|
+
if [ "$${MYCOMESH_CONSUMER_PROTOCOL_VERSION:-8}" = "8" ]; then
|
|
82
|
+
exec python -m gateway.consumer_v8 serve --host 0.0.0.0 --port 8110;
|
|
83
|
+
elif [ "$${MYCOMESH_CONSUMER_PROTOCOL_VERSION:-8}" = "7" ]; then
|
|
84
|
+
exec python -m gateway.consumer_v7 serve --host 0.0.0.0 --port 8110;
|
|
85
|
+
else
|
|
86
|
+
exec python -m gateway.local_consumer serve --host 0.0.0.0 --port 8110;
|
|
87
|
+
fi
|
|
77
88
|
|
|
78
89
|
volumes:
|
|
79
90
|
mycomesh-consumer-data:
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ PROJECT_NAME="mycomesh-consumer"
|
|
|
7
7
|
NODE_IMAGE="${MYCOMESH_NODE_IMAGE:-}"
|
|
8
8
|
CODEX_COMMAND="${MYCOMESH_CODEX_COMMAND:-codex}"
|
|
9
9
|
READY_TIMEOUT="${MYCOMESH_CONSUMER_READY_TIMEOUT_SECONDS:-1800}"
|
|
10
|
+
CONSUMER_VERSION="${MYCOMESH_CONSUMER_PROTOCOL_VERSION:-8}"
|
|
10
11
|
PROXY_URL="${MYCOMESH_CONSUMER_PROXY:-}"
|
|
11
12
|
NO_BROWSER=0
|
|
12
13
|
NO_CODEX=0
|
|
@@ -136,6 +137,10 @@ done
|
|
|
136
137
|
[[ "$NODE_IMAGE" =~ ^[A-Za-z0-9][A-Za-z0-9._/-]*@sha256:[a-f0-9]{64}$ ]] || die "Consumer image must be pinned by digest"
|
|
137
138
|
[[ "$READY_TIMEOUT" =~ ^[1-9][0-9]*$ ]] || die "--ready-timeout must be a positive integer"
|
|
138
139
|
((READY_TIMEOUT <= 86400)) || die "--ready-timeout must not exceed 86400 seconds"
|
|
140
|
+
case "$CONSUMER_VERSION" in
|
|
141
|
+
7|8) ;;
|
|
142
|
+
*) die "MYCOMESH_CONSUMER_PROTOCOL_VERSION must be 7 or 8" ;;
|
|
143
|
+
esac
|
|
139
144
|
|
|
140
145
|
DOCKER="$(find_docker_cli)"
|
|
141
146
|
if ((!DRY_RUN)); then "$DOCKER" info >/dev/null 2>&1 || die "Docker Engine/Desktop is not running"; fi
|
|
@@ -182,7 +187,7 @@ if ((DRY_RUN || NO_CODEX)); then
|
|
|
182
187
|
exit 0
|
|
183
188
|
fi
|
|
184
189
|
|
|
185
|
-
printf '%s\n' "Waiting for a healthy Settlement
|
|
190
|
+
printf '%s\n' "Waiting for a healthy Settlement V${CONSUMER_VERSION} Relay..."
|
|
186
191
|
command -v curl >/dev/null 2>&1 || die "curl is required while waiting for wallet onboarding"
|
|
187
192
|
started_at="$(date +%s)"
|
|
188
193
|
while ! curl --noproxy '*' --fail --silent --max-time 3 http://127.0.0.1:8110/ready >/dev/null 2>&1; do
|
|
@@ -192,7 +197,7 @@ while ! curl --noproxy '*' --fail --silent --max-time 3 http://127.0.0.1:8110/re
|
|
|
192
197
|
sleep 2
|
|
193
198
|
done
|
|
194
199
|
|
|
195
|
-
if ! codex_env="$("$DOCKER" compose --project-name "$PROJECT_NAME" --file "$COMPOSE_FILE" exec -T consumer python -m gateway.consumer_v7 codex-env)"; then
|
|
200
|
+
if ! codex_env="$("$DOCKER" compose --project-name "$PROJECT_NAME" --file "$COMPOSE_FILE" exec -T consumer sh -ec 'if [ "${MYCOMESH_CONSUMER_PROTOCOL_VERSION:-8}" = 8 ]; then exec python -m gateway.consumer_v8 codex-env; else exec python -m gateway.consumer_v7 codex-env; fi')"; then
|
|
196
201
|
die "could not load Codex credentials from the local Consumer"
|
|
197
202
|
fi
|
|
198
203
|
eval "$codex_env"
|
package/src/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { once } from "node:events";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
|
|
4
|
-
const CLI_VERSION = "0.1.
|
|
4
|
+
const CLI_VERSION = "0.1.31";
|
|
5
5
|
// The npm client is local-first. A public Gateway is an explicit override;
|
|
6
6
|
// the default remains the loopback Consumer edge so a blocked domain cannot
|
|
7
7
|
// strand the Codex client.
|
package/src/consumer.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { spawn as defaultSpawn } from "node:child_process";
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
|
-
const CONSUMER_RELEASE_VERSION = "0.1.
|
|
5
|
+
const CONSUMER_RELEASE_VERSION = "0.1.31";
|
|
6
6
|
const DEFAULT_NODE_IMAGE =
|
|
7
|
-
"ghcr.io/charleslzp/mycomesh-node@sha256:
|
|
7
|
+
"ghcr.io/charleslzp/mycomesh-node@sha256:ba6746dcfe3c3a8cfe49eece9ac1d5c39a088ea1f8d4601f61de23c15b7f5943";
|
|
8
8
|
const API_COMMANDS = new Set(["health", "models", "responses", "chat"]);
|
|
9
9
|
const API_VALUE_OPTIONS = new Set([
|
|
10
10
|
"--base-url",
|