@xcanwin/manyoyo 5.6.10 → 5.7.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/lib/agent-resume.js +12 -0
- package/lib/web/frontend/app.js +15 -1
- package/package.json +1 -1
package/lib/agent-resume.js
CHANGED
|
@@ -16,7 +16,10 @@ const AGENT_PROMPT_TEMPLATE_MAP = {
|
|
|
16
16
|
opencode: 'opencode run {prompt}'
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const CLAUDE_DANGEROUS_FLAG = '--dangerously-skip-permissions';
|
|
20
|
+
const GEMINI_YOLO_FLAG = '--yolo';
|
|
19
21
|
const CODEX_DANGEROUS_FLAG = '--dangerously-bypass-approvals-and-sandbox';
|
|
22
|
+
const OPENCODE_PERMISSION_KEY = 'OPENCODE_PERMISSION=';
|
|
20
23
|
|
|
21
24
|
function stripLeadingAssignments(commandText) {
|
|
22
25
|
let rest = String(commandText || '').trim();
|
|
@@ -80,11 +83,20 @@ function resolveAgentPromptCommandTemplate(commandText) {
|
|
|
80
83
|
const normalizedCommand = String(commandText || '').trim();
|
|
81
84
|
const program = resolveAgentProgram(commandText);
|
|
82
85
|
const template = AGENT_PROMPT_TEMPLATE_MAP[program] || '';
|
|
86
|
+
if (program === 'claude' && normalizedCommand.includes(CLAUDE_DANGEROUS_FLAG)) {
|
|
87
|
+
return `${normalizedCommand} -p {prompt}`;
|
|
88
|
+
}
|
|
89
|
+
if (program === 'gemini' && normalizedCommand.includes(GEMINI_YOLO_FLAG)) {
|
|
90
|
+
return `${normalizedCommand} -p {prompt}`;
|
|
91
|
+
}
|
|
83
92
|
if (program === 'codex' && template) {
|
|
84
93
|
if (normalizedCommand.includes(CODEX_DANGEROUS_FLAG)) {
|
|
85
94
|
return `codex exec ${CODEX_DANGEROUS_FLAG} --skip-git-repo-check {prompt}`;
|
|
86
95
|
}
|
|
87
96
|
}
|
|
97
|
+
if (program === 'opencode' && normalizedCommand.includes(OPENCODE_PERMISSION_KEY)) {
|
|
98
|
+
return `${normalizedCommand} run {prompt}`;
|
|
99
|
+
}
|
|
88
100
|
return template;
|
|
89
101
|
}
|
|
90
102
|
|
package/lib/web/frontend/app.js
CHANGED
|
@@ -178,6 +178,10 @@
|
|
|
178
178
|
codex: 'codex exec --skip-git-repo-check {prompt}',
|
|
179
179
|
opencode: 'opencode run {prompt}'
|
|
180
180
|
};
|
|
181
|
+
const CLAUDE_DANGEROUS_FLAG = '--dangerously-skip-permissions';
|
|
182
|
+
const GEMINI_YOLO_FLAG = '--yolo';
|
|
183
|
+
const CODEX_DANGEROUS_FLAG = '--dangerously-bypass-approvals-and-sandbox';
|
|
184
|
+
const OPENCODE_PERMISSION_KEY = 'OPENCODE_PERMISSION=';
|
|
181
185
|
const markdownRenderer = window.ManyoyoMarkdown
|
|
182
186
|
&& typeof window.ManyoyoMarkdown.shouldRenderMessage === 'function'
|
|
183
187
|
&& typeof window.ManyoyoMarkdown.render === 'function'
|
|
@@ -559,11 +563,21 @@
|
|
|
559
563
|
}
|
|
560
564
|
|
|
561
565
|
function resolveAgentPromptTemplate(commandText) {
|
|
566
|
+
const normalizedCommand = String(commandText || '').trim();
|
|
562
567
|
const program = resolveAgentProgram(commandText);
|
|
563
568
|
const template = AGENT_PROMPT_TEMPLATE_MAP[program] || '';
|
|
564
|
-
if (program === '
|
|
569
|
+
if (program === 'claude' && normalizedCommand.includes(CLAUDE_DANGEROUS_FLAG)) {
|
|
570
|
+
return `${normalizedCommand} -p {prompt}`;
|
|
571
|
+
}
|
|
572
|
+
if (program === 'gemini' && normalizedCommand.includes(GEMINI_YOLO_FLAG)) {
|
|
573
|
+
return `${normalizedCommand} -p {prompt}`;
|
|
574
|
+
}
|
|
575
|
+
if (program === 'codex' && normalizedCommand.includes(CODEX_DANGEROUS_FLAG)) {
|
|
565
576
|
return 'codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check {prompt}';
|
|
566
577
|
}
|
|
578
|
+
if (program === 'opencode' && normalizedCommand.includes(OPENCODE_PERMISSION_KEY)) {
|
|
579
|
+
return `${normalizedCommand} run {prompt}`;
|
|
580
|
+
}
|
|
567
581
|
return template;
|
|
568
582
|
}
|
|
569
583
|
|