@xcanwin/manyoyo 5.11.4 → 5.11.7
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.
|
@@ -11,6 +11,7 @@ COPY ./docker/cache/ /cache/
|
|
|
11
11
|
|
|
12
12
|
RUN <<EOX
|
|
13
13
|
# 确定架构
|
|
14
|
+
set -eu
|
|
14
15
|
case "$TARGETARCH" in
|
|
15
16
|
amd64) ARCH_NODE="x64"; ARCH_GO="amd64" ;;
|
|
16
17
|
arm64) ARCH_NODE="arm64"; ARCH_GO="arm64" ;;
|
|
@@ -81,6 +82,7 @@ ENV LANG=C.UTF-8 \
|
|
|
81
82
|
# 合并系统依赖与 Python 安装为单层,减少镜像体积
|
|
82
83
|
RUN <<EOX
|
|
83
84
|
# 配置 APT 镜像源
|
|
85
|
+
set -eu
|
|
84
86
|
sed -i "s|http://[^/]*\.ubuntu\.com|${APT_MIRROR}|g" /etc/apt/sources.list.d/ubuntu.sources
|
|
85
87
|
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
86
88
|
|
|
@@ -135,6 +137,7 @@ ARG GIT_SSL_NO_VERIFY=false
|
|
|
135
137
|
|
|
136
138
|
RUN <<EOX
|
|
137
139
|
# 配置 node.js
|
|
140
|
+
set -eu
|
|
138
141
|
npm config set registry=${NPM_REGISTRY}
|
|
139
142
|
|
|
140
143
|
export GIT_SSL_NO_VERIFY=$GIT_SSL_NO_VERIFY
|
|
@@ -143,6 +146,7 @@ RUN <<EOX
|
|
|
143
146
|
npm install -g pyright typescript-language-server typescript
|
|
144
147
|
|
|
145
148
|
# 安装 Claude CLI
|
|
149
|
+
# npm install -g @anthropic-ai/claude-code @openai/codex @google/gemini-cli opencode-ai
|
|
146
150
|
npm install -g @anthropic-ai/claude-code
|
|
147
151
|
mkdir -p ~/.claude/plugins/marketplaces/
|
|
148
152
|
cp /tmp/docker-res/claude/claude.json ~/.claude.json
|
|
@@ -172,13 +176,13 @@ RUN <<EOX
|
|
|
172
176
|
rm -rf /tmp/openai-skills
|
|
173
177
|
CODEX_INSTALLER="$HOME/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py"
|
|
174
178
|
python3 "$CODEX_INSTALLER" --repo openai/skills --path \
|
|
175
|
-
skills/.curated/doc \
|
|
176
|
-
skills/.curated/spreadsheet \
|
|
177
|
-
skills/.curated/pdf \
|
|
178
179
|
skills/.curated/security-best-practices \
|
|
179
180
|
skills/.curated/security-threat-model
|
|
180
181
|
python3 "$CODEX_INSTALLER" --repo anthropics/skills --path \
|
|
182
|
+
skills/docx \
|
|
183
|
+
skills/xlsx \
|
|
181
184
|
skills/pptx \
|
|
185
|
+
skills/pdf \
|
|
182
186
|
skills/theme-factory \
|
|
183
187
|
skills/frontend-design \
|
|
184
188
|
skills/canvas-design \
|
|
@@ -205,11 +209,10 @@ RUN <<EOX
|
|
|
205
209
|
# 安装 Playwright CLI skills(不在镜像构建阶段下载浏览器)
|
|
206
210
|
PLAYWRIGHT_CLI_INSTALL_DIR=/tmp/playwright-cli-install
|
|
207
211
|
mkdir -p "$PLAYWRIGHT_CLI_INSTALL_DIR/.playwright"
|
|
208
|
-
echo '{"browser":{"browserName":"chromium","launchOptions":{"channel":"chromium"}}}' > "${PLAYWRIGHT_CLI_INSTALL_DIR}/.playwright/cli.config.json"
|
|
209
212
|
cd "$PLAYWRIGHT_CLI_INSTALL_DIR"
|
|
210
213
|
PLAYWRIGHT_CLI_VERSION=$(node -p "const pkg = require('/tmp/manyoyo-package.json'); const value = String(pkg.playwrightCliVersion || '').trim(); if (!value) { throw new Error('package.json.playwrightCliVersion is required'); } value")
|
|
211
214
|
npm install -g "@playwright/cli@${PLAYWRIGHT_CLI_VERSION}"
|
|
212
|
-
playwright-cli
|
|
215
|
+
playwright-cli install --skills
|
|
213
216
|
PLAYWRIGHT_CLI_SKILL_SOURCE="$PLAYWRIGHT_CLI_INSTALL_DIR/.claude/skills/playwright-cli"
|
|
214
217
|
for target in ~/.claude/skills/playwright-cli ~/.codex/skills/playwright-cli ~/.gemini/skills/playwright-cli; do
|
|
215
218
|
mkdir -p "$target"
|
|
@@ -225,14 +228,12 @@ RUN <<EOX
|
|
|
225
228
|
rm -f /var/log/dpkg.log /var/log/bootstrap.log /var/lib/dpkg/status-old /var/cache/debconf/templates.dat-old
|
|
226
229
|
EOX
|
|
227
230
|
|
|
228
|
-
COPY ./docker/res/playwright/playwright-cli-wrapper.sh /usr/local/bin/playwright-cli
|
|
229
|
-
RUN chmod +x /usr/local/bin/playwright-cli
|
|
230
|
-
|
|
231
231
|
# 从 cache-stage 复制 JDT LSP 到最终位置,避免中转层残留
|
|
232
232
|
COPY --from=cache-stage /opt/jdtls /root/.local/share/jdtls
|
|
233
233
|
|
|
234
234
|
RUN <<EOX
|
|
235
235
|
# 安装 java
|
|
236
|
+
set -eu
|
|
236
237
|
case ",$TOOL," in *,full,*|*,java,*)
|
|
237
238
|
apt-get update -y
|
|
238
239
|
apt-get install -y --no-install-recommends openjdk-21-jdk maven
|
|
@@ -251,6 +252,7 @@ COPY --from=cache-stage /opt/gopls /usr/local/share/manyoyo-gopls
|
|
|
251
252
|
|
|
252
253
|
RUN <<EOX
|
|
253
254
|
# 安装 go
|
|
255
|
+
set -eu
|
|
254
256
|
case ",$TOOL," in *,full,*|*,go,*)
|
|
255
257
|
apt-get update -y
|
|
256
258
|
apt-get install -y --no-install-recommends golang gcc
|
|
@@ -279,6 +281,7 @@ COPY ./docker/res/supervisor/s.conf /etc/supervisor/conf.d/s.conf
|
|
|
279
281
|
|
|
280
282
|
RUN <<EOX
|
|
281
283
|
# 清理
|
|
284
|
+
set -eu
|
|
282
285
|
rm -rf /tmp/* /var/tmp/* /var/log/apt /var/log/*.log /var/lib/apt/lists/* ~/.npm ~/go/pkg/mod/cache
|
|
283
286
|
EOX
|
|
284
287
|
|
package/lib/plugin/playwright.js
CHANGED
|
@@ -1000,7 +1000,12 @@ class PlaywrightPlugin {
|
|
|
1000
1000
|
const containerConfigPath = `/tmp/manyoyo-playwright/${sceneName}.cli-attach.json`;
|
|
1001
1001
|
this.writeSceneCliAttachConfig(sceneName, {
|
|
1002
1002
|
browser: {
|
|
1003
|
-
remoteEndpoint
|
|
1003
|
+
// launch-server(非 shared)不预创建 context;remoteEndpoint 存在时
|
|
1004
|
+
// playwright-cli 默认 isolated=false 会走 contexts()[0] 并报
|
|
1005
|
+
// "unable to connect to a browser that does not have any contexts",
|
|
1006
|
+
// 因此容器内会话必须以 isolated 模式自建 context。
|
|
1007
|
+
remoteEndpoint,
|
|
1008
|
+
isolated: true
|
|
1004
1009
|
}
|
|
1005
1010
|
});
|
|
1006
1011
|
const envEntries = [
|
|
@@ -1585,7 +1590,6 @@ class PlaywrightPlugin {
|
|
|
1585
1590
|
const lines = [
|
|
1586
1591
|
'PLAYWRIGHT_CLI_INSTALL_DIR="${TMPDIR:-/tmp}/manyoyo-playwright-cli-install-$$"',
|
|
1587
1592
|
'mkdir -p "$PLAYWRIGHT_CLI_INSTALL_DIR/.playwright"',
|
|
1588
|
-
'echo \'{"browser":{"browserName":"chromium","launchOptions":{"channel":"chromium"}}}\' > "$PLAYWRIGHT_CLI_INSTALL_DIR/.playwright/cli.config.json"',
|
|
1589
1593
|
'cd "$PLAYWRIGHT_CLI_INSTALL_DIR"',
|
|
1590
1594
|
`npm install -g @playwright/cli@${PLAYWRIGHT_CLI_VERSION}`,
|
|
1591
1595
|
'playwright-cli install --skills',
|
package/package.json
CHANGED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
set -eu
|
|
3
|
-
|
|
4
|
-
PLAYWRIGHT_NODE_BIN="${PLAYWRIGHT_NODE_BIN:-node}"
|
|
5
|
-
PLAYWRIGHT_CLI_ROOT="/usr/local/lib/node_modules/@playwright/cli/node_modules/playwright"
|
|
6
|
-
PLAYWRIGHT_CLI_PROGRAM="${PLAYWRIGHT_CLI_ROOT}/lib/cli/client/program.js"
|
|
7
|
-
PLAYWRIGHT_REAL_CLI="${PLAYWRIGHT_CLI_ROOT}/cli.js"
|
|
8
|
-
|
|
9
|
-
resolve_browser() {
|
|
10
|
-
browser=""
|
|
11
|
-
|
|
12
|
-
while [ "$#" -gt 0 ]; do
|
|
13
|
-
case "$1" in
|
|
14
|
-
--browser=*)
|
|
15
|
-
browser="${1#--browser=}"
|
|
16
|
-
;;
|
|
17
|
-
--browser)
|
|
18
|
-
shift
|
|
19
|
-
if [ "$#" -gt 0 ]; then
|
|
20
|
-
browser="$1"
|
|
21
|
-
shift
|
|
22
|
-
fi
|
|
23
|
-
continue
|
|
24
|
-
;;
|
|
25
|
-
--)
|
|
26
|
-
break
|
|
27
|
-
;;
|
|
28
|
-
-*)
|
|
29
|
-
;;
|
|
30
|
-
*)
|
|
31
|
-
if [ -z "$browser" ]; then
|
|
32
|
-
browser="$1"
|
|
33
|
-
fi
|
|
34
|
-
;;
|
|
35
|
-
esac
|
|
36
|
-
shift
|
|
37
|
-
done
|
|
38
|
-
|
|
39
|
-
if [ -n "$browser" ]; then
|
|
40
|
-
printf '%s\n' "$browser"
|
|
41
|
-
return 0
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
"$PLAYWRIGHT_NODE_BIN" <<'NODE'
|
|
45
|
-
const fs = require('fs');
|
|
46
|
-
const path = require('path');
|
|
47
|
-
|
|
48
|
-
const candidates = [
|
|
49
|
-
process.env.PLAYWRIGHT_MCP_CONFIG,
|
|
50
|
-
path.resolve('.playwright/cli.config.json')
|
|
51
|
-
].filter(Boolean);
|
|
52
|
-
|
|
53
|
-
for (const filePath of candidates) {
|
|
54
|
-
try {
|
|
55
|
-
const config = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
56
|
-
const browser = config && config.browser ? config.browser : {};
|
|
57
|
-
const launchOptions = browser.launchOptions || {};
|
|
58
|
-
const channel = String(launchOptions.channel || browser.browserName || '').trim();
|
|
59
|
-
if (channel) {
|
|
60
|
-
process.stdout.write(channel);
|
|
61
|
-
process.exit(0);
|
|
62
|
-
}
|
|
63
|
-
} catch (_) {}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
process.stdout.write('chromium');
|
|
67
|
-
NODE
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if [ "${1-}" = "install-browser" ]; then
|
|
71
|
-
shift
|
|
72
|
-
for arg in "$@"; do
|
|
73
|
-
if [ "$arg" = "--help" ] || [ "$arg" = "-h" ]; then
|
|
74
|
-
exec "$PLAYWRIGHT_NODE_BIN" "$PLAYWRIGHT_CLI_PROGRAM" install-browser "$@"
|
|
75
|
-
fi
|
|
76
|
-
done
|
|
77
|
-
|
|
78
|
-
BROWSER="$(resolve_browser "$@")"
|
|
79
|
-
exec "$PLAYWRIGHT_NODE_BIN" "$PLAYWRIGHT_REAL_CLI" install "$BROWSER"
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
exec "$PLAYWRIGHT_NODE_BIN" "$PLAYWRIGHT_CLI_PROGRAM" "$@"
|