@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,138 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
|
|
3
|
-
import { css, html, LitElement, nothing, type PropertyValues } from 'lit'
|
|
4
|
-
import { customElement, property, state } from 'lit/decorators.js'
|
|
5
|
-
|
|
6
|
-
import { i18next } from '@operato/i18n'
|
|
7
|
-
|
|
8
|
-
export interface InviteCandidate {
|
|
9
|
-
id: string
|
|
10
|
-
name?: string | null
|
|
11
|
-
email?: string | null
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Bring someone into the conversation - a name box under the roster, and the people of the domain who match.
|
|
16
|
-
*
|
|
17
|
-
* It only picks. The chat calls the door (`inviteToAISession`), and the door decides: anyone in an open room, the
|
|
18
|
-
* owner in a group, nobody in a private one. People already in the room are not offered.
|
|
19
|
-
*
|
|
20
|
-
* Events:
|
|
21
|
-
* assistant-invite-pick { userId, name }
|
|
22
|
-
* assistant-invite-close
|
|
23
|
-
*/
|
|
24
|
-
@customElement('ox-assistant-invite')
|
|
25
|
-
export class AssistantInvite extends LitElement {
|
|
26
|
-
static styles = css`
|
|
27
|
-
:host { display: block; padding: 4px 8px 6px; border-bottom: 1px solid var(--md-sys-color-outline-variant, #e2e8f0); }
|
|
28
|
-
.box { display: flex; align-items: center; gap: 4px; }
|
|
29
|
-
input { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--md-sys-color-outline-variant, #cbd5e1); border-radius: 4px; background: var(--md-sys-color-surface, #fff); color: inherit; }
|
|
30
|
-
button { font: inherit; cursor: pointer; }
|
|
31
|
-
.close { border: 0; background: none; padding: 2px; border-radius: 4px; color: var(--md-sys-color-on-surface-variant); line-height: 0; }
|
|
32
|
-
.close md-icon { --md-icon-size: 16px; }
|
|
33
|
-
ul { list-style: none; margin: 4px 0 0; padding: 0; max-height: 160px; overflow: auto; }
|
|
34
|
-
li button { display: flex; gap: 6px; align-items: baseline; width: 100%; text-align: start; border: 0; border-radius: 4px; padding: 3px 6px; background: none; color: inherit; font-size: 12px; }
|
|
35
|
-
li button:hover, li button.active { background: var(--md-sys-color-surface-container-high, #eef2f7); }
|
|
36
|
-
.email { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
|
|
37
|
-
.note { margin-top: 4px; font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
/** Finds the people of the domain by a part of a name or an email. */
|
|
41
|
-
@property({ attribute: false }) search?: (query: string) => Promise<InviteCandidate[]>
|
|
42
|
-
/** Ids already in the room - not offered. */
|
|
43
|
-
@property({ attribute: false }) exclude: string[] = []
|
|
44
|
-
|
|
45
|
-
@state() private query = ''
|
|
46
|
-
@state() private found: InviteCandidate[] = []
|
|
47
|
-
@state() private active = 0
|
|
48
|
-
@state() private searched = false
|
|
49
|
-
|
|
50
|
-
private generation = 0
|
|
51
|
-
private timer?: ReturnType<typeof setTimeout>
|
|
52
|
-
|
|
53
|
-
protected firstUpdated() {
|
|
54
|
-
this.renderRoot.querySelector('input')?.focus()
|
|
55
|
-
void this.lookUp()
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
protected updated(changed: PropertyValues) {
|
|
59
|
-
if (changed.has('exclude') && changed.get('exclude') !== undefined) void this.lookUp()
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
disconnectedCallback() {
|
|
63
|
-
clearTimeout(this.timer)
|
|
64
|
-
this.generation++
|
|
65
|
-
super.disconnectedCallback()
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private async lookUp() {
|
|
69
|
-
const generation = ++this.generation
|
|
70
|
-
const people = this.search ? await this.search(this.query.trim()).catch(() => []) : []
|
|
71
|
-
if (generation !== this.generation) return
|
|
72
|
-
const here = new Set(this.exclude)
|
|
73
|
-
this.found = people.filter(person => person?.id && !here.has(person.id)).slice(0, 8)
|
|
74
|
-
this.active = 0
|
|
75
|
-
this.searched = true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private onInput(value: string) {
|
|
79
|
-
this.query = value
|
|
80
|
-
clearTimeout(this.timer)
|
|
81
|
-
this.timer = setTimeout(() => void this.lookUp(), 150)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
private onKeyDown(event: KeyboardEvent) {
|
|
85
|
-
if (event.key === 'Escape') {
|
|
86
|
-
event.stopPropagation()
|
|
87
|
-
this.emit('assistant-invite-close')
|
|
88
|
-
} else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
89
|
-
event.preventDefault()
|
|
90
|
-
const step = event.key === 'ArrowDown' ? 1 : -1
|
|
91
|
-
if (this.found.length) this.active = (this.active + step + this.found.length) % this.found.length
|
|
92
|
-
} else if (event.key === 'Enter' && !event.isComposing) {
|
|
93
|
-
event.preventDefault()
|
|
94
|
-
const person = this.found[this.active]
|
|
95
|
-
if (person) this.pick(person)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private pick(person: InviteCandidate) {
|
|
100
|
-
this.emit('assistant-invite-pick', { userId: person.id, name: person.name || person.email || '' })
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private emit(name: string, detail?: unknown) {
|
|
104
|
-
this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }))
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
render() {
|
|
108
|
-
const label = i18next.t('ai-assistant.text.invite-search', { defaultValue: 'Name or email' })
|
|
109
|
-
return html`
|
|
110
|
-
<div class="box">
|
|
111
|
-
<input
|
|
112
|
-
.value=${this.query}
|
|
113
|
-
placeholder=${label}
|
|
114
|
-
aria-label=${label}
|
|
115
|
-
@input=${(e: Event) => this.onInput((e.target as HTMLInputElement).value)}
|
|
116
|
-
@keydown=${(e: KeyboardEvent) => this.onKeyDown(e)} />
|
|
117
|
-
<button
|
|
118
|
-
class="close"
|
|
119
|
-
aria-label=${i18next.t('ai-assistant.button.close')}
|
|
120
|
-
title=${i18next.t('ai-assistant.button.close')}
|
|
121
|
-
@click=${() => this.emit('assistant-invite-close')}><md-icon>close</md-icon></button>
|
|
122
|
-
</div>
|
|
123
|
-
${this.found.length
|
|
124
|
-
? html`<ul role="listbox" aria-label=${label}>
|
|
125
|
-
${this.found.map(
|
|
126
|
-
(person, i) => html`<li>
|
|
127
|
-
<button role="option" aria-selected=${i === this.active ? 'true' : 'false'} class=${i === this.active ? 'active' : ''} @click=${() => this.pick(person)}>
|
|
128
|
-
<span>${person.name || person.email}</span>${person.name && person.email ? html`<span class="email">${person.email}</span>` : nothing}
|
|
129
|
-
</button>
|
|
130
|
-
</li>`
|
|
131
|
-
)}
|
|
132
|
-
</ul>`
|
|
133
|
-
: this.searched
|
|
134
|
-
? html`<div class="note" role="status">${i18next.t('ai-assistant.text.invite-none-found', { defaultValue: 'No one else here by that name.' })}</div>`
|
|
135
|
-
: nothing}
|
|
136
|
-
`
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* A mode is one value, and the point of it is that the parts of a conversation cannot disagree
|
|
3
|
-
* with each other. Since ADR-0061 decision 7 the parts live on the server: the browser names the
|
|
4
|
-
* conversation (`kind`) and its subject (`target`), and the persona, the tool categories, the
|
|
5
|
-
* model and the limits are the app server's.
|
|
6
|
-
*
|
|
7
|
-
* The defect this still guards against shipped: a screen whose prompt said "you do not edit boards
|
|
8
|
-
* here" offered `/add-monitor` in the same panel, because the prompt was an element property and
|
|
9
|
-
* the slash list was a module global. A mode's wording now comes from the same declaration the
|
|
10
|
-
* door reads, so the two cannot describe different conversations.
|
|
11
|
-
*/
|
|
12
|
-
import { isDifferentConversation, resolveConversation, type AssistantMode } from './assistant-mode'
|
|
13
|
-
|
|
14
|
-
const MODE: AssistantMode = { kind: 'twin.space', target: 'S-12', hostContext: { spaceId: 'S-12' } }
|
|
15
|
-
|
|
16
|
-
/** What the server said this mode offers, already in the request's locale. */
|
|
17
|
-
const MODE_VIEW = {
|
|
18
|
-
kind: 'twin.space',
|
|
19
|
-
slashTemplates: [{ name: 'status', description: 'summarize', template: '이 공간의 지금 상태를 요약해줘' }],
|
|
20
|
-
catalogEntries: [],
|
|
21
|
-
proposalChoices: [],
|
|
22
|
-
footerNotice: undefined,
|
|
23
|
-
stagedNotice: undefined
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** The board product, which declares no mode and names its own door. */
|
|
27
|
-
/*
|
|
28
|
-
* A host on the neutral door. A board host (`chatEndpoint: 'boardAIChat'`) keeps its own door even with
|
|
29
|
-
* a mode - it alone carries the board document (16d14bce2b, ADR-0061 decision 0-1) - and is pinned below.
|
|
30
|
-
*/
|
|
31
|
-
const HOST_PROPERTIES = {
|
|
32
|
-
hostContext: { boardId: 'B-1' },
|
|
33
|
-
chatEndpoint: 'assistantChat' as const
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const GLOBAL_DEFAULTS = {
|
|
37
|
-
catalogEntries: [{ type: 'rect' }],
|
|
38
|
-
slashTemplates: [{ name: 'add-monitor', template: '모니터를 추가해줘' }],
|
|
39
|
-
footerNotice: 'previewed on the board'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
describe('a mode names the conversation; the server says what it offers', () => {
|
|
43
|
-
test('★ the subject travels, and the door is the neutral one', () => {
|
|
44
|
-
const c = resolveConversation(MODE, HOST_PROPERTIES, GLOBAL_DEFAULTS, MODE_VIEW)
|
|
45
|
-
|
|
46
|
-
expect(c.kind).toBe('twin.space')
|
|
47
|
-
expect(c.target).toBe('S-12')
|
|
48
|
-
expect(c.hostContext).toEqual({ spaceId: 'S-12' })
|
|
49
|
-
expect(c.chatEndpoint).toBe('assistantChat')
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
test('★ what the mode offers comes from the server, not from what another package registered', () => {
|
|
53
|
-
const c = resolveConversation(MODE, HOST_PROPERTIES, GLOBAL_DEFAULTS, MODE_VIEW)
|
|
54
|
-
|
|
55
|
-
expect(c.slashTemplates).toEqual(MODE_VIEW.slashTemplates)
|
|
56
|
-
expect(JSON.stringify(c.slashTemplates)).not.toContain('add-monitor')
|
|
57
|
-
expect(c.catalogEntries).toEqual([])
|
|
58
|
-
expect(c.footerNotice).toBeUndefined()
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
test('★ before the server has answered, a mode offers nothing — the defaults do not stand in', () => {
|
|
62
|
-
const c = resolveConversation(MODE, HOST_PROPERTIES, GLOBAL_DEFAULTS, undefined)
|
|
63
|
-
|
|
64
|
-
expect(c.slashTemplates).toEqual([])
|
|
65
|
-
expect(c.catalogEntries).toEqual([])
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
test('a view for another kind is ignored — the panel is showing this conversation', () => {
|
|
69
|
-
const c = resolveConversation(MODE, HOST_PROPERTIES, GLOBAL_DEFAULTS, { ...MODE_VIEW, kind: 'twin.board' })
|
|
70
|
-
|
|
71
|
-
expect(c.slashTemplates).toEqual([])
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
describe('a host with no mode', () => {
|
|
76
|
-
test('gets its own properties and the registered defaults, as before modes existed', () => {
|
|
77
|
-
const c = resolveConversation(undefined, { ...HOST_PROPERTIES, chatEndpoint: 'boardAIChat' }, GLOBAL_DEFAULTS)
|
|
78
|
-
|
|
79
|
-
expect(c.hostContext).toEqual({ boardId: 'B-1' })
|
|
80
|
-
expect(c.slashTemplates).toEqual(GLOBAL_DEFAULTS.slashTemplates)
|
|
81
|
-
expect(c.footerNotice).toBe('previewed on the board')
|
|
82
|
-
expect(c.chatEndpoint).toBe('boardAIChat')
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
test('★ must name its door — there is no default any more', () => {
|
|
86
|
-
expect(() => resolveConversation(undefined, {}, {})).toThrow(/chatEndpoint/)
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
describe('isDifferentConversation', () => {
|
|
91
|
-
const station3: AssistantMode = { kind: 'plant.station', target: '3' }
|
|
92
|
-
|
|
93
|
-
test('★ a different subject ends the conversation, and so does a different kind', () => {
|
|
94
|
-
expect(isDifferentConversation(station3, { kind: 'plant.station', target: '7' })).toBe(true)
|
|
95
|
-
expect(isDifferentConversation(station3, { kind: 'plant.factory', target: '3' })).toBe(true)
|
|
96
|
-
expect(isDifferentConversation(undefined, station3)).toBe(true)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
test('the same subject, described again, does not', () => {
|
|
100
|
-
expect(isDifferentConversation(station3, { ...station3, hostContext: { reread: true } })).toBe(false)
|
|
101
|
-
expect(isDifferentConversation(undefined, undefined)).toBe(false)
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
/*
|
|
106
|
-
* ADR-0072 A17 ① — 화면을 열 때 어느 대화로 서나.
|
|
107
|
-
*
|
|
108
|
-
* 되살리는 것은 고른 대화이지 세션이 아니다. 그리고 없어진 대화로 되살리지 않는다 — 그러면 대화가
|
|
109
|
-
* 안 열리고 사람은 자기가 무엇을 잘못했는지 알 길이 없다.
|
|
110
|
-
*/
|
|
111
|
-
describe('a board host keeps the board door', () => {
|
|
112
|
-
test('★ with a mode, the door stays boardAIChat and the board defaults fill what the mode leaves out', () => {
|
|
113
|
-
const c = resolveConversation(MODE, { ...HOST_PROPERTIES, chatEndpoint: 'boardAIChat' }, GLOBAL_DEFAULTS, undefined)
|
|
114
|
-
|
|
115
|
-
expect(c.kind).toBe('twin.space')
|
|
116
|
-
expect(c.chatEndpoint).toBe('boardAIChat')
|
|
117
|
-
expect(c.catalogEntries).toEqual(GLOBAL_DEFAULTS.catalogEntries)
|
|
118
|
-
})
|
|
119
|
-
})
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A mode is what a conversation *is*: which conversation this is, and what it is about.
|
|
3
|
-
*
|
|
4
|
-
* Those two used to be nine. The browser declared the persona, the tool categories, the model and
|
|
5
|
-
* the limits and sent them with every turn, which meant a caller holding the door's privilege
|
|
6
|
-
* chose its own authority — and it meant a screen could describe a conversation one way while the
|
|
7
|
-
* server answered it another. Since ADR-0061 decision 7 the app server registers the mode and the
|
|
8
|
-
* browser names it:
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* html`<ox-assistant-chat .mode=${{ kind: 'twin.space', target: spaceId, hostContext: { spaceId } }}></ox-assistant-chat>`
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* What the panel shows — the `/` sentences, the `@` catalog, the two notices — comes from the same
|
|
15
|
-
* declaration, fetched from the server already written in the person's language, so the panel and
|
|
16
|
-
* the door cannot offer different conversations.
|
|
17
|
-
*/
|
|
18
|
-
export interface AssistantMode {
|
|
19
|
-
/**
|
|
20
|
-
* Which conversation this is — a `<app>.<surface>` kind the app server registered.
|
|
21
|
-
*/
|
|
22
|
-
kind: string
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* What it is about: the space, the station, the model being edited.
|
|
26
|
-
*
|
|
27
|
-
* **With `kind`, this is the conversation's lifetime.** When either changes the chat closes what
|
|
28
|
-
* is on screen and starts again — a conversation about station 3 is not a conversation about
|
|
29
|
-
* station 7, and leaving the old one up means the person reads an answer about a screen they are
|
|
30
|
-
* no longer looking at.
|
|
31
|
-
*/
|
|
32
|
-
target?: string
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* What the host knows about the subject; travels with each request.
|
|
36
|
-
*
|
|
37
|
-
* **The model never sees this** — it reaches the tools as `ctx.host` and nothing else (ADR-0061
|
|
38
|
-
* decision 7). Anything the model must know is answered by a read tool.
|
|
39
|
-
*/
|
|
40
|
-
hostContext?: any
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** What the server said this mode offers, already in the request's locale. */
|
|
44
|
-
export interface AssistantModeView {
|
|
45
|
-
kind: string
|
|
46
|
-
slashTemplates: any[]
|
|
47
|
-
catalogEntries: any[]
|
|
48
|
-
proposalChoices: any[]
|
|
49
|
-
placeholder?: string
|
|
50
|
-
/** 빈 대화의 제목과 한 줄 — 이 대화가 무엇을 하는 자리인지. host 속성보다 앞선다. */
|
|
51
|
-
intro?: { title: string; subtitle: string }
|
|
52
|
-
/** 빈 대화의 예시 — 이 대화에서 실제로 할 수 있는 말. host 속성보다 앞선다. */
|
|
53
|
-
examples?: Array<{ label: string; items: string[] }>
|
|
54
|
-
footerNotice?: string
|
|
55
|
-
stagedNotice?: string
|
|
56
|
-
/** What this conversation accepts as attachments; absent - none (design/ai/shared-dock.md §9-1). */
|
|
57
|
-
attachments?: { kinds: ('image' | 'text' | 'spreadsheet' | 'document')[]; maxBytes?: number; maxFiles?: number; maxChars?: number }
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** True when these two describe different conversations, so the old one should be closed. */
|
|
61
|
-
export function isDifferentConversation(a?: AssistantMode, b?: AssistantMode): boolean {
|
|
62
|
-
return `${a?.kind ?? ''}|${a?.target ?? ''}` !== `${b?.kind ?? ''}|${b?.target ?? ''}`
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Everything a conversation needs, after the mode, the host's own properties, the registered
|
|
66
|
-
* defaults and the server's answer have been reconciled. */
|
|
67
|
-
export interface ConversationSettings {
|
|
68
|
-
/** Set when a mode names this conversation; absent for a host that declares none. */
|
|
69
|
-
kind?: string
|
|
70
|
-
target?: string
|
|
71
|
-
hostContext?: any
|
|
72
|
-
chatEndpoint: 'boardAIChat' | 'assistantChat'
|
|
73
|
-
catalogEntries: any[]
|
|
74
|
-
slashTemplates: any[]
|
|
75
|
-
/** What the empty input says. A mode's comes translated from the server. */
|
|
76
|
-
placeholder?: string
|
|
77
|
-
/** Sentences, not keys — a mode's come translated from the server, a host's from its own i18n. */
|
|
78
|
-
footerNotice?: string
|
|
79
|
-
proposalChoices: any[]
|
|
80
|
-
stagedNotice?: string
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Reconcile the places a setting can come from.
|
|
85
|
-
*
|
|
86
|
-
* **A host that declares a mode gets the mode and nothing else.** What the mode does not offer is
|
|
87
|
-
* not filled in from the element's own properties or from the defaults another package registered.
|
|
88
|
-
* Filling it back in is how the defect this type removes returned — board-ai registers board
|
|
89
|
-
* authoring's `/add-monitor`, its component `@` catalog and its "previewed on the board" line
|
|
90
|
-
* globally, and plant's factory mode, which declares no slash list, offered them on a factory
|
|
91
|
-
* screen once the board modeller had been loaded.
|
|
92
|
-
*
|
|
93
|
-
* A mode's offering arrives asynchronously, so until the server has answered a mode offers
|
|
94
|
-
* nothing. Standing the defaults in during that gap would show the board's list for a moment on a
|
|
95
|
-
* screen that does not edit boards.
|
|
96
|
-
*
|
|
97
|
-
* A host that declares no mode gets exactly what it got before modes existed — its own properties,
|
|
98
|
-
* falling back to the registered defaults — and it must name its own door: the `boardAIChat`
|
|
99
|
-
* default was removed with decision 7, because a missing door should show when a surface is
|
|
100
|
-
* declared, not when a person says something.
|
|
101
|
-
*/
|
|
102
|
-
export function resolveConversation(
|
|
103
|
-
mode: AssistantMode | undefined,
|
|
104
|
-
own: Partial<ConversationSettings>,
|
|
105
|
-
defaults: Partial<ConversationSettings>,
|
|
106
|
-
view?: AssistantModeView
|
|
107
|
-
): ConversationSettings {
|
|
108
|
-
if (mode && own.chatEndpoint === 'boardAIChat') {
|
|
109
|
-
/*
|
|
110
|
-
* The board door with a declared mode. The mode decides persona and tools on the server; the
|
|
111
|
-
* door stays `boardAIChat` because only it carries the board document and returns patches -
|
|
112
|
-
* `assistantChat` has no document. What the panel offers comes from the mode where the mode
|
|
113
|
-
* declares it, and from the board's own defaults (the # component catalog, the slash
|
|
114
|
-
* templates) where it does not, so a mode that declares nothing does not empty the panel.
|
|
115
|
-
*/
|
|
116
|
-
const offered = view && view.kind === mode.kind ? view : undefined
|
|
117
|
-
const pickOwn = <K extends keyof ConversationSettings>(key: K): ConversationSettings[K] =>
|
|
118
|
-
(own as any)[key] ?? (defaults as any)[key]
|
|
119
|
-
const orOwn = (list: any[] | undefined, key: 'catalogEntries' | 'slashTemplates' | 'proposalChoices') =>
|
|
120
|
-
list && list.length > 0 ? list : (pickOwn(key) as any[]) ?? []
|
|
121
|
-
return {
|
|
122
|
-
kind: mode.kind,
|
|
123
|
-
target: mode.target,
|
|
124
|
-
hostContext: mode.hostContext ?? pickOwn('hostContext'),
|
|
125
|
-
chatEndpoint: 'boardAIChat',
|
|
126
|
-
catalogEntries: orOwn(offered?.catalogEntries, 'catalogEntries'),
|
|
127
|
-
slashTemplates: orOwn(offered?.slashTemplates, 'slashTemplates'),
|
|
128
|
-
proposalChoices: orOwn(offered?.proposalChoices, 'proposalChoices'),
|
|
129
|
-
placeholder: offered?.placeholder ?? pickOwn('placeholder'),
|
|
130
|
-
footerNotice: offered?.footerNotice ?? pickOwn('footerNotice'),
|
|
131
|
-
stagedNotice: offered?.stagedNotice ?? pickOwn('stagedNotice')
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (mode) {
|
|
136
|
-
/* A view for another kind is the previous conversation's answer arriving late. */
|
|
137
|
-
const offered = view && view.kind === mode.kind ? view : undefined
|
|
138
|
-
return {
|
|
139
|
-
kind: mode.kind,
|
|
140
|
-
target: mode.target,
|
|
141
|
-
hostContext: mode.hostContext,
|
|
142
|
-
chatEndpoint: 'assistantChat',
|
|
143
|
-
catalogEntries: offered?.catalogEntries ?? [],
|
|
144
|
-
slashTemplates: offered?.slashTemplates ?? [],
|
|
145
|
-
proposalChoices: offered?.proposalChoices ?? [],
|
|
146
|
-
placeholder: offered?.placeholder,
|
|
147
|
-
footerNotice: offered?.footerNotice,
|
|
148
|
-
stagedNotice: offered?.stagedNotice
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const pick = <K extends keyof ConversationSettings>(key: K): ConversationSettings[K] =>
|
|
153
|
-
(own as any)[key] ?? (defaults as any)[key]
|
|
154
|
-
|
|
155
|
-
const chatEndpoint = pick('chatEndpoint')
|
|
156
|
-
if (!chatEndpoint) {
|
|
157
|
-
throw new Error(
|
|
158
|
-
'[ox-assistant-chat] a surface with no mode must name its chatEndpoint. The `boardAIChat` default was ' +
|
|
159
|
-
'removed (ADR-0061 decision 7) — apps declare a mode and talk to `assistantChat`; the board product ' +
|
|
160
|
-
'names `boardAIChat` on the element.'
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
hostContext: pick('hostContext'),
|
|
166
|
-
placeholder: pick('placeholder'),
|
|
167
|
-
chatEndpoint,
|
|
168
|
-
catalogEntries: pick('catalogEntries') ?? [],
|
|
169
|
-
slashTemplates: pick('slashTemplates') ?? [],
|
|
170
|
-
footerNotice: pick('footerNotice'),
|
|
171
|
-
proposalChoices: pick('proposalChoices') ?? [],
|
|
172
|
-
stagedNotice: pick('stagedNotice')
|
|
173
|
-
}
|
|
174
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* 「AI와 작업」 over a list (ox-assistant-selection-bar) - one bar for every application's lists. What it is held to here is
|
|
3
|
-
* its source and its words; its behaviour on a real grid is held by the applications' browser tests (operato-office
|
|
4
|
-
* test/browser/page-ai-input.test.js).
|
|
5
|
-
*/
|
|
6
|
-
import { readFileSync } from 'node:fs'
|
|
7
|
-
import { join } from 'node:path'
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* The bar's actions are run here for real: the page action runner is the published one (`@operato/context`, loaded by
|
|
11
|
-
* node itself - jest does not transform node_modules), and the bar's template is read as lit would get it. lit,
|
|
12
|
-
* the icons and the words are stood in for, since this suite runs without a DOM.
|
|
13
|
-
*/
|
|
14
|
-
jest.mock('lit', () => ({
|
|
15
|
-
html: (strings: TemplateStringsArray, ...values: unknown[]) => ({ strings, values }),
|
|
16
|
-
css: () => '',
|
|
17
|
-
nothing: Symbol.for('lit-nothing'),
|
|
18
|
-
LitElement: class {
|
|
19
|
-
requestUpdate() {}
|
|
20
|
-
}
|
|
21
|
-
}))
|
|
22
|
-
jest.mock('lit/decorators.js', () => ({ customElement: () => (it: unknown) => it, property: () => (it: unknown) => it, state: () => (it: unknown) => it }))
|
|
23
|
-
jest.mock('@material/web/icon/icon.js', () => ({}), { virtual: true })
|
|
24
|
-
jest.mock('@operato/context', () => {
|
|
25
|
-
/* The published runner itself: its one file has no imports, so it is turned into CommonJS here and evaluated. */
|
|
26
|
-
const { readFileSync } = jest.requireActual('node:fs')
|
|
27
|
-
const { dirname, join } = jest.requireActual('node:path')
|
|
28
|
-
const { transformSync } = jest.requireActual('@babel/core')
|
|
29
|
-
const file = join(dirname(require.resolve('@operato/context/package.json')), 'dist/src/tools/page-action.js')
|
|
30
|
-
const { code } = transformSync(readFileSync(file, 'utf-8'), { babelrc: false, configFile: false, plugins: ['@babel/plugin-transform-modules-commonjs'] })
|
|
31
|
-
const module = { exports: {} as Record<string, unknown> }
|
|
32
|
-
new Function('module', 'exports', code)(module, module.exports)
|
|
33
|
-
return { ...module.exports, PageActionStyles: '' }
|
|
34
|
-
})
|
|
35
|
-
jest.mock('@operato/i18n', () => ({ i18next: { t: (key: string) => key } }))
|
|
36
|
-
jest.mock('@operato/layout', () => ({ notify: jest.fn() }))
|
|
37
|
-
jest.mock('@operato/styles', () => ({ ButtonStyles: '', FormFieldStyles: '' }))
|
|
38
|
-
jest.mock('../utils/assistant-ask', () => ({ askAssistant: jest.fn() }))
|
|
39
|
-
jest.mock('../utils/assistant-selection', () => ({ selectedRecords: jest.fn() }))
|
|
40
|
-
|
|
41
|
-
import { notify } from '@operato/layout'
|
|
42
|
-
|
|
43
|
-
import { OxAssistantSelectionBar, SelectionAction } from './assistant-selection-bar'
|
|
44
|
-
|
|
45
|
-
type Drawn = { strings: readonly string[]; values: any[] }
|
|
46
|
-
|
|
47
|
-
/** The value bound to `name=` in the bar's button template (`?danger`, `aria-disabled`, `title`, `@click`). */
|
|
48
|
-
const bound = (drawn: Drawn, name: string) => {
|
|
49
|
-
const at = drawn.strings.findIndex(part => /\s$/.test(` ${part.slice(0, part.length - name.length - 1)}`) && part.endsWith(`${name}=`))
|
|
50
|
-
if (at < 0) throw new Error(`no ${name} in the template`)
|
|
51
|
-
return drawn.values[at]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const barWith = (count: number) => {
|
|
55
|
-
/* `renderAction` is private to the bar; the suite reaches it as the template lit would be handed. */
|
|
56
|
-
const bar = new (OxAssistantSelectionBar as any)()
|
|
57
|
-
bar.count = count
|
|
58
|
-
return bar as { count: number; renderAction(action: SelectionAction): Drawn }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const bare = readFileSync(join(__dirname, 'assistant-selection-bar.ts'), 'utf-8').replace(/\/\*[\s\S]*?\*\//g, '')
|
|
62
|
-
|
|
63
|
-
describe('the selection bar', () => {
|
|
64
|
-
it('★ counts every way a grid picks - a row, the header\'s select-all, a new page of rows', () => {
|
|
65
|
-
expect(bare).toMatch(/GRID_EVENTS = \['select-record-change', 'select-all-change', 'list-adopted'\]/)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('★ asks for its grid when it needs it - a page finds its grid only after its first render', () => {
|
|
69
|
-
expect(bare).toMatch(/gridOf\?: \(\) => SelectionGrid \| undefined/)
|
|
70
|
-
expect(bare).not.toMatch(/@property\(\{ attribute: false \}\) grist/)
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('★ hands the rows as keys of the list, to this screen\'s conversation, sent at once', () => {
|
|
74
|
-
expect(bare).toMatch(/selection: \{ title: this\.name, list: this\.list, records: selectedRecords\(rows, \{ axis: this\.axis, labelOf: this\.labelOf \}\) \}/)
|
|
75
|
-
expect(bare).toMatch(/ask: request\?\.trim\(\) \|\| i18next\.t\('ai-assistant\.selection\.ask'/)
|
|
76
|
-
expect(bare).not.toMatch(/draft|continueCurrent|transcript/)
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('keeps the words unless the request was sent', () => {
|
|
80
|
-
expect(bare).toMatch(/if \(outcome\?\.sent && this\.request === request\) this\.request = ''/)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
it('every word it shows reads in every language', () => {
|
|
84
|
-
const keys = [...new Set([...bare.matchAll(/'(ai-assistant\.selection\.[\w-]+)'/g)].map(([, key]) => key))]
|
|
85
|
-
expect(keys.length).toBe(8)
|
|
86
|
-
for (const locale of ['en', 'ko', 'ja', 'zh', 'ms', 'es']) {
|
|
87
|
-
const words = JSON.parse(readFileSync(join(__dirname, `../../translations/${locale}.json`), 'utf-8'))
|
|
88
|
-
for (const key of keys) expect([locale, key, typeof words[key]]).toEqual([locale, key, 'string'])
|
|
89
|
-
expect(words['ai-assistant.selection.ask']).toMatch(/\{n\}/)
|
|
90
|
-
expect(words['ai-assistant.selection.ask']).toMatch(/\{title\}/)
|
|
91
|
-
expect(words['ai-assistant.selection.count']).toMatch(/\{n\}/)
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
describe('the selection bar\'s actions', () => {
|
|
97
|
-
beforeEach(() => (notify as jest.Mock).mockClear())
|
|
98
|
-
|
|
99
|
-
it('★ draws a destructive action as danger, an ordinary one not', () => {
|
|
100
|
-
const bar = barWith(1)
|
|
101
|
-
expect(bound(bar.renderAction({ title: 'delete', action: () => {}, emphasis: { danger: true } }), '?danger')).toBe(true)
|
|
102
|
-
expect(bound(bar.renderAction({ title: 'copy', action: () => {} }), '?danger')).toBe(false)
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
it('★ a one-row action with two rows picked does not run - it is aria-disabled and says why', async () => {
|
|
106
|
-
const bar = barWith(2)
|
|
107
|
-
const action = jest.fn()
|
|
108
|
-
const drawn = bar.renderAction({ title: 'open', single: true, action })
|
|
109
|
-
expect(bound(drawn, 'aria-disabled')).toBe('true')
|
|
110
|
-
expect(bound(drawn, 'title')).toBe('ai-assistant.selection.pick-one')
|
|
111
|
-
await bound(drawn, '@click')({})
|
|
112
|
-
expect(action).not.toHaveBeenCalled()
|
|
113
|
-
expect(notify).toHaveBeenCalledWith({ message: 'ai-assistant.selection.pick-one', level: 'info' })
|
|
114
|
-
|
|
115
|
-
const one = barWith(1).renderAction({ title: 'open', single: true, action })
|
|
116
|
-
expect(bound(one, 'aria-disabled')).toBe('false')
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
it('★ pressed twice while its first run is out, it runs once', async () => {
|
|
120
|
-
const bar = barWith(1)
|
|
121
|
-
let finish!: () => void
|
|
122
|
-
const action = jest.fn(() => new Promise<void>(resolve => (finish = resolve)))
|
|
123
|
-
const declared: SelectionAction = { id: 'twice', title: 'send', single: true, action }
|
|
124
|
-
const first = bound(bar.renderAction(declared), '@click')({})
|
|
125
|
-
const second = bound(bar.renderAction(declared), '@click')({})
|
|
126
|
-
expect(bound(bar.renderAction(declared), 'aria-disabled')).toBe('true')
|
|
127
|
-
finish()
|
|
128
|
-
await Promise.all([first, second])
|
|
129
|
-
await new Promise(resolve => setTimeout(resolve, 0))
|
|
130
|
-
expect(action).toHaveBeenCalledTimes(1)
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
describe('the selection bar without the assistant', () => {
|
|
135
|
-
/** Every template drawn under `drawn`, the outer one first - lit's nested `html` results as the mock hands them. */
|
|
136
|
-
const templates = (drawn: any): Drawn[] =>
|
|
137
|
-
drawn && typeof drawn === 'object' && Array.isArray(drawn.strings)
|
|
138
|
-
? [drawn, ...drawn.values.flatMap((value: any) => (Array.isArray(value) ? value.flatMap(templates) : templates(value)))]
|
|
139
|
-
: []
|
|
140
|
-
const drawnWith = (assistant?: boolean) => {
|
|
141
|
-
const bar = new (OxAssistantSelectionBar as any)()
|
|
142
|
-
bar.count = 1
|
|
143
|
-
bar.actions = [{ id: 'delete', title: 'delete', action: () => {}, emphasis: { danger: true } }]
|
|
144
|
-
if (assistant !== undefined) bar.assistant = assistant
|
|
145
|
-
return templates(bar.render()).map(template => template.strings.join(''))
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
it('★ offers 「AI와 작업」 unless told not to - the lists that had it keep it', () => {
|
|
149
|
-
const drawn = drawnWith()
|
|
150
|
-
expect(drawn.some(template => template.includes('<form'))).toBe(true)
|
|
151
|
-
expect(drawn.some(template => template.includes('data-action='))).toBe(true)
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
it('★ assistant=false keeps the picked count and the list\'s own actions, without the request form', () => {
|
|
155
|
-
const drawn = drawnWith(false)
|
|
156
|
-
expect(drawn.some(template => template.includes('<form'))).toBe(false)
|
|
157
|
-
expect(drawn.some(template => template.includes('class="scope"'))).toBe(true)
|
|
158
|
-
expect(drawn.some(template => template.includes('data-action='))).toBe(true)
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
it('shows nothing while no row is picked, whatever assistant says', () => {
|
|
162
|
-
const bar = new (OxAssistantSelectionBar as any)()
|
|
163
|
-
bar.count = 0
|
|
164
|
-
bar.assistant = false
|
|
165
|
-
expect(templates(bar.render())).toEqual([])
|
|
166
|
-
})
|
|
167
|
-
})
|