@oagi/oagi 0.1.4 → 0.2.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.
@@ -58,9 +58,12 @@ var MODEL_THINKER = "lux-thinker-1";
58
58
  var MODE_ACTOR = "actor";
59
59
  var DEFAULT_MAX_STEPS = 20;
60
60
  var DEFAULT_MAX_STEPS_THINKER = 100;
61
- var MAX_STEPS_ACTOR = 30;
62
- var MAX_STEPS_THINKER = 120;
63
- var DEFAULT_STEP_DELAY = 0.3;
61
+ var DEFAULT_MAX_STEPS_TASKER = 60;
62
+ var MAX_STEPS_ACTOR = 100;
63
+ var MAX_STEPS_THINKER = 300;
64
+ var DEFAULT_REFLECTION_INTERVAL = 4;
65
+ var DEFAULT_REFLECTION_INTERVAL_TASKER = 20;
66
+ var DEFAULT_STEP_DELAY = 1;
64
67
  var DEFAULT_TEMPERATURE = 0.5;
65
68
  var DEFAULT_TEMPERATURE_LOW = 0.1;
66
69
  var HTTP_CLIENT_TIMEOUT = 60;
@@ -105,6 +108,38 @@ var logTraceOnFailure = (_, __, descriptor) => {
105
108
  return descriptor;
106
109
  };
107
110
 
111
+ // src/platform-info.ts
112
+ import { createRequire } from "module";
113
+ var SDK_NAME = "oagi-typescript";
114
+ function getSdkVersion() {
115
+ try {
116
+ const require2 = createRequire(import.meta.url);
117
+ for (const p of ["../package.json", "../../package.json"]) {
118
+ try {
119
+ const pkg = require2(p);
120
+ if (pkg.version && pkg.version !== "0.0.0") return pkg.version;
121
+ } catch {
122
+ }
123
+ }
124
+ } catch {
125
+ }
126
+ return "unknown";
127
+ }
128
+ function getUserAgent() {
129
+ return `${SDK_NAME}/${getSdkVersion()} (node ${process.version}; ${process.platform}; ${process.arch})`;
130
+ }
131
+ function getSdkHeaders() {
132
+ return {
133
+ "User-Agent": getUserAgent(),
134
+ "x-sdk-name": SDK_NAME,
135
+ "x-sdk-version": getSdkVersion(),
136
+ "x-sdk-language": "typescript",
137
+ "x-sdk-language-version": process.version,
138
+ "x-sdk-os": process.platform,
139
+ "x-sdk-platform": process.arch
140
+ };
141
+ }
142
+
108
143
  // src/types/models/action.ts
109
144
  import * as z from "zod";
110
145
  var ActionTypeSchema = z.enum([
@@ -117,6 +152,7 @@ var ActionTypeSchema = z.enum([
117
152
  "type",
118
153
  "scroll",
119
154
  "finish",
155
+ "fail",
120
156
  "wait",
121
157
  "call_user"
122
158
  ]);
@@ -333,7 +369,9 @@ var parseRawOutput = (rawOutput) => {
333
369
  return {
334
370
  reason,
335
371
  actions,
336
- stop: actions.some((action2) => action2.type === "finish")
372
+ stop: actions.some(
373
+ (action2) => action2.type === "finish" || action2.type === "fail"
374
+ )
337
375
  };
338
376
  };
339
377
 
@@ -384,10 +422,12 @@ var _Client = class _Client {
384
422
  `OAGI API key must be provided either as 'api_key' parameter or OAGI_API_KEY environment variable. Get your API key at ${API_KEY_HELP_URL}`
385
423
  );
386
424
  }
425
+ const sdkHeaders = getSdkHeaders();
387
426
  this.client = new OpenAI({
388
427
  baseURL: new URL("./v1", baseURL).href,
389
428
  apiKey,
390
- maxRetries
429
+ maxRetries,
430
+ defaultHeaders: sdkHeaders
391
431
  });
392
432
  logger2.info(`Client initialized with base_url: ${baseURL}`);
393
433
  }
@@ -403,7 +443,7 @@ var _Client = class _Client {
403
443
  return fetch(input, init);
404
444
  }
405
445
  buildHeaders(apiVersion) {
406
- const headers = {};
446
+ const headers = getSdkHeaders();
407
447
  if (apiVersion) {
408
448
  headers["x-api-version"] = apiVersion;
409
449
  }
@@ -851,84 +891,783 @@ var DefaultAgent = class {
851
891
  }
852
892
  };
853
893
 
854
- // src/agent/registry.ts
855
- var agentRegistry = {};
856
- var asyncAgentRegister = (mode) => {
857
- return (func) => {
858
- if (mode in agentRegistry) {
859
- throw new Error(
860
- `Agent mode '${mode}' is already registered. Cannot register the same mode twice.`
894
+ // src/agent/tasker.ts
895
+ var logger5 = logger_default("agent.tasker");
896
+ var resetHandler2 = (handler) => {
897
+ if (typeof handler.reset === "function") {
898
+ handler.reset();
899
+ }
900
+ };
901
+ var sleep2 = (seconds) => new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
902
+ var extractUuidFromUrl = (url) => {
903
+ const pattern = /\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\.[a-z]+)?(?:\?|$)/i;
904
+ const match = pattern.exec(url);
905
+ return match ? match[1] : null;
906
+ };
907
+ var PlannerMemory = class {
908
+ taskDescription = "";
909
+ todos = [];
910
+ history = [];
911
+ taskExecutionSummary = "";
912
+ todoExecutionSummaries = {};
913
+ setTask(taskDescription, todos) {
914
+ this.taskDescription = taskDescription;
915
+ this.todos = todos.map(
916
+ (todo) => typeof todo === "string" ? { description: todo, status: "pending" } : todo
917
+ );
918
+ }
919
+ getCurrentTodo() {
920
+ for (let i = 0; i < this.todos.length; i++) {
921
+ const todo = this.todos[i];
922
+ if (todo.status === "pending" || todo.status === "in_progress") {
923
+ return { todo, index: i };
924
+ }
925
+ }
926
+ return null;
927
+ }
928
+ updateTodo(index, status, summary) {
929
+ if (index < 0 || index >= this.todos.length) return;
930
+ this.todos[index].status = status;
931
+ if (summary) {
932
+ this.todoExecutionSummaries[index] = summary;
933
+ }
934
+ }
935
+ addHistory(todoIndex, actions, summary, completed = false) {
936
+ if (todoIndex < 0 || todoIndex >= this.todos.length) return;
937
+ this.history.push({
938
+ todo_index: todoIndex,
939
+ todo: this.todos[todoIndex].description,
940
+ actions,
941
+ summary,
942
+ completed
943
+ });
944
+ }
945
+ getContext() {
946
+ return {
947
+ task_description: this.taskDescription,
948
+ todos: this.todos.map((todo, index) => ({
949
+ index,
950
+ description: todo.description,
951
+ status: todo.status
952
+ })),
953
+ history: this.history.map((history) => ({
954
+ todo_index: history.todo_index,
955
+ todo: history.todo,
956
+ action_count: history.actions.length,
957
+ summary: history.summary,
958
+ completed: history.completed
959
+ })),
960
+ task_execution_summary: this.taskExecutionSummary,
961
+ todo_execution_summaries: this.todoExecutionSummaries
962
+ };
963
+ }
964
+ getTodoStatusSummary() {
965
+ const summary = {
966
+ pending: 0,
967
+ in_progress: 0,
968
+ completed: 0,
969
+ skipped: 0
970
+ };
971
+ for (const todo of this.todos) {
972
+ summary[todo.status] = (summary[todo.status] ?? 0) + 1;
973
+ }
974
+ return summary;
975
+ }
976
+ appendTodo(description) {
977
+ this.todos.push({ description, status: "pending" });
978
+ }
979
+ };
980
+ var Planner = class {
981
+ constructor(client, apiKey, baseUrl) {
982
+ this.apiKey = apiKey;
983
+ this.baseUrl = baseUrl;
984
+ this.client = client;
985
+ }
986
+ client;
987
+ ownsClient = false;
988
+ ensureClient() {
989
+ if (!this.client) {
990
+ this.client = new Client(this.baseUrl, this.apiKey);
991
+ this.ownsClient = true;
992
+ }
993
+ return this.client;
994
+ }
995
+ getClient() {
996
+ return this.ensureClient();
997
+ }
998
+ async close() {
999
+ if (!this.ownsClient || !this.client) return;
1000
+ const closable = this.client;
1001
+ if (typeof closable.close === "function") {
1002
+ await closable.close();
1003
+ }
1004
+ }
1005
+ extractMemoryData(memory, context, todoIndex) {
1006
+ if (memory && todoIndex !== void 0) {
1007
+ const taskDescription = memory.taskDescription;
1008
+ const todos = memory.todos.map((todo, index) => ({
1009
+ index,
1010
+ description: todo.description,
1011
+ status: todo.status,
1012
+ execution_summary: memory.todoExecutionSummaries[index] ?? void 0
1013
+ }));
1014
+ const history = memory.history.map((history2) => ({
1015
+ todo_index: history2.todo_index,
1016
+ todo_description: history2.todo,
1017
+ action_count: history2.actions.length,
1018
+ summary: history2.summary ?? void 0,
1019
+ completed: history2.completed
1020
+ }));
1021
+ const taskExecutionSummary = memory.taskExecutionSummary || void 0;
1022
+ const overallTodo = memory.todos[todoIndex] ? memory.todos[todoIndex].description : "";
1023
+ return {
1024
+ taskDescription,
1025
+ todos,
1026
+ history,
1027
+ taskExecutionSummary,
1028
+ overallTodo
1029
+ };
1030
+ }
1031
+ const rawTodos = context.todos;
1032
+ const rawHistory = context.history;
1033
+ return {
1034
+ taskDescription: context.task_description ?? "",
1035
+ todos: Array.isArray(rawTodos) ? rawTodos : [],
1036
+ history: Array.isArray(rawHistory) ? rawHistory : [],
1037
+ taskExecutionSummary: void 0,
1038
+ overallTodo: context.current_todo ?? ""
1039
+ };
1040
+ }
1041
+ extractJsonString(text) {
1042
+ const start = text.indexOf("{");
1043
+ const end = text.lastIndexOf("}") + 1;
1044
+ if (start < 0 || end <= start) return "";
1045
+ return text.slice(start, end);
1046
+ }
1047
+ parsePlannerOutput(response) {
1048
+ try {
1049
+ const jsonResponse = this.extractJsonString(response);
1050
+ const data = JSON.parse(jsonResponse);
1051
+ return {
1052
+ instruction: data.subtask ?? data.instruction ?? "",
1053
+ reasoning: data.reasoning ?? "",
1054
+ subtodos: data.subtodos ?? []
1055
+ };
1056
+ } catch {
1057
+ return {
1058
+ instruction: "",
1059
+ reasoning: "Failed to parse structured response",
1060
+ subtodos: []
1061
+ };
1062
+ }
1063
+ }
1064
+ parseReflectionOutput(response) {
1065
+ try {
1066
+ const jsonResponse = this.extractJsonString(response);
1067
+ const data = JSON.parse(jsonResponse);
1068
+ const success = data.success === "yes";
1069
+ const newSubtask = (data.subtask_instruction ?? "").trim();
1070
+ const continueCurrent = !success && !newSubtask;
1071
+ return {
1072
+ continue_current: continueCurrent,
1073
+ new_instruction: newSubtask || null,
1074
+ reasoning: data.reflection ?? data.reasoning ?? "",
1075
+ success_assessment: success
1076
+ };
1077
+ } catch {
1078
+ return {
1079
+ continue_current: true,
1080
+ new_instruction: null,
1081
+ reasoning: "Failed to parse reflection response, continuing current approach",
1082
+ success_assessment: false
1083
+ };
1084
+ }
1085
+ }
1086
+ formatExecutionNotes(context) {
1087
+ const history = context.history;
1088
+ if (!history?.length) return "";
1089
+ const parts = [];
1090
+ for (const item of history) {
1091
+ parts.push(
1092
+ `Todo ${item.todo_index}: ${item.action_count} actions, completed: ${item.completed}`
861
1093
  );
1094
+ if (item.summary) {
1095
+ parts.push(`Summary: ${item.summary}`);
1096
+ }
862
1097
  }
863
- agentRegistry[mode] = func;
864
- return func;
865
- };
1098
+ return parts.join("\n");
1099
+ }
1100
+ async ensureScreenshotUuid(screenshot) {
1101
+ if (!screenshot) return { uuid: void 0, url: void 0 };
1102
+ if (typeof screenshot === "string") {
1103
+ const uuid = extractUuidFromUrl(screenshot);
1104
+ return { uuid: uuid ?? void 0, url: screenshot };
1105
+ }
1106
+ const client = this.ensureClient();
1107
+ const upload = await client.putS3PresignedUrl(screenshot);
1108
+ return { uuid: upload.uuid, url: upload.download_url };
1109
+ }
1110
+ async initialPlan(todo, context, screenshot, memory, todoIndex) {
1111
+ const client = this.ensureClient();
1112
+ const { uuid } = await this.ensureScreenshotUuid(screenshot);
1113
+ const { taskDescription, todos, history, taskExecutionSummary } = this.extractMemoryData(memory, context, todoIndex);
1114
+ const response = await client.callWorker({
1115
+ workerId: "oagi_first",
1116
+ overallTodo: todo,
1117
+ taskDescription,
1118
+ todos,
1119
+ history,
1120
+ currentTodoIndex: todoIndex,
1121
+ taskExecutionSummary,
1122
+ currentScreenshot: uuid
1123
+ });
1124
+ return {
1125
+ output: this.parsePlannerOutput(response.response),
1126
+ requestId: response.request_id
1127
+ };
1128
+ }
1129
+ async reflect(actions, context, screenshot, memory, todoIndex, currentInstruction, reflectionInterval = DEFAULT_REFLECTION_INTERVAL) {
1130
+ const client = this.ensureClient();
1131
+ const { uuid } = await this.ensureScreenshotUuid(screenshot);
1132
+ const {
1133
+ taskDescription,
1134
+ todos,
1135
+ history,
1136
+ taskExecutionSummary,
1137
+ overallTodo
1138
+ } = this.extractMemoryData(memory, context, todoIndex);
1139
+ const windowActions = actions.slice(-reflectionInterval);
1140
+ const windowSteps = windowActions.map((action, index) => ({
1141
+ step_number: index + 1,
1142
+ action_type: action.action_type,
1143
+ target: action.target ?? "",
1144
+ reasoning: action.reasoning ?? ""
1145
+ }));
1146
+ const windowScreenshots = windowActions.map((action) => action.screenshot_uuid).filter(Boolean);
1147
+ const priorNotes = this.formatExecutionNotes(context);
1148
+ const response = await client.callWorker({
1149
+ workerId: "oagi_follow",
1150
+ overallTodo,
1151
+ taskDescription,
1152
+ todos,
1153
+ history,
1154
+ currentTodoIndex: todoIndex,
1155
+ taskExecutionSummary,
1156
+ currentSubtaskInstruction: currentInstruction ?? "",
1157
+ windowSteps,
1158
+ windowScreenshots,
1159
+ resultScreenshot: uuid,
1160
+ priorNotes
1161
+ });
1162
+ return {
1163
+ output: this.parseReflectionOutput(response.response),
1164
+ requestId: response.request_id
1165
+ };
1166
+ }
1167
+ async summarize(_executionHistory, context, memory, todoIndex) {
1168
+ const client = this.ensureClient();
1169
+ const {
1170
+ taskDescription,
1171
+ todos,
1172
+ history,
1173
+ taskExecutionSummary,
1174
+ overallTodo
1175
+ } = this.extractMemoryData(memory, context, todoIndex);
1176
+ const latestTodoSummary = memory && todoIndex !== void 0 ? memory.todoExecutionSummaries[todoIndex] : "";
1177
+ const response = await client.callWorker({
1178
+ workerId: "oagi_task_summary",
1179
+ overallTodo,
1180
+ taskDescription,
1181
+ todos,
1182
+ history,
1183
+ currentTodoIndex: todoIndex,
1184
+ taskExecutionSummary,
1185
+ latestTodoSummary
1186
+ });
1187
+ try {
1188
+ const parsed = JSON.parse(response.response);
1189
+ return {
1190
+ summary: parsed.task_summary ?? response.response,
1191
+ requestId: response.request_id
1192
+ };
1193
+ } catch {
1194
+ return { summary: response.response, requestId: response.request_id };
1195
+ }
1196
+ }
866
1197
  };
867
- var getAgentFactory = (mode) => {
868
- if (!(mode in agentRegistry)) {
869
- const availableModes = Object.keys(agentRegistry);
870
- throw new Error(
871
- `Unknown agent mode: '${mode}'. Available modes: ${availableModes}`
1198
+ var TaskeeAgent = class {
1199
+ apiKey;
1200
+ baseUrl;
1201
+ model;
1202
+ maxSteps;
1203
+ reflectionInterval;
1204
+ temperature;
1205
+ planner;
1206
+ externalMemory;
1207
+ todoIndex;
1208
+ stepObserver;
1209
+ stepDelay;
1210
+ actor;
1211
+ currentTodo = "";
1212
+ currentInstruction = "";
1213
+ actions = [];
1214
+ totalActions = 0;
1215
+ sinceReflection = 0;
1216
+ success = false;
1217
+ constructor(apiKey, baseUrl, model = MODEL_ACTOR, maxSteps = DEFAULT_MAX_STEPS, reflectionInterval = DEFAULT_REFLECTION_INTERVAL, temperature = DEFAULT_TEMPERATURE, planner, externalMemory, todoIndex, stepObserver, stepDelay = DEFAULT_STEP_DELAY) {
1218
+ this.apiKey = apiKey;
1219
+ this.baseUrl = baseUrl;
1220
+ this.model = model;
1221
+ this.maxSteps = maxSteps;
1222
+ this.reflectionInterval = reflectionInterval;
1223
+ this.temperature = temperature;
1224
+ this.planner = planner ?? new Planner(void 0, apiKey, baseUrl);
1225
+ this.externalMemory = externalMemory;
1226
+ this.todoIndex = todoIndex;
1227
+ this.stepObserver = stepObserver;
1228
+ this.stepDelay = stepDelay;
1229
+ }
1230
+ async execute(instruction, actionHandler, imageProvider) {
1231
+ resetHandler2(actionHandler);
1232
+ this.currentTodo = instruction;
1233
+ this.actions = [];
1234
+ this.totalActions = 0;
1235
+ this.sinceReflection = 0;
1236
+ this.success = false;
1237
+ try {
1238
+ this.actor = new Actor(
1239
+ this.apiKey,
1240
+ this.baseUrl,
1241
+ this.model,
1242
+ this.temperature
1243
+ );
1244
+ await this.initialPlan(imageProvider);
1245
+ this.actor.initTask(this.currentInstruction, this.maxSteps);
1246
+ let remainingSteps = this.maxSteps;
1247
+ while (remainingSteps > 0 && !this.success) {
1248
+ const stepsTaken = await this.executeSubtask(
1249
+ Math.min(this.maxSteps, remainingSteps),
1250
+ actionHandler,
1251
+ imageProvider
1252
+ );
1253
+ remainingSteps -= stepsTaken;
1254
+ if (!this.success && remainingSteps > 0) {
1255
+ const shouldContinue = await this.reflectAndDecide(imageProvider);
1256
+ if (!shouldContinue) {
1257
+ break;
1258
+ }
1259
+ }
1260
+ }
1261
+ await this.generateSummary();
1262
+ return this.success;
1263
+ } catch (err) {
1264
+ logger5.error(`Error executing todo: ${err}`);
1265
+ this.recordAction("error", null, String(err));
1266
+ return false;
1267
+ } finally {
1268
+ this.actor = void 0;
1269
+ }
1270
+ }
1271
+ getContext() {
1272
+ return this.externalMemory ? this.externalMemory.getContext() : {};
1273
+ }
1274
+ recordAction(actionType, target, reasoning, result, screenshotUuid) {
1275
+ this.actions.push({
1276
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1277
+ action_type: actionType,
1278
+ target,
1279
+ reasoning,
1280
+ result,
1281
+ details: {},
1282
+ screenshot_uuid: screenshotUuid ?? void 0
1283
+ });
1284
+ }
1285
+ async initialPlan(imageProvider) {
1286
+ logger5.info("Generating initial plan for todo");
1287
+ const screenshot = await imageProvider.provide();
1288
+ const context = this.getContext();
1289
+ const { output, requestId } = await this.planner.initialPlan(
1290
+ this.currentTodo,
1291
+ context,
1292
+ screenshot,
1293
+ this.externalMemory,
1294
+ this.todoIndex
872
1295
  );
1296
+ this.recordAction("plan", "initial", output.reasoning, output.instruction);
1297
+ if (this.stepObserver) {
1298
+ const event = {
1299
+ type: "plan",
1300
+ timestamp: /* @__PURE__ */ new Date(),
1301
+ phase: "initial",
1302
+ image: screenshot,
1303
+ reasoning: output.reasoning,
1304
+ result: output.instruction,
1305
+ request_id: requestId ?? void 0
1306
+ };
1307
+ await this.stepObserver.onEvent(event);
1308
+ }
1309
+ this.currentInstruction = output.instruction;
1310
+ logger5.info(`Initial instruction: ${this.currentInstruction}`);
1311
+ }
1312
+ async executeSubtask(maxSteps, actionHandler, imageProvider) {
1313
+ logger5.info(`Executing subtask with max ${maxSteps} steps`);
1314
+ let stepsTaken = 0;
1315
+ const client = this.planner.getClient();
1316
+ for (let stepNum = 0; stepNum < maxSteps; stepNum++) {
1317
+ const screenshot = await imageProvider.provide();
1318
+ let screenshotUuid;
1319
+ let screenshotUrl;
1320
+ try {
1321
+ if (typeof screenshot === "string") {
1322
+ screenshotUuid = extractUuidFromUrl(screenshot) ?? void 0;
1323
+ screenshotUrl = screenshot;
1324
+ } else {
1325
+ const upload = await client.putS3PresignedUrl(screenshot);
1326
+ screenshotUuid = upload.uuid;
1327
+ screenshotUrl = upload.download_url;
1328
+ }
1329
+ } catch (err) {
1330
+ logger5.error(`Error uploading screenshot: ${err}`);
1331
+ this.recordAction("error", "screenshot_upload", String(err));
1332
+ break;
1333
+ }
1334
+ let step;
1335
+ try {
1336
+ step = await this.actor.step(screenshotUrl ?? screenshot, void 0);
1337
+ } catch (err) {
1338
+ logger5.error(`Error getting step from OAGI: ${err}`);
1339
+ this.recordAction(
1340
+ "error",
1341
+ "oagi_step",
1342
+ String(err),
1343
+ null,
1344
+ screenshotUuid
1345
+ );
1346
+ break;
1347
+ }
1348
+ if (step.reason) {
1349
+ logger5.info(`Step ${this.totalActions + 1}: ${step.reason}`);
1350
+ }
1351
+ if (this.stepObserver) {
1352
+ const event = {
1353
+ type: "step",
1354
+ timestamp: /* @__PURE__ */ new Date(),
1355
+ step_num: this.totalActions + 1,
1356
+ image: screenshot,
1357
+ step,
1358
+ task_id: this.actor.taskId
1359
+ };
1360
+ await this.stepObserver.onEvent(event);
1361
+ }
1362
+ if (step.actions?.length) {
1363
+ logger5.info(`Actions (${step.actions.length}):`);
1364
+ for (const action of step.actions) {
1365
+ const countSuffix = action.count && action.count > 1 ? ` x${action.count}` : "";
1366
+ logger5.info(` [${action.type}] ${action.argument}${countSuffix}`);
1367
+ }
1368
+ for (const action of step.actions) {
1369
+ this.recordAction(
1370
+ action.type,
1371
+ action.argument,
1372
+ step.reason ?? null,
1373
+ null,
1374
+ screenshotUuid
1375
+ );
1376
+ }
1377
+ let error = null;
1378
+ try {
1379
+ await actionHandler.handle(step.actions);
1380
+ } catch (err) {
1381
+ error = String(err);
1382
+ throw err;
1383
+ } finally {
1384
+ if (this.stepObserver) {
1385
+ const event = {
1386
+ type: "action",
1387
+ timestamp: /* @__PURE__ */ new Date(),
1388
+ step_num: this.totalActions + 1,
1389
+ actions: step.actions,
1390
+ error: error ?? void 0
1391
+ };
1392
+ await this.stepObserver.onEvent(event);
1393
+ }
1394
+ }
1395
+ this.totalActions += step.actions.length;
1396
+ this.sinceReflection += step.actions.length;
1397
+ }
1398
+ if (this.stepDelay > 0) {
1399
+ await sleep2(this.stepDelay);
1400
+ }
1401
+ stepsTaken += 1;
1402
+ if (step.stop) {
1403
+ logger5.info("OAGI signaled task completion");
1404
+ break;
1405
+ }
1406
+ if (this.sinceReflection >= this.reflectionInterval) {
1407
+ logger5.info("Reflection interval reached");
1408
+ break;
1409
+ }
1410
+ }
1411
+ return stepsTaken;
1412
+ }
1413
+ async reflectAndDecide(imageProvider) {
1414
+ logger5.info("Reflecting on progress");
1415
+ const screenshot = await imageProvider.provide();
1416
+ const context = this.getContext();
1417
+ context.current_todo = this.currentTodo;
1418
+ const recentActions = this.actions.slice(-this.sinceReflection);
1419
+ const { output, requestId } = await this.planner.reflect(
1420
+ recentActions,
1421
+ context,
1422
+ screenshot,
1423
+ this.externalMemory,
1424
+ this.todoIndex,
1425
+ this.currentInstruction,
1426
+ this.reflectionInterval
1427
+ );
1428
+ this.recordAction(
1429
+ "reflect",
1430
+ null,
1431
+ output.reasoning,
1432
+ output.continue_current ? "continue" : "pivot"
1433
+ );
1434
+ if (this.stepObserver) {
1435
+ const decision = output.success_assessment ? "success" : output.continue_current ? "continue" : "pivot";
1436
+ const event = {
1437
+ type: "plan",
1438
+ timestamp: /* @__PURE__ */ new Date(),
1439
+ phase: "reflection",
1440
+ image: screenshot,
1441
+ reasoning: output.reasoning,
1442
+ result: decision,
1443
+ request_id: requestId ?? void 0
1444
+ };
1445
+ await this.stepObserver.onEvent(event);
1446
+ }
1447
+ if (output.success_assessment) {
1448
+ this.success = true;
1449
+ logger5.info("Reflection indicates task is successful");
1450
+ return false;
1451
+ }
1452
+ this.sinceReflection = 0;
1453
+ if (!output.continue_current && output.new_instruction) {
1454
+ logger5.info(`Pivoting to new instruction: ${output.new_instruction}`);
1455
+ this.currentInstruction = output.new_instruction;
1456
+ await this.actor.initTask(this.currentInstruction, this.maxSteps);
1457
+ return true;
1458
+ }
1459
+ return output.continue_current;
1460
+ }
1461
+ async generateSummary() {
1462
+ logger5.info("Generating execution summary");
1463
+ const context = this.getContext();
1464
+ context.current_todo = this.currentTodo;
1465
+ const { summary, requestId } = await this.planner.summarize(
1466
+ this.actions,
1467
+ context,
1468
+ this.externalMemory,
1469
+ this.todoIndex
1470
+ );
1471
+ this.recordAction("summary", null, summary);
1472
+ if (this.stepObserver) {
1473
+ const event = {
1474
+ type: "plan",
1475
+ timestamp: /* @__PURE__ */ new Date(),
1476
+ phase: "summary",
1477
+ image: void 0,
1478
+ reasoning: summary,
1479
+ result: void 0,
1480
+ request_id: requestId ?? void 0
1481
+ };
1482
+ await this.stepObserver.onEvent(event);
1483
+ }
1484
+ logger5.info(`Execution summary: ${summary}`);
1485
+ }
1486
+ returnExecutionResults() {
1487
+ let summary = "";
1488
+ for (let i = this.actions.length - 1; i >= 0; i--) {
1489
+ if (this.actions[i].action_type === "summary") {
1490
+ summary = this.actions[i].reasoning ?? "";
1491
+ break;
1492
+ }
1493
+ }
1494
+ return {
1495
+ success: this.success,
1496
+ actions: this.actions,
1497
+ summary,
1498
+ total_steps: this.totalActions
1499
+ };
873
1500
  }
874
- return agentRegistry[mode];
875
- };
876
- var listAgentModes = () => {
877
- return Object.keys(agentRegistry);
878
1501
  };
879
- var createAgent = (mode, options = {}) => {
880
- const factory = getAgentFactory(mode);
881
- const agent = factory(options);
882
- if (!agent || typeof agent.execute !== "function") {
883
- throw new TypeError(
884
- `Factory for mode '${mode}' returned an object that doesn't implement Agent. Expected an object with an 'execute' method.`
1502
+ var TaskerAgent = class {
1503
+ /** Hierarchical agent that manages multi-todo workflows. */
1504
+ apiKey;
1505
+ baseUrl;
1506
+ model;
1507
+ maxSteps;
1508
+ temperature;
1509
+ reflectionInterval;
1510
+ planner;
1511
+ stepObserver;
1512
+ stepDelay;
1513
+ memory = new PlannerMemory();
1514
+ currentTaskeeAgent;
1515
+ constructor(apiKey, baseUrl, model = MODEL_ACTOR, maxSteps = DEFAULT_MAX_STEPS_TASKER, temperature = DEFAULT_TEMPERATURE, reflectionInterval = DEFAULT_REFLECTION_INTERVAL, planner, stepObserver, stepDelay = DEFAULT_STEP_DELAY) {
1516
+ this.apiKey = apiKey;
1517
+ this.baseUrl = baseUrl;
1518
+ this.model = model;
1519
+ this.maxSteps = maxSteps;
1520
+ this.temperature = temperature;
1521
+ this.reflectionInterval = reflectionInterval;
1522
+ this.planner = planner ?? new Planner(void 0, apiKey, baseUrl);
1523
+ this.stepObserver = stepObserver;
1524
+ this.stepDelay = stepDelay;
1525
+ }
1526
+ setTask(task, todos) {
1527
+ this.memory.setTask(task, todos);
1528
+ logger5.info(`Task set with ${todos.length} todos`);
1529
+ }
1530
+ set_task(task, todos) {
1531
+ this.setTask(task, todos);
1532
+ }
1533
+ async execute(_instruction, actionHandler, imageProvider) {
1534
+ resetHandler2(actionHandler);
1535
+ let overallSuccess = true;
1536
+ while (true) {
1537
+ const todoInfo = this.prepare();
1538
+ if (!todoInfo) {
1539
+ logger5.info("No more todos to execute");
1540
+ break;
1541
+ }
1542
+ const { todo, index } = todoInfo;
1543
+ logger5.info(`Executing todo ${index}: ${todo.description}`);
1544
+ if (this.stepObserver) {
1545
+ const event = {
1546
+ type: "split",
1547
+ timestamp: /* @__PURE__ */ new Date(),
1548
+ label: `Start of todo ${index + 1}: ${todo.description}`
1549
+ };
1550
+ await this.stepObserver.onEvent(event);
1551
+ }
1552
+ const success = await this.executeTodo(
1553
+ index,
1554
+ actionHandler,
1555
+ imageProvider
1556
+ );
1557
+ if (this.stepObserver) {
1558
+ const event = {
1559
+ type: "split",
1560
+ timestamp: /* @__PURE__ */ new Date(),
1561
+ label: `End of todo ${index + 1}: ${todo.description}`
1562
+ };
1563
+ await this.stepObserver.onEvent(event);
1564
+ }
1565
+ if (!success) {
1566
+ logger5.warn(`Todo ${index} failed`);
1567
+ overallSuccess = false;
1568
+ const currentStatus = this.memory.todos[index]?.status;
1569
+ if (currentStatus === "in_progress") {
1570
+ logger5.error("Todo failed with exception, stopping execution");
1571
+ break;
1572
+ }
1573
+ }
1574
+ this.updateTaskSummary();
1575
+ }
1576
+ const statusSummary = this.memory.getTodoStatusSummary();
1577
+ logger5.info(
1578
+ `Workflow complete. Status summary: ${JSON.stringify(statusSummary)}`
885
1579
  );
1580
+ return overallSuccess;
1581
+ }
1582
+ prepare() {
1583
+ const current = this.memory.getCurrentTodo();
1584
+ if (!current) return null;
1585
+ this.currentTaskeeAgent = new TaskeeAgent(
1586
+ this.apiKey,
1587
+ this.baseUrl,
1588
+ this.model,
1589
+ this.maxSteps,
1590
+ this.reflectionInterval,
1591
+ this.temperature,
1592
+ this.planner,
1593
+ this.memory,
1594
+ current.index,
1595
+ this.stepObserver,
1596
+ this.stepDelay
1597
+ );
1598
+ if (current.todo.status === "pending") {
1599
+ this.memory.updateTodo(current.index, "in_progress");
1600
+ }
1601
+ logger5.info(`Prepared taskee agent for todo ${current.index}`);
1602
+ return current;
1603
+ }
1604
+ async executeTodo(todoIndex, actionHandler, imageProvider) {
1605
+ if (!this.currentTaskeeAgent || todoIndex < 0) {
1606
+ logger5.error("No taskee agent prepared");
1607
+ return false;
1608
+ }
1609
+ const todo = this.memory.todos[todoIndex];
1610
+ try {
1611
+ const success = await this.currentTaskeeAgent.execute(
1612
+ todo.description,
1613
+ actionHandler,
1614
+ imageProvider
1615
+ );
1616
+ const results = this.currentTaskeeAgent.returnExecutionResults();
1617
+ this.updateMemoryFromExecution(todoIndex, results, success);
1618
+ return success;
1619
+ } catch (err) {
1620
+ logger5.error(`Error executing todo ${todoIndex}: ${err}`);
1621
+ this.memory.updateTodo(
1622
+ todoIndex,
1623
+ "in_progress",
1624
+ `Execution failed: ${String(err)}`
1625
+ );
1626
+ return false;
1627
+ }
1628
+ }
1629
+ updateMemoryFromExecution(todoIndex, results, success) {
1630
+ const status = success ? "completed" : "in_progress";
1631
+ this.memory.updateTodo(todoIndex, status, results.summary);
1632
+ this.memory.addHistory(
1633
+ todoIndex,
1634
+ results.actions,
1635
+ results.summary,
1636
+ success
1637
+ );
1638
+ if (success) {
1639
+ const summaryLine = `- Completed todo ${todoIndex}: ${results.summary}`;
1640
+ this.memory.taskExecutionSummary = this.memory.taskExecutionSummary ? `${this.memory.taskExecutionSummary}
1641
+ ${summaryLine}` : summaryLine;
1642
+ }
1643
+ logger5.info(
1644
+ `Updated memory for todo ${todoIndex}: status=${status}, actions=${results.actions.length}`
1645
+ );
1646
+ }
1647
+ updateTaskSummary() {
1648
+ const statusSummary = this.memory.getTodoStatusSummary();
1649
+ const completed = statusSummary.completed ?? 0;
1650
+ const total = this.memory.todos.length;
1651
+ const summaryParts = [`Progress: ${completed}/${total} todos completed`];
1652
+ const recentHistory = this.memory.history.slice(-3);
1653
+ for (const history of recentHistory) {
1654
+ if (history.completed && history.summary) {
1655
+ summaryParts.push(
1656
+ `- Todo ${history.todo_index}: ${history.summary.slice(0, 100)}`
1657
+ );
1658
+ }
1659
+ }
1660
+ this.memory.taskExecutionSummary = summaryParts.join("\n");
1661
+ }
1662
+ getMemory() {
1663
+ return this.memory;
1664
+ }
1665
+ appendTodo(description) {
1666
+ this.memory.appendTodo(description);
1667
+ logger5.info(`Appended new todo: ${description}`);
886
1668
  }
887
- return agent;
888
1669
  };
889
1670
 
890
- // src/agent/factories.ts
891
- asyncAgentRegister("actor")((options = {}) => {
892
- const {
893
- apiKey,
894
- baseURL,
895
- model = MODEL_ACTOR,
896
- maxSteps = DEFAULT_MAX_STEPS,
897
- temperature = DEFAULT_TEMPERATURE_LOW,
898
- stepObserver,
899
- stepDelay = DEFAULT_STEP_DELAY
900
- } = options;
901
- return new DefaultAgent(
902
- apiKey,
903
- baseURL,
904
- model,
905
- maxSteps,
906
- temperature,
907
- stepObserver ?? void 0,
908
- stepDelay
909
- );
910
- });
911
- asyncAgentRegister("thinker")((options = {}) => {
912
- const {
913
- apiKey,
914
- baseURL,
915
- model = MODEL_THINKER,
916
- maxSteps = DEFAULT_MAX_STEPS_THINKER,
917
- temperature = DEFAULT_TEMPERATURE_LOW,
918
- stepObserver,
919
- stepDelay = DEFAULT_STEP_DELAY
920
- } = options;
921
- return new DefaultAgent(
922
- apiKey,
923
- baseURL,
924
- model,
925
- maxSteps,
926
- temperature,
927
- stepObserver ?? void 0,
928
- stepDelay
929
- );
930
- });
931
-
932
1671
  // src/agent/observer/exporters.ts
933
1672
  import fs from "fs";
934
1673
  import path from "path";
@@ -1210,7 +1949,21 @@ var exportToHtml = (events, filePath) => {
1210
1949
  ensureDir(outputDir);
1211
1950
  const moduleUrl = import.meta?.url ? import.meta.url : pathToFileURL(__filename).href;
1212
1951
  const moduleDir = path.dirname(fileURLToPath(moduleUrl));
1213
- const templatePath = path.join(moduleDir, "report_template.html");
1952
+ const primaryTemplate = path.join(moduleDir, "report_template.html");
1953
+ const fallbackTemplate = path.resolve(
1954
+ moduleDir,
1955
+ "..",
1956
+ "src",
1957
+ "agent",
1958
+ "observer",
1959
+ "report_template.html"
1960
+ );
1961
+ const templatePath = fs.existsSync(primaryTemplate) ? primaryTemplate : fallbackTemplate;
1962
+ if (!fs.existsSync(templatePath)) {
1963
+ throw new Error(
1964
+ `Report template not found at ${primaryTemplate} or ${fallbackTemplate}`
1965
+ );
1966
+ }
1214
1967
  const template = fs.readFileSync(templatePath, "utf-8");
1215
1968
  const eventsData = convertEventsForHtml(events);
1216
1969
  const eventsJson = JSON.stringify(eventsData);
@@ -1239,6 +1992,12 @@ var exportToJson = (events, filePath) => {
1239
1992
  };
1240
1993
 
1241
1994
  // src/agent/observer/agent_observer.ts
1995
+ var ExportFormat = /* @__PURE__ */ ((ExportFormat2) => {
1996
+ ExportFormat2["MARKDOWN"] = "markdown";
1997
+ ExportFormat2["HTML"] = "html";
1998
+ ExportFormat2["JSON"] = "json";
1999
+ return ExportFormat2;
2000
+ })(ExportFormat || {});
1242
2001
  var AsyncAgentObserver = class extends StepObserver {
1243
2002
  /**
1244
2003
  * Records agent execution events and exports to various formats.
@@ -1293,10 +2052,196 @@ var AsyncAgentObserver = class extends StepObserver {
1293
2052
  }
1294
2053
  };
1295
2054
 
2055
+ // src/agent/registry.ts
2056
+ var agentRegistry = {};
2057
+ var asyncAgentRegister = (mode) => {
2058
+ return (func) => {
2059
+ if (mode in agentRegistry) {
2060
+ throw new Error(
2061
+ `Agent mode '${mode}' is already registered. Cannot register the same mode twice.`
2062
+ );
2063
+ }
2064
+ agentRegistry[mode] = func;
2065
+ return func;
2066
+ };
2067
+ };
2068
+ var getAgentFactory = (mode) => {
2069
+ if (!(mode in agentRegistry)) {
2070
+ const availableModes = Object.keys(agentRegistry);
2071
+ throw new Error(
2072
+ `Unknown agent mode: '${mode}'. Available modes: ${availableModes}`
2073
+ );
2074
+ }
2075
+ return agentRegistry[mode];
2076
+ };
2077
+ var listAgentModes = () => {
2078
+ return Object.keys(agentRegistry);
2079
+ };
2080
+ var createAgent = (mode, options = {}) => {
2081
+ const factory = getAgentFactory(mode);
2082
+ const agent = factory(options);
2083
+ if (!agent || typeof agent.execute !== "function") {
2084
+ throw new TypeError(
2085
+ `Factory for mode '${mode}' returned an object that doesn't implement Agent. Expected an object with an 'execute' method.`
2086
+ );
2087
+ }
2088
+ return agent;
2089
+ };
2090
+
2091
+ // src/agent/factories.ts
2092
+ asyncAgentRegister("actor")((options = {}) => {
2093
+ const {
2094
+ apiKey,
2095
+ baseURL,
2096
+ model = MODEL_ACTOR,
2097
+ maxSteps = DEFAULT_MAX_STEPS,
2098
+ temperature = DEFAULT_TEMPERATURE_LOW,
2099
+ stepObserver,
2100
+ stepDelay = DEFAULT_STEP_DELAY
2101
+ } = options;
2102
+ return new DefaultAgent(
2103
+ apiKey,
2104
+ baseURL,
2105
+ model,
2106
+ maxSteps,
2107
+ temperature,
2108
+ stepObserver ?? void 0,
2109
+ stepDelay
2110
+ );
2111
+ });
2112
+ asyncAgentRegister("thinker")((options = {}) => {
2113
+ const {
2114
+ apiKey,
2115
+ baseURL,
2116
+ model = MODEL_THINKER,
2117
+ maxSteps = DEFAULT_MAX_STEPS_THINKER,
2118
+ temperature = DEFAULT_TEMPERATURE_LOW,
2119
+ stepObserver,
2120
+ stepDelay = DEFAULT_STEP_DELAY
2121
+ } = options;
2122
+ return new DefaultAgent(
2123
+ apiKey,
2124
+ baseURL,
2125
+ model,
2126
+ maxSteps,
2127
+ temperature,
2128
+ stepObserver ?? void 0,
2129
+ stepDelay
2130
+ );
2131
+ });
2132
+ asyncAgentRegister("tasker")((options = {}) => {
2133
+ const {
2134
+ apiKey,
2135
+ baseURL,
2136
+ model = MODEL_ACTOR,
2137
+ maxSteps = DEFAULT_MAX_STEPS_TASKER,
2138
+ temperature = DEFAULT_TEMPERATURE,
2139
+ reflectionInterval = DEFAULT_REFLECTION_INTERVAL_TASKER,
2140
+ stepObserver,
2141
+ stepDelay = DEFAULT_STEP_DELAY
2142
+ } = options;
2143
+ return new TaskerAgent(
2144
+ apiKey,
2145
+ baseURL,
2146
+ model,
2147
+ maxSteps,
2148
+ temperature,
2149
+ reflectionInterval,
2150
+ void 0,
2151
+ stepObserver ?? void 0,
2152
+ stepDelay
2153
+ );
2154
+ });
2155
+ asyncAgentRegister("tasker:cvs_appointment")(
2156
+ (options = {}) => {
2157
+ const {
2158
+ apiKey,
2159
+ baseURL,
2160
+ model = MODEL_ACTOR,
2161
+ maxSteps = DEFAULT_MAX_STEPS_TASKER,
2162
+ temperature = DEFAULT_TEMPERATURE,
2163
+ reflectionInterval = DEFAULT_REFLECTION_INTERVAL_TASKER,
2164
+ stepObserver,
2165
+ stepDelay = DEFAULT_STEP_DELAY
2166
+ } = options;
2167
+ const tasker = new TaskerAgent(
2168
+ apiKey,
2169
+ baseURL,
2170
+ model,
2171
+ maxSteps,
2172
+ temperature,
2173
+ reflectionInterval,
2174
+ void 0,
2175
+ stepObserver ?? void 0,
2176
+ stepDelay
2177
+ );
2178
+ const firstName = "First";
2179
+ const lastName = "Last";
2180
+ const email = "user@example.com";
2181
+ const birthday = "01-01-1990";
2182
+ const zipCode = "00000";
2183
+ const [month, day, year] = birthday.split("-");
2184
+ const instruction = `Schedule an appointment at CVS for ${firstName} ${lastName} with email ${email} and birthday ${birthday}`;
2185
+ const todos = [
2186
+ "Open a new tab, go to www.cvs.com, type 'flu shot' in the search bar and press enter, wait for the page to load, then click on the button of Schedule vaccinations on the top of the page",
2187
+ `Enter the first name '${firstName}', last name '${lastName}', and email '${email}' in the form. Do not use any suggested autofills. Make sure the mobile phone number is empty.`,
2188
+ "Slightly scroll down to see the date of birth, enter Month '" + month + "', Day '" + day + "', and Year '" + year + "' in the form",
2189
+ "Click on 'Continue as guest' button, wait for the page to load with wait, click on 'Add vaccines' button, select 'Flu' and click on 'Add vaccines'",
2190
+ "Click on 'next' to enter the page with recommendation vaccines, then click on 'next' again, until on the page of entering zip code, enter '" + zipCode + "', select the first option from the dropdown menu, and click on 'Search'"
2191
+ ];
2192
+ tasker.setTask(instruction, todos);
2193
+ return tasker;
2194
+ }
2195
+ );
2196
+ asyncAgentRegister("tasker:software_qa")(
2197
+ (options = {}) => {
2198
+ const {
2199
+ apiKey,
2200
+ baseURL,
2201
+ model = MODEL_ACTOR,
2202
+ maxSteps = DEFAULT_MAX_STEPS_TASKER,
2203
+ temperature = DEFAULT_TEMPERATURE,
2204
+ reflectionInterval = DEFAULT_REFLECTION_INTERVAL_TASKER,
2205
+ stepObserver,
2206
+ stepDelay = DEFAULT_STEP_DELAY
2207
+ } = options;
2208
+ const tasker = new TaskerAgent(
2209
+ apiKey,
2210
+ baseURL,
2211
+ model,
2212
+ maxSteps,
2213
+ temperature,
2214
+ reflectionInterval,
2215
+ void 0,
2216
+ stepObserver ?? void 0,
2217
+ stepDelay
2218
+ );
2219
+ const instruction = "QA: click through every sidebar button in the Nuclear Player UI";
2220
+ const todos = [
2221
+ "Click on 'Dashboard' in the left sidebar",
2222
+ "Click on 'Downloads' in the left sidebar",
2223
+ "Click on 'Lyrics' in the left sidebar",
2224
+ "Click on 'Plugins' in the left sidebar",
2225
+ "Click on 'Search Results' in the left sidebar",
2226
+ "Click on 'Settings' in the left sidebar",
2227
+ "Click on 'Equalizer' in the left sidebar",
2228
+ "Click on 'Visualizer' in the left sidebar",
2229
+ "Click on 'Listening History' in the left sidebar",
2230
+ "Click on 'Favorite Albums' in the left sidebar",
2231
+ "Click on 'Favorite Tracks' in the left sidebar",
2232
+ "Click on 'Favorite Artists' in the left sidebar",
2233
+ "Click on 'Local Library' in the left sidebar",
2234
+ "Click on 'Playlists' in the left sidebar"
2235
+ ];
2236
+ tasker.setTask(instruction, todos);
2237
+ return tasker;
2238
+ }
2239
+ );
2240
+
1296
2241
  // src/handler.ts
1297
2242
  import robot from "robotjs";
1298
2243
  import sharp from "sharp";
1299
- var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
2244
+ var sleep3 = (ms) => new Promise((r) => setTimeout(r, ms));
1300
2245
  var toSharpKernel = (resample) => {
1301
2246
  switch (resample) {
1302
2247
  case "NEAREST":
@@ -1457,7 +2402,7 @@ var DefaultActionHandler = class {
1457
2402
  robot.moveMouse(p1.x, p1.y);
1458
2403
  robot.mouseToggle("down", "left");
1459
2404
  robot.dragMouse(p2.x, p2.y);
1460
- await sleep2(this.#cfg.dragDurationMs);
2405
+ await sleep3(this.#cfg.dragDurationMs);
1461
2406
  robot.mouseToggle("up", "left");
1462
2407
  return;
1463
2408
  }
@@ -1477,7 +2422,7 @@ var DefaultActionHandler = class {
1477
2422
  if (!last) return;
1478
2423
  const modifiers = keys.slice(0, -1);
1479
2424
  robot.keyTap(last, modifiers.length ? modifiers : []);
1480
- await sleep2(this.#cfg.hotkeyDelayMs);
2425
+ await sleep3(this.#cfg.hotkeyDelayMs);
1481
2426
  return;
1482
2427
  }
1483
2428
  case "type": {
@@ -1497,10 +2442,11 @@ var DefaultActionHandler = class {
1497
2442
  return;
1498
2443
  }
1499
2444
  case "wait": {
1500
- await sleep2(this.#cfg.waitDurationMs);
2445
+ await sleep3(this.#cfg.waitDurationMs);
1501
2446
  return;
1502
2447
  }
1503
- case "finish": {
2448
+ case "finish":
2449
+ case "fail": {
1504
2450
  this.reset();
1505
2451
  return;
1506
2452
  }
@@ -1538,10 +2484,12 @@ export {
1538
2484
  Client,
1539
2485
  Actor,
1540
2486
  DefaultAgent,
2487
+ TaskerAgent,
1541
2488
  listAgentModes,
1542
2489
  createAgent,
2490
+ ExportFormat,
1543
2491
  AsyncAgentObserver,
1544
2492
  ScreenshotMaker,
1545
2493
  DefaultActionHandler
1546
2494
  };
1547
- //# sourceMappingURL=chunk-JVNTVY6W.js.map
2495
+ //# sourceMappingURL=chunk-LA6CBP44.js.map