@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { parseMentions } from "./task-board-mentions.js";
|
|
3
|
+
import { TASK_FILE_LIMITS, TaskFileError } from "./task-files.js";
|
|
3
4
|
export const CARD_STATUSES = ["open", "claimed", "blocked", "review", "done", "cancelled"];
|
|
4
5
|
/** Statuses still on the board (not finished). */
|
|
5
6
|
export const LIVE_CARD_STATUSES = ["open", "claimed", "blocked", "review"];
|
|
@@ -27,6 +28,18 @@ export const CARD_LIMITS = {
|
|
|
27
28
|
};
|
|
28
29
|
/** How far back finished sub tasks and cancelled main tasks stay on the board. */
|
|
29
30
|
const BOARD_DAYS = 14;
|
|
31
|
+
/**
|
|
32
|
+
* M-3668 (the user, 11-24): a finished main task — done or cancelled — leaves the dashboard's board this many days after it
|
|
33
|
+
* finished (defaults.task_board.archive_after_days; 0 = never). A view rule only: nothing in the database changes, search
|
|
34
|
+
* and its number still find it, and moving it to To do reopens it (its status, not its age, makes it archived).
|
|
35
|
+
*/
|
|
36
|
+
export const ARCHIVE_AFTER_DAYS = 3;
|
|
37
|
+
/** The archive age as fleet.yaml gives it: a whole number of days, 0–3650; anything else is the default. */
|
|
38
|
+
export function archiveAfterDays(v) {
|
|
39
|
+
return typeof v === "number" && Number.isInteger(v) && v >= 0 && v <= 3650 ? v : ARCHIVE_AFTER_DAYS;
|
|
40
|
+
}
|
|
41
|
+
/** M-3668: how many finished main tasks a project's Done column counts as "this week". */
|
|
42
|
+
const WEEK_MS = 7 * 86_400_000;
|
|
30
43
|
const BATCH_MAX = 30;
|
|
31
44
|
/**
|
|
32
45
|
* The loop guard for comments that wake (docs/design/task-board.md, "Comments and mentions"): instances (and scripts,
|
|
@@ -286,10 +299,20 @@ export class TaskBoard {
|
|
|
286
299
|
/** The notes of the last write, until a caller of the `task` tool's old actions takes them (takeNotes). */
|
|
287
300
|
lastNotes = [];
|
|
288
301
|
codes = new Map();
|
|
302
|
+
/** Where files on cards live (task-files.ts); none: this process cannot take attachments (a bare board in a test, the CLI). */
|
|
303
|
+
fileStore = null;
|
|
304
|
+
/** What undoes this write's file moves, when the write fails after them. */
|
|
305
|
+
undo = [];
|
|
306
|
+
/** S-244: while the barrier flag is up, an open card is not claimed. Unset: today's claim. */
|
|
307
|
+
quiescence = null;
|
|
308
|
+
setQuiescence(gate) { this.quiescence = gate; }
|
|
289
309
|
constructor(db, now = () => new Date()) {
|
|
290
310
|
this.db = db;
|
|
291
311
|
this.now = now;
|
|
292
312
|
}
|
|
313
|
+
/** The store for files on cards (the fleet's scheduler sets it); null takes attachments away. */
|
|
314
|
+
setFiles(store) { this.fileStore = store; }
|
|
315
|
+
files() { return this.fileStore; }
|
|
293
316
|
/** Called with what each committed write changed. Returns an unsubscribe function. */
|
|
294
317
|
onChange(listener) {
|
|
295
318
|
this.listeners.push(listener);
|
|
@@ -375,6 +398,20 @@ export class TaskBoard {
|
|
|
375
398
|
at TEXT NOT NULL,
|
|
376
399
|
PRIMARY KEY (task_id, instance)
|
|
377
400
|
);
|
|
401
|
+
CREATE TABLE IF NOT EXISTS task_attachments (
|
|
402
|
+
id TEXT PRIMARY KEY,
|
|
403
|
+
task_id TEXT NOT NULL,
|
|
404
|
+
entry_id INTEGER,
|
|
405
|
+
name TEXT NOT NULL,
|
|
406
|
+
mime TEXT NOT NULL,
|
|
407
|
+
kind TEXT NOT NULL,
|
|
408
|
+
size INTEGER NOT NULL,
|
|
409
|
+
sha256 TEXT NOT NULL,
|
|
410
|
+
author TEXT NOT NULL,
|
|
411
|
+
author_kind TEXT NOT NULL,
|
|
412
|
+
at TEXT NOT NULL
|
|
413
|
+
);
|
|
414
|
+
CREATE INDEX IF NOT EXISTS idx_task_attachments_task ON task_attachments(task_id, at);
|
|
378
415
|
`);
|
|
379
416
|
// #2352: a project's lead instance, added in place (null: its waiting cards' buttons stay in General).
|
|
380
417
|
const projectCols = new Set(this.db.prepare("PRAGMA table_info(task_projects)").all().map((c) => c.name));
|
|
@@ -575,25 +612,76 @@ export class TaskBoard {
|
|
|
575
612
|
* tasks — or every done main task with `allDone` (the Done column's "All"). Older finished work stays in the
|
|
576
613
|
* database and in the projects' numbers (projectStats), not in every board read.
|
|
577
614
|
*/
|
|
578
|
-
boardCards(days = BOARD_DAYS, allDone = false) {
|
|
615
|
+
boardCards(days = BOARD_DAYS, allDone = false, archiveDays = 0) {
|
|
579
616
|
const since = new Date(this.now().getTime() - days * 86_400_000).toISOString();
|
|
617
|
+
if (archiveDays > 0) {
|
|
618
|
+
// M-3668: finished main tasks until they are archived (`allDone` no longer reads past it: the Archive list does).
|
|
619
|
+
// #4428 review: an archived main task's sub tasks go with it (isArchived), even one done more recently.
|
|
620
|
+
const kept = new Date(this.now().getTime() - archiveDays * 86_400_000).toISOString();
|
|
621
|
+
return this.db.prepare(`SELECT * FROM tasks WHERE
|
|
622
|
+
(kind = 'main' AND (status NOT IN ('done', 'cancelled') OR COALESCE(done_at, updated_at) >= ?))
|
|
623
|
+
OR (kind = 'sub' AND status != 'cancelled' AND (status != 'done' OR COALESCE(done_at, updated_at) >= ?)
|
|
624
|
+
AND NOT EXISTS (SELECT 1 FROM tasks m WHERE m.id = tasks.parent_id AND m.status IN ('done', 'cancelled') AND COALESCE(m.done_at, m.updated_at) < ?))
|
|
625
|
+
ORDER BY sort`).all(kept, since, kept).map(toCard);
|
|
626
|
+
}
|
|
580
627
|
const rows = this.db.prepare(`SELECT * FROM tasks WHERE
|
|
581
628
|
(kind = 'main' AND (status NOT IN ('done', 'cancelled') OR (status = 'done' AND (? OR COALESCE(done_at, updated_at) >= ?)) OR (status = 'cancelled' AND updated_at >= ?)))
|
|
582
629
|
OR (kind = 'sub' AND status != 'cancelled' AND (status != 'done' OR COALESCE(done_at, updated_at) >= ?))
|
|
583
630
|
ORDER BY sort`).all(allDone ? 1 : 0, since, since, since);
|
|
584
631
|
return rows.map(toCard);
|
|
585
632
|
}
|
|
633
|
+
/**
|
|
634
|
+
* #4428 review: ` AND …` leaving out the cards that name one of `names` (assigned to, created by or handed out by one:
|
|
635
|
+
* the public link's hiding, web-api boardHiding), with its values; empty when none.
|
|
636
|
+
*/
|
|
637
|
+
unseen(names = []) {
|
|
638
|
+
const out = [...new Set(names)];
|
|
639
|
+
if (!out.length)
|
|
640
|
+
return { sql: "", args: [] };
|
|
641
|
+
const marks = out.map(() => "?").join(", ");
|
|
642
|
+
return { sql: ` AND (assignee IS NULL OR assignee NOT IN (${marks})) AND created_by NOT IN (${marks}) AND (dispatcher IS NULL OR dispatcher NOT IN (${marks}))`,
|
|
643
|
+
args: [...out, ...out, ...out] };
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* #4428 review: what time alone changes in a board read and its numbers — how many finished cards have passed each
|
|
647
|
+
* of its lines (archived, out of this week's count, out of the recent window) — with the archive age. A card passes a
|
|
648
|
+
* line without a write (the revision stays), so a page's "same revision" read is answered `unchanged` only when this
|
|
649
|
+
* matches too. One counting pass, no rows. `leaveOut`: as projectStats (the public link's hidden instances' cards never
|
|
650
|
+
* move it).
|
|
651
|
+
*/
|
|
652
|
+
boardEpoch(archiveDays = 0, days = BOARD_DAYS, leaveOut = []) {
|
|
653
|
+
const nowMs = this.now().getTime();
|
|
654
|
+
const at = (ms) => new Date(nowMs - ms).toISOString();
|
|
655
|
+
const kept = archiveDays > 0 ? at(archiveDays * 86_400_000) : "", week = at(WEEK_MS), since = at(days * 86_400_000), hide = this.unseen(leaveOut);
|
|
656
|
+
const r = this.db.prepare(`SELECT
|
|
657
|
+
COALESCE(SUM(kind = 'main' AND status IN ('done', 'cancelled') AND COALESCE(done_at, updated_at) < ?), 0) AS archived,
|
|
658
|
+
COALESCE(SUM(kind = 'main' AND status = 'done' AND COALESCE(done_at, updated_at) < ?), 0) AS week,
|
|
659
|
+
COALESCE(SUM(status IN ('done', 'cancelled') AND (CASE WHEN kind = 'main' AND status = 'cancelled' THEN updated_at ELSE COALESCE(done_at, updated_at) END) < ?), 0) AS old
|
|
660
|
+
FROM tasks WHERE 1${hide.sql}`).get(kept, week, since, ...hide.args);
|
|
661
|
+
return `${archiveDays}:${r.archived}:${r.week}:${r.old}`;
|
|
662
|
+
}
|
|
586
663
|
/**
|
|
587
664
|
* Each project's numbers (by id; "none" for No project) over all its cards, finished ones included: main tasks,
|
|
588
665
|
* work units (a main task's sub tasks, or one unit for a main task without them; a done main task counts all its
|
|
589
666
|
* units done), cards waiting for the person and blocked, and the last change. One pass over the table. #2080: waiting
|
|
590
667
|
* counts only the cards in review the person confirms (waitsForPerson, `gone` as for Needs you), never an agent's.
|
|
668
|
+
* #4428 review: `leaveOut` names (the public link's hidden instances) — their cards, and a hidden main task's sub tasks,
|
|
669
|
+
* count nowhere, as the board read leaves them out.
|
|
591
670
|
*/
|
|
592
|
-
projectStats(gone) {
|
|
593
|
-
const
|
|
671
|
+
projectStats(gone, archiveDays = 0, leaveOut = []) {
|
|
672
|
+
const all = this.db.prepare("SELECT id, kind, status, project_id, parent_id, updated_at, done_at, needs_review, dispatcher, dispatcher_kind, assignee, created_by FROM tasks").all();
|
|
673
|
+
const unseenNames = new Set(leaveOut);
|
|
674
|
+
const names = (r) => [r.assignee, r.created_by, r.dispatcher].some((n) => typeof n === "string" && unseenNames.has(n));
|
|
675
|
+
const hiddenMains = unseenNames.size ? new Set(all.filter((r) => r.kind === "main" && names(r)).map((r) => r.id)) : new Set();
|
|
676
|
+
const rows = unseenNames.size ? all.filter((r) => !names(r) && !(r.kind === "sub" && hiddenMains.has(r.parent_id))) : all;
|
|
677
|
+
const nowMs = this.now().getTime(), kept = archiveDays > 0 ? new Date(nowMs - archiveDays * 86_400_000).toISOString() : null;
|
|
678
|
+
const week = new Date(nowMs - WEEK_MS).toISOString();
|
|
679
|
+
const finished = (r) => (r.done_at ?? r.updated_at);
|
|
680
|
+
// M-3668: an archived main task (and its sub tasks) is left out of every number but `archived`.
|
|
681
|
+
const archivedMains = new Set(kept ? rows.filter((r) => r.kind === "main" && (r.status === "done" || r.status === "cancelled") && finished(r) < kept).map((r) => r.id) : []);
|
|
594
682
|
const subs = new Map();
|
|
595
683
|
for (const r of rows) {
|
|
596
|
-
if (r.kind !== "sub" || !r.parent_id || r.status === "cancelled")
|
|
684
|
+
if (r.kind !== "sub" || !r.parent_id || r.status === "cancelled" || archivedMains.has(r.parent_id))
|
|
597
685
|
continue;
|
|
598
686
|
const p = subs.get(r.parent_id) ?? { total: 0, open: 0, claimed: 0, blocked: 0, review: 0, done: 0 };
|
|
599
687
|
p.total++;
|
|
@@ -603,10 +691,21 @@ export class TaskBoard {
|
|
|
603
691
|
const out = {};
|
|
604
692
|
for (const r of rows) {
|
|
605
693
|
const key = r.project_id === null || r.project_id === undefined ? "none" : String(r.project_id);
|
|
606
|
-
const st = out[key] ??= { mains: 0, units: { total: 0, open: 0, claimed: 0, blocked: 0, review: 0, done: 0 }, percent: 0, waiting: 0, blocked: 0, lastActivity: null };
|
|
694
|
+
const st = out[key] ??= { mains: 0, units: { total: 0, open: 0, claimed: 0, blocked: 0, review: 0, done: 0 }, percent: 0, waiting: 0, blocked: 0, lastActivity: null, archived: 0, doneWeek: 0, archivedWeek: 0 };
|
|
607
695
|
if (!st.lastActivity || r.updated_at > st.lastActivity)
|
|
608
696
|
st.lastActivity = r.updated_at;
|
|
609
697
|
const status = r.status;
|
|
698
|
+
if (r.kind === "main" && status === "done" && finished(r) >= week) {
|
|
699
|
+
st.doneWeek++;
|
|
700
|
+
if (archivedMains.has(r.id))
|
|
701
|
+
st.archivedWeek++;
|
|
702
|
+
}
|
|
703
|
+
if (archivedMains.has(r.id)) {
|
|
704
|
+
st.archived++;
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
if (r.kind === "sub" && archivedMains.has(r.parent_id))
|
|
708
|
+
continue;
|
|
610
709
|
if (status === "cancelled")
|
|
611
710
|
continue;
|
|
612
711
|
if (status === "review" && waitsForPerson({ status, needsReview: Number(r.needs_review) === 1,
|
|
@@ -635,6 +734,40 @@ export class TaskBoard {
|
|
|
635
734
|
st.percent = st.units.total ? Math.round((st.units.done / st.units.total) * 100) : 0;
|
|
636
735
|
return out;
|
|
637
736
|
}
|
|
737
|
+
/** M-3668: whether the dashboard has archived this card (a sub task goes with its main task). */
|
|
738
|
+
isArchived(card, archiveDays) {
|
|
739
|
+
if (archiveDays <= 0)
|
|
740
|
+
return false;
|
|
741
|
+
const main = card.kind === "sub" && card.parent ? this.byUuid(card.parent) : card;
|
|
742
|
+
if (!main || main.kind !== "main" || (main.status !== "done" && main.status !== "cancelled"))
|
|
743
|
+
return false;
|
|
744
|
+
return (main.doneAt ?? main.updatedAt) < new Date(this.now().getTime() - archiveDays * 86_400_000).toISOString();
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* M-3668: a project's archived main tasks (`project` null: No project), the most recently finished first, a page at a
|
|
748
|
+
* time (`before`: the last one's cursor), and who they were assigned to (the list's filter, `assignee`).
|
|
749
|
+
* `leaveOut`: names whose cards the reader may not see (assigned to, created by or handed out by one) — left out
|
|
750
|
+
* before the page, its cursor, the total and the assignees are worked out, so none of them tells of such a card.
|
|
751
|
+
*/
|
|
752
|
+
archiveList(project, archiveDays, opts = {}) {
|
|
753
|
+
if (archiveDays <= 0)
|
|
754
|
+
return { cards: [], next: null, total: 0, assignees: [] };
|
|
755
|
+
const kept = new Date(this.now().getTime() - archiveDays * 86_400_000).toISOString();
|
|
756
|
+
const hide = this.unseen(opts.leaveOut);
|
|
757
|
+
const where = `kind = 'main' AND status IN ('done', 'cancelled') AND COALESCE(done_at, updated_at) < ? AND ${project === null ? "project_id IS NULL" : "project_id = ?"}${hide.sql}`;
|
|
758
|
+
const base = [kept, ...(project === null ? [] : [project]), ...hide.args];
|
|
759
|
+
const assignees = this.db.prepare(`SELECT DISTINCT assignee FROM tasks WHERE ${where} AND assignee IS NOT NULL ORDER BY assignee`).all(...base).map((r) => r.assignee);
|
|
760
|
+
const who = opts.assignee ? " AND assignee = ?" : "", whoArgs = opts.assignee ? [opts.assignee] : [];
|
|
761
|
+
const total = this.db.prepare(`SELECT COUNT(*) AS n FROM tasks WHERE ${where}${who}`).get(...base, ...whoArgs).n;
|
|
762
|
+
const cursor = typeof opts.before === "string" ? /^(.+)\|([^|]+)$/.exec(opts.before) : null;
|
|
763
|
+
const after = cursor ? " AND (COALESCE(done_at, updated_at) < ? OR (COALESCE(done_at, updated_at) = ? AND id < ?))" : "";
|
|
764
|
+
const limit = Math.min(Math.max(opts.limit ?? 50, 1), 100);
|
|
765
|
+
const rows = this.db.prepare(`SELECT * FROM tasks WHERE ${where}${who}${after} ORDER BY COALESCE(done_at, updated_at) DESC, id DESC LIMIT ?`)
|
|
766
|
+
.all(...base, ...whoArgs, ...(cursor ? [cursor[1], cursor[1], cursor[2]] : []), limit + 1);
|
|
767
|
+
const cards = rows.slice(0, limit).map(toCard);
|
|
768
|
+
const last = cards[cards.length - 1];
|
|
769
|
+
return { cards, next: rows.length > limit && last ? `${last.doneAt ?? last.updatedAt}|${last.uuid}` : null, total, assignees };
|
|
770
|
+
}
|
|
638
771
|
view(card, scope = {}, gone) {
|
|
639
772
|
return this.views([card], scope, gone)[0];
|
|
640
773
|
}
|
|
@@ -667,6 +800,8 @@ export class TaskBoard {
|
|
|
667
800
|
const by = this.notBy(scope, "author"), eBy = this.notBy(scope, "e.author");
|
|
668
801
|
const comments = new Map(this.db.prepare(`SELECT e.task_id AS task_id, n.n AS n, e.author AS author, e.author_kind AS author_kind, e.at AS at FROM task_entries e
|
|
669
802
|
JOIN (SELECT task_id, COUNT(*) AS n, MAX(id) AS last FROM task_entries WHERE kind IN ('comment', 'reject', 'approve')${by.sql} GROUP BY task_id) n ON e.id = n.last`).all(...by.args).map((r) => [r.task_id, r]));
|
|
803
|
+
const files = new Map(this.db.prepare(`SELECT task_id, COUNT(*) AS n FROM task_attachments WHERE 1 = 1${by.sql} GROUP BY task_id`)
|
|
804
|
+
.all(...by.args).map((r) => [r.task_id, r.n]));
|
|
670
805
|
const unseen = new Map(this.db.prepare(`SELECT t.id AS id, COUNT(e.id) AS n FROM tasks t JOIN task_entries e
|
|
671
806
|
ON e.task_id = t.id AND e.id > t.seen_entry_id AND e.kind IN ('comment', 'reject') AND e.author IS NOT t.assignee${eBy.sql}
|
|
672
807
|
GROUP BY t.id`).all(...eBy.args).map((r) => [r.id, r.n]));
|
|
@@ -720,6 +855,7 @@ export class TaskBoard {
|
|
|
720
855
|
progress: card.kind === "main" ? progress.get(card.uuid) ?? { total: 0, open: 0, claimed: 0, blocked: 0, review: 0, done: 0 } : null,
|
|
721
856
|
unmetDeps: unmet(card.deps, card.parent),
|
|
722
857
|
commentCount: c?.n ?? 0,
|
|
858
|
+
attachmentCount: files.get(card.uuid) ?? 0,
|
|
723
859
|
newCommentCount: unseen.get(card.uuid) ?? 0,
|
|
724
860
|
lastComment: c ? { author: c.author, authorKind: c.author_kind, at: c.at } : null,
|
|
725
861
|
};
|
|
@@ -735,6 +871,7 @@ export class TaskBoard {
|
|
|
735
871
|
comments: this.entries(card.uuid, ["comment", "reject", "approve"], 200),
|
|
736
872
|
logs: this.entries(card.uuid, ["log"], 200),
|
|
737
873
|
history: this.events(card.uuid, 200).filter((e) => e.type !== "reordered"),
|
|
874
|
+
attachments: this.attachments(card.uuid, scope),
|
|
738
875
|
watchers: this.watchersOf(card.uuid),
|
|
739
876
|
inheritedWatchers: card.parent ? this.watchersOf(card.parent) : [],
|
|
740
877
|
leader: this.leaderOf(card),
|
|
@@ -1299,13 +1436,9 @@ export class TaskBoard {
|
|
|
1299
1436
|
touched = true;
|
|
1300
1437
|
}
|
|
1301
1438
|
}
|
|
1302
|
-
if (patch.comment !== undefined) {
|
|
1303
|
-
|
|
1304
|
-
if (text) {
|
|
1305
|
-
this.entry(card, "comment", actor, text);
|
|
1306
|
-
this.commented(actor, card, text);
|
|
1439
|
+
if (patch.comment !== undefined || patch.attach?.length) {
|
|
1440
|
+
if (this.writeComment(card, actor, patch.comment ?? "", patch.attach))
|
|
1307
1441
|
touched = true;
|
|
1308
|
-
}
|
|
1309
1442
|
}
|
|
1310
1443
|
if (!touched)
|
|
1311
1444
|
return { card, notes: ["no change"], said: [] };
|
|
@@ -1348,10 +1481,8 @@ export class TaskBoard {
|
|
|
1348
1481
|
this.checkAnswer(card, comment);
|
|
1349
1482
|
const busy = this.busyWith(card, card.assignee);
|
|
1350
1483
|
if (busy.length) {
|
|
1351
|
-
const text = checkText("the comment", comment, CARD_LIMITS.comment);
|
|
1352
|
-
this.entry(card, "comment", actor, text);
|
|
1353
1484
|
// #2801 review: the one comment that is news — the answer its assignee waits for (`kept`).
|
|
1354
|
-
this.
|
|
1485
|
+
this.writeComment(card, actor, comment, options.attach, true);
|
|
1355
1486
|
card.version++;
|
|
1356
1487
|
card.updatedAt = this.nowIso();
|
|
1357
1488
|
this.save(card);
|
|
@@ -1364,7 +1495,7 @@ export class TaskBoard {
|
|
|
1364
1495
|
this.checkDerivedMove(card, actor, to, reason, { comment });
|
|
1365
1496
|
else
|
|
1366
1497
|
this.checkManualMove(card, actor, to, reason, { comment });
|
|
1367
|
-
this.applyMove(card, actor, this.ownReview(card, actor, to, reason), reason, comment);
|
|
1498
|
+
this.applyMove(card, actor, this.ownReview(card, actor, to, reason), reason, comment, options.attach);
|
|
1368
1499
|
return { card, from, ...this.spoken() };
|
|
1369
1500
|
});
|
|
1370
1501
|
}
|
|
@@ -1913,8 +2044,11 @@ export class TaskBoard {
|
|
|
1913
2044
|
}
|
|
1914
2045
|
// ── Derived state ───────────────────────────────────────
|
|
1915
2046
|
/** Status bookkeeping shared by every move, then what the move sets off. */
|
|
1916
|
-
applyMove(card, actor, to, reason, comment) {
|
|
2047
|
+
applyMove(card, actor, to, reason, comment, attach) {
|
|
1917
2048
|
const from = card.status;
|
|
2049
|
+
if (from === "open" && to === "claimed" && this.quiescence?.holdTaskClaim()) {
|
|
2050
|
+
throw new TaskBoardError("conflict", "an update is in progress; this claim waits until it finishes");
|
|
2051
|
+
}
|
|
1918
2052
|
const now = this.nowIso();
|
|
1919
2053
|
card.status = to;
|
|
1920
2054
|
if (to === "claimed" && !card.startedAt)
|
|
@@ -1923,11 +2057,8 @@ export class TaskBoard {
|
|
|
1923
2057
|
card.submittedAt = now;
|
|
1924
2058
|
card.doneAt = to === "done" ? now : null;
|
|
1925
2059
|
card.blockedReason = to === "blocked" ? reason : "";
|
|
1926
|
-
if (comment?.trim())
|
|
1927
|
-
|
|
1928
|
-
this.entry(card, "comment", actor, text);
|
|
1929
|
-
this.commented(actor, card, text);
|
|
1930
|
-
}
|
|
2060
|
+
if (comment?.trim() || attach?.length)
|
|
2061
|
+
this.writeComment(card, actor, comment ?? "", attach);
|
|
1931
2062
|
card.version++;
|
|
1932
2063
|
card.updatedAt = now;
|
|
1933
2064
|
this.surfaceComments(card, actor);
|
|
@@ -2452,6 +2583,7 @@ export class TaskBoard {
|
|
|
2452
2583
|
this.pending = [];
|
|
2453
2584
|
this.projectsChanged = false;
|
|
2454
2585
|
this.notes = [];
|
|
2586
|
+
this.undo = [];
|
|
2455
2587
|
try {
|
|
2456
2588
|
let wakes = [];
|
|
2457
2589
|
const result = this.db.transaction(() => {
|
|
@@ -2471,6 +2603,9 @@ export class TaskBoard {
|
|
|
2471
2603
|
}
|
|
2472
2604
|
return r;
|
|
2473
2605
|
}).immediate();
|
|
2606
|
+
// Committed: the rows are there for good, so what undoes the file moves is forgotten — a failure from here on (a listener's
|
|
2607
|
+
// work, reading the revision) must not move files back from under rows that stay.
|
|
2608
|
+
this.undo = [];
|
|
2474
2609
|
this.lastNotes = this.notes.map((n) => n.text);
|
|
2475
2610
|
const touched = this.pending;
|
|
2476
2611
|
const projects = this.projectsChanged;
|
|
@@ -2486,9 +2621,20 @@ export class TaskBoard {
|
|
|
2486
2621
|
}
|
|
2487
2622
|
return result;
|
|
2488
2623
|
}
|
|
2624
|
+
catch (err) {
|
|
2625
|
+
// The write failed BEFORE it committed, after it moved files under a card: the rows are rolled back, so the files go back to staging.
|
|
2626
|
+
for (const back of this.undo.reverse()) {
|
|
2627
|
+
try {
|
|
2628
|
+
back();
|
|
2629
|
+
}
|
|
2630
|
+
catch { /* the sweep removes it */ }
|
|
2631
|
+
}
|
|
2632
|
+
throw err;
|
|
2633
|
+
}
|
|
2489
2634
|
finally {
|
|
2490
2635
|
this.pending = [];
|
|
2491
2636
|
this.projectsChanged = false;
|
|
2637
|
+
this.undo = [];
|
|
2492
2638
|
}
|
|
2493
2639
|
}
|
|
2494
2640
|
nowIso() {
|
|
@@ -2581,6 +2727,83 @@ export class TaskBoard {
|
|
|
2581
2727
|
card.seenEntryId = 0;
|
|
2582
2728
|
this.event(actor, card, "assigned", { from, to: assignee });
|
|
2583
2729
|
}
|
|
2730
|
+
/**
|
|
2731
|
+
* A comment written, with the files that came with it: its entry, the files linked to it, and the
|
|
2732
|
+
* "commented" event. A write that brings files and no words leaves a line naming them (`📎 name, name`), which an
|
|
2733
|
+
* older release shows as the comment it is. False when there is nothing to write (no words, no files).
|
|
2734
|
+
*/
|
|
2735
|
+
writeComment(card, actor, raw, attach, kept = false) {
|
|
2736
|
+
const files = attach?.length ? this.stagedFiles(card, actor, attach) : [];
|
|
2737
|
+
const words = checkText("the comment", raw, CARD_LIMITS.comment);
|
|
2738
|
+
const text = words || (files.length ? checkText("the comment", `📎 ${files.map((f) => f.name).join(", ")}`, CARD_LIMITS.comment) : "");
|
|
2739
|
+
if (!text)
|
|
2740
|
+
return false;
|
|
2741
|
+
const entryId = this.entry(card, "comment", actor, text);
|
|
2742
|
+
this.linkFiles(card, actor, entryId, files);
|
|
2743
|
+
this.commented(actor, card, text, kept, files.length);
|
|
2744
|
+
return true;
|
|
2745
|
+
}
|
|
2746
|
+
/** The files `actor` staged, checked against this card's limits (nothing is moved yet). */
|
|
2747
|
+
stagedFiles(card, actor, ids) {
|
|
2748
|
+
const store = this.fileStore;
|
|
2749
|
+
if (!store)
|
|
2750
|
+
throw new TaskBoardError("invalid", "attachments are not available here (the fleet's scheduler holds the card files)");
|
|
2751
|
+
let files;
|
|
2752
|
+
try {
|
|
2753
|
+
files = store.adopt(actor.name, ids);
|
|
2754
|
+
}
|
|
2755
|
+
catch (err) {
|
|
2756
|
+
if (err instanceof TaskFileError)
|
|
2757
|
+
throw new TaskBoardError("invalid", err.message);
|
|
2758
|
+
throw err;
|
|
2759
|
+
}
|
|
2760
|
+
const held = this.db.prepare("SELECT COUNT(*) AS n, COALESCE(SUM(size), 0) AS bytes FROM task_attachments WHERE task_id = ?").get(card.uuid);
|
|
2761
|
+
const bytes = files.reduce((n, f) => n + f.size, 0);
|
|
2762
|
+
if (held.n + files.length > TASK_FILE_LIMITS.files) {
|
|
2763
|
+
throw new TaskBoardError("too_long", `${card.code} holds ${held.n} files; at most ${TASK_FILE_LIMITS.files} on a card`);
|
|
2764
|
+
}
|
|
2765
|
+
if (held.bytes + bytes > TASK_FILE_LIMITS.cardBytes) {
|
|
2766
|
+
throw new TaskBoardError("too_long", `the files on ${card.code} would be ${Math.ceil((held.bytes + bytes) / (1024 * 1024))} MiB; at most ${Math.floor(TASK_FILE_LIMITS.cardBytes / (1024 * 1024))} MiB on a card`);
|
|
2767
|
+
}
|
|
2768
|
+
return files;
|
|
2769
|
+
}
|
|
2770
|
+
/** The staged files, now the card's: a row each, hung under `entryId`, and the file moved under the card. */
|
|
2771
|
+
linkFiles(card, actor, entryId, files) {
|
|
2772
|
+
if (!files.length)
|
|
2773
|
+
return;
|
|
2774
|
+
const store = this.fileStore;
|
|
2775
|
+
const insert = this.db.prepare("INSERT INTO task_attachments (id, task_id, entry_id, name, mime, kind, size, sha256, author, author_kind, at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
2776
|
+
for (const f of files) {
|
|
2777
|
+
insert.run(f.id, card.uuid, entryId, f.name, f.mime, f.kind, f.size, f.sha256, actor.name, actor.kind, this.nowIso());
|
|
2778
|
+
try {
|
|
2779
|
+
this.undo.push(store.commit(card.uuid, f));
|
|
2780
|
+
}
|
|
2781
|
+
catch (err) {
|
|
2782
|
+
if (err instanceof TaskFileError)
|
|
2783
|
+
throw new TaskBoardError("invalid", err.message);
|
|
2784
|
+
throw new TaskBoardError("invalid", `the file ${f.name} could not be stored on ${card.code}`);
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
/** The files on a card, oldest first; a scope leaves out the ones its left-out authors wrote. */
|
|
2789
|
+
attachments(uuid, scope = {}) {
|
|
2790
|
+
const by = this.notBy(scope, "author");
|
|
2791
|
+
const rows = this.db.prepare(`SELECT * FROM task_attachments WHERE task_id = ?${by.sql} ORDER BY at, rowid`).all(uuid, ...by.args);
|
|
2792
|
+
return rows.map((r) => this.toAttachment(r));
|
|
2793
|
+
}
|
|
2794
|
+
/** One file by its id, with the card it is on; undefined when there is none. */
|
|
2795
|
+
attachment(id) {
|
|
2796
|
+
const r = this.db.prepare("SELECT * FROM task_attachments WHERE id = ?").get(id);
|
|
2797
|
+
const card = r ? this.byUuid(r.task_id) : undefined;
|
|
2798
|
+
return r && card ? { file: this.toAttachment(r), card } : undefined;
|
|
2799
|
+
}
|
|
2800
|
+
toAttachment(r) {
|
|
2801
|
+
return {
|
|
2802
|
+
id: r.id, cardId: this.codeOf(r.task_id), entryId: r.entry_id === null ? null : Number(r.entry_id), name: r.name,
|
|
2803
|
+
mime: r.mime, kind: r.kind === "photo" ? "photo" : "document", size: Number(r.size), author: r.author,
|
|
2804
|
+
authorKind: r.author_kind, at: r.at,
|
|
2805
|
+
};
|
|
2806
|
+
}
|
|
2584
2807
|
/**
|
|
2585
2808
|
* Any write by the assignee counts as having seen the comments so far, so the unseen ones go in its reply first;
|
|
2586
2809
|
* otherwise a comment posted mid-task would be acknowledged without being read.
|
|
@@ -2600,15 +2823,16 @@ export class TaskBoard {
|
|
|
2600
2823
|
card.seenEntryId = this.db.prepare("SELECT COALESCE(MAX(id), 0) AS m FROM task_entries WHERE task_id = ?").get(card.uuid).m;
|
|
2601
2824
|
}
|
|
2602
2825
|
entry(card, kind, actor, text) {
|
|
2603
|
-
this.db.prepare("INSERT INTO task_entries (task_id, kind, author, author_kind, text, at) VALUES (?, ?, ?, ?, ?, ?)")
|
|
2826
|
+
const r = this.db.prepare("INSERT INTO task_entries (task_id, kind, author, author_kind, text, at) VALUES (?, ?, ?, ?, ?, ?)")
|
|
2604
2827
|
.run(card.uuid, kind, actor.name, actor.kind, text, this.nowIso());
|
|
2828
|
+
return Number(r.lastInsertRowid);
|
|
2605
2829
|
}
|
|
2606
2830
|
/**
|
|
2607
2831
|
* A comment written (its entry is already on the card): the "commented" event, and whom the comment concerns, which
|
|
2608
2832
|
* settleWakes reads when the write ends. `kept` is a dispatcher's answer a busy assignee finds on the card (#2303).
|
|
2609
2833
|
*/
|
|
2610
|
-
commented(actor, card, text, kept = false) {
|
|
2611
|
-
this.event(actor, card, "commented", kept ? {
|
|
2834
|
+
commented(actor, card, text, kept = false, files = 0) {
|
|
2835
|
+
this.event(actor, card, "commented", { text, ...(kept ? { kept: true } : {}), ...(files ? { files } : {}) });
|
|
2612
2836
|
this.pending[this.pending.length - 1].audience = this.routeComment(actor, card, text, kept);
|
|
2613
2837
|
}
|
|
2614
2838
|
/**
|