openclaw-cascade-plugin 1.0.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.
Files changed (98) hide show
  1. package/PHASE1_SUMMARY.md +191 -0
  2. package/PHASE3_SUMMARY.md +195 -0
  3. package/README.md +43 -0
  4. package/dist/a2a-client.d.ts +17 -0
  5. package/dist/a2a-client.d.ts.map +1 -0
  6. package/dist/a2a-client.js +47 -0
  7. package/dist/a2a-client.js.map +1 -0
  8. package/dist/cascade-client.d.ts +53 -0
  9. package/dist/cascade-client.d.ts.map +1 -0
  10. package/dist/cascade-client.js +179 -0
  11. package/dist/cascade-client.js.map +1 -0
  12. package/dist/config.d.ts +26 -0
  13. package/dist/config.d.ts.map +1 -0
  14. package/dist/config.js +116 -0
  15. package/dist/config.js.map +1 -0
  16. package/dist/index.d.ts +29 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +136 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/python-manager.d.ts +59 -0
  21. package/dist/python-manager.d.ts.map +1 -0
  22. package/dist/python-manager.js +190 -0
  23. package/dist/python-manager.js.map +1 -0
  24. package/dist/test-utils/helpers.d.ts +20 -0
  25. package/dist/test-utils/helpers.d.ts.map +1 -0
  26. package/dist/test-utils/helpers.js +89 -0
  27. package/dist/test-utils/helpers.js.map +1 -0
  28. package/dist/test-utils/index.d.ts +3 -0
  29. package/dist/test-utils/index.d.ts.map +1 -0
  30. package/dist/test-utils/index.js +19 -0
  31. package/dist/test-utils/index.js.map +1 -0
  32. package/dist/test-utils/mocks.d.ts +51 -0
  33. package/dist/test-utils/mocks.d.ts.map +1 -0
  34. package/dist/test-utils/mocks.js +84 -0
  35. package/dist/test-utils/mocks.js.map +1 -0
  36. package/dist/tools/a2a-tools.d.ts +9 -0
  37. package/dist/tools/a2a-tools.d.ts.map +1 -0
  38. package/dist/tools/a2a-tools.js +147 -0
  39. package/dist/tools/a2a-tools.js.map +1 -0
  40. package/dist/tools/api-tools.d.ts +9 -0
  41. package/dist/tools/api-tools.d.ts.map +1 -0
  42. package/dist/tools/api-tools.js +102 -0
  43. package/dist/tools/api-tools.js.map +1 -0
  44. package/dist/tools/desktop-automation.d.ts +10 -0
  45. package/dist/tools/desktop-automation.d.ts.map +1 -0
  46. package/dist/tools/desktop-automation.js +330 -0
  47. package/dist/tools/desktop-automation.js.map +1 -0
  48. package/dist/tools/index.d.ts +12 -0
  49. package/dist/tools/index.d.ts.map +1 -0
  50. package/dist/tools/index.js +35 -0
  51. package/dist/tools/index.js.map +1 -0
  52. package/dist/tools/response-helpers.d.ts +25 -0
  53. package/dist/tools/response-helpers.d.ts.map +1 -0
  54. package/dist/tools/response-helpers.js +71 -0
  55. package/dist/tools/response-helpers.js.map +1 -0
  56. package/dist/tools/sandbox-tools.d.ts +9 -0
  57. package/dist/tools/sandbox-tools.d.ts.map +1 -0
  58. package/dist/tools/sandbox-tools.js +79 -0
  59. package/dist/tools/sandbox-tools.js.map +1 -0
  60. package/dist/tools/tool-registry.d.ts +34 -0
  61. package/dist/tools/tool-registry.d.ts.map +1 -0
  62. package/dist/tools/tool-registry.js +50 -0
  63. package/dist/tools/tool-registry.js.map +1 -0
  64. package/dist/tools/web-automation.d.ts +9 -0
  65. package/dist/tools/web-automation.d.ts.map +1 -0
  66. package/dist/tools/web-automation.js +471 -0
  67. package/dist/tools/web-automation.js.map +1 -0
  68. package/dist/types/index.d.ts +111 -0
  69. package/dist/types/index.d.ts.map +1 -0
  70. package/dist/types/index.js +38 -0
  71. package/dist/types/index.js.map +1 -0
  72. package/jest.setup.js +19 -0
  73. package/openclaw-cascade-plugin-1.0.0.tgz +0 -0
  74. package/openclaw.plugin.json +116 -0
  75. package/package.json +74 -0
  76. package/src/a2a-client.ts +66 -0
  77. package/src/cascade-client.test.ts +400 -0
  78. package/src/cascade-client.ts +198 -0
  79. package/src/config.test.ts +194 -0
  80. package/src/config.ts +135 -0
  81. package/src/index.ts +164 -0
  82. package/src/python-manager.test.ts +187 -0
  83. package/src/python-manager.ts +230 -0
  84. package/src/test-utils/helpers.ts +107 -0
  85. package/src/test-utils/index.ts +2 -0
  86. package/src/test-utils/mocks.ts +101 -0
  87. package/src/tools/a2a-tools.ts +162 -0
  88. package/src/tools/api-tools.ts +110 -0
  89. package/src/tools/desktop-automation.test.ts +305 -0
  90. package/src/tools/desktop-automation.ts +366 -0
  91. package/src/tools/index.ts +13 -0
  92. package/src/tools/response-helpers.ts +78 -0
  93. package/src/tools/sandbox-tools.ts +83 -0
  94. package/src/tools/tool-registry.ts +51 -0
  95. package/src/tools/web-automation.test.ts +177 -0
  96. package/src/tools/web-automation.ts +518 -0
  97. package/src/types/index.ts +132 -0
  98. package/tsconfig.json +27 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a-tools.js","sourceRoot":"","sources":["../../src/tools/a2a-tools.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAOH,4CAsJC;AAxJD,yDAAkE;AAElE,SAAgB,gBAAgB,CAAC,QAAsB,EAAE,SAA2B;IAClF,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uDAAuD;QACpE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uCAAuC;iBACrD;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAyB,EAAE;YAC7C,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oB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AI,EAAyB,EAAE;YAC7C,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACf,OAAO,IAAA,gCAAa,EAAC,kBAAkB,CAAC,CAAC;gBAC3C,CAAC;gBAED,MAAM,SAAS,CAAC,WAAW,CAAC,cAAc,EAAE;oBAC1C,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,eAAe,EAAE,IAAI,CAAC,gBAAgB,KAAK,KAAK;iBACjD,CAAC,CAAC;gBAEH,OAAO,IAAA,gCAAa,EAAC;oBACnB,OAAO,EAAE,sBAAsB;oBAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,MAAM,EAAE,SAAS;iBAClB,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,gCAAa,EAClB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B,EACvE,0DAA0D,CAC3D,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * API Tools
3
+ *
4
+ * 2 tools for web API calls and search
5
+ */
6
+ import { ToolRegistry } from './tool-registry';
7
+ import { CascadeMcpClient } from '../cascade-client';
8
+ export declare function registerApiTools(registry: ToolRegistry, client: CascadeMcpClient): void;
9
+ //# sourceMappingURL=api-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-tools.d.ts","sourceRoot":"","sources":["../../src/tools/api-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAkGvF"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /**
3
+ * API Tools
4
+ *
5
+ * 2 tools for web API calls and search
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.registerApiTools = registerApiTools;
9
+ const response_helpers_1 = require("./response-helpers");
10
+ function registerApiTools(registry, client) {
11
+ // 1. cascade_web_search
12
+ registry.register({
13
+ name: 'cascade_web_search',
14
+ description: 'Search the web for information',
15
+ inputSchema: {
16
+ type: 'object',
17
+ properties: {
18
+ query: {
19
+ type: 'string',
20
+ description: 'Search query'
21
+ },
22
+ top_k: {
23
+ type: 'integer',
24
+ default: 5,
25
+ description: 'Number of results to return'
26
+ }
27
+ },
28
+ required: ['query']
29
+ },
30
+ handler: async (args) => {
31
+ try {
32
+ if (!args.query) {
33
+ return (0, response_helpers_1.errorResponse)('query is required');
34
+ }
35
+ const result = await client.callTool('web_search', {
36
+ query: args.query,
37
+ top_k: args.top_k || 5
38
+ });
39
+ return (0, response_helpers_1.formatSuccess)(result);
40
+ }
41
+ catch (error) {
42
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to search web', 'Check your network connection and API key if required');
43
+ }
44
+ }
45
+ });
46
+ // 2. cascade_call_http_api
47
+ registry.register({
48
+ name: 'cascade_call_http_api',
49
+ description: 'Execute an HTTP API request',
50
+ inputSchema: {
51
+ type: 'object',
52
+ properties: {
53
+ method: {
54
+ type: 'string',
55
+ enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
56
+ description: 'HTTP method'
57
+ },
58
+ url: {
59
+ type: 'string',
60
+ description: 'Full URL to call'
61
+ },
62
+ headers: {
63
+ type: 'object',
64
+ description: 'Optional HTTP headers',
65
+ additionalProperties: { type: 'string' }
66
+ },
67
+ body: {
68
+ type: 'object',
69
+ description: 'Optional request body (as JSON)'
70
+ },
71
+ timeout: {
72
+ type: 'number',
73
+ default: 30,
74
+ description: 'Request timeout in seconds'
75
+ }
76
+ },
77
+ required: ['method', 'url']
78
+ },
79
+ handler: async (args) => {
80
+ try {
81
+ if (!args.method) {
82
+ return (0, response_helpers_1.errorResponse)('method is required');
83
+ }
84
+ if (!args.url) {
85
+ return (0, response_helpers_1.errorResponse)('url is required');
86
+ }
87
+ const result = await client.callTool('call_http_api', {
88
+ method: args.method,
89
+ url: args.url,
90
+ headers: args.headers,
91
+ body: args.body,
92
+ timeout: args.timeout || 30
93
+ });
94
+ return (0, response_helpers_1.formatSuccess)(result);
95
+ }
96
+ catch (error) {
97
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to call API', 'Verify the URL is correct and the API is accessible');
98
+ }
99
+ }
100
+ });
101
+ }
102
+ //# sourceMappingURL=api-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-tools.js","sourceRoot":"","sources":["../../src/tools/api-tools.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAOH,4CAkGC;AApGD,yDAAkE;AAElE,SAAgB,gBAAgB,CAAC,QAAsB,EAAE,MAAwB;IAC/E,wBAAwB;IACxB,QAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,gCAAgC;QAC7C,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,cAAc;iBAC5B;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;oBACV,WAAW,EAAE,6BAA6B;iBAC3C;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAyB,EAAE;YAC7C,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;oBAChB,OAAO,IAAA,gCAAa,EAAC,mBAAmB,CAAC,CAAC;gBAC5C,CAAC;gBAED,MAAM,MAAM,GAAG,MAAM,M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EAAE;YAC7C,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACjB,OAAO,IAAA,gCAAa,EAAC,oBAAoB,CAAC,CAAC;gBAC7C,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBACd,OAAO,IAAA,gCAAa,EAAC,iBAAiB,CAAC,CAAC;gBAC1C,CAAC;gBAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE;oBACpD,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;iBAC5B,CAAC,CAAC;gBACH,OAAO,IAAA,gCAAa,EAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,gCAAa,EAClB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,EAC7D,qDAAqD,CACtD,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Desktop Automation Tools
3
+ *
4
+ * 9 tools for controlling Windows desktop applications
5
+ */
6
+ import { ToolRegistry } from './tool-registry';
7
+ import { CascadeMcpClient } from '../cascade-client';
8
+ import { CascadePluginConfig } from '../types';
9
+ export declare function registerDesktopTools(registry: ToolRegistry, client: CascadeMcpClient, config?: CascadePluginConfig): void;
10
+ //# sourceMappingURL=desktop-automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop-automation.d.ts","sourceRoot":"","sources":["../../src/tools/desktop-automation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAgB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAS7D,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,gBAAgB,EACxB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,IAAI,CAwVN"}
@@ -0,0 +1,330 @@
1
+ "use strict";
2
+ /**
3
+ * Desktop Automation Tools
4
+ *
5
+ * 9 tools for controlling Windows desktop applications
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.registerDesktopTools = registerDesktopTools;
9
+ const response_helpers_1 = require("./response-helpers");
10
+ const promises_1 = require("fs/promises");
11
+ const path_1 = require("path");
12
+ const os_1 = require("os");
13
+ // Max size for embedded images (4MB)
14
+ const MAX_EMBED_SIZE = 4 * 1024 * 1024;
15
+ function registerDesktopTools(registry, client, config) {
16
+ const screenshotMode = config?.screenshotMode || 'auto';
17
+ const screenshotDir = config?.screenshotDir || (0, path_1.join)((0, os_1.homedir)(), '.openclaw', 'screenshots');
18
+ // 1. cascade_click_element
19
+ registry.register({
20
+ name: 'cascade_click_element',
21
+ description: 'Click on a UI element on the desktop or in an application',
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ platform_source: {
26
+ type: 'string',
27
+ enum: ['WINDOWS', 'JAVA', 'WEB'],
28
+ description: 'Platform type (Windows desktop, Java app, or web)'
29
+ },
30
+ id: { type: 'string', description: 'Element ID if known' },
31
+ name: { type: 'string', description: 'Element name/label' },
32
+ control_type: {
33
+ type: 'string',
34
+ enum: ['BUTTON', 'INPUT', 'COMBO', 'MENU', 'TREE', 'TABLE', 'CUSTOM'],
35
+ description: 'Control type'
36
+ },
37
+ path: {
38
+ type: 'array',
39
+ items: { type: 'string' },
40
+ description: 'Path components for navigation'
41
+ },
42
+ index: { type: 'integer', description: 'Index if multiple matches' },
43
+ text_hint: { type: 'string', description: 'Text hint for element' }
44
+ },
45
+ required: ['platform_source']
46
+ },
47
+ handler: async (args) => {
48
+ try {
49
+ if (!args.platform_source) {
50
+ return (0, response_helpers_1.errorResponse)('platform_source is required');
51
+ }
52
+ const result = await client.callTool('click_element', args);
53
+ return (0, response_helpers_1.formatSuccess)(result);
54
+ }
55
+ catch (error) {
56
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to click element', 'Try using cascade_get_semantic_tree first to identify the correct element');
57
+ }
58
+ }
59
+ });
60
+ // 2. cascade_type_text
61
+ registry.register({
62
+ name: 'cascade_type_text',
63
+ description: 'Type text into a UI element (input field, text area, etc.)',
64
+ inputSchema: {
65
+ type: 'object',
66
+ properties: {
67
+ selector: {
68
+ type: 'object',
69
+ description: 'Element selector',
70
+ properties: {
71
+ platform_source: {
72
+ type: 'string',
73
+ enum: ['WINDOWS', 'JAVA', 'WEB']
74
+ },
75
+ id: { type: 'string' },
76
+ name: { type: 'string' },
77
+ control_type: {
78
+ type: 'string',
79
+ enum: ['BUTTON', 'INPUT', 'COMBO', 'MENU', 'TREE', 'TABLE', 'CUSTOM']
80
+ },
81
+ path: { type: 'array', items: { type: 'string' } },
82
+ index: { type: 'integer' },
83
+ text_hint: { type: 'string' }
84
+ },
85
+ required: ['platform_source']
86
+ },
87
+ text: {
88
+ type: 'string',
89
+ description: 'Text to type'
90
+ }
91
+ },
92
+ required: ['selector', 'text']
93
+ },
94
+ handler: async (args) => {
95
+ try {
96
+ if (!args.selector) {
97
+ return (0, response_helpers_1.errorResponse)('selector is required');
98
+ }
99
+ if (!args.text) {
100
+ return (0, response_helpers_1.errorResponse)('text is required');
101
+ }
102
+ const result = await client.callTool('type_text', args);
103
+ return (0, response_helpers_1.formatSuccess)(result);
104
+ }
105
+ catch (error) {
106
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to type text');
107
+ }
108
+ }
109
+ });
110
+ // 3. cascade_get_semantic_tree
111
+ registry.register({
112
+ name: 'cascade_get_semantic_tree',
113
+ description: 'Get the UI element structure of the current window or application',
114
+ inputSchema: {
115
+ type: 'object',
116
+ properties: {}
117
+ },
118
+ handler: async () => {
119
+ try {
120
+ const result = await client.callTool('get_semantic_tree', {});
121
+ return (0, response_helpers_1.formatSuccess)(result);
122
+ }
123
+ catch (error) {
124
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to get semantic tree');
125
+ }
126
+ }
127
+ });
128
+ // 4. cascade_get_screenshot
129
+ registry.register({
130
+ name: 'cascade_get_screenshot',
131
+ description: 'Capture a screenshot of the current screen with element annotations',
132
+ inputSchema: {
133
+ type: 'object',
134
+ properties: {}
135
+ },
136
+ handler: async () => {
137
+ try {
138
+ const result = await client.callTool('get_screenshot', {});
139
+ if (!result.image) {
140
+ return (0, response_helpers_1.errorResponse)('No image data received');
141
+ }
142
+ const imageSize = Buffer.from(result.image, 'base64').length;
143
+ const shouldEmbed = screenshotMode === 'embed' ||
144
+ (screenshotMode === 'auto' && imageSize < MAX_EMBED_SIZE);
145
+ if (shouldEmbed) {
146
+ return (0, response_helpers_1.imageResponse)(result.image, result.format?.toLowerCase() === 'jpeg' ? 'jpeg' : 'png', `Screenshot captured (${(imageSize / 1024).toFixed(1)} KB)`);
147
+ }
148
+ else {
149
+ // Save to disk
150
+ await (0, promises_1.mkdir)(screenshotDir, { recursive: true });
151
+ const filename = `cascade-${Date.now()}.${result.format?.toLowerCase() || 'png'}`;
152
+ const filepath = (0, path_1.join)(screenshotDir, filename);
153
+ await (0, promises_1.writeFile)(filepath, Buffer.from(result.image, 'base64'));
154
+ return (0, response_helpers_1.formatSuccess)({
155
+ saved_to: filepath,
156
+ size_kb: (imageSize / 1024).toFixed(1),
157
+ marks: result.marks
158
+ });
159
+ }
160
+ }
161
+ catch (error) {
162
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to capture screenshot');
163
+ }
164
+ }
165
+ });
166
+ // 5. cascade_start_app
167
+ registry.register({
168
+ name: 'cascade_start_app',
169
+ description: 'Start an application by name',
170
+ inputSchema: {
171
+ type: 'object',
172
+ properties: {
173
+ app_name: {
174
+ type: 'string',
175
+ description: 'Application name or executable (e.g., notepad, calc, excel)'
176
+ }
177
+ },
178
+ required: ['app_name']
179
+ },
180
+ handler: async (args) => {
181
+ try {
182
+ if (!args.app_name) {
183
+ return (0, response_helpers_1.errorResponse)('app_name is required');
184
+ }
185
+ const result = await client.callTool('start_app', args);
186
+ return (0, response_helpers_1.formatSuccess)(result);
187
+ }
188
+ catch (error) {
189
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to start application', 'Verify the app name is correct and the application is installed');
190
+ }
191
+ }
192
+ });
193
+ // 6. cascade_hover_element
194
+ registry.register({
195
+ name: 'cascade_hover_element',
196
+ description: 'Hover over a UI element',
197
+ inputSchema: {
198
+ type: 'object',
199
+ properties: {
200
+ selector: {
201
+ type: 'object',
202
+ description: 'Element selector',
203
+ properties: {
204
+ platform_source: { type: 'string', enum: ['WINDOWS', 'JAVA', 'WEB'] },
205
+ id: { type: 'string' },
206
+ name: { type: 'string' },
207
+ control_type: { type: 'string' },
208
+ path: { type: 'array', items: { type: 'string' } },
209
+ index: { type: 'integer' },
210
+ text_hint: { type: 'string' }
211
+ },
212
+ required: ['platform_source']
213
+ }
214
+ },
215
+ required: ['selector']
216
+ },
217
+ handler: async (args) => {
218
+ try {
219
+ const result = await client.callTool('hover_element', args);
220
+ return (0, response_helpers_1.formatSuccess)(result);
221
+ }
222
+ catch (error) {
223
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to hover element');
224
+ }
225
+ }
226
+ });
227
+ // 7. cascade_focus_element
228
+ registry.register({
229
+ name: 'cascade_focus_element',
230
+ description: 'Focus on a UI element',
231
+ inputSchema: {
232
+ type: 'object',
233
+ properties: {
234
+ selector: {
235
+ type: 'object',
236
+ description: 'Element selector',
237
+ properties: {
238
+ platform_source: { type: 'string', enum: ['WINDOWS', 'JAVA', 'WEB'] },
239
+ id: { type: 'string' },
240
+ name: { type: 'string' },
241
+ control_type: { type: 'string' },
242
+ path: { type: 'array', items: { type: 'string' } },
243
+ index: { type: 'integer' },
244
+ text_hint: { type: 'string' }
245
+ },
246
+ required: ['platform_source']
247
+ }
248
+ },
249
+ required: ['selector']
250
+ },
251
+ handler: async (args) => {
252
+ try {
253
+ const result = await client.callTool('focus_element', args);
254
+ return (0, response_helpers_1.formatSuccess)(result);
255
+ }
256
+ catch (error) {
257
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to focus element');
258
+ }
259
+ }
260
+ });
261
+ // 8. cascade_scroll_element
262
+ registry.register({
263
+ name: 'cascade_scroll_element',
264
+ description: 'Scroll a UI element',
265
+ inputSchema: {
266
+ type: 'object',
267
+ properties: {
268
+ selector: {
269
+ type: 'object',
270
+ description: 'Element selector',
271
+ properties: {
272
+ platform_source: { type: 'string', enum: ['WINDOWS', 'JAVA', 'WEB'] },
273
+ id: { type: 'string' },
274
+ name: { type: 'string' },
275
+ control_type: { type: 'string' },
276
+ path: { type: 'array', items: { type: 'string' } },
277
+ index: { type: 'integer' },
278
+ text_hint: { type: 'string' }
279
+ },
280
+ required: ['platform_source']
281
+ }
282
+ },
283
+ required: ['selector']
284
+ },
285
+ handler: async (args) => {
286
+ try {
287
+ const result = await client.callTool('scroll_element', args);
288
+ return (0, response_helpers_1.formatSuccess)(result);
289
+ }
290
+ catch (error) {
291
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to scroll element');
292
+ }
293
+ }
294
+ });
295
+ // 9. cascade_wait_visible
296
+ registry.register({
297
+ name: 'cascade_wait_visible',
298
+ description: 'Wait for a UI element to become visible',
299
+ inputSchema: {
300
+ type: 'object',
301
+ properties: {
302
+ selector: {
303
+ type: 'object',
304
+ description: 'Element selector',
305
+ properties: {
306
+ platform_source: { type: 'string', enum: ['WINDOWS', 'JAVA', 'WEB'] },
307
+ id: { type: 'string' },
308
+ name: { type: 'string' },
309
+ control_type: { type: 'string' },
310
+ path: { type: 'array', items: { type: 'string' } },
311
+ index: { type: 'integer' },
312
+ text_hint: { type: 'string' }
313
+ },
314
+ required: ['platform_source']
315
+ }
316
+ },
317
+ required: ['selector']
318
+ },
319
+ handler: async (args) => {
320
+ try {
321
+ const result = await client.callTool('wait_visible', args);
322
+ return (0, response_helpers_1.formatSuccess)(result);
323
+ }
324
+ catch (error) {
325
+ return (0, response_helpers_1.errorResponse)(error instanceof Error ? error.message : 'Failed to wait for element');
326
+ }
327
+ }
328
+ });
329
+ }
330
+ //# sourceMappingURL=desktop-automation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop-automation.js","sourceRoot":"","sources":["../../src/tools/desktop-automation.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAaH,oDA4VC;AApWD,yDAAiF;AACjF,0CAA+C;AAC/C,+BAA4B;AAC5B,2BAA6B;AAE7B,qCAAqC;AACrC,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC,SAAgB,oBAAoB,CAClC,QAAsB,EACtB,MAAwB,EACxB,MAA4B;IAE5B,MAAM,cAAc,GAAG,MAAM,EAAE,cAAc,IAAI,MAAM,CAAC;IACxD,MAAM,aAAa,GAAG,MAAM,EAAE,aAAa,IAAI,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAE3F,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,2DAA2D;QACxE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;oBAChC,WAAW,EAAE,mDAAmD;iBACjE;gBACD,EAAE,EAAE,EA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AI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;oBAC/B,UAAU,EAAE;wBACV,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE;wBACrE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAChC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;wBAClD,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;wBAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC9B;oBACD,QAAQ,EAAE,CAAC,iBAAiB,CAAC;iBAC9B;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAyB,EAAE;YAC7C,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAC3D,OAAO,IAAA,gCAAa,EAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,gCAAa,EAClB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CACtE,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tools Index
3
+ *
4
+ * Export all tool registration functions
5
+ */
6
+ export { registerDesktopTools } from './desktop-automation';
7
+ export { registerWebTools } from './web-automation';
8
+ export { registerApiTools } from './api-tools';
9
+ export { registerSandboxTools } from './sandbox-tools';
10
+ export { registerA2ATools } from './a2a-tools';
11
+ export * from './response-helpers';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * Tools Index
4
+ *
5
+ * Export all tool registration functions
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.registerA2ATools = exports.registerSandboxTools = exports.registerApiTools = exports.registerWebTools = exports.registerDesktopTools = void 0;
23
+ var desktop_automation_1 = require("./desktop-automation");
24
+ Object.defineProperty(exports, "registerDesktopTools", { enumerable: true, get: function () { return desktop_automation_1.registerDesktopTools; } });
25
+ var web_automation_1 = require("./web-automation");
26
+ Object.defineProperty(exports, "registerWebTools", { enumerable: true, get: function () { return web_automation_1.registerWebTools; } });
27
+ var api_tools_1 = require("./api-tools");
28
+ Object.defineProperty(exports, "registerApiTools", { enumerable: true, get: function () { return api_tools_1.registerApiTools; } });
29
+ var sandbox_tools_1 = require("./sandbox-tools");
30
+ Object.defineProperty(exports, "registerSandboxTools", { enumerable: true, get: function () { return sandbox_tools_1.registerSandboxTools; } });
31
+ var a2a_tools_1 = require("./a2a-tools");
32
+ Object.defineProperty(exports, "registerA2ATools", { enumerable: true, get: function () { return a2a_tools_1.registerA2ATools; } });
33
+ // Note: ToolRegistry class is not exported from main index to avoid conflict with ToolRegistry interface
34
+ __exportStar(require("./response-helpers"), exports);
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,2DAA4D;AAAnD,0HAAA,oBAAoB,OAAA;AAC7B,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA;AACzB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,iDAAuD;AAA9C,qHAAA,oBAAoB,OAAA;AAC7B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,yGAAyG;AACzG,qDAAmC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Base tool response helpers
3
+ */
4
+ import { ToolResponse } from '../types';
5
+ /**
6
+ * Create a successful text response
7
+ */
8
+ export declare function successResponse(text: string): ToolResponse;
9
+ /**
10
+ * Create a successful JSON response
11
+ */
12
+ export declare function jsonResponse(data: any): ToolResponse;
13
+ /**
14
+ * Create an image response with optional text
15
+ */
16
+ export declare function imageResponse(base64Data: string, format?: 'png' | 'jpeg', text?: string): ToolResponse;
17
+ /**
18
+ * Create an error response
19
+ */
20
+ export declare function errorResponse(message: string, suggestion?: string): ToolResponse;
21
+ /**
22
+ * Format a successful tool result
23
+ */
24
+ export declare function formatSuccess(result: any): ToolResponse;
25
+ //# sourceMappingURL=response-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-helpers.d.ts","sourceRoot":"","sources":["../../src/tools/response-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAI1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,YAAY,CAIpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,KAAK,GAAG,MAAc,EAC9B,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY,CAiBd;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAchF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY,CAKvD"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * Base tool response helpers
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.successResponse = successResponse;
7
+ exports.jsonResponse = jsonResponse;
8
+ exports.imageResponse = imageResponse;
9
+ exports.errorResponse = errorResponse;
10
+ exports.formatSuccess = formatSuccess;
11
+ /**
12
+ * Create a successful text response
13
+ */
14
+ function successResponse(text) {
15
+ return {
16
+ content: [{ type: 'text', text }]
17
+ };
18
+ }
19
+ /**
20
+ * Create a successful JSON response
21
+ */
22
+ function jsonResponse(data) {
23
+ return {
24
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }]
25
+ };
26
+ }
27
+ /**
28
+ * Create an image response with optional text
29
+ */
30
+ function imageResponse(base64Data, format = 'png', text) {
31
+ const content = [
32
+ {
33
+ type: 'image',
34
+ source: {
35
+ type: 'base64',
36
+ media_type: `image/${format}`,
37
+ data: base64Data
38
+ }
39
+ }
40
+ ];
41
+ if (text) {
42
+ content.push({ type: 'text', text });
43
+ }
44
+ return { content };
45
+ }
46
+ /**
47
+ * Create an error response
48
+ */
49
+ function errorResponse(message, suggestion) {
50
+ const response = {
51
+ success: false,
52
+ error: message
53
+ };
54
+ if (suggestion) {
55
+ response.suggestion = suggestion;
56
+ }
57
+ return {
58
+ content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
59
+ isError: true
60
+ };
61
+ }
62
+ /**
63
+ * Format a successful tool result
64
+ */
65
+ function formatSuccess(result) {
66
+ return jsonResponse({
67
+ success: true,
68
+ ...result
69
+ });
70
+ }
71
+ //# sourceMappingURL=response-helpers.js.map