langmart-gateway-type3 3.0.0 → 3.0.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langmart-gateway-type3",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "LangMart Type 3 Gateway - Seller-Managed Gateway with Local Vault",
|
|
5
5
|
"main": "dist/index-server.js",
|
|
6
6
|
"types": "dist/index-server.d.ts",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"scripts/start.sh",
|
|
102
102
|
"scripts/stop.sh",
|
|
103
103
|
"scripts/status.sh",
|
|
104
|
-
"scripts/install
|
|
104
|
+
"scripts/install.sh",
|
|
105
105
|
".env.example",
|
|
106
106
|
"README.md"
|
|
107
107
|
],
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
2
|
+
# Installation Script for LangMart Gateway Type 3
|
|
3
|
+
# Run this script ON the target server to install the gateway
|
|
4
|
+
#
|
|
5
|
+
# Usage (from npm/unpkg - recommended):
|
|
6
|
+
# curl -fsSL https://unpkg.com/langmart-gateway-type3/scripts/install.sh | bash -s -- [OPTIONS]
|
|
7
|
+
#
|
|
8
|
+
# Usage (from npm/jsdelivr):
|
|
9
|
+
# curl -fsSL https://cdn.jsdelivr.net/npm/langmart-gateway-type3/scripts/install.sh | bash -s -- [OPTIONS]
|
|
10
|
+
#
|
|
11
|
+
# Or download and run:
|
|
12
|
+
# bash install.sh [OPTIONS]
|
|
5
13
|
#
|
|
6
14
|
# Options:
|
|
7
15
|
# --marketplace-url URL Marketplace WebSocket URL (default: ws://localhost:8081)
|
|
8
16
|
# --api-key KEY Gateway API key for authentication
|
|
9
17
|
# --port PORT Gateway port (default: 8083)
|
|
10
18
|
# --install-dir DIR Installation directory (default: /opt/langmart-gateway)
|
|
19
|
+
# --capabilities CAPS Gateway capabilities: session,llm or llm (default: llm)
|
|
20
|
+
# --full Enable full capabilities (DevOps + LLM routing)
|
|
11
21
|
# --service Install as systemd service
|
|
12
22
|
# --help Show this help message
|
|
13
23
|
|
|
@@ -26,6 +36,7 @@ INSTALL_DIR="/opt/langmart-gateway"
|
|
|
26
36
|
GATEWAY_PORT="8083"
|
|
27
37
|
MARKETPLACE_URL="ws://localhost:8081"
|
|
28
38
|
GATEWAY_API_KEY=""
|
|
39
|
+
GATEWAY_CAPABILITIES=""
|
|
29
40
|
INSTALL_SERVICE=false
|
|
30
41
|
GITHUB_TOKEN=""
|
|
31
42
|
|
|
@@ -52,6 +63,14 @@ while [[ $# -gt 0 ]]; do
|
|
|
52
63
|
INSTALL_SERVICE=true
|
|
53
64
|
shift
|
|
54
65
|
;;
|
|
66
|
+
--capabilities)
|
|
67
|
+
GATEWAY_CAPABILITIES="$2"
|
|
68
|
+
shift 2
|
|
69
|
+
;;
|
|
70
|
+
--full)
|
|
71
|
+
GATEWAY_CAPABILITIES="session,llm"
|
|
72
|
+
shift
|
|
73
|
+
;;
|
|
55
74
|
--github-token)
|
|
56
75
|
GITHUB_TOKEN="$2"
|
|
57
76
|
shift 2
|
|
@@ -67,11 +86,13 @@ while [[ $# -gt 0 ]]; do
|
|
|
67
86
|
echo " --port PORT Gateway port (default: 8083)"
|
|
68
87
|
echo " --install-dir DIR Installation directory (default: /opt/langmart-gateway)"
|
|
69
88
|
echo " --service Install as systemd service"
|
|
89
|
+
echo " --capabilities CAPS Gateway capabilities: session,llm or llm (default: llm only)"
|
|
90
|
+
echo " --full Enable full capabilities (session + llm) - DevOps mode"
|
|
70
91
|
echo " --github-token TOKEN GitHub token for npm package access"
|
|
71
92
|
echo " --help Show this help message"
|
|
72
93
|
echo ""
|
|
73
94
|
echo "Example:"
|
|
74
|
-
echo " $0 --marketplace-url ws://10.0.1.117:8081 --api-key sk-test-key --service"
|
|
95
|
+
echo " $0 --marketplace-url ws://10.0.1.117:8081 --api-key sk-test-key --full --service"
|
|
75
96
|
exit 0
|
|
76
97
|
;;
|
|
77
98
|
*)
|
|
@@ -155,22 +176,17 @@ if [ ! -f package.json ]; then
|
|
|
155
176
|
fi
|
|
156
177
|
|
|
157
178
|
# Install the gateway package
|
|
158
|
-
echo -e "${CYAN}[4/6] Installing
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
else
|
|
162
|
-
# Direct clone fallback for development
|
|
163
|
-
echo -e "${YELLOW}Cloning from GitHub repository...${NC}"
|
|
164
|
-
git clone --depth 1 https://github.com/YiHuangDB/LangMartDesign.git /tmp/langmart-clone
|
|
165
|
-
cp -r /tmp/langmart-clone/gateway-type3/* .
|
|
166
|
-
rm -rf /tmp/langmart-clone
|
|
167
|
-
npm install --production
|
|
168
|
-
npm run build
|
|
169
|
-
fi
|
|
179
|
+
echo -e "${CYAN}[4/6] Installing langmart-gateway-type3...${NC}"
|
|
180
|
+
# Install from npm (no token needed for public packages)
|
|
181
|
+
npm install langmart-gateway-type3@latest
|
|
170
182
|
echo -e "${GREEN}✓ Gateway package installed${NC}"
|
|
171
183
|
|
|
172
184
|
# Create environment file
|
|
173
185
|
echo -e "${CYAN}[5/6] Creating environment configuration...${NC}"
|
|
186
|
+
|
|
187
|
+
# Generate vault password
|
|
188
|
+
VAULT_PWD=$(openssl rand -base64 32)
|
|
189
|
+
|
|
174
190
|
cat > .env << EOF
|
|
175
191
|
# LangMart Gateway Type 3 Configuration
|
|
176
192
|
# Generated by install-remote.sh on $(date)
|
|
@@ -185,9 +201,12 @@ MARKETPLACE_URL=${MARKETPLACE_URL}
|
|
|
185
201
|
# Gateway authentication
|
|
186
202
|
GATEWAY_API_KEY=${GATEWAY_API_KEY}
|
|
187
203
|
|
|
204
|
+
# Gateway capabilities (session,llm = full DevOps mode, llm = LLM routing only)
|
|
205
|
+
GATEWAY_CAPABILITIES=${GATEWAY_CAPABILITIES:-llm}
|
|
206
|
+
|
|
188
207
|
# Local vault configuration
|
|
189
208
|
VAULT_PATH=.vault/credentials.enc
|
|
190
|
-
VAULT_PASSWORD=$
|
|
209
|
+
VAULT_PASSWORD=${VAULT_PWD}
|
|
191
210
|
|
|
192
211
|
# Environment
|
|
193
212
|
NODE_ENV=production
|
|
@@ -199,11 +218,17 @@ echo -e "${GREEN}✓ Environment file created${NC}"
|
|
|
199
218
|
cat > start.sh << 'STARTEOF'
|
|
200
219
|
#!/bin/bash
|
|
201
220
|
cd "$(dirname "$0")"
|
|
202
|
-
source .env 2>/dev/null || true
|
|
203
221
|
|
|
204
|
-
|
|
222
|
+
# Export all variables from .env file
|
|
223
|
+
if [ -f .env ]; then
|
|
224
|
+
set -a
|
|
225
|
+
source .env
|
|
226
|
+
set +a
|
|
227
|
+
fi
|
|
228
|
+
|
|
229
|
+
if [ -d node_modules/langmart-gateway-type3 ]; then
|
|
205
230
|
# Installed via npm
|
|
206
|
-
node node_modules
|
|
231
|
+
node node_modules/langmart-gateway-type3/dist/index-server.js
|
|
207
232
|
else
|
|
208
233
|
# Direct installation
|
|
209
234
|
node dist/index-server.js
|
|
@@ -265,6 +290,11 @@ echo ""
|
|
|
265
290
|
echo -e "${CYAN}Installation Directory: ${INSTALL_DIR}${NC}"
|
|
266
291
|
echo -e "${CYAN}Gateway Port: ${GATEWAY_PORT}${NC}"
|
|
267
292
|
echo -e "${CYAN}Marketplace URL: ${MARKETPLACE_URL}${NC}"
|
|
293
|
+
if [ -n "$GATEWAY_CAPABILITIES" ] && [ "$GATEWAY_CAPABILITIES" = "session,llm" ]; then
|
|
294
|
+
echo -e "${CYAN}Mode: Full (DevOps + LLM Routing)${NC}"
|
|
295
|
+
else
|
|
296
|
+
echo -e "${CYAN}Mode: LLM Routing Only${NC}"
|
|
297
|
+
fi
|
|
268
298
|
echo ""
|
|
269
299
|
echo -e "${YELLOW}Before starting, configure your API key:${NC}"
|
|
270
300
|
echo -e " ${CYAN}1. Edit ${INSTALL_DIR}/.env${NC}"
|