@songsid/agend 2.4.0-beta.23 → 2.4.0-beta.25
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 +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agend-home.js +5 -5
- package/dist/agend-home.js.map +1 -1
- package/dist/agent-cli-instructions.md +4 -3
- package/dist/agent-cli.js +32 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +10 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +2 -2
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +11 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/agent-workspace.d.ts +18 -2
- package/dist/agent-workspace.js +15 -4
- package/dist/agent-workspace.js.map +1 -1
- package/dist/backend/antigravity.js +8 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +15 -0
- package/dist/backend/claude-code.js +25 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-mcp-carry.d.ts +63 -0
- package/dist/backend/claude-mcp-carry.js +242 -0
- package/dist/backend/claude-mcp-carry.js.map +1 -0
- package/dist/backend/claude-usage-credits.d.ts +8 -0
- package/dist/backend/claude-usage-credits.js +121 -0
- package/dist/backend/claude-usage-credits.js.map +1 -0
- package/dist/backend/types.d.ts +30 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +7 -1
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-tools.js +7 -6
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +1 -0
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/cli-audited.js +9 -4
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli.js +184 -21
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +17 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/contact-auth-store.d.ts +18 -0
- package/dist/contact-auth-store.js +55 -8
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +3 -0
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +34 -0
- package/dist/contact-change-proposals.js +1 -1
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +1 -0
- package/dist/cross-instance-notice.js +9 -8
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +46 -0
- package/dist/daemon.js +299 -33
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +8 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +56 -1
- package/dist/delivery-outbox.js +254 -22
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +8 -0
- package/dist/fleet-lock.d.ts +67 -2
- package/dist/fleet-lock.js +236 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +177 -6
- package/dist/fleet-manager.js +1203 -75
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +20 -1
- package/dist/fleet-windows-runtime.js +98 -18
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +22 -9
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +6 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +7 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -3
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +17 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +35 -7
- package/dist/home-update-lock.d.ts +35 -0
- package/dist/home-update-lock.js +81 -0
- package/dist/home-update-lock.js.map +1 -0
- package/dist/hub/compose/member.d.ts +5 -1
- package/dist/hub/compose/member.js +9 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/member/room-ask.d.ts +5 -0
- package/dist/hub/member/room-ask.js +43 -16
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-mention-feedback.d.ts +2 -0
- package/dist/hub/member/room-mention-feedback.js +1 -1
- package/dist/hub/member/room-mention-feedback.js.map +1 -1
- package/dist/hub/member/room-post-answers.d.ts +2 -0
- package/dist/hub/member/room-post-answers.js +1 -1
- package/dist/hub/member/room-post-answers.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +5 -0
- package/dist/hub/member/room-post.js +4 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/updates.d.ts +7 -1
- package/dist/hub/member/updates.js +7 -1
- package/dist/hub/member/updates.js.map +1 -1
- package/dist/hub/representative.d.ts +7 -0
- package/dist/hub/representative.js +38 -5
- package/dist/hub/representative.js.map +1 -1
- package/dist/install-lock.d.ts +15 -1
- package/dist/install-lock.js +16 -8
- package/dist/install-lock.js.map +1 -1
- package/dist/install-ownership.d.ts +165 -0
- package/dist/install-ownership.js +404 -0
- package/dist/install-ownership.js.map +1 -0
- package/dist/instance-config-impact.js +2 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +4 -0
- package/dist/instructions.js +4 -0
- package/dist/instructions.js.map +1 -1
- package/dist/local-pane-endpoint.d.ts +4 -1
- package/dist/local-pane-endpoint.js +12 -2
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +170 -4
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +46 -3
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-mcp.d.ts +16 -1
- package/dist/native-mcp.js +38 -5
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +9 -0
- package/dist/native-pane-lifecycle.js +23 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +19 -6
- package/dist/native-pane-manager.js +79 -4
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +31 -5
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +22 -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/office-share.js +2 -1
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.d.ts +12 -0
- package/dist/outbound-handlers.js +59 -8
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +7 -5
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/package-preimage.js +4 -0
- package/dist/package-preimage.js.map +1 -1
- package/dist/pane-port.d.ts +1 -0
- package/dist/plist-args.d.ts +9 -0
- package/dist/plist-args.js +22 -0
- package/dist/plist-args.js.map +1 -0
- package/dist/public-preview.d.ts +4 -6
- package/dist/public-preview.js +5 -2
- package/dist/public-preview.js.map +1 -1
- package/dist/public-web-gateway.js +11 -3
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +13 -1
- package/dist/public-web-link.js +28 -1
- package/dist/public-web-link.js.map +1 -1
- package/dist/recover.cjs +2452 -0
- package/dist/remote-card-prompt.d.ts +6 -2
- package/dist/remote-card-prompt.js +12 -3
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-draft.d.ts +12 -0
- package/dist/reply-draft.js +81 -0
- package/dist/reply-draft.js.map +1 -0
- package/dist/request-contact-api.d.ts +15 -0
- package/dist/request-contact-api.js +120 -0
- package/dist/request-contact-api.js.map +1 -0
- package/dist/request-contact-card.d.ts +36 -0
- package/dist/request-contact-card.js +206 -0
- package/dist/request-contact-card.js.map +1 -0
- package/dist/request-contact-gate.d.ts +79 -0
- package/dist/request-contact-gate.js +262 -0
- package/dist/request-contact-gate.js.map +1 -0
- package/dist/request-contact-native.d.ts +52 -0
- package/dist/request-contact-native.js +83 -0
- package/dist/request-contact-native.js.map +1 -0
- package/dist/request-contact-types.d.ts +86 -0
- package/dist/request-contact-types.js +7 -0
- package/dist/request-contact-types.js.map +1 -0
- package/dist/request-context-call-protocol.d.ts +12 -0
- package/dist/request-context-call-protocol.js +14 -0
- package/dist/request-context-call-protocol.js.map +1 -0
- package/dist/request-context-call.d.ts +22 -0
- package/dist/request-context-call.js +35 -0
- package/dist/request-context-call.js.map +1 -0
- package/dist/request-context-compatibility.d.ts +20 -0
- package/dist/request-context-compatibility.js +74 -0
- package/dist/request-context-compatibility.js.map +1 -0
- package/dist/request-context-drain.d.ts +39 -0
- package/dist/request-context-drain.js +159 -0
- package/dist/request-context-drain.js.map +1 -0
- package/dist/request-context-fence.d.ts +28 -0
- package/dist/request-context-fence.js +58 -0
- package/dist/request-context-fence.js.map +1 -0
- package/dist/request-context-migration.d.ts +64 -0
- package/dist/request-context-migration.js +158 -0
- package/dist/request-context-migration.js.map +1 -0
- package/dist/request-context-pane.d.ts +25 -0
- package/dist/request-context-pane.js +48 -0
- package/dist/request-context-pane.js.map +1 -0
- package/dist/request-context-policy.d.ts +74 -0
- package/dist/request-context-policy.js +116 -0
- package/dist/request-context-policy.js.map +1 -0
- package/dist/request-context-protocol.d.ts +137 -0
- package/dist/request-context-protocol.js +38 -0
- package/dist/request-context-protocol.js.map +1 -0
- package/dist/request-context-recovery.d.ts +14 -0
- package/dist/request-context-recovery.js +56 -0
- package/dist/request-context-recovery.js.map +1 -0
- package/dist/request-context-relay.d.ts +19 -0
- package/dist/request-context-relay.js +63 -0
- package/dist/request-context-relay.js.map +1 -0
- package/dist/request-context-returns.d.ts +67 -0
- package/dist/request-context-returns.js +211 -0
- package/dist/request-context-returns.js.map +1 -0
- package/dist/request-context-store.d.ts +26 -0
- package/dist/request-context-store.js +144 -0
- package/dist/request-context-store.js.map +1 -0
- package/dist/request-context-turns.d.ts +99 -0
- package/dist/request-context-turns.js +215 -0
- package/dist/request-context-turns.js.map +1 -0
- package/dist/request-context-view.d.ts +33 -0
- package/dist/request-context-view.js +36 -0
- package/dist/request-context-view.js.map +1 -0
- package/dist/request-hub-context.d.ts +130 -0
- package/dist/request-hub-context.js +89 -0
- package/dist/request-hub-context.js.map +1 -0
- package/dist/request-hub-output.d.ts +11 -0
- package/dist/request-hub-output.js +21 -0
- package/dist/request-hub-output.js.map +1 -0
- package/dist/runtime-cli-install.js +13 -11
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-client.d.ts +2 -0
- package/dist/runtime-client.js +17 -4
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -1
- package/dist/runtime-coordinator.js +10 -3
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +3 -0
- package/dist/runtime-pane-host.js +39 -21
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +6 -2
- package/dist/runtime-pane-link.js +17 -4
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +11 -1
- package/dist/runtime-pane-mcp-relay.js +69 -3
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +28 -1
- package/dist/runtime-pane-mcp.js +92 -15
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +6 -0
- package/dist/runtime-pane-port.js +23 -4
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +4 -0
- package/dist/runtime-pane-protocol.js +11 -4
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-service.d.ts +1 -0
- package/dist/runtime-pane-service.js +25 -9
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-stdio-protocol.d.ts +4 -0
- package/dist/runtime-pane-stdio-protocol.js +12 -5
- package/dist/runtime-pane-stdio-protocol.js.map +1 -1
- package/dist/runtime-pane-stdio.js +5 -5
- package/dist/runtime-pane-stdio.js.map +1 -1
- package/dist/runtime-protocol.d.ts +3 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/scheduler/db.js +26 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +6 -0
- package/dist/scheduler/scheduler.js +19 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +2 -0
- package/dist/scheduler/task-board-text.js +12 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +106 -2
- package/dist/scheduler/task-board.js +248 -24
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-files.d.ts +80 -0
- package/dist/scheduler/task-files.js +357 -0
- package/dist/scheduler/task-files.js.map +1 -0
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/service-activation.js +3 -13
- package/dist/service-activation.js.map +1 -1
- package/dist/service-lock.d.ts +28 -0
- package/dist/service-lock.js +85 -0
- package/dist/service-lock.js.map +1 -0
- package/dist/settings-api.d.ts +8 -0
- package/dist/settings-api.js +41 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +5 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/state-lease.d.ts +24 -0
- package/dist/state-lease.js +103 -0
- package/dist/state-lease.js.map +1 -0
- package/dist/task-attach-client.d.ts +43 -0
- package/dist/task-attach-client.js +125 -0
- package/dist/task-attach-client.js.map +1 -0
- package/dist/task-board-tool.d.ts +12 -0
- package/dist/task-board-tool.js +107 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-file-limits.d.ts +15 -0
- package/dist/task-file-limits.js +21 -0
- package/dist/task-file-limits.js.map +1 -0
- package/dist/tmux-binary.js +1 -1
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tool-permissions.d.ts +32 -0
- package/dist/tool-permissions.js +63 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +2 -0
- package/dist/topic-commands.js +21 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.js +3 -0
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/tunnel/named-link-test.d.ts +27 -0
- package/dist/tunnel/named-link-test.js +41 -0
- package/dist/tunnel/named-link-test.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/agent-who-can-use-strings.js +125 -0
- package/dist/ui/agent-who-can-use.js +238 -0
- package/dist/ui/chat-store.js +5 -4
- package/dist/ui/fleet-office-card.js +37 -6
- package/dist/ui/fleet-office-editor.js +5 -5
- package/dist/ui/fleet-office-pack.d.ts +10 -0
- package/dist/ui/fleet-office-pack.js +65 -2
- package/dist/ui/fleet-office-skin.js +75 -17
- package/dist/ui/fleet-office-store.js +33 -2
- package/dist/ui/fleet-office-vehicles.js +130 -0
- package/dist/ui/fleet-office-zones.js +13 -4
- package/dist/ui/fleet-office.js +245 -46
- package/dist/ui/fleet-task-activity.js +9 -82
- package/dist/ui/fleet-task-archive.js +111 -0
- package/dist/ui/fleet-task-card.js +6 -4
- package/dist/ui/fleet-task-common.js +2 -2
- package/dist/ui/fleet-task-edit.js +8 -1
- package/dist/ui/fleet-task-files.js +196 -0
- package/dist/ui/fleet-task-md.js +98 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-stats.js +2 -2
- package/dist/ui/fleet-task-view.js +12 -8
- package/dist/ui/fleet-tasks.js +42 -18
- package/dist/ui/panel-chat.js +15 -2
- package/dist/ui/panel-details.js +3 -1
- package/dist/ui/panel-needs.js +25 -5
- package/dist/ui/panel-settings.js +37 -9
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-registry.js +3 -0
- package/dist/ui/settings-shared-strings.js +9 -0
- package/dist/ui/settings-shared.js +6 -1
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +8 -1
- package/dist/ui/shared/app.css +131 -5
- package/dist/ui/shared/chat-strings.js +10 -6
- package/dist/ui/shared/chat-thread.js +7 -1
- package/dist/ui/shared/preview-panel.js +1 -1
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/task-board.css +64 -0
- package/dist/ui/shared/tokens.css +18 -3
- package/dist/ui/shared/ui-confirm.js +5 -4
- package/dist/ui/shared/workspace.css +7 -0
- package/dist/ui/usage-credits-card.js +84 -0
- package/dist/ui/workspace-ignored-strings.js +16 -0
- package/dist/ui/workspace-panel.js +15 -6
- package/dist/update-card.d.ts +193 -0
- package/dist/update-card.js +620 -0
- package/dist/update-card.js.map +1 -0
- package/dist/update-dispatch.d.ts +16 -1
- package/dist/update-dispatch.js +12 -4
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-forward.d.ts +73 -0
- package/dist/update-forward.js +283 -0
- package/dist/update-forward.js.map +1 -0
- package/dist/update-idle.d.ts +1 -0
- package/dist/update-idle.js +12 -3
- package/dist/update-idle.js.map +1 -1
- package/dist/update-install.d.ts +2 -1
- package/dist/update-install.js +18 -10
- package/dist/update-install.js.map +1 -1
- package/dist/update-journal.d.ts +351 -0
- package/dist/update-journal.js +717 -0
- package/dist/update-journal.js.map +1 -0
- package/dist/update-launch.js +1 -1
- package/dist/update-launch.js.map +1 -1
- package/dist/update-npm-env.d.ts +45 -12
- package/dist/update-npm-env.js +48 -0
- package/dist/update-npm-env.js.map +1 -1
- package/dist/update-package-restore.d.ts +75 -0
- package/dist/update-package-restore.js +318 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +192 -0
- package/dist/update-quiescence.js +330 -0
- package/dist/update-quiescence.js.map +1 -0
- package/dist/update-readiness-host.d.ts +61 -0
- package/dist/update-readiness-host.js +297 -0
- package/dist/update-readiness-host.js.map +1 -0
- package/dist/update-readiness.d.ts +83 -0
- package/dist/update-readiness.js +459 -0
- package/dist/update-readiness.js.map +1 -0
- package/dist/update-recovery/kit.d.ts +35 -0
- package/dist/update-recovery/kit.js +99 -0
- package/dist/update-recovery/kit.js.map +1 -0
- package/dist/update-recovery/pre-start.d.ts +34 -0
- package/dist/update-recovery/pre-start.js +103 -0
- package/dist/update-recovery/pre-start.js.map +1 -0
- package/dist/update-recovery/recover-main.d.ts +1 -0
- package/dist/update-recovery/recover-main.js +4 -0
- package/dist/update-recovery/recover-main.js.map +1 -0
- package/dist/update-recovery/recover.d.ts +22 -0
- package/dist/update-recovery/recover.js +124 -0
- package/dist/update-recovery/recover.js.map +1 -0
- package/dist/update-recovery/route.d.ts +53 -0
- package/dist/update-recovery/route.js +262 -0
- package/dist/update-recovery/route.js.map +1 -0
- package/dist/update-recovery/runner.d.ts +58 -0
- package/dist/update-recovery/runner.js +196 -0
- package/dist/update-recovery/runner.js.map +1 -0
- package/dist/update-recovery/service-manager.d.ts +39 -0
- package/dist/update-recovery/service-manager.js +57 -0
- package/dist/update-recovery/service-manager.js.map +1 -0
- package/dist/update-restore.d.ts +44 -0
- package/dist/update-restore.js +355 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +38 -0
- package/dist/update-retained.js +91 -0
- package/dist/update-retained.js.map +1 -0
- package/dist/update-rollback.d.ts +74 -0
- package/dist/update-rollback.js +221 -0
- package/dist/update-rollback.js.map +1 -0
- package/dist/update-settings.d.ts +36 -0
- package/dist/update-settings.js +122 -0
- package/dist/update-settings.js.map +1 -0
- package/dist/update-snapshot-manifest.d.ts +32 -0
- package/dist/update-snapshot-manifest.js +65 -0
- package/dist/update-snapshot-manifest.js.map +1 -0
- package/dist/update-snapshot-scope.d.ts +67 -0
- package/dist/update-snapshot-scope.js +172 -0
- package/dist/update-snapshot-scope.js.map +1 -0
- package/dist/update-snapshot.d.ts +34 -0
- package/dist/update-snapshot.js +246 -0
- package/dist/update-snapshot.js.map +1 -0
- package/dist/update-writers.d.ts +71 -0
- package/dist/update-writers.js +235 -0
- package/dist/update-writers.js.map +1 -0
- package/dist/web-api.d.ts +6 -0
- package/dist/web-api.js +140 -22
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +7 -0
- package/dist/web-chat-history.js +15 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-office-acts.d.ts +16 -0
- package/dist/web-office-acts.js +27 -9
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.js +1 -1
- package/dist/web-office-pack-read.js.map +1 -1
- package/dist/web-office-skins.d.ts +5 -3
- package/dist/web-office-skins.js +20 -16
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-preview.d.ts +5 -0
- package/dist/web-preview.js +1 -1
- package/dist/web-preview.js.map +1 -1
- package/dist/web-settings-patch.d.ts +27 -0
- package/dist/web-settings-patch.js +67 -0
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-update.d.ts +6 -0
- package/dist/windows-agents.d.ts +12 -0
- package/dist/windows-agents.js +5 -0
- package/dist/windows-agents.js.map +1 -1
- package/dist/workflow-templates/default.md +1 -0
- package/launcher/agend +4 -1
- package/launcher/agend-agent +4 -1
- package/launcher/agend-install.cjs +16 -8
- package/launcher/install-admission.d.cts +8 -0
- package/launcher/npm-allow-scripts.cjs +72 -0
- package/launcher/npm-global-prefix.cjs +81 -0
- package/launcher/postinstall.cjs +9 -8
- package/launcher/runtime-select.cjs +8 -2
- package/package.json +3 -2
- package/scripts/preinstall-guard.cjs +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M-3770 slice 2.3 (design update-transaction §4.4): the writers-gone proof. Run after the fences (§4.2), and again
|
|
3
|
+
* after the snapshot's copy and after a restore, before their result is published.
|
|
4
|
+
*
|
|
5
|
+
* - **It looks for** any process of this uid that has `AGEND_HOME` equal to this home, its cwd under the home, or a file
|
|
6
|
+
* of the scope open or mapped (Linux: `/proc/<pid>/{environ,cwd,fd,maps}`).
|
|
7
|
+
* - **An incomplete scan is never proof of absence:** a listing that fails, or a process of this uid that STAYS unreadable.
|
|
8
|
+
* A process caught mid-execve or mid-exit fails its reads for a moment (EACCES/EPERM, not ENOENT), so an unreadable one
|
|
9
|
+
* is read again a few times with a short backoff (Fable #4524 F1); between tries it is re-identified — gone is gone, a
|
|
10
|
+
* new start is a different process (classified afresh). Only the same process, unreadable through every try, makes
|
|
11
|
+
* the scan incomplete.
|
|
12
|
+
* - **Sealed processes (design rev 10).** A process of this uid that the kernel closes to this reader is positively
|
|
13
|
+
* identified and reported as `uninspectable`, not as a gap: one made non-dumpable (its `status` reads this uid while
|
|
14
|
+
* its `fd` directory is root's — every systemd user session's `(sd-pam)`), or one holding capabilities this process
|
|
15
|
+
* doesn't (`CapPrm`, readable in `status`; the kernel then denies the read). AgEnD's own processes and the CLIs it
|
|
16
|
+
* launches are neither: AgEnD never clears the dumpable flag and grants no capabilities. Any other unreadable process
|
|
17
|
+
* still makes the scan incomplete.
|
|
18
|
+
* - **The exempt set is exactly:** the updater (`attempt.updater`), the recovery runner (`runner.json`), and helpers the
|
|
19
|
+
* attempt itself spawned (`attempt.helpers[]`, each `{ pid, start }`) whose ancestor chain — by ppid, each step's
|
|
20
|
+
* start time read — reaches the updater or the runner. Nothing is exempt by name or argv.
|
|
21
|
+
*
|
|
22
|
+
* Every read goes through `WritersDeps`, so the proof is testable without real processes; `procWritersDeps()` is the
|
|
23
|
+
* Linux implementation. On another platform the proof is incomplete until its scanner exists (macOS: `lsof -Fn +D`).
|
|
24
|
+
*/
|
|
25
|
+
import { readdirSync, readFileSync, readlinkSync, realpathSync, statSync } from "node:fs";
|
|
26
|
+
import { join, sep } from "node:path";
|
|
27
|
+
import { classify } from "./update-snapshot-scope.js";
|
|
28
|
+
const isUnder = (path, root) => path === root || path.startsWith(root + sep);
|
|
29
|
+
/**
|
|
30
|
+
* The kernel's subset rule for a same-uid read (ptrace_may_access): refused when the target's permitted capabilities
|
|
31
|
+
* hold a bit the reader's don't. Each argument is a `/proc/<pid>/status` text; a missing CapPrm line reads as none.
|
|
32
|
+
*/
|
|
33
|
+
export function capsExceed(targetStatus, readerStatus) {
|
|
34
|
+
const caps = (text) => BigInt(`0x${/^CapPrm:\s+([0-9a-f]+)/m.exec(text)?.[1] ?? "0"}`);
|
|
35
|
+
return (caps(targetStatus) & ~caps(readerStatus)) !== 0n;
|
|
36
|
+
}
|
|
37
|
+
/** Re-reads of a process of this uid that can't be read, and the wait before each (≈ 100 ms in all). */
|
|
38
|
+
export const UNREADABLE_RETRIES = 5;
|
|
39
|
+
export const UNREADABLE_BACKOFF_MS = 20;
|
|
40
|
+
/** §4.4 for `home` (any spelling; compared as realpath), with the attempt's exempt set. */
|
|
41
|
+
export function proveWritersGone(home, exempt, d) {
|
|
42
|
+
if (d.platform !== "linux")
|
|
43
|
+
return { ok: false, incomplete: true, reason: `no writers scan exists on ${d.platform} yet` };
|
|
44
|
+
let root;
|
|
45
|
+
try {
|
|
46
|
+
root = realpathSync(home);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return { ok: false, incomplete: true, reason: `the home can't be resolved (${err.message})` };
|
|
50
|
+
}
|
|
51
|
+
const pids = d.listPids();
|
|
52
|
+
if (!pids)
|
|
53
|
+
return { ok: false, incomplete: true, reason: "the process list can't be read" };
|
|
54
|
+
const isExact = (pid, who) => !!who && who.pid === pid && d.sameProcess(pid, who.start);
|
|
55
|
+
const owners = [exempt.updater, ...(exempt.runner ? [exempt.runner] : [])];
|
|
56
|
+
/** A recorded helper whose ancestor chain (each step proven by its start) reaches the updater or the runner. */
|
|
57
|
+
const isHelper = (pid) => {
|
|
58
|
+
const helper = exempt.helpers.find(h => h.pid === pid);
|
|
59
|
+
if (!helper || !d.sameProcess(pid, helper.start))
|
|
60
|
+
return false;
|
|
61
|
+
let cur = pid;
|
|
62
|
+
for (let hops = 0; hops < 64 && typeof cur === "number" && cur > 1; hops++) {
|
|
63
|
+
const parent = d.ppidOf(cur);
|
|
64
|
+
if (typeof parent !== "number")
|
|
65
|
+
return false;
|
|
66
|
+
if (owners.some(o => isExact(parent, o)))
|
|
67
|
+
return true;
|
|
68
|
+
// An intermediate step must itself be a recorded helper (its start proven), never an unrecorded process.
|
|
69
|
+
const step = exempt.helpers.find(h => h.pid === parent);
|
|
70
|
+
if (!step || !d.sameProcess(parent, step.start))
|
|
71
|
+
return false;
|
|
72
|
+
cur = parent;
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
};
|
|
76
|
+
const writers = [];
|
|
77
|
+
const uninspectable = [];
|
|
78
|
+
/** One look at a pid: not ours, exempt, sealed, gone, unreadable, or its three reads. */
|
|
79
|
+
const look = (pid) => {
|
|
80
|
+
const uid = d.uidOf(pid);
|
|
81
|
+
if (uid === "gone")
|
|
82
|
+
return { kind: "skip" };
|
|
83
|
+
if (uid === null)
|
|
84
|
+
return { kind: "unreadable", what: "owner" };
|
|
85
|
+
if (uid !== d.uid)
|
|
86
|
+
return { kind: "skip" };
|
|
87
|
+
if (owners.some(o => isExact(pid, o)) || isHelper(pid))
|
|
88
|
+
return { kind: "skip" };
|
|
89
|
+
const sealed = d.sealed(pid);
|
|
90
|
+
if (sealed)
|
|
91
|
+
return { kind: "uninspectable", why: sealed };
|
|
92
|
+
const env = d.agendHomeOf(pid), cwd = d.cwdOf(pid), files = d.filesOf(pid);
|
|
93
|
+
if (env === "gone" || cwd === "gone" || files === "gone")
|
|
94
|
+
return { kind: "skip" };
|
|
95
|
+
if (env === null || cwd === null || files === null)
|
|
96
|
+
return { kind: "unreadable", what: env === null ? "environment" : cwd === null ? "working directory" : "open files" };
|
|
97
|
+
return { kind: "read", env, cwd, files };
|
|
98
|
+
};
|
|
99
|
+
for (const pid of pids) {
|
|
100
|
+
let r = look(pid);
|
|
101
|
+
// Unreadable: re-read with a backoff. Each look classifies afresh (gone → skipped; readable → judged). A pid that is
|
|
102
|
+
// now a different process (another start) gets its own full set of tries, a few times at most: the scan stays bounded.
|
|
103
|
+
let seen = r.kind === "unreadable" ? d.startOf(pid) : null;
|
|
104
|
+
for (let tries = 0, renewals = 0; r.kind === "unreadable" && tries < UNREADABLE_RETRIES; tries++) {
|
|
105
|
+
d.sleep(UNREADABLE_BACKOFF_MS);
|
|
106
|
+
const start = d.startOf(pid);
|
|
107
|
+
if (start && seen && !d.sameProcess(pid, seen) && renewals < 3) {
|
|
108
|
+
seen = start;
|
|
109
|
+
tries = -1;
|
|
110
|
+
renewals++;
|
|
111
|
+
}
|
|
112
|
+
else if (!seen)
|
|
113
|
+
seen = start;
|
|
114
|
+
r = look(pid);
|
|
115
|
+
}
|
|
116
|
+
if (r.kind === "skip")
|
|
117
|
+
continue;
|
|
118
|
+
if (r.kind === "uninspectable") {
|
|
119
|
+
uninspectable.push({ pid, name: d.nameOf?.(pid) ?? null, why: r.why });
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (r.kind === "unreadable") {
|
|
123
|
+
const name = d.nameOf?.(pid);
|
|
124
|
+
return { ok: false, incomplete: true, reason: `pid ${pid}${name ? ` (${name})` : ""}, this user's, stays unreadable (its ${r.what}) through ${UNREADABLE_RETRIES} re-reads` };
|
|
125
|
+
}
|
|
126
|
+
const { env, cwd, files } = r;
|
|
127
|
+
const real = (p) => { try {
|
|
128
|
+
return realpathSync(p);
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return p;
|
|
132
|
+
} };
|
|
133
|
+
if (env !== undefined && real(env) === root) {
|
|
134
|
+
writers.push({ pid, why: `its AGEND_HOME is this home` });
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (isUnder(real(cwd), root)) {
|
|
138
|
+
writers.push({ pid, why: `its working directory is under the home (${cwd})` });
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const scoped = files.find(f => {
|
|
142
|
+
if (!isUnder(f, root) || f === root)
|
|
143
|
+
return false;
|
|
144
|
+
const rel = f.slice(root.length + 1).split(sep).join("/");
|
|
145
|
+
try {
|
|
146
|
+
return classify(rel).included;
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (scoped)
|
|
153
|
+
writers.push({ pid, why: `it has ${scoped} open or mapped` });
|
|
154
|
+
}
|
|
155
|
+
return writers.length
|
|
156
|
+
? { ok: false, incomplete: false, writers, reason: writers.map(w => `pid ${w.pid}: ${w.why}`).join("; ") }
|
|
157
|
+
: { ok: true, ...(uninspectable.length ? { uninspectable } : {}) };
|
|
158
|
+
}
|
|
159
|
+
/** Linux: `/proc`. A process that exits mid-read is "gone"; anything else unreadable is null. */
|
|
160
|
+
export function procWritersDeps(sameProcess, startOf) {
|
|
161
|
+
const gone = (err) => ["ENOENT", "ESRCH"].includes(err.code ?? "");
|
|
162
|
+
const read = (fn) => { try {
|
|
163
|
+
return fn();
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
return gone(err) ? "gone" : null;
|
|
167
|
+
} };
|
|
168
|
+
return {
|
|
169
|
+
listPids: () => { try {
|
|
170
|
+
return readdirSync("/proc").filter(n => /^\d+$/.test(n)).map(Number);
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return null;
|
|
174
|
+
} },
|
|
175
|
+
uidOf: pid => read(() => statSync(`/proc/${pid}`).uid),
|
|
176
|
+
agendHomeOf: pid => read(() => {
|
|
177
|
+
const env = readFileSync(`/proc/${pid}/environ`, "latin1").split("\0").find(e => e.startsWith("AGEND_HOME="));
|
|
178
|
+
return env === undefined ? undefined : env.slice("AGEND_HOME=".length);
|
|
179
|
+
}),
|
|
180
|
+
cwdOf: pid => read(() => readlinkSync(`/proc/${pid}/cwd`)),
|
|
181
|
+
filesOf: pid => read(() => {
|
|
182
|
+
const out = [];
|
|
183
|
+
for (const fd of readdirSync(`/proc/${pid}/fd`)) {
|
|
184
|
+
try {
|
|
185
|
+
const t = readlinkSync(join(`/proc/${pid}/fd`, fd));
|
|
186
|
+
if (t.startsWith("/"))
|
|
187
|
+
out.push(t.replace(/ \(deleted\)$/, ""));
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
if (!gone(err))
|
|
191
|
+
throw err;
|
|
192
|
+
} // an fd closed mid-read: skip it
|
|
193
|
+
}
|
|
194
|
+
for (const line of readFileSync(`/proc/${pid}/maps`, "utf8").split("\n")) {
|
|
195
|
+
const at = line.indexOf("/");
|
|
196
|
+
if (at >= 0)
|
|
197
|
+
out.push(line.slice(at).replace(/ \(deleted\)$/, ""));
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}),
|
|
201
|
+
ppidOf: pid => read(() => {
|
|
202
|
+
const stat = readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
203
|
+
return Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
|
|
204
|
+
}),
|
|
205
|
+
startOf: pid => { const t = startOf(pid); return t ? { processStart: t } : null; },
|
|
206
|
+
sleep: ms => { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms); },
|
|
207
|
+
sealed: pid => {
|
|
208
|
+
try {
|
|
209
|
+
const status = readFileSync(`/proc/${pid}/status`, "utf8");
|
|
210
|
+
const real = /^Uid:\s+(\d+)/m.exec(status)?.[1];
|
|
211
|
+
if (real === undefined || Number(real) === 0)
|
|
212
|
+
return false;
|
|
213
|
+
// Non-dumpable: its per-process files are root's.
|
|
214
|
+
if (statSync(`/proc/${pid}/fd`).uid === 0)
|
|
215
|
+
return "non-dumpable";
|
|
216
|
+
// Privileged: it holds capabilities this process doesn't, so the kernel refuses to let this process read it
|
|
217
|
+
// (ptrace read access) though both run as one uid (Fable #4524 CI: a runner process). AgEnD's processes hold none.
|
|
218
|
+
return capsExceed(status, readFileSync("/proc/self/status", "utf8")) ? "privileged" : false;
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
nameOf: pid => { try {
|
|
225
|
+
return /^Name:\s+(.*)$/m.exec(readFileSync(`/proc/${pid}/status`, "utf8"))?.[1] ?? null;
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return null;
|
|
229
|
+
} },
|
|
230
|
+
sameProcess,
|
|
231
|
+
uid: typeof process.getuid === "function" ? process.getuid() : -1,
|
|
232
|
+
platform: process.platform,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=update-writers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-writers.js","sourceRoot":"","sources":["../src/update-writers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAyCtD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AAE7F;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,YAAoB,EAAE,YAAoB;IACnE,MAAM,IAAI,GAA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;YAAC,CAAC;QAC3B,CAAC;QACD,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;YAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,IAAI,CAAC;QAAC,CAAC,CAAC,CAAC;QAC1I,WAAW;QACX,GAAG,EAAE,OAAO,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC"}
|
package/dist/web-api.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RequestContactApiHost } from "./request-contact-api.js";
|
|
1
2
|
import { type ClaudeCredentialApi } from "./web-claude-credentials.js";
|
|
2
3
|
import { type ContactApiHost } from "./contact-auth-api.js";
|
|
3
4
|
import { type HumanOrigin, type WebSessionIdentity } from "./human-delivery-receipts.js";
|
|
@@ -59,6 +60,8 @@ export type AccountWriteResult = {
|
|
|
59
60
|
message?: string;
|
|
60
61
|
};
|
|
61
62
|
export interface WebApiContext extends ClaudeCredentialApi {
|
|
63
|
+
/** Uninstalled until L. New API reads/decisions do not replace legacy routes while OFF. */
|
|
64
|
+
requestContactApi?: RequestContactApiHost;
|
|
62
65
|
hostHistoryQuery?(range: unknown, series: unknown): Promise<import('./host-monitoring-history.js').HostHistoryResult>;
|
|
63
66
|
hostHealthSnapshot?(agentOffset?: number): import("./host-monitoring.js").HostHealthSnapshot;
|
|
64
67
|
hostAlertAction?(key: string, revision: number, actor: string, snoozeMs?: number): Promise<boolean>;
|
|
@@ -162,6 +165,9 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
162
165
|
defaults?: {
|
|
163
166
|
backend?: string;
|
|
164
167
|
effort?: string;
|
|
168
|
+
task_board?: {
|
|
169
|
+
archive_after_days?: number;
|
|
170
|
+
};
|
|
165
171
|
};
|
|
166
172
|
instances: Record<string, {
|
|
167
173
|
topic_id?: number | string;
|
package/dist/web-api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { handleRequestContactApi } from "./request-contact-api.js";
|
|
1
2
|
import { historyQuery } from './host-monitoring-history-policy.js';
|
|
2
3
|
import { instructionFileSizes } from "./instruction-file-sizes.js";
|
|
3
4
|
import { handleClaudeCredentials } from "./web-claude-credentials.js";
|
|
@@ -26,7 +27,7 @@ import { AGENT_WIDGET_SLOTS, checkWidgetData, checkWidgetSpec } from "./web-widg
|
|
|
26
27
|
import { checkOwnerCss, ownerCssAssetRefs } from "./web-owner-css.js";
|
|
27
28
|
import { canonicalText } from "./web-theme.js";
|
|
28
29
|
import { parsePinKey } from "./web-pin-store.js";
|
|
29
|
-
import { SKIN_WIRE_BYTES } from "./web-office-skins.js";
|
|
30
|
+
import { SKIN_WIRE_BYTES, skinPictureType } from "./web-office-skins.js";
|
|
30
31
|
import { gatewayRequestContext } from "./web-request-context.js";
|
|
31
32
|
import { crossInstanceVisibility } from "./cross-instance-notice.js";
|
|
32
33
|
import { permitWebContinuation } from "./web-continuation.js";
|
|
@@ -44,7 +45,8 @@ import { MAX_COMMAND_ARGS } from "./web-commands.js";
|
|
|
44
45
|
import { ROUTE_WORKER_CSP, ROUTE_WORKER_PATH, sendPanelHtml } from "./web-host-guard.js";
|
|
45
46
|
import { libavoidFile } from "./web-libavoid.js";
|
|
46
47
|
import { shellRoute } from "./web-shell-routes.js";
|
|
47
|
-
import { createReadStream, createWriteStream, existsSync, readFileSync, closeSync } from "node:fs";
|
|
48
|
+
import { createReadStream, createWriteStream, existsSync, readFileSync, closeSync, constants as fsConstants } from "node:fs";
|
|
49
|
+
import { open as openFile } from "node:fs/promises";
|
|
48
50
|
import { servedAssets } from "./auth-api.js";
|
|
49
51
|
import { assetIntact, assetsUnchanged, assetVersion, assetVersionMark, answerStaleAsset, buildModuleGraph, staticClosure, versionShell, IMMUTABLE_PRIVATE } from "./web-asset-version.js";
|
|
50
52
|
import { join, dirname } from "node:path";
|
|
@@ -53,7 +55,7 @@ import { createHash, createHmac, randomUUID } from "node:crypto";
|
|
|
53
55
|
import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
|
|
54
56
|
import { scheduleView } from "./web-schedules.js";
|
|
55
57
|
import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
|
|
56
|
-
import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError, cardCode } from "./scheduler/task-board.js";
|
|
58
|
+
import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError, archiveAfterDays, cardCode } from "./scheduler/task-board.js";
|
|
57
59
|
import { TASK_REF_SEPARATOR, cardsForRefs, taskReadWay, taskRefBlock, taskRefCodes, taskRefView } from "./chat-task-refs.js";
|
|
58
60
|
import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js";
|
|
59
61
|
import { z } from "zod";
|
|
@@ -74,6 +76,7 @@ import { isGeneralInstance } from "./general-instance.js";
|
|
|
74
76
|
import { resolveToolSet } from "./tool-permissions.js";
|
|
75
77
|
import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
|
|
76
78
|
import { WEB_NAME_FALLBACK, webPersonKey } from "./web-profile.js";
|
|
79
|
+
import { updateAnswerLabel } from "./update-card.js";
|
|
77
80
|
import { commitTeamCreate, commitTeamUpdate } from "./outbound-handlers.js";
|
|
78
81
|
import { parseMentionQuery } from "./web-mentions.js";
|
|
79
82
|
import { authorizeExplicitInstanceRemoval } from "./instance-removal.js";
|
|
@@ -234,6 +237,20 @@ function contactNeedsFor(req, url, ctx, base) {
|
|
|
234
237
|
const admin = auth.kind === 'allow' && auth.via === 'session' && auth.session.tier === 'admin';
|
|
235
238
|
base = admin ? base : base.filter(item => !item || typeof item !== 'object' || item.type !== 'host');
|
|
236
239
|
const ordinary = base.filter(item => !item || typeof item !== "object" || item.type !== "contact");
|
|
240
|
+
if (ctx.requestContactApi) {
|
|
241
|
+
// Active host replaces the count-only fallback with per-target scoped ids, including before verification.
|
|
242
|
+
// The new service never supplies a decision permit through these passive item ids.
|
|
243
|
+
let scoped = [];
|
|
244
|
+
try {
|
|
245
|
+
const viewer = ctx.requestContactApi.principal(req, url);
|
|
246
|
+
if (viewer?.current())
|
|
247
|
+
scoped = ctx.requestContactApi.needs?.(viewer) ?? [];
|
|
248
|
+
}
|
|
249
|
+
catch { /* The explicit card API reports unavailable; never leak the legacy global count. */ }
|
|
250
|
+
const observer = ctx.contactSuggestionActor?.(req, url);
|
|
251
|
+
const suggestions = observer && ctx.contactNeeds ? ctx.contactNeeds(observer).filter(item => item && typeof item === "object" && item.reason === "contact_restricted_suggestion") : [];
|
|
252
|
+
return [...ordinary, ...scoped, ...suggestions];
|
|
253
|
+
}
|
|
237
254
|
const actor = ctx.contactActor?.(req, url);
|
|
238
255
|
if (actor && ctx.contactNeeds)
|
|
239
256
|
return [...ordinary, ...ctx.contactNeeds(actor)];
|
|
@@ -274,7 +291,9 @@ function boardHiding(ctx, gateway) {
|
|
|
274
291
|
const fleet = ctx.fleetConfig;
|
|
275
292
|
const hiddenName = (n) => gateway && typeof n === "string" && !!n && !!ctx.fleetConfig?.instances?.[n] && crossInstanceVisibility(fleet, n) === "hidden";
|
|
276
293
|
const hidden = (c) => [c.assignee, c.createdBy, c.dispatcher?.name].some(hiddenName);
|
|
277
|
-
|
|
294
|
+
/** M-3668 review: the names hiddenName() refuses, for a read that must leave them out before it pages (the Archive). */
|
|
295
|
+
const hiddenNames = () => Object.keys(ctx.fleetConfig?.instances ?? {}).filter(hiddenName);
|
|
296
|
+
return { hiddenName, hidden, hiddenNames };
|
|
278
297
|
}
|
|
279
298
|
/**
|
|
280
299
|
* Chat history as the public link may see it (#2341 review): a status line that names board cards (the daily summary)
|
|
@@ -579,10 +598,11 @@ function handleAppIcon(req, res, url, ctx, method) {
|
|
|
579
598
|
}
|
|
580
599
|
/**
|
|
581
600
|
* M-2738 (#3332): updating AgEnD from the web.
|
|
582
|
-
* GET /ui/update { admin, current, offer?, checked_at?, check_failed?, progress?, now } — an admin session; a
|
|
601
|
+
* GET /ui/update { admin, current, offer?, card?, checked_at?, check_failed?, progress?, now } — an admin session; a
|
|
583
602
|
* read-only session gets { admin: false, current } (its stale-tab reload line)
|
|
584
603
|
* POST /ui/update/check look now (one a minute) → the GET's answer
|
|
585
604
|
* POST /ui/update/start { confirm: "update-agend" } + Idempotency-Key → 202 { started } (the progress is the GET's)
|
|
605
|
+
* POST /ui/update/answer { action } + Idempotency-Key → 200 { card } (the one update offer)
|
|
586
606
|
* GET /ui/update/log { text, error } — the updater's own words, for the failure's "full log"
|
|
587
607
|
* Signed-in sessions only (never the CLI's token or a guest; M-3278: the public link's sessions too, as locally); an
|
|
588
608
|
* admin's for all but the version. Asked again once a body is in.
|
|
@@ -593,7 +613,7 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
593
613
|
json(res, 404, { error: "not found" });
|
|
594
614
|
return true;
|
|
595
615
|
}
|
|
596
|
-
const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/log": "GET" };
|
|
616
|
+
const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/answer": "POST", "/ui/update/log": "GET" };
|
|
597
617
|
if (!routes[path]) {
|
|
598
618
|
json(res, 404, { error: "not found" });
|
|
599
619
|
return true;
|
|
@@ -611,14 +631,14 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
611
631
|
if (verdict.via !== "session" || !verdict.session || verdict.session.tier === "guest")
|
|
612
632
|
return { status: 403, error: "update_needs_a_signed_in_person" };
|
|
613
633
|
const owner = verdict.session.owner;
|
|
614
|
-
return { admin: verdict.session.tier === "admin", person: owner ? webPersonKey(owner) : "admin-session" };
|
|
634
|
+
return { admin: verdict.session.tier === "admin", person: owner ? webPersonKey(owner) : "admin-session", label: owner ? (ctx.webPerson?.(owner)?.name ?? "") : "" };
|
|
615
635
|
};
|
|
616
636
|
const view = (admin) => {
|
|
617
637
|
const st = host.updateState();
|
|
618
638
|
if (!admin)
|
|
619
639
|
return { admin: false, current: st.current };
|
|
620
640
|
const progress = host.updateProgress();
|
|
621
|
-
return { admin: true, current: st.current, offer: st.offer, hubRecommendation: st.hubRecommendation ?? null, checked_at: st.checkedAt, check_failed: st.checkFailed, progress, now: Date.now() };
|
|
641
|
+
return { admin: true, current: st.current, offer: st.offer, hubRecommendation: st.hubRecommendation ?? null, checked_at: st.checkedAt, check_failed: st.checkFailed, preflight: st.preflight ?? null, progress, card: host.card?.() ?? null, now: Date.now() };
|
|
622
642
|
};
|
|
623
643
|
const first = who();
|
|
624
644
|
if ("status" in first) {
|
|
@@ -644,7 +664,7 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
644
664
|
body = await parseBody(req);
|
|
645
665
|
}
|
|
646
666
|
catch {
|
|
647
|
-
if (path === "/ui/update/start") {
|
|
667
|
+
if (path === "/ui/update/start" || path === "/ui/update/answer") {
|
|
648
668
|
json(res, 400, { error: "Invalid JSON" });
|
|
649
669
|
return;
|
|
650
670
|
}
|
|
@@ -660,6 +680,8 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
660
680
|
json(res, 403, { error: "update_needs_an_admin_session" });
|
|
661
681
|
return;
|
|
662
682
|
}
|
|
683
|
+
// Prism #3505 P2-3: the session that asked, still current and still an admin's, right up to an immediate launch.
|
|
684
|
+
const stillAllowed = () => { const v = who(); return !("status" in v) && v.admin && v.person === now.person; };
|
|
663
685
|
if (path === "/ui/update/check") {
|
|
664
686
|
const r = await host.checkUpdateNow();
|
|
665
687
|
if (!r.ok) {
|
|
@@ -669,6 +691,21 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
669
691
|
json(res, 200, view(true));
|
|
670
692
|
return;
|
|
671
693
|
}
|
|
694
|
+
if (path === "/ui/update/answer") {
|
|
695
|
+
if (!host.answerUpdate) {
|
|
696
|
+
json(res, 404, { error: "unavailable" });
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const header = req.headers["idempotency-key"];
|
|
700
|
+
const key = typeof header === "string" ? header : "";
|
|
701
|
+
if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
|
|
702
|
+
json(res, 400, { error: "Idempotency-Key required (8-128 chars of [A-Za-z0-9_.:-])" });
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
const answered = await host.answerUpdate(key, updateAnswerLabel(now.label), body, stillAllowed);
|
|
706
|
+
json(res, answered.status, answered.ok ? { card: answered.card } : answered.body);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
672
709
|
const header = req.headers["idempotency-key"];
|
|
673
710
|
const key = typeof header === "string" ? header : "";
|
|
674
711
|
if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
|
|
@@ -680,8 +717,6 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
|
680
717
|
json(res, 400, { error: 'confirm must be the literal "update-agend"' });
|
|
681
718
|
return;
|
|
682
719
|
}
|
|
683
|
-
// Prism #3505 P2-3: the session that asked, still current and still an admin's, right up to the updater's launch.
|
|
684
|
-
const stillAllowed = () => { const v = who(); return !("status" in v) && v.admin && v.person === now.person; };
|
|
685
720
|
// M-3140: `recommended` — the Hub's advice this page showed ({ version, revision }); the server re-reads its own.
|
|
686
721
|
const rec = body.recommended;
|
|
687
722
|
if (rec !== undefined && (typeof rec !== "object" || rec === null || typeof rec.version !== "string" || rec.version.length > 128
|
|
@@ -1047,7 +1082,7 @@ function handleOfficeSkins(req, res, url, ctx, path, method) {
|
|
|
1047
1082
|
json(res, 404, { error: "No such image" });
|
|
1048
1083
|
return true;
|
|
1049
1084
|
}
|
|
1050
|
-
res.setHeader("Content-Type",
|
|
1085
|
+
res.setHeader("Content-Type", skinPictureType(bytes));
|
|
1051
1086
|
// Keyed by the sha of its bytes: a picture at this URL never changes.
|
|
1052
1087
|
res.setHeader("Cache-Control", "private, max-age=31536000, immutable");
|
|
1053
1088
|
res.setHeader("Content-Security-Policy", "default-src 'none'; sandbox");
|
|
@@ -2550,6 +2585,51 @@ function boardActor(req, url, ctx, p) {
|
|
|
2550
2585
|
* A board refusal as the dashboard reads it: the board's sentence, its code and the status that fits, and — when the
|
|
2551
2586
|
* person can meet it — the key and values the page says it with in its own language.
|
|
2552
2587
|
*/
|
|
2588
|
+
/**
|
|
2589
|
+
* GET /ui/tasks/files/<id> — a file an agent put on a card, sent as a DOWNLOAD. It is read with the card: any
|
|
2590
|
+
* session that may read the card may fetch it, and over the public link a card kept out of sight (or its main task), or a
|
|
2591
|
+
* file one of those instances wrote, is "no such file" — the same answer an unknown id gets. Never sent as a page: an image
|
|
2592
|
+
* as an image, text as plain text, everything else (HTML and SVG included) as an opaque download, under a sandboxing CSP and
|
|
2593
|
+
* `nosniff`; what the dashboard shows of an HTML file it fetches and runs in the preview frame, never from here.
|
|
2594
|
+
*/
|
|
2595
|
+
async function serveCardFile(res, board, id, rules) {
|
|
2596
|
+
const miss = () => { if (!res.headersSent)
|
|
2597
|
+
json(res, 404, { error: "No such file" }); };
|
|
2598
|
+
try {
|
|
2599
|
+
const found = board.attachment(id);
|
|
2600
|
+
const store = board.files();
|
|
2601
|
+
if (!found || !store || rules.hidden(found.card) || rules.hiddenName(found.file.author))
|
|
2602
|
+
return miss();
|
|
2603
|
+
const on = store.pathOf(found.card.uuid, id);
|
|
2604
|
+
if (!on || on.size !== found.file.size)
|
|
2605
|
+
return miss();
|
|
2606
|
+
// O_NOFOLLOW is undefined on Windows (the flag is then 0): there the isFile and size checks below stand alone (docs/design/task-board.md).
|
|
2607
|
+
const fh = await openFile(on.path, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
2608
|
+
let bytes;
|
|
2609
|
+
try {
|
|
2610
|
+
const st = await fh.stat();
|
|
2611
|
+
if (!st.isFile() || st.size !== found.file.size)
|
|
2612
|
+
return miss();
|
|
2613
|
+
bytes = await fh.readFile();
|
|
2614
|
+
}
|
|
2615
|
+
finally {
|
|
2616
|
+
await fh.close().catch(() => { });
|
|
2617
|
+
}
|
|
2618
|
+
const { file } = found;
|
|
2619
|
+
const inline = INLINE_MIME.has(file.mime);
|
|
2620
|
+
res.setHeader("Content-Type", inline ? file.mime : file.mime.startsWith("text/") ? "text/plain; charset=utf-8" : "application/octet-stream");
|
|
2621
|
+
res.setHeader("Content-Disposition", `${inline ? "inline" : "attachment"}; filename*=UTF-8''${encodeURIComponent(wellFormed(file.name))}`);
|
|
2622
|
+
res.setHeader("Content-Length", bytes.length);
|
|
2623
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
2624
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2625
|
+
res.setHeader("Content-Security-Policy", "default-src 'none'; img-src 'self'; style-src 'unsafe-inline'; sandbox");
|
|
2626
|
+
res.writeHead(200);
|
|
2627
|
+
res.end(bytes);
|
|
2628
|
+
}
|
|
2629
|
+
catch {
|
|
2630
|
+
miss();
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2553
2633
|
function boardError(res, err) {
|
|
2554
2634
|
if (res.headersSent)
|
|
2555
2635
|
return;
|
|
@@ -2774,6 +2854,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2774
2854
|
}
|
|
2775
2855
|
if (handleAgentRuntimeChange(req, res, url, ctx))
|
|
2776
2856
|
return true;
|
|
2857
|
+
if (handleRequestContactApi(req, res, url, ctx.requestContactApi))
|
|
2858
|
+
return true;
|
|
2777
2859
|
if (ctx.contactPermissions && ctx.writeContactPermissions && ctx.contactAuthorization && ctx.contactAuthorizations && ctx.decideContactAuthorization && ctx.contactActor
|
|
2778
2860
|
&& handleContactAuthorizationApi(req, res, url, ctx))
|
|
2779
2861
|
return true;
|
|
@@ -3461,8 +3543,9 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3461
3543
|
const answer = async () => {
|
|
3462
3544
|
if (op === "changes")
|
|
3463
3545
|
return { kind: "json", body: await workspaceChanges(ws) };
|
|
3546
|
+
// M-3765: `ignored=1` lists what git ignores too (each marked); soul.md at the top is listed either way.
|
|
3464
3547
|
if (op === "list")
|
|
3465
|
-
return { kind: "json", body: await workspaceList(ws, p.get("path") ?? "") };
|
|
3548
|
+
return { kind: "json", body: await workspaceList(ws, p.get("path") ?? "", { showIgnored: p.get("ignored") === "1" }) };
|
|
3466
3549
|
if (op === "file")
|
|
3467
3550
|
return { kind: "json", body: await workspaceFile(ws, p.get("path")) };
|
|
3468
3551
|
if (op === "diff")
|
|
@@ -5379,8 +5462,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5379
5462
|
}
|
|
5380
5463
|
// ── Task board (scheduler/task-board.ts) ──────────────
|
|
5381
5464
|
// Reads are the session's; every write is the signed-in person's, through the same rules an instance's tools use.
|
|
5382
|
-
if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/refs" || path === "/ui/tasks/work" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects")) {
|
|
5465
|
+
if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/refs" || path === "/ui/tasks/work" || path === "/ui/tasks/archive" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects") || path.startsWith("/ui/tasks/files/")) {
|
|
5383
5466
|
const board = ctx.scheduler?.db.board;
|
|
5467
|
+
// M-3668: how many days after it finished a main task leaves the board (defaults.task_board.archive_after_days).
|
|
5468
|
+
const archiveDays = archiveAfterDays(ctx.fleetConfig?.defaults?.task_board?.archive_after_days);
|
|
5384
5469
|
if (!board) {
|
|
5385
5470
|
json(res, 503, { error: "The task board is not available", code: "unavailable", key: "unavailable" });
|
|
5386
5471
|
return true;
|
|
@@ -5394,7 +5479,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5394
5479
|
return true;
|
|
5395
5480
|
}
|
|
5396
5481
|
// …nor shows the cards of instances kept out of sight (cross_instance_visibility: hidden).
|
|
5397
|
-
const { hiddenName, hidden } = boardHiding(ctx, !!gateway);
|
|
5482
|
+
const { hiddenName, hidden, hiddenNames } = boardHiding(ctx, !!gateway);
|
|
5398
5483
|
// #2303 review: what a visible card shows of the cards around it follows the same rule — its children, its main
|
|
5399
5484
|
// task (a search hit's too) — and so do the words and the history a hidden instance left on it.
|
|
5400
5485
|
// …and a hidden instance's words on a visible card are not counted, named or found there (#2304 review).
|
|
@@ -5471,10 +5556,15 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5471
5556
|
try {
|
|
5472
5557
|
const ref = card ? decodeURIComponent(card[1]) : "";
|
|
5473
5558
|
if (method === "GET" && path === "/ui/tasks/board") {
|
|
5474
|
-
// A page that has this revision already is told so, not sent the board again.
|
|
5559
|
+
// A page that has this revision already is told so, not sent the board again. #4428 review: and only when time
|
|
5560
|
+
// has not moved a card across one of the board's lines (archived, this week, the recent window) since it read:
|
|
5561
|
+
// `epoch` says where they stood (a page that sends none, an older one, always gets the board).
|
|
5475
5562
|
const rev = board.revision();
|
|
5476
|
-
|
|
5477
|
-
|
|
5563
|
+
// #4428 review: over the public link the hidden instances' cards move neither the epoch nor any project number.
|
|
5564
|
+
const leaveOut = hiddenNames();
|
|
5565
|
+
const epoch = board.boardEpoch(archiveDays, undefined, leaveOut);
|
|
5566
|
+
if (url.searchParams.get("rev") === String(rev) && url.searchParams.get("epoch") === epoch) {
|
|
5567
|
+
json(res, 200, { rev, epoch, unchanged: true });
|
|
5478
5568
|
return true;
|
|
5479
5569
|
}
|
|
5480
5570
|
const allDone = url.searchParams.get("done") === "all";
|
|
@@ -5485,19 +5575,19 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5485
5575
|
// The instances with the task board switched off: no card is handed to them (the pickers mark them), and a
|
|
5486
5576
|
// fleet.yaml edit changes them with the revision unchanged.
|
|
5487
5577
|
const boardOff = taskBoardOffNames(ctx.fleetConfig).filter((n) => !hiddenName(n));
|
|
5488
|
-
const key = gateway ? null : `${rev}:${allDone ? 1 : 0}:${Math.floor(Date.now() / 60_000)}:${board.goneDispatchers(ctx.dispatcherGone)}:${boardOff.join("\u0000")}`;
|
|
5578
|
+
const key = gateway ? null : `${rev}:${allDone ? 1 : 0}:${epoch}:${Math.floor(Date.now() / 60_000)}:${board.goneDispatchers(ctx.dispatcherGone)}:${boardOff.join("\u0000")}`;
|
|
5489
5579
|
const kept = key ? boardBodies.get(board) : undefined;
|
|
5490
5580
|
if (kept && kept.key === key) {
|
|
5491
5581
|
jsonText(res, 200, kept.body);
|
|
5492
5582
|
return true;
|
|
5493
5583
|
}
|
|
5494
|
-
const cards = board.boardCards(undefined, allDone).filter((c) => !hidden(c));
|
|
5584
|
+
const cards = board.boardCards(undefined, allDone, archiveDays).filter((c) => !hidden(c));
|
|
5495
5585
|
// #2352: over the public link a hidden lead is not named (the project reads as having none).
|
|
5496
5586
|
const projects = board.listProjects(true).map((p) => (p.leadInstance && hiddenName(p.leadInstance) ? { ...p, leadInstance: null } : p));
|
|
5497
5587
|
// #2355 review: the names a project's lead may be — the fleet's instances (a Classic-only room is not one); over the
|
|
5498
5588
|
// public link, not a hidden one.
|
|
5499
5589
|
const leads = Object.keys(ctx.fleetConfig?.instances ?? {}).filter((n) => !hiddenName(n)).sort();
|
|
5500
|
-
const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone).map(unnumbered), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone) });
|
|
5590
|
+
const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone).map(unnumbered), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone, archiveDays, leaveOut), archiveAfterDays: archiveDays, epoch });
|
|
5501
5591
|
if (key)
|
|
5502
5592
|
boardBodies.set(board, { key, body });
|
|
5503
5593
|
jsonText(res, 200, body);
|
|
@@ -5546,6 +5636,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5546
5636
|
const results = hits.map(({ card: c, match }, i) => ({
|
|
5547
5637
|
card: views[i],
|
|
5548
5638
|
match,
|
|
5639
|
+
// M-3668: a card the board has archived says so (its number and this search still open it).
|
|
5640
|
+
...(board.isArchived(c, archiveDays) ? { archived: true } : {}),
|
|
5549
5641
|
project: c.projectId === null ? null : names.get(c.projectId) ?? null,
|
|
5550
5642
|
parentTitle: c.parent && !hiddenRef(c.parent) ? board.findCard(c.parent)?.title ?? null : null,
|
|
5551
5643
|
}));
|
|
@@ -5566,13 +5658,39 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5566
5658
|
json(res, 200, { refs: board.suggest((url.searchParams.get("q") ?? "").slice(0, 100), limit, (c) => !hidden(c)).map(taskRefView) });
|
|
5567
5659
|
return true;
|
|
5568
5660
|
}
|
|
5661
|
+
// a file on a card, as a download — the gate of reading the card (below), plus the file's own author.
|
|
5662
|
+
const cardFile = method === "GET" ? /^\/ui\/tasks\/files\/([0-9a-f]{32})$/.exec(path) : null;
|
|
5663
|
+
if (cardFile) {
|
|
5664
|
+
void serveCardFile(res, board, cardFile[1], {
|
|
5665
|
+
hidden: (c) => !!gateway && (hidden(c) || (!!c.parent && hiddenRef(c.parent))),
|
|
5666
|
+
hiddenName: (n) => !!gateway && hiddenName(n),
|
|
5667
|
+
});
|
|
5668
|
+
return true;
|
|
5669
|
+
}
|
|
5569
5670
|
if (method === "GET" && card && !card[2]) {
|
|
5570
5671
|
const found = board.getCard(ref);
|
|
5571
5672
|
if (hidden(found)) {
|
|
5572
5673
|
json(res, 404, { error: "no such card", code: "not_found" });
|
|
5573
5674
|
return true;
|
|
5574
5675
|
}
|
|
5575
|
-
json(res, 200, shown(board.detail(ref, scope, ctx.dispatcherGone)));
|
|
5676
|
+
json(res, 200, { ...shown(board.detail(ref, scope, ctx.dispatcherGone)), ...(board.isArchived(found, archiveDays) ? { archived: true, archiveAfterDays: archiveDays } : {}) });
|
|
5677
|
+
return true;
|
|
5678
|
+
}
|
|
5679
|
+
if (method === "GET" && path === "/ui/tasks/archive") {
|
|
5680
|
+
// M-3668: a project's archived main tasks (`project`: an id, or "none"), newest first, a page at a time (`before`),
|
|
5681
|
+
// filtered by who had them (`assignee`). Over the public link, not a card that names an instance kept out of sight.
|
|
5682
|
+
const p = url.searchParams.get("project") ?? "none";
|
|
5683
|
+
const project = p === "none" ? null : /^\d{1,9}$/.test(p) ? Number(p) : NaN;
|
|
5684
|
+
if (Number.isNaN(project)) {
|
|
5685
|
+
json(res, 400, { error: "invalid project", code: "invalid" });
|
|
5686
|
+
return true;
|
|
5687
|
+
}
|
|
5688
|
+
const who = url.searchParams.get("assignee");
|
|
5689
|
+
// #4428 review: the hidden ones are left out inside the read, before its page, cursor, total and assignees.
|
|
5690
|
+
const list = board.archiveList(project, archiveDays, { before: url.searchParams.get("before"), limit: Number(url.searchParams.get("limit")) || 50,
|
|
5691
|
+
assignee: who && !hiddenName(who) ? who : null, leaveOut: hiddenNames() });
|
|
5692
|
+
json(res, 200, { cards: board.views(list.cards, scope, ctx.dispatcherGone).map(unnumbered), next: list.next, total: list.total,
|
|
5693
|
+
assignees: list.assignees, archiveAfterDays: archiveDays });
|
|
5576
5694
|
return true;
|
|
5577
5695
|
}
|
|
5578
5696
|
if (method === "POST" && path === "/ui/tasks/cards") {
|