@xcanwin/manyoyo 5.7.12 → 5.7.13

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.
Files changed (2) hide show
  1. package/lib/web/server.js +46 -6
  2. package/package.json +1 -1
package/lib/web/server.js CHANGED
@@ -158,17 +158,57 @@ function normalizeWebAgentSessionRecord(agentId, rawAgent) {
158
158
  };
159
159
  }
160
160
 
161
+ function resolveEffectiveAgentPromptCommand(template, applied) {
162
+ const normalizedTemplate = normalizeAgentPromptCommandTemplate(template, 'agentPromptCommand');
163
+ if (!normalizedTemplate) {
164
+ return '';
165
+ }
166
+
167
+ const program = resolveAgentProgram(normalizedTemplate);
168
+ const defaultCommand = applied && typeof applied === 'object'
169
+ ? String(applied.defaultCommand || '').trim()
170
+ : '';
171
+ if (!program || !defaultCommand) {
172
+ return normalizedTemplate;
173
+ }
174
+
175
+ const defaultProgram = resolveAgentProgram(defaultCommand);
176
+ if (!defaultProgram || defaultProgram !== program) {
177
+ return normalizedTemplate;
178
+ }
179
+
180
+ const genericTemplate = normalizeAgentPromptCommandTemplate(
181
+ resolveAgentPromptCommandTemplate(program),
182
+ 'agentPromptCommand'
183
+ );
184
+ if (normalizedTemplate !== genericTemplate) {
185
+ return normalizedTemplate;
186
+ }
187
+
188
+ const inferredTemplate = normalizeAgentPromptCommandTemplate(
189
+ resolveAgentPromptCommandTemplate(defaultCommand),
190
+ 'agentPromptCommand'
191
+ );
192
+ if (!inferredTemplate || inferredTemplate === genericTemplate) {
193
+ return normalizedTemplate;
194
+ }
195
+
196
+ return inferredTemplate;
197
+ }
198
+
161
199
  function normalizeWebHistoryRecord(containerName, rawData) {
162
200
  const data = rawData && typeof rawData === 'object' && !Array.isArray(rawData) ? rawData : {};
201
+ const applied = data.applied && typeof data.applied === 'object' && !Array.isArray(data.applied)
202
+ ? data.applied
203
+ : null;
163
204
  const history = {
164
205
  containerName,
165
206
  updatedAt: typeof data.updatedAt === 'string' ? data.updatedAt : null,
166
- agentPromptCommand: typeof data.agentPromptCommand === 'string'
167
- ? data.agentPromptCommand
168
- : '',
169
- applied: data.applied && typeof data.applied === 'object' && !Array.isArray(data.applied)
170
- ? data.applied
171
- : null,
207
+ agentPromptCommand: resolveEffectiveAgentPromptCommand(
208
+ typeof data.agentPromptCommand === 'string' ? data.agentPromptCommand : '',
209
+ applied
210
+ ),
211
+ applied,
172
212
  agents: {}
173
213
  };
174
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "5.7.12",
3
+ "version": "5.7.13",
4
4
  "imageVersion": "1.9.0-common",
5
5
  "playwrightCliVersion": "0.1.1",
6
6
  "description": "AI Agent CLI Security Sandbox for Docker and Podman",