lua-cli 3.18.0 → 3.21.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.
@@ -1,8 +1,13 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- var __esm = (fn, res) => function __init() {
5
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ var __esm = (fn, res, err) => function __init() {
5
+ if (err) throw err[0];
6
+ try {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ } catch (e) {
9
+ throw err = [e], e;
10
+ }
6
11
  };
7
12
  var __export = (target, all) => {
8
13
  for (var name in all)
@@ -73,6 +78,15 @@ function aiGenerateInputFromSimplified(prompt, content) {
73
78
  ]
74
79
  };
75
80
  }
81
+ function isAllowedReviewableExecuteTool(tool) {
82
+ return REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST.includes(tool);
83
+ }
84
+ function isReviewableMcpSendTool(tool) {
85
+ return tool.length > REVIEWABLE_MCP_SEND_TOOL_SUFFIX.length && tool.endsWith(REVIEWABLE_MCP_SEND_TOOL_SUFFIX);
86
+ }
87
+ function isReviewableExecuteTool(tool) {
88
+ return isAllowedReviewableExecuteTool(tool) || isReviewableMcpSendTool(tool);
89
+ }
76
90
  function isInteractiveChannel(channel) {
77
91
  if (!channel) return true;
78
92
  return !NON_INTERACTIVE_CHANNELS.includes(channel);
@@ -88,6 +102,85 @@ function transformChatHistoryContentParts(parts) {
88
102
  const content = [];
89
103
  for (const rawPart of parts ?? []) {
90
104
  const part = rawPart;
105
+ if (part?.type === "reasoning") {
106
+ const detailsText = Array.isArray(part.details) ? part.details.filter((d) => d?.type === "text" && typeof d.text === "string").map((d) => d.text).join("") : "";
107
+ const reasoningText = [
108
+ part.reasoning,
109
+ detailsText,
110
+ part.text
111
+ ].find((v) => typeof v === "string" && v.trim().length > 0) ?? "";
112
+ if (reasoningText) content.push({
113
+ type: "reasoning",
114
+ text: reasoningText
115
+ });
116
+ continue;
117
+ }
118
+ if (part?.type === "tool-invocation") {
119
+ const inv = part.toolInvocation;
120
+ if (typeof inv?.toolName === "string" && inv.toolName.length > 0) {
121
+ content.push({
122
+ type: "tool",
123
+ toolName: inv.toolName,
124
+ toolCallId: inv.toolCallId,
125
+ input: inv.args,
126
+ output: inv.result,
127
+ toolState: inv.state
128
+ });
129
+ }
130
+ continue;
131
+ }
132
+ if (part?.type === "source") {
133
+ const src = part.source;
134
+ if (src?.sourceType === "document") {
135
+ content.push({
136
+ type: "source-document",
137
+ sourceId: src.id,
138
+ mediaType: src.mediaType,
139
+ title: src.title,
140
+ filename: src.filename,
141
+ providerMetadata: src.providerMetadata
142
+ });
143
+ } else if (typeof src?.url === "string" && src.url.length > 0) {
144
+ content.push({
145
+ type: "source-url",
146
+ sourceId: src.id,
147
+ url: src.url,
148
+ title: src.title,
149
+ providerMetadata: src.providerMetadata
150
+ });
151
+ }
152
+ continue;
153
+ }
154
+ if (part?.type === "source-url") {
155
+ if (typeof part.url === "string" && part.url.length > 0) {
156
+ content.push({
157
+ type: "source-url",
158
+ sourceId: part.sourceId,
159
+ url: part.url,
160
+ title: part.title,
161
+ providerMetadata: part.providerMetadata
162
+ });
163
+ }
164
+ continue;
165
+ }
166
+ if (part?.type === "source-document") {
167
+ content.push({
168
+ type: "source-document",
169
+ sourceId: part.sourceId,
170
+ mediaType: part.mediaType,
171
+ title: part.title,
172
+ filename: part.filename,
173
+ providerMetadata: part.providerMetadata
174
+ });
175
+ continue;
176
+ }
177
+ if (typeof part?.type === "string" && part.type.startsWith("data-lua-")) {
178
+ content.push({
179
+ type: part.type,
180
+ payload: rawPart.data
181
+ });
182
+ continue;
183
+ }
91
184
  if (part?.type !== "text" && part?.type !== "file") continue;
92
185
  if (part.type === "text" && typeof part.text === "string") {
93
186
  const rawText = part.text || "";
@@ -145,10 +238,92 @@ function transformChatHistoryContentParts(parts) {
145
238
  }
146
239
  return content;
147
240
  }
241
+ function isSyntheticSideRow(id) {
242
+ return id.startsWith(SCREENSHOT_MESSAGE_ID_PREFIX) || id.startsWith(RICH_PARTS_MESSAGE_ID_PREFIX);
243
+ }
244
+ function mergeRichPartMirrorMessages(messages, sameTurnGroup) {
245
+ const merged = [];
246
+ for (const message of messages) {
247
+ if (message.role === "assistant" && message.id.startsWith(RICH_PARTS_MESSAGE_ID_PREFIX)) {
248
+ let folded = false;
249
+ for (let i = merged.length - 1; i >= 0; i--) {
250
+ const target = merged[i];
251
+ if (sameTurnGroup && !sameTurnGroup(target, message)) continue;
252
+ if (isSyntheticSideRow(target.id)) continue;
253
+ if (target.role !== "assistant") break;
254
+ const seen = /* @__PURE__ */ new Set();
255
+ for (const part of target.content) {
256
+ for (const key of citationDedupeKeys(part)) seen.add(key);
257
+ }
258
+ const incoming = [];
259
+ for (const part of message.content) {
260
+ const keys = citationDedupeKeys(part);
261
+ if (keys.length > 0 && keys.some((k) => seen.has(k))) continue;
262
+ for (const key of keys) seen.add(key);
263
+ incoming.push(part);
264
+ }
265
+ merged[i] = {
266
+ ...target,
267
+ content: [
268
+ ...target.content,
269
+ ...incoming
270
+ ]
271
+ };
272
+ folded = true;
273
+ break;
274
+ }
275
+ if (folded) continue;
276
+ }
277
+ merged.push(message);
278
+ }
279
+ return merged;
280
+ }
281
+ function citationDedupeKeys(part) {
282
+ if (part.type !== "source-url" && part.type !== "source-document") return [];
283
+ const keys = [];
284
+ if (typeof part.sourceId === "string" && part.sourceId.length > 0) keys.push(`id:${part.sourceId}`);
285
+ if (typeof part.url === "string" && part.url.length > 0) keys.push(`url:${part.url}`);
286
+ return keys;
287
+ }
288
+ function foldRichPartsIntoMessages(messages, records, makeMessage, sameTurnGroup) {
289
+ if (messages.length === 0 || records.length === 0) return messages;
290
+ const messageTime = /* @__PURE__ */ __name2((m) => m.createdAt ? new Date(m.createdAt).getTime() : Number.NEGATIVE_INFINITY, "messageTime");
291
+ const finiteTimes = messages.map(messageTime).filter(Number.isFinite);
292
+ const oldest = finiteTimes.length > 0 ? Math.min(...finiteTimes) : Number.NEGATIVE_INFINITY;
293
+ const synthetic = [];
294
+ for (const record of records) {
295
+ const time = new Date(record.createdAt).getTime();
296
+ if (!Number.isFinite(time) || time < oldest) continue;
297
+ const content = transformChatHistoryContentParts(record.parts);
298
+ if (content.length === 0) continue;
299
+ synthetic.push({
300
+ time,
301
+ message: makeMessage({
302
+ id: `${RICH_PARTS_MESSAGE_ID_PREFIX}${record.threadId}:${record.messageId}`,
303
+ role: "assistant",
304
+ createdAt: new Date(time).toISOString(),
305
+ content
306
+ }, record)
307
+ });
308
+ }
309
+ if (synthetic.length === 0) return messages;
310
+ synthetic.sort((a, b) => a.time - b.time);
311
+ const combined = [];
312
+ let next = 0;
313
+ for (const message of messages) {
314
+ const time = messageTime(message);
315
+ while (next < synthetic.length && synthetic[next].time < time) {
316
+ combined.push(synthetic[next++].message);
317
+ }
318
+ combined.push(message);
319
+ }
320
+ while (next < synthetic.length) combined.push(synthetic[next++].message);
321
+ return mergeRichPartMirrorMessages(combined, sameTurnGroup);
322
+ }
148
323
  function buildDefaultPersona(agentName) {
149
324
  return DEFAULT_PERSONA_GUIDE.replace(AGENT_NAME_TOKEN, () => agentName || "My Agent");
150
325
  }
151
- var __defProp2, __name2, CHANNEL_SEND_CHANNELS, NON_INTERACTIVE_CHANNELS, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema;
326
+ var __defProp2, __name2, CHANNEL_SEND_CHANNELS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, REASONING_EFFORT_VALUES, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema;
152
327
  var init_dist = __esm({
153
328
  "../shared-types/dist/index.mjs"() {
154
329
  "use strict";
@@ -175,6 +350,24 @@ var init_dist = __esm({
175
350
  "instagram",
176
351
  "messenger"
177
352
  ];
353
+ REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST = [
354
+ "sendChannelMessage",
355
+ "sendWhatsappTemplate",
356
+ "sendEmail",
357
+ "sendWhatsappMessage",
358
+ "sendSms",
359
+ "sendWebchatMessage",
360
+ "sendTeamsMessage",
361
+ "sendInstagramMessage",
362
+ "sendMessengerMessage"
363
+ ];
364
+ __name(isAllowedReviewableExecuteTool, "isAllowedReviewableExecuteTool");
365
+ __name2(isAllowedReviewableExecuteTool, "isAllowedReviewableExecuteTool");
366
+ REVIEWABLE_MCP_SEND_TOOL_SUFFIX = "_create_messaging_message";
367
+ __name(isReviewableMcpSendTool, "isReviewableMcpSendTool");
368
+ __name2(isReviewableMcpSendTool, "isReviewableMcpSendTool");
369
+ __name(isReviewableExecuteTool, "isReviewableExecuteTool");
370
+ __name2(isReviewableExecuteTool, "isReviewableExecuteTool");
178
371
  NON_INTERACTIVE_CHANNELS = [
179
372
  "trigger",
180
373
  "agent-invocation"
@@ -187,6 +380,231 @@ var init_dist = __esm({
187
380
  __name2(removeNavigateBlock, "removeNavigateBlock");
188
381
  __name(transformChatHistoryContentParts, "transformChatHistoryContentParts");
189
382
  __name2(transformChatHistoryContentParts, "transformChatHistoryContentParts");
383
+ RICH_PARTS_MESSAGE_ID_PREFIX = "rich-parts:";
384
+ SCREENSHOT_MESSAGE_ID_PREFIX = "screenshot:";
385
+ __name(isSyntheticSideRow, "isSyntheticSideRow");
386
+ __name2(isSyntheticSideRow, "isSyntheticSideRow");
387
+ __name(mergeRichPartMirrorMessages, "mergeRichPartMirrorMessages");
388
+ __name2(mergeRichPartMirrorMessages, "mergeRichPartMirrorMessages");
389
+ __name(citationDedupeKeys, "citationDedupeKeys");
390
+ __name2(citationDedupeKeys, "citationDedupeKeys");
391
+ __name(foldRichPartsIntoMessages, "foldRichPartsIntoMessages");
392
+ __name2(foldRichPartsIntoMessages, "foldRichPartsIntoMessages");
393
+ BROWSER_COMMANDS = [
394
+ // health + lifecycle / navigation
395
+ {
396
+ name: "health",
397
+ description: "Check the local browser engine is installed and responsive."
398
+ },
399
+ {
400
+ name: "session_open",
401
+ description: "Open/attach a browser session (its own cookies/auth). Args: url?, headed?, profile?, confirmActions?."
402
+ },
403
+ {
404
+ name: "navigate",
405
+ description: "Navigate the session to a URL. Args: url, waitUntil?."
406
+ },
407
+ {
408
+ name: "back",
409
+ description: "Go back in history."
410
+ },
411
+ {
412
+ name: "forward",
413
+ description: "Go forward in history."
414
+ },
415
+ {
416
+ name: "reload",
417
+ description: "Reload the current page."
418
+ },
419
+ {
420
+ name: "pushstate",
421
+ description: "SPA client-side navigation. Args: url."
422
+ },
423
+ {
424
+ name: "close",
425
+ description: "Close the session\u2019s browser."
426
+ },
427
+ // perception
428
+ {
429
+ name: "snapshot",
430
+ description: "Accessibility-tree snapshot with element refs (@e1\u2026) \u2014 see what to click/fill. Args: interactiveOnly?, selector?, urls?, compact?, depth?."
431
+ },
432
+ {
433
+ name: "get",
434
+ description: "Read from the page. Args: what(text|html|value|attr|title|url|count|box|styles), selector?, attr?."
435
+ },
436
+ {
437
+ name: "is",
438
+ description: "Check element state. Args: check(visible|enabled|checked), selector."
439
+ },
440
+ // interaction
441
+ {
442
+ name: "click",
443
+ description: "Click an element. Args: selector(@eN or CSS), newTab?."
444
+ },
445
+ {
446
+ name: "dblclick",
447
+ description: "Double-click an element. Args: selector."
448
+ },
449
+ {
450
+ name: "fill",
451
+ description: "Clear and fill a field. Args: selector, text."
452
+ },
453
+ {
454
+ name: "type",
455
+ description: "Type into an element. Args: selector, text."
456
+ },
457
+ {
458
+ name: "press",
459
+ description: "Press a key/chord (Enter, Control+a). Args: key."
460
+ },
461
+ {
462
+ name: "hover",
463
+ description: "Hover an element. Args: selector."
464
+ },
465
+ {
466
+ name: "focus",
467
+ description: "Focus an element. Args: selector."
468
+ },
469
+ {
470
+ name: "select",
471
+ description: "Select a dropdown option. Args: selector, value."
472
+ },
473
+ {
474
+ name: "check",
475
+ description: "Check a checkbox. Args: selector."
476
+ },
477
+ {
478
+ name: "uncheck",
479
+ description: "Uncheck a checkbox. Args: selector."
480
+ },
481
+ {
482
+ name: "scroll",
483
+ description: "Scroll. Args: direction(up|down|left|right), px?, selector?."
484
+ },
485
+ {
486
+ name: "scrollintoview",
487
+ description: "Scroll an element into view. Args: selector."
488
+ },
489
+ {
490
+ name: "drag",
491
+ description: "Drag and drop. Args: source, target."
492
+ },
493
+ {
494
+ name: "upload",
495
+ description: "Upload local file(s) to a file input. Args: selector, files[]."
496
+ },
497
+ {
498
+ name: "find",
499
+ description: "Act by semantic locator. Args: by(role|text|label|placeholder|alt|title|testid), query, action(click|fill|type|hover|focus|check|uncheck|text), value?, name?, exact?."
500
+ },
501
+ // AI fallbacks
502
+ {
503
+ name: "act",
504
+ description: "Act on the page: ref+action (deterministic) or natural-language instruction (engine AI). Args: ref?, action?, value?, instruction?."
505
+ },
506
+ {
507
+ name: "extract",
508
+ description: "Extract data by natural-language instruction (engine AI). Args: instruction."
509
+ },
510
+ // wait
511
+ {
512
+ name: "wait",
513
+ description: "Wait for a condition. Provide one of: selector(+state), ms, text, url, load, fn."
514
+ },
515
+ // tabs / frames
516
+ {
517
+ name: "tab",
518
+ description: "Manage tabs. Args: action(list|new|switch|close), target?, url?, label?."
519
+ },
520
+ {
521
+ name: "window_new",
522
+ description: "Open a new browser window. Args: url?."
523
+ },
524
+ {
525
+ name: "frame",
526
+ description: 'Switch frame context. Args: target(@eN | CSS | "main").'
527
+ },
528
+ // capture
529
+ {
530
+ name: "screenshot",
531
+ description: "Screenshot the page. Args: fullPage?, path?."
532
+ },
533
+ {
534
+ name: "pdf",
535
+ description: "Save the page as PDF. Args: path."
536
+ },
537
+ // state
538
+ {
539
+ name: "cookies",
540
+ description: "Manage cookies. Args: action(get|set|clear), name?, value?."
541
+ },
542
+ {
543
+ name: "storage",
544
+ description: "Manage web storage. Args: area(local|session), action(get|set|clear), key?, value?."
545
+ },
546
+ {
547
+ name: "set",
548
+ description: "Configure the browser. Args: setting(viewport|device|geo|headers|credentials|media), args[]."
549
+ },
550
+ // files / clipboard
551
+ {
552
+ name: "download",
553
+ description: "Download a file (click a selector to trigger, or wait for one). Args: selector?, path?."
554
+ },
555
+ {
556
+ name: "clipboard",
557
+ description: "Clipboard. Args: action(read|write|copy|paste), text?."
558
+ },
559
+ // auth (use-only)
560
+ {
561
+ name: "auth",
562
+ description: "Use a saved login profile. Args: action(login|list|show), name?. (Credentials are saved via the desktop, never the agent.)"
563
+ },
564
+ // confirmation gate
565
+ {
566
+ name: "confirm",
567
+ description: "Approve a pending confirmation_required action. Args: id."
568
+ },
569
+ {
570
+ name: "deny",
571
+ description: "Reject a pending confirmation_required action. Args: id."
572
+ },
573
+ // network / debug / input / state-files
574
+ {
575
+ name: "network",
576
+ description: "Inspect/control network. Args: action(route|unroute|requests|har) + relevant fields."
577
+ },
578
+ {
579
+ name: "console",
580
+ description: "View browser console messages. Args: clear?."
581
+ },
582
+ {
583
+ name: "errors",
584
+ description: "View uncaught page JS errors. Args: clear?."
585
+ },
586
+ {
587
+ name: "mouse",
588
+ description: "Low-level mouse. Args: action(move|down|up|wheel), x?, y?, button?, dy?, dx?."
589
+ },
590
+ {
591
+ name: "keyboard",
592
+ description: "Low-level keyboard at focus. Args: action(type|inserttext|keydown|keyup), text?, key?."
593
+ },
594
+ {
595
+ name: "state",
596
+ description: "Persist/restore storage+auth state to a file. Args: action(save|load|list|clear), path?."
597
+ }
598
+ ];
599
+ BROWSER_COMMAND_NAMES = BROWSER_COMMANDS.map((c) => c.name);
600
+ REASONING_EFFORT_VALUES = [
601
+ "off",
602
+ "minimal",
603
+ "low",
604
+ "medium",
605
+ "high",
606
+ "max"
607
+ ];
190
608
  AGENT_NAME_TOKEN = "[Your Agent Name]";
191
609
  DEFAULT_PERSONA_GUIDE = `# ${AGENT_NAME_TOKEN} - Persona
192
610
 
@@ -1764,7 +2182,8 @@ var init_skill_handler = __esm({
1764
2182
  const response = await api.publishSkillVersion(entityId, version);
1765
2183
  return {
1766
2184
  success: response.success,
1767
- error: response.error?.message
2185
+ error: response.error?.message,
2186
+ agentVersion: response.data?.agentVersion
1768
2187
  };
1769
2188
  }
1770
2189
  prepareForPush(manifest, name, projectPath = process.cwd(), bundleAccumulator) {
@@ -4644,6 +5063,9 @@ var init_agents_api_service = __esm({
4644
5063
  } : {},
4645
5064
  ...body.webhookPayload !== void 0 ? {
4646
5065
  webhookPayload: body.webhookPayload
5066
+ } : {},
5067
+ ...body.clientContext !== void 0 ? {
5068
+ clientContext: body.clientContext
4647
5069
  } : {}
4648
5070
  };
4649
5071
  }
@@ -5095,6 +5517,12 @@ var init_channels_send_api_service = __esm({
5095
5517
  Authorization: `Bearer ${this.apiKey}`
5096
5518
  });
5097
5519
  }
5520
+ /** POST /developer/agents/:agentId/channels/whatsapp/reaction */
5521
+ async sendWhatsAppReaction(input) {
5522
+ return this.httpPost(`/developer/agents/${this.agentId}/channels/whatsapp/reaction`, input, {
5523
+ Authorization: `Bearer ${this.apiKey}`
5524
+ });
5525
+ }
5098
5526
  /** POST /developer/agents/:agentId/channels/email/send */
5099
5527
  async sendEmail(input) {
5100
5528
  return this.httpPost(`/developer/agents/${this.agentId}/channels/email/send`, input, {
@@ -5126,6 +5554,17 @@ var init_channels_send_api_service = __esm({
5126
5554
  }
5127
5555
  return result.data;
5128
5556
  }
5557
+ /** Sandbox helper for WhatsApp reaction sends. */
5558
+ async sendWhatsAppReactionForSandbox(input) {
5559
+ const result = await this.sendWhatsAppReaction(input);
5560
+ if (!result.success) {
5561
+ throw new Error(result.error?.message || "WhatsApp reaction send failed");
5562
+ }
5563
+ if (!result.data) {
5564
+ throw new Error("WhatsApp reaction send failed: empty response");
5565
+ }
5566
+ return result.data;
5567
+ }
5129
5568
  /** Sandbox helper for email sends. */
5130
5569
  async sendEmailForSandbox(input) {
5131
5570
  const result = await this.sendEmail(input);
@@ -5141,6 +5580,44 @@ var init_channels_send_api_service = __esm({
5141
5580
  }
5142
5581
  });
5143
5582
 
5583
+ // src/api/directory.api.service.ts
5584
+ var DirectoryApiService;
5585
+ var init_directory_api_service = __esm({
5586
+ "src/api/directory.api.service.ts"() {
5587
+ "use strict";
5588
+ init_http_client();
5589
+ DirectoryApiService = class extends HttpClient {
5590
+ static {
5591
+ __name(this, "DirectoryApiService");
5592
+ }
5593
+ apiKey;
5594
+ agentId;
5595
+ constructor(baseUrl, apiKey, agentId) {
5596
+ super(baseUrl), this.apiKey = apiKey, this.agentId = agentId;
5597
+ }
5598
+ /** POST /developer/agents/:agentId/directory/resolve */
5599
+ async resolve(name) {
5600
+ return this.httpPost(`/developer/agents/${this.agentId}/directory/resolve`, {
5601
+ name
5602
+ }, {
5603
+ Authorization: `Bearer ${this.apiKey}`
5604
+ });
5605
+ }
5606
+ /** Sandbox helper: throws on non-success, returns unwrapped result. */
5607
+ async resolveForSandbox(name) {
5608
+ const result = await this.resolve(name);
5609
+ if (!result.success) {
5610
+ throw new Error(result.error?.message || "Directory resolve failed");
5611
+ }
5612
+ if (!result.data) {
5613
+ throw new Error("Directory resolve failed: empty response");
5614
+ }
5615
+ return result.data;
5616
+ }
5617
+ };
5618
+ }
5619
+ });
5620
+
5144
5621
  // src/api/device.api.service.ts
5145
5622
  var device_api_service_exports = {};
5146
5623
  __export(device_api_service_exports, {
@@ -5237,6 +5714,7 @@ __export(lazy_instances_exports, {
5237
5714
  getDataInstance: () => getDataInstance,
5238
5715
  getDeveloperInstance: () => getDeveloperInstance,
5239
5716
  getDeviceInstance: () => getDeviceInstance,
5717
+ getDirectoryInstance: () => getDirectoryInstance,
5240
5718
  getJobInstance: () => getJobInstance,
5241
5719
  getOrderInstance: () => getOrderInstance,
5242
5720
  getProductsInstance: () => getProductsInstance,
@@ -5351,6 +5829,13 @@ async function getChannelsSendInstance() {
5351
5829
  }
5352
5830
  return _channelsSendInstance;
5353
5831
  }
5832
+ async function getDirectoryInstance() {
5833
+ if (!_directoryInstance) {
5834
+ const creds = await getCredentials();
5835
+ _directoryInstance = new DirectoryApiService(BASE_URLS.API, creds.apiKey, creds.agentId);
5836
+ }
5837
+ return _directoryInstance;
5838
+ }
5354
5839
  function clearAllInstances() {
5355
5840
  _userInstance = null;
5356
5841
  _dataInstance = null;
@@ -5366,8 +5851,9 @@ function clearAllInstances() {
5366
5851
  _developerInstance = null;
5367
5852
  _voiceInstance = null;
5368
5853
  _channelsSendInstance = null;
5854
+ _directoryInstance = null;
5369
5855
  }
5370
- var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _deviceInstance;
5856
+ var _userInstance, _dataInstance, _productsInstance, _basketsInstance, _orderInstance, _webhookInstance, _jobInstance, _aiInstance, _agentsInstance, _whatsAppTemplatesInstance, _cdnInstance, _developerInstance, _voiceInstance, _channelsSendInstance, _directoryInstance, _deviceInstance;
5371
5857
  var init_lazy_instances = __esm({
5372
5858
  "src/api/lazy-instances.ts"() {
5373
5859
  "use strict";
@@ -5387,6 +5873,7 @@ var init_lazy_instances = __esm({
5387
5873
  init_developer_api_service();
5388
5874
  init_voice_api_service();
5389
5875
  init_channels_send_api_service();
5876
+ init_directory_api_service();
5390
5877
  _userInstance = null;
5391
5878
  _dataInstance = null;
5392
5879
  _productsInstance = null;
@@ -5401,6 +5888,7 @@ var init_lazy_instances = __esm({
5401
5888
  _developerInstance = null;
5402
5889
  _voiceInstance = null;
5403
5890
  _channelsSendInstance = null;
5891
+ _directoryInstance = null;
5404
5892
  __name(getUserInstance, "getUserInstance");
5405
5893
  __name(getDataInstance, "getDataInstance");
5406
5894
  __name(getProductsInstance, "getProductsInstance");
@@ -5417,6 +5905,7 @@ var init_lazy_instances = __esm({
5417
5905
  __name(getDeveloperInstance, "getDeveloperInstance");
5418
5906
  __name(getVoiceInstance, "getVoiceInstance");
5419
5907
  __name(getChannelsSendInstance, "getChannelsSendInstance");
5908
+ __name(getDirectoryInstance, "getDirectoryInstance");
5420
5909
  __name(clearAllInstances, "clearAllInstances");
5421
5910
  }
5422
5911
  });
@@ -5435,6 +5924,7 @@ function assertValidToolName(name) {
5435
5924
  __name(assertValidToolName, "assertValidToolName");
5436
5925
 
5437
5926
  // src/types/skill.ts
5927
+ init_dist();
5438
5928
  var env = /* @__PURE__ */ __name((key) => {
5439
5929
  if (process.env[key]) {
5440
5930
  return process.env[key];
@@ -5879,6 +6369,18 @@ function validateModelSettings(settings) {
5879
6369
  throw new Error("Agent modelSettings.stopSequences must be a string array");
5880
6370
  }
5881
6371
  }
6372
+ if (settings.reasoning !== void 0) {
6373
+ if (typeof settings.reasoning !== "object" || settings.reasoning === null || Array.isArray(settings.reasoning)) {
6374
+ throw new Error("Agent modelSettings.reasoning must be an object");
6375
+ }
6376
+ const { effort, show } = settings.reasoning;
6377
+ if (effort !== void 0 && !REASONING_EFFORT_VALUES.includes(effort)) {
6378
+ throw new Error(`Agent modelSettings.reasoning.effort must be one of: ${REASONING_EFFORT_VALUES.join(", ")}`);
6379
+ }
6380
+ if (show !== void 0 && typeof show !== "boolean") {
6381
+ throw new Error("Agent modelSettings.reasoning.show must be a boolean");
6382
+ }
6383
+ }
5882
6384
  }
5883
6385
  __name(validateModelSettings, "validateModelSettings");
5884
6386
  var LuaAgent = class {
@@ -5901,6 +6403,7 @@ var LuaAgent = class {
5901
6403
  voices;
5902
6404
  batching;
5903
6405
  governance;
6406
+ browser;
5904
6407
  /**
5905
6408
  * Creates a new LuaAgent instance.
5906
6409
  *
@@ -5942,10 +6445,15 @@ var LuaAgent = class {
5942
6445
  this.voices = config.voices;
5943
6446
  this.batching = config.batching;
5944
6447
  this.governance = config.governance;
6448
+ this.browser = config.browser;
5945
6449
  }
5946
6450
  getName() {
5947
6451
  return this.name;
5948
6452
  }
6453
+ /** Browser switch (LuaBrowser) — `true`/config when the agent can browse. */
6454
+ getBrowser() {
6455
+ return this.browser;
6456
+ }
5949
6457
  getPersona() {
5950
6458
  return this.persona;
5951
6459
  }
@@ -6603,6 +7111,11 @@ var Channels = {
6603
7111
  const { getChannelsSendInstance: getChannelsSendInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
6604
7112
  const channels = await getChannelsSendInstance2();
6605
7113
  return channels.sendWhatsAppTemplateForSandbox(input);
7114
+ },
7115
+ async sendReaction(input) {
7116
+ const { getChannelsSendInstance: getChannelsSendInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
7117
+ const channels = await getChannelsSendInstance2();
7118
+ return channels.sendWhatsAppReactionForSandbox(input);
6606
7119
  }
6607
7120
  },
6608
7121
  email: {
@@ -6613,6 +7126,13 @@ var Channels = {
6613
7126
  }
6614
7127
  }
6615
7128
  };
7129
+ var Team = {
7130
+ async findMember(name) {
7131
+ const { getDirectoryInstance: getDirectoryInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
7132
+ const directory = await getDirectoryInstance2();
7133
+ return directory.resolveForSandbox(name);
7134
+ }
7135
+ };
6616
7136
  var Templates = {
6617
7137
  /**
6618
7138
  * WhatsApp Templates
@@ -6781,6 +7301,7 @@ export {
6781
7301
  PreProcessor,
6782
7302
  ProductInstance,
6783
7303
  Products,
7304
+ Team,
6784
7305
  Templates,
6785
7306
  ToolFlag,
6786
7307
  User,