@123toto/ai-app-assistant-client 0.1.0

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.
@@ -0,0 +1,49 @@
1
+ import { type AiDocsClientOptions } from "./client.js";
2
+ import { type AiDocsControllerConfig } from "./controller.js";
3
+ export interface AiDocsWebComponentConfig extends AiDocsControllerConfig {
4
+ endpoint: string;
5
+ streamEndpoint?: string;
6
+ headers?: AiDocsClientOptions["headers"];
7
+ assistantName?: string;
8
+ launcherLabel?: string;
9
+ subtitle?: string;
10
+ mascot?: string;
11
+ }
12
+ declare const HTMLElementBase: typeof HTMLElement;
13
+ /**
14
+ * Framework-independent assistant UI built on browser standards only.
15
+ * Configure it with attributes or with `configure()` before/after connection.
16
+ */
17
+ export declare class AiDocsAssistantElement extends HTMLElementBase {
18
+ #private;
19
+ static readonly observedAttributes: string[];
20
+ connectedCallback(): void;
21
+ disconnectedCallback(): void;
22
+ attributeChangedCallback(): void;
23
+ /** Applies non-serializable options such as authorization headers. */
24
+ configure(config: AiDocsWebComponentConfig): void;
25
+ newConversation(): void;
26
+ /** Recreates the shared controller when attributes or runtime options change. */
27
+ private initialize;
28
+ private resolveConfig;
29
+ private render;
30
+ private renderConversation;
31
+ private renderComposer;
32
+ private readonly onClick;
33
+ private readonly onSubmit;
34
+ private readonly onInput;
35
+ private readonly onKeydown;
36
+ private ask;
37
+ private retry;
38
+ private selectElement;
39
+ private scrollToLatestQuestion;
40
+ }
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ "ai-docs-assistant": AiDocsAssistantElement;
44
+ }
45
+ }
46
+ /** Registers `<ai-docs-assistant>` once and returns its constructor. */
47
+ export declare function defineAiDocsAssistantElement(tagName?: string): typeof AiDocsAssistantElement;
48
+ export {};
49
+ //# sourceMappingURL=web-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../src/web-component.ts"],"names":[],"mappings":"AACA,OAAO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AC7C;CACF;AAED,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,OAAO,SAAsB,GAAG,OAAO,sBAAsB,CAGzG"}
@@ -0,0 +1,305 @@
1
+ import { createAiDocsClient } from "./client.js";
2
+ import { AiDocsAssistantController, normalizeAiDocsError } from "./controller.js";
3
+ // The subpath can be imported during SSR; the real base is selected only when
4
+ // the browser provides HTMLElement. Instances are created exclusively there.
5
+ const HTMLElementBase = typeof HTMLElement === "undefined"
6
+ ? class {
7
+ }
8
+ : HTMLElement;
9
+ /**
10
+ * Framework-independent assistant UI built on browser standards only.
11
+ * Configure it with attributes or with `configure()` before/after connection.
12
+ */
13
+ export class AiDocsAssistantElement extends HTMLElementBase {
14
+ static observedAttributes = [
15
+ "endpoint",
16
+ "stream-endpoint",
17
+ "assistant-name",
18
+ "launcher-label",
19
+ "subtitle",
20
+ "mascot",
21
+ "max-conversation-turns"
22
+ ];
23
+ #root = this.attachShadow({ mode: "open" });
24
+ #config = {};
25
+ #controller;
26
+ #unsubscribe;
27
+ #snapshot;
28
+ #open = false;
29
+ #question = "";
30
+ connectedCallback() {
31
+ this.setAttribute("data-ai-docs-ui", "");
32
+ this.#root.addEventListener("click", this.onClick);
33
+ this.#root.addEventListener("submit", this.onSubmit);
34
+ this.#root.addEventListener("input", this.onInput);
35
+ this.#root.addEventListener("keydown", this.onKeydown);
36
+ this.initialize();
37
+ }
38
+ disconnectedCallback() {
39
+ this.#root.removeEventListener("click", this.onClick);
40
+ this.#root.removeEventListener("submit", this.onSubmit);
41
+ this.#root.removeEventListener("input", this.onInput);
42
+ this.#root.removeEventListener("keydown", this.onKeydown);
43
+ this.#unsubscribe?.();
44
+ this.#controller?.stop();
45
+ this.#controller?.cancelElementSelection();
46
+ }
47
+ attributeChangedCallback() {
48
+ if (this.isConnected)
49
+ this.initialize();
50
+ }
51
+ /** Applies non-serializable options such as authorization headers. */
52
+ configure(config) {
53
+ this.#config = { ...this.#config, ...config };
54
+ if (this.isConnected)
55
+ this.initialize();
56
+ }
57
+ newConversation() {
58
+ this.#question = "";
59
+ this.#controller?.newConversation();
60
+ }
61
+ /** Recreates the shared controller when attributes or runtime options change. */
62
+ initialize() {
63
+ const config = this.resolveConfig();
64
+ if (!config.endpoint) {
65
+ this.#snapshot = undefined;
66
+ this.render("Missing ai-docs endpoint.");
67
+ return;
68
+ }
69
+ this.#unsubscribe?.();
70
+ this.#controller?.stop();
71
+ const client = createAiDocsClient({
72
+ endpoint: config.endpoint,
73
+ ...(config.streamEndpoint ? { streamEndpoint: config.streamEndpoint } : {}),
74
+ ...(config.headers ? { headers: config.headers } : {})
75
+ });
76
+ this.#controller = new AiDocsAssistantController(config, client);
77
+ this.#unsubscribe = this.#controller.subscribe((snapshot) => {
78
+ this.#snapshot = snapshot;
79
+ this.render();
80
+ this.dispatchEvent(new CustomEvent("ai-docs-state-change", {
81
+ detail: snapshot,
82
+ bubbles: true,
83
+ composed: true
84
+ }));
85
+ });
86
+ }
87
+ resolveConfig() {
88
+ const endpoint = this.#config.endpoint ?? this.getAttribute("endpoint") ?? "";
89
+ const streamEndpoint = this.#config.streamEndpoint ?? this.getAttribute("stream-endpoint") ?? undefined;
90
+ const turnsValue = this.#config.maxConversationTurns
91
+ ?? numberAttribute(this.getAttribute("max-conversation-turns"));
92
+ return {
93
+ ...this.#config,
94
+ endpoint,
95
+ ...(streamEndpoint ? { streamEndpoint } : {}),
96
+ ...(turnsValue ? { maxConversationTurns: turnsValue } : {}),
97
+ assistantName: this.#config.assistantName ?? this.getAttribute("assistant-name") ?? "AI assistant",
98
+ launcherLabel: this.#config.launcherLabel ?? this.getAttribute("launcher-label") ?? "Ask AI",
99
+ subtitle: this.#config.subtitle ?? this.getAttribute("subtitle") ?? "Help about this page",
100
+ mascot: this.#config.mascot ?? this.getAttribute("mascot") ?? "✦"
101
+ };
102
+ }
103
+ render(configurationError) {
104
+ const config = this.resolveConfig();
105
+ const labels = this.ownerDocument.documentElement.lang.toLowerCase().startsWith("fr")
106
+ ? FRENCH_LABELS
107
+ : ENGLISH_LABELS;
108
+ const snapshot = this.#snapshot;
109
+ this.#root.innerHTML = `<style>${STYLES}</style>
110
+ ${!this.#open ? `<button class="launcher" data-action="open" aria-label="${escapeHtml(config.launcherLabel ?? labels.open)}"><span>${escapeHtml(config.mascot ?? "✦")}</span><b>${escapeHtml(config.launcherLabel ?? labels.open)}</b></button>` : ""}
111
+ ${snapshot?.selecting ? `<div class="picker-hud" role="status">${labels.selection}<button data-action="cancel-selection">${labels.cancel}</button></div>` : ""}
112
+ ${this.#open ? `<aside class="panel" aria-label="${escapeHtml(config.assistantName ?? "AI assistant")}">
113
+ <header><span class="avatar">${escapeHtml(config.mascot ?? "✦")}</span><div><strong>${escapeHtml(config.assistantName ?? "AI assistant")}</strong><small>${escapeHtml(config.subtitle ?? "")}</small></div><nav><button data-action="new" title="${labels.newConversation}">↻</button><button data-action="close" title="${labels.close}">—</button></nav></header>
114
+ <main class="conversation">${configurationError ? `<div class="error">${escapeHtml(configurationError)}</div>` : this.renderConversation(snapshot, labels)}</main>
115
+ ${configurationError ? "" : this.renderComposer(snapshot, labels)}
116
+ </aside>` : ""}`;
117
+ queueMicrotask(() => this.scrollToLatestQuestion());
118
+ }
119
+ renderConversation(snapshot, labels) {
120
+ if (!snapshot)
121
+ return "";
122
+ const messages = snapshot.messages.map((message) => {
123
+ if (message.role === "selection") {
124
+ return `<article class="selection"><small>${labels.elementSelected}</small><strong>${escapeHtml(message.label)}</strong></article>`;
125
+ }
126
+ if (message.role === "user") {
127
+ return `<article class="message user" data-message-id="${message.id}"><p>${escapeHtml(message.text)}</p></article>`;
128
+ }
129
+ return renderResponse(message.response);
130
+ }).join("");
131
+ const state = snapshot.state;
132
+ const progress = state.status === "loading"
133
+ ? `<article class="message assistant"><div class="progress"><i></i><i></i><i></i><span>${labels[state.phase]}</span></div>${state.partialText ? `<p>${escapeHtml(state.partialText)}</p>` : ""}</article>`
134
+ : "";
135
+ const error = state.status === "error"
136
+ ? `<div class="error"><strong>${labels.error}</strong><span>${escapeHtml(state.error.message)}</span><button data-action="retry">${labels.retry}</button></div>`
137
+ : "";
138
+ return messages || progress || error
139
+ ? `${messages}${progress}${error}`
140
+ : `<div class="welcome"><strong>${labels.welcome}</strong><p>${labels.welcomeBody}</p></div>`;
141
+ }
142
+ renderComposer(snapshot, labels) {
143
+ const disabled = snapshot?.loading || snapshot?.conversationLimitReached;
144
+ return `<form class="composer">
145
+ ${snapshot?.conversationLimitReached ? `<div class="limit"><span>${labels.limit}</span><button type="button" data-action="new">${labels.newConversation}</button></div>` : ""}
146
+ ${snapshot?.selectedElementLabel ? `<div class="chip"><span>◎ ${escapeHtml(snapshot.selectedElementLabel)}</span><button type="button" data-action="clear-selection">×</button></div>` : ""}
147
+ <textarea maxlength="4000" rows="2" placeholder="${labels.placeholder}" ${disabled ? "disabled" : ""}>${escapeHtml(this.#question)}</textarea>
148
+ <div class="actions"><button type="button" data-action="select" ${disabled ? "disabled" : ""}>◎ ${labels.select}</button>${snapshot?.loading
149
+ ? `<button type="button" class="send" data-action="stop" aria-label="${labels.stop}">■</button>`
150
+ : `<button type="submit" class="send" ${snapshot?.conversationLimitReached ? "disabled" : ""} aria-label="${labels.send}">➤</button>`}</div>
151
+ </form>`;
152
+ }
153
+ onClick = (event) => {
154
+ const target = event.target?.closest("[data-action]");
155
+ if (!target)
156
+ return;
157
+ const action = target.dataset["action"];
158
+ if (action === "open") {
159
+ this.#open = true;
160
+ if (this.#controller?.syncPage())
161
+ this.#question = "";
162
+ this.render();
163
+ }
164
+ else if (action === "close") {
165
+ this.#open = false;
166
+ this.render();
167
+ }
168
+ else if (action === "new")
169
+ this.newConversation();
170
+ else if (action === "stop")
171
+ this.#controller?.stop();
172
+ else if (action === "retry")
173
+ void this.retry();
174
+ else if (action === "select")
175
+ void this.selectElement();
176
+ else if (action === "cancel-selection") {
177
+ this.#controller?.cancelElementSelection();
178
+ this.#open = true;
179
+ this.render();
180
+ }
181
+ else if (action === "clear-selection")
182
+ this.#controller?.clearSelectedElement();
183
+ };
184
+ onSubmit = (event) => {
185
+ event.preventDefault();
186
+ void this.ask();
187
+ };
188
+ onInput = (event) => {
189
+ if (event.target instanceof HTMLTextAreaElement)
190
+ this.#question = event.target.value;
191
+ };
192
+ onKeydown = (event) => {
193
+ if (event instanceof KeyboardEvent && event.target instanceof HTMLTextAreaElement
194
+ && event.key === "Enter" && !event.shiftKey) {
195
+ event.preventDefault();
196
+ void this.ask();
197
+ }
198
+ };
199
+ async ask() {
200
+ if (!this.#controller || this.#snapshot?.conversationLimitReached)
201
+ return;
202
+ const question = this.#question.trim();
203
+ this.#question = "";
204
+ try {
205
+ const response = await this.#controller.ask(question ? { question } : {});
206
+ this.dispatchEvent(new CustomEvent("ai-docs-answer", {
207
+ detail: response, bubbles: true, composed: true
208
+ }));
209
+ }
210
+ catch (error) {
211
+ const normalized = normalizeAiDocsError(error);
212
+ if (normalized.name !== "AbortError")
213
+ this.dispatchEvent(new CustomEvent("ai-docs-error", {
214
+ detail: normalized, bubbles: true, composed: true
215
+ }));
216
+ }
217
+ }
218
+ async retry() {
219
+ try {
220
+ await this.#controller?.retry();
221
+ }
222
+ catch { /* Controller state is rendered. */ }
223
+ }
224
+ async selectElement() {
225
+ if (!this.#controller)
226
+ return;
227
+ this.#open = false;
228
+ this.render();
229
+ try {
230
+ await this.#controller.selectElement();
231
+ }
232
+ catch (error) {
233
+ if (normalizeAiDocsError(error).name !== "AbortError")
234
+ throw error;
235
+ }
236
+ finally {
237
+ this.#open = true;
238
+ this.render();
239
+ }
240
+ }
241
+ scrollToLatestQuestion() {
242
+ // Keep the last question and the beginning of its answer visible together.
243
+ const conversation = this.#root.querySelector(".conversation");
244
+ const questions = this.#root.querySelectorAll("[data-message-id]");
245
+ const latest = questions.item(questions.length - 1);
246
+ if (!conversation || !latest)
247
+ return;
248
+ conversation.scrollTop = Math.max(0, latest.offsetTop - conversation.offsetTop - 6);
249
+ }
250
+ }
251
+ /** Registers `<ai-docs-assistant>` once and returns its constructor. */
252
+ export function defineAiDocsAssistantElement(tagName = "ai-docs-assistant") {
253
+ if (!customElements.get(tagName))
254
+ customElements.define(tagName, AiDocsAssistantElement);
255
+ return AiDocsAssistantElement;
256
+ }
257
+ function renderResponse(response) {
258
+ const title = response.answer.title ? `<h3>${escapeHtml(response.answer.title)}</h3>` : "";
259
+ const sections = response.answer.sections.map((section) => `<section><h4>${escapeHtml(section.heading)}</h4><p>${escapeHtml(section.content)}</p></section>`).join("");
260
+ const steps = response.answer.steps?.length
261
+ ? `<ol>${response.answer.steps.map((step) => `<li><strong>${escapeHtml(step.label)}</strong> ${escapeHtml(step.description)}</li>`).join("")}</ol>`
262
+ : "";
263
+ const warnings = (response.answer.warnings ?? []).map((warning) => `<p class="warning">⚠ ${escapeHtml(warning)}</p>`).join("");
264
+ return `<article class="message assistant">${title}<p>${escapeHtml(response.answer.summary)}</p>${sections}${steps}${warnings}<footer><i class="confidence ${response.confidence.level}"></i>${Math.round(response.confidence.score * 100)}%</footer></article>`;
265
+ }
266
+ function escapeHtml(value) {
267
+ return value.replace(/[&<>"']/g, (character) => ({
268
+ "&": "&amp;", "<": "&lt;", ">": "&gt;", "\"": "&quot;", "'": "&#039;"
269
+ })[character] ?? character);
270
+ }
271
+ function numberAttribute(value) {
272
+ if (!value)
273
+ return undefined;
274
+ const parsed = Number(value);
275
+ return Number.isFinite(parsed) ? parsed : undefined;
276
+ }
277
+ const ENGLISH_LABELS = {
278
+ open: "Ask AI", close: "Minimize", selection: "Select an element on the page", cancel: "Cancel",
279
+ newConversation: "New conversation", elementSelected: "Selected element", welcome: "How can I help?",
280
+ welcomeBody: "Ask about this page or select a specific element.", error: "The answer could not be generated.",
281
+ retry: "Retry", placeholder: "Ask your question…", select: "Select element", stop: "Stop generating",
282
+ send: "Send", limit: "Question limit reached. Start a new conversation to continue.",
283
+ preparing: "Reading the page…", thinking: "Thinking…", writing: "Writing the answer…", finalizing: "Checking the answer…"
284
+ };
285
+ const FRENCH_LABELS = {
286
+ open: "Demander à l’IA", close: "Réduire", selection: "Choisissez un élément dans la page", cancel: "Annuler",
287
+ newConversation: "Nouvelle conversation", elementSelected: "Élément sélectionné", welcome: "Comment puis-je vous aider ?",
288
+ welcomeBody: "Interrogez cette page ou sélectionnez un élément précis.", error: "La réponse n’a pas pu être générée.",
289
+ retry: "Réessayer", placeholder: "Posez votre question…", select: "Sélectionner un élément", stop: "Arrêter",
290
+ send: "Envoyer", limit: "Limite de questions atteinte. Démarrez une nouvelle conversation pour continuer.",
291
+ preparing: "Lecture de la page…", thinking: "Réflexion…", writing: "Rédaction…", finalizing: "Vérification…"
292
+ };
293
+ const STYLES = `
294
+ :host{--ai-accent:#14745b;--ai-surface:#fff;--ai-muted:#f4f7f6;--ai-text:#1f2925;--ai-border:#d8e0dc;position:fixed;right:20px;bottom:20px;z-index:9000;font:14px/1.45 system-ui,sans-serif;color:var(--ai-text)}
295
+ button,textarea{font:inherit}.launcher{display:flex;align-items:center;gap:0;width:50px;height:50px;padding:0;overflow:hidden;color:#fff;background:var(--ai-accent);border:0;border-radius:999px;box-shadow:0 8px 25px #0003,0 0 20px color-mix(in srgb,var(--ai-accent) 45%,transparent);cursor:pointer;transition:width .2s}.launcher:hover{width:132px}.launcher span{display:grid;flex:0 0 50px;place-items:center;font-size:20px}.launcher b{white-space:nowrap}
296
+ .panel{display:flex;flex-direction:column;width:min(380px,calc(100vw - 24px));height:min(580px,calc(100vh - 28px));overflow:hidden;background:var(--ai-surface);border:1px solid var(--ai-border);border-radius:16px;box-shadow:0 18px 55px #0003}.panel>header{display:flex;align-items:center;gap:9px;padding:12px;color:#fff;background:linear-gradient(135deg,var(--ai-accent),color-mix(in srgb,var(--ai-accent) 65%,#000))}.avatar{display:grid;width:32px;height:32px;place-items:center;background:#ffffff20;border-radius:50%}.panel header div{display:flex;flex:1;flex-direction:column}.panel header small{opacity:.8}.panel nav{display:flex}.panel nav button{color:inherit;background:none;border:0;cursor:pointer}
297
+ .conversation{flex:1;padding:12px;overflow:auto;background:var(--ai-muted)}.welcome,.message,.selection,.error{margin-bottom:10px;padding:11px;background:var(--ai-surface);border:1px solid var(--ai-border);border-radius:12px}.welcome p,.message p{margin:4px 0}.user{max-width:82%;margin-left:auto;color:#fff;background:var(--ai-accent);border-color:transparent}.assistant h3{margin:0 0 9px;padding-bottom:7px;font-size:15px;border-bottom:1px solid var(--ai-border)}.assistant section{margin-top:12px}.assistant h4{margin:0 0 4px;font-size:13px}.assistant footer{display:flex;align-items:center;gap:6px;margin-top:10px;padding-top:8px;color:#66736d;border-top:1px solid var(--ai-border);font-size:11px}.confidence{width:8px;height:8px;background:#888;border-radius:50%}.confidence.high{background:#238636}.confidence.medium{background:#d29922}.confidence.low{background:#da3633}.selection{display:flex;flex-direction:column;color:#3646a0;background:#eef0ff}.error{display:flex;flex-direction:column;gap:7px;color:#a43737;background:#fff1f0;border-color:#efb4af}.error button{align-self:flex-start;color:#fff;background:#a43737;border:0;border-radius:7px;padding:6px 9px}.progress{display:flex;align-items:center;gap:5px}.progress i{width:5px;height:5px;background:var(--ai-accent);border-radius:50%;animation:wave 1s infinite}.progress i:nth-child(2){animation-delay:.14s}.progress i:nth-child(3){animation-delay:.28s}
298
+ .composer{padding:10px;background:var(--ai-surface);border-top:1px solid var(--ai-border)}textarea{box-sizing:border-box;width:100%;padding:9px;resize:none;color:var(--ai-text);background:var(--ai-muted);border:1px solid var(--ai-border);border-radius:10px}.actions{display:flex;justify-content:space-between;margin-top:7px}.actions button,.limit button{padding:6px 9px;color:var(--ai-accent);background:var(--ai-surface);border:1px solid var(--ai-border);border-radius:8px}.actions .send{color:#fff;background:var(--ai-accent);border-color:transparent;border-radius:50%}.chip,.limit{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;padding:7px 8px;background:var(--ai-muted);border:1px solid var(--ai-border);border-radius:9px;font-size:12px}.chip button{background:none;border:0}.picker-hud{position:fixed;right:20px;bottom:20px;display:flex;align-items:center;gap:8px;padding:10px 12px;color:#fff;background:#17231f;border-radius:10px;box-shadow:0 8px 25px #0003}.picker-hud button{color:inherit;background:none;border:1px solid #ffffff55;border-radius:6px}
299
+ @media(prefers-color-scheme:dark){:host{--ai-surface:#1d2321;--ai-muted:#151a18;--ai-text:#edf2ef;--ai-border:#39443f}.error{background:#3c2020}}
300
+ @keyframes wave{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
301
+ `;
302
+ // Importing the browser-only subpath is enough for the zero-configuration use case.
303
+ if (typeof customElements !== "undefined")
304
+ defineAiDocsAssistantElement();
305
+ //# sourceMappingURL=web-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-component.js","sourceRoot":"","sources":["../src/web-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAA4B,MAAM,aAAa,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EAGrB,MAAM,iBAAiB,CAAC;AAYzB,8EAA8E;AAC9E,6EAA6E;AAC7E,MAAM,eAAe,GAAuB,OAAO,WAAW,KAAK,WAAW;IAC5E,CAAC,CAAC;KAA8B;IAChC,CAAC,CAAC,WAAW,CAAC;AAEhB;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IACzD,MAAM,CAAU,kBAAkB,GAAG;QACnC,UAAU;QACV,iBAAiB;QACjB,gBAAgB;QAChB,gBAAgB;QAChB,UAAU;QACV,QAAQ;QACR,wBAAwB;KACzB,CAAC;IAEO,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD,OAAO,GAAsC,EAAE,CAAC;IAChD,WAAW,CAAwC;IACnD,YAAY,CAA2B;IACvC,SAAS,CAAuC;IAChD,KAAK,GAAG,KAAK,CAAC;IACd,SAAS,GAAG,EAAE,CAAC;IAER,iBAAiB;QACtB,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,KAA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,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,oCAAoC,EAAE,MAAM,EAAE,SAAS;IAC7G,eAAe,EAAE,uBAAuB,EAAE,eAAe,EAAE,qBAAqB,EAAE,OAAO,EAAE,8BAA8B;IACzH,WAAW,EAAE,0DAA0D,EAAE,KAAK,EAAE,qCAAqC;IACrH,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,EAAE,yBAAyB,EAAE,IAAI,EAAE,SAAS;IAC5G,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,kFAAkF;IAC1G,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe;CAC7G,CAAC;AAEF,MAAM,MAAM,GAAG;;;;;;;;CAQd,CAAC;AAEF,oFAAoF;AACpF,IAAI,OAAO,cAAc,KAAK,WAAW;IAAE,4BAA4B,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@123toto/ai-app-assistant-client",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "description": "Framework-neutral browser client and UI for contextual in-app AI assistants",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/123toto/ai-docs-asker.git",
9
+ "directory": "packages/client-core"
10
+ },
11
+ "homepage": "https://github.com/123toto/ai-docs-asker#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/123toto/ai-docs-asker/issues"
14
+ },
15
+ "keywords": [
16
+ "ai",
17
+ "documentation",
18
+ "assistant",
19
+ "web-component",
20
+ "angular"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "type": "module",
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
33
+ "./angular": {
34
+ "types": "./dist/angular.d.ts",
35
+ "import": "./dist/angular.js"
36
+ },
37
+ "./web-component": {
38
+ "types": "./dist/web-component.d.ts",
39
+ "import": "./dist/web-component.js"
40
+ },
41
+ "./settings": {
42
+ "types": "./dist/settings.d.ts",
43
+ "import": "./dist/settings.js"
44
+ },
45
+ "./settings-web-component": {
46
+ "types": "./dist/settings-web-component.d.ts",
47
+ "import": "./dist/settings-web-component.js"
48
+ }
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "README.md",
53
+ "LICENSE"
54
+ ],
55
+ "dependencies": {
56
+ "@123toto/ai-app-assistant-contracts": "0.1.0"
57
+ },
58
+ "peerDependencies": {
59
+ "@angular/common": ">=19 <22",
60
+ "@angular/core": ">=19 <22",
61
+ "rxjs": "^7.8.0"
62
+ },
63
+ "peerDependenciesMeta": {
64
+ "@angular/common": {
65
+ "optional": true
66
+ },
67
+ "@angular/core": {
68
+ "optional": true
69
+ },
70
+ "rxjs": {
71
+ "optional": true
72
+ }
73
+ },
74
+ "devDependencies": {
75
+ "@angular/common": "^20.0.0",
76
+ "@angular/compiler": "^20.0.0",
77
+ "@angular/compiler-cli": "^20.0.0",
78
+ "@angular/core": "^20.0.0",
79
+ "rxjs": "^7.8.0",
80
+ "happy-dom": "^18.0.0"
81
+ },
82
+ "scripts": {
83
+ "build": "ngc -p tsconfig.json",
84
+ "clean": "rm -rf dist",
85
+ "dev": "ngc -p tsconfig.json --watch --preserveWatchOutput",
86
+ "test": "vitest run",
87
+ "typecheck": "tsc -p tsconfig.json --noEmit"
88
+ }
89
+ }