@things-factory/ai-assistant 10.1.52 → 10.1.58

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.
@@ -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,CAAA;AAE9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAG/G,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAA5C;;QAyBuB,aAAQ,GAAG,uBAAuB,CAAA;QAC7C,WAAM,GAAG,CAAC,CAAA;IA6B7B,CAAC;aAtDQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;GAsBlB,AAtBY,CAsBZ;IAOD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAA;QAClC,IAAI,CAAC,WAAW,GAAG,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,IA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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 static styles = css`\n :host {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n }\n\n .badge {\n position: absolute;\n top: -4px;\n right: -6px;\n min-width: 14px;\n height: 14px;\n padding: 0 3px;\n box-sizing: border-box;\n border-radius: 7px;\n background: var(--md-sys-color-error);\n color: var(--md-sys-color-on-error);\n font-size: 9px;\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 return html`\n <md-icon\n title=${i18next.t('ai-assistant.dock.open', { defaultValue: 'Ask AI' })}\n @click=${() => openOverlay(this.viewpart, { backdrop: false })}\n >forum</md-icon\n >\n ${this.unread ? html`<span class=\"badge\">${this.unread}</span>` : nothing}\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 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 level: VIEWPART_LEVEL.TOPMOST,\n template: html`<ox-assistant-dock .viewpart=${viewpart}></ox-assistant-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"]}
1
+ {"version":3,"file":"setup-assistant-dock.js","sourceRo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AAC,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 height: 28px;\n min-width: 28px;\n padding: 0 8px;\n box-sizing: border-box;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 7px;\n background-color: var(--header-band-control-surface, var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface)));\n color: var(--md-sys-color-on-surface-variant);\n font: inherit;\n cursor: pointer;\n }\n\n button:hover {\n border-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-primary);\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 min-width: 15px;\n height: 15px;\n padding: 0 4px;\n box-sizing: border-box;\n border-radius: 8px;\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: 10px;\n font-weight: 700;\n line-height: 15px;\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 <md-icon aria-hidden=\"true\">forum</md-icon>\n ${this.unread ? html`<span class=\"count\">${this.unread > 99 ? '99+' : this.unread}</span>` : nothing}\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 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 level: VIEWPART_LEVEL.TOPMOST,\n template: html`<ox-assistant-dock .viewpart=${viewpart}></ox-assistant-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"]}