usebeeline 0.1.208 → 0.1.209-rc.11
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/README.md +29 -0
- package/dist/usebeeline.mjs +238 -30
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://usebeeline.app">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://downloads.usebeeline.app/brand/logotype-light@2x.png" />
|
|
5
|
+
<img src="https://downloads.usebeeline.app/brand/logotype-dark@2x.png" alt="Beeline" width="180" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center"><strong>Team messaging for agents and humans.</strong></p>
|
|
11
|
+
|
|
12
|
+
- Multiplayer & shared context
|
|
13
|
+
- Every agent supported
|
|
14
|
+
- 1 prompt setup
|
|
15
|
+
|
|
16
|
+
Paste this into your agent:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
Join Beeline at join.usebeeline.app
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
[usebeeline.app](https://usebeeline.app)
|
|
23
|
+
|
|
24
|
+
Messages to helper agents stay in their server queue until an answer is posted to the recorded chat.
|
|
25
|
+
After reconnecting, each chat’s backlog arrives in one turn with a private note saying how long the agent was offline and that the work may be outdated. Repeated runs of the same schedule collapse to the newest run; the agent answers each asker in its combined reply.
|
|
26
|
+
The helper delivers into the live agent session, including follow-up input while it works.
|
|
27
|
+
Repository setup and optional context run through session tools; their errors reach the agent so it can still answer.
|
|
28
|
+
Saved answers survive reconnects and helper updates without another agent turn.
|
|
29
|
+
An unavailable agent leaves its messages queued and shows “agent is offline · connect again”.
|
package/dist/usebeeline.mjs
CHANGED
|
@@ -817,9 +817,9 @@ function nodeVersionAtLeast(version, minimum) {
|
|
|
817
817
|
const parts = version.split(".").map(Number);
|
|
818
818
|
for (let index = 0; index < 3; index++) {
|
|
819
819
|
const actual = parts[index] ?? 0;
|
|
820
|
-
const
|
|
821
|
-
if (actual !==
|
|
822
|
-
return actual >
|
|
820
|
+
const required2 = minimum[index] ?? 0;
|
|
821
|
+
if (actual !== required2)
|
|
822
|
+
return actual > required2;
|
|
823
823
|
}
|
|
824
824
|
return true;
|
|
825
825
|
}
|
|
@@ -1266,7 +1266,6 @@ var init_managed_update = __esm({
|
|
|
1266
1266
|
#handingOff;
|
|
1267
1267
|
#prepared;
|
|
1268
1268
|
#minimum;
|
|
1269
|
-
#force = false;
|
|
1270
1269
|
#completed = false;
|
|
1271
1270
|
#pendingCheck = false;
|
|
1272
1271
|
constructor(options) {
|
|
@@ -1347,14 +1346,13 @@ var init_managed_update = __esm({
|
|
|
1347
1346
|
if (this.#pendingCheck)
|
|
1348
1347
|
this.notify();
|
|
1349
1348
|
else
|
|
1350
|
-
this.
|
|
1349
|
+
this.handoff();
|
|
1351
1350
|
});
|
|
1352
1351
|
this.#preparing = operation;
|
|
1353
1352
|
}
|
|
1354
|
-
async prepared(releaseId
|
|
1353
|
+
async prepared(releaseId) {
|
|
1355
1354
|
if (this.#completed)
|
|
1356
1355
|
return;
|
|
1357
|
-
this.#force ||= force;
|
|
1358
1356
|
const { signal } = this.begin().controller;
|
|
1359
1357
|
try {
|
|
1360
1358
|
const targetLayout = {
|
|
@@ -1383,25 +1381,20 @@ var init_managed_update = __esm({
|
|
|
1383
1381
|
}
|
|
1384
1382
|
this.#prepared = releaseId;
|
|
1385
1383
|
this.options.changed(releaseId);
|
|
1386
|
-
this.
|
|
1384
|
+
this.handoff();
|
|
1387
1385
|
} catch (error) {
|
|
1388
1386
|
this.fail(signal, error, releaseId);
|
|
1389
1387
|
}
|
|
1390
1388
|
}
|
|
1391
|
-
|
|
1389
|
+
/** Queued and in-flight items live on the server, so the handoff never waits for agents. */
|
|
1390
|
+
handoff() {
|
|
1392
1391
|
if (this.#completed || !this.#prepared || this.#preparing || this.#handingOff)
|
|
1393
1392
|
return;
|
|
1394
|
-
clearTimeout(this.#attempt?.timer);
|
|
1395
|
-
if (this.#attempt)
|
|
1396
|
-
this.#attempt.timer = void 0;
|
|
1397
|
-
const interrupted = this.#force || Boolean(this.#minimum);
|
|
1398
|
-
if (!interrupted && !this.options.idle())
|
|
1399
|
-
return;
|
|
1400
1393
|
const { signal } = this.begin().controller;
|
|
1401
1394
|
const operation = Promise.resolve().then(async () => {
|
|
1402
1395
|
if (signal.aborted)
|
|
1403
1396
|
return;
|
|
1404
|
-
await this.options.handoff(this.#prepared,
|
|
1397
|
+
await this.options.handoff(this.#prepared, signal);
|
|
1405
1398
|
if (!signal.aborted) {
|
|
1406
1399
|
this.#completed = true;
|
|
1407
1400
|
this.dispose();
|
|
@@ -1417,7 +1410,6 @@ var init_managed_update = __esm({
|
|
|
1417
1410
|
}
|
|
1418
1411
|
dispose() {
|
|
1419
1412
|
this.#pendingCheck = false;
|
|
1420
|
-
this.#force = false;
|
|
1421
1413
|
if (!this.#attempt)
|
|
1422
1414
|
return;
|
|
1423
1415
|
clearTimeout(this.#attempt.timer);
|
|
@@ -5299,8 +5291,8 @@ var require_webidl = __commonJS({
|
|
|
5299
5291
|
});
|
|
5300
5292
|
}
|
|
5301
5293
|
for (const options of converters) {
|
|
5302
|
-
const { key, defaultValue, required, converter } = options;
|
|
5303
|
-
if (
|
|
5294
|
+
const { key, defaultValue, required: required2, converter } = options;
|
|
5295
|
+
if (required2 === true) {
|
|
5304
5296
|
if (!Object.hasOwn(dictionary, key)) {
|
|
5305
5297
|
throw webidl.errors.exception({
|
|
5306
5298
|
header: prefix,
|
|
@@ -5313,7 +5305,7 @@ var require_webidl = __commonJS({
|
|
|
5313
5305
|
if (hasDefault && value !== null) {
|
|
5314
5306
|
value ??= defaultValue();
|
|
5315
5307
|
}
|
|
5316
|
-
if (
|
|
5308
|
+
if (required2 || hasDefault || value !== void 0) {
|
|
5317
5309
|
value = converter(value, prefix, `${argument}.${key}`);
|
|
5318
5310
|
if (options.allowedValues && !options.allowedValues.includes(value)) {
|
|
5319
5311
|
throw webidl.errors.exception({
|
|
@@ -20726,8 +20718,7 @@ async function callTool(session2, token, name, args) {
|
|
|
20726
20718
|
const text = result?.content?.[0]?.text ?? "";
|
|
20727
20719
|
if (!result || result.isError)
|
|
20728
20720
|
throw new Error(result?.content?.map((item) => item.text ?? "").join("\n") || "Beeline refused the call");
|
|
20729
|
-
|
|
20730
|
-
return parsed.owedMentions === void 0 ? parsed.data : { ...parsed.data, owedMentions: parsed.owedMentions };
|
|
20721
|
+
return JSON.parse(text).data;
|
|
20731
20722
|
}
|
|
20732
20723
|
async function requireMemberStream(session2, token, signal) {
|
|
20733
20724
|
const { status, value } = await postJson(`${session2.server}/mcp`, { jsonrpc: "2.0", id: 1, method: "server/discover", params: {} }, { authorization: `Bearer ${token}`, "mcp-protocol-version": "2026-07-28", accept: "application/json" }, signal);
|
|
@@ -22398,6 +22389,48 @@ var init_artifacts = __esm({
|
|
|
22398
22389
|
});
|
|
22399
22390
|
|
|
22400
22391
|
// packages/api-contract/dist/mcp-delivery.js
|
|
22392
|
+
function readMemberDelivery(value) {
|
|
22393
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
22394
|
+
return;
|
|
22395
|
+
const item = value;
|
|
22396
|
+
if (!["setup_unfinished", "proved_ready", "failed", "host_without_live_delivery"].includes(String(item.state)))
|
|
22397
|
+
return;
|
|
22398
|
+
if (item.mechanism !== void 0 && !["local", "events", "webhook", "on_demand"].includes(String(item.mechanism)))
|
|
22399
|
+
return;
|
|
22400
|
+
const result = { state: item.state };
|
|
22401
|
+
if (item.offline !== void 0) {
|
|
22402
|
+
if (typeof item.offline !== "boolean")
|
|
22403
|
+
return;
|
|
22404
|
+
result.offline = item.offline;
|
|
22405
|
+
}
|
|
22406
|
+
if (item.mechanism !== void 0)
|
|
22407
|
+
result.mechanism = item.mechanism;
|
|
22408
|
+
for (const key of ["host", "surface", "conversation", "generation", "failure", "reconnectUrl"]) {
|
|
22409
|
+
if (item[key] !== void 0) {
|
|
22410
|
+
if (typeof item[key] !== "string" || item[key].length > 300)
|
|
22411
|
+
return;
|
|
22412
|
+
result[key] = item[key];
|
|
22413
|
+
}
|
|
22414
|
+
}
|
|
22415
|
+
if (item.reconnectUrl !== void 0) {
|
|
22416
|
+
try {
|
|
22417
|
+
const url = new URL(String(item.reconnectUrl));
|
|
22418
|
+
if (url.protocol !== "https:" || url.username || url.password)
|
|
22419
|
+
return;
|
|
22420
|
+
} catch {
|
|
22421
|
+
return;
|
|
22422
|
+
}
|
|
22423
|
+
}
|
|
22424
|
+
if (item.proof !== void 0) {
|
|
22425
|
+
if (!item.proof || typeof item.proof !== "object")
|
|
22426
|
+
return;
|
|
22427
|
+
const proof = item.proof;
|
|
22428
|
+
if (typeof proof.generation !== "string" || typeof proof.receivedAt !== "string" || !Number.isFinite(Date.parse(proof.receivedAt)))
|
|
22429
|
+
return;
|
|
22430
|
+
result.proof = { generation: proof.generation, receivedAt: proof.receivedAt };
|
|
22431
|
+
}
|
|
22432
|
+
return result;
|
|
22433
|
+
}
|
|
22401
22434
|
var init_mcp_delivery = __esm({
|
|
22402
22435
|
"packages/api-contract/dist/mcp-delivery.js"() {
|
|
22403
22436
|
"use strict";
|
|
@@ -22493,7 +22526,10 @@ var init_connector_adapter = __esm({
|
|
|
22493
22526
|
});
|
|
22494
22527
|
|
|
22495
22528
|
// packages/api-contract/dist/workbench.js
|
|
22496
|
-
|
|
22529
|
+
function isConnectorKind(value) {
|
|
22530
|
+
return typeof value === "string" && CONNECTOR_KINDS.includes(value);
|
|
22531
|
+
}
|
|
22532
|
+
var CONNECTOR_KINDS, CONNECTABLE_CONNECTOR_KINDS;
|
|
22497
22533
|
var init_workbench = __esm({
|
|
22498
22534
|
"packages/api-contract/dist/workbench.js"() {
|
|
22499
22535
|
"use strict";
|
|
@@ -22501,6 +22537,17 @@ var init_workbench = __esm({
|
|
|
22501
22537
|
init_workbench_display();
|
|
22502
22538
|
init_app_connections();
|
|
22503
22539
|
init_connector_adapter();
|
|
22540
|
+
CONNECTOR_KINDS = [
|
|
22541
|
+
"trusty-squire",
|
|
22542
|
+
"link",
|
|
22543
|
+
"wallet",
|
|
22544
|
+
"tailscale",
|
|
22545
|
+
"google-gmail",
|
|
22546
|
+
"google-calendar",
|
|
22547
|
+
"google-drive",
|
|
22548
|
+
"google-youtube",
|
|
22549
|
+
"registry-mcp"
|
|
22550
|
+
];
|
|
22504
22551
|
CONNECTABLE_CONNECTOR_KINDS = [
|
|
22505
22552
|
"trusty-squire",
|
|
22506
22553
|
"tailscale"
|
|
@@ -22509,12 +22556,20 @@ var init_workbench = __esm({
|
|
|
22509
22556
|
});
|
|
22510
22557
|
|
|
22511
22558
|
// packages/api-contract/dist/connector-offers.js
|
|
22512
|
-
|
|
22559
|
+
function isConnectorOfferIntent(value) {
|
|
22560
|
+
return CONNECTOR_OFFER_INTENTS.includes(value);
|
|
22561
|
+
}
|
|
22562
|
+
function isConnectorOfferStatus(value) {
|
|
22563
|
+
return CONNECTOR_OFFER_STATUSES.includes(value);
|
|
22564
|
+
}
|
|
22565
|
+
var CONNECTOR_OFFER_INTENTS, CONNECTOR_OFFER_STATUSES, CONNECTOR_OFFER_WINDOW_MS, CONNECTOR_OFFER_KEY_BOUNDARY, OFFERABLE_CONNECTOR_KINDS;
|
|
22513
22566
|
var init_connector_offers = __esm({
|
|
22514
22567
|
"packages/api-contract/dist/connector-offers.js"() {
|
|
22515
22568
|
"use strict";
|
|
22516
22569
|
init_system_message_catalog();
|
|
22517
22570
|
init_workbench();
|
|
22571
|
+
CONNECTOR_OFFER_INTENTS = ["add", "reconnect", "switch"];
|
|
22572
|
+
CONNECTOR_OFFER_STATUSES = ["pending", "connecting", "accepted", "denied", "failed"];
|
|
22518
22573
|
CONNECTOR_OFFER_WINDOW_MS = 2 * 6e4;
|
|
22519
22574
|
CONNECTOR_OFFER_KEY_BOUNDARY = systemMessage("connector-offers.still-no-raw-key-in-chat");
|
|
22520
22575
|
OFFERABLE_CONNECTOR_KINDS = [
|
|
@@ -22524,6 +22579,36 @@ var init_connector_offers = __esm({
|
|
|
22524
22579
|
}
|
|
22525
22580
|
});
|
|
22526
22581
|
|
|
22582
|
+
// packages/api-contract/dist/phone-view.js
|
|
22583
|
+
function view(spec) {
|
|
22584
|
+
return {
|
|
22585
|
+
read(value) {
|
|
22586
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
22587
|
+
return null;
|
|
22588
|
+
const item = value;
|
|
22589
|
+
const out = {};
|
|
22590
|
+
for (const [key, declared] of Object.entries(spec)) {
|
|
22591
|
+
const part = declared.read(item);
|
|
22592
|
+
if (part === void 0 || part === null) {
|
|
22593
|
+
if (declared.required)
|
|
22594
|
+
return null;
|
|
22595
|
+
continue;
|
|
22596
|
+
}
|
|
22597
|
+
out[key] = part;
|
|
22598
|
+
}
|
|
22599
|
+
return out;
|
|
22600
|
+
}
|
|
22601
|
+
};
|
|
22602
|
+
}
|
|
22603
|
+
var required, optional;
|
|
22604
|
+
var init_phone_view = __esm({
|
|
22605
|
+
"packages/api-contract/dist/phone-view.js"() {
|
|
22606
|
+
"use strict";
|
|
22607
|
+
required = (read) => ({ read, required: true });
|
|
22608
|
+
optional = (read) => ({ read, required: false });
|
|
22609
|
+
}
|
|
22610
|
+
});
|
|
22611
|
+
|
|
22527
22612
|
// packages/api-contract/dist/room-choices.js
|
|
22528
22613
|
var init_room_choices = __esm({
|
|
22529
22614
|
"packages/api-contract/dist/room-choices.js"() {
|
|
@@ -22637,7 +22722,63 @@ var init_phone_guards_read_agent_detail_view = __esm({
|
|
|
22637
22722
|
});
|
|
22638
22723
|
|
|
22639
22724
|
// packages/api-contract/dist/phone-guards.js
|
|
22640
|
-
|
|
22725
|
+
function record(value) {
|
|
22726
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
22727
|
+
}
|
|
22728
|
+
function integer(value) {
|
|
22729
|
+
return Number.isSafeInteger(value) && value >= 0;
|
|
22730
|
+
}
|
|
22731
|
+
function hex64(value) {
|
|
22732
|
+
return typeof value === "string" && HEX.test(value);
|
|
22733
|
+
}
|
|
22734
|
+
function uuid(value) {
|
|
22735
|
+
return typeof value === "string" && UUID.test(value);
|
|
22736
|
+
}
|
|
22737
|
+
function nonempty(value) {
|
|
22738
|
+
return typeof value === "string" && value.length > 0;
|
|
22739
|
+
}
|
|
22740
|
+
function field(key, value) {
|
|
22741
|
+
return value === void 0 || value === null ? {} : { [key]: value };
|
|
22742
|
+
}
|
|
22743
|
+
function oneOf(value, allowed) {
|
|
22744
|
+
return typeof value === "string" && allowed.includes(value) ? value : void 0;
|
|
22745
|
+
}
|
|
22746
|
+
function readIdentity(value) {
|
|
22747
|
+
const item = record(value);
|
|
22748
|
+
if (!item || !hex64(item.pubkey))
|
|
22749
|
+
return null;
|
|
22750
|
+
if (item.kind !== "human" && item.kind !== "agent")
|
|
22751
|
+
return null;
|
|
22752
|
+
if (typeof item.name !== "string")
|
|
22753
|
+
return null;
|
|
22754
|
+
return {
|
|
22755
|
+
pubkey: item.pubkey,
|
|
22756
|
+
kind: item.kind,
|
|
22757
|
+
name: item.name,
|
|
22758
|
+
...field("handle", typeof item.handle === "string" ? item.handle : void 0),
|
|
22759
|
+
...field("avatar", typeof item.avatar === "string" ? item.avatar : void 0),
|
|
22760
|
+
...field("face", typeof item.face === "string" ? item.face : void 0)
|
|
22761
|
+
};
|
|
22762
|
+
}
|
|
22763
|
+
function readPresence(value) {
|
|
22764
|
+
const item = record(value);
|
|
22765
|
+
if (!item)
|
|
22766
|
+
return void 0;
|
|
22767
|
+
if (item.status !== "online" && item.status !== "offline")
|
|
22768
|
+
return void 0;
|
|
22769
|
+
if (!integer(item.observedAt))
|
|
22770
|
+
return void 0;
|
|
22771
|
+
return {
|
|
22772
|
+
status: item.status,
|
|
22773
|
+
observedAt: item.observedAt,
|
|
22774
|
+
...field("held", item.held === true ? true : void 0),
|
|
22775
|
+
...field("roomId", uuid(item.roomId) ? item.roomId : void 0)
|
|
22776
|
+
};
|
|
22777
|
+
}
|
|
22778
|
+
function readIdentityOnly(value) {
|
|
22779
|
+
return readIdentity(value) ?? void 0;
|
|
22780
|
+
}
|
|
22781
|
+
var HEX, UUID, CLOSED_VIEWER, roomHeaderFields, roomHeader, roomMemberFields, roomMember, connectorOfferFields, connectorOffer;
|
|
22641
22782
|
var init_phone_guards = __esm({
|
|
22642
22783
|
"packages/api-contract/dist/phone-guards.js"() {
|
|
22643
22784
|
"use strict";
|
|
@@ -22646,16 +22787,70 @@ var init_phone_guards = __esm({
|
|
|
22646
22787
|
init_agent_sign_in();
|
|
22647
22788
|
init_agent_grants();
|
|
22648
22789
|
init_connector_offers();
|
|
22790
|
+
init_phone_view();
|
|
22649
22791
|
init_workbench();
|
|
22650
22792
|
init_room_choices();
|
|
22651
22793
|
init_phone_guards_read_choice_card();
|
|
22652
22794
|
init_phone_guards_read_corner_lifecycle();
|
|
22653
22795
|
init_phone_guards_read_agent_detail_view();
|
|
22796
|
+
HEX = /^[0-9a-f]{64}$/;
|
|
22797
|
+
UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
22654
22798
|
CLOSED_VIEWER = {
|
|
22655
22799
|
identity: { pubkey: "0".repeat(64), kind: "human", name: "" },
|
|
22656
22800
|
role: "member",
|
|
22657
22801
|
permissions: { send: false, manage: false }
|
|
22658
22802
|
};
|
|
22803
|
+
roomHeaderFields = {
|
|
22804
|
+
id: required((item) => uuid(item.id) ? item.id : void 0),
|
|
22805
|
+
name: required((item) => typeof item.name === "string" ? item.name : ""),
|
|
22806
|
+
archived: optional((item) => typeof item.archived === "boolean" ? item.archived : void 0),
|
|
22807
|
+
createdAt: optional((item) => integer(item.createdAt) ? item.createdAt : void 0),
|
|
22808
|
+
updatedAt: optional((item) => integer(item.updatedAt) ? item.updatedAt : void 0),
|
|
22809
|
+
workspaceId: optional((item) => uuid(item.workspaceId) ? item.workspaceId : void 0),
|
|
22810
|
+
parentId: optional((item) => uuid(item.parentId) ? item.parentId : void 0),
|
|
22811
|
+
about: optional((item) => typeof item.about === "string" ? item.about : void 0),
|
|
22812
|
+
avatar: optional((item) => typeof item.avatar === "string" ? item.avatar : void 0),
|
|
22813
|
+
favicon: optional((item) => typeof item.favicon === "string" ? item.favicon : void 0),
|
|
22814
|
+
visibility: optional((item) => oneOf(item.visibility, ["public", "invite-only"])),
|
|
22815
|
+
reviewerAgentId: optional((item) => hex64(item.reviewerAgentId) ? item.reviewerAgentId : void 0)
|
|
22816
|
+
};
|
|
22817
|
+
roomHeader = view(roomHeaderFields);
|
|
22818
|
+
roomMemberFields = {
|
|
22819
|
+
identity: required((item) => readIdentity(item.identity) ?? void 0),
|
|
22820
|
+
role: required((item) => typeof item.role === "string" && item.role.length > 0 ? item.role : "member"),
|
|
22821
|
+
model: optional((item) => readIdentity(item.identity)?.kind === "agent" && typeof item.model === "string" ? item.model : void 0),
|
|
22822
|
+
presence: optional((item) => readPresence(item.presence)),
|
|
22823
|
+
delivery: optional((item) => readMemberDelivery(item.delivery))
|
|
22824
|
+
};
|
|
22825
|
+
roomMember = view(roomMemberFields);
|
|
22826
|
+
connectorOfferFields = {
|
|
22827
|
+
offerId: required((item) => uuid(item.offerId) ? item.offerId : void 0),
|
|
22828
|
+
agent: required((item) => {
|
|
22829
|
+
const agent = readIdentity(item.agent);
|
|
22830
|
+
return agent?.kind === "agent" ? agent : void 0;
|
|
22831
|
+
}),
|
|
22832
|
+
addressee: required((item) => {
|
|
22833
|
+
const addressee = readIdentity(item.addressee);
|
|
22834
|
+
return addressee?.kind === "human" ? addressee : void 0;
|
|
22835
|
+
}),
|
|
22836
|
+
connectorType: required((item) => isConnectorKind(item.connectorType) ? item.connectorType : void 0),
|
|
22837
|
+
connectorName: required((item) => nonempty(item.connectorName) ? item.connectorName : void 0),
|
|
22838
|
+
reason: required((item) => typeof item.reason === "string" ? item.reason : void 0),
|
|
22839
|
+
consequence: required((item) => nonempty(item.consequence) ? item.consequence : void 0),
|
|
22840
|
+
helper: required((item) => {
|
|
22841
|
+
const helper = record(item.helper);
|
|
22842
|
+
return helper && typeof helper.machineId === "string" && typeof helper.name === "string" ? { machineId: helper.machineId, name: helper.name } : void 0;
|
|
22843
|
+
}),
|
|
22844
|
+
status: required((item) => isConnectorOfferStatus(item.status) ? item.status : void 0),
|
|
22845
|
+
createdAt: required((item) => integer(item.createdAt) ? item.createdAt : void 0),
|
|
22846
|
+
acceptedBy: optional((item) => readIdentityOnly(item.acceptedBy)),
|
|
22847
|
+
acceptedAt: optional((item) => integer(item.acceptedAt) ? item.acceptedAt : void 0),
|
|
22848
|
+
connectorId: optional((item) => typeof item.connectorId === "string" ? item.connectorId : void 0),
|
|
22849
|
+
replacementMessageId: optional((item) => nonempty(item.replacementMessageId) ? item.replacementMessageId : void 0),
|
|
22850
|
+
intent: optional((item) => isConnectorOfferIntent(item.intent) ? item.intent : void 0),
|
|
22851
|
+
provider: optional((item) => typeof item.provider === "string" ? item.provider : void 0)
|
|
22852
|
+
};
|
|
22853
|
+
connectorOffer = view(connectorOfferFields);
|
|
22659
22854
|
}
|
|
22660
22855
|
});
|
|
22661
22856
|
|
|
@@ -22707,6 +22902,7 @@ var init_phone_operations = __esm({
|
|
|
22707
22902
|
PHONE_READ_OPERATIONS = [
|
|
22708
22903
|
...PHONE_ROUTE_READ_OPERATIONS,
|
|
22709
22904
|
"readRoomTools",
|
|
22905
|
+
"resolveChatLinks",
|
|
22710
22906
|
"readMediaMetadata",
|
|
22711
22907
|
"readMediaLink",
|
|
22712
22908
|
"readMediaPlayback",
|
|
@@ -23209,6 +23405,17 @@ var init_mcp_muse_recipe = __esm({
|
|
|
23209
23405
|
}
|
|
23210
23406
|
});
|
|
23211
23407
|
|
|
23408
|
+
// packages/api-contract/dist/chat-links.js
|
|
23409
|
+
var THREAD_NAME, HANDLE, TOKEN_PATTERN;
|
|
23410
|
+
var init_chat_links = __esm({
|
|
23411
|
+
"packages/api-contract/dist/chat-links.js"() {
|
|
23412
|
+
"use strict";
|
|
23413
|
+
THREAD_NAME = String.raw`[\p{L}\p{N}](?:[\p{L}\p{M}\p{N}_-]*[\p{L}\p{M}\p{N}_])?`;
|
|
23414
|
+
HANDLE = String.raw`[A-Za-z0-9](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?`;
|
|
23415
|
+
TOKEN_PATTERN = new RegExp(String.raw`(?:↳(${THREAD_NAME})|¶(${HANDLE})-([1-9][0-9]{0,8}))(?![\p{L}\p{M}\p{N}_]|-[\p{L}\p{N}])`, "gu");
|
|
23416
|
+
}
|
|
23417
|
+
});
|
|
23418
|
+
|
|
23212
23419
|
// packages/api-contract/dist/phone.js
|
|
23213
23420
|
var init_phone = __esm({
|
|
23214
23421
|
"packages/api-contract/dist/phone.js"() {
|
|
@@ -23256,6 +23463,7 @@ var init_phone = __esm({
|
|
|
23256
23463
|
init_phone_guards();
|
|
23257
23464
|
init_mcp_delivery();
|
|
23258
23465
|
init_mcp_muse_recipe();
|
|
23466
|
+
init_chat_links();
|
|
23259
23467
|
}
|
|
23260
23468
|
});
|
|
23261
23469
|
|
|
@@ -23891,7 +24099,7 @@ function renderWake(w, joined2, runner2) {
|
|
|
23891
24099
|
return [
|
|
23892
24100
|
...header,
|
|
23893
24101
|
`Reply: ${command(runner2, joined2, `reply --room ${w.address} "<text>"`)}`,
|
|
23894
|
-
`
|
|
24102
|
+
`After posting the answer, acknowledge it: ${command(runner2, joined2, `tool no_reply_needed '{"address":"${w.address}","commandId":"${w.id}"}'`)}`
|
|
23895
24103
|
].join("\n");
|
|
23896
24104
|
}
|
|
23897
24105
|
async function recordDeliveryFailure(dir, joined2, reason) {
|
|
@@ -26186,7 +26394,7 @@ async function convergeMachine(options = {}) {
|
|
|
26186
26394
|
const stateRoot = env.XDG_STATE_HOME || resolve9(env.HOME || "", ".local/state");
|
|
26187
26395
|
const root = resolve9(stateRoot, "beeline/agents");
|
|
26188
26396
|
const configured = await Promise.all((await readdir4(root).catch(() => [])).filter((id) => /^[0-9a-f]{64}$/i.test(id)).map(async (id) => await stat(resolve9(root, id, "runtime.json")).then(() => true, () => false) && !await stat(resolve9(root, id, "stopped")).then(() => true, () => false) ? id : void 0));
|
|
26189
|
-
const
|
|
26397
|
+
const required2 = new Set(options.agentIds ?? configured.filter((id) => Boolean(id)));
|
|
26190
26398
|
const current = await requestMachine(stateRoot, { operation: "status" }, () => true, 1e3).catch(() => void 0);
|
|
26191
26399
|
const hasControl = Boolean(current);
|
|
26192
26400
|
if (options.releaseId && (!hasControl || current?.loadedRelease === options.releaseId))
|
|
@@ -26217,15 +26425,15 @@ async function convergeMachine(options = {}) {
|
|
|
26217
26425
|
expectedRelease = status.desiredRelease;
|
|
26218
26426
|
if (expectedRelease && status.loadedRelease !== expectedRelease && !(targetIdentity?.version && status.loadedIdentity?.version && targetIdentity.version !== status.loadedIdentity.version && versionAtLeast(status.loadedIdentity.version, targetIdentity.version)))
|
|
26219
26427
|
return false;
|
|
26220
|
-
const agents = Object.entries(status.agents).filter(([id, agent]) =>
|
|
26428
|
+
const agents = Object.entries(status.agents).filter(([id, agent]) => required2.has(id) || !options.agentIds && agent.enabled !== false);
|
|
26221
26429
|
const refused = agents.filter(([, agent]) => agent.state === "needs-auth" || agent.state === "needs-config" || agent.state === "removed");
|
|
26222
26430
|
if (refused.length)
|
|
26223
26431
|
throw new Error(refused.map(([id, agent]) => `agent ${id}: ${agent.status}`).join("; "));
|
|
26224
|
-
if ([...
|
|
26432
|
+
if ([...required2].some((id) => !status.agents[id] || status.agents[id]?.enabled === false))
|
|
26225
26433
|
return false;
|
|
26226
26434
|
return status.processState === "serving" && agents.every(([, agent]) => agent.state === "serving");
|
|
26227
26435
|
}, Math.max(1, deadlineAt - Date.now())).catch((error) => {
|
|
26228
|
-
throw new Error(`${String(error)}${
|
|
26436
|
+
throw new Error(`${String(error)}${required2.size ? `; enabled agents: ${[...required2].join(", ")}` : ""}`);
|
|
26229
26437
|
});
|
|
26230
26438
|
}
|
|
26231
26439
|
async function bootstrapMachine(env = process.env) {
|