@jackle.dev/zalox-plugin 1.0.8 ā 1.0.10
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 +1 -1
- package/src/tools-scenario.ts +27 -3
package/package.json
CHANGED
package/src/tools-scenario.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { createTemplate } from './core/templates.js';
|
|
|
3
3
|
|
|
4
4
|
export const zaloxScenarioTool = {
|
|
5
5
|
name: 'zalox_scenario',
|
|
6
|
-
description: 'Import scenario templates from a URL or Registry ID.',
|
|
6
|
+
description: 'Import scenario templates (Playbook) from a URL or Registry ID.',
|
|
7
7
|
parameters: z.object({
|
|
8
8
|
action: z.enum(['import']),
|
|
9
9
|
url: z.string().optional().describe('Direct URL to scenario JSON'),
|
|
10
|
-
registryId: z.string().optional().describe('Registry ID (e.g., "appointment-booking")'),
|
|
10
|
+
registryId: z.string().optional().describe('Registry ID (e.g., "appointment-booking", "viettel-tracking")'),
|
|
11
11
|
}),
|
|
12
12
|
execute: async (args: any) => {
|
|
13
13
|
const { action, url, registryId } = args;
|
|
@@ -40,7 +40,31 @@ export const zaloxScenarioTool = {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
let report = `Imported scenario "${data.name || 'Unknown'}":\n${results.join('\n')}`;
|
|
45
|
+
|
|
46
|
+
// Analyze Requirements (Playbook Logic)
|
|
47
|
+
const reqs = data.requirements || {};
|
|
48
|
+
const flow = data.flow || [];
|
|
49
|
+
const warnings = [];
|
|
50
|
+
|
|
51
|
+
if (reqs.packages && reqs.packages.length > 0) {
|
|
52
|
+
warnings.push(`š¦ Packages required: ${reqs.packages.join(', ')} (Please install via npm)`);
|
|
53
|
+
}
|
|
54
|
+
if (reqs.env && reqs.env.length > 0) {
|
|
55
|
+
warnings.push(`š Environment variables needed: ${reqs.env.join(', ')}`);
|
|
56
|
+
}
|
|
57
|
+
if (reqs.tools && reqs.tools.length > 0) {
|
|
58
|
+
warnings.push(`š ļø Agent tools required: ${reqs.tools.join(', ')}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (warnings.length > 0 || flow.length > 0) {
|
|
62
|
+
report += `\n\nšØ PLAYBOOK REQUIREMENTS:\n${warnings.join('\n')}`;
|
|
63
|
+
report += `\n\nš EXECUTION FLOW (SOP):\n${flow.join('\n')}`;
|
|
64
|
+
report += `\n\nš Agent: Please read the flow above and ask user to fulfill requirements if missing.`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return report;
|
|
44
68
|
} catch (e: any) {
|
|
45
69
|
return `Scenario import failed: ${e.message}`;
|
|
46
70
|
}
|