@nonoun/native-chat 0.5.9 → 0.5.12
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/package.json +1 -1
- package/dist/avatar/chat-avatar-element.d.ts +0 -18
- package/dist/avatar/chat-avatar-element.d.ts.map +0 -1
- package/dist/avatar/index.d.ts +0 -2
- package/dist/avatar/index.d.ts.map +0 -1
- package/dist/avatar/n-chat-avatar.d.ts +0 -2
- package/dist/avatar/n-chat-avatar.d.ts.map +0 -1
- package/dist/chat-input-element.d.ts +0 -31
- package/dist/chat-input-element.d.ts.map +0 -1
- package/dist/chat-panel-element.d.ts +0 -67
- package/dist/chat-panel-element.d.ts.map +0 -1
- package/dist/feed/chat-feed-element.d.ts +0 -48
- package/dist/feed/chat-feed-element.d.ts.map +0 -1
- package/dist/feed/index.d.ts +0 -2
- package/dist/feed/index.d.ts.map +0 -1
- package/dist/feed/n-chat-feed.d.ts +0 -2
- package/dist/feed/n-chat-feed.d.ts.map +0 -1
- package/dist/index.d.ts +0 -18
- package/dist/index.d.ts.map +0 -1
- package/dist/message/chat-input-structured-element.d.ts +0 -43
- package/dist/message/chat-input-structured-element.d.ts.map +0 -1
- package/dist/message/chat-message-activity-element.d.ts +0 -32
- package/dist/message/chat-message-activity-element.d.ts.map +0 -1
- package/dist/message/chat-message-element.d.ts +0 -44
- package/dist/message/chat-message-element.d.ts.map +0 -1
- package/dist/message/chat-message-genui-element.d.ts +0 -45
- package/dist/message/chat-message-genui-element.d.ts.map +0 -1
- package/dist/message/chat-message-seed-element.d.ts +0 -33
- package/dist/message/chat-message-seed-element.d.ts.map +0 -1
- package/dist/message/chat-message-text-element.d.ts +0 -37
- package/dist/message/chat-message-text-element.d.ts.map +0 -1
- package/dist/message/chat-messages-element.d.ts +0 -39
- package/dist/message/chat-messages-element.d.ts.map +0 -1
- package/dist/message/index.d.ts +0 -8
- package/dist/message/index.d.ts.map +0 -1
- package/dist/message/n-chat-message.d.ts +0 -2
- package/dist/message/n-chat-message.d.ts.map +0 -1
- package/dist/register.d.ts +0 -13
- package/dist/register.d.ts.map +0 -1
- package/dist/stream/classify.d.ts +0 -19
- package/dist/stream/classify.d.ts.map +0 -1
- package/dist/stream/create-transport.d.ts +0 -19
- package/dist/stream/create-transport.d.ts.map +0 -1
- package/dist/stream/index.d.ts +0 -9
- package/dist/stream/index.d.ts.map +0 -1
- package/dist/stream/parse-json.d.ts +0 -9
- package/dist/stream/parse-json.d.ts.map +0 -1
- package/dist/stream/parse-ndjson.d.ts +0 -9
- package/dist/stream/parse-ndjson.d.ts.map +0 -1
- package/dist/stream/parse-sse.d.ts +0 -9
- package/dist/stream/parse-sse.d.ts.map +0 -1
- package/dist/stream/types.d.ts +0 -42
- package/dist/stream/types.d.ts.map +0 -1
- package/dist/telemetry/emitter.d.ts +0 -20
- package/dist/telemetry/emitter.d.ts.map +0 -1
- package/dist/telemetry/events.d.ts +0 -11
- package/dist/telemetry/events.d.ts.map +0 -1
- package/dist/telemetry/index.d.ts +0 -5
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/redactor.d.ts +0 -17
- package/dist/telemetry/redactor.d.ts.map +0 -1
- package/dist/telemetry/types.d.ts +0 -27
- package/dist/telemetry/types.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Chat avatar — renders an image, icon, or initials for a chat participant.
|
|
4
|
-
*
|
|
5
|
-
* Priority: `src` (image) → `icon` (phosphor icon) → `name` (initials) → default icon.
|
|
6
|
-
*
|
|
7
|
-
* @attr {string} src - Image URL
|
|
8
|
-
* @attr {string} name - Display name (used for initials fallback)
|
|
9
|
-
* @attr {string} icon - Phosphor icon name
|
|
10
|
-
*/
|
|
11
|
-
export declare class NChatAvatar extends NativeElement {
|
|
12
|
-
#private;
|
|
13
|
-
static observedAttributes: string[];
|
|
14
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
15
|
-
setup(): void;
|
|
16
|
-
teardown(): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=chat-avatar-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-avatar-element.d.ts","sourceRoot":"","sources":["../../src/avatar/chat-avatar-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,aAAa;;IAC5C,MAAM,CAAC,kBAAkB,WAA2B;IAMpD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUpF,KAAK,IAAI,IAAI;IA2Cb,QAAQ,IAAI,IAAI;CAIjB"}
|
package/dist/avatar/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"n-chat-avatar.d.ts","sourceRoot":"","sources":["../../src/avatar/n-chat-avatar.ts"],"names":[],"mappings":""}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Chat message input with textarea, submit button, and Enter-to-send behavior.
|
|
4
|
-
* @attr {boolean} disabled - Disables interaction
|
|
5
|
-
* @attr {boolean} busy - Disables submit but keeps textarea enabled
|
|
6
|
-
* @attr {boolean} no-enter-submit - Disables Enter key submission
|
|
7
|
-
* @attr {boolean} no-auto-clear - Prevents clearing the textarea after send
|
|
8
|
-
* @fires native:send - Fired on submit with `{ value }` detail
|
|
9
|
-
* @fires native:composer-submit-blocked - Fired when submit is attempted while busy
|
|
10
|
-
* @fires native:composer-focus - Fired when the composer textarea gains focus
|
|
11
|
-
* @fires native:composer-blur - Fired when the composer textarea loses focus
|
|
12
|
-
*/
|
|
13
|
-
export declare class NChatInput extends NativeElement {
|
|
14
|
-
#private;
|
|
15
|
-
static observedAttributes: string[];
|
|
16
|
-
constructor();
|
|
17
|
-
get value(): string;
|
|
18
|
-
set value(val: string);
|
|
19
|
-
get disabled(): boolean;
|
|
20
|
-
set disabled(val: boolean);
|
|
21
|
-
get busy(): boolean;
|
|
22
|
-
set busy(val: boolean);
|
|
23
|
-
/** Focus the composer textarea. */
|
|
24
|
-
focusComposer(): void;
|
|
25
|
-
/** Blur the composer textarea. */
|
|
26
|
-
blurComposer(): void;
|
|
27
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
28
|
-
setup(): void;
|
|
29
|
-
teardown(): void;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=chat-input-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-element.d.ts","sourceRoot":"","sources":["../src/chat-input-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,mBAAmB,CAAC;AAGhF;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,aAAa;;IAC3C,MAAM,CAAC,kBAAkB,WAAwB;;IAejD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAEpB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,IAAI,CAAC,GAAG,EAAE,OAAO,EAGpB;IAED,mCAAmC;IACnC,aAAa,IAAI,IAAI;IAKrB,kCAAkC;IAClC,YAAY,IAAI,IAAI;IAOpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAepF,KAAK,IAAI,IAAI;IA2Cb,QAAQ,IAAI,IAAI;CAkHjB"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
export type AutoFocusPolicy = 'open-request' | 'ready' | 'never';
|
|
3
|
-
export interface ChatPanelOpenOptions {
|
|
4
|
-
focusComposer?: boolean;
|
|
5
|
-
reason?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface FocusComposerOptions {
|
|
8
|
-
cursor?: 'start' | 'end' | 'preserve';
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Stamped panel for the chat interface.
|
|
12
|
-
*
|
|
13
|
-
* Creates `<n-header>` (icon, title), `<n-body>` containing
|
|
14
|
-
* `<n-chat-content>`, and `<n-footer>` with `<n-chat-input>` directly
|
|
15
|
-
* as children. The host element itself is the panel surface.
|
|
16
|
-
*
|
|
17
|
-
* ## Extension Points
|
|
18
|
-
*
|
|
19
|
-
* **Header trailing slot** — move consumer-provided controls into the header:
|
|
20
|
-
* ```html
|
|
21
|
-
* <native-chat-panel>
|
|
22
|
-
* <div slot="header-trailing"><n-button variant="ghost">Custom</n-button></div>
|
|
23
|
-
* </native-chat-panel>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* **Footer leading slot** — insert content before the chat input:
|
|
27
|
-
* ```html
|
|
28
|
-
* <native-chat-panel>
|
|
29
|
-
* <div slot="footer-leading">Powered by AI</div>
|
|
30
|
-
* </native-chat-panel>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* **Stop / Restart buttons** — toggle via attributes:
|
|
34
|
-
* ```html
|
|
35
|
-
* <native-chat-panel show-stop></native-chat-panel>
|
|
36
|
-
* ```
|
|
37
|
-
* @attr {boolean} show-stop - Show a stop button in the header; fires `native:chat-stop`
|
|
38
|
-
* @attr {boolean} show-restart - Show a restart button in the header; fires `native:chat-restart`
|
|
39
|
-
* @attr {string} auto-focus-policy - When to auto-focus the composer: 'open-request' (default), 'ready', 'never'
|
|
40
|
-
* @fires native:chat-stop - Fired when the stop button is pressed
|
|
41
|
-
* @fires native:chat-restart - Fired when the restart button is pressed
|
|
42
|
-
* @fires native:send - Fired on submit with `{ value }` detail
|
|
43
|
-
* @fires native:chat-opened - Fired when the panel opens
|
|
44
|
-
* @fires native:chat-closed - Fired when the panel closes
|
|
45
|
-
* @fires native:composer-focused - Fired when the composer receives focus via API/policy
|
|
46
|
-
* @fires native:composer-focus-failed - Fired when focusComposer() fails after retries
|
|
47
|
-
*/
|
|
48
|
-
export declare class NChatPanel extends NativeElement {
|
|
49
|
-
#private;
|
|
50
|
-
static observedAttributes: string[];
|
|
51
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
52
|
-
get showStop(): boolean;
|
|
53
|
-
set showStop(val: boolean);
|
|
54
|
-
get showRestart(): boolean;
|
|
55
|
-
set showRestart(val: boolean);
|
|
56
|
-
get autoFocusPolicy(): AutoFocusPolicy;
|
|
57
|
-
set autoFocusPolicy(val: AutoFocusPolicy);
|
|
58
|
-
/** Open the panel. Optionally focus the composer. */
|
|
59
|
-
open(options?: ChatPanelOpenOptions): void;
|
|
60
|
-
/** Close the panel. */
|
|
61
|
-
close(reason?: string): void;
|
|
62
|
-
/** Focus the composer input. */
|
|
63
|
-
focusComposer(options?: FocusComposerOptions, by?: 'api' | 'user' | 'policy'): void;
|
|
64
|
-
setup(): void;
|
|
65
|
-
teardown(): void;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=chat-panel-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-panel-element.d.ts","sourceRoot":"","sources":["../src/chat-panel-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAI1D,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,UAAW,SAAQ,aAAa;;IAC3C,MAAM,CAAC,kBAAkB,WAA8D;IAevF,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA4BpF,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAED,IAAI,WAAW,IAAI,OAAO,CAAoC;IAC9D,IAAI,WAAW,CAAC,GAAG,EAAE,OAAO,EAG3B;IAED,IAAI,eAAe,IAAI,eAAe,CAAwC;IAC9E,IAAI,eAAe,CAAC,GAAG,EAAE,eAAe,EAGvC;IAED,qDAAqD;IACrD,IAAI,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI;IAkB1C,uBAAuB;IACvB,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAU5B,gCAAgC;IAChC,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,EAAE,EAAE,GAAE,KAAK,GAAG,MAAM,GAAG,QAAgB,GAAG,IAAI;IAM1F,KAAK,IAAI,IAAI;IA0Ib,QAAQ,IAAI,IAAI;CA2JjB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Chat feed coordinator — scrollable thread of message groups.
|
|
4
|
-
*
|
|
5
|
-
* Wraps `n-chat-messages` groups and manages auto-scroll behavior.
|
|
6
|
-
* When pinned to bottom, new content automatically scrolls into view.
|
|
7
|
-
*
|
|
8
|
-
* ```html
|
|
9
|
-
* <n-chat-feed auto-scroll>
|
|
10
|
-
* <n-chat-messages role="assistant">...</n-chat-messages>
|
|
11
|
-
* <n-chat-messages role="user">...</n-chat-messages>
|
|
12
|
-
* </n-chat-feed>
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* ### Virtualization (opt-in)
|
|
16
|
-
*
|
|
17
|
-
* ```html
|
|
18
|
-
* <n-chat-feed virtual virtual-item-height="80" virtual-overscan="8">
|
|
19
|
-
* </n-chat-feed>
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* Set `items` and `itemRenderer` properties for programmatic data-driven rendering.
|
|
23
|
-
*
|
|
24
|
-
* @attr {boolean} auto-scroll - Enable auto-scroll to bottom on new content (default: true)
|
|
25
|
-
* @attr {boolean} virtual - Enable virtual scroll windowing
|
|
26
|
-
* @attr {string} virtual-item-height - Estimated item height in px (default: 80)
|
|
27
|
-
* @attr {string} virtual-overscan - Number of extra items to render outside viewport (default: 5)
|
|
28
|
-
* @fires native:feed-scroll - Fired when scroll pinned state changes
|
|
29
|
-
* @fires native:range-change - Fired when virtual scroll range changes
|
|
30
|
-
*/
|
|
31
|
-
export declare class NChatFeed extends NativeElement {
|
|
32
|
-
#private;
|
|
33
|
-
static observedAttributes: string[];
|
|
34
|
-
constructor();
|
|
35
|
-
get isPinned(): boolean;
|
|
36
|
-
/** Scroll to the bottom of the feed. */
|
|
37
|
-
scrollToBottom(smooth?: boolean): void;
|
|
38
|
-
/** Data items for virtual rendering. */
|
|
39
|
-
get items(): unknown[];
|
|
40
|
-
set items(val: unknown[]);
|
|
41
|
-
/** Callback that creates an HTMLElement from a data item. */
|
|
42
|
-
get itemRenderer(): ((item: unknown, index: number) => HTMLElement) | null;
|
|
43
|
-
set itemRenderer(fn: ((item: unknown, index: number) => HTMLElement) | null);
|
|
44
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
45
|
-
setup(): void;
|
|
46
|
-
teardown(): void;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=chat-feed-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-feed-element.d.ts","sourceRoot":"","sources":["../../src/feed/chat-feed-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmC,MAAM,mBAAmB,CAAC;AAInF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,SAAU,SAAQ,aAAa;;IAC1C,MAAM,CAAC,kBAAkB,WAAuF;;IAoBhH,IAAI,QAAQ,IAAI,OAAO,CAAiC;IAExD,wCAAwC;IACxC,cAAc,CAAC,MAAM,UAAO,GAAG,IAAI;IAQnC,wCAAwC;IACxC,IAAI,KAAK,IAAI,OAAO,EAAE,CAA8B;IACpD,IAAI,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,EAKvB;IAED,6DAA6D;IAC7D,IAAI,YAAY,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,IAAI,CAA+B;IACzG,IAAI,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG,IAAI,EAE1E;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA0BpF,KAAK,IAAI,IAAI;IAiCb,QAAQ,IAAI,IAAI;CA6HjB"}
|
package/dist/feed/index.d.ts
DELETED
package/dist/feed/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"n-chat-feed.d.ts","sourceRoot":"","sources":["../../src/feed/n-chat-feed.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import './register.ts';
|
|
2
|
-
export { NChatInput } from './chat-input-element.ts';
|
|
3
|
-
export { NChatPanel } from './chat-panel-element.ts';
|
|
4
|
-
export type { AutoFocusPolicy, ChatPanelOpenOptions, FocusComposerOptions } from './chat-panel-element.ts';
|
|
5
|
-
export { NChatFeed } from './feed/index.ts';
|
|
6
|
-
export { NChatAvatar } from './avatar/index.ts';
|
|
7
|
-
export { NChatMessage, NChatMessages, NChatMessageText, NChatMessageActivity, NChatMessageSeed, NChatMessageGenUI, NChatInputStructured, } from './message/index.ts';
|
|
8
|
-
export type { ChatMessageActionDef } from './message/chat-message-element.ts';
|
|
9
|
-
export { ACTION_REGISTRY, ROLE_DEFAULTS } from './message/chat-message-element.ts';
|
|
10
|
-
export type { SeedOption } from './message/chat-message-seed-element.ts';
|
|
11
|
-
export type { StructuredOption } from './message/chat-input-structured-element.ts';
|
|
12
|
-
export type { GenUINode } from './message/chat-message-genui-element.ts';
|
|
13
|
-
export { renderMarkdown, renderInline, sanitizeHtml } from './message/chat-message-text-element.ts';
|
|
14
|
-
export type { ChatStreamChunk, StreamFormat, ChatTransportOptions, ChatStreamEvent, ChatTransport, TransportState, TransportStatus, TransportStateCallback, RetryOptions, StreamEndReason, } from './stream/index.ts';
|
|
15
|
-
export { parseSSE, parseNDJSON, parseJSON, detectFormat, createChatStream, createChatTransport, classifyStreamEnd, classifyHttpError, backoffDelay, } from './stream/index.ts';
|
|
16
|
-
export type { TelemetryCorrelation, TelemetryTiming, TelemetryRetry, TelemetryLevel, TelemetryEvent, TelemetryRedactor, } from './telemetry/index.ts';
|
|
17
|
-
export { CHAT_EVENTS, SAFE_FIELDS, SENSITIVE_FIELDS, scrubPII, createDefaultRedactor, TelemetryEmitter, } from './telemetry/index.ts';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGnF,YAAY,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,YAAY,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAGpG,YAAY,EACV,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
export interface StructuredOption {
|
|
3
|
-
value: string;
|
|
4
|
-
label: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Structured multi-choice input — appears before submission for
|
|
10
|
-
* guided input (like modern Claude chat's multiple-choice UI).
|
|
11
|
-
*
|
|
12
|
-
* ```html
|
|
13
|
-
* <n-chat-input-structured
|
|
14
|
-
* question="What would you like to do?"
|
|
15
|
-
* type="single"
|
|
16
|
-
* options='[{"value":"a","label":"Option A"},{"value":"b","label":"Option B"}]'>
|
|
17
|
-
* </n-chat-input-structured>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @attr {string} question - Prompt text
|
|
21
|
-
* @attr {string} type - `single` (default) | `multi`
|
|
22
|
-
* @attr {string} options - JSON array of `{ value, label, description?, icon? }`
|
|
23
|
-
* @attr {boolean} required - At least one selection required before submit
|
|
24
|
-
* @attr {boolean} disabled - Disables interaction
|
|
25
|
-
* @fires native:structured-submit - Fired on submit with selections
|
|
26
|
-
* @fires native:structured-cancel - Fired when dismissed without selecting
|
|
27
|
-
*/
|
|
28
|
-
export declare class NChatInputStructured extends NativeElement {
|
|
29
|
-
#private;
|
|
30
|
-
static observedAttributes: string[];
|
|
31
|
-
constructor();
|
|
32
|
-
get question(): string;
|
|
33
|
-
set question(val: string);
|
|
34
|
-
get options(): StructuredOption[];
|
|
35
|
-
set options(val: StructuredOption[]);
|
|
36
|
-
get selections(): StructuredOption[];
|
|
37
|
-
get disabled(): boolean;
|
|
38
|
-
set disabled(val: boolean);
|
|
39
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
40
|
-
setup(): void;
|
|
41
|
-
teardown(): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=chat-input-structured-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-structured-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-input-structured-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,mBAAmB,CAAC;AAEhF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;;IACrD,MAAM,CAAC,kBAAkB,WAA2D;;IAiBpF,IAAI,QAAQ,IAAI,MAAM,CAAiC;IACvD,IAAI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAGvB;IAED,IAAI,OAAO,IAAI,gBAAgB,EAAE,CAAgC;IACjE,IAAI,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,EAGlC;IAED,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAGnC;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAiBpF,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,IAAI;CA0HjB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Streaming activity indicator — typing, thinking, or tool-use status.
|
|
4
|
-
*
|
|
5
|
-
* When `active`, shows an animated indicator with elapsed time.
|
|
6
|
-
* When `expandable`, clicking toggles visibility of slotted trace content.
|
|
7
|
-
*
|
|
8
|
-
* ```html
|
|
9
|
-
* <n-chat-message-activity type="thinking" active>
|
|
10
|
-
* <pre>Reasoning trace here...</pre>
|
|
11
|
-
* </n-chat-message-activity>
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @attr {string} type - `typing` | `thinking` | `tool-use`
|
|
15
|
-
* @attr {string} label - Custom label text (overrides default per-type label)
|
|
16
|
-
* @attr {boolean} active - Currently streaming / in progress
|
|
17
|
-
* @attr {boolean} expandable - Allow click to expand trace content
|
|
18
|
-
* @fires native:activity-toggle - Fired when trace is expanded/collapsed
|
|
19
|
-
*/
|
|
20
|
-
export declare class NChatMessageActivity extends NativeElement {
|
|
21
|
-
#private;
|
|
22
|
-
static observedAttributes: string[];
|
|
23
|
-
constructor();
|
|
24
|
-
get active(): boolean;
|
|
25
|
-
set active(val: boolean);
|
|
26
|
-
get expanded(): boolean;
|
|
27
|
-
set expanded(val: boolean);
|
|
28
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
29
|
-
setup(): void;
|
|
30
|
-
teardown(): void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=chat-message-activity-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-activity-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-activity-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;;IACrD,MAAM,CAAC,kBAAkB,WAA6C;;IAsBtE,IAAI,MAAM,IAAI,OAAO,CAA+B;IACpD,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,EAGtB;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAapF,KAAK,IAAI,IAAI;IAyCb,QAAQ,IAAI,IAAI;CAmFjB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
export interface ChatMessageActionDef {
|
|
3
|
-
label: string;
|
|
4
|
-
icon: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const ACTION_REGISTRY: Record<string, ChatMessageActionDef>;
|
|
7
|
-
export declare const ROLE_DEFAULTS: Record<string, string[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Individual chat message bubble.
|
|
10
|
-
*
|
|
11
|
-
* Accepts slotted content: `n-chat-message-text`, `n-chat-message-genui`,
|
|
12
|
-
* `n-chat-message-seed`, or any custom content.
|
|
13
|
-
*
|
|
14
|
-
* @attr {string} role - `user` | `assistant` | `system`
|
|
15
|
-
* @attr {string} message-id - Unique message identifier
|
|
16
|
-
* @attr {string} timestamp - Epoch milliseconds
|
|
17
|
-
* @attr {string} status - `sending` | `sent` | `error` | `streaming` | `partial`
|
|
18
|
-
* @attr {string} actions - Comma-separated action list, or `"none"` to suppress
|
|
19
|
-
* @attr {string} actions-style - `"icon"` (default) | `"label"` | `"icon-label"`
|
|
20
|
-
* @attr {string} actions-position - `"below"` (default) | `"inside"` — toolbar placement
|
|
21
|
-
* @fires native:message-action - Fired when an action button is clicked
|
|
22
|
-
* @fires native:continue-request - Fired when continue is requested for a partial message
|
|
23
|
-
*/
|
|
24
|
-
export declare class NChatMessage extends NativeElement {
|
|
25
|
-
#private;
|
|
26
|
-
static observedAttributes: string[];
|
|
27
|
-
constructor();
|
|
28
|
-
get role(): string;
|
|
29
|
-
set role(val: string);
|
|
30
|
-
get messageId(): string;
|
|
31
|
-
get timestamp(): number;
|
|
32
|
-
get status(): string;
|
|
33
|
-
set status(val: string);
|
|
34
|
-
get actions(): string | null;
|
|
35
|
-
set actions(val: string | null);
|
|
36
|
-
get actionsStyle(): string;
|
|
37
|
-
set actionsStyle(val: string);
|
|
38
|
-
get actionsPosition(): string;
|
|
39
|
-
set actionsPosition(val: string);
|
|
40
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
41
|
-
setup(): void;
|
|
42
|
-
teardown(): void;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=chat-message-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,mBAAmB,CAAC;AAI/D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAOhE,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAGlD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,YAAa,SAAQ,aAAa;;IAC7C,MAAM,CAAC,kBAAkB,WAAiG;;IAoB1H,IAAI,IAAI,IAAI,MAAM,CAA6B;IAC/C,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,EAGnB;IAED,IAAI,SAAS,IAAI,MAAM,CAAkD;IAEzE,IAAI,SAAS,IAAI,MAAM,CAAwD;IAE/E,IAAI,MAAM,IAAI,MAAM,CAA+B;IACnD,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAGrB;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAAgC;IAC5D,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAO7B;IAED,IAAI,YAAY,IAAI,MAAM,CAAqC;IAC/D,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,EAG3B;IAED,IAAI,eAAe,IAAI,MAAM,CAAwC;IACrE,IAAI,eAAe,CAAC,GAAG,EAAE,MAAM,EAG9B;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAcpF,KAAK,IAAI,IAAI;IAqBb,QAAQ,IAAI,IAAI;CAoJjB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/** Minimal UINode shape for schema-driven rendering. */
|
|
3
|
-
export interface GenUINode {
|
|
4
|
-
tag: string;
|
|
5
|
-
id?: string;
|
|
6
|
-
attributes?: Record<string, string>;
|
|
7
|
-
properties?: Record<string, unknown>;
|
|
8
|
-
children?: GenUINode[];
|
|
9
|
-
text?: string;
|
|
10
|
-
slot?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* GenUI message card — renders UI from a schema (A2UI, MCPUI, etc).
|
|
14
|
-
*
|
|
15
|
-
* Validates the schema before rendering. Forbidden tags are rejected.
|
|
16
|
-
*
|
|
17
|
-
* ```html
|
|
18
|
-
* <n-chat-message-genui schema-type="a2ui" mode="inline"></n-chat-message-genui>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* Set the schema via property:
|
|
22
|
-
* ```js
|
|
23
|
-
* el.schema = { tag: 'n-card', children: [{ tag: 'p', text: 'Hello' }] };
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @attr {string} schema-type - `a2ui` | `mcpui`
|
|
27
|
-
* @attr {string} mode - `inline` (default) | `lightbox`
|
|
28
|
-
* @fires native:genui-action - Fired when an action occurs within the rendered UI
|
|
29
|
-
* @fires native:genui-error - Fired when schema validation fails
|
|
30
|
-
*/
|
|
31
|
-
export declare class NChatMessageGenUI extends NativeElement {
|
|
32
|
-
#private;
|
|
33
|
-
static observedAttributes: string[];
|
|
34
|
-
constructor();
|
|
35
|
-
get schema(): GenUINode | null;
|
|
36
|
-
set schema(val: GenUINode | null);
|
|
37
|
-
get schemaType(): string;
|
|
38
|
-
set schemaType(val: string);
|
|
39
|
-
get mode(): 'inline' | 'lightbox';
|
|
40
|
-
set mode(val: 'inline' | 'lightbox');
|
|
41
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
42
|
-
setup(): void;
|
|
43
|
-
teardown(): void;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=chat-message-genui-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-genui-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-genui-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;;IAClD,MAAM,CAAC,kBAAkB,WAA2B;;IAepD,IAAI,MAAM,IAAI,SAAS,GAAG,IAAI,CAA+B;IAC7D,IAAI,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,EAE/B;IAED,IAAI,UAAU,IAAI,MAAM,CAAmC;IAC3D,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,EAGzB;IAED,IAAI,IAAI,IAAI,QAAQ,GAAG,UAAU,CAA6B;IAC9D,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,UAAU,EAGlC;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAWpF,KAAK,IAAI,IAAI;IA0Cb,QAAQ,IAAI,IAAI;CAsEjB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
export interface SeedOption {
|
|
3
|
-
value: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Suggestion chips — pre-seeded quick responses.
|
|
9
|
-
*
|
|
10
|
-
* Options can be provided as JSON attribute or via the `options` property.
|
|
11
|
-
*
|
|
12
|
-
* ```html
|
|
13
|
-
* <n-chat-message-seed options='[{"value":"yes","label":"Yes"},{"value":"no","label":"No"}]'>
|
|
14
|
-
* </n-chat-message-seed>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @attr {string} options - JSON array of `{ value, label, icon? }`
|
|
18
|
-
* @attr {boolean} disabled - Disables all chips
|
|
19
|
-
* @fires native:seed-select - Fired when a chip is clicked
|
|
20
|
-
*/
|
|
21
|
-
export declare class NChatMessageSeed extends NativeElement {
|
|
22
|
-
#private;
|
|
23
|
-
static observedAttributes: string[];
|
|
24
|
-
constructor();
|
|
25
|
-
get options(): SeedOption[];
|
|
26
|
-
set options(val: SeedOption[]);
|
|
27
|
-
get disabled(): boolean;
|
|
28
|
-
set disabled(val: boolean);
|
|
29
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
30
|
-
setup(): void;
|
|
31
|
-
teardown(): void;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=chat-message-seed-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-seed-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-seed-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,mBAAmB,CAAC;AAEhF,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,MAAM,CAAC,kBAAkB,WAA2B;;IAapD,IAAI,OAAO,IAAI,UAAU,EAAE,CAAgC;IAC3D,IAAI,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,EAG5B;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAgBpF,KAAK,IAAI,IAAI;IAmCb,QAAQ,IAAI,IAAI;CAsBjB"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Rich text message renderer with lightweight markdown support.
|
|
4
|
-
*
|
|
5
|
-
* Renders a markdown subset (paragraphs, headings, lists, code fences,
|
|
6
|
-
* inline code, bold, italic, links, blockquotes) to sanitized HTML.
|
|
7
|
-
*
|
|
8
|
-
* ```html
|
|
9
|
-
* <n-chat-message-text format="markdown">
|
|
10
|
-
* Hello **world**!
|
|
11
|
-
* </n-chat-message-text>
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Or set content via property:
|
|
15
|
-
* ```js
|
|
16
|
-
* el.content = '# Title\nSome **bold** text';
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @attr {string} format - `markdown` (default) | `plain`
|
|
20
|
-
*/
|
|
21
|
-
export declare class NChatMessageText extends NativeElement {
|
|
22
|
-
#private;
|
|
23
|
-
static observedAttributes: string[];
|
|
24
|
-
get content(): string;
|
|
25
|
-
set content(val: string);
|
|
26
|
-
get format(): 'markdown' | 'plain';
|
|
27
|
-
set format(val: 'markdown' | 'plain');
|
|
28
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
29
|
-
setup(): void;
|
|
30
|
-
teardown(): void;
|
|
31
|
-
}
|
|
32
|
-
declare function renderInline(text: string): string;
|
|
33
|
-
declare function renderMarkdown(src: string): string;
|
|
34
|
-
/** Sanitize rendered HTML — strip any tags not in allowlist. */
|
|
35
|
-
export declare function sanitizeHtml(html: string): string;
|
|
36
|
-
export { renderMarkdown, renderInline };
|
|
37
|
-
//# sourceMappingURL=chat-message-text-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-text-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-text-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,MAAM,CAAC,kBAAkB,WAAc;IAQvC,IAAI,OAAO,IAAI,MAAM,CAAgC;IACrD,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,EAEtB;IAED,IAAI,MAAM,IAAI,UAAU,GAAG,OAAO,CAA+B;IACjE,IAAI,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAGnC;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUpF,KAAK,IAAI,IAAI;IA8Bb,QAAQ,IAAI,IAAI;CAIjB;AAuBD,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmB1C;AAED,iBAAS,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA4F3C;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
-
/**
|
|
3
|
-
* Message group — cluster of messages from the same sender.
|
|
4
|
-
*
|
|
5
|
-
* Provides a 2×2 grid layout:
|
|
6
|
-
* - Col 1, row 1–2: avatar (bottom-aligned)
|
|
7
|
-
* - Col 2, row 1: context area (metadata, reasoning, timestamps)
|
|
8
|
-
* - Col 2, row 2: messages area (chat bubbles, flex column)
|
|
9
|
-
*
|
|
10
|
-
* On setup, non-avatar children are sorted into two wrapper divs:
|
|
11
|
-
* - `.n-chat-context` — non-message children (row 1)
|
|
12
|
-
* - `.n-chat-bubbles` — `n-chat-message` children (row 2)
|
|
13
|
-
*
|
|
14
|
-
* A MutationObserver routes dynamically added children into the
|
|
15
|
-
* correct wrapper automatically.
|
|
16
|
-
*
|
|
17
|
-
* ```html
|
|
18
|
-
* <n-chat-messages role="assistant" sender="AI">
|
|
19
|
-
* <n-chat-avatar>AI</n-chat-avatar>
|
|
20
|
-
* <span class="reasoning">Thinking...</span>
|
|
21
|
-
* <n-chat-message role="assistant">
|
|
22
|
-
* <n-chat-message-text>Hello!</n-chat-message-text>
|
|
23
|
-
* </n-chat-message>
|
|
24
|
-
* </n-chat-messages>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @attr {string} role - `user` | `assistant` | `system`
|
|
28
|
-
* @attr {string} sender - Display name of the sender
|
|
29
|
-
* @attr {string} avatar-align - `"top"` | `"center"` | `"bottom"` (default) — avatar vertical alignment
|
|
30
|
-
*/
|
|
31
|
-
export declare class NChatMessages extends NativeElement {
|
|
32
|
-
#private;
|
|
33
|
-
static observedAttributes: string[];
|
|
34
|
-
constructor();
|
|
35
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
36
|
-
setup(): void;
|
|
37
|
-
teardown(): void;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=chat-messages-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-messages-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-messages-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,aAAc,SAAQ,aAAa;;IAC9C,MAAM,CAAC,kBAAkB,WAAsC;;IAY/D,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKpF,KAAK,IAAI,IAAI;IA8Bb,QAAQ,IAAI,IAAI;CA4CjB"}
|
package/dist/message/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { NChatMessage } from './chat-message-element.ts';
|
|
2
|
-
export { NChatMessages } from './chat-messages-element.ts';
|
|
3
|
-
export { NChatMessageText } from './chat-message-text-element.ts';
|
|
4
|
-
export { NChatMessageActivity } from './chat-message-activity-element.ts';
|
|
5
|
-
export { NChatMessageSeed } from './chat-message-seed-element.ts';
|
|
6
|
-
export { NChatMessageGenUI } from './chat-message-genui-element.ts';
|
|
7
|
-
export { NChatInputStructured } from './chat-input-structured-element.ts';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"n-chat-message.d.ts","sourceRoot":"","sources":["../../src/message/n-chat-message.ts"],"names":[],"mappings":""}
|
package/dist/register.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NChatInput } from './chat-input-element.ts';
|
|
2
|
-
import { NChatPanel } from './chat-panel-element.ts';
|
|
3
|
-
import { NChatFeed } from './feed/chat-feed-element.ts';
|
|
4
|
-
import { NChatAvatar } from './avatar/chat-avatar-element.ts';
|
|
5
|
-
import { NChatMessage } from './message/chat-message-element.ts';
|
|
6
|
-
import { NChatMessages } from './message/chat-messages-element.ts';
|
|
7
|
-
import { NChatMessageText } from './message/chat-message-text-element.ts';
|
|
8
|
-
import { NChatMessageActivity } from './message/chat-message-activity-element.ts';
|
|
9
|
-
import { NChatMessageSeed } from './message/chat-message-seed-element.ts';
|
|
10
|
-
import { NChatMessageGenUI } from './message/chat-message-genui-element.ts';
|
|
11
|
-
import { NChatInputStructured } from './message/chat-input-structured-element.ts';
|
|
12
|
-
export { NChatInput, NChatPanel, NChatFeed, NChatAvatar, NChatMessage, NChatMessages, NChatMessageText, NChatMessageActivity, NChatMessageSeed, NChatMessageGenUI, NChatInputStructured, };
|
|
13
|
-
//# sourceMappingURL=register.d.ts.map
|
package/dist/register.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAqClF,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ChatStreamChunk, TransportState } from './types.ts';
|
|
2
|
-
export type StreamEndReason = 'complete' | 'partial' | 'error' | 'stopped';
|
|
3
|
-
/**
|
|
4
|
-
* Classify how a stream ended based on the final chunk and optional error.
|
|
5
|
-
* - `complete` — explicit done signal received (e.g., `[DONE]` sentinel, `finish_reason`)
|
|
6
|
-
* - `partial` — stream ended without explicit completion (truncated)
|
|
7
|
-
* - `error` — an error occurred during streaming
|
|
8
|
-
* - `stopped` — consumer aborted the stream
|
|
9
|
-
*/
|
|
10
|
-
export declare function classifyStreamEnd(chunk: ChatStreamChunk, error?: Error): StreamEndReason;
|
|
11
|
-
/**
|
|
12
|
-
* Classify an HTTP status code into a transport state.
|
|
13
|
-
*/
|
|
14
|
-
export declare function classifyHttpError(status: number): TransportState;
|
|
15
|
-
/**
|
|
16
|
-
* Calculate exponential backoff delay with jitter.
|
|
17
|
-
*/
|
|
18
|
-
export declare function backoffDelay(attempt: number, base?: number, max?: number): number;
|
|
19
|
-
//# sourceMappingURL=classify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/stream/classify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,eAAe,CAOxF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAKhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,SAAO,EAAE,GAAG,SAAQ,GAAG,MAAM,CAE9E"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ChatStreamChunk, StreamFormat, ChatTransportOptions } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Detect the stream format from a Content-Type header value.
|
|
4
|
-
*/
|
|
5
|
-
export declare function detectFormat(contentType: string): StreamFormat;
|
|
6
|
-
/**
|
|
7
|
-
* Create an async generator that yields ChatStreamChunk values from a
|
|
8
|
-
* Response, auto-detecting the format from Content-Type when not specified.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createChatStream(response: Response, format?: StreamFormat): AsyncGenerator<ChatStreamChunk>;
|
|
11
|
-
export interface ChatTransport {
|
|
12
|
-
send(body: unknown): Promise<AsyncGenerator<ChatStreamChunk>>;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Create a reusable chat transport that sends requests and returns a
|
|
16
|
-
* streaming async generator. Supports retry/backoff and transport state callbacks.
|
|
17
|
-
*/
|
|
18
|
-
export declare function createChatTransport(options: ChatTransportOptions): ChatTransport;
|
|
19
|
-
//# sourceMappingURL=create-transport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-transport.d.ts","sourceRoot":"","sources":["../../src/stream/create-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAmB,MAAM,YAAY,CAAC;AAMvG;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAK9D;AAED;;;GAGG;AACH,wBAAuB,gBAAgB,CACrC,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,YAAY,GACpB,cAAc,CAAC,eAAe,CAAC,CAejC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,aAAa,CAsGf"}
|
package/dist/stream/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type { ChatStreamChunk, StreamFormat, ChatTransportOptions, ChatStreamEvent, TransportState, TransportStatus, TransportStateCallback, RetryOptions, } from './types.ts';
|
|
2
|
-
export { parseSSE } from './parse-sse.ts';
|
|
3
|
-
export { parseNDJSON } from './parse-ndjson.ts';
|
|
4
|
-
export { parseJSON } from './parse-json.ts';
|
|
5
|
-
export type { ChatTransport } from './create-transport.ts';
|
|
6
|
-
export { detectFormat, createChatStream, createChatTransport, } from './create-transport.ts';
|
|
7
|
-
export type { StreamEndReason } from './classify.ts';
|
|
8
|
-
export { classifyStreamEnd, classifyHttpError, backoffDelay } from './classify.ts';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChatStreamChunk } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Parse a standard JSON response as a single ChatStreamChunk.
|
|
4
|
-
*
|
|
5
|
-
* Reads the entire response body, parses as JSON, and yields one chunk
|
|
6
|
-
* with `done: true`.
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseJSON(response: Response): AsyncGenerator<ChatStreamChunk>;
|
|
9
|
-
//# sourceMappingURL=parse-json.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["../../src/stream/parse-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AACH,wBAAuB,SAAS,CAC9B,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAAC,eAAe,CAAC,CA2BjC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChatStreamChunk } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Parse a newline-delimited JSON (NDJSON) response stream into ChatStreamChunk values.
|
|
4
|
-
*
|
|
5
|
-
* Each non-empty line is parsed as a standalone JSON object.
|
|
6
|
-
* Accumulates the full message across chunks.
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseNDJSON(response: Response): AsyncGenerator<ChatStreamChunk>;
|
|
9
|
-
//# sourceMappingURL=parse-ndjson.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-ndjson.d.ts","sourceRoot":"","sources":["../../src/stream/parse-ndjson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AACH,wBAAuB,WAAW,CAChC,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAAC,eAAe,CAAC,CA2FjC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChatStreamChunk } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Parse a Server-Sent Events (SSE) response stream into ChatStreamChunk values.
|
|
4
|
-
*
|
|
5
|
-
* Reads `data:` lines from the response body, skips empty lines and comments,
|
|
6
|
-
* handles the `[DONE]` sentinel, and accumulates the full message across chunks.
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseSSE(response: Response): AsyncGenerator<ChatStreamChunk>;
|
|
9
|
-
//# sourceMappingURL=parse-sse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-sse.d.ts","sourceRoot":"","sources":["../../src/stream/parse-sse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AACH,wBAAuB,QAAQ,CAC7B,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAAC,eAAe,CAAC,CAmIjC"}
|
package/dist/stream/types.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface ChatStreamChunk {
|
|
2
|
-
delta: string;
|
|
3
|
-
fullMessage: string;
|
|
4
|
-
role: 'assistant' | 'user';
|
|
5
|
-
datetime: number;
|
|
6
|
-
done: boolean;
|
|
7
|
-
/** True when stream ended without an explicit completion signal (e.g., no `[DONE]` sentinel). */
|
|
8
|
-
partial?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export type StreamFormat = 'sse' | 'ndjson' | 'json';
|
|
11
|
-
export type TransportState = 'idle' | 'sending' | 'streaming' | 'retrying' | 'rate-limited' | 'auth-required' | 'server-error' | 'offline' | 'ready';
|
|
12
|
-
export interface TransportStatus {
|
|
13
|
-
state: TransportState;
|
|
14
|
-
statusCode?: number;
|
|
15
|
-
retryInMs?: number;
|
|
16
|
-
attempt?: number;
|
|
17
|
-
maxAttempts?: number;
|
|
18
|
-
error?: Error;
|
|
19
|
-
}
|
|
20
|
-
export type TransportStateCallback = (status: TransportStatus) => void;
|
|
21
|
-
export interface RetryOptions {
|
|
22
|
-
maxAttempts?: number;
|
|
23
|
-
baseDelayMs?: number;
|
|
24
|
-
maxDelayMs?: number;
|
|
25
|
-
}
|
|
26
|
-
export interface ChatTransportOptions {
|
|
27
|
-
baseUrl: string;
|
|
28
|
-
clientId?: string;
|
|
29
|
-
format?: StreamFormat;
|
|
30
|
-
headers?: Record<string, string>;
|
|
31
|
-
signal?: AbortSignal;
|
|
32
|
-
onStateChange?: TransportStateCallback;
|
|
33
|
-
retry?: RetryOptions;
|
|
34
|
-
}
|
|
35
|
-
export interface ChatStreamEvent {
|
|
36
|
-
type: 'start' | 'chunk' | 'complete' | 'partial' | 'error' | 'stop';
|
|
37
|
-
chunk?: ChatStreamChunk;
|
|
38
|
-
error?: Error;
|
|
39
|
-
durationMs?: number;
|
|
40
|
-
requestId: string;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/stream/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,iGAAiG;IACjG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAIrD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,cAAc,GACd,eAAe,GACf,cAAc,GACd,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;AAEvE,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACpE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TelemetryCorrelation, TelemetryEvent, TelemetryLevel, TelemetryRedactor } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Dispatches telemetry events as `CustomEvent` instances on a given
|
|
4
|
-
* `EventTarget`, applying a configurable redactor before emission.
|
|
5
|
-
*/
|
|
6
|
-
export declare class TelemetryEmitter {
|
|
7
|
-
#private;
|
|
8
|
-
constructor(target: EventTarget, level?: TelemetryLevel);
|
|
9
|
-
/** Change the telemetry level, replacing the redactor. */
|
|
10
|
-
setLevel(level: TelemetryLevel): void;
|
|
11
|
-
/** Replace the redactor with a custom implementation. */
|
|
12
|
-
setRedactor(fn: TelemetryRedactor): void;
|
|
13
|
-
/** Apply the redactor and dispatch the event on the target. */
|
|
14
|
-
emit(event: TelemetryEvent): void;
|
|
15
|
-
emitTransport(correlation: TelemetryCorrelation, mode: string, contentType: string): void;
|
|
16
|
-
emitGenerationStart(correlation: TelemetryCorrelation): void;
|
|
17
|
-
emitGenerationComplete(correlation: TelemetryCorrelation, durationMs: number): void;
|
|
18
|
-
emitWarning(correlation: TelemetryCorrelation, message: string, detail?: Record<string, unknown>): void;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=emitter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/telemetry/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAIpB;;;GAGG;AACH,qBAAa,gBAAgB;;gBAIf,MAAM,EAAE,WAAW,EAAE,KAAK,GAAE,cAA0B;IAKlE,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAIrC,yDAAyD;IACzD,WAAW,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI;IAIxC,+DAA+D;IAC/D,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IASjC,aAAa,CACX,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,IAAI;IAQP,mBAAmB,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI;IAQ5D,sBAAsB,CACpB,WAAW,EAAE,oBAAoB,EACjC,UAAU,EAAE,MAAM,GACjB,IAAI;IAQP,WAAW,CACT,WAAW,EAAE,oBAAoB,EACjC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI;CAOR"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const CHAT_EVENTS: {
|
|
2
|
-
readonly TRANSPORT: "native:chat-transport";
|
|
3
|
-
readonly GENERATION_START: "native:generation-start";
|
|
4
|
-
readonly GENERATION_COMPLETE: "native:generation-complete";
|
|
5
|
-
readonly GENERATION_STOP: "native:generation-stop";
|
|
6
|
-
readonly GENERATION_ERROR: "native:generation-error";
|
|
7
|
-
readonly WARNING: "native:chat-warning";
|
|
8
|
-
};
|
|
9
|
-
export declare const SAFE_FIELDS: readonly ["requestId", "sessionId", "conversationId", "messageId", "mode", "contentType", "durationMs", "startedAt", "completedAt", "attempt", "maxAttempts", "chunkIndex"];
|
|
10
|
-
export declare const SENSITIVE_FIELDS: readonly ["query", "message", "delta", "fullMessage", "body", "content", "prompt", "response"];
|
|
11
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/telemetry/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC;AAEX,eAAO,MAAM,WAAW,6KAad,CAAC;AAEX,eAAO,MAAM,gBAAgB,gGASnB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { TelemetryCorrelation, TelemetryTiming, TelemetryRetry, TelemetryLevel, TelemetryEvent, TelemetryRedactor, } from './types.ts';
|
|
2
|
-
export { CHAT_EVENTS, SAFE_FIELDS, SENSITIVE_FIELDS } from './events.ts';
|
|
3
|
-
export { scrubPII, createDefaultRedactor } from './redactor.ts';
|
|
4
|
-
export { TelemetryEmitter } from './emitter.ts';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TelemetryLevel, TelemetryRedactor } from './types.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Scrub common PII patterns from a string.
|
|
4
|
-
*
|
|
5
|
-
* Replaces email addresses, phone-like numbers, and credit-card-like
|
|
6
|
-
* number sequences with `[redacted]` placeholders.
|
|
7
|
-
*/
|
|
8
|
-
export declare function scrubPII(text: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Create a default redactor for the given telemetry level.
|
|
11
|
-
*
|
|
12
|
-
* - **minimal**: Sensitive fields in `detail` are replaced with
|
|
13
|
-
* `[redacted:Nchars]` indicating the original length.
|
|
14
|
-
* - **debug**: All fields pass through unmodified.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createDefaultRedactor(level: TelemetryLevel): TelemetryRedactor;
|
|
17
|
-
//# sourceMappingURL=redactor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redactor.d.ts","sourceRoot":"","sources":["../../src/telemetry/redactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASpF;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AAMD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,iBAAiB,CAmB9E"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface TelemetryCorrelation {
|
|
2
|
-
requestId: string;
|
|
3
|
-
sessionId?: string;
|
|
4
|
-
conversationId?: string;
|
|
5
|
-
messageId?: string;
|
|
6
|
-
parentMessageId?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface TelemetryTiming {
|
|
9
|
-
startedAt?: number;
|
|
10
|
-
completedAt?: number;
|
|
11
|
-
durationMs?: number;
|
|
12
|
-
}
|
|
13
|
-
export interface TelemetryRetry {
|
|
14
|
-
attempt?: number;
|
|
15
|
-
maxAttempts?: number;
|
|
16
|
-
retryReason?: string;
|
|
17
|
-
}
|
|
18
|
-
export type TelemetryLevel = 'minimal' | 'debug';
|
|
19
|
-
export interface TelemetryEvent {
|
|
20
|
-
type: string;
|
|
21
|
-
correlation: TelemetryCorrelation;
|
|
22
|
-
timing?: TelemetryTiming;
|
|
23
|
-
retry?: TelemetryRetry;
|
|
24
|
-
detail?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
export type TelemetryRedactor = (event: TelemetryEvent) => TelemetryEvent;
|
|
27
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,oBAAoB,CAAC;IAClC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc,CAAC"}
|