@lobu/runtime-device 24.1.1 → 24.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.
- package/dist/component.json +1 -1
- package/dist/dependencies.bun.lock +26 -28
- package/npm-shrinkwrap.json +155 -172
- package/package.json +1 -1
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +14 -5
- package/vendor/cli/dist/chrome-extension/accessibility-tree.js +834 -0
- package/vendor/cli/dist/chrome-extension/ambient-context.js +53 -0
- package/vendor/cli/dist/chrome-extension/auth-refresh.js +167 -0
- package/vendor/cli/dist/chrome-extension/automation-run.js +13 -0
- package/vendor/cli/dist/chrome-extension/background.js +1155 -0
- package/vendor/cli/dist/chrome-extension/bridge.js +140 -0
- package/vendor/cli/dist/chrome-extension/browser-origin-policy.js +62 -0
- package/vendor/cli/dist/chrome-extension/browser-recovery.js +260 -0
- package/vendor/cli/dist/chrome-extension/browser-url-sanitizer.js +284 -0
- package/vendor/cli/dist/chrome-extension/completion-response.js +12 -0
- package/vendor/cli/dist/chrome-extension/config.js +144 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome.json +1516 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_bookmarks.json +84 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_downloads.json +86 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_history.json +78 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests.js +1767 -0
- package/vendor/cli/dist/chrome-extension/console-capture.js +627 -0
- package/vendor/cli/dist/chrome-extension/control-activity.js +70 -0
- package/vendor/cli/dist/chrome-extension/debugger-lease.js +439 -0
- package/vendor/cli/dist/chrome-extension/feed-listener.js +488 -0
- package/vendor/cli/dist/chrome-extension/feed-transaction.js +48 -0
- package/vendor/cli/dist/chrome-extension/feeds.js +632 -0
- package/vendor/cli/dist/chrome-extension/focus-tab.js +25 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-mono-latin-500-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-sans-latin-400-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-sans-latin-600-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/heartbeat.js +140 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-128-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-128.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-16-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-16.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-32-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-32.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-48-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-48.png +0 -0
- package/vendor/cli/dist/chrome-extension/lens-page.js +135 -0
- package/vendor/cli/dist/chrome-extension/lens-target.js +20 -0
- package/vendor/cli/dist/chrome-extension/manifest.json +76 -0
- package/vendor/cli/dist/chrome-extension/network-intercept.js +657 -0
- package/vendor/cli/dist/chrome-extension/page-activation.js +120 -0
- package/vendor/cli/dist/chrome-extension/page-dialogs.js +125 -0
- package/vendor/cli/dist/chrome-extension/page-url.js +11 -0
- package/vendor/cli/dist/chrome-extension/panel-session.js +184 -0
- package/vendor/cli/dist/chrome-extension/poll-auth.js +85 -0
- package/vendor/cli/dist/chrome-extension/poll-backoff.js +22 -0
- package/vendor/cli/dist/chrome-extension/run-fence.js +117 -0
- package/vendor/cli/dist/chrome-extension/setup-status.js +71 -0
- package/vendor/cli/dist/chrome-extension/side-panel-action-click.js +65 -0
- package/vendor/cli/dist/chrome-extension/sidepanel-context.js +50 -0
- package/vendor/cli/dist/chrome-extension/sidepanel.html +680 -0
- package/vendor/cli/dist/chrome-extension/sidepanel.js +1643 -0
- package/vendor/cli/dist/chrome-extension/tab-labels.js +233 -0
- package/vendor/cli/dist/chrome-extension/tools.js +3354 -0
- package/vendor/cli/dist/chrome-extension/watch-observer.js +354 -0
- package/vendor/cli/dist/chrome-extension/watch-redact.js +96 -0
- package/vendor/cli/dist/chrome-extension/watch.js +348 -0
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +6 -4
- package/vendor/cli/dist/commands/_lib/apply/desired-state.js +5 -3
- package/vendor/cli/dist/commands/_lib/apply/diff.js +4 -3
- package/vendor/cli/dist/commands/_lib/chrome-for-testing.d.ts +13 -0
- package/vendor/cli/dist/commands/_lib/chrome-for-testing.js +226 -0
- package/vendor/cli/dist/commands/_lib/device-credential.d.ts +34 -0
- package/vendor/cli/dist/commands/_lib/device-credential.js +157 -0
- package/vendor/cli/dist/commands/_lib/device-wizard.d.ts +17 -0
- package/vendor/cli/dist/commands/_lib/device-wizard.js +11 -2
- package/vendor/cli/dist/commands/_lib/native-messaging.d.ts +7 -0
- package/vendor/cli/dist/commands/_lib/native-messaging.js +40 -0
- package/vendor/cli/dist/commands/browser.d.ts +23 -0
- package/vendor/cli/dist/commands/browser.js +492 -0
- package/vendor/cli/dist/commands/call.d.ts +12 -0
- package/vendor/cli/dist/commands/call.js +48 -26
- package/vendor/cli/dist/commands/context.d.ts +3 -1
- package/vendor/cli/dist/commands/context.js +13 -2
- package/vendor/cli/dist/commands/daemon.js +2 -152
- package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +4 -1
- package/vendor/cli/dist/commands/memory/_lib/errors.js +9 -1
- package/vendor/cli/dist/commands/memory/_lib/mcp.d.ts +0 -9
- package/vendor/cli/dist/commands/memory/_lib/mcp.js +1 -23
- package/vendor/cli/dist/commands/memory/_lib/memory-auth.d.ts +20 -4
- package/vendor/cli/dist/commands/memory/_lib/memory-auth.js +21 -17
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +6 -17
- package/vendor/cli/dist/commands/memory/run.js +4 -25
- package/vendor/cli/dist/connectors/google_gmail.ts +70 -41
- package/vendor/cli/dist/connectors/google_gmail_references.ts +406 -0
- package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +107 -36
- package/vendor/cli/dist/connectors/linkedin-inbox.ts +13 -0
- package/vendor/cli/dist/connectors/linkedin.ts +1 -1
- package/vendor/cli/dist/connectors/postgres.ts +5 -3
- package/vendor/cli/dist/connectors/reddit.ts +171 -5
- package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +147 -61
- package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +6 -2
- package/vendor/cli/dist/connectors/whatsapp_web.ts +48 -17
- package/vendor/cli/dist/connectors/x-dm-adapter.js +252 -35
- package/vendor/cli/dist/connectors/x.ts +189 -13
- package/vendor/cli/dist/index.js +46 -6
- package/vendor/cli/dist/internal/device-state.d.ts +2 -0
- package/vendor/cli/dist/internal/device-state.js +4 -0
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/dist/templates/AGENTS.md.tmpl +3 -1
- package/vendor/cli/dist/templates/TESTING.md.tmpl +8 -8
- package/vendor/cli/package.json +1 -1
- package/vendor/connector-sdk/dist/browser-requirement.js +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +5 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/agent-turn/gateway-tools.d.ts +9 -0
- package/vendor/connector-worker/dist/agent-turn/gateway-tools.js +23 -2
- package/vendor/connector-worker/dist/agent-turn/guest-entry.js +14 -6
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +62 -25
- package/vendor/connector-worker/dist/agent-turn/media-tools.d.ts +1 -0
- package/vendor/connector-worker/dist/agent-turn/media-tools.js +5 -2
- package/vendor/connector-worker/dist/bin.js +2 -0
- package/vendor/connector-worker/dist/daemon/agent-turn.js +52 -17
- package/vendor/connector-worker/dist/daemon/automation.js +2 -12
- package/vendor/connector-worker/dist/daemon/client.d.ts +8 -2
- package/vendor/connector-worker/dist/daemon/client.js +8 -1
- package/vendor/connector-worker/dist/daemon/interactive-session.js +29 -6
- package/vendor/connector-worker/dist/daemon/poll-loop.js +23 -1
- package/vendor/connector-worker/dist/daemon/terminal-delivery.d.ts +5 -10
- package/vendor/connector-worker/dist/daemon/terminal-delivery.js +55 -23
- package/vendor/connector-worker/dist/daemon/terminal-failure.js +2 -2
- package/vendor/connector-worker/dist/executor/isolate.js +3 -0
- package/vendor/connector-worker/package.json +1 -1
- package/vendor/core/dist/agent-tooling.d.ts +8 -0
- package/vendor/core/dist/agent-tooling.js +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +5 -0
- package/vendor/core/dist/contracts/entity-reference.d.ts +3 -0
- package/vendor/core/dist/contracts/entity-reference.js +31 -0
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +113 -34
- package/vendor/core/dist/contracts/tools/manage-entity.js +41 -14
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
- package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
- package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
- package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
- package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
- package/vendor/core/dist/contracts/worker/protocol.js +20 -0
- package/vendor/core/dist/reserved.d.ts +6 -3
- package/vendor/core/dist/reserved.js +6 -3
- package/vendor/core/dist/worker/auth.d.ts +3 -2
- package/vendor/core/package.json +6 -1
- package/vendor/postgres/cf/src/query.js +3 -1
- package/vendor/postgres/cjs/src/query.js +3 -1
- package/vendor/postgres/src/query.js +3 -1
- /package/vendor/postgres/{.bun-tag-2f292c6554a8475e → .bun-tag-22d644c2873790db} +0 -0
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - live_messages: DMs read live from the signed-in browser without importing
|
|
24
24
|
* history; Automations subscribe to `message.created` and can
|
|
25
25
|
* answer through `send_message`
|
|
26
|
+
* - notifications: signed-in All timeline; metadata-only sync, explicit source reads
|
|
26
27
|
* - following_timeline: live chronological Following timeline (OAuth API,
|
|
27
28
|
* source reads only; does not import tweet events)
|
|
28
29
|
* - home_feed: personalized x.com home timeline (extension only — the
|
|
@@ -3146,19 +3147,32 @@ async function readyXLiveTab(
|
|
|
3146
3147
|
return nav.tab_id;
|
|
3147
3148
|
}
|
|
3148
3149
|
|
|
3150
|
+
/** Bind source access to the account saved by the connection's browser probe. */
|
|
3151
|
+
function requireXAccount(ctx: {
|
|
3152
|
+
sessionState?: Record<string, unknown> | null;
|
|
3153
|
+
}): string {
|
|
3154
|
+
const account = ctx.sessionState?.account_id;
|
|
3155
|
+
if (typeof account !== "string" || !/^[0-9]{1,20}$/.test(account))
|
|
3156
|
+
throw new Error(
|
|
3157
|
+
"X saved account identity is unavailable; reconnect this connection",
|
|
3158
|
+
);
|
|
3159
|
+
return account;
|
|
3160
|
+
}
|
|
3161
|
+
|
|
3149
3162
|
/** One call into the page program, installing it first when absent or stale. */
|
|
3150
3163
|
async function invokeXDirectMessages<T>(
|
|
3151
3164
|
dispatcher: ChromeActionDispatcher,
|
|
3152
3165
|
tabId: number,
|
|
3153
|
-
op: "read" | "listen" | "send",
|
|
3166
|
+
op: "read" | "listen" | "send" | "readNotifications",
|
|
3154
3167
|
input: Record<string, unknown>,
|
|
3168
|
+
accountId: string,
|
|
3155
3169
|
): Promise<T> {
|
|
3156
3170
|
const result = await dispatcher.dispatch<{
|
|
3157
3171
|
value?: T;
|
|
3158
3172
|
exception?: { description?: string } | unknown;
|
|
3159
3173
|
}>("evaluate", {
|
|
3160
3174
|
tab_id: tabId,
|
|
3161
|
-
expression: `(() => { (${xDirectMessagesProgram.toString()})(); return globalThis.__lobuXDirectMessagesV1.${op}(${xScriptArgument(input)}); })()`,
|
|
3175
|
+
expression: `(() => { (${xDirectMessagesProgram.toString()})(); return globalThis.__lobuXDirectMessagesV1.${op}(${xScriptArgument({ ...input, account_id: accountId })}); })()`,
|
|
3162
3176
|
await_promise: true,
|
|
3163
3177
|
});
|
|
3164
3178
|
if (result.exception || !result.value) {
|
|
@@ -3184,16 +3198,23 @@ async function readXLiveMessages(
|
|
|
3184
3198
|
assertNoWindow(ctx, message);
|
|
3185
3199
|
assertNoMatch(ctx, message);
|
|
3186
3200
|
const dispatcher = requireXBrowser(ctx);
|
|
3201
|
+
const accountId = requireXAccount(ctx);
|
|
3187
3202
|
const tabId = await readyXLiveTab(dispatcher);
|
|
3188
3203
|
const page = await invokeXDirectMessages<{
|
|
3189
3204
|
rows: Array<Record<string, unknown>>;
|
|
3190
3205
|
nextCursor?: string;
|
|
3191
3206
|
hasMore: boolean;
|
|
3192
|
-
}>(
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3207
|
+
}>(
|
|
3208
|
+
dispatcher,
|
|
3209
|
+
tabId,
|
|
3210
|
+
"read",
|
|
3211
|
+
{
|
|
3212
|
+
query: ctx.query,
|
|
3213
|
+
cursor: ctx.cursor,
|
|
3214
|
+
limit: ctx.limit,
|
|
3215
|
+
},
|
|
3216
|
+
accountId,
|
|
3217
|
+
);
|
|
3197
3218
|
return {
|
|
3198
3219
|
rows: page.rows,
|
|
3199
3220
|
columns: X_LIVE_MESSAGE_COLUMNS,
|
|
@@ -3209,6 +3230,7 @@ async function readXLiveMessages(
|
|
|
3209
3230
|
*/
|
|
3210
3231
|
async function observeXLiveMessages(ctx: FeedObserveContext): Promise<void> {
|
|
3211
3232
|
const dispatcher = requireXBrowser(ctx);
|
|
3233
|
+
const accountId = requireXAccount(ctx);
|
|
3212
3234
|
const tabId = await readyXLiveTab(dispatcher);
|
|
3213
3235
|
const binding = await dispatcher.dispatch<{
|
|
3214
3236
|
bridge_id?: string;
|
|
@@ -3224,11 +3246,148 @@ async function observeXLiveMessages(ctx: FeedObserveContext): Promise<void> {
|
|
|
3224
3246
|
) {
|
|
3225
3247
|
throw new Error("The paired browser must support source subscriptions");
|
|
3226
3248
|
}
|
|
3227
|
-
await invokeXDirectMessages(
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3249
|
+
await invokeXDirectMessages(
|
|
3250
|
+
dispatcher,
|
|
3251
|
+
tabId,
|
|
3252
|
+
"listen",
|
|
3253
|
+
{
|
|
3254
|
+
checkpoint: ctx.checkpoint ?? null,
|
|
3255
|
+
bridge_id: binding.bridge_id,
|
|
3256
|
+
token: binding.token,
|
|
3257
|
+
},
|
|
3258
|
+
accountId,
|
|
3259
|
+
);
|
|
3260
|
+
}
|
|
3261
|
+
|
|
3262
|
+
async function readXNotifications(
|
|
3263
|
+
ctx: FeedReadContext,
|
|
3264
|
+
): Promise<FeedReadResult> {
|
|
3265
|
+
const message =
|
|
3266
|
+
"X notifications support source cursor pagination only; queries, windows, offsets, matching and sorting are unsupported";
|
|
3267
|
+
assertNoOffsetPaging(ctx, message);
|
|
3268
|
+
assertNoSort(ctx, message);
|
|
3269
|
+
assertNoWindow(ctx, message);
|
|
3270
|
+
assertNoMatch(ctx, message);
|
|
3271
|
+
if (ctx.query) throw new Error(message);
|
|
3272
|
+
const browser = requireXBrowser(ctx);
|
|
3273
|
+
const accountId = requireXAccount(ctx);
|
|
3274
|
+
const result = await invokeXDirectMessages<FeedReadResult>(
|
|
3275
|
+
browser,
|
|
3276
|
+
await readyXLiveTab(browser),
|
|
3277
|
+
"readNotifications",
|
|
3278
|
+
{ cursor: ctx.cursor, limit: ctx.limit },
|
|
3279
|
+
accountId,
|
|
3280
|
+
);
|
|
3281
|
+
return {
|
|
3282
|
+
rows: result.rows,
|
|
3283
|
+
nextCursor: result.nextCursor,
|
|
3284
|
+
hasMore: result.hasMore,
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
async function syncXNotifications(ctx: SyncContext): Promise<SyncResult> {
|
|
3289
|
+
const browser = requireXBrowser(ctx);
|
|
3290
|
+
const accountId = requireXAccount(ctx);
|
|
3291
|
+
if (
|
|
3292
|
+
ctx.checkpoint?.notifications_account &&
|
|
3293
|
+
ctx.checkpoint.notifications_account !== accountId
|
|
3294
|
+
)
|
|
3295
|
+
throw new Error("X notification checkpoint belongs to another account");
|
|
3296
|
+
const tab = await readyXLiveTab(browser);
|
|
3297
|
+
const saved = ctx.checkpoint?.notifications_cursor as
|
|
3298
|
+
| string
|
|
3299
|
+
| null
|
|
3300
|
+
| undefined;
|
|
3301
|
+
const previousHead = ctx.checkpoint?.notifications_head_revision;
|
|
3302
|
+
let head: string | undefined;
|
|
3303
|
+
let catchingUp = !!saved;
|
|
3304
|
+
let cursor: string | undefined;
|
|
3305
|
+
let account: string | undefined;
|
|
3306
|
+
let cursorReset = false;
|
|
3307
|
+
const seenCursors = new Set<string>();
|
|
3308
|
+
const seenItems = new Set<string>();
|
|
3309
|
+
const events: EventEnvelope[] = [];
|
|
3310
|
+
for (let page = 0; page < 10; page++) {
|
|
3311
|
+
if (cursor) seenCursors.add(cursor);
|
|
3312
|
+
const result = await invokeXDirectMessages<
|
|
3313
|
+
FeedReadResult & { account_id: string; expired?: boolean }
|
|
3314
|
+
>(
|
|
3315
|
+
browser,
|
|
3316
|
+
tab,
|
|
3317
|
+
"readNotifications",
|
|
3318
|
+
{
|
|
3319
|
+
cursor,
|
|
3320
|
+
limit: 100,
|
|
3321
|
+
restartExpired: !cursorReset,
|
|
3322
|
+
metadataOnly: true,
|
|
3323
|
+
},
|
|
3324
|
+
accountId,
|
|
3325
|
+
);
|
|
3326
|
+
account = result.account_id;
|
|
3327
|
+
if (
|
|
3328
|
+
ctx.checkpoint?.notifications_account &&
|
|
3329
|
+
ctx.checkpoint.notifications_account !== account
|
|
3330
|
+
)
|
|
3331
|
+
throw new Error("X notification checkpoint belongs to another account");
|
|
3332
|
+
if (result.expired) {
|
|
3333
|
+
if (page === 9)
|
|
3334
|
+
throw new Error(
|
|
3335
|
+
"X notification cursor restart exceeds the page budget; retry without committing",
|
|
3336
|
+
);
|
|
3337
|
+
cursorReset = true;
|
|
3338
|
+
cursor = undefined;
|
|
3339
|
+
seenCursors.clear();
|
|
3340
|
+
continue;
|
|
3341
|
+
}
|
|
3342
|
+
head ??= result.rows[0]?.revision as string | undefined;
|
|
3343
|
+
for (const row of result.rows) {
|
|
3344
|
+
if (seenItems.has(String(row.id))) continue;
|
|
3345
|
+
seenItems.add(String(row.id));
|
|
3346
|
+
events.push({
|
|
3347
|
+
origin_id: `x_notification_${row.id}`,
|
|
3348
|
+
origin_type: "notification",
|
|
3349
|
+
payload_text: "",
|
|
3350
|
+
title: "X notification reference",
|
|
3351
|
+
source_url: String(row.url),
|
|
3352
|
+
occurred_at: new Date(String(row.occurred_at)),
|
|
3353
|
+
metadata: {
|
|
3354
|
+
account_id: row.account_id,
|
|
3355
|
+
entry_id: row.entry_id,
|
|
3356
|
+
notification_id: row.notification_id,
|
|
3357
|
+
kind: row.kind,
|
|
3358
|
+
actor_ids: row.actor_ids,
|
|
3359
|
+
tweet_ids: row.tweet_ids,
|
|
3360
|
+
revision: row.revision,
|
|
3361
|
+
timestamp_basis: row.timestamp_basis,
|
|
3362
|
+
},
|
|
3363
|
+
});
|
|
3364
|
+
}
|
|
3365
|
+
cursor = result.nextCursor;
|
|
3366
|
+
// Do not skip arrivals spanning multiple pages before resuming history.
|
|
3367
|
+
// A missing head boundary falls back to a full sweep from this position.
|
|
3368
|
+
if (
|
|
3369
|
+
catchingUp &&
|
|
3370
|
+
result.rows.some((row) => row.revision === previousHead)
|
|
3371
|
+
) {
|
|
3372
|
+
catchingUp = false;
|
|
3373
|
+
if (cursor && saved) cursor = saved;
|
|
3374
|
+
}
|
|
3375
|
+
if (!cursor) break;
|
|
3376
|
+
if (seenCursors.has(cursor))
|
|
3377
|
+
throw new Error("X notification cursor did not advance");
|
|
3378
|
+
}
|
|
3379
|
+
await ctx.commit(events, {
|
|
3380
|
+
notifications_cursor: cursor ?? null,
|
|
3381
|
+
notifications_account: account,
|
|
3382
|
+
notifications_head_revision: head ?? null,
|
|
3231
3383
|
});
|
|
3384
|
+
return {
|
|
3385
|
+
status: cursor ? "more" : "complete",
|
|
3386
|
+
metadata: {
|
|
3387
|
+
items_found: events.length,
|
|
3388
|
+
...(cursorReset ? { cursor_reset: true } : {}),
|
|
3389
|
+
},
|
|
3390
|
+
};
|
|
3232
3391
|
}
|
|
3233
3392
|
|
|
3234
3393
|
// ── Connector ──────────────────────────────────────────────────
|
|
@@ -3238,8 +3397,8 @@ export default class XConnector extends ConnectorRuntime {
|
|
|
3238
3397
|
key: "x",
|
|
3239
3398
|
name: "X (Twitter)",
|
|
3240
3399
|
description:
|
|
3241
|
-
"Fetches tweets, browser-visible like history, bookmarks, and DMs through the X API v2 or the paired Owletto Chrome extension, reads the chronological Following timeline live through the X API, and reads and answers DMs live in the paired browser. Links social actors into the person graph.",
|
|
3242
|
-
version: "3.
|
|
3400
|
+
"Fetches tweets, browser-visible like history, bookmarks, and DMs through the X API v2 or the paired Owletto Chrome extension, reads the chronological Following timeline live through the X API, captures notification references, and reads and answers DMs live in the paired browser. Links social actors into the person graph.",
|
|
3401
|
+
version: "3.16.0",
|
|
3243
3402
|
faviconDomain: "x.com",
|
|
3244
3403
|
browser: {
|
|
3245
3404
|
origins: ["https://x.com", "https://twitter.com"],
|
|
@@ -3324,8 +3483,23 @@ export default class XConnector extends ConnectorRuntime {
|
|
|
3324
3483
|
{ key: "liked_tweet", label: "Liked Tweet" },
|
|
3325
3484
|
{ key: "bookmark", label: "Bookmark" },
|
|
3326
3485
|
{ key: "dm_message", label: "DM Message" },
|
|
3486
|
+
{ key: "notification", label: "Notification" },
|
|
3327
3487
|
],
|
|
3328
3488
|
feeds: {
|
|
3489
|
+
notifications: {
|
|
3490
|
+
key: "notifications",
|
|
3491
|
+
name: "Notifications",
|
|
3492
|
+
description:
|
|
3493
|
+
"Read the signed-in account's retained All notifications timeline and capture metadata-only references without opening the notification panel or marking items seen. Includes source-exposed grouped reactions/follows and post entries; source icon categories are retained. History is limited by X. For post entries the source date is post creation time, not an invented notification time. Requires browser authentication; this is not OS push interception.",
|
|
3494
|
+
read: readXNotifications,
|
|
3495
|
+
sync: syncXNotifications,
|
|
3496
|
+
eventKinds: {
|
|
3497
|
+
notification: {
|
|
3498
|
+
description:
|
|
3499
|
+
"A metadata-only reference to an X notification timeline item",
|
|
3500
|
+
},
|
|
3501
|
+
},
|
|
3502
|
+
},
|
|
3329
3503
|
live_messages: {
|
|
3330
3504
|
key: "live_messages",
|
|
3331
3505
|
name: "Live messages",
|
|
@@ -3585,6 +3759,7 @@ export default class XConnector extends ConnectorRuntime {
|
|
|
3585
3759
|
try {
|
|
3586
3760
|
if (ctx.actionKey === "send_message") {
|
|
3587
3761
|
const dispatcher = requireXBrowser(ctx);
|
|
3762
|
+
const accountId = requireXAccount(ctx);
|
|
3588
3763
|
const tabId = await readyXLiveTab(dispatcher);
|
|
3589
3764
|
const output = await invokeXDirectMessages<Record<string, unknown>>(
|
|
3590
3765
|
dispatcher,
|
|
@@ -3595,6 +3770,7 @@ export default class XConnector extends ConnectorRuntime {
|
|
|
3595
3770
|
text: ctx.input.text,
|
|
3596
3771
|
idempotency_key: ctx.input.idempotency_key,
|
|
3597
3772
|
},
|
|
3773
|
+
accountId,
|
|
3598
3774
|
);
|
|
3599
3775
|
return { success: true, output };
|
|
3600
3776
|
}
|
package/vendor/cli/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import { dirname, join } from "node:path";
|
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
import chalk from "chalk";
|
|
20
20
|
import { Command } from "commander";
|
|
21
|
+
import { browserListCommand, browserNativeHostCommand, browserRemoveCommand, browserStartCommand, browserStopCommand, } from "./commands/browser.js";
|
|
21
22
|
import { opencodePluginCommand, } from "./commands/opencode-plugin.js";
|
|
22
23
|
import { GATEWAY_DEFAULT_URL } from "./internal/index.js";
|
|
23
24
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -88,12 +89,12 @@ Cloud:
|
|
|
88
89
|
providers <subcmd> Manage org model providers (create, set-key, ...)
|
|
89
90
|
sandbox <subcmd> Manage sandboxes (runtime providers)
|
|
90
91
|
clients <subcmd> List / revoke connected clients (MCP, messaging)
|
|
91
|
-
call [tool] Invoke
|
|
92
|
+
call [tool] Invoke a tool by name (run_sdk/query_sdk/query_sql need --arg title=)
|
|
92
93
|
token [create] Print or mint personal access tokens
|
|
94
|
+
browser <subcmd> Named browsers paired as devices (start, stop, list, rm)
|
|
93
95
|
|
|
94
96
|
Memory:
|
|
95
97
|
memory run [tool] Invoke a memory MCP tool
|
|
96
|
-
memory exec <script> Run a ClientSDK script
|
|
97
98
|
memory health Validate login + MCP connectivity
|
|
98
99
|
memory seed [path] Provision a memory workspace
|
|
99
100
|
`);
|
|
@@ -202,7 +203,7 @@ Memory:
|
|
|
202
203
|
// ─── rollback ───────────────────────────────────────────────────────────
|
|
203
204
|
program
|
|
204
205
|
.command("rollback")
|
|
205
|
-
.argument("<applyId>", "Deployment to restore (apl_… from
|
|
206
|
+
.argument("<applyId>", "Deployment to restore (apl_… from the Events page, Applies filter)")
|
|
206
207
|
.description("Restore a previous deployment from its stored snapshot (pauses future applies until --resume)")
|
|
207
208
|
.option("--yes", "Skip the confirmation prompt (CI mode)")
|
|
208
209
|
.option("--org <slug>", "Org slug override (defaults to active session)")
|
|
@@ -240,6 +241,7 @@ Memory:
|
|
|
240
241
|
.option("-q, --quiet", "Suppress spinner; bail immediately if non-interactive (CI / backgrounded shells)")
|
|
241
242
|
.option("--email <address>", "Headless login on a user's behalf: the server emails them an approval link (auth.md user_claimed flow)")
|
|
242
243
|
.option("--wait-for-approval", "Keep polling for browser approval when supervised without a TTY")
|
|
244
|
+
.option("--client-name <name>", 'Register this login as its own OAuth client name (default "Lobu CLI"); the activity feed attributes the context\'s calls to it')
|
|
243
245
|
.action(async (options) => {
|
|
244
246
|
const { loginCommand } = await import("./commands/login.js");
|
|
245
247
|
await loginCommand({ ...options, cliVersion: version });
|
|
@@ -303,9 +305,10 @@ Memory:
|
|
|
303
305
|
context
|
|
304
306
|
.command("list")
|
|
305
307
|
.description("List configured contexts")
|
|
306
|
-
.
|
|
308
|
+
.option("--json", "Print JSON: each context's name, URL, and whether credentials are stored")
|
|
309
|
+
.action(async (options) => {
|
|
307
310
|
const { contextListCommand } = await import("./commands/context.js");
|
|
308
|
-
await contextListCommand();
|
|
311
|
+
await contextListCommand(options);
|
|
309
312
|
});
|
|
310
313
|
context
|
|
311
314
|
.command("current")
|
|
@@ -596,7 +599,7 @@ Memory:
|
|
|
596
599
|
// the REST proxy. See packages/cli/src/commands/call.ts for the arg shape.
|
|
597
600
|
withCommonOpts(program
|
|
598
601
|
.command("call [tool]")
|
|
599
|
-
.description("Invoke
|
|
602
|
+
.description("Invoke a tool by name (POST /api/<org>/<tool>; MCP tools/call when LOBU_API_TOKEN + LOBU_MEMORY_URL are set). run_sdk, query_sdk and query_sql require --arg title=<heading>. Run with --list or no args to discover.")
|
|
600
603
|
.option("--list", "List tools available to the current token (default when called bare)")
|
|
601
604
|
.option("--all", "Include internal/admin-only tools in --list output")
|
|
602
605
|
.option("--input-file <path>", "Read the JSON args body from a file (top-level object)")
|
|
@@ -638,6 +641,43 @@ Memory:
|
|
|
638
641
|
const { daemonCommand } = await loadDeviceCommand("daemon");
|
|
639
642
|
await daemonCommand({ ...options, cliVersion: version });
|
|
640
643
|
});
|
|
644
|
+
// ─── browser ────────────────────────────────────────────────────────
|
|
645
|
+
const browser = program
|
|
646
|
+
.command("browser")
|
|
647
|
+
.description("Run named Chrome browsers paired to Lobu as devices");
|
|
648
|
+
browser
|
|
649
|
+
.command("start <name>")
|
|
650
|
+
.description("Open a named browser and connect it as a device (downloads Chrome for Testing on first use)")
|
|
651
|
+
.option("-c, --context <name>", "Use a named context for a new browser")
|
|
652
|
+
.option("--headless", "Run without a window (servers without a display)")
|
|
653
|
+
.action(async (name, options) => {
|
|
654
|
+
await browserStartCommand(name, options);
|
|
655
|
+
});
|
|
656
|
+
browser
|
|
657
|
+
.command("stop <name>")
|
|
658
|
+
.description("Close a named browser")
|
|
659
|
+
.action(async (name) => {
|
|
660
|
+
await browserStopCommand(name);
|
|
661
|
+
});
|
|
662
|
+
browser
|
|
663
|
+
.command("list")
|
|
664
|
+
.description("List named browsers and whether their devices are online")
|
|
665
|
+
.option("--json", "Print JSON")
|
|
666
|
+
.action(async (options) => {
|
|
667
|
+
await browserListCommand(options);
|
|
668
|
+
});
|
|
669
|
+
browser
|
|
670
|
+
.command("rm <name>")
|
|
671
|
+
.description("Remove a named browser, its device, and its profile")
|
|
672
|
+
.action(async (name) => {
|
|
673
|
+
await browserRemoveCommand(name);
|
|
674
|
+
});
|
|
675
|
+
browser
|
|
676
|
+
.command("native-host <name>", { hidden: true })
|
|
677
|
+
.description("Pair the Lobu extension in a named browser (run by Chrome)")
|
|
678
|
+
.action(async (name) => {
|
|
679
|
+
await browserNativeHostCommand(name);
|
|
680
|
+
});
|
|
641
681
|
program
|
|
642
682
|
.command("opencode-plugin <action>")
|
|
643
683
|
.description("Manage Lobu's interactive-session plugin for OpenCode")
|
|
@@ -11,4 +11,6 @@ export declare function loadDeviceState(context: string, platform: string): Prom
|
|
|
11
11
|
export declare function updateDeviceState(context: string, platform: string, state: DeviceState): Promise<void>;
|
|
12
12
|
/** Persist one completed setup without allowing two first boots to race. */
|
|
13
13
|
export declare function saveDeviceState(context: string, platform: string, state: DeviceState): Promise<void>;
|
|
14
|
+
/** Forget one saved identity after its device has been removed. */
|
|
15
|
+
export declare function deleteDeviceState(context: string, platform: string): Promise<void>;
|
|
14
16
|
//# sourceMappingURL=device-state.d.ts.map
|
|
@@ -95,4 +95,8 @@ function isErrno(error, code) {
|
|
|
95
95
|
"code" in error &&
|
|
96
96
|
error.code === code);
|
|
97
97
|
}
|
|
98
|
+
/** Forget one saved identity after its device has been removed. */
|
|
99
|
+
export async function deleteDeviceState(context, platform) {
|
|
100
|
+
await rm(statePath(context, platform), { force: true });
|
|
101
|
+
}
|
|
98
102
|
//# sourceMappingURL=device-state.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"server": "dist/server.bundle.mjs",
|
|
6
6
|
"embeddingsServer": "dist/embeddings-server.mjs"
|
|
7
7
|
},
|
|
8
|
-
"version": "24.
|
|
8
|
+
"version": "24.2.0",
|
|
9
9
|
"verify": "dist/verify.mjs"
|
|
10
10
|
},
|
|
11
11
|
"device": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"connector": "node_modules/@lobu/cli/dist/commands/connector.js",
|
|
17
17
|
"worker": "node_modules/@lobu/connector-worker/dist/bin.js"
|
|
18
18
|
},
|
|
19
|
-
"version": "24.
|
|
19
|
+
"version": "24.2.0",
|
|
20
20
|
"verify": "dist/verify.mjs"
|
|
21
21
|
},
|
|
22
22
|
"postgres": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"entries": {
|
|
25
25
|
"postgres": "dist/index.mjs"
|
|
26
26
|
},
|
|
27
|
-
"version": "24.
|
|
27
|
+
"version": "24.2.0",
|
|
28
28
|
"verify": "dist/verify.mjs"
|
|
29
29
|
},
|
|
30
30
|
"embeddings": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"entries": {
|
|
33
33
|
"embeddings": "dist/embeddings.js"
|
|
34
34
|
},
|
|
35
|
-
"version": "24.
|
|
35
|
+
"version": "24.2.0",
|
|
36
36
|
"verify": "dist/verify.mjs"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -248,7 +248,9 @@ choices cover configured install flows; Telegram uses the link-code flow above.
|
|
|
248
248
|
`cloud_status: "unavailable"` means discovery failed; retry before concluding
|
|
249
249
|
that no managed option exists. Offers are not connected accounts. In an
|
|
250
250
|
authenticated cloud context, use ClientSDK through Lobu MCP or
|
|
251
|
-
`lobu memory
|
|
251
|
+
`lobu memory run query_sdk '{"title":"Find managed connection providers","script":"export default async (_ctx, client) => client.organizations.list()"}'`.
|
|
252
|
+
This account discovery works before an active org is selected; `lobu call` over REST requires one.
|
|
253
|
+
Call `client.organizations.list()` to find organizations
|
|
252
254
|
that offer managed connections. On account-scoped `/mcp`, first select an
|
|
253
255
|
authorized home workspace with `const home = await client.org(homeSlug)` and use
|
|
254
256
|
that client for `home.connections.connectManaged`. The public provider
|
|
@@ -45,8 +45,8 @@ prove Slack, Telegram, or another platform works.
|
|
|
45
45
|
Discover the live ids and current state instead of copying ids from config:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npx @lobu/cli@latest
|
|
49
|
-
'export default async (_ctx, client) => ({ connections: await client.connections.list(), feeds: await client.feeds.list() });' \
|
|
48
|
+
npx @lobu/cli@latest call query_sdk --arg title='List connections and feeds' \
|
|
49
|
+
--arg script='export default async (_ctx, client) => ({ connections: await client.connections.list(), feeds: await client.feeds.list() });' \
|
|
50
50
|
--context local
|
|
51
51
|
```
|
|
52
52
|
|
|
@@ -62,8 +62,8 @@ After the user explicitly approves provider-data access, dry-run a collected
|
|
|
62
62
|
feed server-side first:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
npx @lobu/cli@latest
|
|
66
|
-
'export default async (_ctx, client) => client.feeds.trigger({ feed_id: Number("<feed-id>"), dry_run: true });' \
|
|
65
|
+
npx @lobu/cli@latest call run_sdk --arg title='Dry-run feed' \
|
|
66
|
+
--arg script='export default async (_ctx, client) => client.feeds.trigger({ feed_id: Number("<feed-id>"), dry_run: true });' \
|
|
67
67
|
--context local
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -86,12 +86,12 @@ List configured Automations, then trigger each selected Automation by its return
|
|
|
86
86
|
id:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
npx @lobu/cli@latest
|
|
90
|
-
'export default async (_ctx, client) => client.automations.list();' \
|
|
89
|
+
npx @lobu/cli@latest call query_sdk --arg title='List Automations' \
|
|
90
|
+
--arg script='export default async (_ctx, client) => client.automations.list();' \
|
|
91
91
|
--context local
|
|
92
92
|
|
|
93
|
-
npx @lobu/cli@latest
|
|
94
|
-
'export default async (_ctx, client) => client.automations.trigger({ automation_id: "<automation-id>" });' \
|
|
93
|
+
npx @lobu/cli@latest call run_sdk --arg title='Trigger Automation' \
|
|
94
|
+
--arg script='export default async (_ctx, client) => client.automations.trigger({ automation_id: "<automation-id>" });' \
|
|
95
95
|
--context local
|
|
96
96
|
```
|
|
97
97
|
|
package/vendor/cli/package.json
CHANGED
|
@@ -36,7 +36,7 @@ export function resolveBrowserRequirement(value, authMethod) {
|
|
|
36
36
|
/** Replaces caller-supplied `allowed_origins` with the catalog grant; URLs must fall inside it. */
|
|
37
37
|
export function constrainBrowserInput(browser, actionKey, input) {
|
|
38
38
|
validateBrowserRequirement(browser);
|
|
39
|
-
const allowedActions = [BROWSER_VERIFY_OPERATION, 'navigate', 'evaluate', 'get_accessibility_tree', 'wait_for_selector', 'screenshot', 'click_ref', 'type_ref', 'press_key', 'scroll', 'focus_tab', 'close_tab', 'list_tabs', 'feed_listen', 'show_notification', 'network_intercept_start', 'network_intercept_drain', 'network_intercept_stop', 'network_intercept_replay', 'console_capture_start', 'console_capture_drain', 'console_capture_stop'];
|
|
39
|
+
const allowedActions = [BROWSER_VERIFY_OPERATION, 'navigate', 'evaluate', 'get_accessibility_tree', 'wait_for_selector', 'screenshot', 'click_ref', 'type_ref', 'press_key', 'hover_ref', 'scroll', 'select_option', 'handle_dialog', 'focus_tab', 'close_tab', 'list_tabs', 'feed_listen', 'show_notification', 'network_intercept_start', 'network_intercept_drain', 'network_intercept_stop', 'network_intercept_replay', 'console_capture_start', 'console_capture_drain', 'console_capture_stop'];
|
|
40
40
|
if (!allowedActions.includes(actionKey))
|
|
41
41
|
throw new Error('Operation is outside the declared browser resource');
|
|
42
42
|
if (actionKey === 'navigate' && input.url === 'about:blank')
|
|
@@ -41,6 +41,7 @@ export interface ConnectorDefinition {
|
|
|
41
41
|
/** Query filters implemented by this connector. Unsupported filters fail before query(). */
|
|
42
42
|
queryCapabilities?: {
|
|
43
43
|
exactMatch?: boolean;
|
|
44
|
+
verbatimExactMatch?: boolean;
|
|
44
45
|
selection?: boolean;
|
|
45
46
|
};
|
|
46
47
|
/** Connector-normalized events that can activate Automations. */
|
|
@@ -1082,14 +1083,17 @@ export interface QueryContext<F = Record<string, unknown>> {
|
|
|
1082
1083
|
order: 'asc' | 'desc';
|
|
1083
1084
|
};
|
|
1084
1085
|
/**
|
|
1085
|
-
* Filter before pagination by the trimmed
|
|
1086
|
+
* Filter before pagination by the string (trimmed by default) of the first non-null
|
|
1086
1087
|
* projected column, in order. Missing columns count as null; an empty string
|
|
1087
1088
|
* does not fall through. Values must be bound or safely encoded by the
|
|
1088
1089
|
* connector, which owns its source dialect. Requires queryCapabilities.exactMatch.
|
|
1090
|
+
* `verbatim: true` preserves the scalar string without trimming and additionally
|
|
1091
|
+
* requires queryCapabilities.verbatimExactMatch. The default stays trimmed.
|
|
1089
1092
|
*/
|
|
1090
1093
|
exactMatch?: {
|
|
1091
1094
|
columns: string[];
|
|
1092
1095
|
value: string;
|
|
1096
|
+
verbatim?: boolean;
|
|
1093
1097
|
};
|
|
1094
1098
|
/**
|
|
1095
1099
|
* Shared collection predicates, applied before sorting and pagination.
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import type { AgentTool } from '@mariozechner/pi-agent-core';
|
|
20
20
|
import type { AgentTurnConversation, AgentTurnGatewayTool } from './types.js';
|
|
21
|
+
/**
|
|
22
|
+
* `tools`, with each call executed by a tool set built for THAT call: one whose
|
|
23
|
+
* gateway requests name the steered input the call answers
|
|
24
|
+
* (`TURN_INPUT_RUN_HEADER`), so the gateway keys the write on that input's
|
|
25
|
+
* stored message. Building a plugin tool set is only object construction; the
|
|
26
|
+
* schemas and descriptions offered to the model are the first set's.
|
|
27
|
+
*/
|
|
28
|
+
export declare function perCallInputRun(tools: AgentTool[], build: (headers: Record<string, string>) => AgentTool[], inputRunFor: (toolCallId: string) => number | undefined): AgentTool[];
|
|
21
29
|
/**
|
|
22
30
|
* Build the gateway tools this turn may call.
|
|
23
31
|
*
|
|
@@ -41,5 +49,6 @@ export declare function createGatewayTools(allowed: readonly AgentTurnGatewayToo
|
|
|
41
49
|
conversation: AgentTurnConversation;
|
|
42
50
|
onAskUserPosted: () => void;
|
|
43
51
|
onInBandReplyDelivered: () => void;
|
|
52
|
+
inputRunFor: (toolCallId: string) => number | undefined;
|
|
44
53
|
}): AgentTool[];
|
|
45
54
|
//# sourceMappingURL=gateway-tools.d.ts.map
|
|
@@ -16,7 +16,27 @@
|
|
|
16
16
|
* What this module adds is only the seam: which tools the policy admitted,
|
|
17
17
|
* the turn's one credential as the bearer, and pi's `AgentTool` shape.
|
|
18
18
|
*/
|
|
19
|
+
import { TURN_INPUT_RUN_HEADER } from '@lobu/core/agent-tooling';
|
|
19
20
|
import { createConversationTools } from '@lobu/plugin-conversations';
|
|
21
|
+
/**
|
|
22
|
+
* `tools`, with each call executed by a tool set built for THAT call: one whose
|
|
23
|
+
* gateway requests name the steered input the call answers
|
|
24
|
+
* (`TURN_INPUT_RUN_HEADER`), so the gateway keys the write on that input's
|
|
25
|
+
* stored message. Building a plugin tool set is only object construction; the
|
|
26
|
+
* schemas and descriptions offered to the model are the first set's.
|
|
27
|
+
*/
|
|
28
|
+
export function perCallInputRun(tools, build, inputRunFor) {
|
|
29
|
+
return tools.map((tool) => ({
|
|
30
|
+
...tool,
|
|
31
|
+
execute: (toolCallId, ...rest) => {
|
|
32
|
+
const inputRunId = inputRunFor(toolCallId);
|
|
33
|
+
if (inputRunId === undefined)
|
|
34
|
+
return tool.execute(toolCallId, ...rest);
|
|
35
|
+
const forCall = build({ [TURN_INPUT_RUN_HEADER]: String(inputRunId) }).find((t) => t.name === tool.name);
|
|
36
|
+
return forCall.execute(toolCallId, ...rest);
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
20
40
|
/**
|
|
21
41
|
* Build the gateway tools this turn may call.
|
|
22
42
|
*
|
|
@@ -38,15 +58,16 @@ export function createGatewayTools(allowed, args) {
|
|
|
38
58
|
const wanted = new Set(allowed);
|
|
39
59
|
if (wanted.size === 0)
|
|
40
60
|
return [];
|
|
41
|
-
const
|
|
61
|
+
const build = (headers) => createConversationTools({
|
|
42
62
|
gatewayUrl: args.gatewayUrl,
|
|
43
63
|
workerToken: args.credential,
|
|
44
64
|
channelId: args.conversation.channelId,
|
|
45
65
|
conversationId: args.conversation.conversationId,
|
|
46
66
|
platform: args.conversation.platform,
|
|
67
|
+
...(headers ? { headers } : {}),
|
|
47
68
|
onAskUserPosted: args.onAskUserPosted,
|
|
48
69
|
onInBandReplyDelivered: args.onInBandReplyDelivered,
|
|
49
70
|
});
|
|
50
|
-
return
|
|
71
|
+
return perCallInputRun(build().filter((tool) => wanted.has(tool.name)), build, args.inputRunFor);
|
|
51
72
|
}
|
|
52
73
|
//# sourceMappingURL=gateway-tools.js.map
|