@eko-ai/eko 1.0.13 → 1.0.14

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.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Sets a proxy for the Chrome API.
3
+ * This function creates a proxy for the Chrome API, allowing for interception and modification of certain methods.
4
+ * The main logic involves creating a proxy for the `chrome` namespaces.
5
+ * If a method exists in the mock implementation (e.g., `a` or `a_b` or `a_b_c` and so on), it will be used; otherwise, the original Chrome API method will be called.
6
+ * @param chromeProxy - An object that provides mock implementations of Chrome API methods.
7
+ * @example
8
+ * ```typescript
9
+ * class MyChromeProxy {
10
+ * chrome.events.Event<(tabId: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) => void>.removeListener(callback: (tabId: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) => void): void
11
+ * public static tabs_onUpdated_removeListener(callback: (tabId: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) => void): void {
12
+ * console.log(callback);
13
+ * return chrome.tabs.onUpdated.removeListener(callback);
14
+ * }
15
+ * public static tabs_get(tabId: number): Promise<chrome.tabs.Tab> {
16
+ * console.log(tabId);
17
+ * return chrome.tabs.get(tabId);
18
+ * }
19
+ * public static windows_create(createData: chrome.windows.CreateData): Promise<chrome.windows.Window> {
20
+ * console.log(createData);
21
+ * return chrome.windows.create(createData);
22
+ * }
23
+ * }
24
+ * setChromeProxy(MyChromeProxy);
25
+ * ```
26
+ */
27
+ export declare function setChromeProxy(chromeProxy: any): void;
28
+ /**
29
+ * Retrieves the current Chrome API proxy.
30
+ * This function returns the proxy object created by `setChromeProxy`, which can be used to access the proxied Chrome API methods.
31
+ * @returns The proxied Chrome API object.
32
+ * @example
33
+ * ```typescript
34
+ * getChromeProxy().tabs.get(1).then(tab => console.log(tab));
35
+ * ```
36
+ * In this example, `getChromeProxy` is used to retrieve the proxied Chrome API object, and then `tabs.get` is called on it.
37
+ */
38
+ export declare function getChromeProxy(): any;
@@ -0,0 +1,9 @@
1
+ import { CancelWorkflowInput } from '../../types/tools.types';
2
+ import { Tool, InputSchema, ExecutionContext } from '../../types/action.types';
3
+ export declare class CancelWorkflow implements Tool<CancelWorkflowInput, void> {
4
+ name: string;
5
+ description: string;
6
+ input_schema: InputSchema;
7
+ constructor();
8
+ execute(context: ExecutionContext, params: CancelWorkflowInput): Promise<void>;
9
+ }
@@ -0,0 +1,30 @@
1
+ import { HumanInputTextInput, HumanInputTextResult, HumanInputSingleChoiceInput, HumanInputSingleChoiceResult, HumanInputMultipleChoiceInput, HumanInputMultipleChoiceResult, HumanOperateInput, HumanOperateResult } from '../../types/tools.types';
2
+ import { Tool, InputSchema, ExecutionContext } from '../../types/action.types';
3
+ export declare class HumanInputText implements Tool<HumanInputTextInput, HumanInputTextResult> {
4
+ name: string;
5
+ description: string;
6
+ input_schema: InputSchema;
7
+ constructor();
8
+ execute(context: ExecutionContext, params: HumanInputTextInput): Promise<HumanInputTextResult>;
9
+ }
10
+ export declare class HumanInputSingleChoice implements Tool<HumanInputSingleChoiceInput, HumanInputSingleChoiceResult> {
11
+ name: string;
12
+ description: string;
13
+ input_schema: InputSchema;
14
+ constructor();
15
+ execute(context: ExecutionContext, params: HumanInputSingleChoiceInput): Promise<HumanInputSingleChoiceResult>;
16
+ }
17
+ export declare class HumanInputMultipleChoice implements Tool<HumanInputMultipleChoiceInput, HumanInputMultipleChoiceResult> {
18
+ name: string;
19
+ description: string;
20
+ input_schema: InputSchema;
21
+ constructor();
22
+ execute(context: ExecutionContext, params: HumanInputMultipleChoiceInput): Promise<HumanInputMultipleChoiceResult>;
23
+ }
24
+ export declare class HumanOperate implements Tool<HumanOperateInput, HumanOperateResult> {
25
+ name: string;
26
+ description: string;
27
+ input_schema: InputSchema;
28
+ constructor();
29
+ execute(context: ExecutionContext, params: HumanOperateInput): Promise<HumanOperateResult>;
30
+ }
@@ -0,0 +1,4 @@
1
+ import { CancelWorkflow } from "./cancel_workflow";
2
+ import { HumanInputText, HumanInputSingleChoice, HumanInputMultipleChoice, HumanOperate } from "./human";
3
+ import { SummaryWorkflow } from "./summary_workflow";
4
+ export { CancelWorkflow, HumanInputText, HumanInputSingleChoice, HumanInputMultipleChoice, HumanOperate, SummaryWorkflow, };
@@ -0,0 +1,9 @@
1
+ import { SummaryWorkflowInput } from '../../types/tools.types';
2
+ import { Tool, InputSchema, ExecutionContext } from '../../types/action.types';
3
+ export declare class SummaryWorkflow implements Tool<SummaryWorkflowInput, any> {
4
+ name: string;
5
+ description: string;
6
+ input_schema: InputSchema;
7
+ constructor();
8
+ execute(context: ExecutionContext, params: SummaryWorkflowInput): Promise<any>;
9
+ }
@@ -0,0 +1,10 @@
1
+ export declare class ChromeMock {
2
+ static tabs_create(createProperties: chrome.tabs.CreateProperties): Promise<chrome.tabs.Tab>;
3
+ static tabs_get(tabId: number): Promise<chrome.tabs.Tab>;
4
+ static tabs_remove(tabId: number): Promise<void>;
5
+ static windows_create(createData: chrome.windows.CreateData): Promise<chrome.windows.Window>;
6
+ static windows_get(windowId: number): Promise<chrome.windows.Window>;
7
+ static windows_getCurrent(): Promise<chrome.windows.Window>;
8
+ static windows_remove(windowId: number): Promise<void>;
9
+ }
10
+ export declare const ChromeProxy: any;
@@ -33,6 +33,7 @@ function clickable_elements_to_string(element_tree, includeAttributes) {
33
33
  'type',
34
34
  'name',
35
35
  'role',
36
+ 'class',
36
37
  // 'href',
37
38
  'tabindex',
38
39
  'aria-label',
@@ -1120,10 +1120,11 @@ class ExportFile {
1120
1120
  * @returns > { success: true }
1121
1121
  */
1122
1122
  async execute(context, params) {
1123
- var _a, _b, _c;
1123
+ var _a, _b, _c, _d, _e, _f;
1124
1124
  if (typeof params !== 'object' || params === null || !('content' in params)) {
1125
1125
  throw new Error('Invalid parameters. Expected an object with a "content" property.');
1126
1126
  }
1127
+ await ((_c = (_b = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks) === null || _b === undefined ? undefined : _b.onExportFile) === null || _c === undefined ? undefined : _c.call(_b, params));
1127
1128
  let type = 'text/plain';
1128
1129
  switch (params.fileType) {
1129
1130
  case 'csv':
@@ -1172,7 +1173,7 @@ class ExportFile {
1172
1173
  else {
1173
1174
  tab = await open_new_tab(url, true);
1174
1175
  }
1175
- (_c = (_b = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks) === null || _b === undefined ? undefined : _b.onTabCreated) === null || _c === undefined ? undefined : _c.call(_b, tab.id);
1176
+ (_f = (_e = (_d = context.callback) === null || _d === undefined ? undefined : _d.hooks) === null || _e === undefined ? undefined : _e.onTabCreated) === null || _f === undefined ? undefined : _f.call(_e, tab.id);
1176
1177
  let tabId = tab.id;
1177
1178
  await chrome.scripting.executeScript({
1178
1179
  target: { tabId: tabId },
@@ -2076,21 +2077,29 @@ class HumanInputText {
2076
2077
  };
2077
2078
  }
2078
2079
  async execute(context, params) {
2079
- var _a, _b, _c;
2080
+ var _a;
2080
2081
  if (typeof params !== 'object' || params === null || !params.question) {
2081
2082
  throw new Error('Invalid parameters. Expected an object with a "question" property.');
2082
2083
  }
2083
2084
  const question = params.question;
2084
2085
  console.log("question: " + question);
2085
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputText) === null || _c === undefined ? undefined : _c.call(_b, question));
2086
- if (!answer) {
2087
- console.error("Cannot get user's answer.");
2088
- return { status: "Error: Cannot get user's answer.", answer: "" };
2089
- }
2090
- else {
2086
+ let onHumanInputText = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputText;
2087
+ if (onHumanInputText) {
2088
+ let answer;
2089
+ try {
2090
+ answer = await onHumanInputText(question);
2091
+ }
2092
+ catch (e) {
2093
+ console.error(e);
2094
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2095
+ }
2091
2096
  console.log("answer: " + answer);
2092
2097
  return { status: "OK", answer: answer };
2093
2098
  }
2099
+ else {
2100
+ console.error("`onHumanInputText` not implemented");
2101
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2102
+ }
2094
2103
  }
2095
2104
  }
2096
2105
  class HumanInputSingleChoice {
@@ -2113,7 +2122,7 @@ class HumanInputSingleChoice {
2113
2122
  };
2114
2123
  }
2115
2124
  async execute(context, params) {
2116
- var _a, _b, _c;
2125
+ var _a;
2117
2126
  if (typeof params !== 'object' || params === null || !params.question || !params.choices) {
2118
2127
  throw new Error('Invalid parameters. Expected an object with a "question" and "choices" property.');
2119
2128
  }
@@ -2121,15 +2130,23 @@ class HumanInputSingleChoice {
2121
2130
  const choices = params.choices;
2122
2131
  console.log("question: " + question);
2123
2132
  console.log("choices: " + choices);
2124
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputSingleChoice) === null || _c === undefined ? undefined : _c.call(_b, question, choices));
2125
- if (!answer) {
2126
- console.error("Cannot get user's answer.");
2127
- return { status: "Error: Cannot get user's answer.", answer: "" };
2128
- }
2129
- else {
2133
+ let onHumanInputSingleChoice = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputSingleChoice;
2134
+ if (onHumanInputSingleChoice) {
2135
+ let answer;
2136
+ try {
2137
+ answer = await onHumanInputSingleChoice(question, choices);
2138
+ }
2139
+ catch (e) {
2140
+ console.error(e);
2141
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2142
+ }
2130
2143
  console.log("answer: " + answer);
2131
2144
  return { status: "OK", answer: answer };
2132
2145
  }
2146
+ else {
2147
+ console.error("`onHumanInputSingleChoice` not implemented");
2148
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2149
+ }
2133
2150
  }
2134
2151
  }
2135
2152
  class HumanInputMultipleChoice {
@@ -2152,7 +2169,7 @@ class HumanInputMultipleChoice {
2152
2169
  };
2153
2170
  }
2154
2171
  async execute(context, params) {
2155
- var _a, _b, _c;
2172
+ var _a;
2156
2173
  if (typeof params !== 'object' || params === null || !params.question || !params.choices) {
2157
2174
  throw new Error('Invalid parameters. Expected an object with a "question" and "choices" property.');
2158
2175
  }
@@ -2160,15 +2177,23 @@ class HumanInputMultipleChoice {
2160
2177
  const choices = params.choices;
2161
2178
  console.log("question: " + question);
2162
2179
  console.log("choices: " + choices);
2163
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputMultipleChoice) === null || _c === undefined ? undefined : _c.call(_b, question, choices));
2164
- if (!answer) {
2165
- console.error("Cannot get user's answer.");
2166
- return { status: "Error: Cannot get user's answer.", answer: [] };
2167
- }
2168
- else {
2180
+ let onHumanInputMultipleChoice = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputMultipleChoice;
2181
+ if (onHumanInputMultipleChoice) {
2182
+ let answer;
2183
+ try {
2184
+ answer = await onHumanInputMultipleChoice(question, choices);
2185
+ }
2186
+ catch (e) {
2187
+ console.error(e);
2188
+ return { status: "`onHumanInputMultipleChoice` not implemented", answer: [] };
2189
+ }
2169
2190
  console.log("answer: " + answer);
2170
2191
  return { status: "OK", answer: answer };
2171
2192
  }
2193
+ else {
2194
+ console.error("Cannot get user's answer.");
2195
+ return { status: "Error: Cannot get user's answer.", answer: [] };
2196
+ }
2172
2197
  }
2173
2198
  }
2174
2199
  class HumanOperate {
@@ -2187,28 +2212,36 @@ class HumanOperate {
2187
2212
  };
2188
2213
  }
2189
2214
  async execute(context, params) {
2190
- var _a, _b, _c;
2215
+ var _a;
2191
2216
  if (typeof params !== 'object' || params === null || !params.reason) {
2192
2217
  throw new Error('Invalid parameters. Expected an object with a "reason" property.');
2193
2218
  }
2194
2219
  const reason = params.reason;
2195
2220
  console.log("reason: " + reason);
2196
- let userOperation = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanOperate) === null || _c === undefined ? undefined : _c.call(_b, reason));
2197
- if (!userOperation) {
2198
- console.error("Cannot get user's operation.");
2199
- return { status: "Error: Cannot get user's operation.", userOperation: "" };
2200
- }
2201
- else {
2221
+ let onHumanOperate = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanOperate;
2222
+ if (onHumanOperate) {
2223
+ let userOperation;
2224
+ try {
2225
+ userOperation = await onHumanOperate(reason);
2226
+ }
2227
+ catch (e) {
2228
+ console.error(e);
2229
+ return { status: "`onHumanOperate` not implemented", userOperation: "" };
2230
+ }
2202
2231
  console.log("userOperation: " + userOperation);
2203
2232
  return { status: "OK", userOperation: userOperation };
2204
2233
  }
2234
+ else {
2235
+ console.error("Cannot get user's operation.");
2236
+ return { status: "Error: Cannot get user's operation.", userOperation: "" };
2237
+ }
2205
2238
  }
2206
2239
  }
2207
2240
 
2208
2241
  class SummaryWorkflow {
2209
2242
  constructor() {
2210
2243
  this.name = 'summary_workflow';
2211
- this.description = 'Summarize what this workflow has done from start to finish using an ordered list .';
2244
+ this.description = 'Summarize briefly what this workflow has accomplished.';
2212
2245
  this.input_schema = {
2213
2246
  type: 'object',
2214
2247
  properties: {
@@ -1118,10 +1118,11 @@ class ExportFile {
1118
1118
  * @returns > { success: true }
1119
1119
  */
1120
1120
  async execute(context, params) {
1121
- var _a, _b, _c;
1121
+ var _a, _b, _c, _d, _e, _f;
1122
1122
  if (typeof params !== 'object' || params === null || !('content' in params)) {
1123
1123
  throw new Error('Invalid parameters. Expected an object with a "content" property.');
1124
1124
  }
1125
+ await ((_c = (_b = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks) === null || _b === undefined ? undefined : _b.onExportFile) === null || _c === undefined ? undefined : _c.call(_b, params));
1125
1126
  let type = 'text/plain';
1126
1127
  switch (params.fileType) {
1127
1128
  case 'csv':
@@ -1170,7 +1171,7 @@ class ExportFile {
1170
1171
  else {
1171
1172
  tab = await open_new_tab(url, true);
1172
1173
  }
1173
- (_c = (_b = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks) === null || _b === undefined ? undefined : _b.onTabCreated) === null || _c === undefined ? undefined : _c.call(_b, tab.id);
1174
+ (_f = (_e = (_d = context.callback) === null || _d === undefined ? undefined : _d.hooks) === null || _e === undefined ? undefined : _e.onTabCreated) === null || _f === undefined ? undefined : _f.call(_e, tab.id);
1174
1175
  let tabId = tab.id;
1175
1176
  await chrome.scripting.executeScript({
1176
1177
  target: { tabId: tabId },
@@ -2074,21 +2075,29 @@ class HumanInputText {
2074
2075
  };
2075
2076
  }
2076
2077
  async execute(context, params) {
2077
- var _a, _b, _c;
2078
+ var _a;
2078
2079
  if (typeof params !== 'object' || params === null || !params.question) {
2079
2080
  throw new Error('Invalid parameters. Expected an object with a "question" property.');
2080
2081
  }
2081
2082
  const question = params.question;
2082
2083
  console.log("question: " + question);
2083
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputText) === null || _c === undefined ? undefined : _c.call(_b, question));
2084
- if (!answer) {
2085
- console.error("Cannot get user's answer.");
2086
- return { status: "Error: Cannot get user's answer.", answer: "" };
2087
- }
2088
- else {
2084
+ let onHumanInputText = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputText;
2085
+ if (onHumanInputText) {
2086
+ let answer;
2087
+ try {
2088
+ answer = await onHumanInputText(question);
2089
+ }
2090
+ catch (e) {
2091
+ console.error(e);
2092
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2093
+ }
2089
2094
  console.log("answer: " + answer);
2090
2095
  return { status: "OK", answer: answer };
2091
2096
  }
2097
+ else {
2098
+ console.error("`onHumanInputText` not implemented");
2099
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2100
+ }
2092
2101
  }
2093
2102
  }
2094
2103
  class HumanInputSingleChoice {
@@ -2111,7 +2120,7 @@ class HumanInputSingleChoice {
2111
2120
  };
2112
2121
  }
2113
2122
  async execute(context, params) {
2114
- var _a, _b, _c;
2123
+ var _a;
2115
2124
  if (typeof params !== 'object' || params === null || !params.question || !params.choices) {
2116
2125
  throw new Error('Invalid parameters. Expected an object with a "question" and "choices" property.');
2117
2126
  }
@@ -2119,15 +2128,23 @@ class HumanInputSingleChoice {
2119
2128
  const choices = params.choices;
2120
2129
  console.log("question: " + question);
2121
2130
  console.log("choices: " + choices);
2122
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputSingleChoice) === null || _c === undefined ? undefined : _c.call(_b, question, choices));
2123
- if (!answer) {
2124
- console.error("Cannot get user's answer.");
2125
- return { status: "Error: Cannot get user's answer.", answer: "" };
2126
- }
2127
- else {
2131
+ let onHumanInputSingleChoice = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputSingleChoice;
2132
+ if (onHumanInputSingleChoice) {
2133
+ let answer;
2134
+ try {
2135
+ answer = await onHumanInputSingleChoice(question, choices);
2136
+ }
2137
+ catch (e) {
2138
+ console.error(e);
2139
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2140
+ }
2128
2141
  console.log("answer: " + answer);
2129
2142
  return { status: "OK", answer: answer };
2130
2143
  }
2144
+ else {
2145
+ console.error("`onHumanInputSingleChoice` not implemented");
2146
+ return { status: "Error: Cannot get user's answer.", answer: "" };
2147
+ }
2131
2148
  }
2132
2149
  }
2133
2150
  class HumanInputMultipleChoice {
@@ -2150,7 +2167,7 @@ class HumanInputMultipleChoice {
2150
2167
  };
2151
2168
  }
2152
2169
  async execute(context, params) {
2153
- var _a, _b, _c;
2170
+ var _a;
2154
2171
  if (typeof params !== 'object' || params === null || !params.question || !params.choices) {
2155
2172
  throw new Error('Invalid parameters. Expected an object with a "question" and "choices" property.');
2156
2173
  }
@@ -2158,15 +2175,23 @@ class HumanInputMultipleChoice {
2158
2175
  const choices = params.choices;
2159
2176
  console.log("question: " + question);
2160
2177
  console.log("choices: " + choices);
2161
- let answer = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanInputMultipleChoice) === null || _c === undefined ? undefined : _c.call(_b, question, choices));
2162
- if (!answer) {
2163
- console.error("Cannot get user's answer.");
2164
- return { status: "Error: Cannot get user's answer.", answer: [] };
2165
- }
2166
- else {
2178
+ let onHumanInputMultipleChoice = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanInputMultipleChoice;
2179
+ if (onHumanInputMultipleChoice) {
2180
+ let answer;
2181
+ try {
2182
+ answer = await onHumanInputMultipleChoice(question, choices);
2183
+ }
2184
+ catch (e) {
2185
+ console.error(e);
2186
+ return { status: "`onHumanInputMultipleChoice` not implemented", answer: [] };
2187
+ }
2167
2188
  console.log("answer: " + answer);
2168
2189
  return { status: "OK", answer: answer };
2169
2190
  }
2191
+ else {
2192
+ console.error("Cannot get user's answer.");
2193
+ return { status: "Error: Cannot get user's answer.", answer: [] };
2194
+ }
2170
2195
  }
2171
2196
  }
2172
2197
  class HumanOperate {
@@ -2185,28 +2210,36 @@ class HumanOperate {
2185
2210
  };
2186
2211
  }
2187
2212
  async execute(context, params) {
2188
- var _a, _b, _c;
2213
+ var _a;
2189
2214
  if (typeof params !== 'object' || params === null || !params.reason) {
2190
2215
  throw new Error('Invalid parameters. Expected an object with a "reason" property.');
2191
2216
  }
2192
2217
  const reason = params.reason;
2193
2218
  console.log("reason: " + reason);
2194
- let userOperation = await ((_c = (_a = context.callback) === null || _a === undefined ? undefined : (_b = _a.hooks).onHumanOperate) === null || _c === undefined ? undefined : _c.call(_b, reason));
2195
- if (!userOperation) {
2196
- console.error("Cannot get user's operation.");
2197
- return { status: "Error: Cannot get user's operation.", userOperation: "" };
2198
- }
2199
- else {
2219
+ let onHumanOperate = (_a = context.callback) === null || _a === undefined ? undefined : _a.hooks.onHumanOperate;
2220
+ if (onHumanOperate) {
2221
+ let userOperation;
2222
+ try {
2223
+ userOperation = await onHumanOperate(reason);
2224
+ }
2225
+ catch (e) {
2226
+ console.error(e);
2227
+ return { status: "`onHumanOperate` not implemented", userOperation: "" };
2228
+ }
2200
2229
  console.log("userOperation: " + userOperation);
2201
2230
  return { status: "OK", userOperation: userOperation };
2202
2231
  }
2232
+ else {
2233
+ console.error("Cannot get user's operation.");
2234
+ return { status: "Error: Cannot get user's operation.", userOperation: "" };
2235
+ }
2203
2236
  }
2204
2237
  }
2205
2238
 
2206
2239
  class SummaryWorkflow {
2207
2240
  constructor() {
2208
2241
  this.name = 'summary_workflow';
2209
- this.description = 'Summarize what this workflow has done from start to finish using an ordered list .';
2242
+ this.description = 'Summarize briefly what this workflow has accomplished.';
2210
2243
  this.input_schema = {
2211
2244
  type: 'object',
2212
2245
  properties: {
@@ -318,7 +318,7 @@ function request_user_help(task_id, failure_type, failure_message) {
318
318
  position: fixed;
319
319
  top: 5px;
320
320
  left: 18px;
321
- z-index: 9999;
321
+ z-index: 999999;
322
322
  background-color: #FEF0ED;
323
323
  color: white;
324
324
  padding: 16px;
package/dist/index.cjs.js CHANGED
@@ -502,7 +502,7 @@ class ActionImpl {
502
502
  result = modified_result;
503
503
  }
504
504
  }
505
- const result_has_image = result && "image" in result;
505
+ const result_has_image = result && result.image;
506
506
  const resultContent = result_has_image
507
507
  ? {
508
508
  type: 'tool_result',
@@ -942,19 +942,6 @@ class WorkflowGenerator {
942
942
  ],
943
943
  });
944
944
  const workflowData = response.toolCalls[0].input.workflow;
945
- // Forcibly add special tools
946
- const specialTools = [
947
- "cancel_workflow",
948
- "human_input_text",
949
- "human_operate",
950
- ];
951
- for (const node of workflowData.nodes) {
952
- for (const tool of specialTools) {
953
- if (!node.action.tools.includes(tool)) {
954
- node.action.tools.push(tool);
955
- }
956
- }
957
- }
958
945
  // Validate all tools exist
959
946
  for (const node of workflowData.nodes) {
960
947
  if (!this.toolRegistry.hasTools(node.action.tools)) {
package/dist/index.esm.js CHANGED
@@ -498,7 +498,7 @@ class ActionImpl {
498
498
  result = modified_result;
499
499
  }
500
500
  }
501
- const result_has_image = result && "image" in result;
501
+ const result_has_image = result && result.image;
502
502
  const resultContent = result_has_image
503
503
  ? {
504
504
  type: 'tool_result',
@@ -938,19 +938,6 @@ class WorkflowGenerator {
938
938
  ],
939
939
  });
940
940
  const workflowData = response.toolCalls[0].input.workflow;
941
- // Forcibly add special tools
942
- const specialTools = [
943
- "cancel_workflow",
944
- "human_input_text",
945
- "human_operate",
946
- ];
947
- for (const node of workflowData.nodes) {
948
- for (const tool of specialTools) {
949
- if (!node.action.tools.includes(tool)) {
950
- node.action.tools.push(tool);
951
- }
952
- }
953
- }
954
941
  // Validate all tools exist
955
942
  for (const node of workflowData.nodes) {
956
943
  if (!this.toolRegistry.hasTools(node.action.tools)) {