@songsid/agend 2.4.0-beta.13 → 2.4.0-beta.14
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-endpoint.js +28 -6
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/backend/claude-code.d.ts +9 -0
- package/dist/backend/claude-code.js +60 -4
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/grok.js +11 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +3 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +1 -16
- package/dist/backend-availability.js +2 -91
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-version-static.d.ts +15 -0
- package/dist/backend-version-static.js +95 -0
- package/dist/backend-version-static.js.map +1 -0
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/telegram.js +3 -1
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +18 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/tool-router.d.ts +4 -0
- package/dist/channel/tool-router.js +43 -19
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +3 -0
- package/dist/classic-channel-manager.js +18 -0
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/classic-cli-guard.d.ts +66 -0
- package/dist/classic-cli-guard.js +209 -0
- package/dist/classic-cli-guard.js.map +1 -0
- package/dist/cli-audited.js +7 -5
- package/dist/cli-audited.js.map +1 -1
- package/dist/config-validator.js +3 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/contact-auth-api.d.ts +16 -0
- package/dist/contact-auth-api.js +78 -0
- package/dist/contact-auth-api.js.map +1 -0
- package/dist/contact-auth-files.d.ts +6 -0
- package/dist/contact-auth-files.js +29 -0
- package/dist/contact-auth-files.js.map +1 -0
- package/dist/contact-auth-policy.d.ts +75 -0
- package/dist/contact-auth-policy.js +23 -0
- package/dist/contact-auth-policy.js.map +1 -0
- package/dist/contact-auth-service.d.ts +32 -0
- package/dist/contact-auth-service.js +99 -0
- package/dist/contact-auth-service.js.map +1 -0
- package/dist/contact-auth-store.d.ts +75 -0
- package/dist/contact-auth-store.js +295 -0
- package/dist/contact-auth-store.js.map +1 -0
- package/dist/contact-auth-types.d.ts +170 -0
- package/dist/contact-auth-types.js +7 -0
- package/dist/contact-auth-types.js.map +1 -0
- package/dist/daemon.d.ts +8 -0
- package/dist/daemon.js +93 -4
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +6 -0
- package/dist/delivery-outbox.js +19 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +40 -0
- package/dist/fleet-manager.js +429 -22
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +18 -0
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +28 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -0
- package/dist/hub/audit/index.d.ts +3 -1
- package/dist/hub/audit/index.js +35 -3
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/catalog.d.ts +8 -0
- package/dist/hub/catalog.js +39 -4
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/compose/server.d.ts +2 -0
- package/dist/hub/compose/server.js +11 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.js +5 -2
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +5 -1
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +123 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +2 -0
- package/dist/hub/http/schema.js +6 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/invitations.js +15 -7
- package/dist/hub/invitations.js.map +1 -1
- package/dist/hub/roles/cutover-inventory.d.ts +3 -0
- package/dist/hub/roles/cutover-inventory.js +20 -4
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover-marker.d.ts +18 -2
- package/dist/hub/roles/cutover-marker.js +6 -2
- package/dist/hub/roles/cutover-marker.js.map +1 -1
- package/dist/hub/room-agent-discovery-model.d.ts +29 -0
- package/dist/hub/room-agent-discovery-model.js +33 -0
- package/dist/hub/room-agent-discovery-model.js.map +1 -0
- package/dist/hub/room-agent-discovery.d.ts +14 -0
- package/dist/hub/room-agent-discovery.js +65 -0
- package/dist/hub/room-agent-discovery.js.map +1 -0
- package/dist/hub/room-agent-requests.d.ts +71 -0
- package/dist/hub/room-agent-requests.js +377 -0
- package/dist/hub/room-agent-requests.js.map +1 -0
- package/dist/hub/rooms/directory.d.ts +13 -0
- package/dist/hub/rooms/directory.js +12 -3
- package/dist/hub/rooms/directory.js.map +1 -1
- package/dist/hub/rooms/schema.d.ts +5 -0
- package/dist/hub/rooms/schema.js +9 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +43 -19
- package/dist/hub/rooms/service.js +67 -11
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +1 -1
- package/dist/instance-lifecycle.d.ts +3 -1
- package/dist/instance-lifecycle.js +4 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +28 -4
- package/dist/locale.js.map +1 -1
- package/dist/needs-you-hub.d.ts +1 -0
- package/dist/needs-you-hub.js +6 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +10 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +9 -0
- package/dist/outbound-handlers.js +46 -10
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/runtime-cli-install.js +7 -7
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/topic-commands.d.ts +1 -1
- package/dist/topic-commands.js +4 -6
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/contact-auth-client.js +48 -0
- package/dist/ui/contact-auth-strings.js +164 -0
- package/dist/ui/contact-authorizations.js +125 -0
- package/dist/ui/contact-needs.js +84 -0
- package/dist/ui/contact-permissions.js +193 -0
- package/dist/ui/contact-ticket-badge.js +54 -0
- package/dist/ui/hub-client.js +30 -7
- package/dist/ui/hub-invitations.js +5 -1
- package/dist/ui/hub-room-new.js +10 -3
- package/dist/ui/hub-room-owner-requests-strings.js +114 -0
- package/dist/ui/hub-room-owner-requests.js +264 -0
- package/dist/ui/hub-room-pins.js +43 -0
- package/dist/ui/hub-room-settings.js +11 -2
- package/dist/ui/hub-room-strings.js +3 -0
- package/dist/ui/hub-room-thread.js +47 -5
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/panel-details.js +2 -0
- package/dist/ui/panel-fleet.js +3 -2
- package/dist/ui/panel-hub.js +7 -1
- package/dist/ui/panel-needs.js +5 -1
- package/dist/ui/panel-settings.js +3 -0
- package/dist/ui/shared/app-route.js +1 -1
- package/dist/ui/shared/app-shell.js +2 -0
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +31 -0
- package/dist/ui/shared/chat-quote.js +26 -2
- package/dist/ui/shared/chat-thread.js +6 -2
- package/dist/ui/shared/hub-rooms-u2.css +22 -0
- package/dist/ui/shared/text-undo.js +17 -3
- package/dist/web-api.d.ts +9 -0
- package/dist/web-api.js +55 -3
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +5 -0
- package/dist/web-chat-history.js +26 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-reply-files.d.ts +1 -0
- package/dist/web-reply-files.js +2 -0
- package/dist/web-reply-files.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +2 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/package.json +1 -1
|
@@ -156,14 +156,23 @@ export function installTextUndo({ doc = document, win = typeof window !== "undef
|
|
|
156
156
|
// The browser's own undo or redo went ahead (one it could not cancel, or a script's execCommand("undo"), which has no
|
|
157
157
|
// beforeinput): what it left is a change of its own — the history starts afresh.
|
|
158
158
|
if (h.native || e.inputType === "historyUndo" || e.inputType === "historyRedo") { h.native = false; h.undo = []; h.redo = []; h.kind = null; }
|
|
159
|
-
|
|
159
|
+
// M-3356 (the user, iPhone, 注音: the candidate bar blanked on every key): never read the field's selection while an
|
|
160
|
+
// IME composes — iOS redraws its candidate bar when the page asks. compositionend (and WebKit's input after it) take
|
|
161
|
+
// the value the next edit starts from.
|
|
162
|
+
if (h.composing || e.isComposing) return;
|
|
163
|
+
h.last = snap(el);
|
|
160
164
|
};
|
|
161
165
|
const onCompStart = (e) => {
|
|
162
166
|
const el = field(e);
|
|
163
167
|
if (!el) return;
|
|
164
168
|
const h = historyFor(el);
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
// M-3356: the step a composition begins is the field as the last edit left it (already read, outside the composition);
|
|
170
|
+
// only a field a script changed since is read again. The price (#4208 review F2): a caret moved since without an
|
|
171
|
+
// edit (a tap elsewhere) is not in that step, so undoing the composition puts the caret where the last edit ended —
|
|
172
|
+
// the value is right. Reading it here is what iOS answers with a candidate-bar redraw.
|
|
173
|
+
if (String(el.value ?? "") === h.last.v) { h.marked = null; push(h.undo, h.last); }
|
|
174
|
+
else { sync(el, h); push(h.undo, snap(el)); }
|
|
175
|
+
h.redo = [];
|
|
167
176
|
h.composing = true; h.kind = null;
|
|
168
177
|
};
|
|
169
178
|
const onCompEnd = (e) => {
|
|
@@ -173,6 +182,9 @@ export function installTextUndo({ doc = document, win = typeof window !== "undef
|
|
|
173
182
|
h.composing = false;
|
|
174
183
|
h.last = snap(el); // WebKit's last input comes after compositionend: onInput updates it again
|
|
175
184
|
};
|
|
185
|
+
// M-3356: a field's history starts when it takes the focus — its first read is never inside a composition (a first key
|
|
186
|
+
// that starts an IME would otherwise read the selection there).
|
|
187
|
+
const onFocus = (e) => { const el = field(e); if (el) historyFor(el); };
|
|
176
188
|
const onKey = (e) => {
|
|
177
189
|
const el = field(e);
|
|
178
190
|
if (!el) return;
|
|
@@ -181,6 +193,7 @@ export function installTextUndo({ doc = document, win = typeof window !== "undef
|
|
|
181
193
|
e.preventDefault(); // never the browser's page-wide stack, even when this field has no step
|
|
182
194
|
step(el, which === "redo", win);
|
|
183
195
|
};
|
|
196
|
+
doc.addEventListener("focusin", onFocus, true);
|
|
184
197
|
doc.addEventListener("beforeinput", onBefore, true);
|
|
185
198
|
doc.addEventListener("input", onInput, true);
|
|
186
199
|
doc.addEventListener("compositionstart", onCompStart, true);
|
|
@@ -188,6 +201,7 @@ export function installTextUndo({ doc = document, win = typeof window !== "undef
|
|
|
188
201
|
doc.addEventListener("keydown", onKey, true);
|
|
189
202
|
return () => {
|
|
190
203
|
doc.removeEventListener("beforeinput", onBefore, true);
|
|
204
|
+
doc.removeEventListener("focusin", onFocus, true);
|
|
191
205
|
doc.removeEventListener("input", onInput, true);
|
|
192
206
|
doc.removeEventListener("compositionstart", onCompStart, true);
|
|
193
207
|
doc.removeEventListener("compositionend", onCompEnd, true);
|
package/dist/web-api.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ContactApiHost } from "./contact-auth-api.js";
|
|
1
2
|
import { type HumanOrigin } from "./human-delivery-receipts.js";
|
|
2
3
|
import { type HumanAuthority, type WebAuthorityResult, type WebPeer } from "./authority/web-authority.js";
|
|
3
4
|
import type { CachedImage } from "./web-images.js";
|
|
@@ -57,6 +58,14 @@ export type AccountWriteResult = {
|
|
|
57
58
|
message?: string;
|
|
58
59
|
};
|
|
59
60
|
export interface WebApiContext {
|
|
61
|
+
contactPermissions?: ContactApiHost["contactPermissions"];
|
|
62
|
+
writeContactPermissions?: ContactApiHost["writeContactPermissions"];
|
|
63
|
+
contactAuthorization?: ContactApiHost["contactAuthorization"];
|
|
64
|
+
contactAuthorizations?: ContactApiHost["contactAuthorizations"];
|
|
65
|
+
decideContactAuthorization?: ContactApiHost["decideContactAuthorization"];
|
|
66
|
+
contactActor?(req: IncomingMessage, url: URL): import("./contact-auth-types.js").ContactPerson | null;
|
|
67
|
+
contactNeeds?(actor: import("./contact-auth-types.js").ContactPerson): unknown[];
|
|
68
|
+
acknowledgeContactSuggestion?(instance: string, actor: import("./contact-auth-types.js").ContactPerson): void;
|
|
60
69
|
recoverNativePane?(name: string, launchId: string, authorized: () => boolean): Promise<void>;
|
|
61
70
|
startFreshNativePane?(name: string, launchId: string, sessionId: string | null, authorized: () => boolean): Promise<void>;
|
|
62
71
|
nativeInstanceRuntime?(): import("./fleet-windows-runtime.js").FleetWindowsRuntime;
|
package/dist/web-api.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pipeline } from "node:stream/promises";
|
|
2
|
+
import { handleContactAuthorizationApi } from "./contact-auth-api.js";
|
|
2
3
|
import { buildAgentExport, parseAgentExport } from "./agent-export.js";
|
|
3
4
|
import { STRUCTURED_PROFILE_BACKENDS } from "./structured-signin-transport.js";
|
|
4
5
|
import { hubModeOf, hubNameOf } from "./hub-mode.js";
|
|
@@ -218,6 +219,12 @@ const safeInstanceSegment = (name) => /^[^\\/\x00]+$/.test(name) && name !== "."
|
|
|
218
219
|
*/
|
|
219
220
|
/** #1920 phase 1b: the open streams that are a guest's, and whose — each event is projected for them (guestFrameData). */
|
|
220
221
|
const streamGuests = new WeakMap();
|
|
222
|
+
const streamContactProjection = new WeakMap();
|
|
223
|
+
function contactNeedsFor(req, url, ctx, base) {
|
|
224
|
+
const ordinary = base.filter(item => !item || typeof item !== "object" || item.type !== "contact");
|
|
225
|
+
const actor = ctx.contactActor?.(req, url);
|
|
226
|
+
return actor && ctx.contactNeeds ? [...ordinary, ...ctx.contactNeeds(actor)] : ordinary;
|
|
227
|
+
}
|
|
221
228
|
/**
|
|
222
229
|
* The task board's rule over the public link: an instance kept out of sight (cross_instance_visibility: hidden) is not
|
|
223
230
|
* shown, nor a card that names one as its assignee, creator or dispatcher. Off the link nothing is hidden. Read when
|
|
@@ -334,7 +341,10 @@ export function broadcastSseEvent(clients, event, data, onError, id) {
|
|
|
334
341
|
client.write(sseFrame(event, shown));
|
|
335
342
|
continue;
|
|
336
343
|
}
|
|
337
|
-
|
|
344
|
+
const project = streamContactProjection.get(client);
|
|
345
|
+
const shown = project ? project(event, data) : data;
|
|
346
|
+
if (shown !== undefined)
|
|
347
|
+
client.write(shown === data ? payload : sseFrame(event, shown, id));
|
|
338
348
|
}
|
|
339
349
|
catch (err) {
|
|
340
350
|
dead.push(client);
|
|
@@ -2649,6 +2659,9 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2649
2659
|
}
|
|
2650
2660
|
if (handleAgentRuntimeChange(req, res, url, ctx))
|
|
2651
2661
|
return true;
|
|
2662
|
+
if (ctx.contactPermissions && ctx.writeContactPermissions && ctx.contactAuthorization && ctx.contactAuthorizations && ctx.decideContactAuthorization && ctx.contactActor
|
|
2663
|
+
&& handleContactAuthorizationApi(req, res, url, ctx))
|
|
2664
|
+
return true;
|
|
2652
2665
|
if (handleNativeInstanceRequest(req, res, url, ctx))
|
|
2653
2666
|
return true;
|
|
2654
2667
|
if (handleWindowsCliRequest(req, res, url, ctx))
|
|
@@ -2993,7 +3006,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2993
3006
|
prompts: ctx.listWebPrompts?.() ?? [],
|
|
2994
3007
|
// #1386: "Needs you" rides the passive channels only — no endpoint of its own to poll. Over the public link,
|
|
2995
3008
|
// without the task board's hidden cards (#2306 review).
|
|
2996
|
-
needs: visibleNeeds(ctx, linkRestricted(req, url, ctx), ctx.needsYouItems?.() ?? []),
|
|
3009
|
+
needs: visibleNeeds(ctx, linkRestricted(req, url, ctx), contactNeedsFor(req, url, ctx, ctx.needsYouItems?.() ?? [])),
|
|
2997
3010
|
// #1577: the newest message this answer accounts for — after a restart, the last restored one until this process
|
|
2998
3011
|
// records its own (`<boot>-0` would be after(0): the whole restored history again on every poll).
|
|
2999
3012
|
cursor: history ? history.pollCursor() : null,
|
|
@@ -3035,6 +3048,30 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3035
3048
|
streamGuests.set(res, guest);
|
|
3036
3049
|
guest.streamOpened?.();
|
|
3037
3050
|
}
|
|
3051
|
+
if (!guest && ctx.contactActor)
|
|
3052
|
+
streamContactProjection.set(res, (event, value) => {
|
|
3053
|
+
if (event === "needs")
|
|
3054
|
+
return { items: contactNeedsFor(req, url, ctx, (value && typeof value === "object" && Array.isArray(value.items)) ? value.items : []) };
|
|
3055
|
+
if (event === "contact-auth") {
|
|
3056
|
+
const actor = ctx.contactActor?.(req, url);
|
|
3057
|
+
if (!actor || !value || typeof value !== "object")
|
|
3058
|
+
return undefined;
|
|
3059
|
+
const change = value;
|
|
3060
|
+
try {
|
|
3061
|
+
if (change.ticketId)
|
|
3062
|
+
ctx.contactAuthorization?.(change.ticketId, actor);
|
|
3063
|
+
else if (change.instance)
|
|
3064
|
+
ctx.contactPermissions?.(change.instance, actor);
|
|
3065
|
+
else
|
|
3066
|
+
return undefined;
|
|
3067
|
+
return value;
|
|
3068
|
+
}
|
|
3069
|
+
catch {
|
|
3070
|
+
return undefined;
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
return value;
|
|
3074
|
+
});
|
|
3038
3075
|
const statusFrame = () => `event: status\ndata: ${JSON.stringify(guest ? guestStatus(ctx.getUiStatus(), guest.scope()) : ctx.getUiStatus())}\n\n`;
|
|
3039
3076
|
res.write(`${statusFrame()}${sseClock()}`);
|
|
3040
3077
|
// An EventSource that reconnects says what it last saw: send what it missed, before anything new.
|
|
@@ -3062,7 +3099,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3062
3099
|
res.write(`event: prompts\ndata: ${JSON.stringify(ctx.listWebPrompts())}\n\n`);
|
|
3063
3100
|
// #1386: and "Needs you" as it is now; changes follow as `needs` events.
|
|
3064
3101
|
if (!guest && ctx.needsYouItems)
|
|
3065
|
-
res.write(`event: needs\ndata: ${JSON.stringify({ items: ctx.needsYouItems() })}\n\n`);
|
|
3102
|
+
res.write(`event: needs\ndata: ${JSON.stringify({ items: contactNeedsFor(req, url, ctx, ctx.needsYouItems()) })}\n\n`);
|
|
3066
3103
|
ctx.sseClients.add(res);
|
|
3067
3104
|
// #1956: the heartbeat's status comes from the one build every open stream shares each tick (statusTick), with
|
|
3068
3105
|
// this stream's own projection; this stream's checks stay its own.
|
|
@@ -4617,6 +4654,21 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
4617
4654
|
json(res, 400, { error: "id required" });
|
|
4618
4655
|
return;
|
|
4619
4656
|
}
|
|
4657
|
+
if (id.startsWith("contact-suggest:")) {
|
|
4658
|
+
const actor = ctx.contactActor?.(req, url);
|
|
4659
|
+
if (!actor || !ctx.acknowledgeContactSuggestion) {
|
|
4660
|
+
json(res, 403, { error: "forbidden" });
|
|
4661
|
+
return;
|
|
4662
|
+
}
|
|
4663
|
+
try {
|
|
4664
|
+
ctx.acknowledgeContactSuggestion(id.slice("contact-suggest:".length), actor);
|
|
4665
|
+
json(res, 200, { acknowledged: true });
|
|
4666
|
+
}
|
|
4667
|
+
catch {
|
|
4668
|
+
json(res, 403, { error: "forbidden" });
|
|
4669
|
+
}
|
|
4670
|
+
return;
|
|
4671
|
+
}
|
|
4620
4672
|
const verdict = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
4621
4673
|
if (verdict.kind !== "allow") {
|
|
4622
4674
|
json(res, 401, { error: WEB_TOKEN_INVALID_MESSAGE });
|