@things-factory/ai-assistant 10.1.270 → 10.1.272
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/client/components/assistant-chat.ts +18 -6
- package/client/components/assistant-dock.ts +15 -1
- package/client/components/proposal-request.test.ts +12 -1
- package/client/setup-assistant-dock.ts +30 -15
- package/client/utils/addressed-draft.test.ts +31 -0
- package/client/utils/assistant-ask.ts +7 -0
- package/client/utils/assistant-request-context.ts +10 -0
- package/dist-client/components/assistant-chat.d.ts +6 -0
- package/dist-client/components/assistant-chat.js +23 -6
- package/dist-client/components/assistant-chat.js.map +1 -1
- package/dist-client/components/assistant-dock.js +15 -0
- package/dist-client/components/assistant-dock.js.map +1 -1
- package/dist-client/components/proposal-request.test.js +11 -1
- package/dist-client/components/proposal-request.test.js.map +1 -1
- package/dist-client/setup-assistant-dock.js +30 -15
- package/dist-client/setup-assistant-dock.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/addressed-draft.test.d.ts +1 -0
- package/dist-client/utils/addressed-draft.test.js +27 -0
- package/dist-client/utils/addressed-draft.test.js.map +1 -0
- package/dist-client/utils/assistant-ask.d.ts +10 -0
- package/dist-client/utils/assistant-ask.js.map +1 -1
- package/dist-client/utils/assistant-request-context.d.ts +12 -0
- package/dist-client/utils/assistant-request-context.js +11 -0
- package/dist-client/utils/assistant-request-context.js.map +1 -1
- package/dist-server/service/assistant-chat-resolver.js +5 -2
- package/dist-server/service/assistant-chat-resolver.js.map +1 -1
- package/dist-server/service/assistant-mode/index.d.ts +1 -0
- package/dist-server/service/assistant-mode/index.js +4 -1
- package/dist-server/service/assistant-mode/index.js.map +1 -1
- package/dist-server/service/assistant-mode/turn-lines.d.ts +12 -0
- package/dist-server/service/assistant-mode/turn-lines.js +38 -0
- package/dist-server/service/assistant-mode/turn-lines.js.map +1 -0
- package/dist-server/service/chat-message/index.d.ts +1 -0
- package/dist-server/service/chat-message/index.js +3 -1
- package/dist-server/service/chat-message/index.js.map +1 -1
- package/dist-server/service/chat-message/room-turn.d.ts +31 -0
- package/dist-server/service/chat-message/room-turn.js +30 -0
- package/dist-server/service/chat-message/room-turn.js.map +1 -0
- package/dist-server/service/chat-session-participant/invite-notification.d.ts +20 -4
- package/dist-server/service/chat-session-participant/invite-notification.js +17 -12
- package/dist-server/service/chat-session-participant/invite-notification.js.map +1 -1
- package/dist-server/service/chat-session-participant/mention-invite.d.ts +2 -0
- package/dist-server/service/chat-session-participant/mention-invite.js +5 -0
- package/dist-server/service/chat-session-participant/mention-invite.js.map +1 -1
- package/dist-server/service/chat-session-resolver.d.ts +5 -0
- package/dist-server/service/chat-session-resolver.js +56 -3
- package/dist-server/service/chat-session-resolver.js.map +1 -1
- package/dist-server/service/data-entry/entry-apply.d.ts +2 -0
- package/dist-server/service/data-entry/entry-apply.js +1 -1
- package/dist-server/service/data-entry/entry-apply.js.map +1 -1
- package/dist-server/service/data-entry/entry-resolver.js +2 -1
- package/dist-server/service/data-entry/entry-resolver.js.map +1 -1
- package/dist-server/service/data-entry/entry-target.d.ts +7 -2
- package/dist-server/service/data-entry/entry-target.js.map +1 -1
- package/dist-server/service/people/index.d.ts +2 -0
- package/dist-server/service/people/index.js +9 -1
- package/dist-server/service/people/index.js.map +1 -1
- package/dist-server/service/people/person-subject.d.ts +34 -0
- package/dist-server/service/people/person-subject.js +89 -0
- package/dist-server/service/people/person-subject.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/server/service/assistant-chat-resolver.ts +5 -2
- package/server/service/assistant-mode/index.ts +1 -0
- package/server/service/assistant-mode/open-subject-door.test.ts +7 -2
- package/server/service/assistant-mode/turn-lines.ts +43 -0
- package/server/service/chat-message/index.ts +1 -0
- package/server/service/chat-message/room-turn.ts +42 -0
- package/server/service/chat-session/group-room.test.ts +4 -4
- package/server/service/chat-session-participant/invite-notification.test.ts +12 -12
- package/server/service/chat-session-participant/invite-notification.ts +25 -11
- package/server/service/chat-session-participant/mention-invite.ts +5 -0
- package/server/service/chat-session-resolver.ts +50 -3
- package/server/service/data-entry/entry-apply.ts +3 -1
- package/server/service/data-entry/entry-resolver.ts +2 -1
- package/server/service/data-entry/entry-target.ts +5 -2
- package/server/service/people/index.ts +2 -0
- package/server/service/people/person-subject.test.ts +163 -0
- package/server/service/people/person-subject.ts +88 -0
- package/test/assistant-request-context.test.ts +1 -1
- package/test/open-doors.test.ts +3 -1
- package/translations/en.json +2 -0
- package/translations/es.json +2 -0
- package/translations/ja.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
|
@@ -638,6 +638,20 @@ let AssistantDock = class AssistantDock extends localize(i18next)(LitElement) {
|
|
|
638
638
|
const ask = takeAssistantAsk();
|
|
639
639
|
if (!ask)
|
|
640
640
|
return;
|
|
641
|
+
/*
|
|
642
|
+
* A request for one conversation - a to-do that came from it (ADR-0200 decision 3). It is listed on its subject's
|
|
643
|
+
* screen; until the dock stands there the request waits, and the conversation is opened when it does.
|
|
644
|
+
*/
|
|
645
|
+
if (ask.sessionId) {
|
|
646
|
+
if (!this.sessions.some(one => one.id === ask.sessionId))
|
|
647
|
+
await this.reloadSessions();
|
|
648
|
+
if (!this.controller.select(ask.sessionId))
|
|
649
|
+
return holdAssistantAsk(ask);
|
|
650
|
+
this.conversationView++;
|
|
651
|
+
this.asking = ask.ask || ask.draft || ask.to ? { ask: ask.ask, draft: ask.draft, to: ask.to, requestId: String(Date.now()) } : undefined;
|
|
652
|
+
settleAssistantAsk(ask, { sent: true });
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
641
655
|
if (!ask.continueCurrent && (ask.name || ask.context || ask.transcript?.length)) {
|
|
642
656
|
const id = await this.startCarried(ask).catch(() => {
|
|
643
657
|
notify({ level: 'error', message: t('carry-failed', 'The selected context could not be attached. Nothing was sent. Try again from the original screen.') });
|
|
@@ -950,6 +964,7 @@ let AssistantDock = class AssistantDock extends localize(i18next)(LitElement) {
|
|
|
950
964
|
.autoAsk=${this.asking?.ask}
|
|
951
965
|
.autoAskRequestId=${this.asking?.requestId}
|
|
952
966
|
.draft=${this.asking?.draft}
|
|
967
|
+
.draftTo=${this.asking?.to}
|
|
953
968
|
.draftRequestId=${this.asking?.requestId}
|
|
954
969
|
@assistant-proposal-execute=${this.onProposal}
|
|
955
970
|
@assistant-proposal-check=${this.onProposalCheck}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-dock.js","sourceRoot":"","sources":["../../client/components/assistant-dock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,gCAAgC,CAAA;AACvC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EAAE,0BAA0B,EAAsD,MAAM,0CAA0C,CAAA;A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,CAs5BzB","sourcesContent":["import { findMenu, foldForDock, unfoldAfterDock } from '../utils/menu-room.js'\nimport '@material/web/icon/icon.js'\nimport './assistant-chat.js'\nimport './assistant-session-toolbar.js'\nimport './assistant-session-manager.js'\n\nimport gql from 'graphql-tag'\nimport { LitElement, css, html, nothing, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { closeOverlay, notify, refreshEntity360 } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { AppController, navigate, store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport type { AssistantMode } from './assistant-mode.js'\nimport { AssistantSessionController, type AssistantSession, type AssistantSessionTarget } from '../utils/assistant-session-controller.js'\nimport { assistantSessionTransport } from '../utils/assistant-session-transport.js'\nimport { readAiCapability } from '../utils/assistant-capability-read.js'\nimport type { AiCapability } from '../utils/assistant-capability.js'\nimport { setOpenSession, subscribeSessionActivity } from '../utils/assistant-activity.js'\nimport {\n assistantHomeSurface,\n currentAssistantSurface,\n isAnchor,\n subscribeAssistantSurface,\n type AnchorResult,\n type AssistantSurface\n} from '../utils/assistant-surface.js'\nimport { runProposal, setEntryProposalHandler, type ProposalContext, type ProposalOutcome } from '../utils/assistant-proposals.js'\nimport { refreshAppliedScreens, type AppliedScreensDeps } from '../utils/applied-screens.js'\n/* The invite card's handler - ai-assistant's own tool, registered by its own module (design/ai/shared-dock.md §4). */\nimport '../utils/invite-proposal-register.js'\nimport { entryProposalHandler, type EntryApplyAnswer } from '../utils/entry-proposal.js'\nimport { holdAssistantAsk, peekAssistantAsk, settleAssistantAsk, subscribeAssistantAsk, takeAssistantAsk, type AssistantAsk } from '../utils/assistant-ask.js'\nimport { selectionNote } from '../utils/assistant-selection.js'\nimport { surfaceTransition } from '../utils/assistant-navigation.js'\n\nexport const ASSISTANT_DOCK_VIEWPART = 'assistant-dock'\n\nconst t = (key: string, defaultValue: string, options: Record<string, unknown> = {}) =>\n i18next.t(`ai-assistant.dock.${key}`, { defaultValue, ...options })\n\n/* Pressing a data entry card asks the server to enter the rows it stored - the screen sends none (design/ai/data-entry.md §4). */\nsetEntryProposalHandler(\n entryProposalHandler(\n async (sessionId, proposalKey, reviewedHash) => {\n const result = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $key: String!, $reviewed: String) {\n applyEntryProposal(sessionId: $id, proposalKey: $key, reviewedHash: $reviewed)\n }\n `,\n variables: { id: sessionId, key: proposalKey, reviewed: reviewedHash ?? null }\n })\n if (result.errors?.length) throw new Error(result.errors[0].message)\n return result.data?.applyEntryProposal as EntryApplyAnswer\n },\n (key, options) => String(i18next.t(key, options))\n )\n)\n\n/* The page on screen and the shown 360 - what an applied card's records may be shown on. */\nconst APPLIED_SCREENS: AppliedScreensDeps = {\n page: () => {\n const route = (store.getState() as any)?.route ?? {}\n return { name: route.page, element: route.activePage }\n },\n refresh360: refreshEntity360\n}\n\nconst MODE_QUERY = gql`\n query ($subject: String!) {\n assistantModeFor(subject: $subject) {\n kind\n label\n }\n }\n`\n\n/** The one conversation for what the screen shows (design/ai/screen-pattern.md §3). */\nasync function modeFor(subject: string): Promise<{ kind: string; label?: string } | null> {\n const response = await client.query({ query: MODE_QUERY, variables: { subject }, fetchPolicy: 'network-only' })\n if (response.errors?.length) throw new Error(response.errors[0].message)\n return response.data?.assistantModeFor ?? null\n}\n\n/**\n * The AI dock - the same in every operato application (design/ai/shared-dock.md).\n *\n * ── What is here and what is not ────────────────────────────────────────────────\n * here where it stands, whether an AI answers, which surface and anchor, which conversation (mode),\n * sessions and their management, unread, proposals and their outcome, asks from other screens\n * the app what its screens show (surfaces, assistant-surface.ts), how its proposal kinds apply\n * (assistant-proposals.ts), and on the server its modes and tools\n *\n * Nothing in this file names an application or a proposal kind. A behaviour one app needs and another does\n * not is a surface field or a handler, never a branch here.\n */\n@customElement('ox-assistant-dock')\nexport class AssistantDock extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n width: 420px;\n max-width: 100vw;\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n background: var(--md-sys-color-surface-container-lowest);\n border-left: 1px solid var(--md-sys-color-outline-variant);\n color: var(--md-sys-color-on-surface);\n font-size: 13px;\n }\n\n /*\n * The dock opens in one place on every screen and takes its room beside the page, so it covers no page's controls\n * and no screen needs its own exception (2026-10-12). Only a screen too narrow to share floats it over the page.\n * The DOM stays - the chat does not reconnect.\n */\n @media (max-width: 1023.98px) {\n :host {\n position: fixed;\n inset: 0 0 0 auto;\n height: 100vh;\n height: 100dvh;\n z-index: 10;\n box-shadow: var(--md-sys-elevation-shadow-3, -4px 0 16px rgb(0 0 0 / 20%));\n }\n }\n\n @media (max-width: 599.98px) {\n :host {\n width: 100vw;\n }\n }\n\n .scope {\n display: flex;\n align-items: center;\n gap: 6px;\n min-height: 40px;\n padding: 5px 8px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n\n .scope > md-icon {\n --md-icon-size: 18px;\n flex: none;\n color: var(--md-sys-color-primary);\n }\n\n .what {\n display: grid;\n flex: 1;\n min-width: 0;\n font-size: 12px;\n font-weight: 650;\n line-height: 1.25;\n }\n\n .what span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .detail {\n color: var(--md-sys-color-on-surface-variant);\n font-size: 10.5px;\n font-weight: 400;\n }\n\n .sbtn {\n display: inline-flex;\n align-items: center;\n flex: none;\n padding: 4px;\n border: none;\n border-radius: 8px;\n background: none;\n color: var(--md-sys-color-on-surface-variant);\n cursor: pointer;\n }\n\n .sbtn:hover {\n background: var(--md-sys-color-surface-container-high);\n color: var(--md-sys-color-on-surface);\n }\n\n .sbtn md-icon {\n --md-icon-size: 18px;\n }\n\n /*\n * An open conversation is read by everyone in the domain - the dock says so on every screen of it, not\n * only in the list (2026-09-30: open and private were one grey word apart, and an owner's question about\n * the books sat in every employee's list). A private one draws nothing extra: it is the default.\n */\n /*\n * One warning colour in every application (2026-09-30, product owner): the theme's tertiary was a pale\n * lavender in figure and something else in each app, so \"everyone reads this\" was as loud as the theme\n * happened to be. Amber with near-black ink reads on light and dark themes alike - ink on amber 8.2:1, the edge 3.3:1 on white and 5.1:1 on a dark surface.\n */\n :host {\n --assistant-open-edge: #c47f00;\n --assistant-open-surface: #f2b01e;\n --assistant-open-ink: #2e2100;\n }\n\n :host([audience='open']) {\n border-left: 4px solid var(--assistant-open-edge);\n }\n\n .audience {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: none;\n padding: 6px 10px;\n background: var(--assistant-open-surface);\n color: var(--assistant-open-ink);\n border-bottom: 1px solid var(--assistant-open-edge);\n font-size: 12px;\n font-weight: 600;\n line-height: 1.35;\n }\n\n .audience md-icon {\n --md-icon-size: 16px;\n flex: none;\n }\n\n ox-assistant-session-toolbar {\n flex: none;\n min-width: 0;\n padding: 3px 8px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n --border-color: var(--md-sys-color-outline-variant);\n --main-section-background-color: var(--md-sys-color-surface-container);\n --primary-color: var(--md-sys-color-primary);\n font: inherit;\n font-size: 12px;\n }\n\n ox-assistant-chat,\n ox-assistant-session-manager {\n flex: 1;\n min-height: 0;\n }\n\n /* No conversation could stand - say what stopped it, never an empty panel. */\n .stuck {\n margin: auto;\n padding: 20px;\n text-align: center;\n line-height: 1.7;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .stuck .sbtn {\n margin-top: 6px;\n gap: 4px;\n font: inherit;\n }\n\n .next-step {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-low);\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n line-height: 1.4;\n }\n\n .next-step a {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n flex: none;\n color: var(--md-sys-color-primary);\n font-weight: 650;\n text-decoration: none;\n }\n\n .next-step a:hover { text-decoration: underline; }\n .next-step md-icon { --md-icon-size: 16px; }\n ox-assistant-chat[hidden] { display: none; }\n `\n ]\n\n /** The viewpart this dock lives in - for closing it. */\n @property({ type: String }) viewpart = ASSISTANT_DOCK_VIEWPART\n\n @state() private capability: AiCapability = 'unknown'\n @state() private asked = false\n @state() private surface?: AssistantSurface\n @state() private anchor?: AnchorResult\n @state() private kind = ''\n /** kind → its label, for the manager's rows. */\n @state() private sessions: AssistantSession[] = []\n @state() private sessionId = ''\n @state() private loading = false\n @state() private failure = ''\n @state() private showingHistory = false\n @state() private conversationView = 0\n @state() private asking?: { ask?: string; draft?: string; requestId: string }\n private openedIdentity = ''\n\n private app = new AppController(this)\n private revision = 0\n /** What the conversation was opened for - a send is refused when the screen moved on. */\n private openedFor = ''\n private unsubscribers: (() => void)[] = []\n private controller = new AssistantSessionController(\n assistantSessionTransport,\n next => {\n if (next.sessionId !== this.sessionId) {\n setOpenSession(next.sessionId)\n this.surface?.sessionChanged?.(next.sessionId)\n }\n this.sessions = next.sessions\n this.sessionId = next.sessionId\n this.loading = next.loading\n this.failure = next.error\n },\n { getItem: key => sessionStorage.getItem(key), setItem: (key, value) => sessionStorage.setItem(key, value) },\n { lazy: true }\n )\n\n private onStartNewSession = () => void this.newConversation()\n\n\n /* A card asks for a page of this application - the AI 작업 패널. The dock stays open beside it. */\n private onOpenPage = (event: CustomEvent) => {\n const href = event.detail?.href\n if (typeof href === 'string' && href) navigate(href)\n }\n\n /** Who reads the open conversation - absent until the list or the create answer says. */\n private get audience(): string | undefined {\n return this.sessions.find(session => session.id === this.sessionId)?.visibility || undefined\n }\n\n protected updated(changed: Map<PropertyKey, unknown>) {\n super.updated?.(changed as any)\n const audience = !this.showingHistory && this.audience === 'open' ? 'open' : null\n if (audience) this.setAttribute('audience', audience)\n else this.removeAttribute('audience')\n }\n\n /* Whether the left menu was folded by this dock's opening - only then does closing open it again. */\n private menuFoldedByDock = false\n\n connectedCallback() {\n super.connectedCallback()\n this.menuFoldedByDock = foldForDock(findMenu())\n if (this.menuFoldedByDock) window.dispatchEvent(new Event('resize'))\n this.addEventListener('assistant-start-new-session', this.onStartNewSession)\n this.addEventListener('assistant-open-page', this.onOpenPage as EventListener)\n this.unsubscribers.push(\n subscribeAssistantSurface(() => this.follow()),\n store.subscribe(() => { if (this.openedIdentity !== this.identityKey()) this.follow() }),\n subscribeAssistantAsk(() => void this.takeAsk()),\n subscribeSessionActivity(activity => {\n /* A rename or a new conversation elsewhere on this anchor - the tabs read again. */\n if (activity.kind === 'meta' && isAnchor(this.anchor) && activity.anchorId === this.anchor.anchorId) void this.reloadSessions()\n })\n )\n if (!this.openedIdentity) return this.follow(true)\n /*\n * The same dock opened again - the aside bar takes it out while it is closed. The conversation and what was\n * being written in it are still here; only what moved while it was closed (the screen, the person) is followed.\n */\n setOpenSession(this.sessionId)\n this.follow()\n }\n\n /* Closing keeps the conversation: the dock comes back as it was left (design/ai/shared-dock.md §2-1, §2-7). */\n disconnectedCallback() {\n unfoldAfterDock(findMenu(), this.menuFoldedByDock)\n if (this.menuFoldedByDock) window.dispatchEvent(new Event('resize'))\n this.menuFoldedByDock = false\n this.removeEventListener('assistant-start-new-session', this.onStartNewSession)\n this.removeEventListener('assistant-open-page', this.onOpenPage as EventListener)\n this.unsubscribers.splice(0).forEach(unsubscribe => unsubscribe())\n clearTimeout(this.takeTimer)\n setOpenSession('')\n super.disconnectedCallback()\n }\n\n private scopeKey(surface: AssistantSurface | undefined) {\n return JSON.stringify([this.app.contextPath, surface?.key ?? ''])\n }\n\n private identityKey() {\n const user = (store.getState() as any).auth?.user\n return JSON.stringify([this.app.contextPath, user?.id || user?.email || ''])\n }\n\n private get navigationState() {\n return (this.renderRoot.querySelector('ox-assistant-chat') as any)?.navigationState ?? { busy: false, draft: false }\n }\n\n private async mayLeaveConversation(): Promise<boolean> {\n if (this.navigationState.busy) {\n notify({ level: 'info', message: t('wait-before-switch', 'Wait for the current response before changing conversations.') })\n return false\n }\n if (!this.navigationState.draft) return true\n const identity = this.identityKey()\n const accepted = await OxPrompt.open({\n type: 'warning', title: t('switch-title', 'Change conversation?'),\n text: t('switch-draft', 'Your unsent text and attachments will not move to the other conversation.'),\n confirmButton: { text: t('switch-confirm', 'Discard draft and switch') },\n cancelButton: { text: t('stay', 'Keep writing') }\n })\n return !!accepted && identity === this.identityKey()\n }\n\n private async requestSurface(surface: AssistantSurface | undefined) {\n if (!(await this.mayLeaveConversation())) return\n this.surface = surface\n await this.open()\n }\n\n /** The screen changed - a different surface or domain is a different conversation. */\n private follow(force = false) {\n const next = currentAssistantSurface()\n const transition = surfaceTransition({\n identityChanged: this.openedIdentity !== this.identityKey(),\n sameSubject: this.scopeKey(next) === this.openedFor,\n busy: this.navigationState.busy\n })\n if (!force && transition === 'refresh') {\n this.surface = next\n this.requestUpdate()\n return\n }\n if (!force && transition === 'wait') {\n /* The answer lands in the conversation it was asked in; then the dock follows the page. */\n this.followWhenIdle()\n return\n }\n if (transition !== 'reset') this.keepDraft()\n if (transition === 'reset') {\n this.asking = undefined\n this.capability = 'unknown'\n if (this.openedIdentity) {\n const dropped = takeAssistantAsk()\n /* Another account or domain - the request was not this one's to send; the screen is told. */\n if (dropped) settleAssistantAsk(dropped, { sent: false, reason: 'identity-changed' })\n }\n }\n this.surface = next\n void this.open()\n }\n\n private followTimer?: ReturnType<typeof setTimeout>\n\n private followWhenIdle() {\n clearTimeout(this.followTimer)\n this.followTimer = setTimeout(() => (this.navigationState.busy ? this.followWhenIdle() : this.follow()), 300)\n }\n\n /* What was being written, per subject - it goes back to its conversation when the page returns there. */\n private drafts = new Map<string, unknown>()\n\n private keepDraft() {\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n const draft = this.openedFor ? chat?.takeDraft?.() : undefined\n if (draft) this.drafts.set(this.openedFor!, draft)\n }\n\n private async restoreDraft() {\n const draft = this.openedFor ? this.drafts.get(this.openedFor) : undefined\n if (!draft) return\n await this.updateComplete\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n if (!chat?.restoreDraft) return\n this.drafts.delete(this.openedFor!)\n chat.restoreDraft(draft)\n }\n\n private async open(): Promise<void> {\n this.openedIdentity = this.identityKey()\n const ticket = ++this.revision\n this.conversationView++\n this.showingHistory = false\n void this.controller.open(undefined)\n this.loading = true\n this.failure = ''\n this.anchor = undefined\n this.openedFor = this.scopeKey(this.surface)\n\n try {\n if (this.capability !== 'configured') {\n this.capability = await readAiCapability()\n this.asked = true\n }\n if (ticket !== this.revision || this.capability !== 'configured') return\n\n const surface = this.surface\n if (!surface) return\n\n const anchor = await surface.anchor()\n if (ticket !== this.revision) return\n this.anchor = anchor\n if (!isAnchor(anchor)) return\n\n const mode = await modeFor(surface.subject)\n if (ticket !== this.revision) return\n this.kind = mode?.kind ?? ''\n if (!this.kind) {\n this.anchor = { stuck: 'no-conversation', message: t('no-conversation', 'there is no conversation for this screen.') }\n return\n }\n\n const user = (store.getState() as any).auth?.user\n const userId = user?.id || user?.email\n if (!userId) throw new Error(t('no-user', 'your sign-in could not be read. sign in again.'))\n\n await this.controller.open(this.target(userId, anchor))\n } catch (error) {\n if (ticket === this.revision) this.failure = (error as Error).message\n } finally {\n if (ticket === this.revision) {\n this.loading = false\n /*\n * The ask waiting is taken once the opening is done - takeAsk passes while loading, so taking it inside the\n * opening left it waiting for good: a card's 「AI로 고치기」 reopened this screen's conversation and was never sent\n * (2026-10-25). With no conversation possible here, it is answered now, not sent later somewhere else.\n */\n if (this.anchor) void this.takeAsk()\n /* What was being written on this subject before the page moved away comes back here. */\n void this.restoreDraft()\n }\n }\n }\n\n private target(userId: string, anchor: { anchorType: string; anchorId: string }): AssistantSessionTarget {\n /* The conversation kind is part of the key: two conversations on one anchor never share a session (ADR-0072 decision 3). */\n return { scope: JSON.stringify([this.app.contextPath, userId, this.kind]), anchorType: anchor.anchorType, anchorId: anchor.anchorId, kind: this.kind }\n }\n\n private async reloadSessions() {\n const target = this.controller.state.target\n if (target) await this.controller.open(target, true)\n }\n\n private async newConversation() {\n if (this.loading || !isAnchor(this.anchor)) return\n if (!(await this.mayLeaveConversation())) return\n this.showingHistory = false\n const revision = this.controller.state.revision\n await this.controller.reset()\n if (revision !== this.controller.state.revision) this.conversationView++\n }\n\n private async selectSession(id: string) {\n if (id !== this.sessionId && !(await this.mayLeaveConversation())) return\n this.showingHistory = false\n const previous = this.sessionId\n if (this.controller.select(id) && previous !== id) this.conversationView++\n }\n\n /* ── asks from other screens ────────────────────────────────────────────────────── */\n\n private async takeAsk() {\n if (this.loading || !this.anchor) return\n /* A request made on the screen with what was picked there (「AI와 작업」) has rules of its own (§2-11-1). */\n if (peekAssistantAsk()?.selection) return this.takeScreenRequest()\n /*\n * A request the person made on this screen is never dropped for what the dock is doing (2026-10-24: 「AI와 작업」\n * pressed again was thrown away because the input still held the first press's draft). An answer being written\n * finishes first, then the request is taken. Unsent words are asked about - the person keeps writing or lets them go.\n */\n if (this.navigationState.busy) {\n this.takeWhenIdle()\n return\n }\n if (this.navigationState.draft && !(await this.mayLeaveConversation())) {\n const waiting = takeAssistantAsk()\n if (waiting) notify({ level: 'info', message: t('ask-kept-current', 'The current conversation was kept. Switch to the intended subject before asking again.') })\n return\n }\n if (!isAnchor(this.anchor)) {\n /*\n A question is not sent later on its own, once some conversation happens to stand - by then the person is looking\n at something else. It is said now why it was not sent. A draft only fills the input, so it waits.\n */\n const waiting = takeAssistantAsk()\n if (!waiting) return\n if (waiting.ask) notify({ level: 'info', message: `${t('ask-needs-conversation', 'the question was not sent.')} ${this.anchor.message}` })\n else holdAssistantAsk(waiting)\n return\n }\n const ask: AssistantAsk | undefined = takeAssistantAsk()\n if (!ask) return\n\n if (!ask.continueCurrent && (ask.name || ask.context || ask.transcript?.length)) {\n const id = await this.startCarried(ask).catch(() => {\n notify({ level: 'error', message: t('carry-failed', 'The selected context could not be attached. Nothing was sent. Try again from the original screen.') })\n return undefined\n })\n // Never send a context-dependent request into the previous conversation after a failed handoff.\n if (!id) return\n if (id) {\n await this.reloadSessions()\n this.controller.select(id)\n }\n } else if (!ask.continueCurrent) {\n await this.newConversation()\n }\n this.conversationView++\n this.asking = { ask: ask.ask, draft: ask.draft, requestId: String(Date.now()) }\n }\n\n private takeTimer?: ReturnType<typeof setTimeout>\n\n /**\n * This person's own conversation on this screen - the most recent they sit in; none, a new one made on sending. What\n * they were writing comes along.\n */\n private async goToOwnConversation() {\n const kept = (this.renderRoot.querySelector('ox-assistant-chat') as any)?.takeDraft?.()\n const own = this.sessions.find(one => one.participant !== false && one.id !== this.sessionId)\n const revision = this.controller.state.revision\n if (own) {\n if (this.controller.select(own.id)) this.conversationView++\n } else {\n await this.controller.reset()\n if (revision !== this.controller.state.revision) this.conversationView++\n }\n await this.updateComplete\n if (kept) (this.renderRoot.querySelector('ox-assistant-chat') as any)?.restoreDraft?.(kept)\n }\n\n /*\n * ── A screen request (「AI와 작업」) - design/ai/shared-dock.md §2-11-1 ─────────────────────────────────────────\n * The user (2026-10-24): 「\"AI와 작업\" 기능이 unstable 하다. 작동 방식을 신뢰할 수 있도록 새로운 세션을 여는지, 기존 세션을\n * 활용하는지 등등을 명확하게 하라.」 One way, every time:\n * 1. this screen's conversation - the one the dock opens for this screen; none yet, one is made on sending. The dock\n * showing another screen's conversation, or its list, comes back here. Never a new conversation per press.\n * 2. the selection at the press is noted for that turn - a line the person reads, the ids for the model; a later\n * press's note replaces it (SELECTION_RULE).\n * 3. the request is sent, always - never left as a draft.\n * 4. what the person was writing in the box is set aside while the request goes, and put back.\n * 5. not sent: said in a notice, and the screen is told so it keeps the request on its bar.\n * 6. an answer being written: said, and the request goes right after it - never dropped.\n */\n private waitingNoticeFor?: AssistantAsk\n\n private async takeScreenRequest() {\n const waiting = peekAssistantAsk()\n if (!waiting?.selection) return\n if (this.navigationState.busy) {\n if (this.waitingNoticeFor !== waiting) {\n this.waitingNoticeFor = waiting\n notify({ level: 'info', message: t('screen-request-waits', 'An answer is being written - your request goes right after it.') })\n }\n this.takeWhenIdle()\n return\n }\n const here = currentAssistantSurface()\n if (this.scopeKey(here) !== this.openedFor || this.openedIdentity !== this.identityKey()) {\n /* Another screen's conversation is open - back to this screen's; open() takes the request again when it stands. */\n this.keepDraft()\n this.surface = here\n await this.open()\n return\n }\n const ask = takeAssistantAsk()!\n this.waitingNoticeFor = undefined\n const fail = (reason: string) => {\n notify({ level: 'error', message: reason })\n settleAssistantAsk(ask, { sent: false, reason })\n }\n if (!isAnchor(this.anchor)) return fail(this.anchor?.message || t('no-conversation', 'there is no conversation for this screen.'))\n this.showingHistory = false\n /*\n * The dock opens the first conversation it can read when this person has none here yet - someone else's open one,\n * found 2026-10-24: the request went into Admin's public 「회사가치를 제시해보라」. A screen request is the person's own\n * work: a conversation they do not sit in is not this screen's conversation for them. Their own on this screen is\n * used - the most recent one; none yet, one is started (made on sending).\n */\n if (this.sessions.find(one => one.id === this.sessionId)?.participant === false) await this.goToOwnConversation()\n await this.updateComplete\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n if (!chat?.sendScreenRequest) return fail(t('screen-request-not-ready', 'The conversation is not ready yet. Try again in a moment.'))\n const request = ask.ask?.trim() || t('screen-request-default', 'Read the selected records and suggest what can be done with them now.')\n const outcome = await chat.sendScreenRequest(request, selectionNote(ask.selection!, t))\n if (!outcome?.sent) return fail(outcome?.reason || t('screen-request-failed', 'The request was not sent. Try again.'))\n settleAssistantAsk(ask, { sent: true })\n }\n\n /** The request waits (it is still pending) while an answer is written, then is taken. */\n private takeWhenIdle() {\n clearTimeout(this.takeTimer)\n this.takeTimer = setTimeout(() => (this.navigationState.busy ? this.takeWhenIdle() : void this.takeAsk()), 300)\n }\n\n /** A new conversation carrying what the other screen had - its name, a note, earlier turns. */\n private async startCarried(ask: AssistantAsk): Promise<string | undefined> {\n const anchor = this.anchor as { anchorType: string; anchorId: string }\n const created = await client.mutate({\n mutation: gql`\n mutation ($t: String!, $i: String!, $n: String) {\n createAISession(anchorType: $t, anchorId: $i, name: $n) {\n id\n }\n }\n `,\n variables: { t: anchor.anchorType, i: anchor.anchorId, n: ask.name || null }\n })\n if (created.errors?.length) throw new Error(created.errors[0].message)\n const id = created.data?.createAISession?.id\n if (!id) throw new Error('Session was not created')\n if (ask.context) {\n const attached = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $c: String!) {\n appendSessionNote(sessionId: $id, content: $c)\n }\n `,\n variables: { id, c: ask.context }\n })\n if (attached.errors?.length) throw new Error(attached.errors[0].message)\n }\n if (ask.transcript?.length) {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $turns: JSON!) {\n appendSessionTurns(sessionId: $id, turns: $turns)\n }\n `,\n variables: { id, turns: ask.transcript.map(turn => ({ role: turn.role === 'ai' ? 'assistant' : 'user', content: turn.content })) }\n })\n }\n return id\n }\n\n /* ── proposals ───────────────────────────────────────────────────────────────────── */\n\n private proposalContext(sessionId?: string): ProposalContext {\n const identity = this.identityKey()\n const scope = this.openedFor\n return {\n sessionId,\n surface: this.surface,\n confirm: async ({ title, text, confirmText, cancelText, type }) =>\n !!(await OxPrompt.open({\n type: type ?? 'warning',\n title,\n text,\n confirmButton: { text: confirmText ?? t('confirm', 'OK') },\n cancelButton: { text: cancelText ?? t('cancel', 'Cancel') }\n })) && identity === this.identityKey() && scope === this.scopeKey(currentAssistantSurface()),\n notify: (level, message) => notify({ level, message })\n }\n }\n\n private async report(sessionId: string | undefined, proposalKey: string | undefined, outcome: ProposalOutcome) {\n if (!sessionId || !proposalKey) return\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $key: String!, $outcome: JSON!) {\n reportProposalOutcome(sessionId: $id, proposalKey: $key, outcome: $outcome)\n }\n `,\n variables: { id: sessionId, key: proposalKey, outcome }\n })\n } catch {\n /* the card then says it heard nothing - never \"done\" */\n }\n }\n\n /** Every proposal ends in exactly one reported outcome - a kind nobody handles is `unavailable`. */\n private onProposal = async (event: CustomEvent) => {\n const { proposal, sessionId, proposalKey } = event.detail ?? {}\n const outcome: ProposalOutcome = this.openedFor !== this.scopeKey(currentAssistantSurface()) || this.openedIdentity !== this.identityKey()\n ? { verdict: 'unavailable', errorCode: 'conversation-screen-changed', note: t('return-to-subject', 'Return to the conversation subject before applying this proposal.') }\n : await runProposal(proposal, this.proposalContext(sessionId))\n if (outcome.verdict === 'unavailable' && outcome.errorCode === 'unknown-proposal-kind') {\n notify({ level: 'error', message: t('proposal-not-runnable', 'this proposal cannot be run on this screen.') })\n }\n const { records, ...reported } = outcome\n await this.report(sessionId, proposalKey, reported)\n /* What the handler did, in the person's words, stays in the conversation - what was created, why it did not run. */\n if (outcome.note && sessionId) await this.appendNote(sessionId, outcome.note)\n /* The list or 360 behind the dock shows what went in, without the person refreshing it. */\n if (outcome.verdict === 'accepted' && (outcome.applied ?? 1) > 0)\n void refreshAppliedScreens(proposal, records, APPLIED_SCREENS).then(kept => {\n if (kept) notify({ level: 'info', message: t('screen-kept-edits', 'the list was not read again - it has unsaved edits. save them, then refresh it to see what went in.') })\n })\n }\n\n /**\n * \"Check result\" - asks the surface what became of a requested proposal and reports only what it learns.\n * Nothing is run: a lost answer never turns into a second application (ADR-0097 Q-D4 ④).\n */\n private onProposalCheck = async (event: CustomEvent) => {\n const { proposal, sessionId, proposalKey } = event.detail ?? {}\n const ask = this.surface?.proposalOutcome\n if (!ask) {\n notify({ level: 'info', message: t('proposal-result-uncheckable', 'this screen cannot check that result. open the screen where it was applied.') })\n return\n }\n\n let outcome: ProposalOutcome | undefined\n try {\n outcome = await ask.call(this.surface, proposalKey, proposal)\n } catch {\n outcome = undefined\n }\n if (!outcome?.verdict) {\n notify({ level: 'info', message: t('proposal-result-unknown', 'the result is still unknown. it was not applied again.') })\n return\n }\n\n await this.report(sessionId, proposalKey, outcome)\n if (outcome.note && sessionId) await this.appendNote(sessionId, outcome.note)\n }\n\n private async appendNote(sessionId: string, note: string) {\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $c: String!) {\n appendSessionNote(sessionId: $id, content: $c)\n }\n `,\n variables: { id: sessionId, c: note }\n })\n } catch {\n /* the outcome is already reported; a lost note is not a lost outcome */\n }\n }\n\n /* ── board surfaces: the chat's scene edits land on the open board ───────────────── */\n\n private onScenePatch = async (event: CustomEvent) => {\n if (!this.mayApplyOnScreen()) return\n const board = this.surface?.board\n if (!board) return\n const result = await board.applyPatch(event.detail)\n if (result?.missed) notify({ level: 'info', message: t('patch-missed', '{missed} of the changes could not be applied.', { missed: result.missed }) })\n }\n\n private mayApplyOnScreen() {\n if (this.openedFor === this.scopeKey(currentAssistantSurface()) && this.openedIdentity === this.identityKey()) return true\n notify({ level: 'info', message: t('return-to-subject', 'Return to the conversation subject before applying this proposal.') })\n return false\n }\n\n private onBoardRevert = (event: CustomEvent) => { if (this.mayApplyOnScreen()) void this.surface?.board?.revertPatch?.(event.detail?.patchId) }\n\n private onSceneAction = (event: CustomEvent) => { if (this.mayApplyOnScreen()) void this.surface?.board?.applyAction?.(event.detail) }\n\n /* ── drawing ─────────────────────────────────────────────────────────────────────── */\n\n private stuckLine(): string {\n if (this.capability === 'not-configured') return t('not-configured', 'no AI is set up for this site. an administrator can set one up in the AI settings.')\n if (this.capability === 'unknown' && this.asked && !this.loading && !this.failure) return t('capability-unknown', 'whether AI is set up here could not be read.')\n if (this.capability === 'configured' && !this.surface && !this.loading) return t('no-surface', 'this screen has no conversation.')\n const anchor = this.anchor\n if (anchor && !isAnchor(anchor)) return anchor.message\n return ''\n }\n\n private header(): TemplateResult {\n const surface = this.surface\n const home = assistantHomeSurface()\n const ready = this.capability === 'configured' && isAnchor(this.anchor)\n return html`\n <div class=\"scope\">\n <md-icon>${surface?.icon || 'forum'}</md-icon>\n <span class=\"what\">\n <span>${surface?.label() || t('title', 'Assistant')}</span>\n ${surface?.detail ? html`<span class=\"detail\">${surface.detail()}</span>` : nothing}\n </span>\n ${home && surface && home !== surface\n ? html`<button class=\"sbtn\" title=${t('to-home', \"back to this application's conversation\")} @click=${() => this.useSurface(home)}>\n <md-icon>home</md-icon>\n </button>`\n : nothing}\n ${ready && this.showingHistory\n ? html`<button\n class=\"sbtn\"\n title=${this.showingHistory ? t('back-to-conversation', 'back to the conversation') : t('conversations', 'conversations')}\n @click=${() => (this.showingHistory = !this.showingHistory)}\n >\n <md-icon>arrow_back</md-icon>${t('back-to-conversation', 'back to the conversation')}\n </button>`\n : nothing}\n <button class=\"sbtn\" title=${t('rebind', 'follow this screen again')} @click=${() => this.requestSurface(currentAssistantSurface())}>\n <md-icon>refresh</md-icon>\n </button>\n <button class=\"sbtn\" title=${t('close', 'close')} @click=${() => closeOverlay(this.viewpart)}>\n <md-icon>close</md-icon>\n </button>\n </div>\n `\n }\n\n /** The home button: talk about the application instead of this screen, until the screen changes. */\n private useSurface(surface: AssistantSurface) {\n void this.requestSurface(surface)\n }\n\n render(): TemplateResult {\n const anchor = this.anchor\n const ready = this.capability === 'configured' && isAnchor(anchor)\n const stuck = this.stuckLine()\n const surface = this.surface\n const openedFor = this.openedFor\n const board = surface?.board\n\n const mode: AssistantMode | undefined = ready ? { kind: this.kind, target: (anchor as any).anchorId, hostContext: {} } : undefined\n\n return html`\n ${this.header()}\n ${surface?.nextStep ? html`<div class=\"next-step\" role=\"status\">\n <span>${surface.nextStep.description?.() || ''}</span>\n <a href=${surface.nextStep.href}>${surface.nextStep.label()}<md-icon>arrow_forward</md-icon></a>\n </div>` : nothing}\n\n ${ready && this.showingHistory\n ? html`<ox-assistant-session-manager\n .anchorType=${(anchor as any).anchorType}\n .anchorId=${(anchor as any).anchorId}\n .sessionId=${this.sessionId}\n .kind=${this.kind}\n @assistant-session-select=${(event: CustomEvent) => this.selectSession(event.detail.sessionId)}\n @assistant-session-reset=${() => this.newConversation()}\n @assistant-session-changed=${() => this.reloadSessions()}\n ></ox-assistant-session-manager>`\n : nothing}\n ${ready && !this.showingHistory\n ? html`<ox-assistant-session-toolbar\n .sessions=${this.sessions}\n .sessionId=${this.sessionId}\n .loading=${this.loading}\n .error=${this.failure}\n historyEnabled\n singleConversation\n @assistant-session-select=${(event: CustomEvent) => this.selectSession(event.detail.sessionId)}\n @assistant-session-reset=${() => this.newConversation()}\n @assistant-session-history=${() => (this.showingHistory = true)}\n @assistant-session-retry=${() => this.open()}\n ></ox-assistant-session-toolbar>`\n : nothing}\n ${ready && !this.showingHistory && this.audience === 'open'\n ? html`<div class=\"audience\" role=\"status\">\n <md-icon>public</md-icon>\n <span>${t('audience-open-band', 'Public conversation - everyone in this domain can read and write here.')}</span>\n </div>`\n : nothing}\n ${ready && !this.loading && !this.failure\n ? keyed(\n this.conversationView,\n html`<ox-assistant-chat\n ?hidden=${this.showingHistory}\n .sessionId=${this.sessionId}\n .visibility=${this.audience}\n .prepareSession=${(adopt: (id: string) => void) => this.controller.prepareSession(adopt)}\n .contextProvider=${() => {\n /* The screen moved on between writing and sending - do not answer about the old one. */\n if (openedFor !== this.scopeKey(currentAssistantSurface()) || this.openedIdentity !== this.identityKey()) throw new Error(t('return-to-subject', 'Return to the conversation subject before applying this proposal.'))\n return { hostContext: surface?.hostContext?.() ?? {} }\n }}\n .mode=${mode}\n .subject=${surface?.subject}\n .chatEndpoint=${board?.chatEndpoint ?? 'assistantChat'}\n ?board-tools=${!!board}\n .currentBoard=${board?.currentBoard?.()}\n .boardProvider=${board?.boardProvider}\n .selectedRefids=${board?.selectedRefids?.() ?? []}\n .knownTypes=${board?.knownTypes?.()}\n .categories=${board?.categories?.()}\n .componentSchemas=${board?.componentSchemas?.()}\n .searchProvider=${board?.searchProvider}\n .autoAsk=${this.asking?.ask}\n .autoAskRequestId=${this.asking?.requestId}\n .draft=${this.asking?.draft}\n .draftRequestId=${this.asking?.requestId}\n @assistant-proposal-execute=${this.onProposal}\n @assistant-proposal-check=${this.onProposalCheck}\n @scene-edit-patch=${this.onScenePatch}\n @board-edit-revert=${this.onBoardRevert}\n @scene-action-execute=${this.onSceneAction}\n ></ox-assistant-chat>`\n )\n : nothing}\n ${stuck\n ? html`<div class=\"stuck\">\n ${stuck}\n ${this.capability === 'unknown'\n ? html`<div><button class=\"sbtn\" @click=${() => this.open()}><md-icon>refresh</md-icon>${t('retry', 'try again')}</button></div>`\n : nothing}\n </div>`\n : nothing}\n ${this.failure && !stuck && !ready\n ? html`<div class=\"stuck\">\n ${this.failure}\n <div><button class=\"sbtn\" @click=${() => this.open()}><md-icon>refresh</md-icon>${t('retry', 'try again')}</button></div>\n </div>`\n : nothing}\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"assistant-dock.js","sourceRoot":"","sources":["../../client/components/assistant-dock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,gCAAgC,CAAA;AACvC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EAAE,0BAA0B,EAAsD,MAAM,0CAA0C,CAAA;AACzI,OAAO,EAAE,yBAAyB,EAA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AO;QACT,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAA;cACA,IAAI,CAAC,OAAO;+CACqB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC;iBACpG;YACT,CAAC,CAAC,OAAO;KACZ,CAAA;IACH,CAAC;;AA5tB2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAmC;AAE7C;IAAhB,KAAK,EAAE;;iDAA6C;AACpC;IAAhB,KAAK,EAAE;;4CAAsB;AACb;IAAhB,KAAK,EAAE;;8CAAmC;AAC1B;IAAhB,KAAK,EAAE;;6CAA8B;AACrB;IAAhB,KAAK,EAAE;;2CAAkB;AAET;IAAhB,KAAK,EAAE;;+CAA0C;AACjC;IAAhB,KAAK,EAAE;;gDAAuB;AACd;IAAhB,KAAK,EAAE;;8CAAwB;AACf;IAAhB,KAAK,EAAE;;8CAAqB;AACZ;IAAhB,KAAK,EAAE;;qDAA+B;AACtB;IAAhB,KAAK,EAAE;;uDAA6B;AACpB;IAAhB,KAAK,EAAE;;6CAAwG;AArNrG,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAo6BzB","sourcesContent":["import { findMenu, foldForDock, unfoldAfterDock } from '../utils/menu-room.js'\nimport '@material/web/icon/icon.js'\nimport './assistant-chat.js'\nimport './assistant-session-toolbar.js'\nimport './assistant-session-manager.js'\n\nimport gql from 'graphql-tag'\nimport { LitElement, css, html, nothing, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { closeOverlay, notify, refreshEntity360 } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { AppController, navigate, store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport type { AssistantMode } from './assistant-mode.js'\nimport { AssistantSessionController, type AssistantSession, type AssistantSessionTarget } from '../utils/assistant-session-controller.js'\nimport { assistantSessionTransport } from '../utils/assistant-session-transport.js'\nimport { readAiCapability } from '../utils/assistant-capability-read.js'\nimport type { AiCapability } from '../utils/assistant-capability.js'\nimport { setOpenSession, subscribeSessionActivity } from '../utils/assistant-activity.js'\nimport {\n assistantHomeSurface,\n currentAssistantSurface,\n isAnchor,\n subscribeAssistantSurface,\n type AnchorResult,\n type AssistantSurface\n} from '../utils/assistant-surface.js'\nimport { runProposal, setEntryProposalHandler, type ProposalContext, type ProposalOutcome } from '../utils/assistant-proposals.js'\nimport { refreshAppliedScreens, type AppliedScreensDeps } from '../utils/applied-screens.js'\n/* The invite card's handler - ai-assistant's own tool, registered by its own module (design/ai/shared-dock.md §4). */\nimport '../utils/invite-proposal-register.js'\nimport { entryProposalHandler, type EntryApplyAnswer } from '../utils/entry-proposal.js'\nimport { holdAssistantAsk, peekAssistantAsk, settleAssistantAsk, subscribeAssistantAsk, takeAssistantAsk, type AssistantAsk } from '../utils/assistant-ask.js'\nimport { selectionNote } from '../utils/assistant-selection.js'\nimport { surfaceTransition } from '../utils/assistant-navigation.js'\n\nexport const ASSISTANT_DOCK_VIEWPART = 'assistant-dock'\n\nconst t = (key: string, defaultValue: string, options: Record<string, unknown> = {}) =>\n i18next.t(`ai-assistant.dock.${key}`, { defaultValue, ...options })\n\n/* Pressing a data entry card asks the server to enter the rows it stored - the screen sends none (design/ai/data-entry.md §4). */\nsetEntryProposalHandler(\n entryProposalHandler(\n async (sessionId, proposalKey, reviewedHash) => {\n const result = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $key: String!, $reviewed: String) {\n applyEntryProposal(sessionId: $id, proposalKey: $key, reviewedHash: $reviewed)\n }\n `,\n variables: { id: sessionId, key: proposalKey, reviewed: reviewedHash ?? null }\n })\n if (result.errors?.length) throw new Error(result.errors[0].message)\n return result.data?.applyEntryProposal as EntryApplyAnswer\n },\n (key, options) => String(i18next.t(key, options))\n )\n)\n\n/* The page on screen and the shown 360 - what an applied card's records may be shown on. */\nconst APPLIED_SCREENS: AppliedScreensDeps = {\n page: () => {\n const route = (store.getState() as any)?.route ?? {}\n return { name: route.page, element: route.activePage }\n },\n refresh360: refreshEntity360\n}\n\nconst MODE_QUERY = gql`\n query ($subject: String!) {\n assistantModeFor(subject: $subject) {\n kind\n label\n }\n }\n`\n\n/** The one conversation for what the screen shows (design/ai/screen-pattern.md §3). */\nasync function modeFor(subject: string): Promise<{ kind: string; label?: string } | null> {\n const response = await client.query({ query: MODE_QUERY, variables: { subject }, fetchPolicy: 'network-only' })\n if (response.errors?.length) throw new Error(response.errors[0].message)\n return response.data?.assistantModeFor ?? null\n}\n\n/**\n * The AI dock - the same in every operato application (design/ai/shared-dock.md).\n *\n * ── What is here and what is not ────────────────────────────────────────────────\n * here where it stands, whether an AI answers, which surface and anchor, which conversation (mode),\n * sessions and their management, unread, proposals and their outcome, asks from other screens\n * the app what its screens show (surfaces, assistant-surface.ts), how its proposal kinds apply\n * (assistant-proposals.ts), and on the server its modes and tools\n *\n * Nothing in this file names an application or a proposal kind. A behaviour one app needs and another does\n * not is a surface field or a handler, never a branch here.\n */\n@customElement('ox-assistant-dock')\nexport class AssistantDock extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n width: 420px;\n max-width: 100vw;\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n background: var(--md-sys-color-surface-container-lowest);\n border-left: 1px solid var(--md-sys-color-outline-variant);\n color: var(--md-sys-color-on-surface);\n font-size: 13px;\n }\n\n /*\n * The dock opens in one place on every screen and takes its room beside the page, so it covers no page's controls\n * and no screen needs its own exception (2026-10-12). Only a screen too narrow to share floats it over the page.\n * The DOM stays - the chat does not reconnect.\n */\n @media (max-width: 1023.98px) {\n :host {\n position: fixed;\n inset: 0 0 0 auto;\n height: 100vh;\n height: 100dvh;\n z-index: 10;\n box-shadow: var(--md-sys-elevation-shadow-3, -4px 0 16px rgb(0 0 0 / 20%));\n }\n }\n\n @media (max-width: 599.98px) {\n :host {\n width: 100vw;\n }\n }\n\n .scope {\n display: flex;\n align-items: center;\n gap: 6px;\n min-height: 40px;\n padding: 5px 8px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n\n .scope > md-icon {\n --md-icon-size: 18px;\n flex: none;\n color: var(--md-sys-color-primary);\n }\n\n .what {\n display: grid;\n flex: 1;\n min-width: 0;\n font-size: 12px;\n font-weight: 650;\n line-height: 1.25;\n }\n\n .what span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .detail {\n color: var(--md-sys-color-on-surface-variant);\n font-size: 10.5px;\n font-weight: 400;\n }\n\n .sbtn {\n display: inline-flex;\n align-items: center;\n flex: none;\n padding: 4px;\n border: none;\n border-radius: 8px;\n background: none;\n color: var(--md-sys-color-on-surface-variant);\n cursor: pointer;\n }\n\n .sbtn:hover {\n background: var(--md-sys-color-surface-container-high);\n color: var(--md-sys-color-on-surface);\n }\n\n .sbtn md-icon {\n --md-icon-size: 18px;\n }\n\n /*\n * An open conversation is read by everyone in the domain - the dock says so on every screen of it, not\n * only in the list (2026-09-30: open and private were one grey word apart, and an owner's question about\n * the books sat in every employee's list). A private one draws nothing extra: it is the default.\n */\n /*\n * One warning colour in every application (2026-09-30, product owner): the theme's tertiary was a pale\n * lavender in figure and something else in each app, so \"everyone reads this\" was as loud as the theme\n * happened to be. Amber with near-black ink reads on light and dark themes alike - ink on amber 8.2:1, the edge 3.3:1 on white and 5.1:1 on a dark surface.\n */\n :host {\n --assistant-open-edge: #c47f00;\n --assistant-open-surface: #f2b01e;\n --assistant-open-ink: #2e2100;\n }\n\n :host([audience='open']) {\n border-left: 4px solid var(--assistant-open-edge);\n }\n\n .audience {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: none;\n padding: 6px 10px;\n background: var(--assistant-open-surface);\n color: var(--assistant-open-ink);\n border-bottom: 1px solid var(--assistant-open-edge);\n font-size: 12px;\n font-weight: 600;\n line-height: 1.35;\n }\n\n .audience md-icon {\n --md-icon-size: 16px;\n flex: none;\n }\n\n ox-assistant-session-toolbar {\n flex: none;\n min-width: 0;\n padding: 3px 8px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n --border-color: var(--md-sys-color-outline-variant);\n --main-section-background-color: var(--md-sys-color-surface-container);\n --primary-color: var(--md-sys-color-primary);\n font: inherit;\n font-size: 12px;\n }\n\n ox-assistant-chat,\n ox-assistant-session-manager {\n flex: 1;\n min-height: 0;\n }\n\n /* No conversation could stand - say what stopped it, never an empty panel. */\n .stuck {\n margin: auto;\n padding: 20px;\n text-align: center;\n line-height: 1.7;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .stuck .sbtn {\n margin-top: 6px;\n gap: 4px;\n font: inherit;\n }\n\n .next-step {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n background: var(--md-sys-color-surface-container-low);\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n line-height: 1.4;\n }\n\n .next-step a {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n flex: none;\n color: var(--md-sys-color-primary);\n font-weight: 650;\n text-decoration: none;\n }\n\n .next-step a:hover { text-decoration: underline; }\n .next-step md-icon { --md-icon-size: 16px; }\n ox-assistant-chat[hidden] { display: none; }\n `\n ]\n\n /** The viewpart this dock lives in - for closing it. */\n @property({ type: String }) viewpart = ASSISTANT_DOCK_VIEWPART\n\n @state() private capability: AiCapability = 'unknown'\n @state() private asked = false\n @state() private surface?: AssistantSurface\n @state() private anchor?: AnchorResult\n @state() private kind = ''\n /** kind → its label, for the manager's rows. */\n @state() private sessions: AssistantSession[] = []\n @state() private sessionId = ''\n @state() private loading = false\n @state() private failure = ''\n @state() private showingHistory = false\n @state() private conversationView = 0\n @state() private asking?: { ask?: string; draft?: string; to?: { id: string; name: string }; requestId: string }\n private openedIdentity = ''\n\n private app = new AppController(this)\n private revision = 0\n /** What the conversation was opened for - a send is refused when the screen moved on. */\n private openedFor = ''\n private unsubscribers: (() => void)[] = []\n private controller = new AssistantSessionController(\n assistantSessionTransport,\n next => {\n if (next.sessionId !== this.sessionId) {\n setOpenSession(next.sessionId)\n this.surface?.sessionChanged?.(next.sessionId)\n }\n this.sessions = next.sessions\n this.sessionId = next.sessionId\n this.loading = next.loading\n this.failure = next.error\n },\n { getItem: key => sessionStorage.getItem(key), setItem: (key, value) => sessionStorage.setItem(key, value) },\n { lazy: true }\n )\n\n private onStartNewSession = () => void this.newConversation()\n\n\n /* A card asks for a page of this application - the AI 작업 패널. The dock stays open beside it. */\n private onOpenPage = (event: CustomEvent) => {\n const href = event.detail?.href\n if (typeof href === 'string' && href) navigate(href)\n }\n\n /** Who reads the open conversation - absent until the list or the create answer says. */\n private get audience(): string | undefined {\n return this.sessions.find(session => session.id === this.sessionId)?.visibility || undefined\n }\n\n protected updated(changed: Map<PropertyKey, unknown>) {\n super.updated?.(changed as any)\n const audience = !this.showingHistory && this.audience === 'open' ? 'open' : null\n if (audience) this.setAttribute('audience', audience)\n else this.removeAttribute('audience')\n }\n\n /* Whether the left menu was folded by this dock's opening - only then does closing open it again. */\n private menuFoldedByDock = false\n\n connectedCallback() {\n super.connectedCallback()\n this.menuFoldedByDock = foldForDock(findMenu())\n if (this.menuFoldedByDock) window.dispatchEvent(new Event('resize'))\n this.addEventListener('assistant-start-new-session', this.onStartNewSession)\n this.addEventListener('assistant-open-page', this.onOpenPage as EventListener)\n this.unsubscribers.push(\n subscribeAssistantSurface(() => this.follow()),\n store.subscribe(() => { if (this.openedIdentity !== this.identityKey()) this.follow() }),\n subscribeAssistantAsk(() => void this.takeAsk()),\n subscribeSessionActivity(activity => {\n /* A rename or a new conversation elsewhere on this anchor - the tabs read again. */\n if (activity.kind === 'meta' && isAnchor(this.anchor) && activity.anchorId === this.anchor.anchorId) void this.reloadSessions()\n })\n )\n if (!this.openedIdentity) return this.follow(true)\n /*\n * The same dock opened again - the aside bar takes it out while it is closed. The conversation and what was\n * being written in it are still here; only what moved while it was closed (the screen, the person) is followed.\n */\n setOpenSession(this.sessionId)\n this.follow()\n }\n\n /* Closing keeps the conversation: the dock comes back as it was left (design/ai/shared-dock.md §2-1, §2-7). */\n disconnectedCallback() {\n unfoldAfterDock(findMenu(), this.menuFoldedByDock)\n if (this.menuFoldedByDock) window.dispatchEvent(new Event('resize'))\n this.menuFoldedByDock = false\n this.removeEventListener('assistant-start-new-session', this.onStartNewSession)\n this.removeEventListener('assistant-open-page', this.onOpenPage as EventListener)\n this.unsubscribers.splice(0).forEach(unsubscribe => unsubscribe())\n clearTimeout(this.takeTimer)\n setOpenSession('')\n super.disconnectedCallback()\n }\n\n private scopeKey(surface: AssistantSurface | undefined) {\n return JSON.stringify([this.app.contextPath, surface?.key ?? ''])\n }\n\n private identityKey() {\n const user = (store.getState() as any).auth?.user\n return JSON.stringify([this.app.contextPath, user?.id || user?.email || ''])\n }\n\n private get navigationState() {\n return (this.renderRoot.querySelector('ox-assistant-chat') as any)?.navigationState ?? { busy: false, draft: false }\n }\n\n private async mayLeaveConversation(): Promise<boolean> {\n if (this.navigationState.busy) {\n notify({ level: 'info', message: t('wait-before-switch', 'Wait for the current response before changing conversations.') })\n return false\n }\n if (!this.navigationState.draft) return true\n const identity = this.identityKey()\n const accepted = await OxPrompt.open({\n type: 'warning', title: t('switch-title', 'Change conversation?'),\n text: t('switch-draft', 'Your unsent text and attachments will not move to the other conversation.'),\n confirmButton: { text: t('switch-confirm', 'Discard draft and switch') },\n cancelButton: { text: t('stay', 'Keep writing') }\n })\n return !!accepted && identity === this.identityKey()\n }\n\n private async requestSurface(surface: AssistantSurface | undefined) {\n if (!(await this.mayLeaveConversation())) return\n this.surface = surface\n await this.open()\n }\n\n /** The screen changed - a different surface or domain is a different conversation. */\n private follow(force = false) {\n const next = currentAssistantSurface()\n const transition = surfaceTransition({\n identityChanged: this.openedIdentity !== this.identityKey(),\n sameSubject: this.scopeKey(next) === this.openedFor,\n busy: this.navigationState.busy\n })\n if (!force && transition === 'refresh') {\n this.surface = next\n this.requestUpdate()\n return\n }\n if (!force && transition === 'wait') {\n /* The answer lands in the conversation it was asked in; then the dock follows the page. */\n this.followWhenIdle()\n return\n }\n if (transition !== 'reset') this.keepDraft()\n if (transition === 'reset') {\n this.asking = undefined\n this.capability = 'unknown'\n if (this.openedIdentity) {\n const dropped = takeAssistantAsk()\n /* Another account or domain - the request was not this one's to send; the screen is told. */\n if (dropped) settleAssistantAsk(dropped, { sent: false, reason: 'identity-changed' })\n }\n }\n this.surface = next\n void this.open()\n }\n\n private followTimer?: ReturnType<typeof setTimeout>\n\n private followWhenIdle() {\n clearTimeout(this.followTimer)\n this.followTimer = setTimeout(() => (this.navigationState.busy ? this.followWhenIdle() : this.follow()), 300)\n }\n\n /* What was being written, per subject - it goes back to its conversation when the page returns there. */\n private drafts = new Map<string, unknown>()\n\n private keepDraft() {\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n const draft = this.openedFor ? chat?.takeDraft?.() : undefined\n if (draft) this.drafts.set(this.openedFor!, draft)\n }\n\n private async restoreDraft() {\n const draft = this.openedFor ? this.drafts.get(this.openedFor) : undefined\n if (!draft) return\n await this.updateComplete\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n if (!chat?.restoreDraft) return\n this.drafts.delete(this.openedFor!)\n chat.restoreDraft(draft)\n }\n\n private async open(): Promise<void> {\n this.openedIdentity = this.identityKey()\n const ticket = ++this.revision\n this.conversationView++\n this.showingHistory = false\n void this.controller.open(undefined)\n this.loading = true\n this.failure = ''\n this.anchor = undefined\n this.openedFor = this.scopeKey(this.surface)\n\n try {\n if (this.capability !== 'configured') {\n this.capability = await readAiCapability()\n this.asked = true\n }\n if (ticket !== this.revision || this.capability !== 'configured') return\n\n const surface = this.surface\n if (!surface) return\n\n const anchor = await surface.anchor()\n if (ticket !== this.revision) return\n this.anchor = anchor\n if (!isAnchor(anchor)) return\n\n const mode = await modeFor(surface.subject)\n if (ticket !== this.revision) return\n this.kind = mode?.kind ?? ''\n if (!this.kind) {\n this.anchor = { stuck: 'no-conversation', message: t('no-conversation', 'there is no conversation for this screen.') }\n return\n }\n\n const user = (store.getState() as any).auth?.user\n const userId = user?.id || user?.email\n if (!userId) throw new Error(t('no-user', 'your sign-in could not be read. sign in again.'))\n\n await this.controller.open(this.target(userId, anchor))\n } catch (error) {\n if (ticket === this.revision) this.failure = (error as Error).message\n } finally {\n if (ticket === this.revision) {\n this.loading = false\n /*\n * The ask waiting is taken once the opening is done - takeAsk passes while loading, so taking it inside the\n * opening left it waiting for good: a card's 「AI로 고치기」 reopened this screen's conversation and was never sent\n * (2026-10-25). With no conversation possible here, it is answered now, not sent later somewhere else.\n */\n if (this.anchor) void this.takeAsk()\n /* What was being written on this subject before the page moved away comes back here. */\n void this.restoreDraft()\n }\n }\n }\n\n private target(userId: string, anchor: { anchorType: string; anchorId: string }): AssistantSessionTarget {\n /* The conversation kind is part of the key: two conversations on one anchor never share a session (ADR-0072 decision 3). */\n return { scope: JSON.stringify([this.app.contextPath, userId, this.kind]), anchorType: anchor.anchorType, anchorId: anchor.anchorId, kind: this.kind }\n }\n\n private async reloadSessions() {\n const target = this.controller.state.target\n if (target) await this.controller.open(target, true)\n }\n\n private async newConversation() {\n if (this.loading || !isAnchor(this.anchor)) return\n if (!(await this.mayLeaveConversation())) return\n this.showingHistory = false\n const revision = this.controller.state.revision\n await this.controller.reset()\n if (revision !== this.controller.state.revision) this.conversationView++\n }\n\n private async selectSession(id: string) {\n if (id !== this.sessionId && !(await this.mayLeaveConversation())) return\n this.showingHistory = false\n const previous = this.sessionId\n if (this.controller.select(id) && previous !== id) this.conversationView++\n }\n\n /* ── asks from other screens ────────────────────────────────────────────────────── */\n\n private async takeAsk() {\n if (this.loading || !this.anchor) return\n /* A request made on the screen with what was picked there (「AI와 작업」) has rules of its own (§2-11-1). */\n if (peekAssistantAsk()?.selection) return this.takeScreenRequest()\n /*\n * A request the person made on this screen is never dropped for what the dock is doing (2026-10-24: 「AI와 작업」\n * pressed again was thrown away because the input still held the first press's draft). An answer being written\n * finishes first, then the request is taken. Unsent words are asked about - the person keeps writing or lets them go.\n */\n if (this.navigationState.busy) {\n this.takeWhenIdle()\n return\n }\n if (this.navigationState.draft && !(await this.mayLeaveConversation())) {\n const waiting = takeAssistantAsk()\n if (waiting) notify({ level: 'info', message: t('ask-kept-current', 'The current conversation was kept. Switch to the intended subject before asking again.') })\n return\n }\n if (!isAnchor(this.anchor)) {\n /*\n A question is not sent later on its own, once some conversation happens to stand - by then the person is looking\n at something else. It is said now why it was not sent. A draft only fills the input, so it waits.\n */\n const waiting = takeAssistantAsk()\n if (!waiting) return\n if (waiting.ask) notify({ level: 'info', message: `${t('ask-needs-conversation', 'the question was not sent.')} ${this.anchor.message}` })\n else holdAssistantAsk(waiting)\n return\n }\n const ask: AssistantAsk | undefined = takeAssistantAsk()\n if (!ask) return\n\n /*\n * A request for one conversation - a to-do that came from it (ADR-0200 decision 3). It is listed on its subject's\n * screen; until the dock stands there the request waits, and the conversation is opened when it does.\n */\n if (ask.sessionId) {\n if (!this.sessions.some(one => one.id === ask.sessionId)) await this.reloadSessions()\n if (!this.controller.select(ask.sessionId)) return holdAssistantAsk(ask)\n this.conversationView++\n this.asking = ask.ask || ask.draft || ask.to ? { ask: ask.ask, draft: ask.draft, to: ask.to, requestId: String(Date.now()) } : undefined\n settleAssistantAsk(ask, { sent: true })\n return\n }\n\n if (!ask.continueCurrent && (ask.name || ask.context || ask.transcript?.length)) {\n const id = await this.startCarried(ask).catch(() => {\n notify({ level: 'error', message: t('carry-failed', 'The selected context could not be attached. Nothing was sent. Try again from the original screen.') })\n return undefined\n })\n // Never send a context-dependent request into the previous conversation after a failed handoff.\n if (!id) return\n if (id) {\n await this.reloadSessions()\n this.controller.select(id)\n }\n } else if (!ask.continueCurrent) {\n await this.newConversation()\n }\n this.conversationView++\n this.asking = { ask: ask.ask, draft: ask.draft, requestId: String(Date.now()) }\n }\n\n private takeTimer?: ReturnType<typeof setTimeout>\n\n /**\n * This person's own conversation on this screen - the most recent they sit in; none, a new one made on sending. What\n * they were writing comes along.\n */\n private async goToOwnConversation() {\n const kept = (this.renderRoot.querySelector('ox-assistant-chat') as any)?.takeDraft?.()\n const own = this.sessions.find(one => one.participant !== false && one.id !== this.sessionId)\n const revision = this.controller.state.revision\n if (own) {\n if (this.controller.select(own.id)) this.conversationView++\n } else {\n await this.controller.reset()\n if (revision !== this.controller.state.revision) this.conversationView++\n }\n await this.updateComplete\n if (kept) (this.renderRoot.querySelector('ox-assistant-chat') as any)?.restoreDraft?.(kept)\n }\n\n /*\n * ── A screen request (「AI와 작업」) - design/ai/shared-dock.md §2-11-1 ─────────────────────────────────────────\n * The user (2026-10-24): 「\"AI와 작업\" 기능이 unstable 하다. 작동 방식을 신뢰할 수 있도록 새로운 세션을 여는지, 기존 세션을\n * 활용하는지 등등을 명확하게 하라.」 One way, every time:\n * 1. this screen's conversation - the one the dock opens for this screen; none yet, one is made on sending. The dock\n * showing another screen's conversation, or its list, comes back here. Never a new conversation per press.\n * 2. the selection at the press is noted for that turn - a line the person reads, the ids for the model; a later\n * press's note replaces it (SELECTION_RULE).\n * 3. the request is sent, always - never left as a draft.\n * 4. what the person was writing in the box is set aside while the request goes, and put back.\n * 5. not sent: said in a notice, and the screen is told so it keeps the request on its bar.\n * 6. an answer being written: said, and the request goes right after it - never dropped.\n */\n private waitingNoticeFor?: AssistantAsk\n\n private async takeScreenRequest() {\n const waiting = peekAssistantAsk()\n if (!waiting?.selection) return\n if (this.navigationState.busy) {\n if (this.waitingNoticeFor !== waiting) {\n this.waitingNoticeFor = waiting\n notify({ level: 'info', message: t('screen-request-waits', 'An answer is being written - your request goes right after it.') })\n }\n this.takeWhenIdle()\n return\n }\n const here = currentAssistantSurface()\n if (this.scopeKey(here) !== this.openedFor || this.openedIdentity !== this.identityKey()) {\n /* Another screen's conversation is open - back to this screen's; open() takes the request again when it stands. */\n this.keepDraft()\n this.surface = here\n await this.open()\n return\n }\n const ask = takeAssistantAsk()!\n this.waitingNoticeFor = undefined\n const fail = (reason: string) => {\n notify({ level: 'error', message: reason })\n settleAssistantAsk(ask, { sent: false, reason })\n }\n if (!isAnchor(this.anchor)) return fail(this.anchor?.message || t('no-conversation', 'there is no conversation for this screen.'))\n this.showingHistory = false\n /*\n * The dock opens the first conversation it can read when this person has none here yet - someone else's open one,\n * found 2026-10-24: the request went into Admin's public 「회사가치를 제시해보라」. A screen request is the person's own\n * work: a conversation they do not sit in is not this screen's conversation for them. Their own on this screen is\n * used - the most recent one; none yet, one is started (made on sending).\n */\n if (this.sessions.find(one => one.id === this.sessionId)?.participant === false) await this.goToOwnConversation()\n await this.updateComplete\n const chat = this.renderRoot.querySelector('ox-assistant-chat') as any\n if (!chat?.sendScreenRequest) return fail(t('screen-request-not-ready', 'The conversation is not ready yet. Try again in a moment.'))\n const request = ask.ask?.trim() || t('screen-request-default', 'Read the selected records and suggest what can be done with them now.')\n const outcome = await chat.sendScreenRequest(request, selectionNote(ask.selection!, t))\n if (!outcome?.sent) return fail(outcome?.reason || t('screen-request-failed', 'The request was not sent. Try again.'))\n settleAssistantAsk(ask, { sent: true })\n }\n\n /** The request waits (it is still pending) while an answer is written, then is taken. */\n private takeWhenIdle() {\n clearTimeout(this.takeTimer)\n this.takeTimer = setTimeout(() => (this.navigationState.busy ? this.takeWhenIdle() : void this.takeAsk()), 300)\n }\n\n /** A new conversation carrying what the other screen had - its name, a note, earlier turns. */\n private async startCarried(ask: AssistantAsk): Promise<string | undefined> {\n const anchor = this.anchor as { anchorType: string; anchorId: string }\n const created = await client.mutate({\n mutation: gql`\n mutation ($t: String!, $i: String!, $n: String) {\n createAISession(anchorType: $t, anchorId: $i, name: $n) {\n id\n }\n }\n `,\n variables: { t: anchor.anchorType, i: anchor.anchorId, n: ask.name || null }\n })\n if (created.errors?.length) throw new Error(created.errors[0].message)\n const id = created.data?.createAISession?.id\n if (!id) throw new Error('Session was not created')\n if (ask.context) {\n const attached = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $c: String!) {\n appendSessionNote(sessionId: $id, content: $c)\n }\n `,\n variables: { id, c: ask.context }\n })\n if (attached.errors?.length) throw new Error(attached.errors[0].message)\n }\n if (ask.transcript?.length) {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $turns: JSON!) {\n appendSessionTurns(sessionId: $id, turns: $turns)\n }\n `,\n variables: { id, turns: ask.transcript.map(turn => ({ role: turn.role === 'ai' ? 'assistant' : 'user', content: turn.content })) }\n })\n }\n return id\n }\n\n /* ── proposals ───────────────────────────────────────────────────────────────────── */\n\n private proposalContext(sessionId?: string): ProposalContext {\n const identity = this.identityKey()\n const scope = this.openedFor\n return {\n sessionId,\n surface: this.surface,\n confirm: async ({ title, text, confirmText, cancelText, type }) =>\n !!(await OxPrompt.open({\n type: type ?? 'warning',\n title,\n text,\n confirmButton: { text: confirmText ?? t('confirm', 'OK') },\n cancelButton: { text: cancelText ?? t('cancel', 'Cancel') }\n })) && identity === this.identityKey() && scope === this.scopeKey(currentAssistantSurface()),\n notify: (level, message) => notify({ level, message })\n }\n }\n\n private async report(sessionId: string | undefined, proposalKey: string | undefined, outcome: ProposalOutcome) {\n if (!sessionId || !proposalKey) return\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $key: String!, $outcome: JSON!) {\n reportProposalOutcome(sessionId: $id, proposalKey: $key, outcome: $outcome)\n }\n `,\n variables: { id: sessionId, key: proposalKey, outcome }\n })\n } catch {\n /* the card then says it heard nothing - never \"done\" */\n }\n }\n\n /** Every proposal ends in exactly one reported outcome - a kind nobody handles is `unavailable`. */\n private onProposal = async (event: CustomEvent) => {\n const { proposal, sessionId, proposalKey } = event.detail ?? {}\n const outcome: ProposalOutcome = this.openedFor !== this.scopeKey(currentAssistantSurface()) || this.openedIdentity !== this.identityKey()\n ? { verdict: 'unavailable', errorCode: 'conversation-screen-changed', note: t('return-to-subject', 'Return to the conversation subject before applying this proposal.') }\n : await runProposal(proposal, this.proposalContext(sessionId))\n if (outcome.verdict === 'unavailable' && outcome.errorCode === 'unknown-proposal-kind') {\n notify({ level: 'error', message: t('proposal-not-runnable', 'this proposal cannot be run on this screen.') })\n }\n const { records, ...reported } = outcome\n await this.report(sessionId, proposalKey, reported)\n /* What the handler did, in the person's words, stays in the conversation - what was created, why it did not run. */\n if (outcome.note && sessionId) await this.appendNote(sessionId, outcome.note)\n /* The list or 360 behind the dock shows what went in, without the person refreshing it. */\n if (outcome.verdict === 'accepted' && (outcome.applied ?? 1) > 0)\n void refreshAppliedScreens(proposal, records, APPLIED_SCREENS).then(kept => {\n if (kept) notify({ level: 'info', message: t('screen-kept-edits', 'the list was not read again - it has unsaved edits. save them, then refresh it to see what went in.') })\n })\n }\n\n /**\n * \"Check result\" - asks the surface what became of a requested proposal and reports only what it learns.\n * Nothing is run: a lost answer never turns into a second application (ADR-0097 Q-D4 ④).\n */\n private onProposalCheck = async (event: CustomEvent) => {\n const { proposal, sessionId, proposalKey } = event.detail ?? {}\n const ask = this.surface?.proposalOutcome\n if (!ask) {\n notify({ level: 'info', message: t('proposal-result-uncheckable', 'this screen cannot check that result. open the screen where it was applied.') })\n return\n }\n\n let outcome: ProposalOutcome | undefined\n try {\n outcome = await ask.call(this.surface, proposalKey, proposal)\n } catch {\n outcome = undefined\n }\n if (!outcome?.verdict) {\n notify({ level: 'info', message: t('proposal-result-unknown', 'the result is still unknown. it was not applied again.') })\n return\n }\n\n await this.report(sessionId, proposalKey, outcome)\n if (outcome.note && sessionId) await this.appendNote(sessionId, outcome.note)\n }\n\n private async appendNote(sessionId: string, note: string) {\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $c: String!) {\n appendSessionNote(sessionId: $id, content: $c)\n }\n `,\n variables: { id: sessionId, c: note }\n })\n } catch {\n /* the outcome is already reported; a lost note is not a lost outcome */\n }\n }\n\n /* ── board surfaces: the chat's scene edits land on the open board ───────────────── */\n\n private onScenePatch = async (event: CustomEvent) => {\n if (!this.mayApplyOnScreen()) return\n const board = this.surface?.board\n if (!board) return\n const result = await board.applyPatch(event.detail)\n if (result?.missed) notify({ level: 'info', message: t('patch-missed', '{missed} of the changes could not be applied.', { missed: result.missed }) })\n }\n\n private mayApplyOnScreen() {\n if (this.openedFor === this.scopeKey(currentAssistantSurface()) && this.openedIdentity === this.identityKey()) return true\n notify({ level: 'info', message: t('return-to-subject', 'Return to the conversation subject before applying this proposal.') })\n return false\n }\n\n private onBoardRevert = (event: CustomEvent) => { if (this.mayApplyOnScreen()) void this.surface?.board?.revertPatch?.(event.detail?.patchId) }\n\n private onSceneAction = (event: CustomEvent) => { if (this.mayApplyOnScreen()) void this.surface?.board?.applyAction?.(event.detail) }\n\n /* ── drawing ─────────────────────────────────────────────────────────────────────── */\n\n private stuckLine(): string {\n if (this.capability === 'not-configured') return t('not-configured', 'no AI is set up for this site. an administrator can set one up in the AI settings.')\n if (this.capability === 'unknown' && this.asked && !this.loading && !this.failure) return t('capability-unknown', 'whether AI is set up here could not be read.')\n if (this.capability === 'configured' && !this.surface && !this.loading) return t('no-surface', 'this screen has no conversation.')\n const anchor = this.anchor\n if (anchor && !isAnchor(anchor)) return anchor.message\n return ''\n }\n\n private header(): TemplateResult {\n const surface = this.surface\n const home = assistantHomeSurface()\n const ready = this.capability === 'configured' && isAnchor(this.anchor)\n return html`\n <div class=\"scope\">\n <md-icon>${surface?.icon || 'forum'}</md-icon>\n <span class=\"what\">\n <span>${surface?.label() || t('title', 'Assistant')}</span>\n ${surface?.detail ? html`<span class=\"detail\">${surface.detail()}</span>` : nothing}\n </span>\n ${home && surface && home !== surface\n ? html`<button class=\"sbtn\" title=${t('to-home', \"back to this application's conversation\")} @click=${() => this.useSurface(home)}>\n <md-icon>home</md-icon>\n </button>`\n : nothing}\n ${ready && this.showingHistory\n ? html`<button\n class=\"sbtn\"\n title=${this.showingHistory ? t('back-to-conversation', 'back to the conversation') : t('conversations', 'conversations')}\n @click=${() => (this.showingHistory = !this.showingHistory)}\n >\n <md-icon>arrow_back</md-icon>${t('back-to-conversation', 'back to the conversation')}\n </button>`\n : nothing}\n <button class=\"sbtn\" title=${t('rebind', 'follow this screen again')} @click=${() => this.requestSurface(currentAssistantSurface())}>\n <md-icon>refresh</md-icon>\n </button>\n <button class=\"sbtn\" title=${t('close', 'close')} @click=${() => closeOverlay(this.viewpart)}>\n <md-icon>close</md-icon>\n </button>\n </div>\n `\n }\n\n /** The home button: talk about the application instead of this screen, until the screen changes. */\n private useSurface(surface: AssistantSurface) {\n void this.requestSurface(surface)\n }\n\n render(): TemplateResult {\n const anchor = this.anchor\n const ready = this.capability === 'configured' && isAnchor(anchor)\n const stuck = this.stuckLine()\n const surface = this.surface\n const openedFor = this.openedFor\n const board = surface?.board\n\n const mode: AssistantMode | undefined = ready ? { kind: this.kind, target: (anchor as any).anchorId, hostContext: {} } : undefined\n\n return html`\n ${this.header()}\n ${surface?.nextStep ? html`<div class=\"next-step\" role=\"status\">\n <span>${surface.nextStep.description?.() || ''}</span>\n <a href=${surface.nextStep.href}>${surface.nextStep.label()}<md-icon>arrow_forward</md-icon></a>\n </div>` : nothing}\n\n ${ready && this.showingHistory\n ? html`<ox-assistant-session-manager\n .anchorType=${(anchor as any).anchorType}\n .anchorId=${(anchor as any).anchorId}\n .sessionId=${this.sessionId}\n .kind=${this.kind}\n @assistant-session-select=${(event: CustomEvent) => this.selectSession(event.detail.sessionId)}\n @assistant-session-reset=${() => this.newConversation()}\n @assistant-session-changed=${() => this.reloadSessions()}\n ></ox-assistant-session-manager>`\n : nothing}\n ${ready && !this.showingHistory\n ? html`<ox-assistant-session-toolbar\n .sessions=${this.sessions}\n .sessionId=${this.sessionId}\n .loading=${this.loading}\n .error=${this.failure}\n historyEnabled\n singleConversation\n @assistant-session-select=${(event: CustomEvent) => this.selectSession(event.detail.sessionId)}\n @assistant-session-reset=${() => this.newConversation()}\n @assistant-session-history=${() => (this.showingHistory = true)}\n @assistant-session-retry=${() => this.open()}\n ></ox-assistant-session-toolbar>`\n : nothing}\n ${ready && !this.showingHistory && this.audience === 'open'\n ? html`<div class=\"audience\" role=\"status\">\n <md-icon>public</md-icon>\n <span>${t('audience-open-band', 'Public conversation - everyone in this domain can read and write here.')}</span>\n </div>`\n : nothing}\n ${ready && !this.loading && !this.failure\n ? keyed(\n this.conversationView,\n html`<ox-assistant-chat\n ?hidden=${this.showingHistory}\n .sessionId=${this.sessionId}\n .visibility=${this.audience}\n .prepareSession=${(adopt: (id: string) => void) => this.controller.prepareSession(adopt)}\n .contextProvider=${() => {\n /* The screen moved on between writing and sending - do not answer about the old one. */\n if (openedFor !== this.scopeKey(currentAssistantSurface()) || this.openedIdentity !== this.identityKey()) throw new Error(t('return-to-subject', 'Return to the conversation subject before applying this proposal.'))\n return { hostContext: surface?.hostContext?.() ?? {} }\n }}\n .mode=${mode}\n .subject=${surface?.subject}\n .chatEndpoint=${board?.chatEndpoint ?? 'assistantChat'}\n ?board-tools=${!!board}\n .currentBoard=${board?.currentBoard?.()}\n .boardProvider=${board?.boardProvider}\n .selectedRefids=${board?.selectedRefids?.() ?? []}\n .knownTypes=${board?.knownTypes?.()}\n .categories=${board?.categories?.()}\n .componentSchemas=${board?.componentSchemas?.()}\n .searchProvider=${board?.searchProvider}\n .autoAsk=${this.asking?.ask}\n .autoAskRequestId=${this.asking?.requestId}\n .draft=${this.asking?.draft}\n .draftTo=${this.asking?.to}\n .draftRequestId=${this.asking?.requestId}\n @assistant-proposal-execute=${this.onProposal}\n @assistant-proposal-check=${this.onProposalCheck}\n @scene-edit-patch=${this.onScenePatch}\n @board-edit-revert=${this.onBoardRevert}\n @scene-action-execute=${this.onSceneAction}\n ></ox-assistant-chat>`\n )\n : nothing}\n ${stuck\n ? html`<div class=\"stuck\">\n ${stuck}\n ${this.capability === 'unknown'\n ? html`<div><button class=\"sbtn\" @click=${() => this.open()}><md-icon>refresh</md-icon>${t('retry', 'try again')}</button></div>`\n : nothing}\n </div>`\n : nothing}\n ${this.failure && !stuck && !ready\n ? html`<div class=\"stuck\">\n ${this.failure}\n <div><button class=\"sbtn\" @click=${() => this.open()}><md-icon>refresh</md-icon>${t('retry', 'try again')}</button></div>\n </div>`\n : nothing}\n `\n }\n}\n"]}
|
|
@@ -45,9 +45,19 @@ it('the chat reads stored proposals from history and from the broadcast', () =>
|
|
|
45
45
|
it('a failed page-context handoff never sends the request into the previous conversation', () => {
|
|
46
46
|
const take = body(dock, 'private async takeAsk()');
|
|
47
47
|
expect(take.indexOf('if (!id) return')).toBeGreaterThan(take.indexOf('await this.startCarried(ask)'));
|
|
48
|
-
expect(take.indexOf('if (!id) return')).toBeLessThan(take.indexOf('this.asking ='));
|
|
48
|
+
expect(take.indexOf('if (!id) return')).toBeLessThan(take.indexOf('this.asking =', take.indexOf('await this.startCarried(ask)')));
|
|
49
49
|
const carry = body(dock, 'private async startCarried(');
|
|
50
50
|
expect(carry).toContain('if (created.errors?.length) throw');
|
|
51
51
|
expect(carry).toContain('if (attached.errors?.length) throw');
|
|
52
52
|
});
|
|
53
|
+
it('a request for one conversation opens that one - waiting until the dock lists it, never a new conversation (ADR-0200)', () => {
|
|
54
|
+
const take = body(dock, 'private async takeAsk()');
|
|
55
|
+
const branch = take.slice(take.indexOf('if (ask.sessionId) {'), take.indexOf('if (!ask.continueCurrent'));
|
|
56
|
+
expect(branch).toContain('await this.reloadSessions()');
|
|
57
|
+
expect(branch).toContain('if (!this.controller.select(ask.sessionId)) return holdAssistantAsk(ask)');
|
|
58
|
+
expect(branch).toContain('settleAssistantAsk(ask, { sent: true })');
|
|
59
|
+
expect(branch).not.toContain('newConversation');
|
|
60
|
+
expect(branch).not.toContain('startCarried');
|
|
61
|
+
expect(take.indexOf('if (ask.sessionId) {')).toBeLessThan(take.indexOf('await this.startCarried(ask)'));
|
|
62
|
+
});
|
|
53
63
|
//# sourceMappingURL=proposal-request.test.js.map
|
|
@@ -1 +1 @@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AAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAA;AACzG,CAAC,CAAC,CAAA","sourcesContent":["/*\n * ADR-0097 Q-D4 ④ — the chat asks the server before it asks the host, and a card that was requested and\n * never answered offers \"check result\", never \"run\".\n *\n * The component itself needs a browser; the order of its steps is read from the source, and the rules\n * it follows are tested on their own (`proposal-outcome.test.ts`).\n */\nimport { readFileSync } from 'fs'\nimport { join } from 'path'\n\nimport { remoteMessageToLine } from './chat-echo-dedup'\n\nconst chat = readFileSync(join(__dirname, 'assistant-chat.ts'), 'utf8')\nconst dock = readFileSync(join(__dirname, 'assistant-dock.ts'), 'utf8')\n\nconst body = (source: string, start: string) => {\n const from = source.indexOf(start)\n expect(from).toBeGreaterThan(0)\n return source.slice(from, source.indexOf('\\n }\\n', from))\n}\n\nit('★ the host is asked only after the server granted the request', () => {\n const run = body(chat, 'private async executeProposal(')\n const asked = run.indexOf('await this.requestProposal(key)')\n const dispatched = run.indexOf(\"new CustomEvent('assistant-proposal-execute'\")\n expect(asked).toBeGreaterThan(0)\n expect(dispatched).toBeGreaterThan(asked)\n expect(run.slice(asked, dispatched)).toMatch(/if \\(!granted\\) \\{[\\s\\S]*return\\n/)\n})\n\nit('★ a requested card without an answer checks the result — it never runs again', () => {\n const unconfirmed = chat.slice(chat.indexOf(\"card.state === 'unconfirmed'\"), chat.indexOf(': html`', chat.indexOf(\"card.state === 'unconfirmed'\")))\n expect(unconfirmed).toMatch(/this\\.checkProposal\\(p, key\\)/)\n expect(unconfirmed).not.toMatch(/executeProposal/)\n})\n\nit('★ \"check result\" reports only what the host knows, and runs nothing', () => {\n const check = body(dock, 'private onProposalCheck = async')\n expect(check).toMatch(/this\\.surface\\?\\.proposalOutcome/)\n expect(check).toMatch(/if \\(!outcome\\?\\.verdict\\) \\{[\\s\\S]*return/)\n expect(check).not.toMatch(/runProposal|assistant-proposal-execute/)\n})\n\nit('★ a stored answer brings its cards back after a refresh', () => {\n const line: any = remoteMessageToLine({ id: 'm1', role: 'assistant', content: 'here', proposalsJson: [{ tool: 'proposeFigureCandidate', key: 'k1' }] })\n expect(line.proposals).toEqual([{ tool: 'proposeFigureCandidate', key: 'k1' }])\n expect((remoteMessageToLine({ id: 'm2', role: 'assistant', content: 'plain', proposalsJson: [] }) as any).proposals).toBeUndefined()\n})\n\nit('the chat reads stored proposals from history and from the broadcast', () => {\n expect(chat.split('proposalsJson').length - 1).toBeGreaterThanOrEqual(2)\n})\n\n\nit('a failed page-context handoff never sends the request into the previous conversation', () => {\n const take = body(dock, 'private async takeAsk()')\n expect(take.indexOf('if (!id) return')).toBeGreaterThan(take.indexOf('await this.startCarried(ask)'))\n expect(take.indexOf('if (!id) return')).toBeLessThan(take.indexOf('this.asking =', take.indexOf('await this.startCarried(ask)')))\n const carry = body(dock, 'private async startCarried(')\n expect(carry).toContain('if (created.errors?.length) throw')\n expect(carry).toContain('if (attached.errors?.length) throw')\n})\n\nit('a request for one conversation opens that one - waiting until the dock lists it, never a new conversation (ADR-0200)', () => {\n const take = body(dock, 'private async takeAsk()')\n const branch = take.slice(take.indexOf('if (ask.sessionId) {'), take.indexOf('if (!ask.continueCurrent'))\n expect(branch).toContain('await this.reloadSessions()')\n expect(branch).toContain('if (!this.controller.select(ask.sessionId)) return holdAssistantAsk(ask)')\n expect(branch).toContain('settleAssistantAsk(ask, { sent: true })')\n expect(branch).not.toContain('newConversation')\n expect(branch).not.toContain('startCarried')\n expect(take.indexOf('if (ask.sessionId) {')).toBeLessThan(take.indexOf('await this.startCarried(ask)'))\n})\n"]}
|
|
@@ -41,23 +41,32 @@ let AssistantDockButton = class AssistantDockButton extends LitElement {
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: center;
|
|
43
43
|
gap: 6px;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
/* an icon alone: the band's 32px square (app-header-band .ctl.icon) */
|
|
45
|
+
height: 32px;
|
|
46
|
+
min-width: 32px;
|
|
47
|
+
padding: 0;
|
|
47
48
|
box-sizing: border-box;
|
|
48
|
-
|
|
49
|
-
border
|
|
50
|
-
|
|
49
|
+
/* the header band's control shape (apptool-ui app-header-band .ctl): no plate, no edge, a soft tint on hover */
|
|
50
|
+
border: 0;
|
|
51
|
+
border-radius: 999px;
|
|
52
|
+
background-color: transparent;
|
|
53
|
+
transition: background-color 120ms ease;
|
|
51
54
|
color: var(--md-sys-color-on-surface-variant);
|
|
52
55
|
font: inherit;
|
|
53
56
|
cursor: pointer;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
button:hover {
|
|
57
|
-
|
|
60
|
+
background-color: var(--header-band-control-hover, color-mix(in srgb, var(--md-sys-color-on-surface) 7%, transparent));
|
|
58
61
|
color: var(--md-sys-color-primary);
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
/* The count hangs on the icon's top right, as the bell's does. */
|
|
65
|
+
.icon-with-count {
|
|
66
|
+
position: relative;
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
}
|
|
69
|
+
|
|
61
70
|
button:focus-visible {
|
|
62
71
|
outline: 2px solid var(--md-sys-color-primary);
|
|
63
72
|
outline-offset: 2px;
|
|
@@ -71,16 +80,20 @@ let AssistantDockButton = class AssistantDockButton extends LitElement {
|
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
.count {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: -6px;
|
|
85
|
+
left: 10px;
|
|
86
|
+
min-width: 14px;
|
|
87
|
+
height: 14px;
|
|
88
|
+
padding: 0 3px;
|
|
77
89
|
box-sizing: border-box;
|
|
78
|
-
border-radius:
|
|
90
|
+
border-radius: 7px;
|
|
91
|
+
box-shadow: 0 0 0 1.5px var(--header-band-surface, var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface)));
|
|
79
92
|
background-color: var(--header-band-count-background, var(--md-sys-color-error));
|
|
80
93
|
color: var(--header-band-count-color, var(--md-sys-color-on-error));
|
|
81
|
-
font-size:
|
|
94
|
+
font-size: 9.5px;
|
|
82
95
|
font-weight: 700;
|
|
83
|
-
line-height:
|
|
96
|
+
line-height: 14px;
|
|
84
97
|
text-align: center;
|
|
85
98
|
}
|
|
86
99
|
`; }
|
|
@@ -101,8 +114,10 @@ let AssistantDockButton = class AssistantDockButton extends LitElement {
|
|
|
101
114
|
const label = i18next.t('ai-assistant.dock.open', { defaultValue: 'Ask AI' });
|
|
102
115
|
return html `
|
|
103
116
|
<button title=${label} aria-label=${label} @click=${() => openOverlay(this.viewpart, { backdrop: false })}>
|
|
104
|
-
<
|
|
105
|
-
|
|
117
|
+
<span class="icon-with-count">
|
|
118
|
+
<md-icon aria-hidden="true">forum</md-icon>
|
|
119
|
+
${this.unread ? html `<span class="count">${this.unread > 99 ? '99+' : this.unread}</span>` : nothing}
|
|
120
|
+
</span>
|
|
106
121
|
</button>
|
|
107
122
|
`;
|
|
108
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-assistant-dock.js","sourceRoot":"","sources":["../client/setup-assistant-dock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,4BAA4B,CAAA;AACnC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAA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;IAE1B;;;;OAIG;IACH,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAuC,CAAA;IAC9F,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAExB,cAAc,CAAC;QACb,IAAI,EAAE,QAAQ;QACd;;;WAGG;QACH,QAAQ,EAAE;YACR,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,IAAI;YAChB,kBAAkB,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE,YAAY,EAAE,WAAW,EAAE;YACtF,KAAK,EAAE,cAAc,CAAC,OAAO;YAC7B,QAAQ,EAAE,IAAI,CAAA,GAAG,IAAI,EAAE;SACxB;QACD,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;KACrC,CAAC,CAAA;IAEF,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE;YACJ,IAAI,EAAE,qBAAqB;YAC3B,QAAQ,EAAE,aAAa,CAAC,IAAI;YAC5B,QAAQ,EAAE,IAAI,CAAA,uCAAuC,QAAQ,8BAA8B;SAC5F;KACF,CAAC,CAAA;IAEF,oDAAoD;IACpD,MAAM,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["/*\n * Standing the AI dock up in an application - one call in its bootstrap (design/ai/shared-dock.md §2-1).\n *\n * setupAssistantDock()\n * registerAssistantHome({ ... }) // what the app's own conversation is about\n * registerSubjectSurface('items', ...) // how a page's context.subject becomes a surface (if any)\n *\n * The dock sits in the aside bar above everything, closed at first; the header band's `forum` button opens\n * it and carries how many conversations have something unread. Asks from other screens open it too.\n */\nimport '@material/web/icon/icon.js'\nimport './components/assistant-dock.js'\n\nimport { LitElement, css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { appendViewpart, openOverlay, TOOL_POSITION, VIEWPART_LEVEL, VIEWPART_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { APPEND_APP_TOOL } from '@things-factory/apptool-base/client/index.js'\n\nimport { ASSISTANT_DOCK_VIEWPART } from './components/assistant-dock.js'\nimport { startSessionActivityFeed, subscribeSessionActivity, unreadSessionCount } from './utils/assistant-activity.js'\n\n@customElement('ox-assistant-dock-button')\nexport class AssistantDockButton extends LitElement {\n /*\n * The band's pill, as its bell draws it (apptool-ui app-header-band `.ctl`): 28px, a 1px edge, a 7px radius, an 18px\n * outlined icon in the muted colour, the count inside the pill. The band shapes bare md-icon tools itself but cannot\n * reach into this element, so the button draws the same shape - a filled 24px mark at full ink stood out on the row\n * (user, 2026-09-25).\n */\n static styles = css`\n :host {\n display: inline-flex;\n }\n\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n /* an icon alone: the band's 32px square (app-header-band .ctl.icon) */\n height: 32px;\n min-width: 32px;\n padding: 0;\n box-sizing: border-box;\n /* the header band's control shape (apptool-ui app-header-band .ctl): no plate, no edge, a soft tint on hover */\n border: 0;\n border-radius: 999px;\n background-color: transparent;\n transition: background-color 120ms ease;\n color: var(--md-sys-color-on-surface-variant);\n font: inherit;\n cursor: pointer;\n }\n\n button:hover {\n background-color: var(--header-band-control-hover, color-mix(in srgb, var(--md-sys-color-on-surface) 7%, transparent));\n color: var(--md-sys-color-primary);\n }\n\n /* The count hangs on the icon's top right, as the bell's does. */\n .icon-with-count {\n position: relative;\n display: inline-flex;\n }\n\n button:focus-visible {\n outline: 2px solid var(--md-sys-color-primary);\n outline-offset: 2px;\n }\n\n md-icon {\n --md-icon-size: 18px;\n font-size: 18px;\n font-variation-settings: 'FILL' 0;\n color: inherit;\n }\n\n .count {\n position: absolute;\n top: -6px;\n left: 10px;\n min-width: 14px;\n height: 14px;\n padding: 0 3px;\n box-sizing: border-box;\n border-radius: 7px;\n box-shadow: 0 0 0 1.5px var(--header-band-surface, var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface)));\n background-color: var(--header-band-count-background, var(--md-sys-color-error));\n color: var(--header-band-count-color, var(--md-sys-color-on-error));\n font-size: 9.5px;\n font-weight: 700;\n line-height: 14px;\n text-align: center;\n }\n `\n\n @property({ type: String }) viewpart = ASSISTANT_DOCK_VIEWPART\n @state() private unread = 0\n\n private unsubscribe?: () => void\n\n connectedCallback() {\n super.connectedCallback()\n this.unread = unreadSessionCount()\n this.unsubscribe = subscribeSessionActivity(() => (this.unread = unreadSessionCount()))\n }\n\n disconnectedCallback() {\n this.unsubscribe?.()\n super.disconnectedCallback()\n }\n\n /*\n * Opens, never toggles: after a reload the viewpart can be marked shown while nothing is drawn, and a toggle\n * then closed it - the first press did nothing (found on :3700, 2026-09-25). The dock's own ✕ closes it.\n */\n render() {\n const label = i18next.t('ai-assistant.dock.open', { defaultValue: 'Ask AI' })\n return html`\n <button title=${label} aria-label=${label} @click=${() => openOverlay(this.viewpart, { backdrop: false })}>\n <span class=\"icon-with-count\">\n <md-icon aria-hidden=\"true\">forum</md-icon>\n ${this.unread ? html`<span class=\"count\">${this.unread > 99 ? '99+' : this.unread}</span>` : nothing}\n </span>\n </button>\n `\n }\n}\n\nlet installed = false\n\nexport function setupAssistantDock(options: { viewpart?: string } = {}): void {\n if (installed) return\n installed = true\n const viewpart = options.viewpart ?? ASSISTANT_DOCK_VIEWPART\n\n startSessionActivityFeed()\n\n /*\n * One dock for the application's life. The aside bar drops a closed viewpart's template, so a template that\n * makes the element would make a new dock on every opening - and a new composer, the text being written gone\n * (design/ai/shared-dock.md §2-1, §2-7). The same element is put back instead, as the entity360 dock is.\n */\n const dock = document.createElement('ox-assistant-dock') as HTMLElement & { viewpart: string }\n dock.viewpart = viewpart\n\n appendViewpart({\n name: viewpart,\n /*\n * `persistent` keeps the dock on editors that bleed wide (the board modeller hides the aside bar with\n * `widebleed`) - those are the screens where the conversation authors, so the dock must still open there.\n */\n viewpart: {\n show: false,\n persistent: true,\n expansionCompanion: { labelKey: 'ai-assistant.dock.title', defaultLabel: 'Assistant' },\n level: VIEWPART_LEVEL.TOPMOST,\n template: html`${dock}`\n },\n position: VIEWPART_POSITION.ASIDEBAR\n })\n\n store.dispatch({\n type: APPEND_APP_TOOL,\n tool: {\n name: 'assistant-dock-open',\n position: TOOL_POSITION.REAR,\n template: html`<ox-assistant-dock-button .viewpart=${viewpart}></ox-assistant-dock-button>`\n }\n })\n\n /* askAssistant() from any screen opens the dock. */\n window.addEventListener('assistant-dock-open', () => openOverlay(viewpart, { backdrop: false }))\n}\n"]}
|