@things-factory/ai-assistant 10.1.269 → 10.1.271
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/setup-assistant-dock.ts +30 -15
- 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-server/service/assistant-chat-resolver.js +1 -1
- package/dist-server/service/assistant-chat-resolver.js.map +1 -1
- 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-resolver.js +1 -1
- package/dist-server/service/chat-session-resolver.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/server/service/assistant-chat-resolver.ts +1 -1
- 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-resolver.ts +1 -1
|
@@ -40,23 +40,32 @@ export class AssistantDockButton extends LitElement {
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
42
|
gap: 6px;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/* an icon alone: the band's 32px square (app-header-band .ctl.icon) */
|
|
44
|
+
height: 32px;
|
|
45
|
+
min-width: 32px;
|
|
46
|
+
padding: 0;
|
|
46
47
|
box-sizing: border-box;
|
|
47
|
-
|
|
48
|
-
border
|
|
49
|
-
|
|
48
|
+
/* the header band's control shape (apptool-ui app-header-band .ctl): no plate, no edge, a soft tint on hover */
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: 999px;
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
transition: background-color 120ms ease;
|
|
50
53
|
color: var(--md-sys-color-on-surface-variant);
|
|
51
54
|
font: inherit;
|
|
52
55
|
cursor: pointer;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
button:hover {
|
|
56
|
-
|
|
59
|
+
background-color: var(--header-band-control-hover, color-mix(in srgb, var(--md-sys-color-on-surface) 7%, transparent));
|
|
57
60
|
color: var(--md-sys-color-primary);
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
/* The count hangs on the icon's top right, as the bell's does. */
|
|
64
|
+
.icon-with-count {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
button:focus-visible {
|
|
61
70
|
outline: 2px solid var(--md-sys-color-primary);
|
|
62
71
|
outline-offset: 2px;
|
|
@@ -70,16 +79,20 @@ export class AssistantDockButton extends LitElement {
|
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
.count {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: -6px;
|
|
84
|
+
left: 10px;
|
|
85
|
+
min-width: 14px;
|
|
86
|
+
height: 14px;
|
|
87
|
+
padding: 0 3px;
|
|
76
88
|
box-sizing: border-box;
|
|
77
|
-
border-radius:
|
|
89
|
+
border-radius: 7px;
|
|
90
|
+
box-shadow: 0 0 0 1.5px var(--header-band-surface, var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface)));
|
|
78
91
|
background-color: var(--header-band-count-background, var(--md-sys-color-error));
|
|
79
92
|
color: var(--header-band-count-color, var(--md-sys-color-on-error));
|
|
80
|
-
font-size:
|
|
93
|
+
font-size: 9.5px;
|
|
81
94
|
font-weight: 700;
|
|
82
|
-
line-height:
|
|
95
|
+
line-height: 14px;
|
|
83
96
|
text-align: center;
|
|
84
97
|
}
|
|
85
98
|
`
|
|
@@ -108,8 +121,10 @@ export class AssistantDockButton extends LitElement {
|
|
|
108
121
|
const label = i18next.t('ai-assistant.dock.open', { defaultValue: 'Ask AI' })
|
|
109
122
|
return html`
|
|
110
123
|
<button title=${label} aria-label=${label} @click=${() => openOverlay(this.viewpart, { backdrop: false })}>
|
|
111
|
-
<
|
|
112
|
-
|
|
124
|
+
<span class="icon-with-count">
|
|
125
|
+
<md-icon aria-hidden="true">forum</md-icon>
|
|
126
|
+
${this.unread ? html`<span class="count">${this.unread > 99 ? '99+' : this.unread}</span>` : nothing}
|
|
127
|
+
</span>
|
|
113
128
|
</button>
|
|
114
129
|
`
|
|
115
130
|
}
|
|
@@ -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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BAAqB,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"]}
|