@songsid/agend 2.4.0-beta.10 → 2.4.0-beta.12
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/accounts-view.d.ts +29 -0
- package/dist/accounts-view.js +2 -14
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +4 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +29 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +35 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-precaution.d.ts +7 -0
- package/dist/backend/codex-precaution.js +102 -0
- package/dist/backend/codex-precaution.js.map +1 -0
- package/dist/backend/codex.d.ts +1 -0
- package/dist/backend/codex.js +18 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok.js +21 -6
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +9 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +1 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-install-kind.d.ts +19 -0
- package/dist/claude-install-kind.js +54 -0
- package/dist/claude-install-kind.js.map +1 -0
- package/dist/cli-audited.js +3 -3
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.d.ts +5 -0
- package/dist/daemon.js +22 -4
- package/dist/daemon.js.map +1 -1
- package/dist/event-log.d.ts +12 -0
- package/dist/event-log.js +40 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-manager.d.ts +122 -2
- package/dist/fleet-manager.js +482 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +38 -6
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -1
- package/dist/hub/admin-dashboard.js +3 -3
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog-model.d.ts +276 -0
- package/dist/hub/agent-catalog-model.js +49 -0
- package/dist/hub/agent-catalog-model.js.map +1 -0
- package/dist/hub/agent-catalog.d.ts +137 -0
- package/dist/hub/agent-catalog.js +118 -0
- package/dist/hub/agent-catalog.js.map +1 -0
- package/dist/hub/agent-intro-model.d.ts +38 -0
- package/dist/hub/agent-intro-model.js +14 -0
- package/dist/hub/agent-intro-model.js.map +1 -0
- package/dist/hub/agent-intro-tool.d.ts +35 -0
- package/dist/hub/agent-intro-tool.js +83 -0
- package/dist/hub/agent-intro-tool.js.map +1 -0
- package/dist/hub/agent-intro.d.ts +31 -0
- package/dist/hub/agent-intro.js +51 -0
- package/dist/hub/agent-intro.js.map +1 -0
- package/dist/hub/catalog.d.ts +4 -2
- package/dist/hub/catalog.js +19 -3
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +3 -0
- package/dist/hub/client.js +47 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +19 -5
- package/dist/hub/compose/member.js +94 -13
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +5 -0
- package/dist/hub/compose/server.js +6 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/execution/service.d.ts +1 -1
- package/dist/hub/execution/service.js +1 -0
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/http/compose.d.ts +3 -0
- package/dist/hub/http/compose.js +122 -15
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +15 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/mcp/tools.js +2 -1
- package/dist/hub/mcp/tools.js.map +1 -1
- package/dist/hub/member/agent-catalog.d.ts +28 -0
- package/dist/hub/member/agent-catalog.js +80 -0
- package/dist/hub/member/agent-catalog.js.map +1 -0
- package/dist/hub/member/agent-intro.d.ts +28 -0
- package/dist/hub/member/agent-intro.js +66 -0
- package/dist/hub/member/agent-intro.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +3 -3
- package/dist/hub/member/exposure-api.js +4 -4
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +12 -4
- package/dist/hub/member/exposures.js +27 -13
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +14 -1
- package/dist/hub/member/room-ask.js +76 -10
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-context-budget.d.ts +5 -0
- package/dist/hub/member/room-context-budget.js +34 -0
- package/dist/hub/member/room-context-budget.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +1 -1
- package/dist/hub/member/room-post.d.ts +6 -3
- package/dist/hub/member/room-post.js +9 -3
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/sharing-journal.d.ts +252 -0
- package/dist/hub/member/sharing-journal.js +212 -0
- package/dist/hub/member/sharing-journal.js.map +1 -0
- package/dist/hub/member/sharing-link.d.ts +25 -0
- package/dist/hub/member/sharing-link.js +68 -0
- package/dist/hub/member/sharing-link.js.map +1 -0
- package/dist/hub/member/sharing-result.d.ts +6 -0
- package/dist/hub/member/sharing-result.js +46 -0
- package/dist/hub/member/sharing-result.js.map +1 -0
- package/dist/hub/member/sharing.d.ts +37 -0
- package/dist/hub/member/sharing.js +181 -0
- package/dist/hub/member/sharing.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +6 -0
- package/dist/hub/personal/owner-host.js +4 -2
- package/dist/hub/personal/owner-host.js.map +1 -1
- package/dist/hub/protocol.d.ts +398 -4
- package/dist/hub/protocol.js +13 -5
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-answer-status-model.d.ts +3 -0
- package/dist/hub/room-answer-status-model.js +4 -0
- package/dist/hub/room-answer-status-model.js.map +1 -0
- package/dist/hub/room-brief-model.d.ts +30 -0
- package/dist/hub/room-brief-model.js +37 -0
- package/dist/hub/room-brief-model.js.map +1 -0
- package/dist/hub/room-context-model.d.ts +2 -0
- package/dist/hub/room-context-model.js +2 -2
- package/dist/hub/room-context-model.js.map +1 -1
- package/dist/hub/room-members-model.d.ts +63 -0
- package/dist/hub/room-members-model.js +7 -0
- package/dist/hub/room-members-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +1 -0
- package/dist/hub/rooms/agents.js +62 -11
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/brief.d.ts +18 -0
- package/dist/hub/rooms/brief.js +39 -0
- package/dist/hub/rooms/brief.js.map +1 -0
- package/dist/hub/rooms/direct-view.d.ts +5 -1
- package/dist/hub/rooms/direct-view.js +2 -2
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/members-page.d.ts +33 -0
- package/dist/hub/rooms/members-page.js +37 -0
- package/dist/hub/rooms/members-page.js.map +1 -0
- package/dist/hub/rooms/purpose.d.ts +7 -0
- package/dist/hub/rooms/purpose.js +14 -0
- package/dist/hub/rooms/purpose.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +43 -0
- package/dist/hub/rooms/service.js +80 -22
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +6 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +9 -4
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +49 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sharing-previous-access.d.ts +22 -0
- package/dist/hub/sharing-previous-access.js +93 -0
- package/dist/hub/sharing-previous-access.js.map +1 -0
- package/dist/hub/sharing-requests.d.ts +171 -0
- package/dist/hub/sharing-requests.js +311 -0
- package/dist/hub/sharing-requests.js.map +1 -0
- package/dist/hub/sharing-retention.d.ts +47 -0
- package/dist/hub/sharing-retention.js +83 -0
- package/dist/hub/sharing-retention.js.map +1 -0
- package/dist/hub/sharing-withdrawal.d.ts +14 -0
- package/dist/hub/sharing-withdrawal.js +28 -0
- package/dist/hub/sharing-withdrawal.js.map +1 -0
- package/dist/hub/types.d.ts +13 -5
- package/dist/hub-page-sharing-settings.d.ts +6 -0
- package/dist/hub-page-sharing-settings.js +19 -0
- package/dist/hub-page-sharing-settings.js.map +1 -0
- package/dist/hub-room-reply-warning.d.ts +2 -0
- package/dist/hub-room-reply-warning.js +16 -0
- package/dist/hub-room-reply-warning.js.map +1 -0
- package/dist/hub-sharing-notice.d.ts +43 -0
- package/dist/hub-sharing-notice.js +34 -0
- package/dist/hub-sharing-notice.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +15 -0
- package/dist/instance-lifecycle.js +36 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +78 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +26 -0
- package/dist/login-controller.js +72 -2
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-flows.js.map +1 -1
- package/dist/native-mcp.js +1 -1
- package/dist/native-mcp.js.map +1 -1
- package/dist/needs-you-hub.js +1 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +8 -1
- package/dist/needs-you.js +6 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +2 -1
- package/dist/outbound-handlers.js +17 -4
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +10 -0
- package/dist/outbound-schemas.js +3 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +9 -3
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/remote-card-answer.d.ts +1 -1
- package/dist/remote-card-answer.js +8 -1
- package/dist/remote-card-answer.js.map +1 -1
- package/dist/remote-card-prompt.js +1 -1
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +84 -10
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +3 -0
- package/dist/settings-baseline.js +2 -2
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +3 -0
- package/dist/settings-effect.js +33 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/fleet-office-card.js +8 -4
- package/dist/ui/fleet-office-pack.d.ts +1 -0
- package/dist/ui/fleet-office-pack.js +6 -2
- package/dist/ui/fleet-office-play.js +84 -0
- package/dist/ui/fleet-office-store.js +23 -0
- package/dist/ui/fleet-office-zones.js +5 -1
- package/dist/ui/fleet-office.js +78 -8
- package/dist/ui/host-install.js +77 -3
- package/dist/ui/hub-agent-intro.js +35 -0
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-strings.js +4 -4
- package/dist/ui/hub-client.js +16 -1
- package/dist/ui/hub-grant-picker.js +25 -11
- package/dist/ui/hub-group-strings.js +3 -3
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-my-agents-model.js +42 -0
- package/dist/ui/hub-my-agents-strings.js +18 -0
- package/dist/ui/hub-my-agents.js +144 -0
- package/dist/ui/hub-owner-strings.js +5 -5
- package/dist/ui/hub-personal-agent.js +5 -4
- package/dist/ui/hub-room-composer.js +37 -6
- package/dist/ui/hub-room-list.js +4 -3
- package/dist/ui/hub-room-members.js +5 -2
- package/dist/ui/hub-room-new.js +8 -5
- package/dist/ui/hub-room-purpose.js +19 -0
- package/dist/ui/hub-room-search.js +1 -1
- package/dist/ui/hub-room-settings.js +9 -0
- package/dist/ui/hub-room-strings.js +6 -4
- package/dist/ui/hub-room-thread.js +70 -17
- package/dist/ui/hub-strings.js +5 -5
- package/dist/ui/hub-welcome.js +6 -6
- package/dist/ui/notice-hub-sharing.js +81 -0
- package/dist/ui/panel-chat.js +19 -5
- package/dist/ui/panel-hub.js +77 -29
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/settings-hub-connection.js +2 -2
- package/dist/ui/settings-hub-page-sharing.js +52 -0
- package/dist/ui/settings-hub.js +4 -2
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +14 -2
- package/dist/ui/shared/app-store.js +6 -2
- package/dist/ui/shared/app.js +3 -1
- package/dist/ui/shared/chat-msg-actions.js +3 -1
- package/dist/ui/shared/chat-quote.js +261 -0
- package/dist/ui/shared/hub-chat.css +31 -0
- package/dist/ui/shared/hub-my-agents.css +35 -0
- package/dist/ui/shared/hub-rooms-u2.css +5 -0
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/web-api.d.ts +21 -5
- package/dist/web-api.js +138 -7
- package/dist/web-api.js.map +1 -1
- package/dist/web-asset-version.d.ts +65 -0
- package/dist/web-asset-version.js +259 -0
- package/dist/web-asset-version.js.map +1 -0
- package/dist/web-host-guard.js +3 -1
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-host-install.d.ts +30 -3
- package/dist/web-host-install.js +50 -4
- package/dist/web-host-install.js.map +1 -1
- package/dist/web-notices.d.ts +17 -0
- package/dist/web-notices.js +47 -6
- package/dist/web-notices.js.map +1 -1
- package/dist/web-terminal.d.ts +5 -0
- package/dist/web-terminal.js +11 -0
- package/dist/web-terminal.js.map +1 -1
- package/launcher/agend-install.cjs +48 -7
- package/package.json +1 -1
package/dist/settings-api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hubPageSharingSettings, parseHubPageSharing } from "./hub-page-sharing-settings.js";
|
|
1
2
|
import { handleHubWebInitHttp } from "./hub/init/web-http.js";
|
|
2
3
|
import { connectInstallInfo } from "./connect/install.js";
|
|
3
4
|
import { handleHubWebAddressHttp } from "./hub/settings-web-address-http.js";
|
|
@@ -427,6 +428,78 @@ export function handleSettingsRequest(req, res, url, ctx) {
|
|
|
427
428
|
// #2667: validated with the ClassicBot rooms there are now — a guest grant naming one is not an unknown name.
|
|
428
429
|
const validateFleet = (config) => validateFleetConfig(config, { rooms: ctx.classicRoomNames?.() ?? [] });
|
|
429
430
|
const method = req.method ?? "GET";
|
|
431
|
+
const sharingNotice = path.match(/^\/api\/settings\/hub\/sharing-notices\/([a-f0-9]{64})(\/undo)?$/);
|
|
432
|
+
if (sharingNotice) {
|
|
433
|
+
const caller = () => {
|
|
434
|
+
const value = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
435
|
+
return value.kind === "allow" && value.via === "session" && value.session.tier === "admin" ? value.session.handle : null;
|
|
436
|
+
};
|
|
437
|
+
const actor = caller(), controller = ctx.hubSharing?.();
|
|
438
|
+
if (!actor) {
|
|
439
|
+
json(res, 403, { error: "admin_required" });
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
if (!controller) {
|
|
443
|
+
json(res, 404, { error: "unavailable" });
|
|
444
|
+
return true;
|
|
445
|
+
}
|
|
446
|
+
const current = () => caller() === actor && ctx.hubSharing?.() === controller;
|
|
447
|
+
if (method === "GET" && !sharingNotice[2]) {
|
|
448
|
+
const value = controller.view(sharingNotice[1]);
|
|
449
|
+
if (!current()) {
|
|
450
|
+
json(res, 403, { error: "admin_required" });
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
json(res, value ? 200 : 404, value ?? { error: "not_found" });
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
if (method !== "POST" || !sharingNotice[2]) {
|
|
457
|
+
json(res, 405, { error: "method_not_allowed" });
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
void readBody(req, 4096).then(async (bytes) => {
|
|
461
|
+
if (!current()) {
|
|
462
|
+
json(res, 403, { error: "admin_required" });
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const body = JSON.parse(bytes.toString("utf8"));
|
|
466
|
+
if (!body || typeof body !== "object" || Array.isArray(body) || Object.keys(body).length) {
|
|
467
|
+
json(res, 400, { error: "invalid" });
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
try {
|
|
471
|
+
const before = controller.view(sharingNotice[1]);
|
|
472
|
+
if (!before) {
|
|
473
|
+
json(res, 404, { error: "not_found" });
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (before.state !== "undone" && Date.now() >= before.undoUntil) {
|
|
477
|
+
json(res, 409, { error: "expired" });
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (before.state === "pending" || !before.rows.some(row => row.state === "shared" || row.state === "stopped" || row.state === "undone" || row.state === "changed")) {
|
|
481
|
+
json(res, 409, { error: "not_available" });
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const value = await controller.undo(sharingNotice[1], `web:${actor}`, current);
|
|
485
|
+
if (!current()) {
|
|
486
|
+
json(res, 403, { error: "admin_required" });
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
json(res, 200, value);
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
if (!current()) {
|
|
493
|
+
json(res, 403, { error: "admin_required" });
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
// The journal may already contain an effect; a transport/notice failure is not a definite failure of Undo.
|
|
497
|
+
const value = controller.view(sharingNotice[1]);
|
|
498
|
+
json(res, 202, { pending: true, notice: value });
|
|
499
|
+
}
|
|
500
|
+
}).catch(() => json(res, 400, { error: "invalid" }));
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
430
503
|
const updateConsent = path === "/api/settings/hub/update-consent";
|
|
431
504
|
const updateRequest = path.match(/^\/api\/settings\/hub\/fleet-updates\/([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})(\/cancel)?$/);
|
|
432
505
|
if (updateConsent || updateRequest) {
|
|
@@ -1040,9 +1113,10 @@ export function handleSettingsRequest(req, res, url, ctx) {
|
|
|
1040
1113
|
// Remaining fleet Settings routes use in-memory configuration when they mutate.
|
|
1041
1114
|
const cfg = ctx.fleetConfig;
|
|
1042
1115
|
// This pure Settings surface remains available while membership is off; it imports no Hub runtime.
|
|
1043
|
-
if (path === "/api/settings/hub/membership" || path === "/api/settings/hub/pilot-trust") {
|
|
1044
|
-
const pilot = path.endsWith("/pilot-trust");
|
|
1045
|
-
const
|
|
1116
|
+
if (path === "/api/settings/hub/membership" || path === "/api/settings/hub/pilot-trust" || path === "/api/settings/hub/share-from-hub") {
|
|
1117
|
+
const pilot = path.endsWith("/pilot-trust"), pageSharing = path.endsWith("/share-from-hub");
|
|
1118
|
+
const invalid = pageSharing ? "invalid_hub_page_sharing" : "invalid_hub_membership";
|
|
1119
|
+
const settings = (raw) => pageSharing ? hubPageSharingSettings(raw) : pilot ? hubPilotTrustSettings(raw, RUNNING_AGEND_VERSION) : hubMembershipSettings(raw);
|
|
1046
1120
|
// M-3278 (decision 7933bf90): the public link's admin session too (each method asks for an admin below).
|
|
1047
1121
|
if (method === "GET") {
|
|
1048
1122
|
if (!guestSettingsCaller(req, url, ctx)) {
|
|
@@ -1050,9 +1124,9 @@ export function handleSettingsRequest(req, res, url, ctx) {
|
|
|
1050
1124
|
return true;
|
|
1051
1125
|
}
|
|
1052
1126
|
// v2 is an explicit local-owner read. Older clients keep the pure boolean response and lazy-off behavior.
|
|
1053
|
-
if (!pilot && url.searchParams.has("v")) {
|
|
1127
|
+
if (!pilot && !pageSharing && url.searchParams.has("v")) {
|
|
1054
1128
|
if (url.searchParams.get("v") !== "2" || [...url.searchParams.keys()].length !== 1) {
|
|
1055
|
-
json(res, 400, { ok: false, error:
|
|
1129
|
+
json(res, 400, { ok: false, error: invalid });
|
|
1056
1130
|
return true;
|
|
1057
1131
|
}
|
|
1058
1132
|
const owner = ctx.hubCompanySession?.(req), read = ctx.hubMemberPairingView?.bind(ctx), raw = ctx.getRawFleetConfig(), configPath = ctx.configPath;
|
|
@@ -1078,7 +1152,7 @@ export function handleSettingsRequest(req, res, url, ctx) {
|
|
|
1078
1152
|
json(res, 200, { ok: true, ...settings(ctx.getRawFleetConfig()) });
|
|
1079
1153
|
}
|
|
1080
1154
|
catch {
|
|
1081
|
-
json(res, 409, { ok: false, error:
|
|
1155
|
+
json(res, 409, { ok: false, error: invalid });
|
|
1082
1156
|
}
|
|
1083
1157
|
return true;
|
|
1084
1158
|
}
|
|
@@ -1108,24 +1182,24 @@ export function handleSettingsRequest(req, res, url, ctx) {
|
|
|
1108
1182
|
throw Error("unavailable");
|
|
1109
1183
|
let input;
|
|
1110
1184
|
try {
|
|
1111
|
-
input = parseHubMembership(JSON.parse(bytes.toString("utf8")));
|
|
1185
|
+
input = pageSharing ? parseHubPageSharing(JSON.parse(bytes.toString("utf8"))) : parseHubMembership(JSON.parse(bytes.toString("utf8")));
|
|
1112
1186
|
}
|
|
1113
1187
|
catch {
|
|
1114
|
-
json(res, 400, { ok: false, error:
|
|
1188
|
+
json(res, 400, { ok: false, error: invalid });
|
|
1115
1189
|
return;
|
|
1116
1190
|
}
|
|
1117
1191
|
settingsWrite(req, () => {
|
|
1118
1192
|
if (!settingsRequestLocalAdmin(req) || ctx.fleetConfig !== cfg || ctx.configPath !== configPath)
|
|
1119
1193
|
throw Error("unavailable");
|
|
1120
1194
|
settings(ctx.getRawFleetConfig());
|
|
1121
|
-
ctx.saveFleetConfig([{ path: ["hub_member", pilot ? "pilot_trust" : "enabled"], value: input.enabled }]);
|
|
1195
|
+
ctx.saveFleetConfig([{ path: ["hub_member", pageSharing ? "share_from_hub" : pilot ? "pilot_trust" : "enabled"], value: input.enabled }]);
|
|
1122
1196
|
});
|
|
1123
1197
|
json(res, 200, { ok: true, ...settings(ctx.getRawFleetConfig()) });
|
|
1124
1198
|
}
|
|
1125
1199
|
catch {
|
|
1126
1200
|
json(res, 503, { ok: false, error: "unavailable" });
|
|
1127
1201
|
}
|
|
1128
|
-
}).catch(() => json(res, 400, { ok: false, error:
|
|
1202
|
+
}).catch(() => json(res, 400, { ok: false, error: invalid }));
|
|
1129
1203
|
return true;
|
|
1130
1204
|
}
|
|
1131
1205
|
// ── Manual pause / wake ──
|