usebeeline 0.0.94 → 0.0.95
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/usebeeline.mjs +27 -14
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -7906,6 +7906,16 @@ var ModelSelectionUnavailableError = class extends Error {
|
|
|
7906
7906
|
this.guidance = input.guidance;
|
|
7907
7907
|
}
|
|
7908
7908
|
};
|
|
7909
|
+
function withEffectiveCurrentValues(options, selection) {
|
|
7910
|
+
if (!selection || !selection.model && !selection.effort)
|
|
7911
|
+
return options;
|
|
7912
|
+
return options.map((option) => {
|
|
7913
|
+
const target = modelSelectionTargets(selection).find((entry) => entry.categories.includes(option.category));
|
|
7914
|
+
if (!target?.value || option.currentValue === target.value)
|
|
7915
|
+
return option;
|
|
7916
|
+
return { ...option, currentValue: target.value };
|
|
7917
|
+
});
|
|
7918
|
+
}
|
|
7909
7919
|
function modelSelectionTargets(selection) {
|
|
7910
7920
|
return [
|
|
7911
7921
|
{ categories: ["model"], label: "model", value: selection.model },
|
|
@@ -8128,7 +8138,8 @@ async function syncAgentModelCatalog(input) {
|
|
|
8128
8138
|
...configuration.effort ? { effort: configuration.effort } : {}
|
|
8129
8139
|
} : input.runtimeSelection;
|
|
8130
8140
|
const { catalog } = await withTimeout(fetchCatalog(input.agent, input.agentEnv, input.startupUnavailable ? void 0 : selection), input.timeoutMs ?? MODEL_CATALOG_PROBE_TIMEOUT_MS, "model catalog probe");
|
|
8131
|
-
const
|
|
8141
|
+
const effectiveCatalog = input.startupUnavailable ? catalog : withEffectiveCurrentValues(catalog, selection);
|
|
8142
|
+
const hash = modelCatalogHash(effectiveCatalog, selection, input.startupUnavailable);
|
|
8132
8143
|
const previous = await readFile(hashPath, "utf8").catch(() => "");
|
|
8133
8144
|
if (previous.trim() === hash)
|
|
8134
8145
|
return "unchanged";
|
|
@@ -8136,7 +8147,7 @@ async function syncAgentModelCatalog(input) {
|
|
|
8136
8147
|
agentId: input.agentId,
|
|
8137
8148
|
workspaceId: input.workspaceId,
|
|
8138
8149
|
// `fetchAgentModelCatalog` already applied the category allow-list.
|
|
8139
|
-
options:
|
|
8150
|
+
options: effectiveCatalog,
|
|
8140
8151
|
...selection ? { selection } : {},
|
|
8141
8152
|
...input.startupUnavailable ? { unavailable: input.startupUnavailable } : {}
|
|
8142
8153
|
});
|
|
@@ -8169,7 +8180,7 @@ function isAgentCommand(value) {
|
|
|
8169
8180
|
if (!["input", "resume", "stop"].includes(String(c2.action)) || !Number.isInteger(c2.agentDepth) || Number(c2.agentDepth) < 0 || Number(c2.agentDepth) > 3)
|
|
8170
8181
|
return false;
|
|
8171
8182
|
const source = c2.source;
|
|
8172
|
-
return Boolean(source && typeof source.id === "string" && typeof source.authorId === "string" && typeof source.body === "string" && typeof source.createdAt === "number" && Array.isArray(source.attachments)
|
|
8183
|
+
return Boolean(source && typeof source.id === "string" && typeof source.authorId === "string" && typeof source.body === "string" && typeof source.createdAt === "number" && Array.isArray(source.attachments));
|
|
8173
8184
|
}
|
|
8174
8185
|
|
|
8175
8186
|
// packages/api-contract/dist/system-events.js
|
|
@@ -18249,6 +18260,8 @@ var BEELINE_ROOM_CAPABILITIES = [
|
|
|
18249
18260
|
`To react to things that HAPPEN in this Room rather than only to what is said to you, call beeline-agent subscribe_events with the kinds you want (${SERVER_EVENT_KINDS.join(", ")}); each one then wakes you for a turn. It replaces your list, so send every kind you want - list_event_subscriptions shows the current one. You do this yourself: nobody has to configure it for you. grant-decided carries the grant id and status and resumes the turn that asked for the grant.`,
|
|
18250
18261
|
"To state something that happened so the Room and other agents can act on it, call beeline-agent emit_event with your own agent:<slug> kind, one sentence, and optionally the agent members to wake. Chains of events are bounded and a refused emit posts nothing.",
|
|
18251
18262
|
"When repository work is needed, you MUST call beeline-agent open_corner with a name of at most three words - it titles the corner everywhere - and a complete objective of no more than 24 words. The host-governed call is the only way to start write work.",
|
|
18263
|
+
"Never open a corner from your own reading of a person's ask. For every ask, first reply on one line `Proposed corner: <name> \u2014 <objective>`, using the exact title and objective you would pass to open_corner, then stop and wait. If one message contains several asks, list one numbered `Proposed corner:` line per ask; `go on 1 and 3` opens exactly those objectives and leaves the others proposed. A person's `go`, `yes`, or equivalent opens exactly the proposed corner; if they edit it, their edited text is the objective. Skip this ceremony only when the message itself explicitly commands a corner and states its scope, such as `open a corner and do X` or `go build X in a corner`; open that scope immediately.",
|
|
18264
|
+
"Agreement is not action: never merely acknowledge an ask. Reply with a proposed corner, a question, or a line beginning `parked:` with the reason.",
|
|
18252
18265
|
"When open_corner succeeds, the server posts the corner card: do not announce or restate the opening. End the turn with nothing more unless the person asked something else.",
|
|
18253
18266
|
"Never claim an action or reply happened unless the prompt or a tool result proves it."
|
|
18254
18267
|
].join(" ");
|
|
@@ -19842,14 +19855,14 @@ var AgentTurnStream = class {
|
|
|
19842
19855
|
this.close();
|
|
19843
19856
|
const { api, roomId, requestId } = this.options;
|
|
19844
19857
|
if (reply) {
|
|
19845
|
-
|
|
19858
|
+
await api.execute("postRoomMessage", {
|
|
19846
19859
|
roomId,
|
|
19847
19860
|
requestId,
|
|
19848
19861
|
text: reply,
|
|
19849
19862
|
presentation: "message",
|
|
19850
19863
|
...fields
|
|
19851
19864
|
});
|
|
19852
|
-
onReplyPosted?.(
|
|
19865
|
+
onReplyPosted?.();
|
|
19853
19866
|
}
|
|
19854
19867
|
await this.retract();
|
|
19855
19868
|
}
|
|
@@ -21240,23 +21253,23 @@ function isRoomMcpPermissionRequest(request, mountedServers = ROOM_MOUNTED_MCP_S
|
|
|
21240
21253
|
return false;
|
|
21241
21254
|
return isMountedMcpToolPermissionRequest(request, mountedServers);
|
|
21242
21255
|
}
|
|
21243
|
-
function isScheduledPrompt(item
|
|
21244
|
-
if (item.type !== "system"
|
|
21256
|
+
function isScheduledPrompt(item) {
|
|
21257
|
+
if (item.type !== "system")
|
|
21245
21258
|
return false;
|
|
21246
21259
|
if (item.systemEvent?.kind)
|
|
21247
21260
|
return item.systemEvent.kind === "schedule-ran";
|
|
21248
21261
|
return item.systemEvent?.verb === SCHEDULE_RAN_VERB;
|
|
21249
21262
|
}
|
|
21250
|
-
function inboxItemAuthorName(item,
|
|
21251
|
-
if (isScheduledPrompt(item
|
|
21263
|
+
function inboxItemAuthorName(item, names) {
|
|
21264
|
+
if (isScheduledPrompt(item))
|
|
21252
21265
|
return SCHEDULE_SCHEDULER_NAME;
|
|
21253
21266
|
const subject = item.systemEvent?.subject;
|
|
21254
21267
|
if (item.type === "system" && subject?.name)
|
|
21255
21268
|
return subject.name;
|
|
21256
21269
|
return names.get(item.authorId) ?? item.authorId.slice(0, 12);
|
|
21257
21270
|
}
|
|
21258
|
-
function inboxItemPromptBody(item
|
|
21259
|
-
return isScheduledPrompt(item
|
|
21271
|
+
function inboxItemPromptBody(item) {
|
|
21272
|
+
return isScheduledPrompt(item) ? item.systemEvent?.consequence ?? item.body : item.body;
|
|
21260
21273
|
}
|
|
21261
21274
|
function pendingGrantToolCall(call) {
|
|
21262
21275
|
if (!/(?:^|[._:/-])request_grant$/i.test(call.title ?? ""))
|
|
@@ -21777,8 +21790,8 @@ var MonolithRoomTurnLoop = class {
|
|
|
21777
21790
|
"If the current task is only a nudge to respond, answer the most recent unanswered human message in the conversation instead of echoing the nudge.",
|
|
21778
21791
|
MAINTAIN_ASSIGNED_IDENTITY_DIRECTIVE
|
|
21779
21792
|
].join(" "),
|
|
21780
|
-
`Current task selected by the server from ${inboxItemAuthorName(item,
|
|
21781
|
-
roomMessagePrompt("", inboxItemPromptBody(item
|
|
21793
|
+
`Current task selected by the server from ${inboxItemAuthorName(item, names)}:`,
|
|
21794
|
+
roomMessagePrompt("", inboxItemPromptBody(item), item.attachments, delivered, this.acceptsImages())
|
|
21782
21795
|
].filter(Boolean).join("\n\n");
|
|
21783
21796
|
const stream = new AgentTurnStream({
|
|
21784
21797
|
api,
|
|
@@ -23921,7 +23934,7 @@ var RoomRuntimeCoordinator = class {
|
|
|
23921
23934
|
roomId: cornerId,
|
|
23922
23935
|
limit: 50
|
|
23923
23936
|
});
|
|
23924
|
-
const asked = [...conversation.items].reverse().find((item) => item.type === "message" && item.
|
|
23937
|
+
const asked = [...conversation.items].reverse().find((item) => item.type === "message" && item.authorId !== this.agent.publicKey);
|
|
23925
23938
|
if (!asked)
|
|
23926
23939
|
return;
|
|
23927
23940
|
const reason = distillTurnFailureReason(error);
|