@threadplane/chat 0.0.46

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 ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@threadplane/chat",
3
+ "version": "0.0.46",
4
+ "exports": {
5
+ "./chat.css": "./chat.css",
6
+ "./themes/default-dark.css": "./themes/default-dark.css",
7
+ "./themes/default-light.css": "./themes/default-light.css",
8
+ "./themes/material-dark.css": "./themes/material-dark.css",
9
+ "./themes/material-light.css": "./themes/material-light.css",
10
+ "./package.json": {
11
+ "default": "./package.json"
12
+ },
13
+ ".": {
14
+ "types": "./types/threadplane-chat.d.ts",
15
+ "default": "./fesm2022/threadplane-chat.mjs"
16
+ },
17
+ "./debug": {
18
+ "types": "./types/threadplane-chat-debug.d.ts",
19
+ "default": "./fesm2022/threadplane-chat-debug.mjs"
20
+ },
21
+ "./testing": {
22
+ "types": "./types/threadplane-chat-testing.d.ts",
23
+ "default": "./fesm2022/threadplane-chat-testing.mjs"
24
+ }
25
+ },
26
+ "dependencies": {
27
+ "@cacheplane/partial-json": ">=0.1.1 <0.3.0",
28
+ "@cacheplane/partial-markdown": "^0.3.0",
29
+ "tslib": "^2.3.0",
30
+ "@threadplane/telemetry": "*"
31
+ },
32
+ "peerDependencies": {
33
+ "@angular/core": "^20.0.0 || ^21.0.0",
34
+ "@angular/common": "^20.0.0 || ^21.0.0",
35
+ "@angular/forms": "^20.0.0 || ^21.0.0",
36
+ "@angular/platform-browser": "^20.0.0 || ^21.0.0",
37
+ "@threadplane/licensing": "*",
38
+ "@threadplane/render": "*",
39
+ "@threadplane/a2ui": "*",
40
+ "@json-render/core": "^0.16.0",
41
+ "@langchain/core": "^1.1.33",
42
+ "rxjs": "~7.8.0",
43
+ "marked": "^15.0.0 || ^16.0.0"
44
+ },
45
+ "license": "PolyForm-Noncommercial-1.0.0 OR LicenseRef-Threadplane-Commercial",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/cacheplane/angular-agent-framework.git",
49
+ "directory": "libs/chat"
50
+ },
51
+ "homepage": "https://github.com/cacheplane/angular-agent-framework#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/cacheplane/angular-agent-framework/issues"
54
+ },
55
+ "sideEffects": [
56
+ "**/chat-tokens.ts",
57
+ "./fesm2022/threadplane-chat.mjs",
58
+ "**/*.css"
59
+ ],
60
+ "module": "fesm2022/threadplane-chat.mjs",
61
+ "typings": "types/threadplane-chat.d.ts",
62
+ "scripts": {
63
+ "postinstall": "threadplane-telemetry-postinstall || true"
64
+ }
65
+ }
@@ -0,0 +1,32 @@
1
+ /*
2
+ * @threadplane/chat — default dark theme
3
+ * SPDX-License-Identifier: MIT
4
+ *
5
+ * The lib's `:host` defaults on `<a2ui-surface>` already declare these
6
+ * exact values — this preset is a no-op @import for symmetry/docs and
7
+ * for consumers who want their `:root` to make the choice explicit.
8
+ *
9
+ * Usage in your global stylesheet:
10
+ * @import '@threadplane/chat/themes/default-dark.css';
11
+ *
12
+ * The agent's `beginRendering.styles.primaryColor` continues to override
13
+ * `--a2ui-primary` per surface (host inline-style binding, highest
14
+ * specificity).
15
+ */
16
+ :root {
17
+ /* === Color (dark, blue accent) === */
18
+ --a2ui-primary: #4f8df5;
19
+ --a2ui-on-primary: #ffffff;
20
+ --a2ui-primary-hover: #6699f7;
21
+ --a2ui-secondary: #8a92a3;
22
+ --a2ui-on-secondary: #ffffff;
23
+ --a2ui-surface: #1a1d23;
24
+ --a2ui-on-surface: #ffffff;
25
+ --a2ui-surface-variant: rgba(255, 255, 255, 0.05);
26
+ --a2ui-on-surface-variant: rgba(255, 255, 255, 0.7);
27
+ --a2ui-outline: rgba(255, 255, 255, 0.1);
28
+ --a2ui-outline-variant: rgba(255, 255, 255, 0.05);
29
+ --a2ui-error: #f5524f;
30
+ --a2ui-on-error: #ffffff;
31
+ --a2ui-scrim: rgba(0, 0, 0, 0.6);
32
+ }
@@ -0,0 +1,36 @@
1
+ /*
2
+ * @threadplane/chat — default light theme
3
+ * SPDX-License-Identifier: MIT
4
+ *
5
+ * Neutral light palette with blue accent. Off-white surface (#FAFAFA)
6
+ * for friendlier contrast vs. pure white. Same blue accent (#4f8df5)
7
+ * as default-dark — the only theming decision is foreground/background
8
+ * inversion + outline lightening + softer elevation.
9
+ *
10
+ * Usage in your global stylesheet:
11
+ * @import '@threadplane/chat/themes/default-light.css';
12
+ */
13
+ :root {
14
+ /* === Color (light, blue accent) === */
15
+ --a2ui-primary: #4f8df5;
16
+ --a2ui-on-primary: #ffffff;
17
+ --a2ui-primary-hover: #3b7be3;
18
+ --a2ui-secondary: #5b6275;
19
+ --a2ui-on-secondary: #ffffff;
20
+ --a2ui-surface: #fafafa;
21
+ --a2ui-on-surface: #1a1d23;
22
+ --a2ui-surface-variant: rgba(0, 0, 0, 0.04);
23
+ --a2ui-on-surface-variant: rgba(0, 0, 0, 0.6);
24
+ --a2ui-outline: rgba(0, 0, 0, 0.12);
25
+ --a2ui-outline-variant: rgba(0, 0, 0, 0.06);
26
+ --a2ui-error: #d33533;
27
+ --a2ui-on-error: #ffffff;
28
+ --a2ui-scrim: rgba(0, 0, 0, 0.4);
29
+
30
+ /* === Elevation (softer shadows on light backgrounds) === */
31
+ --a2ui-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.08);
32
+ --a2ui-elevation-2: 0 2px 4px rgba(0, 0, 0, 0.10);
33
+ --a2ui-elevation-3: 0 4px 8px rgba(0, 0, 0, 0.12);
34
+ --a2ui-elevation-4: 0 8px 16px rgba(0, 0, 0, 0.14);
35
+ --a2ui-elevation-5: 0 16px 32px rgba(0, 0, 0, 0.16);
36
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * @threadplane/chat — Material Design 3 dark theme
3
+ * SPDX-License-Identifier: MIT
4
+ *
5
+ * Maps Google's Material Design 3 dark color tokens (m3.material.io)
6
+ * into the @threadplane/chat token vocabulary. No `@angular/material` runtime
7
+ * dependency — pure CSS custom-property declarations.
8
+ *
9
+ * Color values from the Material Design 3 spec
10
+ * (https://m3.material.io/styles/color/the-color-system/tokens).
11
+ *
12
+ * Usage in your global stylesheet:
13
+ * @import '@threadplane/chat/themes/material-dark.css';
14
+ */
15
+ :root {
16
+ /* === Color (M3 dark) === */
17
+ --a2ui-primary: #D0BCFF;
18
+ --a2ui-on-primary: #381E72;
19
+ --a2ui-primary-hover: #B69DF8;
20
+ --a2ui-secondary: #CCC2DC;
21
+ --a2ui-on-secondary: #332D41;
22
+ --a2ui-surface: #1C1B1F;
23
+ --a2ui-on-surface: #E6E1E5;
24
+ --a2ui-surface-variant: #49454F;
25
+ --a2ui-on-surface-variant: #CAC4D0;
26
+ --a2ui-outline: #938F99;
27
+ --a2ui-outline-variant: #49454F;
28
+ --a2ui-error: #F2B8B5;
29
+ --a2ui-on-error: #601410;
30
+ --a2ui-scrim: rgba(0, 0, 0, 0.6);
31
+
32
+ /* === Shape (M3 favors slightly larger radii) === */
33
+ --a2ui-shape-extra-small: 4px;
34
+ --a2ui-shape-small: 8px;
35
+ --a2ui-shape-medium: 12px;
36
+ --a2ui-shape-large: 16px;
37
+ --a2ui-shape-extra-large: 28px;
38
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * @threadplane/chat — Material Design 3 light theme
3
+ * SPDX-License-Identifier: MIT
4
+ *
5
+ * Maps Google's Material Design 3 light color tokens (m3.material.io)
6
+ * into the @threadplane/chat token vocabulary. No `@angular/material` runtime
7
+ * dependency — pure CSS custom-property declarations.
8
+ *
9
+ * Color values from the Material Design 3 spec
10
+ * (https://m3.material.io/styles/color/the-color-system/tokens).
11
+ *
12
+ * Usage in your global stylesheet:
13
+ * @import '@threadplane/chat/themes/material-light.css';
14
+ */
15
+ :root {
16
+ /* === Color (M3 light) === */
17
+ --a2ui-primary: #6750A4;
18
+ --a2ui-on-primary: #FFFFFF;
19
+ --a2ui-primary-hover: #533F8E;
20
+ --a2ui-secondary: #625B71;
21
+ --a2ui-on-secondary: #FFFFFF;
22
+ --a2ui-surface: #FFFBFE;
23
+ --a2ui-on-surface: #1C1B1F;
24
+ --a2ui-surface-variant: #E7E0EC;
25
+ --a2ui-on-surface-variant: #49454F;
26
+ --a2ui-outline: #79747E;
27
+ --a2ui-outline-variant: #CAC4D0;
28
+ --a2ui-error: #B3261E;
29
+ --a2ui-on-error: #FFFFFF;
30
+ --a2ui-scrim: rgba(0, 0, 0, 0.4);
31
+
32
+ /* === Shape (M3 favors slightly larger radii) === */
33
+ --a2ui-shape-extra-small: 4px;
34
+ --a2ui-shape-small: 8px;
35
+ --a2ui-shape-medium: 12px;
36
+ --a2ui-shape-large: 16px;
37
+ --a2ui-shape-extra-large: 28px;
38
+
39
+ /* === Elevation (softer shadows on light backgrounds) === */
40
+ --a2ui-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.08);
41
+ --a2ui-elevation-2: 0 2px 4px rgba(0, 0, 0, 0.10);
42
+ --a2ui-elevation-3: 0 4px 8px rgba(0, 0, 0, 0.12);
43
+ --a2ui-elevation-4: 0 8px 16px rgba(0, 0, 0, 0.14);
44
+ --a2ui-elevation-5: 0 16px 32px rgba(0, 0, 0, 0.16);
45
+ }
@@ -0,0 +1,66 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+
4
+ interface DebugAgentCheckpoint {
5
+ id?: string;
6
+ label?: string;
7
+ values?: Record<string, unknown>;
8
+ }
9
+ interface DebugAgent {
10
+ messages: Signal<unknown[]>;
11
+ status: Signal<string>;
12
+ isLoading: Signal<boolean>;
13
+ error: Signal<unknown>;
14
+ toolCalls: Signal<unknown[]>;
15
+ state: Signal<Record<string, unknown>>;
16
+ }
17
+ interface DebugAgentWithHistory extends DebugAgent {
18
+ history: Signal<DebugAgentCheckpoint[]>;
19
+ }
20
+
21
+ type DockPosition = 'right' | 'bottom' | 'left';
22
+ interface TabEntry {
23
+ readonly id: string;
24
+ readonly label: string;
25
+ readonly kind: 'builtin-timeline' | 'builtin-state';
26
+ }
27
+ declare class ChatDebugComponent {
28
+ readonly agent: _angular_core.InputSignal<DebugAgent | DebugAgentWithHistory | null>;
29
+ readonly dock: _angular_core.InputSignal<DockPosition>;
30
+ readonly defaultOpen: _angular_core.InputSignal<boolean>;
31
+ readonly launcher: _angular_core.InputSignal<"floating" | "none">;
32
+ readonly storageKey: _angular_core.InputSignal<string>;
33
+ readonly replayRequested: _angular_core.OutputEmitterRef<string>;
34
+ readonly forkRequested: _angular_core.OutputEmitterRef<string>;
35
+ readonly openChange: _angular_core.OutputEmitterRef<boolean>;
36
+ readonly dockChange: _angular_core.OutputEmitterRef<DockPosition>;
37
+ protected readonly open: _angular_core.WritableSignal<boolean>;
38
+ protected readonly dockState: _angular_core.WritableSignal<DockPosition>;
39
+ /** Set to `true` the first time the user explicitly clicks a dock button.
40
+ * Auto-dock detection becomes a no-op after this flips. Not persisted —
41
+ * fresh session = fresh chance for the smart default. */
42
+ private readonly userDockOverride;
43
+ protected readonly activeTabId: _angular_core.WritableSignal<string>;
44
+ protected readonly historyAgent: _angular_core.Signal<DebugAgentWithHistory | null>;
45
+ private readonly hydrated;
46
+ /** Reads `agent.status()` reactively for the launcher dot. */
47
+ protected readonly isStreaming: _angular_core.Signal<boolean>;
48
+ protected readonly tabs: _angular_core.Signal<TabEntry[]>;
49
+ protected readonly activeTab: _angular_core.Signal<TabEntry | undefined>;
50
+ private readonly hostEl;
51
+ constructor();
52
+ setOpen(value: boolean): void;
53
+ setDock(next: DockPosition): void;
54
+ setActiveTab(id: string): void;
55
+ protected onEsc(): void;
56
+ /**
57
+ * Click-outside dismiss. When the panel is open, any click whose
58
+ * composed path doesn't include our host element closes the panel.
59
+ */
60
+ protected onDocumentClick(event: MouseEvent): void;
61
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatDebugComponent, never>;
62
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatDebugComponent, "chat-debug", never, { "agent": { "alias": "agent"; "required": false; "isSignal": true; }; "dock": { "alias": "dock"; "required": false; "isSignal": true; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; "isSignal": true; }; "launcher": { "alias": "launcher"; "required": false; "isSignal": true; }; "storageKey": { "alias": "storageKey"; "required": false; "isSignal": true; }; }, { "replayRequested": "replayRequested"; "forkRequested": "forkRequested"; "openChange": "openChange"; "dockChange": "dockChange"; }, never, never, true, never>;
63
+ }
64
+
65
+ export { ChatDebugComponent };
66
+ export type { DockPosition };
@@ -0,0 +1,39 @@
1
+ import { Agent, AgentCheckpoint, AgentWithHistory, Message } from '@threadplane/chat';
2
+
3
+ /**
4
+ * Runs a suite of contract conformance assertions against a factory that
5
+ * produces a fresh Agent. Adapter packages should call this in their
6
+ * own test suites to verify the contract is satisfied.
7
+ */
8
+ declare function runAgentConformance(label: string, factory: () => Agent): void;
9
+
10
+ /**
11
+ * Conformance suite for AgentWithHistory implementations.
12
+ *
13
+ * Runs the base Agent conformance suite, then verifies the history
14
+ * signal is present and returns an array of AgentCheckpoint-shaped entries.
15
+ */
16
+ declare function runAgentWithHistoryConformance(label: string, factory: (seed?: {
17
+ history?: AgentCheckpoint[];
18
+ }) => AgentWithHistory): void;
19
+
20
+ declare const REASONING_FIXTURE_MESSAGE_ID = "fixture-msg-1";
21
+ declare const REASONING_FIXTURE_REASONING = "I read the prompt and decided to greet the user.";
22
+ declare const REASONING_FIXTURE_RESPONSE = "Hello!";
23
+ interface AbstractEvent {
24
+ kind: 'reasoning-start' | 'reasoning-chunk' | 'reasoning-end' | 'text-start' | 'text-chunk' | 'text-end';
25
+ delta?: string;
26
+ }
27
+ /**
28
+ * Canonical sequence: reasoning starts, three reasoning chunks, reasoning
29
+ * ends, text starts, three text chunks, text ends.
30
+ */
31
+ declare const REASONING_FIXTURE_EVENTS: AbstractEvent[];
32
+ /**
33
+ * Assertion — common to both adapters. Throws if the produced messages
34
+ * don't match the shared expectation.
35
+ */
36
+ declare function assertReasoningFixtureMessages(messages: readonly Message[]): void;
37
+
38
+ export { REASONING_FIXTURE_EVENTS, REASONING_FIXTURE_MESSAGE_ID, REASONING_FIXTURE_REASONING, REASONING_FIXTURE_RESPONSE, assertReasoningFixtureMessages, runAgentConformance, runAgentWithHistoryConformance };
39
+ export type { AbstractEvent };