@songsid/agend 2.4.0-beta.27 → 2.4.0-beta.29
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/agent-cli-instructions.md +2 -1
- package/dist/agent-cli.js +6 -0
- package/dist/agent-cli.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.d.ts +13 -1
- package/dist/channel/adapters/discord.js +51 -21
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-turn-boundaries.d.ts +15 -0
- package/dist/claude-turn-boundaries.js +88 -0
- package/dist/claude-turn-boundaries.js.map +1 -0
- package/dist/contact-auth-service.js +3 -0
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +16 -0
- package/dist/contact-auth-store.js +61 -1
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/daemon.d.ts +12 -1
- package/dist/daemon.js +130 -19
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +38 -0
- package/dist/delivery-outbox.js +81 -1
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +17 -1
- package/dist/fleet-manager.js +239 -16
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +5 -0
- package/dist/general-knowledge/skills/task-board/SKILL.md +14 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +1 -1
- package/dist/host-memory.d.ts +21 -1
- package/dist/host-memory.js +30 -4
- package/dist/host-memory.js.map +1 -1
- package/dist/host-monitoring/linux/interpretation.js +1 -1
- package/dist/host-monitoring/linux/interpretation.js.map +1 -1
- package/dist/host-monitoring/wsl/interpretation.js +1 -1
- package/dist/host-monitoring/wsl/interpretation.js.map +1 -1
- package/dist/host-monitoring.d.ts +3 -1
- package/dist/hub/compose/server.js +1 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.js +100 -56
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +2 -0
- package/dist/hub/http/core.js +17 -7
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/policy.js +56 -27
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +1 -1
- package/dist/hub/roles/clock.js +8 -6
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/cutover-clock-facts.d.ts +13 -0
- package/dist/hub/roles/cutover-clock-facts.js +25 -0
- package/dist/hub/roles/cutover-clock-facts.js.map +1 -0
- package/dist/hub/roles/read.d.ts +2 -0
- package/dist/hub/roles/read.js +15 -6
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/rooms.d.ts +8 -4
- package/dist/hub/rooms.js +18 -5
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/send-timing.d.ts +6 -0
- package/dist/hub/send-timing.js +39 -0
- package/dist/hub/send-timing.js.map +1 -0
- package/dist/hub/settings-directory-decision.js +11 -5
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +1 -1
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/store.d.ts +4 -0
- package/dist/hub/store.js +19 -4
- package/dist/hub/store.js.map +1 -1
- package/dist/locale.js +19 -1
- package/dist/locale.js.map +1 -1
- package/dist/memory-pressure.js +8 -1
- package/dist/memory-pressure.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +4 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/request-context-activation.js +14 -3
- package/dist/request-context-activation.js.map +1 -1
- package/dist/request-context-call.d.ts +1 -0
- package/dist/request-context-call.js.map +1 -1
- package/dist/request-context-compatibility.js +10 -2
- package/dist/request-context-compatibility.js.map +1 -1
- package/dist/request-context-control-api.d.ts +18 -0
- package/dist/request-context-control-api.js +4 -2
- package/dist/request-context-control-api.js.map +1 -1
- package/dist/request-context-drain-projection.d.ts +8 -0
- package/dist/request-context-drain-projection.js +40 -0
- package/dist/request-context-drain-projection.js.map +1 -0
- package/dist/request-context-drain.d.ts +9 -0
- package/dist/request-context-drain.js +63 -4
- package/dist/request-context-drain.js.map +1 -1
- package/dist/request-context-human.d.ts +6 -0
- package/dist/request-context-human.js +24 -1
- package/dist/request-context-human.js.map +1 -1
- package/dist/request-context-migration.d.ts +11 -0
- package/dist/request-context-migration.js +16 -3
- package/dist/request-context-migration.js.map +1 -1
- package/dist/request-context-reply-pending.d.ts +16 -0
- package/dist/request-context-reply-pending.js +77 -0
- package/dist/request-context-reply-pending.js.map +1 -0
- package/dist/request-context-resolution.d.ts +35 -0
- package/dist/request-context-resolution.js +86 -0
- package/dist/request-context-resolution.js.map +1 -0
- package/dist/request-context-retirement.d.ts +2 -0
- package/dist/request-context-retirement.js.map +1 -1
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/scheduler/db.js +9 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +3 -6
- package/dist/scheduler/task-board-text.js +15 -10
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board-unread.d.ts +90 -0
- package/dist/scheduler/task-board-unread.js +192 -0
- package/dist/scheduler/task-board-unread.js.map +1 -0
- package/dist/scheduler/task-board.d.ts +324 -6
- package/dist/scheduler/task-board.js +786 -47
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/settings-effect.js +17 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/task-board-tool.js +24 -3
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +53 -2
- package/dist/task-board-waker.js +183 -12
- package/dist/task-board-waker.js.map +1 -1
- package/dist/transcript-monitor.d.ts +6 -1
- package/dist/transcript-monitor.js +59 -4
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-turns.d.ts +3 -0
- package/dist/transcript-turns.js +5 -0
- package/dist/transcript-turns.js.map +1 -1
- package/dist/ui/fleet-task-activity.js +164 -24
- package/dist/ui/fleet-task-card.js +77 -13
- package/dist/ui/fleet-task-common.js +14 -0
- package/dist/ui/fleet-task-flow.js +353 -0
- package/dist/ui/fleet-task-md.js +1 -1
- package/dist/ui/fleet-task-run.js +98 -22
- package/dist/ui/fleet-task-thread.js +245 -0
- package/dist/ui/fleet-task-unread.js +100 -0
- package/dist/ui/fleet-task-view.js +6 -5
- package/dist/ui/fleet-task-wake.js +140 -0
- package/dist/ui/fleet-tasks.js +13 -6
- package/dist/ui/host-health.js +3 -3
- package/dist/ui/host-monitoring-linux.js +2 -2
- package/dist/ui/host-monitoring-wsl.js +2 -2
- package/dist/ui/panel-windows-cli.js +2 -2
- package/dist/ui/request-context-control.js +51 -13
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +4 -1
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +8 -2
- package/dist/ui/shared/app.js +3 -0
- package/dist/ui/shared/task-board.css +164 -0
- package/dist/ui/shared/ui-icons.js +3 -0
- package/dist/ui/task-unread.js +70 -0
- package/dist/ui/windows-cli-catalog.js +33 -6
- package/dist/update-goback.js +3 -1
- package/dist/update-goback.js.map +1 -1
- package/dist/web-api.d.ts +45 -1
- package/dist/web-api.js +184 -6
- package/dist/web-api.js.map +1 -1
- package/dist/windows-cli-api.js +4 -2
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli.d.ts +40 -1
- package/dist/windows-cli.js +93 -11
- package/dist/windows-cli.js.map +1 -1
- package/dist/windows-shortcuts.d.ts +3 -22
- package/dist/windows-shortcuts.js +5 -45
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workflow-templates/default.md +3 -2
- package/dist/wsl-host.d.ts +52 -0
- package/dist/wsl-host.js +97 -0
- package/dist/wsl-host.js.map +1 -0
- package/package.json +1 -1
package/dist/hub/http/compose.js
CHANGED
|
@@ -1159,48 +1159,61 @@ export function createHubHttp(deps, sql) {
|
|
|
1159
1159
|
tail = tail.then(async () => {
|
|
1160
1160
|
if (ended)
|
|
1161
1161
|
return;
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
if (event.type === "unread.changed")
|
|
1178
|
-
data = { roomId: event.roomId, unread: directUnread(core, view) };
|
|
1179
|
-
else if (event.type === "room.changed")
|
|
1180
|
-
data = { roomId: event.roomId, room: directRoomView(view, directPresence(view.exposureId), directUnread(core, view), intros.projection(view.exposureId), groupRooms.agents.reported(view.exposureId)) };
|
|
1162
|
+
const finishTiming = core.sendTiming?.start("sse.project");
|
|
1163
|
+
try {
|
|
1164
|
+
let data;
|
|
1165
|
+
// Concurrent agent checks can briefly fill the person's physical read slots. Keep this event in the bounded
|
|
1166
|
+
// queue and re-read it after a short delay; persistent overload and all other failures still close the stream.
|
|
1167
|
+
for (let attempt = 0;; attempt++) {
|
|
1168
|
+
try {
|
|
1169
|
+
if (event.audiencePerson) {
|
|
1170
|
+
if (event.type === "invitation.changed") {
|
|
1171
|
+
data = personKeyString(await ctx.requirePerson()) === event.audiencePerson ? {} : null;
|
|
1172
|
+
}
|
|
1173
|
+
else if (event.type === "pins.changed") {
|
|
1174
|
+
// M-3340: the person's own pins changed (another tab or device): which room only; the page reads them again.
|
|
1175
|
+
data = personKeyString(await ctx.requirePerson()) === event.audiencePerson ? { roomId: event.roomId } : null;
|
|
1176
|
+
}
|
|
1181
1177
|
else {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1178
|
+
if (event.type === "unread.changed") {
|
|
1179
|
+
const view = await rooms.view(ctx, event.roomId);
|
|
1180
|
+
data = { roomId: event.roomId, unread: directUnread(core, view) };
|
|
1181
|
+
}
|
|
1182
|
+
else if (event.type === "room.changed") {
|
|
1183
|
+
const view = await rooms.view(ctx, event.roomId);
|
|
1184
|
+
data = { roomId: event.roomId, room: directRoomView(view, directPresence(view.exposureId), directUnread(core, view), intros.projection(view.exposureId), groupRooms.agents.reported(view.exposureId)) };
|
|
1185
|
+
}
|
|
1186
|
+
else {
|
|
1187
|
+
// readPage owns the complete current proof and its room projection. Do not acquire a second,
|
|
1188
|
+
// unused room proof before it; nothing is retained across this event or its viewer's session.
|
|
1189
|
+
if (typeof event.data.messageId !== "string")
|
|
1190
|
+
throw new HubProtocolError("invalid");
|
|
1191
|
+
const page = await rooms.readPage(ctx, event.roomId, 0, streamSession.sessionId, { before: null, limit: 100, messageId: event.data.messageId });
|
|
1192
|
+
const message = directMessages(page.room, page.entries, streamSession.displayName).find(m => m.id === event.data.messageId);
|
|
1193
|
+
data = message ? { roomId: event.roomId, message } : null;
|
|
1194
|
+
}
|
|
1185
1195
|
}
|
|
1186
1196
|
}
|
|
1197
|
+
else
|
|
1198
|
+
data = await groupRooms.event(ctx, event);
|
|
1199
|
+
break;
|
|
1200
|
+
}
|
|
1201
|
+
catch (error) {
|
|
1202
|
+
if (!(error instanceof HubProtocolError) || error.code !== "backpressure" || attempt >= 3)
|
|
1203
|
+
throw error;
|
|
1204
|
+
await new Promise(resolve => setTimeout(resolve, 25 * 2 ** attempt));
|
|
1205
|
+
if (ended || !live() || !ctx.isCurrent?.())
|
|
1206
|
+
return close();
|
|
1187
1207
|
}
|
|
1188
|
-
else
|
|
1189
|
-
data = await groupRooms.event(ctx, event);
|
|
1190
|
-
break;
|
|
1191
|
-
}
|
|
1192
|
-
catch (error) {
|
|
1193
|
-
if (!(error instanceof HubProtocolError) || error.code !== "backpressure" || attempt >= 3)
|
|
1194
|
-
throw error;
|
|
1195
|
-
await new Promise(resolve => setTimeout(resolve, 25 * 2 ** attempt));
|
|
1196
|
-
if (ended || !live() || !ctx.isCurrent?.())
|
|
1197
|
-
return close();
|
|
1198
1208
|
}
|
|
1209
|
+
if (ended || !live() || !ctx.isCurrent?.())
|
|
1210
|
+
return close();
|
|
1211
|
+
if (data && !res.write(`event: ${event.type}\ndata: ${JSON.stringify(data)}\n\n`))
|
|
1212
|
+
close();
|
|
1213
|
+
}
|
|
1214
|
+
finally {
|
|
1215
|
+
finishTiming?.();
|
|
1199
1216
|
}
|
|
1200
|
-
if (ended || !live() || !ctx.isCurrent?.())
|
|
1201
|
-
return close();
|
|
1202
|
-
if (data && !res.write(`event: ${event.type}\ndata: ${JSON.stringify(data)}\n\n`))
|
|
1203
|
-
close();
|
|
1204
1217
|
}).catch(close).finally(() => { queued--; });
|
|
1205
1218
|
});
|
|
1206
1219
|
const pushNotices = async () => {
|
|
@@ -1432,11 +1445,17 @@ export function createHubHttp(deps, sql) {
|
|
|
1432
1445
|
if (!b.mentions.every((x) => x === own || x === "all"))
|
|
1433
1446
|
throw new HubProtocolError("invalid");
|
|
1434
1447
|
}
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1448
|
+
const finishTiming = core.sendTiming?.start("submit");
|
|
1449
|
+
try {
|
|
1450
|
+
const receipt = await guard(() => rooms.ask(ctx, roomId, uuid(b.idempotencyKey), typeof b.text === "string" ? b.text : "", files));
|
|
1451
|
+
const room = await guard(() => rooms.view(ctx, roomId));
|
|
1452
|
+
groupRooms.publish({ type: "message.added", roomId, data: { roomId, messageId: receipt.messageId }, audiencePerson: personKeyString(room.asker) });
|
|
1453
|
+
return send(res, 200, { id: receipt.messageId, roomId, at: receipt.at, author: { kind: "person", id: personKeyString(room.asker), name: signedIn().displayName },
|
|
1454
|
+
text: typeof b.text === "string" ? b.text : "", mentions: [], idempotencyKey: b.idempotencyKey, receipt });
|
|
1455
|
+
}
|
|
1456
|
+
finally {
|
|
1457
|
+
finishTiming?.();
|
|
1458
|
+
}
|
|
1440
1459
|
}
|
|
1441
1460
|
throw new HttpError(405, "method");
|
|
1442
1461
|
}
|
|
@@ -1913,10 +1932,17 @@ export function createHubHttp(deps, sql) {
|
|
|
1913
1932
|
return;
|
|
1914
1933
|
throw error;
|
|
1915
1934
|
}
|
|
1916
|
-
case "agent.state":
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1935
|
+
case "agent.state": {
|
|
1936
|
+
const finishTiming = core.sendTiming?.start("agent.state");
|
|
1937
|
+
try {
|
|
1938
|
+
groupRooms.agents.state(frame.payload, link);
|
|
1939
|
+
directAgentChanged(frame.payload.exposureId);
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
finally {
|
|
1943
|
+
finishTiming?.();
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1920
1946
|
// M-3127 (agent reactions, on room-answer-buttons-v1): an agent's reaction to the room question it was asked; the result says why not.
|
|
1921
1947
|
case "room.react":
|
|
1922
1948
|
try {
|
|
@@ -1951,21 +1977,39 @@ export function createHubHttp(deps, sql) {
|
|
|
1951
1977
|
return { ...reply, type: "question.close-result", payload };
|
|
1952
1978
|
}
|
|
1953
1979
|
case "receipt": {
|
|
1954
|
-
const
|
|
1955
|
-
|
|
1956
|
-
|
|
1980
|
+
const finishTiming = core.sendTiming?.start("receipt");
|
|
1981
|
+
try {
|
|
1982
|
+
const payload = rooms.receipt(frame.payload, link);
|
|
1983
|
+
directChanged(payload.messageId, false);
|
|
1984
|
+
return { ...reply, type: "receipt", payload };
|
|
1985
|
+
}
|
|
1986
|
+
finally {
|
|
1987
|
+
finishTiming?.();
|
|
1988
|
+
}
|
|
1957
1989
|
}
|
|
1958
1990
|
case "answer": {
|
|
1959
|
-
const
|
|
1960
|
-
|
|
1961
|
-
|
|
1991
|
+
const finishTiming = core.sendTiming?.start("answer");
|
|
1992
|
+
try {
|
|
1993
|
+
const payload = await rooms.answer(frame.payload, link);
|
|
1994
|
+
directChanged(payload.messageId, true);
|
|
1995
|
+
return { ...reply, type: "receipt", payload };
|
|
1996
|
+
}
|
|
1997
|
+
finally {
|
|
1998
|
+
finishTiming?.();
|
|
1999
|
+
}
|
|
1962
2000
|
}
|
|
1963
2001
|
case "authorize.request": {
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2002
|
+
const finishTiming = core.sendTiming?.start(`authorize.${frame.payload.phase}`);
|
|
2003
|
+
try {
|
|
2004
|
+
const payload = await policy.authorize(frame.payload, link);
|
|
2005
|
+
// M-3596: a begin lease is the hand-off to the agent: the asker's question now reads "working on it".
|
|
2006
|
+
if (payload.ok && frame.payload.phase === "begin")
|
|
2007
|
+
directStarted(frame.payload.messageId);
|
|
2008
|
+
return { ...reply, type: "authorize.result", payload };
|
|
2009
|
+
}
|
|
2010
|
+
finally {
|
|
2011
|
+
finishTiming?.();
|
|
2012
|
+
}
|
|
1969
2013
|
}
|
|
1970
2014
|
case "reconcile": {
|
|
1971
2015
|
const page = rooms.reconcile(frame.payload, link);
|