@xcanwin/manyoyo 5.11.16 → 6.0.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/lib/web/frontend/codemirror.bundle.js +1173 -1034
- package/lib/web/server.js +31 -9
- package/package.json +15 -15
package/lib/web/server.js
CHANGED
|
@@ -34,8 +34,8 @@ const WEB_TERMINAL_MIN_ROWS = 12;
|
|
|
34
34
|
const WEB_AGENT_CONTEXT_MAX_MESSAGES = 24;
|
|
35
35
|
const WEB_AGENT_CONTEXT_MAX_CHARS = 6000;
|
|
36
36
|
const WEB_AGENT_CONTEXT_PER_MESSAGE_MAX_CHARS = 600;
|
|
37
|
-
//
|
|
38
|
-
const NATIVE_SESSION_RESUME_PROGRAMS = new Set(['claude', 'codex']);
|
|
37
|
+
// 支持按 Web Agent 保存的引擎会话 ID 原生续接,避免历史文本被截断。
|
|
38
|
+
const NATIVE_SESSION_RESUME_PROGRAMS = new Set(['claude', 'codex', 'opencode']);
|
|
39
39
|
const WEB_FILE_PREVIEW_MAX_BYTES = 512 * 1024;
|
|
40
40
|
const WEB_FILE_EDIT_MAX_BYTES = 2 * 1024 * 1024;
|
|
41
41
|
const WEB_AUTH_COOKIE_NAME = 'manyoyo_web_auth';
|
|
@@ -763,14 +763,22 @@ function buildGeminiAgentExecCommand(template, prompt) {
|
|
|
763
763
|
: renderAgentPromptCommand(geminiTemplate, prompt);
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
function buildOpenCodeAgentExecCommand(template, prompt) {
|
|
766
|
+
function buildOpenCodeAgentExecCommand(template, prompt, options = {}) {
|
|
767
767
|
const templateText = normalizeAgentPromptCommandTemplate(template, 'agentPromptCommand');
|
|
768
|
+
const sessionId = options && typeof options.sessionId === 'string' ? options.sessionId.trim() : '';
|
|
769
|
+
const flagSpecs = [
|
|
770
|
+
{ flag: '--format json', pattern: /(?:^|\s)--format(?:\s|$)/ }
|
|
771
|
+
];
|
|
772
|
+
if (sessionId) {
|
|
773
|
+
flagSpecs.push({
|
|
774
|
+
flag: `--session ${quoteBashSingleValue(sessionId)}`,
|
|
775
|
+
pattern: /(?:^|\s)(?:--session|-s)(?:\s|$)/
|
|
776
|
+
});
|
|
777
|
+
}
|
|
768
778
|
const opencodeTemplate = prependAgentFlags(
|
|
769
779
|
templateText,
|
|
770
|
-
/^(((?:(?:[A-Za-z_][A-Za-z0-9_]*=)(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s]+)\s+)*)opencode\s+run\b)(.*)$/,
|
|
771
|
-
|
|
772
|
-
{ flag: '--format json', pattern: /(?:^|\s)--format(?:\s|$)/ }
|
|
773
|
-
]
|
|
780
|
+
/^(((?:(?:[A-Za-z_][A-Za-z0-9_]*=)(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s]+)\s+)*)opencode\b.*?\s+run\b)(.*)$/,
|
|
781
|
+
flagSpecs
|
|
774
782
|
);
|
|
775
783
|
return opencodeTemplate === templateText
|
|
776
784
|
? renderAgentPromptCommand(templateText, prompt)
|
|
@@ -786,7 +794,7 @@ function buildWebAgentExecCommand(template, prompt, agentProgram, options = {})
|
|
|
786
794
|
case 'codex':
|
|
787
795
|
return buildCodexAgentExecCommand(template, prompt, options);
|
|
788
796
|
case 'opencode':
|
|
789
|
-
return buildOpenCodeAgentExecCommand(template, prompt);
|
|
797
|
+
return buildOpenCodeAgentExecCommand(template, prompt, options);
|
|
790
798
|
default:
|
|
791
799
|
break;
|
|
792
800
|
}
|
|
@@ -890,7 +898,7 @@ function extractOpenCodeAgentMessage(text) {
|
|
|
890
898
|
if (role && role !== 'assistant') {
|
|
891
899
|
continue;
|
|
892
900
|
}
|
|
893
|
-
const content = collectStructuredText(message.content || payload.content || payload.text || payload);
|
|
901
|
+
const content = collectStructuredText(message.content || payload.content || payload.text || payload.part || payload);
|
|
894
902
|
if (!content) {
|
|
895
903
|
continue;
|
|
896
904
|
}
|
|
@@ -941,6 +949,17 @@ function extractClaudeSessionId(text) {
|
|
|
941
949
|
return '';
|
|
942
950
|
}
|
|
943
951
|
|
|
952
|
+
function extractOpenCodeSessionId(text) {
|
|
953
|
+
for (const rawLine of String(text || '').split('\n')) {
|
|
954
|
+
const payload = parseJsonObjectLine(rawLine);
|
|
955
|
+
const sessionId = payload && pickFirstString(payload.sessionID, payload.session_id);
|
|
956
|
+
if (sessionId) {
|
|
957
|
+
return sessionId;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
return '';
|
|
961
|
+
}
|
|
962
|
+
|
|
944
963
|
function extractEngineSessionId(agentProgram, text) {
|
|
945
964
|
if (agentProgram === 'codex') {
|
|
946
965
|
return extractCodexThreadId(text);
|
|
@@ -948,6 +967,9 @@ function extractEngineSessionId(agentProgram, text) {
|
|
|
948
967
|
if (agentProgram === 'claude') {
|
|
949
968
|
return extractClaudeSessionId(text);
|
|
950
969
|
}
|
|
970
|
+
if (agentProgram === 'opencode') {
|
|
971
|
+
return extractOpenCodeSessionId(text);
|
|
972
|
+
}
|
|
951
973
|
return '';
|
|
952
974
|
}
|
|
953
975
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcanwin/manyoyo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"imageVersion": "1.9.1-common",
|
|
5
|
-
"playwrightCliVersion": "0.1.
|
|
5
|
+
"playwrightCliVersion": "0.1.18",
|
|
6
6
|
"description": "AI Agent CLI Security Sandbox for Docker and Podman",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"manyoyo",
|
|
@@ -57,37 +57,37 @@
|
|
|
57
57
|
"manyoyo.example.json"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@playwright/mcp": "0.0.
|
|
60
|
+
"@playwright/mcp": "0.0.79",
|
|
61
61
|
"@xterm/addon-fit": "^0.11.0",
|
|
62
62
|
"@xterm/xterm": "^6.0.0",
|
|
63
63
|
"commander": "^15.0.0",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
|
-
"marked": "^18.0.
|
|
66
|
-
"playwright": "1.
|
|
67
|
-
"ws": "^8.21.
|
|
65
|
+
"marked": "^18.0.9",
|
|
66
|
+
"playwright": "1.62.1",
|
|
67
|
+
"ws": "^8.21.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@codemirror/commands": "^6.10.
|
|
70
|
+
"@codemirror/commands": "^6.10.4",
|
|
71
71
|
"@codemirror/lang-css": "^6.3.1",
|
|
72
|
-
"@codemirror/lang-html": "^6.4.
|
|
72
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
73
73
|
"@codemirror/lang-javascript": "^6.2.5",
|
|
74
74
|
"@codemirror/lang-json": "^6.0.2",
|
|
75
|
-
"@codemirror/lang-markdown": "^6.5.
|
|
75
|
+
"@codemirror/lang-markdown": "^6.5.2",
|
|
76
76
|
"@codemirror/lang-python": "^6.2.1",
|
|
77
77
|
"@codemirror/lang-yaml": "^6.1.3",
|
|
78
|
-
"@codemirror/language": "^6.12.
|
|
78
|
+
"@codemirror/language": "^6.12.4",
|
|
79
79
|
"@codemirror/search": "^6.7.1",
|
|
80
|
-
"@codemirror/state": "^6.
|
|
81
|
-
"@codemirror/view": "^6.43.
|
|
80
|
+
"@codemirror/state": "^6.7.1",
|
|
81
|
+
"@codemirror/view": "^6.43.8",
|
|
82
82
|
"codemirror": "^6.0.2",
|
|
83
|
+
"esbuild": "^0.28.2",
|
|
83
84
|
"jest": "^30.4.2",
|
|
84
85
|
"vitepress": "^1.6.4"
|
|
85
86
|
},
|
|
86
87
|
"overrides": {
|
|
87
|
-
"esbuild": "^0.25.12",
|
|
88
88
|
"glob": "^13.0.6",
|
|
89
|
-
"minimatch": "^10.2.
|
|
90
|
-
"postcss": "^8.5.
|
|
89
|
+
"minimatch": "^10.2.6",
|
|
90
|
+
"postcss": "^8.5.26",
|
|
91
91
|
"test-exclude": "^8.0.0",
|
|
92
92
|
"vite": "^6.4.3"
|
|
93
93
|
},
|