@songsid/agend 2.3.0-beta.22 → 2.3.0-beta.23
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 +2 -2
- package/README.zh-TW.md +2 -2
- package/dist/agent-cli.js +4 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +4 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.d.ts +5 -0
- package/dist/agent-whats-new.js +16 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.d.ts +7 -0
- package/dist/auth-api.js +8 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/codex-package.d.ts +30 -0
- package/dist/backend/codex-package.js +133 -0
- package/dist/backend/codex-package.js.map +1 -0
- package/dist/backend/codex.d.ts +2 -0
- package/dist/backend/codex.js +9 -2
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/kiro.d.ts +9 -1
- package/dist/backend/kiro.js +102 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/opencode-permission.js +1 -1
- package/dist/backend/opencode-permission.js.map +1 -1
- package/dist/backend/opencode.js +2 -1
- package/dist/backend/opencode.js.map +1 -1
- package/dist/binary-probe.js +1 -1
- package/dist/bug-report-cli.js +1 -1
- package/dist/bundled-skills.d.ts +7 -3
- package/dist/bundled-skills.js +16 -7
- package/dist/bundled-skills.js.map +1 -1
- package/dist/channel/adapters/discord.js +3 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-server.js +12 -4
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +3 -1
- package/dist/channel/mcp-tools.js +36 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/child-process.d.ts +21 -0
- package/dist/child-process.js +54 -0
- package/dist/child-process.js.map +1 -0
- package/dist/cli.js +167 -182
- package/dist/cli.js.map +1 -1
- package/dist/command-table.d.ts +1 -1
- package/dist/command-table.js +1 -1
- package/dist/command-table.js.map +1 -1
- package/dist/config-validator.js +20 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +8 -0
- package/dist/daemon.js +31 -8
- package/dist/daemon.js.map +1 -1
- package/dist/darwin-memory.js +1 -1
- package/dist/doctor.d.ts +5 -0
- package/dist/doctor.js +42 -0
- package/dist/doctor.js.map +1 -1
- package/dist/export-import.js +1 -1
- package/dist/export-import.js.map +1 -1
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +2 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +45 -0
- package/dist/fleet-manager.js +301 -21
- package/dist/fleet-manager.js.map +1 -1
- package/dist/full-restart.d.ts +5 -5
- package/dist/full-restart.js +5 -5
- package/dist/full-restart.js.map +1 -1
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -1
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +7 -8
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.canvas-worker-off.md +319 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +529 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -3
- package/dist/general-knowledge/steering/core-rules.md +1 -1
- package/dist/instance-config-impact.js +10 -3
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.js +4 -4
- package/dist/locale.js +118 -4
- package/dist/locale.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-shell.js +3 -1
- package/dist/login-shell.js.map +1 -1
- package/dist/ls-rows.js +1 -1
- package/dist/needs-you-hub.d.ts +98 -1
- package/dist/needs-you-hub.js +313 -44
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you-live.d.ts +5 -2
- package/dist/needs-you-live.js +6 -3
- package/dist/needs-you-live.js.map +1 -1
- package/dist/needs-you.d.ts +58 -3
- package/dist/needs-you.js +36 -3
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -3
- package/dist/public-link-progress.d.ts +12 -1
- package/dist/public-link-progress.js +5 -10
- package/dist/public-link-progress.js.map +1 -1
- package/dist/public-tunnel-config.d.ts +5 -0
- package/dist/public-tunnel-config.js +45 -1
- package/dist/public-tunnel-config.js.map +1 -1
- package/dist/public-web-link.js +6 -5
- package/dist/public-web-link.js.map +1 -1
- package/dist/quickstart.js +14 -8
- package/dist/quickstart.js.map +1 -1
- package/dist/resource-report.js +1 -1
- package/dist/scheduler/task-board.d.ts +41 -1
- package/dist/scheduler/task-board.js +150 -4
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/sd-notify.js +2 -1
- package/dist/sd-notify.js.map +1 -1
- package/dist/service-installer.d.ts +69 -0
- package/dist/service-installer.js +181 -0
- package/dist/service-installer.js.map +1 -1
- package/dist/service-owner.d.ts +44 -0
- package/dist/service-owner.js +48 -0
- package/dist/service-owner.js.map +1 -0
- package/dist/settings-api.d.ts +4 -0
- package/dist/settings-api.js +21 -3
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +85 -2
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +2 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +2 -0
- package/dist/settings-http-confirmation.js +3 -2
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +4 -1
- package/dist/settings-request-capability.js +11 -3
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/setup-host.js +1 -1
- package/dist/setup-wizard.js +1 -1
- package/dist/setup-wizard.js.map +1 -1
- package/dist/task-board-summary.d.ts +101 -0
- package/dist/task-board-summary.js +177 -0
- package/dist/task-board-summary.js.map +1 -0
- package/dist/task-board-waker.d.ts +8 -1
- package/dist/task-board-waker.js +15 -6
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tmux-control.js +1 -1
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-exec-helper.d.ts +5 -1
- package/dist/tmux-exec-helper.js +13 -21
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-manager.js +1 -1
- package/dist/tmux-read.js +1 -1
- package/dist/tmux-read.js.map +1 -1
- package/dist/topic-commands.d.ts +3 -0
- package/dist/topic-commands.js +29 -18
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.js +5 -0
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +2 -0
- package/dist/transcript-sources.js +4 -0
- package/dist/transcript-sources.js.map +1 -1
- package/dist/tunnel/cloudflared-install.js +3 -1
- package/dist/tunnel/cloudflared-install.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +1 -1
- package/dist/tunnel/cloudflared.js +51 -10
- package/dist/tunnel/cloudflared.js.map +1 -1
- package/dist/tunnel/named-diagnostics.d.ts +13 -0
- package/dist/tunnel/named-diagnostics.js +52 -0
- package/dist/tunnel/named-diagnostics.js.map +1 -0
- package/dist/tunnel/types.d.ts +2 -1
- package/dist/tunnel/types.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/ui/app-effects.js +10 -4
- package/dist/ui/chat-strings.js +3 -0
- package/dist/ui/chat-thread.js +14 -7
- package/dist/ui/effect-trial-offer.js +2 -31
- package/dist/ui/effects-waker.js +2 -70
- package/dist/ui/fleet-task-card.js +5 -5
- package/dist/ui/fleet-task-common.js +41 -7
- package/dist/ui/fleet-task-work.js +107 -0
- package/dist/ui/fleet-tasks.js +46 -12
- package/dist/ui/image-lightbox.js +39 -1
- package/dist/ui/image-zoom.js +242 -0
- package/dist/ui/panel-chat.js +24 -13
- package/dist/ui/panel-details.js +2 -0
- package/dist/ui/panel-fleet.js +6 -2
- package/dist/ui/panel-needs.js +21 -6
- package/dist/ui/panel-settings.js +35 -13
- package/dist/ui/preview-panel.js +2 -1
- package/dist/ui/search-dialog.js +2 -1
- package/dist/ui/settings-appearance.js +33 -8
- package/dist/ui/settings-dialogs.js +33 -17
- package/dist/ui/settings-discord.js +6 -2
- package/dist/ui/settings-guests.js +2 -1
- package/dist/ui/settings-model.js +2 -11
- package/dist/ui/settings-mods.js +6 -3
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/settings-token.js +3 -1
- package/dist/ui/settings-web-authority.js +6 -3
- package/dist/ui/settings-wizard.js +13 -7
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +2 -2
- package/dist/ui/shared/app-store.js +2 -2
- package/dist/ui/shared/app.css +80 -9
- package/dist/ui/shared/app.js +5 -1
- package/dist/ui/shared/effect-app-runtime.js +7 -5
- package/dist/ui/shared/effect-chat-runtime.js +2 -7
- package/dist/ui/shared/effect-cursor.js +3 -2
- package/dist/ui/shared/effect-display-metadata.js +39 -0
- package/dist/ui/shared/effect-registry.js +4 -2
- package/dist/ui/shared/effect-runtime-loader.js +3 -1
- package/dist/ui/shared/effect-stock-trust.js +1 -1
- package/dist/ui/shared/feature-flags.js +127 -0
- package/dist/ui/shared/identity-color.js +6 -3
- package/dist/ui/shared/instance-nav.js +3 -2
- package/dist/ui/shared/text-undo.js +210 -0
- package/dist/ui/shared/ui-dialog.js +4 -3
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/update-dispatch.js +1 -1
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +1 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/providers.js +1 -1
- package/dist/usage/providers.js.map +1 -1
- package/dist/view-api.js +1 -1
- package/dist/web-api.d.ts +6 -0
- package/dist/web-api.js +152 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-appearance-tools.d.ts +1 -0
- package/dist/web-appearance-tools.js +7 -3
- package/dist/web-appearance-tools.js.map +1 -1
- package/dist/web-appearance.d.ts +4 -10
- package/dist/web-appearance.js +4 -3
- package/dist/web-appearance.js.map +1 -1
- package/dist/web-chat-history.d.ts +14 -0
- package/dist/web-chat-history.js +26 -1
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-experimental-http.d.ts +2 -0
- package/dist/web-experimental-http.js +12 -0
- package/dist/web-experimental-http.js.map +1 -0
- package/dist/web-experimental.d.ts +11 -0
- package/dist/web-experimental.js +49 -0
- package/dist/web-experimental.js.map +1 -0
- package/dist/web-guest-access.d.ts +1 -0
- package/dist/web-guest-access.js +4 -2
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-mod-store.d.ts +2 -0
- package/dist/web-mod-store.js +10 -0
- package/dist/web-mod-store.js.map +1 -1
- package/dist/web-preview.d.ts +2 -0
- package/dist/web-preview.js +2 -0
- package/dist/web-preview.js.map +1 -1
- package/dist/web-settings-patch.d.ts +2 -1
- package/dist/web-settings-patch.js +5 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-settings-tools.d.ts +1 -0
- package/dist/web-settings-tools.js +14 -10
- package/dist/web-settings-tools.js.map +1 -1
- package/dist/web-terminal.js +1 -1
- package/dist/web-theme-store.d.ts +2 -2
- package/dist/web-theme-store.js +6 -3
- package/dist/web-theme-store.js.map +1 -1
- package/package.json +1 -1
package/dist/web-api.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { canvasWorkerEnabled, CANVAS_WORKER_EXPERIMENTAL_MESSAGE } from "./web-experimental.js";
|
|
2
|
+
import { isCanvasWorkerHttpPath } from "./web-experimental-http.js";
|
|
1
3
|
import { webHumanOrigin } from "./human-delivery-receipts.js";
|
|
2
4
|
import { classifyWebPeer, confirmAfterBody, noAuthority } from "./authority/web-authority.js";
|
|
3
5
|
import { guestChatRefusal, guestCommandText, guestDeliveries, guestFrameData, guestHistory, guestMessages, guestPollBody, guestPrefs, guestRequestOf, guestSeesMessage, guestStatus } from "./web-guest-access.js";
|
|
@@ -38,7 +40,7 @@ import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js
|
|
|
38
40
|
import { z } from "zod";
|
|
39
41
|
import { evaluateWebRequest, isPassiveWebRead, isSecureRequest, isWebRequestAuthorized, WEB_TOKEN_INVALID_MESSAGE } from "./web-auth.js";
|
|
40
42
|
import { dashboardOriginFor } from "./web-preview.js";
|
|
41
|
-
import { newWebMessageId, parseLastEventId, webChatReplyRef, webChatReplyText } from "./web-chat-history.js";
|
|
43
|
+
import { WEB_CHAT_CARDS_OVERFLOW, newWebMessageId, parseLastEventId, webChatReplyRef, webChatReplyText } from "./web-chat-history.js";
|
|
42
44
|
import { attachmentDelivery, createPartFile, displayName, fileTooLargeText, INLINE_MIME, isFileId, MEDIA_RANGE_MAX, publicAttachment, UPLOAD_LIMITS, UPLOAD_MAX_MS, UPLOAD_STALL_MS, UploadSniffer, uploadLimits, wellFormed } from "./web-upload.js";
|
|
43
45
|
import { getAgendHome } from "./paths.js";
|
|
44
46
|
import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
|
|
@@ -123,11 +125,20 @@ const CardMoveSchema = z.object({
|
|
|
123
125
|
version: z.number().int().optional(),
|
|
124
126
|
}).strict();
|
|
125
127
|
const CardReorderSchema = z.object({ after: CardRef.nullable().optional(), before: CardRef.nullable().optional() }).strict();
|
|
126
|
-
const ProjectCreateSchema = z.object({ name: z.string().max(256), description: z.string().max(BOARD_TEXT).optional() }).strict();
|
|
128
|
+
const ProjectCreateSchema = z.object({ name: z.string().max(256), description: z.string().max(BOARD_TEXT).optional(), leadInstance: z.string().max(256).nullable().optional() }).strict();
|
|
129
|
+
/** #2352: a project's lead must be one of the fleet's instances now (the board keeps any name, as for an assignee). */
|
|
130
|
+
function checkLeadIsInstance(ctx, lead) {
|
|
131
|
+
const name = lead?.trim();
|
|
132
|
+
if (name && !(ctx.fleetConfig?.instances && Object.hasOwn(ctx.fleetConfig.instances, name))) {
|
|
133
|
+
throw new TaskBoardError("invalid", `"${name.slice(0, 64)}" is not one of the fleet's instances`, "lead_not_instance");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
127
136
|
const ProjectPatchSchema = z.object({
|
|
128
137
|
name: z.string().max(256).optional(),
|
|
129
138
|
description: z.string().max(BOARD_TEXT).optional(),
|
|
130
139
|
archived: z.boolean().optional(),
|
|
140
|
+
/** #2352: the instance whose channel lists the project's waiting cards (null or "": General). */
|
|
141
|
+
leadInstance: z.string().max(256).nullable().optional(),
|
|
131
142
|
}).strict();
|
|
132
143
|
const TeamCreateSchema = z.object({
|
|
133
144
|
name: z.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/),
|
|
@@ -169,6 +180,68 @@ const safeInstanceSegment = (name) => /^[^\\/\x00]+$/.test(name) && name !== "."
|
|
|
169
180
|
*/
|
|
170
181
|
/** #1920 phase 1b: the open streams that are a guest's, and whose — each event is projected for them (guestFrameData). */
|
|
171
182
|
const streamGuests = new WeakMap();
|
|
183
|
+
/**
|
|
184
|
+
* The task board's rule over the public link: an instance kept out of sight (cross_instance_visibility: hidden) is not
|
|
185
|
+
* shown, nor a card that names one as its assignee, creator or dispatcher. Off the link nothing is hidden. Read when
|
|
186
|
+
* asked: the fleet's config as it is now.
|
|
187
|
+
*/
|
|
188
|
+
function boardHiding(ctx, gateway) {
|
|
189
|
+
const fleet = ctx.fleetConfig;
|
|
190
|
+
const hiddenName = (n) => gateway && typeof n === "string" && !!n && !!ctx.fleetConfig?.instances?.[n] && crossInstanceVisibility(fleet, n) === "hidden";
|
|
191
|
+
const hidden = (c) => [c.assignee, c.createdBy, c.dispatcher?.name].some(hiddenName);
|
|
192
|
+
return { hiddenName, hidden };
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Chat history as the public link may see it (#2341 review): a status line that names board cards (the daily summary)
|
|
196
|
+
* is withheld while one of them is hidden there now — or no longer on the board — read when asked, so a card hidden
|
|
197
|
+
* after the line was written is withheld too. Off the link, as is. The cards are read in one query per answer.
|
|
198
|
+
*/
|
|
199
|
+
function visibleMessages(ctx, gateway, messages) {
|
|
200
|
+
if (!gateway)
|
|
201
|
+
return messages;
|
|
202
|
+
// #2341 review r2: a line that named too many cards to keep them all is withheld whole.
|
|
203
|
+
messages = messages.filter((m) => !(m.cards ?? []).includes(WEB_CHAT_CARDS_OVERFLOW));
|
|
204
|
+
const named = [...new Set(messages.flatMap((m) => m.cards ?? []))];
|
|
205
|
+
if (!named.length)
|
|
206
|
+
return messages;
|
|
207
|
+
const board = ctx.scheduler?.db.board;
|
|
208
|
+
const { hidden } = boardHiding(ctx, true);
|
|
209
|
+
let found;
|
|
210
|
+
try {
|
|
211
|
+
found = new Map((board ? board.cardsByCode(named) : []).map((c) => [c.code, c]));
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
found = new Map();
|
|
215
|
+
}
|
|
216
|
+
const withheld = new Set(named.filter((code) => { const c = found.get(code); return !c || hidden(c); }));
|
|
217
|
+
return messages.filter((m) => !(m.cards ?? []).some((code) => withheld.has(code)));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Needs you as the public link may see it (#2306 review): a task item whose card the board hides there — or a card
|
|
221
|
+
* the board no longer has — is left out, with its title and question; everything else as listed. Off the link, as is.
|
|
222
|
+
* The link reads Needs you by /ui/poll only: its page has no stream (/ui/events answers it 404).
|
|
223
|
+
*/
|
|
224
|
+
function visibleNeeds(ctx, gateway, items) {
|
|
225
|
+
if (!gateway)
|
|
226
|
+
return items;
|
|
227
|
+
const board = ctx.scheduler?.db.board;
|
|
228
|
+
const { hidden } = boardHiding(ctx, true);
|
|
229
|
+
return items.filter((i) => {
|
|
230
|
+
const item = i;
|
|
231
|
+
if (item.type !== "task")
|
|
232
|
+
return true;
|
|
233
|
+
const code = item.card?.code;
|
|
234
|
+
if (!board || typeof code !== "string")
|
|
235
|
+
return false;
|
|
236
|
+
try {
|
|
237
|
+
const card = board.findCard(code);
|
|
238
|
+
return !!card && !hidden(card);
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
172
245
|
/**
|
|
173
246
|
* #1920 §5.2: one event for the guests' streams only, each as projected for it — a message that has just become what
|
|
174
247
|
* its channel saw (an admin's page already has it, unchanged).
|
|
@@ -254,6 +327,8 @@ function jsonText(res, status, body) {
|
|
|
254
327
|
* board (the newest revision replaces the previous), so it holds one board's JSON at most.
|
|
255
328
|
*/
|
|
256
329
|
const boardBodies = new WeakMap();
|
|
330
|
+
/** #2316 review: the same for who works on what (GET /ui/tasks/work), per (revision, names asked for). */
|
|
331
|
+
const workBodies = new WeakMap();
|
|
257
332
|
/**
|
|
258
333
|
* #1630 (#1635 review): an answer that waited on something (a list, a download) is sent only if the request is still
|
|
259
334
|
* allowed — the session not revoked meanwhile, a public link's exposure still current. Otherwise 401, and nothing.
|
|
@@ -661,6 +736,10 @@ function handleEffectTrials(req, res, url, ctx, path, method) {
|
|
|
661
736
|
json(res, now.status, { error: now.error });
|
|
662
737
|
return;
|
|
663
738
|
}
|
|
739
|
+
if (!canvasWorkerEnabled(ctx.fleetConfig?.web)) {
|
|
740
|
+
json(res, 403, { error: "canvas_worker_experimental", message: CANVAS_WORKER_EXPERIMENTAL_MESSAGE });
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
664
743
|
if (now.record !== first.record || now.sessions !== first.sessions || now.actor.sessionHash !== first.actor.sessionHash
|
|
665
744
|
|| now.actor.person !== first.actor.person || now.actor.epoch !== first.actor.epoch) {
|
|
666
745
|
json(res, 409, { error: "trials_person_changed" });
|
|
@@ -896,6 +975,10 @@ function handleEffects(req, res, url, ctx, path, method) {
|
|
|
896
975
|
json(res, now.status, { error: now.error });
|
|
897
976
|
return;
|
|
898
977
|
}
|
|
978
|
+
if (!canvasWorkerEnabled(ctx.fleetConfig?.web)) {
|
|
979
|
+
json(res, 403, { error: "canvas_worker_experimental", message: CANVAS_WORKER_EXPERIMENTAL_MESSAGE });
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
899
982
|
if (now.person !== first.person || now.epoch !== first.epoch) {
|
|
900
983
|
json(res, 409, { error: "effects_person_changed" });
|
|
901
984
|
return;
|
|
@@ -1017,6 +1100,10 @@ function handleMods(req, res, url, ctx, path, method) {
|
|
|
1017
1100
|
// So the export ACL judges what the file carries, not what was installed: it downloads only when this person may
|
|
1018
1101
|
// read every effect in it (their own claim on that content, or a shared one). A file without effects is any admin's.
|
|
1019
1102
|
const fx = mods.bundleEffects(fileMatch[1]);
|
|
1103
|
+
if (!canvasWorkerEnabled(ctx.fleetConfig?.web) && (fx === "unknown" || (fx?.length ?? 0) > 0)) {
|
|
1104
|
+
json(res, 403, { error: "canvas_worker_experimental", message: CANVAS_WORKER_EXPERIMENTAL_MESSAGE });
|
|
1105
|
+
return true;
|
|
1106
|
+
}
|
|
1020
1107
|
if (fx === "unknown" || (fx ?? []).some(id => !ctx.modPlacedEffect?.(first.person, id))) {
|
|
1021
1108
|
json(res, 403, { error: "mod_effects_not_yours", detail: "this mod's file carries effects that are not yours to share: export your own look instead" });
|
|
1022
1109
|
return true;
|
|
@@ -1147,7 +1234,7 @@ export function exportMod(ctx, person, body) {
|
|
|
1147
1234
|
// The effects the theme places travel with it, as the library keeps them (a person may export what is placed).
|
|
1148
1235
|
// Only effects this person may carry away travel (Sol's ACL); the rest are counted, never packaged.
|
|
1149
1236
|
// #2017: an older placement of an effect that doesn't play in chat stays out (a mod can't place it): counted.
|
|
1150
|
-
const effects = rec.placements.effects.flatMap(p => { const e = ctx.modPlacedEffect?.(person, p.id); if (!e || !filesPlayInChat(e.files)) {
|
|
1237
|
+
const effects = (canvasWorkerEnabled(ctx.fleetConfig?.web) ? rec.placements.effects : []).flatMap(p => { const e = ctx.modPlacedEffect?.(person, p.id); if (!e || !filesPlayInChat(e.files)) {
|
|
1151
1238
|
omitted++;
|
|
1152
1239
|
return [];
|
|
1153
1240
|
} return [{ name: e.name, files: e.files, params: p.params ?? {} }]; });
|
|
@@ -1398,6 +1485,10 @@ function statusTick(ctx, t) {
|
|
|
1398
1485
|
export function handleWebRequest(req, res, url, ctx) {
|
|
1399
1486
|
const path = url.pathname;
|
|
1400
1487
|
const method = req.method ?? "GET";
|
|
1488
|
+
if (!canvasWorkerEnabled(ctx.fleetConfig?.web) && isCanvasWorkerHttpPath(path)) {
|
|
1489
|
+
json(res, 403, { error: "canvas_worker_experimental", message: CANVAS_WORKER_EXPERIMENTAL_MESSAGE });
|
|
1490
|
+
return true;
|
|
1491
|
+
}
|
|
1401
1492
|
// Auth check for all /ui routes. Defence in depth behind the fleet-manager
|
|
1402
1493
|
// gate: the same session cookie or header token, and an unset token closes
|
|
1403
1494
|
// the panel instead of comparing null against a missing credential.
|
|
@@ -1545,7 +1636,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1545
1636
|
}
|
|
1546
1637
|
json(res, 200, {
|
|
1547
1638
|
status: ctx.getUiStatus(),
|
|
1548
|
-
|
|
1639
|
+
// #2341 review: over the public link, without a summary line that names a card hidden there.
|
|
1640
|
+
messages: history ? visibleMessages(ctx, !!gatewayRequestContext(req), fresh ? history.after(0) : history.replayFor(parseLastEventId(after))) : [],
|
|
1549
1641
|
// The ticks too, so polling never has to re-read a chat's history — that read would count as the person's
|
|
1550
1642
|
// activity; this poll does not (isPassiveWebRead).
|
|
1551
1643
|
deliveries: history ? history.deliveries() : [],
|
|
@@ -1555,8 +1647,9 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1555
1647
|
reactions: history ? history.reactionStates() : [],
|
|
1556
1648
|
// And the fleet prompts open on the dashboard (C4): prompt events are stream-only too.
|
|
1557
1649
|
prompts: ctx.listWebPrompts?.() ?? [],
|
|
1558
|
-
// #1386: "Needs you" rides the passive channels only — no endpoint of its own to poll.
|
|
1559
|
-
|
|
1650
|
+
// #1386: "Needs you" rides the passive channels only — no endpoint of its own to poll. Over the public link,
|
|
1651
|
+
// without the task board's hidden cards (#2306 review).
|
|
1652
|
+
needs: visibleNeeds(ctx, !!gatewayRequestContext(req), ctx.needsYouItems?.() ?? []),
|
|
1560
1653
|
// #1577: the newest message this answer accounts for — after a restart, the last restored one until this process
|
|
1561
1654
|
// records its own (`<boot>-0` would be after(0): the whole restored history again on every poll).
|
|
1562
1655
|
cursor: history ? history.pollCursor() : null,
|
|
@@ -1672,7 +1765,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1672
1765
|
}
|
|
1673
1766
|
// #1920 §5.2: a guest gets what the channel showed of it, and its own messages (the gate checked the scope).
|
|
1674
1767
|
const guest = guestRequestOf(req);
|
|
1675
|
-
const messages = !ctx.webChatHistory ? [] : guest ? guestHistory(ctx.webChatHistory, instance, limit, guest, guest.scope())
|
|
1768
|
+
const messages = !ctx.webChatHistory ? [] : guest ? guestHistory(ctx.webChatHistory, instance, limit, guest, guest.scope())
|
|
1769
|
+
: visibleMessages(ctx, !!gatewayRequestContext(req), ctx.webChatHistory.list(instance, limit));
|
|
1676
1770
|
json(res, 200, { messages, boot: ctx.webChatHistory?.boot ?? null, lastId: ctx.webChatHistory?.lastId ?? 0 });
|
|
1677
1771
|
return true;
|
|
1678
1772
|
}
|
|
@@ -2166,6 +2260,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2166
2260
|
return;
|
|
2167
2261
|
}
|
|
2168
2262
|
const personal = [...parsed.patch.keys()].some(isOwnerEffectKey);
|
|
2263
|
+
if (personal && !canvasWorkerEnabled(ctx.fleetConfig?.web)) {
|
|
2264
|
+
json(res, 403, { error: "canvas_worker_experimental", message: CANVAS_WORKER_EXPERIMENTAL_MESSAGE });
|
|
2265
|
+
return;
|
|
2266
|
+
}
|
|
2169
2267
|
if (personal && now.person === null) {
|
|
2170
2268
|
json(res, 403, { error: "prefs_need_a_signed_in_person" });
|
|
2171
2269
|
return;
|
|
@@ -2642,7 +2740,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2642
2740
|
}
|
|
2643
2741
|
// ── Task board (scheduler/task-board.ts) ──────────────
|
|
2644
2742
|
// Reads are the session's; every write is the signed-in person's, through the same rules an instance's tools use.
|
|
2645
|
-
if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects")) {
|
|
2743
|
+
if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/work" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects")) {
|
|
2646
2744
|
const board = ctx.scheduler?.db.board;
|
|
2647
2745
|
if (!board) {
|
|
2648
2746
|
json(res, 503, { error: "The task board is not available" });
|
|
@@ -2656,9 +2754,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2656
2754
|
return true;
|
|
2657
2755
|
}
|
|
2658
2756
|
// …nor shows the cards of instances kept out of sight (cross_instance_visibility: hidden).
|
|
2659
|
-
const
|
|
2660
|
-
const hiddenName = (n) => !!gateway && typeof n === "string" && !!n && !!ctx.fleetConfig?.instances?.[n] && crossInstanceVisibility(fleet, n) === "hidden";
|
|
2661
|
-
const hidden = (c) => [c.assignee, c.createdBy, c.dispatcher?.name].some(hiddenName);
|
|
2757
|
+
const { hiddenName, hidden } = boardHiding(ctx, !!gateway);
|
|
2662
2758
|
// #2303 review: what a visible card shows of the cards around it follows the same rule — its children, its main
|
|
2663
2759
|
// task (a search hit's too) — and so do the words and the history a hidden instance left on it.
|
|
2664
2760
|
// …and a hidden instance's words on a visible card are not counted, named or found there (#2304 review).
|
|
@@ -2695,12 +2791,53 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2695
2791
|
return true;
|
|
2696
2792
|
}
|
|
2697
2793
|
const cards = board.boardCards(undefined, allDone).filter((c) => !hidden(c));
|
|
2698
|
-
|
|
2794
|
+
// #2352: over the public link a hidden lead is not named (the project reads as having none).
|
|
2795
|
+
const projects = board.listProjects(true).map((p) => (p.leadInstance && hiddenName(p.leadInstance) ? { ...p, leadInstance: null } : p));
|
|
2796
|
+
// #2355 review: the names a project's lead may be — the fleet's instances (a Classic-only room is not one); over the
|
|
2797
|
+
// public link, not a hidden one.
|
|
2798
|
+
const leads = Object.keys(ctx.fleetConfig?.instances ?? {}).filter((n) => !hiddenName(n)).sort();
|
|
2799
|
+
const body = JSON.stringify({ rev, cards: board.views(cards, scope), projects, leads, stats: board.projectStats() });
|
|
2699
2800
|
if (key)
|
|
2700
2801
|
boardBodies.set(board, { key, body });
|
|
2701
2802
|
jsonText(res, 200, body);
|
|
2702
2803
|
return true;
|
|
2703
2804
|
}
|
|
2805
|
+
if (method === "GET" && path === "/ui/tasks/work") {
|
|
2806
|
+
// #2246 step 3: each instance's work on the board — what its `task mine` reads (myWork) — for the board's
|
|
2807
|
+
// Instance list and an instance's Details page (`?instance=`): the fleet's instances and anyone else a live
|
|
2808
|
+
// card is assigned to. Over the public link, not those kept out of sight, nor a card that names one. Every
|
|
2809
|
+
// name's work is one workOf() read and the cards one views() read, whatever the number of instances (#2316
|
|
2810
|
+
// review); on the dashboard the answer is built once per board revision and the names asked for, and shared
|
|
2811
|
+
// by every open drawer (the public link's is filtered per request, as the board's).
|
|
2812
|
+
const only = url.searchParams.get("instance");
|
|
2813
|
+
const names = (only ? [only] : [...new Set([...Object.keys(ctx.fleetConfig?.instances ?? {}), ...board.liveAssignees()])]).filter((n) => !hiddenName(n));
|
|
2814
|
+
const key = gateway ? null : `${board.revision()}:${only === null ? "*" : `=${only}`}:${names.join("\u0000")}`;
|
|
2815
|
+
const kept = key ? workBodies.get(board) : undefined;
|
|
2816
|
+
if (kept && kept.key === key) {
|
|
2817
|
+
jsonText(res, 200, kept.body);
|
|
2818
|
+
return true;
|
|
2819
|
+
}
|
|
2820
|
+
const byName = board.workOf(names);
|
|
2821
|
+
const works = names.map((name) => ({ name, w: byName.get(name) }));
|
|
2822
|
+
const all = new Map();
|
|
2823
|
+
for (const { w } of works)
|
|
2824
|
+
for (const c of [...w.doing, ...w.blocked, ...w.review, ...w.ready, ...w.waiting.map((x) => x.card), ...w.mains.map((x) => x.card)])
|
|
2825
|
+
if (!hidden(c))
|
|
2826
|
+
all.set(c.uuid, c);
|
|
2827
|
+
const viewOf = new Map(board.views([...all.values()], scope).map((v) => [v.uuid, v]));
|
|
2828
|
+
const drawn = (cards) => cards.flatMap((c) => (viewOf.has(c.uuid) ? [viewOf.get(c.uuid)] : []));
|
|
2829
|
+
const codes = (cards) => cards.filter((x) => all.has(x.card.uuid)).map((x) => x.card.code);
|
|
2830
|
+
const body = JSON.stringify({ instances: works.map(({ name, w }) => ({
|
|
2831
|
+
name,
|
|
2832
|
+
doing: drawn(w.doing), blocked: drawn(w.blocked), review: drawn(w.review), ready: drawn(w.ready),
|
|
2833
|
+
waiting: drawn(w.waiting.map((x) => x.card)), mains: drawn(w.mains.map((x) => x.card)),
|
|
2834
|
+
sentBack: codes(w.sentBack), newComments: codes(w.newComments),
|
|
2835
|
+
})) });
|
|
2836
|
+
if (key)
|
|
2837
|
+
workBodies.set(board, { key, body });
|
|
2838
|
+
jsonText(res, 200, body);
|
|
2839
|
+
return true;
|
|
2840
|
+
}
|
|
2704
2841
|
if (method === "GET" && path === "/ui/tasks/search") {
|
|
2705
2842
|
const names = new Map(board.listProjects(true).map((p) => [p.id, p.name]));
|
|
2706
2843
|
const hits = board.search(url.searchParams.get("q") ?? "", Number(url.searchParams.get("limit")) || 20, scope).filter((h) => !hidden(h.card));
|
|
@@ -2749,11 +2886,11 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2749
2886
|
return true;
|
|
2750
2887
|
}
|
|
2751
2888
|
if (method === "POST" && path === "/ui/tasks/projects") {
|
|
2752
|
-
boardWrite(req, res, url, ctx, board, ProjectCreateSchema, (input, person) => ({ project: board.createProject(person, input) })
|
|
2889
|
+
boardWrite(req, res, url, ctx, board, ProjectCreateSchema, (input, person) => { checkLeadIsInstance(ctx, input.leadInstance); return { project: board.createProject(person, input) }; });
|
|
2753
2890
|
return true;
|
|
2754
2891
|
}
|
|
2755
2892
|
if (method === "POST" && project) {
|
|
2756
|
-
boardWrite(req, res, url, ctx, board, ProjectPatchSchema, (patch, person) => ({ project: board.updateProject(person, Number(project[1]), patch) })
|
|
2893
|
+
boardWrite(req, res, url, ctx, board, ProjectPatchSchema, (patch, person) => { checkLeadIsInstance(ctx, patch.leadInstance); return { project: board.updateProject(person, Number(project[1]), patch) }; });
|
|
2757
2894
|
return true;
|
|
2758
2895
|
}
|
|
2759
2896
|
}
|
|
@@ -3765,6 +3902,7 @@ function shellBodyTag(req, ctx, mode, viewer) {
|
|
|
3765
3902
|
+ ` data-usage-panel="${ctx.fleetConfig?.web?.usage_panel === false || viewer?.guest ? "0" : "1"}"`
|
|
3766
3903
|
// #1218: whether the Log tab is on (web.log_tab; off by default): the tab says so and offers to turn it on.
|
|
3767
3904
|
+ ` data-log-tab="${ctx.fleetConfig?.web?.log_tab === true ? "1" : "0"}"`
|
|
3905
|
+
+ ` data-canvas-worker="${canvasWorkerEnabled(ctx.fleetConfig?.web) ? "1" : "0"}"`
|
|
3768
3906
|
// #1937: the upload limits in force for this page (the config's; the public link's own cap on it) — what the chat
|
|
3769
3907
|
// checks before sending a file, and the numbers its words say. The server checks again on every upload.
|
|
3770
3908
|
+ ` data-upload-limits="${attr(JSON.stringify(uploadLimits(ctx.fleetConfig?.web, { publicLink: gatewayRequestContext(req) !== undefined })))}"`
|