@jackle.dev/zalox-plugin 1.0.9 ā 1.0.11
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 +30 -6
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;
|
|
@@ -42,11 +42,35 @@ export const zaloxScenarioTool = {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
let report = `Imported scenario "${data.name || 'Unknown'}":\n${results.join('\n')}`;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
|
|
46
|
+
// Analyze Requirements (Playbook Logic)
|
|
47
|
+
const reqs = data.requirements || {};
|
|
48
|
+
const flow = data.flow || [];
|
|
49
|
+
const setup = data.setup || {};
|
|
50
|
+
const warnings = [];
|
|
51
|
+
|
|
52
|
+
if (reqs.packages && reqs.packages.length > 0) {
|
|
53
|
+
warnings.push(`š¦ Packages required: ${reqs.packages.join(', ')}`);
|
|
48
54
|
}
|
|
49
|
-
|
|
55
|
+
if (reqs.env && reqs.env.length > 0) {
|
|
56
|
+
warnings.push(`š Environment variables needed: ${reqs.env.join(', ')}`);
|
|
57
|
+
}
|
|
58
|
+
if (reqs.tools && reqs.tools.length > 0) {
|
|
59
|
+
warnings.push(`š ļø Agent tools required: ${reqs.tools.join(', ')}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (warnings.length > 0 || flow.length > 0) {
|
|
63
|
+
report += `\n\nšØ PLAYBOOK REQUIREMENTS:\n${warnings.join('\n')}`;
|
|
64
|
+
|
|
65
|
+
if (setup.commands && setup.commands.length > 0) {
|
|
66
|
+
report += `\n\nš ļø SETUP GUIDE (Ask user to run/confirm):\n`;
|
|
67
|
+
if (setup.guide) report += `ā¹ļø ${setup.guide}\n`;
|
|
68
|
+
report += `Commands:\n${setup.commands.map((c: string) => `> ${c}`).join('\n')}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
report += `\n\nš EXECUTION FLOW (SOP):\n${flow.join('\n')}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
return report;
|
|
51
75
|
} catch (e: any) {
|
|
52
76
|
return `Scenario import failed: ${e.message}`;
|