@things-factory/ai-assistant 10.1.277 → 10.1.279
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/bootstrap.d.ts +4 -4
- package/dist-client/bootstrap.js +4 -8
- package/dist-client/components/ai-model-price-table.d.ts +32 -0
- package/dist-client/components/ai-model-price-table.js +311 -0
- package/dist-client/components/ai-usage-table.d.ts +17 -0
- package/dist-client/components/ai-usage-table.js +151 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/pages/ai-model-price-page.d.ts +37 -0
- package/dist-client/pages/ai-model-price-page.js +312 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +4 -0
- package/dist-client/settings/ai-agent-setting-let.js +11 -0
- package/dist-client/utils/model-price-model.d.ts +31 -0
- package/dist-client/utils/model-price-model.js +30 -0
- package/dist-client/utils/usage-charts.d.ts +21 -0
- package/dist-client/utils/usage-charts.js +45 -0
- package/dist-client/utils/usage-model.d.ts +44 -0
- package/dist-client/utils/usage-model.js +44 -0
- package/dist-server/service/ai-agent-resolver.d.ts +46 -0
- package/dist-server/service/ai-agent-resolver.js +252 -0
- package/dist-server/service/assistant-mode/mode-categories.js +2 -2
- package/dist-server/service/chat-message/message-doors.d.ts +6 -10
- package/dist-server/service/chat-message/message-doors.js +5 -12
- package/dist-server/service/data-read/read-target.d.ts +3 -4
- package/dist-server/service/people/person-subject.d.ts +9 -5
- package/dist-server/service/people/person-subject.js +14 -19
- package/package.json +25 -10
- package/things-factory.config.js +4 -1
- package/translations/en.json +46 -4
- package/translations/es.json +43 -1
- package/translations/ja.json +43 -1
- package/translations/ko.json +46 -4
- package/translations/ms.json +43 -1
- package/translations/zh.json +43 -1
- package/client/bootstrap.ts +0 -27
- package/client/components/assistant-chat.test.ts +0 -149
- package/client/components/assistant-chat.ts +0 -5599
- package/client/components/assistant-dock.ts +0 -1036
- package/client/components/assistant-invite.ts +0 -138
- package/client/components/assistant-mode.test.ts +0 -119
- package/client/components/assistant-mode.ts +0 -174
- package/client/components/assistant-selection-bar.test.ts +0 -167
- package/client/components/assistant-selection-bar.ts +0 -178
- package/client/components/assistant-session-manager.ts +0 -915
- package/client/components/assistant-session-toolbar.ts +0 -80
- package/client/components/chat-defaults.ts +0 -64
- package/client/components/chat-echo-dedup.test.ts +0 -253
- package/client/components/chat-echo-dedup.ts +0 -190
- package/client/components/chat-input-builder.test.ts +0 -86
- package/client/components/chat-input-builder.ts +0 -133
- package/client/components/chat-proposal-survival.test.ts +0 -73
- package/client/components/entry-review.ts +0 -346
- package/client/components/markdown.test.ts +0 -518
- package/client/components/markdown.ts +0 -508
- package/client/components/mention-popup-helpers.ts +0 -433
- package/client/components/mention-popup.test.ts +0 -588
- package/client/components/mention-popup.ts +0 -261
- package/client/components/panel-aria.test.ts +0 -59
- package/client/components/proposal-outcome-line.ts +0 -74
- package/client/components/proposal-request.test.ts +0 -73
- package/client/components/reply-message.test.ts +0 -15
- package/client/components/reply-message.ts +0 -11
- package/client/components/roster-identity.test.ts +0 -8
- package/client/components/roster-identity.ts +0 -4
- package/client/components/workspace-view.ts +0 -486
- package/client/index.ts +0 -36
- package/client/pages/assistant-workspace-page.ts +0 -317
- package/client/route.ts +0 -9
- package/client/settings/agent-settings-model.ts +0 -164
- package/client/settings/ai-agent-setting-let.ts +0 -667
- package/client/settings/ai-usage-setting-let.ts +0 -240
- package/client/settings/usage-model.ts +0 -46
- package/client/setup-assistant-dock.ts +0 -177
- package/client/tsconfig.json +0 -13
- package/client/utils/addressed-draft.test.ts +0 -31
- package/client/utils/agent-choice.ts +0 -56
- package/client/utils/applied-screens.ts +0 -36
- package/client/utils/assistant-activity.ts +0 -122
- package/client/utils/assistant-ask.test.ts +0 -38
- package/client/utils/assistant-ask.ts +0 -93
- package/client/utils/assistant-capability-read.ts +0 -24
- package/client/utils/assistant-capability.test.ts +0 -17
- package/client/utils/assistant-capability.ts +0 -19
- package/client/utils/assistant-navigation.test.ts +0 -66
- package/client/utils/assistant-navigation.ts +0 -11
- package/client/utils/assistant-proposals.ts +0 -85
- package/client/utils/assistant-request-context.ts +0 -63
- package/client/utils/assistant-selection.test.ts +0 -54
- package/client/utils/assistant-selection.ts +0 -75
- package/client/utils/assistant-session-actions.ts +0 -32
- package/client/utils/assistant-session-admin.ts +0 -239
- package/client/utils/assistant-session-controller.test.ts +0 -75
- package/client/utils/assistant-session-controller.ts +0 -208
- package/client/utils/assistant-session-transport.ts +0 -46
- package/client/utils/assistant-surface.ts +0 -178
- package/client/utils/assistant-typing.test.ts +0 -33
- package/client/utils/assistant-typing.ts +0 -53
- package/client/utils/attachment-policy.ts +0 -106
- package/client/utils/composer-frame.ts +0 -77
- package/client/utils/document-text.ts +0 -332
- package/client/utils/entry-hash.ts +0 -35
- package/client/utils/entry-proposal.ts +0 -215
- package/client/utils/entry-workspace.ts +0 -70
- package/client/utils/invite-proposal-register.ts +0 -31
- package/client/utils/invite-proposal.test.ts +0 -40
- package/client/utils/invite-proposal.ts +0 -54
- package/client/utils/menu-room.ts +0 -33
- package/client/utils/open-page.ts +0 -21
- package/client/utils/pasted-table.ts +0 -145
- package/client/utils/pdf-pages.ts +0 -25
- package/client/utils/spreadsheet-text.ts +0 -125
- package/client/utils/workspace.ts +0 -89
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/components/assistant-chat.js.map +0 -1
- package/dist-client/components/assistant-chat.test.d.ts +0 -1
- package/dist-client/components/assistant-chat.test.js +0 -138
- package/dist-client/components/assistant-chat.test.js.map +0 -1
- package/dist-client/components/assistant-dock.js.map +0 -1
- package/dist-client/components/assistant-invite.js.map +0 -1
- package/dist-client/components/assistant-mode.js.map +0 -1
- package/dist-client/components/assistant-mode.test.d.ts +0 -1
- package/dist-client/components/assistant-mode.test.js +0 -100
- package/dist-client/components/assistant-mode.test.js.map +0 -1
- package/dist-client/components/assistant-selection-bar.js.map +0 -1
- package/dist-client/components/assistant-selection-bar.test.d.ts +0 -1
- package/dist-client/components/assistant-selection-bar.test.js +0 -148
- package/dist-client/components/assistant-selection-bar.test.js.map +0 -1
- package/dist-client/components/assistant-session-manager.js.map +0 -1
- package/dist-client/components/assistant-session-toolbar.js.map +0 -1
- package/dist-client/components/chat-defaults.js.map +0 -1
- package/dist-client/components/chat-echo-dedup.js.map +0 -1
- package/dist-client/components/chat-echo-dedup.test.d.ts +0 -1
- package/dist-client/components/chat-echo-dedup.test.js +0 -223
- package/dist-client/components/chat-echo-dedup.test.js.map +0 -1
- package/dist-client/components/chat-input-builder.js.map +0 -1
- package/dist-client/components/chat-input-builder.test.d.ts +0 -1
- package/dist-client/components/chat-input-builder.test.js +0 -70
- package/dist-client/components/chat-input-builder.test.js.map +0 -1
- package/dist-client/components/chat-proposal-survival.test.d.ts +0 -1
- package/dist-client/components/chat-proposal-survival.test.js +0 -61
- package/dist-client/components/chat-proposal-survival.test.js.map +0 -1
- package/dist-client/components/entry-review.js.map +0 -1
- package/dist-client/components/markdown.js.map +0 -1
- package/dist-client/components/markdown.test.d.ts +0 -1
- package/dist-client/components/markdown.test.js +0 -418
- package/dist-client/components/markdown.test.js.map +0 -1
- package/dist-client/components/mention-popup-helpers.js.map +0 -1
- package/dist-client/components/mention-popup.js.map +0 -1
- package/dist-client/components/mention-popup.test.d.ts +0 -1
- package/dist-client/components/mention-popup.test.js +0 -474
- package/dist-client/components/mention-popup.test.js.map +0 -1
- package/dist-client/components/panel-aria.test.d.ts +0 -1
- package/dist-client/components/panel-aria.test.js +0 -53
- package/dist-client/components/panel-aria.test.js.map +0 -1
- package/dist-client/components/proposal-outcome-line.js.map +0 -1
- package/dist-client/components/proposal-request.test.d.ts +0 -1
- package/dist-client/components/proposal-request.test.js +0 -63
- package/dist-client/components/proposal-request.test.js.map +0 -1
- package/dist-client/components/reply-message.js.map +0 -1
- package/dist-client/components/reply-message.test.d.ts +0 -1
- package/dist-client/components/reply-message.test.js +0 -16
- package/dist-client/components/reply-message.test.js.map +0 -1
- package/dist-client/components/roster-identity.js.map +0 -1
- package/dist-client/components/roster-identity.test.d.ts +0 -1
- package/dist-client/components/roster-identity.test.js +0 -9
- package/dist-client/components/roster-identity.test.js.map +0 -1
- package/dist-client/components/workspace-view.js.map +0 -1
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/assistant-workspace-page.js.map +0 -1
- package/dist-client/route.js.map +0 -1
- package/dist-client/settings/agent-settings-model.js.map +0 -1
- package/dist-client/settings/ai-agent-setting-let.js.map +0 -1
- package/dist-client/settings/ai-usage-setting-let.d.ts +0 -25
- package/dist-client/settings/ai-usage-setting-let.js +0 -258
- package/dist-client/settings/ai-usage-setting-let.js.map +0 -1
- package/dist-client/settings/usage-model.d.ts +0 -32
- package/dist-client/settings/usage-model.js +0 -25
- package/dist-client/settings/usage-model.js.map +0 -1
- package/dist-client/setup-assistant-dock.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/utils/addressed-draft.test.d.ts +0 -1
- package/dist-client/utils/addressed-draft.test.js +0 -27
- package/dist-client/utils/addressed-draft.test.js.map +0 -1
- package/dist-client/utils/agent-choice.js.map +0 -1
- package/dist-client/utils/applied-screens.js.map +0 -1
- package/dist-client/utils/assistant-activity.js.map +0 -1
- package/dist-client/utils/assistant-ask.js.map +0 -1
- package/dist-client/utils/assistant-ask.test.d.ts +0 -1
- package/dist-client/utils/assistant-ask.test.js +0 -40
- package/dist-client/utils/assistant-ask.test.js.map +0 -1
- package/dist-client/utils/assistant-capability-read.js.map +0 -1
- package/dist-client/utils/assistant-capability.js.map +0 -1
- package/dist-client/utils/assistant-capability.test.d.ts +0 -1
- package/dist-client/utils/assistant-capability.test.js +0 -16
- package/dist-client/utils/assistant-capability.test.js.map +0 -1
- package/dist-client/utils/assistant-navigation.js.map +0 -1
- package/dist-client/utils/assistant-navigation.test.d.ts +0 -1
- package/dist-client/utils/assistant-navigation.test.js +0 -63
- package/dist-client/utils/assistant-navigation.test.js.map +0 -1
- package/dist-client/utils/assistant-proposals.js.map +0 -1
- package/dist-client/utils/assistant-request-context.js.map +0 -1
- package/dist-client/utils/assistant-selection.js.map +0 -1
- package/dist-client/utils/assistant-selection.test.d.ts +0 -1
- package/dist-client/utils/assistant-selection.test.js +0 -46
- package/dist-client/utils/assistant-selection.test.js.map +0 -1
- package/dist-client/utils/assistant-session-actions.js.map +0 -1
- package/dist-client/utils/assistant-session-admin.js.map +0 -1
- package/dist-client/utils/assistant-session-controller.js.map +0 -1
- package/dist-client/utils/assistant-session-controller.test.d.ts +0 -1
- package/dist-client/utils/assistant-session-controller.test.js +0 -56
- package/dist-client/utils/assistant-session-controller.test.js.map +0 -1
- package/dist-client/utils/assistant-session-transport.js.map +0 -1
- package/dist-client/utils/assistant-surface.js.map +0 -1
- package/dist-client/utils/assistant-typing.js.map +0 -1
- package/dist-client/utils/assistant-typing.test.d.ts +0 -1
- package/dist-client/utils/assistant-typing.test.js +0 -30
- package/dist-client/utils/assistant-typing.test.js.map +0 -1
- package/dist-client/utils/attachment-policy.js.map +0 -1
- package/dist-client/utils/composer-frame.js.map +0 -1
- package/dist-client/utils/document-text.js.map +0 -1
- package/dist-client/utils/entry-hash.js.map +0 -1
- package/dist-client/utils/entry-proposal.js.map +0 -1
- package/dist-client/utils/entry-workspace.js.map +0 -1
- package/dist-client/utils/invite-proposal-register.js.map +0 -1
- package/dist-client/utils/invite-proposal.js.map +0 -1
- package/dist-client/utils/invite-proposal.test.d.ts +0 -1
- package/dist-client/utils/invite-proposal.test.js +0 -35
- package/dist-client/utils/invite-proposal.test.js.map +0 -1
- package/dist-client/utils/menu-room.js.map +0 -1
- package/dist-client/utils/open-page.js.map +0 -1
- package/dist-client/utils/pasted-table.js.map +0 -1
- package/dist-client/utils/pdf-pages.js.map +0 -1
- package/dist-client/utils/spreadsheet-text.js.map +0 -1
- package/dist-client/utils/workspace.js.map +0 -1
- package/dist-server/door-declaration-report.js.map +0 -1
- package/dist-server/index.js.map +0 -1
- package/dist-server/role-tasks.js.map +0 -1
- package/dist-server/service/ai-agent-resolver.js.map +0 -1
- package/dist-server/service/assistant-capability-resolver.js.map +0 -1
- package/dist-server/service/assistant-chat-resolver.js.map +0 -1
- package/dist-server/service/assistant-mode/assistant-mode-resolver.js.map +0 -1
- package/dist-server/service/assistant-mode/fallback-subjects.js.map +0 -1
- package/dist-server/service/assistant-mode/index.js.map +0 -1
- package/dist-server/service/assistant-mode/mode-categories.js.map +0 -1
- package/dist-server/service/assistant-mode/record-subject.js.map +0 -1
- package/dist-server/service/assistant-mode/registry.js.map +0 -1
- package/dist-server/service/assistant-mode/resolve.js.map +0 -1
- package/dist-server/service/assistant-mode/screen-rules.js.map +0 -1
- package/dist-server/service/assistant-mode/turn-lines.js.map +0 -1
- package/dist-server/service/assistant-mode/types.js.map +0 -1
- package/dist-server/service/chat-message/carried-turns.js.map +0 -1
- package/dist-server/service/chat-message/chat-message-broadcast.js.map +0 -1
- package/dist-server/service/chat-message/chat-message-publish.js.map +0 -1
- package/dist-server/service/chat-message/chat-message-room.js.map +0 -1
- package/dist-server/service/chat-message/chat-message-subscription.js.map +0 -1
- package/dist-server/service/chat-message/chat-message.js.map +0 -1
- package/dist-server/service/chat-message/chat-typing-subscription.js.map +0 -1
- package/dist-server/service/chat-message/chat-typing.js.map +0 -1
- package/dist-server/service/chat-message/door-access.js.map +0 -1
- package/dist-server/service/chat-message/fold-history.js.map +0 -1
- package/dist-server/service/chat-message/fold-session-history.js.map +0 -1
- package/dist-server/service/chat-message/history-summary.js.map +0 -1
- package/dist-server/service/chat-message/index.js.map +0 -1
- package/dist-server/service/chat-message/llm-history.js.map +0 -1
- package/dist-server/service/chat-message/message-doors.js.map +0 -1
- package/dist-server/service/chat-message/proposal-outcome.js.map +0 -1
- package/dist-server/service/chat-message/reader-gate.js.map +0 -1
- package/dist-server/service/chat-message/room-message.js.map +0 -1
- package/dist-server/service/chat-message/room-turn.js.map +0 -1
- package/dist-server/service/chat-message/used-tools.js.map +0 -1
- package/dist-server/service/chat-session/attachment-policy.js.map +0 -1
- package/dist-server/service/chat-session/attachment-route.js.map +0 -1
- package/dist-server/service/chat-session/attachment-tool-result.js.map +0 -1
- package/dist-server/service/chat-session/attachment-tools.js.map +0 -1
- package/dist-server/service/chat-session/chat-session.js.map +0 -1
- package/dist-server/service/chat-session/index.js.map +0 -1
- package/dist-server/service/chat-session/session-activity-broadcast.js.map +0 -1
- package/dist-server/service/chat-session/session-activity-publish.js.map +0 -1
- package/dist-server/service/chat-session/session-activity-subscription.js.map +0 -1
- package/dist-server/service/chat-session/session-anchor.js.map +0 -1
- package/dist-server/service/chat-session/session-attachments.js.map +0 -1
- package/dist-server/service/chat-session/session-cleanup.js.map +0 -1
- package/dist-server/service/chat-session/session-inbox.js.map +0 -1
- package/dist-server/service/chat-session/session-kind.js.map +0 -1
- package/dist-server/service/chat-session/session-name.js.map +0 -1
- package/dist-server/service/chat-session/session-purge.js.map +0 -1
- package/dist-server/service/chat-session/session-retention.js.map +0 -1
- package/dist-server/service/chat-session/session-visibility.js.map +0 -1
- package/dist-server/service/chat-session/session-write-gate.js.map +0 -1
- package/dist-server/service/chat-session/station-session-guard.js.map +0 -1
- package/dist-server/service/chat-session/turn-attachments.js.map +0 -1
- package/dist-server/service/chat-session-participant/chat-session-participant.js.map +0 -1
- package/dist-server/service/chat-session-participant/index.js.map +0 -1
- package/dist-server/service/chat-session-participant/invite-notification.js.map +0 -1
- package/dist-server/service/chat-session-participant/mention-invite.js.map +0 -1
- package/dist-server/service/chat-session-participant/participant-lookup-roles.js.map +0 -1
- package/dist-server/service/chat-session-participant/participant-lookup.js.map +0 -1
- package/dist-server/service/chat-session-participant/presence.js.map +0 -1
- package/dist-server/service/chat-session-participant/read-roster.js.map +0 -1
- package/dist-server/service/chat-session-resolver.js.map +0 -1
- package/dist-server/service/data-entry/entry-apply.js.map +0 -1
- package/dist-server/service/data-entry/entry-hash.js.map +0 -1
- package/dist-server/service/data-entry/entry-refusal.js.map +0 -1
- package/dist-server/service/data-entry/entry-resolver.js.map +0 -1
- package/dist-server/service/data-entry/entry-screen.js.map +0 -1
- package/dist-server/service/data-entry/entry-sources.js.map +0 -1
- package/dist-server/service/data-entry/entry-target.js.map +0 -1
- package/dist-server/service/data-entry/entry-tools.js.map +0 -1
- package/dist-server/service/data-entry/entry-update.js.map +0 -1
- package/dist-server/service/data-read/list-read.js.map +0 -1
- package/dist-server/service/data-read/read-target.js.map +0 -1
- package/dist-server/service/data-read/read-tools.js.map +0 -1
- package/dist-server/service/grounding-sources.js.map +0 -1
- package/dist-server/service/help-documents/help-keys.js.map +0 -1
- package/dist-server/service/help-documents/help-tools.js.map +0 -1
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/people/index.js.map +0 -1
- package/dist-server/service/people/invite-tools.js.map +0 -1
- package/dist-server/service/people/people-keys.js.map +0 -1
- package/dist-server/service/people/people-read.js.map +0 -1
- package/dist-server/service/people/person-subject.js.map +0 -1
- package/dist-server/service/request-translator.js.map +0 -1
- package/dist-server/service/testing/conversation-script.js.map +0 -1
- package/dist-server/service/testing/mode-conformance.js.map +0 -1
- package/dist-server/service/tool-access.js.map +0 -1
- package/dist-server/service/types.js.map +0 -1
- package/dist-server/service/unattended-run/assistant-run.js.map +0 -1
- package/dist-server/service/unattended-run/index.js.map +0 -1
- package/dist-server/service/unattended-run/limits.js.map +0 -1
- package/dist-server/service/unattended-run/run-as.js.map +0 -1
- package/dist-server/service/unattended-run/run-budget.js.map +0 -1
- package/dist-server/service/unattended-run/run-ledger.js.map +0 -1
- package/dist-server/service/unattended-run/run-outcome.js.map +0 -1
- package/dist-server/service/unattended-run/run-store.js.map +0 -1
- package/dist-server/service/unattended-run/run-unattended.js.map +0 -1
- package/dist-server/service/unattended-run/unattended-prompt.js.map +0 -1
- package/dist-server/service/workspace/workspace-blocks.js.map +0 -1
- package/dist-server/service/workspace/workspace-tools.js.map +0 -1
- package/dist-server/tool-registry-boot-report.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
- package/docs/session-controller.md +0 -52
- package/server/door-declaration-report.test.ts +0 -53
- package/server/door-declaration-report.ts +0 -61
- package/server/explicit-graphql-types.test.ts +0 -56
- package/server/index.ts +0 -36
- package/server/role-tasks.ts +0 -14
- package/server/service/ai-agent-resolver.ts +0 -330
- package/server/service/assistant-capability-resolver.ts +0 -66
- package/server/service/assistant-chat-resolver.ts +0 -640
- package/server/service/assistant-mode/assistant-mode-resolver.ts +0 -101
- package/server/service/assistant-mode/conversation-category.test.ts +0 -48
- package/server/service/assistant-mode/fallback-subjects.ts +0 -36
- package/server/service/assistant-mode/index.ts +0 -22
- package/server/service/assistant-mode/mode-categories.ts +0 -178
- package/server/service/assistant-mode/mode-front.test.ts +0 -181
- package/server/service/assistant-mode/one-conversation-per-subject.test.ts +0 -37
- package/server/service/assistant-mode/open-subject-door.test.ts +0 -52
- package/server/service/assistant-mode/record-subject.test.ts +0 -41
- package/server/service/assistant-mode/record-subject.ts +0 -44
- package/server/service/assistant-mode/registry.test.ts +0 -171
- package/server/service/assistant-mode/registry.ts +0 -139
- package/server/service/assistant-mode/resolve.test.ts +0 -129
- package/server/service/assistant-mode/resolve.ts +0 -113
- package/server/service/assistant-mode/screen-rules.test.ts +0 -99
- package/server/service/assistant-mode/screen-rules.ts +0 -103
- package/server/service/assistant-mode/turn-lines.ts +0 -43
- package/server/service/assistant-mode/types.ts +0 -138
- package/server/service/chat-message/carried-turns.test.ts +0 -80
- package/server/service/chat-message/carried-turns.ts +0 -112
- package/server/service/chat-message/chat-message-broadcast.integration.test.ts +0 -73
- package/server/service/chat-message/chat-message-broadcast.test.ts +0 -40
- package/server/service/chat-message/chat-message-broadcast.ts +0 -70
- package/server/service/chat-message/chat-message-publish.ts +0 -22
- package/server/service/chat-message/chat-message-room.test.ts +0 -145
- package/server/service/chat-message/chat-message-room.ts +0 -50
- package/server/service/chat-message/chat-message-subscription.ts +0 -77
- package/server/service/chat-message/chat-message.ts +0 -289
- package/server/service/chat-message/chat-typing-subscription.ts +0 -52
- package/server/service/chat-message/chat-typing.test.ts +0 -45
- package/server/service/chat-message/chat-typing.ts +0 -48
- package/server/service/chat-message/door-access.test.ts +0 -72
- package/server/service/chat-message/door-access.ts +0 -65
- package/server/service/chat-message/fold-history-window.test.ts +0 -184
- package/server/service/chat-message/fold-history.test.ts +0 -98
- package/server/service/chat-message/fold-history.ts +0 -77
- package/server/service/chat-message/fold-session-history.test.ts +0 -116
- package/server/service/chat-message/fold-session-history.ts +0 -115
- package/server/service/chat-message/history-summary.test.ts +0 -127
- package/server/service/chat-message/history-summary.ts +0 -100
- package/server/service/chat-message/index.ts +0 -13
- package/server/service/chat-message/llm-history.test.ts +0 -245
- package/server/service/chat-message/llm-history.ts +0 -182
- package/server/service/chat-message/message-doors.test.ts +0 -124
- package/server/service/chat-message/message-doors.ts +0 -137
- package/server/service/chat-message/proposal-outcome.test.ts +0 -111
- package/server/service/chat-message/proposal-outcome.ts +0 -99
- package/server/service/chat-message/reader-gate.ts +0 -44
- package/server/service/chat-message/room-message.test.ts +0 -21
- package/server/service/chat-message/room-message.ts +0 -22
- package/server/service/chat-message/room-turn.ts +0 -42
- package/server/service/chat-message/used-tools.test.ts +0 -19
- package/server/service/chat-message/used-tools.ts +0 -25
- package/server/service/chat-session/attachment-policy.test.ts +0 -42
- package/server/service/chat-session/attachment-policy.ts +0 -91
- package/server/service/chat-session/attachment-route.ts +0 -45
- package/server/service/chat-session/attachment-tool-result.test.ts +0 -63
- package/server/service/chat-session/attachment-tool-result.ts +0 -37
- package/server/service/chat-session/attachment-tools.ts +0 -66
- package/server/service/chat-session/chat-session.ts +0 -244
- package/server/service/chat-session/group-room.test.ts +0 -233
- package/server/service/chat-session/index.ts +0 -5
- package/server/service/chat-session/session-activity-broadcast.ts +0 -77
- package/server/service/chat-session/session-activity-publish.ts +0 -49
- package/server/service/chat-session/session-activity-receivers.test.ts +0 -26
- package/server/service/chat-session/session-activity-subscription.ts +0 -66
- package/server/service/chat-session/session-anchor.ts +0 -142
- package/server/service/chat-session/session-attachments.ts +0 -90
- package/server/service/chat-session/session-cleanup.test.ts +0 -83
- package/server/service/chat-session/session-cleanup.ts +0 -69
- package/server/service/chat-session/session-inbox.test.ts +0 -273
- package/server/service/chat-session/session-inbox.ts +0 -240
- package/server/service/chat-session/session-kind.test.ts +0 -24
- package/server/service/chat-session/session-kind.ts +0 -32
- package/server/service/chat-session/session-name.ts +0 -32
- package/server/service/chat-session/session-purge.test.ts +0 -24
- package/server/service/chat-session/session-purge.ts +0 -117
- package/server/service/chat-session/session-retention.ts +0 -17
- package/server/service/chat-session/session-visibility.test.ts +0 -130
- package/server/service/chat-session/session-visibility.ts +0 -68
- package/server/service/chat-session/session-write-gate.test.ts +0 -59
- package/server/service/chat-session/session-write-gate.ts +0 -31
- package/server/service/chat-session/station-session-guard.ts +0 -25
- package/server/service/chat-session/turn-attachments.test.ts +0 -106
- package/server/service/chat-session/turn-attachments.ts +0 -45
- package/server/service/chat-session-participant/chat-session-participant.ts +0 -135
- package/server/service/chat-session-participant/index.ts +0 -8
- package/server/service/chat-session-participant/invite-notification.test.ts +0 -80
- package/server/service/chat-session-participant/invite-notification.ts +0 -118
- package/server/service/chat-session-participant/mention-invite.test.ts +0 -173
- package/server/service/chat-session-participant/mention-invite.ts +0 -180
- package/server/service/chat-session-participant/participant-lookup-roles.ts +0 -6
- package/server/service/chat-session-participant/participant-lookup.ts +0 -22
- package/server/service/chat-session-participant/presence.test.ts +0 -39
- package/server/service/chat-session-participant/presence.ts +0 -21
- package/server/service/chat-session-participant/read-roster.test.ts +0 -27
- package/server/service/chat-session-participant/read-roster.ts +0 -17
- package/server/service/chat-session-resolver.ts +0 -1455
- package/server/service/data-entry/data-entry-update.test.ts +0 -378
- package/server/service/data-entry/data-entry.test.ts +0 -494
- package/server/service/data-entry/entry-apply.ts +0 -247
- package/server/service/data-entry/entry-hash.ts +0 -35
- package/server/service/data-entry/entry-refusal.test.ts +0 -73
- package/server/service/data-entry/entry-refusal.ts +0 -20
- package/server/service/data-entry/entry-resolver.ts +0 -74
- package/server/service/data-entry/entry-screen.ts +0 -14
- package/server/service/data-entry/entry-sources.ts +0 -39
- package/server/service/data-entry/entry-target.ts +0 -774
- package/server/service/data-entry/entry-tools.ts +0 -282
- package/server/service/data-entry/entry-update.ts +0 -238
- package/server/service/data-read/data-read.test.ts +0 -395
- package/server/service/data-read/detail-lists.test.ts +0 -61
- package/server/service/data-read/list-missing.test.ts +0 -49
- package/server/service/data-read/list-read.ts +0 -146
- package/server/service/data-read/list-status.test.ts +0 -46
- package/server/service/data-read/read-target.ts +0 -510
- package/server/service/data-read/read-tools.ts +0 -334
- package/server/service/data-read/read-words.test.ts +0 -99
- package/server/service/data-read/record-keys.test.ts +0 -42
- package/server/service/grounding-sources.test.ts +0 -55
- package/server/service/grounding-sources.ts +0 -46
- package/server/service/help-documents/help-keys.ts +0 -2
- package/server/service/help-documents/help-tools.test.ts +0 -40
- package/server/service/help-documents/help-tools.ts +0 -88
- package/server/service/index.ts +0 -99
- package/server/service/people/index.ts +0 -15
- package/server/service/people/invite-tools.ts +0 -159
- package/server/service/people/invite.test.ts +0 -159
- package/server/service/people/people-keys.ts +0 -16
- package/server/service/people/people-read.test.ts +0 -82
- package/server/service/people/people-read.ts +0 -56
- package/server/service/people/person-subject.test.ts +0 -163
- package/server/service/people/person-subject.ts +0 -88
- package/server/service/request-translator.test.ts +0 -45
- package/server/service/request-translator.ts +0 -33
- package/server/service/session-anchor.test.ts +0 -198
- package/server/service/station-session-guard.test.ts +0 -31
- package/server/service/testing/conversation-scenario.test.ts +0 -164
- package/server/service/testing/conversation-script.test.ts +0 -133
- package/server/service/testing/conversation-script.ts +0 -296
- package/server/service/testing/mode-conformance.test.ts +0 -61
- package/server/service/testing/mode-conformance.ts +0 -165
- package/server/service/tool-access.test.ts +0 -96
- package/server/service/tool-access.ts +0 -36
- package/server/service/types.ts +0 -15
- package/server/service/unattended-run/assistant-run.ts +0 -199
- package/server/service/unattended-run/index.ts +0 -10
- package/server/service/unattended-run/limits.ts +0 -24
- package/server/service/unattended-run/run-as.ts +0 -38
- package/server/service/unattended-run/run-budget.ts +0 -58
- package/server/service/unattended-run/run-ledger.ts +0 -31
- package/server/service/unattended-run/run-outcome.ts +0 -43
- package/server/service/unattended-run/run-store-race.pg.test.ts +0 -83
- package/server/service/unattended-run/run-store.ts +0 -162
- package/server/service/unattended-run/run-unattended.test.ts +0 -478
- package/server/service/unattended-run/run-unattended.ts +0 -248
- package/server/service/unattended-run/unattended-prompt.ts +0 -24
- package/server/service/workspace/workspace-blocks.ts +0 -134
- package/server/service/workspace/workspace-tools.ts +0 -108
- package/server/service/workspace/workspace.test.ts +0 -74
- package/server/tool-registry-boot-report.test.ts +0 -41
- package/server/tool-registry-boot-report.ts +0 -63
- package/test/ai-agent-settings.test.ts +0 -123
- package/test/applied-screens.test.ts +0 -65
- package/test/assistant-chat-call-sites.test.ts +0 -92
- package/test/assistant-dock.test.ts +0 -294
- package/test/assistant-request-context.test.ts +0 -72
- package/test/assistant-session-controller.test.ts +0 -87
- package/test/assistant-session-manager.test.ts +0 -186
- package/test/assistant-session-toolbar.test.ts +0 -43
- package/test/attachment-one-rule.test.ts +0 -46
- package/test/attachment-policy-agree.test.ts +0 -38
- package/test/composer-frame.test.ts +0 -173
- package/test/document-text.test.ts +0 -175
- package/test/entry-card-styles.test.ts +0 -18
- package/test/entry-proposal.test.ts +0 -186
- package/test/entry-workspace.test.ts +0 -89
- package/test/menu-room.test.ts +0 -33
- package/test/open-doors.test.ts +0 -164
- package/test/open-page.test.ts +0 -31
- package/test/pasted-table.test.ts +0 -147
- package/test/refusals-in-korean.test.ts +0 -80
- package/test/session-discovery.test.ts +0 -43
- package/test/spreadsheet-text.test.ts +0 -92
- package/test/translations.test.ts +0 -80
- package/test/workspace.test.ts +0 -54
- package/tsconfig.json +0 -9
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* What this guards: **the two doors take different inputs, and neither one leaks into the other.**
|
|
3
|
-
*
|
|
4
|
-
* The chat component talks to one of two server operations. `boardAIChat` is board authoring and
|
|
5
|
-
* carries the board model; `assistantChat` is for a surface with no document of its own. Sending
|
|
6
|
-
* a board field to the neutral door, or dropping a required one, produces a GraphQL error the
|
|
7
|
-
* user sees as "the assistant is broken".
|
|
8
|
-
*
|
|
9
|
-
* The required system prompt is the one that would be silent. A conversation with no persona
|
|
10
|
-
* still answers — as nobody, on a surface that never said what it is — and that reads as a poor
|
|
11
|
-
* model rather than a missing argument.
|
|
12
|
-
*/
|
|
13
|
-
import { buildAssistantChatInput, buildChatMutationInput } from './chat-input-builder'
|
|
14
|
-
|
|
15
|
-
const history = [{ role: 'user', content: 'what figures do we have' }]
|
|
16
|
-
|
|
17
|
-
const args = (over: any = {}) => ({ history, mode: { kind: 'figure.modeller', target: 'fig-1' }, ...over })
|
|
18
|
-
|
|
19
|
-
describe('the neutral door carries no document', () => {
|
|
20
|
-
it('★ no board field reaches assistantChat', () => {
|
|
21
|
-
const input = buildAssistantChatInput(args({ sessionId: 's-1' }))
|
|
22
|
-
|
|
23
|
-
for (const field of ['currentBoard', 'selectedRefids', 'boardTools', 'knownTypes', 'componentSchemas', 'scopes', 'mentions']) {
|
|
24
|
-
expect(input).not.toHaveProperty(field)
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('carries the conversation, the session and which conversation this is', () => {
|
|
29
|
-
const input = buildAssistantChatInput(args({ sessionId: 's-1' }))
|
|
30
|
-
|
|
31
|
-
expect(input.sessionId).toBe('s-1')
|
|
32
|
-
expect(input.messages).toBe(history)
|
|
33
|
-
expect(input.mode).toEqual({ kind: 'figure.modeller', target: 'fig-1' })
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('★ the persona, the tools and the limits are not on the wire — they are the server\'s', () => {
|
|
37
|
-
const input = buildAssistantChatInput(args({ sessionId: 's-1' }))
|
|
38
|
-
|
|
39
|
-
for (const field of ['systemPrompt', 'toolCategories', 'model', 'temperature', 'maxTokens', 'requireGroundingTools']) {
|
|
40
|
-
expect(input).not.toHaveProperty(field)
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('★ the open page goes along - the server offers that screen\'s tools first (ADR-0061 decision 9)', () => {
|
|
45
|
-
expect(buildAssistantChatInput(args({ page: 'cash-transaction-list' })).page).toBe('cash-transaction-list')
|
|
46
|
-
expect(buildAssistantChatInput(args())).not.toHaveProperty('page')
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('a one-off question has no session — null, not absent, so the server reads it as ad-hoc', () => {
|
|
50
|
-
expect(buildAssistantChatInput(args()).sessionId).toBeNull()
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
describe('the mode is required', () => {
|
|
55
|
-
it('★ refuses a turn with no mode instead of sending one', () => {
|
|
56
|
-
expect(() => buildAssistantChatInput(args({ mode: { kind: '' } }))).toThrow(/mode.kind is required/)
|
|
57
|
-
expect(() => buildAssistantChatInput(args({ mode: { kind: ' ' } }))).toThrow(/mode.kind is required/)
|
|
58
|
-
expect(() => buildAssistantChatInput(args({ mode: undefined }))).toThrow(/mode.kind is required/)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('a conversation about nothing in particular carries no target', () => {
|
|
62
|
-
expect(buildAssistantChatInput(args({ mode: { kind: 'twin.none' } })).mode).toEqual({ kind: 'twin.none' })
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
describe('optional fields are sent only when they mean something', () => {
|
|
67
|
-
|
|
68
|
-
it('host context and truncation travel when given', () => {
|
|
69
|
-
const input = buildAssistantChatInput(args({ hostContext: { figureId: 'fig-1' }, truncateAfterMessageId: 'm-9' }))
|
|
70
|
-
|
|
71
|
-
expect(input.hostContext).toEqual({ figureId: 'fig-1' })
|
|
72
|
-
expect(input.truncateAfterMessageId).toBe('m-9')
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
describe('the board door is unchanged', () => {
|
|
77
|
-
it('★ still carries selectedRefids — a missing one was why the AI did not know what was selected', () => {
|
|
78
|
-
const input = buildChatMutationInput({ history, liveBoard: null, selectedRefids: [3, 7] } as any)
|
|
79
|
-
expect(input.selectedRefids).toEqual([3, 7])
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
it('does not take a system prompt — the board conversation has its persona on the server', () => {
|
|
83
|
-
const input = buildChatMutationInput({ history, liveBoard: null, selectedRefids: [] } as any)
|
|
84
|
-
expect(input).not.toHaveProperty('systemPrompt')
|
|
85
|
-
})
|
|
86
|
-
})
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* boardAIChat GraphQL mutation 의 input 객체 빌더.
|
|
3
|
-
*
|
|
4
|
-
* board-ai-chat.ts (Lit / Material Web 의존) 와 분리 — pure 함수만 두면 jest 의 node
|
|
5
|
-
* 환경에서도 import 가능. 회귀 테스트 (selectedRefids 누락 등) 가 단위 테스트로 잠긴다.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface ChatMutationInputArgs {
|
|
9
|
-
sessionId?: string
|
|
10
|
-
history: Array<{ role: string; content: string }>
|
|
11
|
-
liveBoard: any
|
|
12
|
-
scopes?: string[]
|
|
13
|
-
/** 편집으로 접은 지점(마지막으로 남긴 서버 메시지 id) — 서버가 그 뒤 이력을 에이전트 문맥에서 뺀다. */
|
|
14
|
-
truncateAfterMessageId?: string
|
|
15
|
-
/** 이 대화면이 무엇을 보고 있는지(예: { spaceId }) — 도구가 대상을 알 수 있게. 없으면 모델이 식별자를 되묻는다. */
|
|
16
|
-
hostContext?: any
|
|
17
|
-
/**
|
|
18
|
-
* 이 대화면이 쓸 수 있는 외부 도구 카테고리(registerToolCategory 이름).
|
|
19
|
-
* 미지정 = 등록된 전부(현행 동작). 지정하면 정의와 **실행** 모두 그 범위로 제한된다.
|
|
20
|
-
*/
|
|
21
|
-
toolCategories?: string[]
|
|
22
|
-
/** 코어 보드 편집 도구(addComponent·스타일링·씬 조작) 사용 여부. 기본 true. */
|
|
23
|
-
boardTools?: boolean
|
|
24
|
-
/**
|
|
25
|
-
* 첫 턴에 도구 호출을 강제할지 — 라이브 상태를 다루는 대화면에서 켠다.
|
|
26
|
-
* 근거 없이 상태를 단언하는 답(도구를 아예 부르지 않은 답)을 원천에서 막는다.
|
|
27
|
-
*/
|
|
28
|
-
requireGroundingTools?: boolean
|
|
29
|
-
knownTypes?: string[]
|
|
30
|
-
categories?: string[]
|
|
31
|
-
componentSchemas?: any
|
|
32
|
-
/**
|
|
33
|
-
* 선택된 컴포넌트의 `refid` 배열 — things-scene universal numeric handle.
|
|
34
|
-
* id (데이터 바인딩 이름) 와는 다른 개념.
|
|
35
|
-
*/
|
|
36
|
-
selectedRefids: number[]
|
|
37
|
-
/**
|
|
38
|
-
* popup 에서 명시 선택한 #mention 매핑 — {token, refid}.
|
|
39
|
-
* 사용자 textarea 에는 #token 만 보이고, 정확한 refid 는 이 별도 채널로 server 에 전달.
|
|
40
|
-
* server 가 mention map 으로 LLM 에 정확한 refid 정보 첨부 (사용자 노출 0).
|
|
41
|
-
*/
|
|
42
|
-
mentions?: Array<{ token: string; refid: number }>
|
|
43
|
-
/**
|
|
44
|
-
* The registered conversation this board chat is (ADR-0061 decision 7). When sent, the server
|
|
45
|
-
* takes the persona, tool categories, model and limits from that mode and ignores the per-request
|
|
46
|
-
* ones above. Omitted for a surface that declares no mode.
|
|
47
|
-
*/
|
|
48
|
-
mode?: { kind: string; target?: string }
|
|
49
|
-
/** The AI agent the person picked. Omitted, the domain default answers. */
|
|
50
|
-
agentId?: string
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* GraphQL mutation 의 input 객체를 빌드.
|
|
55
|
-
*
|
|
56
|
-
* 핵심 보호 — `selectedRefids` 가 항상 포함되어야 한다. 누락이 사용자에게 보고된
|
|
57
|
-
* "AI 가 선택된 컴포넌트를 모른다" 의 root cause 였다.
|
|
58
|
-
*/
|
|
59
|
-
export function buildChatMutationInput(args: ChatMutationInputArgs): Record<string, any> {
|
|
60
|
-
return {
|
|
61
|
-
sessionId: args.sessionId ?? null,
|
|
62
|
-
messages: args.history,
|
|
63
|
-
currentBoard: args.liveBoard ?? null,
|
|
64
|
-
scopes: args.scopes,
|
|
65
|
-
...(args.truncateAfterMessageId ? { truncateAfterMessageId: args.truncateAfterMessageId } : {}),
|
|
66
|
-
...(args.hostContext ? { hostContext: args.hostContext } : {}),
|
|
67
|
-
/* 미지정은 서버 기본(전부 허용)에 맡긴다 — null 을 보내 굳이 덮어쓰지 않는다. */
|
|
68
|
-
...(args.toolCategories ? { toolCategories: args.toolCategories } : {}),
|
|
69
|
-
...(args.boardTools === false ? { boardTools: false } : {}),
|
|
70
|
-
...(args.requireGroundingTools ? { requireGroundingTools: true } : {}),
|
|
71
|
-
knownTypes: args.knownTypes,
|
|
72
|
-
categories: args.categories,
|
|
73
|
-
componentSchemas: args.componentSchemas,
|
|
74
|
-
selectedRefids: args.selectedRefids,
|
|
75
|
-
...(args.mentions && args.mentions.length > 0 && { mentions: args.mentions }),
|
|
76
|
-
...(args.mode?.kind ? { mode: { kind: args.mode.kind, ...(args.mode.target ? { target: args.mode.target } : {}) } } : {}),
|
|
77
|
-
...(args.agentId ? { agentId: args.agentId } : {})
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Input for `assistantChat` — the door for a surface that has no document of its own.
|
|
83
|
-
*
|
|
84
|
-
* Deliberately a separate builder rather than a flag on the one above. The two mutations take
|
|
85
|
-
* different inputs, and folding them together would mean a board field reaching a surface that
|
|
86
|
-
* has no board, or a required field going missing with nothing to notice it. The one thing they
|
|
87
|
-
* share is the conversation, and that is passed the same way.
|
|
88
|
-
*/
|
|
89
|
-
export interface AssistantChatInputArgs {
|
|
90
|
-
sessionId?: string
|
|
91
|
-
history: Array<{ role: string; content: string }>
|
|
92
|
-
/**
|
|
93
|
-
* Which conversation this is and what it is about. The persona, the tool categories, the model
|
|
94
|
-
* and the limits belong to the mode the app server registered (ADR-0061 decision 7) — a caller
|
|
95
|
-
* that could choose its own tool categories was a caller choosing its own authority.
|
|
96
|
-
*/
|
|
97
|
-
mode: { kind: string; target?: string }
|
|
98
|
-
truncateAfterMessageId?: string
|
|
99
|
-
hostContext?: any
|
|
100
|
-
/** Files stored with the conversation by attachToConversation, sent with this turn. */
|
|
101
|
-
attachmentIds?: string[]
|
|
102
|
-
/** The AI agent the person picked. Omitted, the domain default answers. */
|
|
103
|
-
agentId?: string
|
|
104
|
-
/** The route of the page the dock is on - the server offers that screen's tools first (ADR-0061 decision 9). */
|
|
105
|
-
page?: string
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Build the neutral input.
|
|
110
|
-
*
|
|
111
|
-
* Refuses a conversation with no mode instead of sending one. A turn with no mode has no persona
|
|
112
|
-
* and no tools, and an answer given as nobody reads like a bad model rather than a missing
|
|
113
|
-
* argument — the server refuses it too, and this says so where the surface is.
|
|
114
|
-
*/
|
|
115
|
-
export function buildAssistantChatInput(args: AssistantChatInputArgs): Record<string, any> {
|
|
116
|
-
if (!args.mode?.kind?.trim()) {
|
|
117
|
-
throw new Error(
|
|
118
|
-
'[ox-assistant-chat] mode.kind is required when the chat talks to assistantChat — the app server ' +
|
|
119
|
-
'registers the mode and the screen names it (ADR-0061 decision 7)'
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
sessionId: args.sessionId ?? null,
|
|
125
|
-
messages: args.history,
|
|
126
|
-
mode: { kind: args.mode.kind, ...(args.mode.target ? { target: args.mode.target } : {}) },
|
|
127
|
-
...(args.truncateAfterMessageId ? { truncateAfterMessageId: args.truncateAfterMessageId } : {}),
|
|
128
|
-
...(args.hostContext ? { hostContext: args.hostContext } : {}),
|
|
129
|
-
...(args.attachmentIds?.length ? { attachmentIds: args.attachmentIds } : {}),
|
|
130
|
-
...(args.agentId ? { agentId: args.agentId } : {}),
|
|
131
|
-
...(args.page ? { page: args.page } : {})
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* What this guards: the one thing a turn carries that is never stored — its proposals — survives
|
|
3
|
-
* the race between the broadcast echo and the mutation's own answer.
|
|
4
|
-
*
|
|
5
|
-
* A proposal card exists only in the mutation result. The reply, the tool usages and the grounding
|
|
6
|
-
* warnings are all in the database, so any path that rebuilds a line from the broadcast looks
|
|
7
|
-
* right on screen and silently drops the one thing the person can act on. That shipped once
|
|
8
|
-
* before (the comment in chat-echo-dedup remembers it), and on 2026-09-18 the twin saw it again:
|
|
9
|
-
* `proposals` came back with one item and the line on screen had no `proposals` field at all.
|
|
10
|
-
*/
|
|
11
|
-
import { receiveRemoteMessage, reconcileSentLine } from './chat-echo-dedup'
|
|
12
|
-
|
|
13
|
-
const pending = (localId: string) => ({ role: 'assistant', content: '', pending: true, _localId: localId }) as any
|
|
14
|
-
const echo = (id: string) => ({ id, role: 'assistant', content: 'placed at the centre', toolUsagesJson: [{ name: 'proposeSceneEdit' }] }) as any
|
|
15
|
-
const answer = { proposals: [{ tool: 'proposeSceneEdit', proposed: true, kind: 'scene-edit' }], toolUsages: [{ name: 'proposeSceneEdit' }], content: 'placed at the centre', pending: false }
|
|
16
|
-
|
|
17
|
-
it('★ echo first, then the answer — the card survives', () => {
|
|
18
|
-
const absorbed = receiveRemoteMessage([pending('local-1-a')], new Set(), echo('server-1'))!
|
|
19
|
-
const settled = reconcileSentLine(absorbed.lines, absorbed.seen, 'local-1-a', 'server-1', answer as any)
|
|
20
|
-
|
|
21
|
-
expect(settled.lines).toHaveLength(1)
|
|
22
|
-
expect((settled.lines[0] as any).proposals).toHaveLength(1)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('★ the answer first, then the echo — the card survives', () => {
|
|
26
|
-
const settled = reconcileSentLine([pending('local-1-a')], new Set(), 'local-1-a', 'server-1', answer as any)
|
|
27
|
-
const after = receiveRemoteMessage(settled.lines, settled.seen, echo('server-1'))
|
|
28
|
-
|
|
29
|
-
/* The echo is already known; it must not append a second line, and it must not replace this one. */
|
|
30
|
-
const lines = after ? after.lines : settled.lines
|
|
31
|
-
expect(lines).toHaveLength(1)
|
|
32
|
-
expect((lines[0] as any).proposals).toHaveLength(1)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('★ the pending line is gone when the echo arrives — the answer still finds its message', () => {
|
|
36
|
-
/*
|
|
37
|
-
* This is the shape the twin saw on 2026-09-18: a line carrying exactly what the database has,
|
|
38
|
-
* no `proposals` field at all, while the response had one. It happens when the pending line is
|
|
39
|
-
* no longer in `lines` by the time the echo arrives, and the echo is appended as a new line.
|
|
40
|
-
*
|
|
41
|
-
* The answer knows which stored message it is (`assistantMessageId`), so it merges there. What
|
|
42
|
-
* it must never do is return with the card nowhere: the model tells the person to press a button
|
|
43
|
-
* that does not exist.
|
|
44
|
-
*/
|
|
45
|
-
const appended = receiveRemoteMessage([], new Set(), echo('server-1'))!
|
|
46
|
-
expect((appended.lines[0] as any).proposals).toBeUndefined()
|
|
47
|
-
|
|
48
|
-
const settled = reconcileSentLine(appended.lines, appended.seen, 'local-1-a', 'server-1', answer as any)
|
|
49
|
-
|
|
50
|
-
expect(settled.lines).toHaveLength(1)
|
|
51
|
-
expect((settled.lines[0] as any).proposals).toHaveLength(1)
|
|
52
|
-
expect((settled.lines[0] as any).id).toBe('server-1')
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('★ the echo was appended beside a pending line — the card lands on the message that stays', () => {
|
|
56
|
-
/*
|
|
57
|
-
* The duplicate branch used to drop the local line and the answer with it. Everything the
|
|
58
|
-
* database holds was already on the echo line, so the screen looked complete and only the card
|
|
59
|
-
* was missing — the exact defect the absorption path exists to prevent.
|
|
60
|
-
*/
|
|
61
|
-
const withBoth = { lines: [pending('local-1-a'), { id: 'server-1', role: 'assistant', content: 'placed at the centre' }], seen: new Set(['server-1']) }
|
|
62
|
-
|
|
63
|
-
const settled = reconcileSentLine(withBoth.lines as any, withBoth.seen, 'local-1-a', 'server-1', answer as any)
|
|
64
|
-
|
|
65
|
-
expect(settled.lines).toHaveLength(1)
|
|
66
|
-
expect((settled.lines[0] as any).proposals).toHaveLength(1)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
it('a turn with nothing to merge into is left alone — no line is invented', () => {
|
|
70
|
-
const settled = reconcileSentLine([], new Set(), 'local-1-a', 'server-9', answer as any)
|
|
71
|
-
|
|
72
|
-
expect(settled.lines).toEqual([])
|
|
73
|
-
})
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The rows of a data entry proposal, as the person reviews them (operato-application/design/ai/data-entry.md §5).
|
|
3
|
-
*
|
|
4
|
-
* Read-only on purpose: a correction is said in the conversation ("row 2 is 12,000", "drop the last one")
|
|
5
|
-
* and the model proposes again. What is wrong in a cell is marked on the cell - blocking in the error
|
|
6
|
-
* colour, a note in the outline - and where each row came from is on the row.
|
|
7
|
-
*/
|
|
8
|
-
import '@material/web/icon/icon.js'
|
|
9
|
-
|
|
10
|
-
import { LitElement, css, html, nothing } from 'lit'
|
|
11
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
12
|
-
|
|
13
|
-
import { i18next } from '@operato/i18n'
|
|
14
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
15
|
-
|
|
16
|
-
import { entryCellIssues, entryIssueKey, type EntryIssueView, type EntryRowView, type EntryTotalView } from '../utils/entry-proposal.js'
|
|
17
|
-
|
|
18
|
-
const SHOWN = 50
|
|
19
|
-
|
|
20
|
-
const t = (key: string, defaultValue: string, options: Record<string, unknown> = {}) =>
|
|
21
|
-
i18next.t(`ai-assistant.entry.${key}`, { defaultValue, ...options })
|
|
22
|
-
|
|
23
|
-
function issueText(issue: EntryIssueView): string {
|
|
24
|
-
const params = { ...(issue.params ?? {}) } as any
|
|
25
|
-
if (Array.isArray(params.values)) params.values = params.values.join(', ')
|
|
26
|
-
/* A code inside the message is worded by the key the application named for it. */
|
|
27
|
-
for (const [name, prefix] of Object.entries(issue.paramKeys ?? {}))
|
|
28
|
-
if (typeof params[name] === 'string' && params[name]) params[name] = String(i18next.t(`${prefix}${params[name].toLowerCase()}`, { defaultValue: params[name] }))
|
|
29
|
-
return String(i18next.t(entryIssueKey(issue), { defaultValue: issue.code, ...params }))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** Where a row came from, in the screen's words - "said in the conversation" is the framework's, never the model's English. */
|
|
33
|
-
function sourceText(source: { attachmentId?: string; where?: string; person?: boolean }): string {
|
|
34
|
-
if (source.person) return t('source-person', 'said in the conversation')
|
|
35
|
-
return source.where || source.attachmentId || ''
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** An enum value in the person's words when the target names its key - the code only when it does not. */
|
|
39
|
-
function valueOf(column: { valueKeyPrefix?: string }, value: unknown): string {
|
|
40
|
-
if (column.valueKeyPrefix && typeof value === 'string' && value) return String(i18next.t(`${column.valueKeyPrefix}${value.toLowerCase()}`, { defaultValue: value }))
|
|
41
|
-
return shown(value)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function shown(value: unknown): string {
|
|
45
|
-
if (value === undefined || value === null) return ''
|
|
46
|
-
/* A reference: the record's name the server found, or the text that found none. */
|
|
47
|
-
if (typeof value === 'object') return String((value as any).label ?? (value as any).text ?? (value as any).id ?? '')
|
|
48
|
-
if (typeof value === 'number') return value.toLocaleString(i18next.language || undefined)
|
|
49
|
-
if (typeof value === 'boolean') return value ? '✓' : '—'
|
|
50
|
-
return String(value)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@customElement('ox-assistant-entry-review')
|
|
54
|
-
export class AssistantEntryReview extends LitElement {
|
|
55
|
-
/* The inner scroll areas wear the standard scrollbar, as the dock does. */
|
|
56
|
-
static styles = [
|
|
57
|
-
ScrollbarStyles,
|
|
58
|
-
css`
|
|
59
|
-
:host {
|
|
60
|
-
display: block;
|
|
61
|
-
margin: 4px 0 2px;
|
|
62
|
-
font-size: 12px;
|
|
63
|
-
color: var(--md-sys-color-on-surface);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.summary {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-wrap: wrap;
|
|
69
|
-
gap: 4px 10px;
|
|
70
|
-
margin-bottom: 6px;
|
|
71
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.summary .blocked {
|
|
75
|
-
color: var(--md-sys-color-error);
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.scroll {
|
|
80
|
-
max-height: 320px;
|
|
81
|
-
overflow: auto;
|
|
82
|
-
border: 1px solid var(--md-sys-color-outline-variant);
|
|
83
|
-
border-radius: 6px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
table {
|
|
87
|
-
width: 100%;
|
|
88
|
-
border-collapse: collapse;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
th,
|
|
92
|
-
td {
|
|
93
|
-
padding: 4px 6px;
|
|
94
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
95
|
-
text-align: start;
|
|
96
|
-
vertical-align: top;
|
|
97
|
-
white-space: nowrap;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
th {
|
|
101
|
-
position: sticky;
|
|
102
|
-
top: 0;
|
|
103
|
-
background: var(--md-sys-color-surface-container);
|
|
104
|
-
font-weight: 600;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
td.num {
|
|
108
|
-
text-align: end;
|
|
109
|
-
font-variant-numeric: tabular-nums;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
tr.blocked td {
|
|
113
|
-
background: color-mix(in srgb, var(--md-sys-color-error) 6%, transparent);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
td.bad {
|
|
117
|
-
color: var(--md-sys-color-error);
|
|
118
|
-
text-decoration: underline wavy var(--md-sys-color-error);
|
|
119
|
-
text-underline-offset: 3px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
td.note {
|
|
123
|
-
text-decoration: underline dotted var(--md-sys-color-outline);
|
|
124
|
-
text-underline-offset: 3px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.before {
|
|
128
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
129
|
-
text-decoration: line-through;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.missing {
|
|
133
|
-
color: var(--md-sys-color-error);
|
|
134
|
-
font-style: italic;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.source {
|
|
138
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
139
|
-
max-width: 180px;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
text-overflow: ellipsis;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.row-issue {
|
|
145
|
-
display: block;
|
|
146
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
147
|
-
white-space: normal;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.row-issue.blocking {
|
|
151
|
-
color: var(--md-sys-color-error);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.verified {
|
|
155
|
-
color: var(--md-sys-color-primary);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.verified md-icon,
|
|
159
|
-
.totals md-icon {
|
|
160
|
-
--md-icon-size: 14px;
|
|
161
|
-
vertical-align: -2px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.totals {
|
|
165
|
-
display: flex;
|
|
166
|
-
flex-wrap: wrap;
|
|
167
|
-
gap: 2px 12px;
|
|
168
|
-
margin: 6px 0 0;
|
|
169
|
-
font-variant-numeric: tabular-nums;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.totals .differs {
|
|
173
|
-
color: var(--md-sys-color-error);
|
|
174
|
-
font-weight: 600;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.totals .matches {
|
|
178
|
-
color: var(--md-sys-color-primary);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/* In the AI 작업 패널: every row, the page's height, the reading size of a page (design/ai/workspace.md §6-1). */
|
|
182
|
-
:host([wide]) {
|
|
183
|
-
font-size: 13px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
:host([wide]) .scroll {
|
|
187
|
-
max-height: calc(100vh - 260px);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
:host([wide]) th,
|
|
191
|
-
:host([wide]) td {
|
|
192
|
-
padding: 6px 10px;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:host([wide]) .source {
|
|
196
|
-
max-width: 320px;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.more,
|
|
200
|
-
.check-failed {
|
|
201
|
-
margin-top: 4px;
|
|
202
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
203
|
-
}
|
|
204
|
-
`
|
|
205
|
-
]
|
|
206
|
-
|
|
207
|
-
@property({ attribute: false }) proposal: any
|
|
208
|
-
/** The 작업 패널's review - every row is drawn, not the first fifty. */
|
|
209
|
-
@property({ type: Boolean, reflect: true }) wide = false
|
|
210
|
-
|
|
211
|
-
/** The sum of each totalled field, beside the total the material prints - a missing row shows here without reading every row. */
|
|
212
|
-
private renderTotals(totals: EntryTotalView[], columns: { name: string; labelKey?: string }[]) {
|
|
213
|
-
if (!totals.length) return nothing
|
|
214
|
-
const name = (field: string) => {
|
|
215
|
-
const column = columns.find(one => one.name === field)
|
|
216
|
-
return column?.labelKey ? i18next.t(column.labelKey) : field
|
|
217
|
-
}
|
|
218
|
-
return html`<div class="totals" role="status">
|
|
219
|
-
${totals.map(total => html`
|
|
220
|
-
<span>${t('total', '{field} total {sum}', { field: name(total.field), sum: shown(total.all) })}</span>
|
|
221
|
-
${total.ready !== total.all ? html`<span>${t('total-ready', 'entered {sum}', { sum: shown(total.ready) })}</span>` : nothing}
|
|
222
|
-
${total.declared !== undefined
|
|
223
|
-
? html`<span>${total.declaredBy === 'file' ? t('total-declared-file', "the file's total line {sum}", { sum: shown(total.declared) }) : t('total-declared', 'the material says {sum}', { sum: shown(total.declared) })}${total.declaredFound === false ? ` (${t('total-not-found', 'not found in the file')})` : ''}</span>
|
|
224
|
-
${total.difference
|
|
225
|
-
? html`<span class="differs">${t('total-differs', 'differs by {sum}', { sum: shown(total.difference) })}</span>`
|
|
226
|
-
: html`<span class="matches"><md-icon>task_alt</md-icon> ${t('total-matches', 'matches')}</span>`}`
|
|
227
|
-
: nothing}
|
|
228
|
-
`)}
|
|
229
|
-
</div>`
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* A 수정안 - each record by its name, each changing field as what it holds now and what it becomes, and how the
|
|
234
|
-
* record was picked. The "now" is the server's reading, never the model's memory.
|
|
235
|
-
*/
|
|
236
|
-
private renderChanges(p: any) {
|
|
237
|
-
const columns: { name: string; type: string; labelKey?: string; valueKeyPrefix?: string }[] = p.columns ?? []
|
|
238
|
-
const rows: any[] = p.rows ?? []
|
|
239
|
-
const counts = p.counts ?? {}
|
|
240
|
-
const via = (row: any) =>
|
|
241
|
-
row.via === 'current' ? t('via-current', 'the record on screen') : row.via === 'selected' ? t('via-selected', 'selected on screen') : t('via-id', 'found in the conversation')
|
|
242
|
-
return html`
|
|
243
|
-
<div class="summary" role="status">
|
|
244
|
-
<span>${t('changes', '{count} records', { count: counts.rows ?? rows.length })}</span>
|
|
245
|
-
<span>${t('ready', '{count} ready', { count: counts.ready ?? 0 })}</span>
|
|
246
|
-
${counts.blocked ? html`<span class="blocked">${t('not-changed', '{count} will not be changed', { count: counts.blocked })}</span>` : nothing}
|
|
247
|
-
</div>
|
|
248
|
-
<div class="scroll">
|
|
249
|
-
<table>
|
|
250
|
-
<thead>
|
|
251
|
-
<tr>
|
|
252
|
-
<th>#</th>
|
|
253
|
-
<th>${t('record', 'record')}</th>
|
|
254
|
-
${columns.map(column => html`<th>${column.labelKey ? i18next.t(column.labelKey) : column.name}</th>`)}
|
|
255
|
-
<th>${t('picked', 'picked')}</th>
|
|
256
|
-
</tr>
|
|
257
|
-
</thead>
|
|
258
|
-
<tbody>
|
|
259
|
-
${rows.slice(0, this.wide ? rows.length : SHOWN).map(row => {
|
|
260
|
-
const blocked = (row.issues ?? []).some((issue: EntryIssueView) => issue.blocking)
|
|
261
|
-
const whole = entryCellIssues(row)
|
|
262
|
-
return html`<tr class=${blocked ? 'blocked' : ''}>
|
|
263
|
-
<td class="num">${row.index + 1}</td>
|
|
264
|
-
<td>${row.label || row.id}${whole.map(issue => html`<span class="row-issue ${issue.blocking ? 'blocking' : ''}">${issueText(issue)}</span>`)}</td>
|
|
265
|
-
${columns.map(column => {
|
|
266
|
-
const issues = entryCellIssues(row, column.name)
|
|
267
|
-
const bad = issues.some(issue => issue.blocking)
|
|
268
|
-
const changes = column.name in (row.values ?? {})
|
|
269
|
-
return html`<td class="${column.type === 'number' || column.type === 'integer' ? 'num' : ''} ${bad ? 'bad' : issues.length ? 'note' : ''}" title=${issues.map(issueText).join('\n')}>
|
|
270
|
-
${changes ? html`<span class="before">${valueOf(column, row.before?.[column.name]) || '—'}</span> → <strong>${valueOf(column, row.values[column.name]) || '—'}</strong>` : ''}
|
|
271
|
-
</td>`
|
|
272
|
-
})}
|
|
273
|
-
<td class="source">${via(row)}</td>
|
|
274
|
-
</tr>`
|
|
275
|
-
})}
|
|
276
|
-
</tbody>
|
|
277
|
-
</table>
|
|
278
|
-
</div>
|
|
279
|
-
`
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
render() {
|
|
283
|
-
const p = this.proposal ?? {}
|
|
284
|
-
if (p.op === 'update') return this.renderChanges(p)
|
|
285
|
-
const columns: { name: string; type: string; required?: boolean; labelKey?: string; valueKeyPrefix?: string }[] = p.columns ?? []
|
|
286
|
-
const rows: EntryRowView[] = p.rows ?? []
|
|
287
|
-
const counts = p.counts ?? {}
|
|
288
|
-
return html`
|
|
289
|
-
<div class="summary" role="status">
|
|
290
|
-
${counts.groups ? html`<span>${t('groups', '{count} records', { count: counts.groups })}</span>` : nothing}
|
|
291
|
-
<span>${t('rows', '{count} rows', { count: counts.rows ?? rows.length })}</span>
|
|
292
|
-
${counts.groups && counts.groupsReady !== counts.groups ? html`<span class="blocked">${t('groups-kept-out', '{count} records kept out whole', { count: counts.groups - counts.groupsReady })}</span>` : nothing}
|
|
293
|
-
<span>${t('ready', '{count} ready', { count: counts.ready ?? 0 })}</span>
|
|
294
|
-
${counts.blocked ? html`<span class="blocked">${t('blocked', '{count} will not be entered', { count: counts.blocked })}</span>` : nothing}
|
|
295
|
-
${counts.cut ? html`<span class="blocked">${t('cut', '{count} left out over the limit', { count: counts.cut })}</span>` : nothing}
|
|
296
|
-
${counts.verified ? html`<span class="verified"><md-icon>task_alt</md-icon> ${t('verified', '{count} found in their file', { count: counts.verified })}</span>` : nothing}
|
|
297
|
-
${counts.unmatched ? html`<span class="blocked">${t('unmatched', '{count} with a value their file does not have', { count: counts.unmatched })}</span>` : nothing}
|
|
298
|
-
</div>
|
|
299
|
-
<div class="scroll">
|
|
300
|
-
<table>
|
|
301
|
-
<thead>
|
|
302
|
-
<tr>
|
|
303
|
-
<th>#</th>
|
|
304
|
-
${columns.map(column => html`<th>${column.labelKey ? i18next.t(column.labelKey) : column.name}${column.required ? ' *' : ''}</th>`)}
|
|
305
|
-
<th>${t('source', 'from')}</th>
|
|
306
|
-
</tr>
|
|
307
|
-
</thead>
|
|
308
|
-
<tbody>
|
|
309
|
-
${rows.slice(0, this.wide ? rows.length : SHOWN).map(row => {
|
|
310
|
-
const blocked = (row.issues ?? []).some(issue => issue.blocking)
|
|
311
|
-
const whole = entryCellIssues(row)
|
|
312
|
-
return html`
|
|
313
|
-
<tr class=${blocked ? 'blocked' : ''}>
|
|
314
|
-
<td class="num">${row.index + 1}</td>
|
|
315
|
-
${columns.map(column => {
|
|
316
|
-
const issues = entryCellIssues(row, column.name)
|
|
317
|
-
const bad = issues.some(issue => issue.blocking)
|
|
318
|
-
const value = row.values?.[column.name]
|
|
319
|
-
const text = valueOf(column, value)
|
|
320
|
-
return html`<td
|
|
321
|
-
class="${column.type === 'number' || column.type === 'integer' ? 'num' : ''} ${bad ? 'bad' : issues.length ? 'note' : ''}"
|
|
322
|
-
title=${issues.map(issueText).join('\n')}
|
|
323
|
-
>
|
|
324
|
-
${text || (issues.some(issue => issue.code === 'required') ? html`<span class="missing">${t('missing', 'missing')}</span>` : '')}
|
|
325
|
-
</td>`
|
|
326
|
-
})}
|
|
327
|
-
<td class="source" title=${(row.sources ?? []).map(sourceText).join(' · ')}>
|
|
328
|
-
${row.evidence ? html`<span class="verified" title=${t('evidence', 'found on line {line} of the file', { line: row.evidence.line })}><md-icon>task_alt</md-icon></span> ` : nothing}
|
|
329
|
-
${(row.sources ?? []).map(sourceText).join(' · ')}
|
|
330
|
-
${whole
|
|
331
|
-
.filter(issue => issue.code !== 'no-source')
|
|
332
|
-
.map(issue => html`<span class="row-issue ${issue.blocking ? 'blocking' : ''}">${issueText(issue)}</span>`)}
|
|
333
|
-
${whole.some(issue => issue.code === 'no-source') ? html`<span class="row-issue">${issueText({ code: 'no-source', blocking: false })}</span>` : nothing}
|
|
334
|
-
</td>
|
|
335
|
-
</tr>
|
|
336
|
-
`
|
|
337
|
-
})}
|
|
338
|
-
</tbody>
|
|
339
|
-
</table>
|
|
340
|
-
</div>
|
|
341
|
-
${this.renderTotals(p.totals ?? [], columns)}
|
|
342
|
-
${!this.wide && rows.length > SHOWN ? html`<div class="more">${t('more-rows', '{count} more rows are not shown - they are entered too.', { count: rows.length - SHOWN })}</div>` : nothing}
|
|
343
|
-
${p.checkFailed ? html`<div class="check-failed">${t('check-failed', 'the application could not check these rows; they are checked again when entered.')}</div>` : nothing}
|
|
344
|
-
`
|
|
345
|
-
}
|
|
346
|
-
}
|