@threadplane/chat 0.0.53 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"threadplane-chat-debug.mjs","sources":["../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug-tokens.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug-root-styles.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-checkpoint-card.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/state-diff.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-state-diff.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-utils.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/inspectors/timeline-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-state-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/inspectors/state-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/persistence.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug.component.ts","../../../../libs/chat/debug/public-api.ts","../../../../libs/chat/debug/threadplane-chat-debug.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n\n/**\n * Component-scoped CSS variables for the chat-debug devtools chrome.\n *\n * Imported into every chat-debug component / primitive's `styles` array\n * so the defaults are set on each `:host` element. Hosts override by\n * setting any token on `chat-debug` or any ancestor.\n *\n * Independent from `--ngaf-chat-*` (the chat library's theme tokens).\n * Devtools chrome stays dark regardless of host theme by default —\n * matches Chrome DevTools / React DevTools / Redux DevTools convention.\n *\n * Palette anchor: shadcn zinc-900 + accent blue.\n */\nexport const CHAT_DEBUG_TOKENS = `\n :host {\n --ngaf-chat-debug-bg: #18181b;\n --ngaf-chat-debug-bg-deep: #09090b;\n --ngaf-chat-debug-surface: #1f1f23;\n --ngaf-chat-debug-border: #27272a;\n --ngaf-chat-debug-border-strong: #3f3f46;\n --ngaf-chat-debug-text: #fafafa;\n --ngaf-chat-debug-text-muted: #a1a1aa;\n --ngaf-chat-debug-text-subtle: #71717a;\n --ngaf-chat-debug-accent: #4f8df5;\n --ngaf-chat-debug-success: #4ade80;\n --ngaf-chat-debug-shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.5);\n --ngaf-chat-debug-shadow-pill: 0 6px 18px rgba(0, 0, 0, 0.4);\n --ngaf-chat-debug-radius-panel: 12px;\n --ngaf-chat-debug-radius-input: 8px;\n --ngaf-chat-debug-radius-pill: 999px;\n --ngaf-chat-debug-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;\n --ngaf-chat-debug-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-family: var(--ngaf-chat-debug-font-sans);\n color: var(--ngaf-chat-debug-text);\n\n /*\n * Cascade shim: rewire the chat library's color tokens to debug\n * equivalents so embedded components that consume \\`--ngaf-chat-*\\`\n * (debug-checkpoint-card, debug-state-diff, debug-state-inspector,\n * any host-projected slot content) pick up the dark devtools surface\n * without each one needing its own re-skin. Geometry / font tokens\n * are left alone — they're neutral.\n */\n --ngaf-chat-bg: var(--ngaf-chat-debug-bg);\n --ngaf-chat-text: var(--ngaf-chat-debug-text);\n --ngaf-chat-text-muted: var(--ngaf-chat-debug-text-muted);\n --ngaf-chat-separator: var(--ngaf-chat-debug-border);\n --ngaf-chat-surface-alt: var(--ngaf-chat-debug-bg-deep);\n --ngaf-chat-font-size-xs: 12px;\n --ngaf-chat-font-mono: var(--ngaf-chat-debug-font-mono);\n --ngaf-chat-radius-card: 8px;\n --ngaf-chat-success: var(--ngaf-chat-debug-success);\n --ngaf-chat-error-bg: color-mix(in srgb, #ef4444 18%, transparent);\n --ngaf-chat-error-text: #fca5a5;\n --ngaf-chat-warning-bg: color-mix(in srgb, #f59e0b 18%, transparent);\n --ngaf-chat-warning-text: #fcd34d;\n }\n`;\n","// SPDX-License-Identifier: MIT\nconst CHAT_DEBUG_ROOT_STYLES = `\n@layer ngaf-chat-debug {\n :root {\n --ngaf-chat-sidebar-claim-right: 0px;\n --ngaf-chat-debug-panel-size-h: 40vh;\n --ngaf-chat-debug-panel-size-w: 420px;\n }\n :root[data-threadplane-chat-debug=\"bottom\"] {\n --ngaf-chat-debug-claim-bottom: var(--ngaf-chat-debug-panel-size-h, 40vh);\n --ngaf-chat-occupy-bottom: var(--ngaf-chat-debug-panel-size-h, 40vh);\n }\n :root[data-threadplane-chat-debug=\"right\"] {\n --ngaf-chat-debug-claim-right: var(--ngaf-chat-debug-panel-size-w, 420px);\n --ngaf-chat-occupy-right: var(--ngaf-chat-debug-panel-size-w, 420px);\n }\n :root[data-threadplane-chat-debug=\"left\"] {\n --ngaf-chat-debug-claim-left: var(--ngaf-chat-debug-panel-size-w, 420px);\n --ngaf-chat-occupy-left: var(--ngaf-chat-debug-panel-size-w, 420px);\n }\n}\n`;\n\nconst STYLE_ELEMENT_ID = 'ngaf-chat-debug-root-styles';\n\nexport function ensureChatDebugRootStyles(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(STYLE_ELEMENT_ID)) return;\n const style = document.createElement('style');\n style.id = STYLE_ELEMENT_ID;\n style.textContent = CHAT_DEBUG_ROOT_STYLES;\n document.head.appendChild(style);\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n input,\n output,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\nexport interface DebugCheckpoint {\n node?: string;\n duration?: number;\n tokenCount?: number;\n checkpointId?: string;\n}\n\n@Component({\n selector: 'chat-debug-checkpoint-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-checkpoint-card {\n width: 100%;\n text-align: left;\n border-radius: var(--ngaf-chat-radius-card);\n border: 1px solid var(--ngaf-chat-separator);\n padding: 8px 12px;\n cursor: pointer;\n background: var(--ngaf-chat-bg);\n transition: background 150ms ease, border-color 150ms ease;\n }\n .debug-checkpoint-card:hover {\n background: color-mix(in srgb, var(--ngaf-chat-text) 5%, transparent);\n }\n .debug-checkpoint-card--selected {\n border-color: var(--ngaf-chat-text-muted);\n background: color-mix(in srgb, var(--ngaf-chat-text) 5%, transparent);\n }\n .debug-checkpoint-card__title {\n font-size: var(--ngaf-chat-font-size-xs);\n font-weight: 500;\n color: var(--ngaf-chat-text);\n margin: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .debug-checkpoint-card__meta {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n }\n .debug-checkpoint-card__badge {\n font-size: var(--ngaf-chat-font-size-xs);\n padding: 2px 6px;\n border-radius: 4px;\n background: var(--ngaf-chat-surface-alt);\n color: var(--ngaf-chat-text-muted);\n }\n `,\n ],\n template: `\n <button\n class=\"debug-checkpoint-card\"\n [class.debug-checkpoint-card--selected]=\"isSelected()\"\n (click)=\"selected.emit()\"\n >\n <p class=\"debug-checkpoint-card__title\">{{ checkpoint().node ?? 'Unknown' }}</p>\n <div class=\"debug-checkpoint-card__meta\">\n @if (checkpoint().duration !== null && checkpoint().duration !== undefined) {\n <span class=\"debug-checkpoint-card__badge\">{{ checkpoint().duration }}ms</span>\n }\n @if (checkpoint().tokenCount !== null && checkpoint().tokenCount !== undefined) {\n <span class=\"debug-checkpoint-card__badge\">{{ checkpoint().tokenCount }} tok</span>\n }\n </div>\n </button>\n `,\n})\nexport class DebugCheckpointCardComponent {\n readonly checkpoint = input.required<DebugCheckpoint>();\n readonly isSelected = input<boolean>(false);\n readonly selected = output<void>();\n}\n","// SPDX-License-Identifier: MIT\n\n/**\n * Represents a single entry in a state diff.\n * - `added`: key exists in `after` but not `before`\n * - `removed`: key exists in `before` but not `after`\n * - `changed`: key exists in both but values differ\n */\nexport interface DiffEntry {\n path: string;\n type: 'added' | 'removed' | 'changed';\n before?: unknown;\n after?: unknown;\n}\n\n/**\n * Computes a recursive diff between two state objects.\n * Returns an array of DiffEntry describing added, removed, and changed keys.\n */\nexport function computeStateDiff(\n before: Record<string, unknown>,\n after: Record<string, unknown>,\n prefix = '',\n): DiffEntry[] {\n const entries: DiffEntry[] = [];\n const allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);\n\n for (const key of allKeys) {\n const path = prefix ? `${prefix}.${key}` : key;\n const inBefore = key in before;\n const inAfter = key in after;\n\n if (!inBefore && inAfter) {\n entries.push({ path, type: 'added', after: after[key] });\n } else if (inBefore && !inAfter) {\n entries.push({ path, type: 'removed', before: before[key] });\n } else {\n const bVal = before[key];\n const aVal = after[key];\n\n // Recurse into nested plain objects\n if (isPlainObject(bVal) && isPlainObject(aVal)) {\n entries.push(\n ...computeStateDiff(\n bVal as Record<string, unknown>,\n aVal as Record<string, unknown>,\n path,\n ),\n );\n } else if (!deepEqual(bVal, aVal)) {\n entries.push({ path, type: 'changed', before: bVal, after: aVal });\n }\n // If equal, no entry\n }\n }\n\n return entries;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.getPrototypeOf(value) === Object.prototype\n );\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a === null || b === null) return false;\n if (typeof a !== typeof b) return false;\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n return a.every((item, i) => deepEqual(item, b[i]));\n }\n\n if (isPlainObject(a) && isPlainObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every((key) => key in b && deepEqual(a[key], b[key]));\n }\n\n return false;\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n computed,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { JsonPipe } from '@angular/common';\nimport { computeStateDiff } from './state-diff';\nimport type { DiffEntry } from './state-diff';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\n@Component({\n selector: 'chat-debug-state-diff',\n standalone: true,\n imports: [JsonPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-state-diff__empty {\n font-size: var(--ngaf-chat-font-size-xs);\n color: var(--ngaf-chat-text-muted);\n font-style: italic;\n margin: 0;\n }\n .debug-state-diff__list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n .debug-state-diff__entry {\n font-size: var(--ngaf-chat-font-size-xs);\n font-family: var(--ngaf-chat-font-mono);\n padding: 4px 8px;\n border-radius: 4px;\n }\n .debug-state-diff__entry--added {\n background: var(--ngaf-chat-surface-alt);\n color: var(--ngaf-chat-success);\n }\n .debug-state-diff__entry--removed {\n background: var(--ngaf-chat-error-bg);\n color: var(--ngaf-chat-error-text);\n }\n .debug-state-diff__entry--changed {\n background: var(--ngaf-chat-warning-bg);\n color: var(--ngaf-chat-warning-text);\n }\n .debug-state-diff__key { font-weight: 600; }\n .debug-state-diff__value {\n display: block;\n padding-left: 16px;\n color: var(--ngaf-chat-text-muted);\n }\n `,\n ],\n template: `\n @if (diffEntries().length === 0) {\n <p class=\"debug-state-diff__empty\">No changes</p>\n } @else {\n <div class=\"debug-state-diff__list\">\n @for (entry of diffEntries(); track entry.path) {\n <div class=\"debug-state-diff__entry\" [class]=\"entryClass(entry.type)\">\n <span class=\"debug-state-diff__key\">{{ prefix(entry.type) }} {{ entry.path }}</span>\n @if (entry.type === 'changed') {\n <span class=\"debug-state-diff__value\">{{ entry.before | json }} &rarr; {{ entry.after | json }}</span>\n } @else if (entry.type === 'added') {\n <span class=\"debug-state-diff__value\">{{ entry.after | json }}</span>\n } @else {\n <span class=\"debug-state-diff__value\">{{ entry.before | json }}</span>\n }\n </div>\n }\n </div>\n }\n `,\n})\nexport class DebugStateDiffComponent {\n readonly before = input<Record<string, unknown>>({});\n readonly after = input<Record<string, unknown>>({});\n\n readonly diffEntries = computed((): DiffEntry[] =>\n computeStateDiff(this.before(), this.after()),\n );\n\n prefix(type: DiffEntry['type']): string {\n switch (type) {\n case 'added': return '+';\n case 'removed': return '-';\n case 'changed': return '~';\n }\n }\n\n entryClass(type: DiffEntry['type']): string {\n switch (type) {\n case 'added': return 'debug-state-diff__entry--added';\n case 'removed': return 'debug-state-diff__entry--removed';\n case 'changed': return 'debug-state-diff__entry--changed';\n }\n }\n\n /** @deprecated Use entryClass instead — kept for backward compat if any template references it */\n colorClass(type: DiffEntry['type']): string {\n return this.entryClass(type);\n }\n}\n","// SPDX-License-Identifier: MIT\nimport type { DebugAgentCheckpoint } from './debug-agent';\nimport type { DebugCheckpoint } from './debug-checkpoint-card.component';\n\nexport function toDebugCheckpoint(cp: DebugAgentCheckpoint, index: number): DebugCheckpoint {\n return {\n node: cp.label ?? `Step ${index + 1}`,\n checkpointId: cp.id,\n };\n}\n\nexport function extractStateValues(cp: DebugAgentCheckpoint | undefined): Record<string, unknown> {\n return cp?.values ?? {};\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n output,\n signal,\n HostListener,\n} from '@angular/core';\nimport type { DebugAgentWithHistory } from '../debug-agent';\nimport { CHAT_DEBUG_TOKENS } from '../chat-debug-tokens';\nimport { DebugCheckpointCardComponent, type DebugCheckpoint } from '../debug-checkpoint-card.component';\nimport { DebugStateDiffComponent } from '../debug-state-diff.component';\nimport { toDebugCheckpoint, extractStateValues } from '../debug-utils';\n\nexport type Direction = 'up' | 'down' | 'home' | 'end';\n\n/**\n * Pure selection-step function. Exported for unit testing — the component's\n * keyboard handler delegates to it.\n */\nexport function stepSelection(dir: Direction, current: number, count: number): number {\n if (count === 0) return -1;\n switch (dir) {\n case 'down': return Math.min(current + 1, count - 1);\n case 'up': return Math.max(current - 1, 0);\n case 'home': return 0;\n case 'end': return count - 1;\n }\n}\n\n@Component({\n selector: 'chat-debug-timeline-inspector',\n standalone: true,\n imports: [DebugCheckpointCardComponent, DebugStateDiffComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host { display: flex; flex-direction: column; height: 100%; outline: none; }\n .timeline__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 16px;\n border-bottom: 1px solid var(--ngaf-chat-debug-border);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--ngaf-chat-debug-text-subtle);\n background: var(--ngaf-chat-debug-bg);\n }\n .timeline__count { display: inline-flex; align-items: center; gap: 6px; }\n .timeline__count-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 22px;\n height: 18px;\n padding: 0 6px;\n border-radius: 9px;\n background: var(--ngaf-chat-debug-surface);\n border: 1px solid var(--ngaf-chat-debug-border);\n color: var(--ngaf-chat-debug-text);\n font-size: 11px;\n font-weight: 500;\n letter-spacing: 0;\n text-transform: none;\n font-variant-numeric: tabular-nums;\n }\n .timeline__clear {\n background: transparent;\n border: 0;\n cursor: pointer;\n color: var(--ngaf-chat-debug-text-subtle);\n font: inherit;\n font-size: 11px;\n letter-spacing: 0;\n text-transform: none;\n padding: 2px 6px;\n border-radius: 6px;\n transition: color 120ms ease, background 120ms ease;\n }\n .timeline__clear:hover:not(:disabled) {\n color: var(--ngaf-chat-debug-text);\n background: var(--ngaf-chat-debug-surface);\n }\n .timeline__clear:disabled { opacity: 0.4; cursor: default; }\n .timeline__list {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ngaf-chat-debug-bg);\n }\n .timeline__empty {\n padding: 24px 16px;\n text-align: center;\n color: var(--ngaf-chat-debug-text-subtle);\n font-size: 13px;\n }\n .timeline__row { display: flex; flex-direction: column; gap: 8px; }\n .timeline__row-actions {\n display: none;\n gap: 8px;\n padding-left: 12px;\n }\n .timeline__row:hover .timeline__row-actions { display: flex; }\n .timeline__row button.row-action {\n background: var(--ngaf-chat-debug-bg-deep);\n border: 1px solid var(--ngaf-chat-debug-border);\n border-radius: 6px;\n padding: 3px 8px;\n font: inherit;\n font-size: 11px;\n color: var(--ngaf-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n }\n .timeline__row button.row-action:hover {\n color: var(--ngaf-chat-debug-text);\n border-color: var(--ngaf-chat-debug-border-strong);\n }\n .timeline__diff {\n padding: 12px;\n background: var(--ngaf-chat-debug-bg-deep);\n border: 1px solid var(--ngaf-chat-debug-border);\n border-radius: var(--ngaf-chat-debug-radius-input);\n color: var(--ngaf-chat-debug-text);\n }\n `,\n ],\n template: `\n <div class=\"timeline__header\">\n <span class=\"timeline__count\">\n <span class=\"timeline__count-badge\">{{ checkpoints().length }}</span>\n <span>checkpoint{{ checkpoints().length === 1 ? '' : 's' }}</span>\n </span>\n <button\n type=\"button\"\n class=\"timeline__clear\"\n [disabled]=\"selectedIndex() < 0\"\n (click)=\"selectedIndex.set(-1)\"\n >Clear selection</button>\n </div>\n <div\n class=\"timeline__list\"\n tabindex=\"0\"\n role=\"listbox\"\n aria-label=\"Checkpoint timeline\"\n >\n @if (checkpoints().length === 0) {\n <div class=\"timeline__empty\">No checkpoints yet. Send a message to populate the timeline.</div>\n }\n @for (cp of checkpoints(); let i = $index; track cp.checkpointId ?? i) {\n <div class=\"timeline__row\">\n <chat-debug-checkpoint-card\n [checkpoint]=\"cp\"\n [isSelected]=\"i === selectedIndex()\"\n (selected)=\"selectedIndex.set(i)\"\n />\n @if (i === selectedIndex() && cp.checkpointId) {\n <div class=\"timeline__row-actions\">\n <button class=\"row-action\" type=\"button\" (click)=\"replayRequested.emit(cp.checkpointId!)\">Replay</button>\n <button class=\"row-action\" type=\"button\" (click)=\"forkRequested.emit(cp.checkpointId!)\">Fork</button>\n </div>\n }\n @if (i === selectedIndex()) {\n <div class=\"timeline__diff\">\n <chat-debug-state-diff\n [before]=\"previousStateAt(i)\"\n [after]=\"currentStateAt(i)\"\n />\n </div>\n }\n </div>\n }\n </div>\n `,\n})\nexport class TimelineInspectorComponent {\n readonly agent = input.required<DebugAgentWithHistory>();\n readonly replayRequested = output<string>();\n readonly forkRequested = output<string>();\n\n readonly selectedIndex = signal<number>(-1);\n\n readonly checkpoints = computed((): DebugCheckpoint[] =>\n this.agent().history().map((cp, i) => toDebugCheckpoint(cp, i)),\n );\n\n currentStateAt(i: number): Record<string, unknown> {\n return extractStateValues(this.agent().history()[i]);\n }\n\n previousStateAt(i: number): Record<string, unknown> {\n if (i <= 0) return {};\n return extractStateValues(this.agent().history()[i - 1]);\n }\n\n @HostListener('keydown', ['$event'])\n protected onKey(ev: KeyboardEvent): void {\n const map: Record<string, Direction | undefined> = {\n ArrowDown: 'down',\n ArrowUp: 'up',\n Home: 'home',\n End: 'end',\n };\n const dir = map[ev.key];\n if (!dir) return;\n ev.preventDefault();\n this.selectedIndex.set(stepSelection(dir, this.selectedIndex(), this.checkpoints().length));\n }\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { JsonPipe } from '@angular/common';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\n@Component({\n selector: 'chat-debug-state-inspector',\n standalone: true,\n imports: [JsonPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-state-inspector {\n overflow: auto;\n max-height: 256px;\n }\n .debug-state-inspector__pre {\n font-size: var(--ngaf-chat-font-size-xs);\n font-family: var(--ngaf-chat-font-mono);\n color: var(--ngaf-chat-text);\n white-space: pre-wrap;\n word-break: break-all;\n margin: 0;\n }\n `,\n ],\n template: `\n <div class=\"debug-state-inspector\">\n <pre class=\"debug-state-inspector__pre\">{{ state() | json }}</pre>\n </div>\n `,\n})\nexport class DebugStateInspectorComponent {\n readonly state = input<Record<string, unknown>>({});\n}\n","// SPDX-License-Identifier: MIT\nimport { Component, ChangeDetectionStrategy, input, computed, signal } from '@angular/core';\nimport type { DebugAgent, DebugAgentWithHistory } from '../debug-agent';\nimport { CHAT_DEBUG_TOKENS } from '../chat-debug-tokens';\nimport { DebugStateInspectorComponent } from '../debug-state-inspector.component';\n\n@Component({\n selector: 'chat-debug-state-tab',\n standalone: true,\n imports: [DebugStateInspectorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host { display: flex; flex-direction: column; height: 100%; background: var(--ngaf-chat-debug-bg); }\n .state__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 16px;\n border-bottom: 1px solid var(--ngaf-chat-debug-border);\n background: var(--ngaf-chat-debug-bg);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--ngaf-chat-debug-text-subtle);\n }\n .state__copy {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--ngaf-chat-debug-bg-deep);\n border: 1px solid var(--ngaf-chat-debug-border);\n border-radius: 6px;\n padding: 3px 8px;\n font: inherit;\n font-size: 11px;\n letter-spacing: 0;\n text-transform: none;\n color: var(--ngaf-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n }\n .state__copy:hover {\n color: var(--ngaf-chat-debug-text);\n border-color: var(--ngaf-chat-debug-border-strong);\n }\n .state__copy.is-copied {\n color: var(--ngaf-chat-debug-success);\n border-color: var(--ngaf-chat-debug-success);\n }\n .state__copy svg { display: block; }\n .state__body {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n color: var(--ngaf-chat-debug-text);\n }\n `,\n ],\n template: `\n <div class=\"state__header\">\n <span>Current state</span>\n <button type=\"button\" class=\"state__copy\" [class.is-copied]=\"justCopied()\" (click)=\"copy()\">\n @if (justCopied()) {\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.5 6L5 8.5L9.5 3.5\"/></svg>\n <span>Copied</span>\n } @else {\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 14 14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"4\" y=\"4\" width=\"8\" height=\"8\" rx=\"1.2\"/><path d=\"M2 9V2.5C2 2.22 2.22 2 2.5 2H9\"/></svg>\n <span>Copy</span>\n }\n </button>\n </div>\n <div class=\"state__body\">\n <chat-debug-state-inspector [state]=\"state()\" />\n </div>\n `,\n})\nexport class StateInspectorComponent {\n readonly agent = input.required<DebugAgent | DebugAgentWithHistory>();\n\n readonly state = computed((): Record<string, unknown> => {\n return this.agent().state();\n });\n\n protected readonly justCopied = signal<boolean>(false);\n\n copy(): void {\n if (typeof navigator === 'undefined' || !navigator.clipboard) return;\n void navigator.clipboard.writeText(JSON.stringify(this.state(), null, 2));\n this.justCopied.set(true);\n setTimeout(() => this.justCopied.set(false), 1500);\n }\n}\n","// SPDX-License-Identifier: MIT\nexport interface Persistence {\n read<T = unknown>(key: string): T | undefined;\n write<T = unknown>(key: string, value: T): void;\n}\n\n/**\n * Tiny typed localStorage wrapper namespaced under `{prefix}:`. SSR-safe:\n * when `localStorage` is undefined (server build), read returns undefined\n * and write is a no-op.\n */\nexport function createPersistence(prefix: string): Persistence {\n const fullKey = (k: string) => `${prefix}:${k}`;\n return {\n read<T = unknown>(key: string): T | undefined {\n if (typeof localStorage === 'undefined') return undefined;\n const raw = localStorage.getItem(fullKey(key));\n if (raw === null) return undefined;\n try {\n return JSON.parse(raw) as T;\n } catch {\n return undefined;\n }\n },\n write<T = unknown>(key: string, value: T): void {\n if (typeof localStorage === 'undefined') return;\n localStorage.setItem(fullKey(key), JSON.stringify(value));\n },\n };\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n ChangeDetectionStrategy,\n computed,\n effect,\n ElementRef,\n HostListener,\n afterNextRender,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\nimport { ensureChatDebugRootStyles } from './chat-debug-root-styles';\nimport type { DebugAgent, DebugAgentWithHistory } from './debug-agent';\nimport { TimelineInspectorComponent } from './inspectors/timeline-inspector.component';\nimport { StateInspectorComponent } from './inspectors/state-inspector.component';\nimport { createPersistence } from './persistence';\n\nexport type DockPosition = 'right' | 'bottom' | 'left';\n\ninterface TabEntry {\n readonly id: string;\n readonly label: string;\n readonly kind: 'builtin-timeline' | 'builtin-state';\n}\n\nfunction hasHistory(\n agent: DebugAgent | DebugAgentWithHistory\n): agent is DebugAgentWithHistory {\n return typeof (agent as DebugAgentWithHistory).history === 'function';\n}\n\n@Component({\n selector: 'chat-debug',\n standalone: true,\n imports: [TimelineInspectorComponent, StateInspectorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host {\n display: contents;\n }\n\n /* ── Status pill launcher ─────────────────────────────────────── */\n .launcher {\n position: fixed;\n top: 20px;\n right: 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: var(--ngaf-chat-debug-radius-pill);\n background: var(--ngaf-chat-debug-bg);\n border: 1px solid var(--ngaf-chat-debug-border);\n color: var(--ngaf-chat-debug-text);\n cursor: pointer;\n z-index: 990;\n box-shadow: var(--ngaf-chat-debug-shadow-pill);\n transition: background 120ms ease, border-color 120ms ease;\n padding: 0;\n }\n .launcher:hover {\n background: var(--ngaf-chat-debug-surface);\n border-color: var(--ngaf-chat-debug-border-strong);\n }\n .launcher__dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ngaf-chat-debug-success);\n box-shadow: 0 0 8px\n color-mix(in srgb, var(--ngaf-chat-debug-success) 60%, transparent);\n }\n .launcher__dot--streaming {\n background: var(--ngaf-chat-debug-accent);\n box-shadow: 0 0 8px\n color-mix(in srgb, var(--ngaf-chat-debug-accent) 70%, transparent);\n animation: chat-debug-pill-pulse 1.2s ease-in-out infinite;\n }\n @keyframes chat-debug-pill-pulse {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.6;\n transform: scale(0.85);\n }\n }\n\n /* ── Docked panel ─────────────────────────────────────────────── */\n .panel {\n position: fixed;\n background: var(--ngaf-chat-debug-bg);\n color: var(--ngaf-chat-debug-text);\n border: 1px solid var(--ngaf-chat-debug-border);\n z-index: 991;\n display: flex;\n flex-direction: column;\n box-shadow: var(--ngaf-chat-debug-shadow-panel);\n animation: chat-debug-panel-enter 120ms ease;\n }\n .panel--right {\n top: 0;\n right: var(--ngaf-chat-sidebar-claim-right, 0);\n bottom: 0;\n width: var(--panel-size, 420px);\n border-right: 0;\n border-top-left-radius: var(--ngaf-chat-debug-radius-panel);\n border-bottom-left-radius: var(--ngaf-chat-debug-radius-panel);\n transform-origin: bottom right;\n transition: right 200ms ease-out;\n }\n .panel--left {\n top: 0;\n left: 0;\n bottom: 0;\n width: var(--panel-size, 420px);\n border-left: 0;\n border-top-right-radius: var(--ngaf-chat-debug-radius-panel);\n border-bottom-right-radius: var(--ngaf-chat-debug-radius-panel);\n transform-origin: bottom left;\n }\n .panel--bottom {\n left: 0;\n right: var(--ngaf-chat-sidebar-claim-right, 0);\n bottom: 0;\n height: var(--panel-size, 40vh);\n border-bottom: 0;\n border-top-left-radius: var(--ngaf-chat-debug-radius-panel);\n border-top-right-radius: var(--ngaf-chat-debug-radius-panel);\n transform-origin: bottom right;\n transition: right 200ms ease-out;\n }\n /* Mobile breakpoint: when an edge-claimer occupies the right and\n the device is narrow, the bottom strip's effective width is\n ~zero. Explicitly hide it so it doesn't intercept pointer events\n on the sidebar drawer. The chat-debug launcher remains visible. */\n @media (max-width: 767px) {\n .panel--bottom {\n display: none;\n }\n }\n @keyframes chat-debug-panel-enter {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n .panel__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid var(--ngaf-chat-debug-border);\n min-height: 44px;\n box-sizing: border-box;\n }\n .panel__title {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n letter-spacing: -0.01em;\n color: var(--ngaf-chat-debug-text);\n }\n .panel__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .panel__dock-group {\n display: inline-flex;\n gap: 0;\n padding: 2px;\n background: var(--ngaf-chat-debug-bg-deep);\n border: 1px solid var(--ngaf-chat-debug-border);\n border-radius: 6px;\n }\n .panel__dock-btn {\n appearance: none;\n background: transparent;\n border: 0;\n border-radius: 4px;\n width: 24px;\n height: 22px;\n padding: 0;\n color: var(--ngaf-chat-debug-text-subtle);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 120ms ease, color 120ms ease;\n }\n .panel__dock-btn:hover {\n color: var(--ngaf-chat-debug-text);\n }\n .panel__dock-btn.is-active {\n background: var(--ngaf-chat-debug-border);\n color: var(--ngaf-chat-debug-text);\n }\n .panel__dock-btn svg {\n display: block;\n }\n\n .panel__close {\n appearance: none;\n background: transparent;\n border: 0;\n border-radius: 6px;\n width: 26px;\n height: 26px;\n margin-left: 4px;\n color: var(--ngaf-chat-debug-text-subtle);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 120ms ease, color 120ms ease;\n }\n .panel__close:hover {\n background: var(--ngaf-chat-debug-surface);\n color: var(--ngaf-chat-debug-text);\n }\n\n .panel__controls {\n border-bottom: 1px solid var(--ngaf-chat-debug-border);\n overflow-y: auto;\n max-height: 50%;\n background: var(--ngaf-chat-debug-bg);\n }\n .panel__controls:empty {\n display: none;\n }\n\n .panel__tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--ngaf-chat-debug-border);\n padding: 0 12px;\n background: var(--ngaf-chat-debug-bg);\n }\n .panel__tab {\n appearance: none;\n background: transparent;\n border: 0;\n border-bottom: 2px solid transparent;\n padding: 10px 8px;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--ngaf-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n margin-bottom: -1px;\n }\n .panel__tab:hover {\n color: var(--ngaf-chat-debug-text);\n }\n .panel__tab.is-active {\n color: var(--ngaf-chat-debug-text);\n border-bottom-color: var(--ngaf-chat-debug-accent);\n }\n\n .panel__body {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background: var(--ngaf-chat-debug-bg);\n }\n `,\n ],\n template: `\n @if (!open() && launcher() === 'floating') {\n <button\n type=\"button\"\n class=\"launcher\"\n title=\"Open chat devtools\"\n aria-label=\"Open chat devtools\"\n [attr.aria-pressed]=\"false\"\n (click)=\"setOpen(true)\"\n >\n <span\n class=\"launcher__dot\"\n [class.launcher__dot--streaming]=\"isStreaming()\"\n aria-hidden=\"true\"\n ></span>\n </button>\n } @else if (open() && agent(); as currentAgent) {\n <div\n class=\"panel\"\n [class.panel--right]=\"dockState() === 'right'\"\n [class.panel--bottom]=\"dockState() === 'bottom'\"\n [class.panel--left]=\"dockState() === 'left'\"\n role=\"region\"\n aria-label=\"Chat devtools\"\n >\n <div class=\"panel__header\">\n <h3 class=\"panel__title\">Chat Devtools</h3>\n <div class=\"panel__actions\">\n <div\n class=\"panel__dock-group\"\n role=\"group\"\n aria-label=\"Dock position\"\n >\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'left'\"\n (click)=\"setDock('left')\"\n aria-label=\"Dock left\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"5.5\" y1=\"2.5\" x2=\"5.5\" y2=\"11.5\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'bottom'\"\n (click)=\"setDock('bottom')\"\n aria-label=\"Dock bottom\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"1.5\" y1=\"8.5\" x2=\"12.5\" y2=\"8.5\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'right'\"\n (click)=\"setDock('right')\"\n aria-label=\"Dock right\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"8.5\" y1=\"2.5\" x2=\"8.5\" y2=\"11.5\" />\n </svg>\n </button>\n </div>\n <button\n type=\"button\"\n class=\"panel__close\"\n (click)=\"setOpen(false)\"\n aria-label=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"3\" y1=\"3\" x2=\"11\" y2=\"11\" />\n <line x1=\"11\" y1=\"3\" x2=\"3\" y2=\"11\" />\n </svg>\n </button>\n </div>\n </div>\n\n @if (tabs().length > 1) {\n <div class=\"panel__tabs\" role=\"tablist\">\n @for (tab of tabs(); track tab.id) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"panel__tab\"\n [class.is-active]=\"tab.id === activeTabId()\"\n [attr.aria-selected]=\"tab.id === activeTabId()\"\n (click)=\"setActiveTab(tab.id)\"\n >\n {{ tab.label }}\n </button>\n }\n </div>\n }\n\n <div class=\"panel__body\">\n @switch (activeTab()?.kind) { @case ('builtin-timeline') { @if\n (historyAgent(); as history) {\n <chat-debug-timeline-inspector\n [agent]=\"history\"\n (replayRequested)=\"replayRequested.emit($event)\"\n (forkRequested)=\"forkRequested.emit($event)\"\n />\n } } @case ('builtin-state') {\n <chat-debug-state-tab [agent]=\"currentAgent\" />\n } }\n </div>\n </div>\n }\n `,\n})\nexport class ChatDebugComponent {\n readonly agent = input<DebugAgent | DebugAgentWithHistory | null>(null);\n readonly dock = input<DockPosition>('right');\n readonly defaultOpen = input<boolean>(false);\n readonly launcher = input<'floating' | 'none'>('floating');\n readonly storageKey = input<string>('chat-debug');\n\n readonly replayRequested = output<string>();\n readonly forkRequested = output<string>();\n readonly openChange = output<boolean>();\n readonly dockChange = output<DockPosition>();\n\n protected readonly open = signal<boolean>(false);\n protected readonly dockState = signal<DockPosition>('right');\n /** Set to `true` the first time the user explicitly clicks a dock button.\n * Auto-dock detection becomes a no-op after this flips. Not persisted —\n * fresh session = fresh chance for the smart default. */\n private readonly userDockOverride = signal<boolean>(false);\n protected readonly activeTabId = signal<string>('timeline');\n protected readonly historyAgent = computed(() => {\n const agent = this.agent();\n return agent && hasHistory(agent) ? agent : null;\n });\n private readonly hydrated = signal(false);\n\n /** Reads `agent.status()` reactively for the launcher dot. */\n protected readonly isStreaming = computed(() => {\n const status = this.agent()?.status?.();\n return status === 'running';\n });\n\n protected readonly tabs = computed((): TabEntry[] => {\n if (!this.agent()) return [];\n return [\n ...(this.historyAgent()\n ? [\n {\n id: 'timeline',\n label: 'Timeline',\n kind: 'builtin-timeline',\n } satisfies TabEntry,\n ]\n : []),\n { id: 'state', label: 'State', kind: 'builtin-state' },\n ];\n });\n\n protected readonly activeTab = computed(() =>\n this.tabs().find((t) => t.id === this.activeTabId())\n );\n\n private readonly hostEl: ElementRef<HTMLElement> = inject(ElementRef);\n\n constructor() {\n // Inject chat lib root CSS custom properties so the theme-attribute\n // mappings + edge-claim primitive are in the document, even when\n // chat-debug is mounted without a sibling chat composition.\n ensureChatDebugRootStyles();\n\n effect(() => {\n const tabs = this.tabs();\n if (tabs.length === 0) return;\n if (tabs.some((tab) => tab.id === this.activeTabId())) return;\n this.activeTabId.set(tabs[0].id);\n });\n\n // Restore once after Angular has assigned bound input values. Doing this\n // synchronously in the constructor reads input defaults, then immediately\n // writes those defaults to storage and masks a consumer-provided\n // defaultOpen=true on first load.\n afterNextRender(() => {\n const restore = createPersistence(this.storageKey());\n const persistedOpen = restore.read<boolean>('open');\n if (!this.open()) {\n this.open.set(persistedOpen ?? this.defaultOpen());\n }\n const persistedDock = restore.read<DockPosition>('dock');\n this.dockState.set(persistedDock ?? this.dock());\n const persistedTab = restore.read<string>('tab');\n if (persistedTab) this.activeTabId.set(persistedTab);\n this.hydrated.set(true);\n });\n\n // Write-through effect — reads each writable signal so subsequent\n // changes trigger a fresh run that writes them all to storage.\n effect(() => {\n if (!this.hydrated()) return;\n const p = createPersistence(this.storageKey());\n p.write('open', this.open());\n p.write('dock', this.dockState());\n p.write('tab', this.activeTabId());\n });\n\n // Publish the dock the panel currently occupies. Peer panels\n // (e.g. chat-sidebar) read --ngaf-chat-occupy-{right,bottom,left}\n // to avoid overlap.\n effect(() => {\n if (typeof document === 'undefined') return;\n const html = document.documentElement;\n if (this.open()) {\n html.dataset['threadplaneChatDebug'] = this.dockState();\n } else {\n delete html.dataset['threadplaneChatDebug'];\n }\n });\n\n // Auto-dock: when the panel transitions from closed → open AND a\n // sibling <chat-sidebar> exists on the page AND the user hasn't\n // overridden the dock this session, prefer bottom-dock so the two\n // panels coexist without stacking on the right edge.\n effect(() => {\n const isOpen = this.open();\n if (!isOpen) return;\n if (this.userDockOverride()) return;\n if (typeof document === 'undefined') return;\n if (!document.querySelector('chat-sidebar')) return;\n this.dockState.set('bottom');\n });\n }\n\n setOpen(value: boolean): void {\n this.open.set(value);\n this.openChange.emit(value);\n }\n\n setDock(next: DockPosition): void {\n this.userDockOverride.set(true);\n this.dockState.set(next);\n this.dockChange.emit(next);\n }\n\n setActiveTab(id: string): void {\n this.activeTabId.set(id);\n }\n\n @HostListener('document:keydown.escape')\n protected onEsc(): void {\n if (this.open()) this.setOpen(false);\n }\n\n /**\n * Click-outside dismiss. When the panel is open, any click whose\n * composed path doesn't include our host element closes the panel.\n */\n @HostListener('document:click', ['$event'])\n protected onDocumentClick(event: MouseEvent): void {\n if (!this.open()) return;\n const path = event.composedPath();\n if (path.includes(this.hostEl.nativeElement)) return;\n this.setOpen(false);\n }\n}\n","// SPDX-License-Identifier: MIT\nexport { ChatDebugComponent } from './src/lib/compositions/chat-debug/chat-debug.component';\nexport type { DockPosition } from './src/lib/compositions/chat-debug/chat-debug.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ChC;;AC3DD;AACA,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;CAoB9B;AAED,MAAM,gBAAgB,GAAG,6BAA6B;SAEtC,yBAAyB,GAAA;IACvC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE;AACrC,IAAA,IAAI,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAAE;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,IAAA,KAAK,CAAC,EAAE,GAAG,gBAAgB;AAC3B,IAAA,KAAK,CAAC,WAAW,GAAG,sBAAsB;AAC1C,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAClC;;AChCA;MAiFa,4BAA4B,CAAA;AAC9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AA,sBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAiZlD,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBApZ9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,UAAA,EACV,IAAI,EAAA,OAAA,EACP,CAAC,0BAA0B,EAAE,uBAAuB,CAAC,EAAA,eAAA,EAC7C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAuPrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,2/CAAA,EAAA,s+IAAA,CAAA,EAAA;;sBAyIA,YAAY;uBAAC,yBAAyB;;sBAStC,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;;ACvkB5C;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"threadplane-chat-debug.mjs","sources":["../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug-tokens.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug-root-styles.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-checkpoint-card.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/state-diff.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-state-diff.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-utils.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/inspectors/timeline-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/debug-state-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/inspectors/state-inspector.component.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/persistence.ts","../../../../libs/chat/debug/src/lib/compositions/chat-debug/chat-debug.component.ts","../../../../libs/chat/debug/public-api.ts","../../../../libs/chat/debug/threadplane-chat-debug.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n\n/**\n * Component-scoped CSS variables for the chat-debug devtools chrome.\n *\n * Imported into every chat-debug component / primitive's `styles` array\n * so the defaults are set on each `:host` element. Hosts override by\n * setting any token on `chat-debug` or any ancestor.\n *\n * Independent from `--tplane-chat-*` (the chat library's theme tokens).\n * Devtools chrome stays dark regardless of host theme by default —\n * matches Chrome DevTools / React DevTools / Redux DevTools convention.\n *\n * Palette anchor: shadcn zinc-900 + accent blue.\n */\nexport const CHAT_DEBUG_TOKENS = `\n :host {\n --tplane-chat-debug-bg: #18181b;\n --tplane-chat-debug-bg-deep: #09090b;\n --tplane-chat-debug-surface: #1f1f23;\n --tplane-chat-debug-border: #27272a;\n --tplane-chat-debug-border-strong: #3f3f46;\n --tplane-chat-debug-text: #fafafa;\n --tplane-chat-debug-text-muted: #a1a1aa;\n --tplane-chat-debug-text-subtle: #71717a;\n --tplane-chat-debug-accent: #4f8df5;\n --tplane-chat-debug-success: #4ade80;\n --tplane-chat-debug-shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.5);\n --tplane-chat-debug-shadow-pill: 0 6px 18px rgba(0, 0, 0, 0.4);\n --tplane-chat-debug-radius-panel: 12px;\n --tplane-chat-debug-radius-input: 8px;\n --tplane-chat-debug-radius-pill: 999px;\n --tplane-chat-debug-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;\n --tplane-chat-debug-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-family: var(--tplane-chat-debug-font-sans);\n color: var(--tplane-chat-debug-text);\n\n /*\n * Cascade shim: rewire the chat library's color tokens to debug\n * equivalents so embedded components that consume \\`--tplane-chat-*\\`\n * (debug-checkpoint-card, debug-state-diff, debug-state-inspector,\n * any host-projected slot content) pick up the dark devtools surface\n * without each one needing its own re-skin. Geometry / font tokens\n * are left alone — they're neutral.\n */\n --tplane-chat-bg: var(--tplane-chat-debug-bg);\n --tplane-chat-text: var(--tplane-chat-debug-text);\n --tplane-chat-text-muted: var(--tplane-chat-debug-text-muted);\n --tplane-chat-separator: var(--tplane-chat-debug-border);\n --tplane-chat-surface-alt: var(--tplane-chat-debug-bg-deep);\n --tplane-chat-font-size-xs: 12px;\n --tplane-chat-font-mono: var(--tplane-chat-debug-font-mono);\n --tplane-chat-radius-card: 8px;\n --tplane-chat-success: var(--tplane-chat-debug-success);\n --tplane-chat-error-bg: color-mix(in srgb, #ef4444 18%, transparent);\n --tplane-chat-error-text: #fca5a5;\n --tplane-chat-warning-bg: color-mix(in srgb, #f59e0b 18%, transparent);\n --tplane-chat-warning-text: #fcd34d;\n }\n`;\n","// SPDX-License-Identifier: MIT\nconst CHAT_DEBUG_ROOT_STYLES = `\n@layer tplane-chat-debug {\n :root {\n --tplane-chat-sidebar-claim-right: 0px;\n --tplane-chat-debug-panel-size-h: 40vh;\n --tplane-chat-debug-panel-size-w: 420px;\n }\n :root[data-threadplane-chat-debug=\"bottom\"] {\n --tplane-chat-debug-claim-bottom: var(--tplane-chat-debug-panel-size-h, 40vh);\n --tplane-chat-occupy-bottom: var(--tplane-chat-debug-panel-size-h, 40vh);\n }\n :root[data-threadplane-chat-debug=\"right\"] {\n --tplane-chat-debug-claim-right: var(--tplane-chat-debug-panel-size-w, 420px);\n --tplane-chat-occupy-right: var(--tplane-chat-debug-panel-size-w, 420px);\n }\n :root[data-threadplane-chat-debug=\"left\"] {\n --tplane-chat-debug-claim-left: var(--tplane-chat-debug-panel-size-w, 420px);\n --tplane-chat-occupy-left: var(--tplane-chat-debug-panel-size-w, 420px);\n }\n}\n`;\n\nconst STYLE_ELEMENT_ID = 'tplane-chat-debug-root-styles';\n\nexport function ensureChatDebugRootStyles(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(STYLE_ELEMENT_ID)) return;\n const style = document.createElement('style');\n style.id = STYLE_ELEMENT_ID;\n style.textContent = CHAT_DEBUG_ROOT_STYLES;\n document.head.appendChild(style);\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n input,\n output,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\nexport interface DebugCheckpoint {\n node?: string;\n duration?: number;\n tokenCount?: number;\n checkpointId?: string;\n}\n\n@Component({\n selector: 'chat-debug-checkpoint-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-checkpoint-card {\n width: 100%;\n text-align: left;\n border-radius: var(--tplane-chat-radius-card);\n border: 1px solid var(--tplane-chat-separator);\n padding: 8px 12px;\n cursor: pointer;\n background: var(--tplane-chat-bg);\n transition: background 150ms ease, border-color 150ms ease;\n }\n .debug-checkpoint-card:hover {\n background: color-mix(in srgb, var(--tplane-chat-text) 5%, transparent);\n }\n .debug-checkpoint-card--selected {\n border-color: var(--tplane-chat-text-muted);\n background: color-mix(in srgb, var(--tplane-chat-text) 5%, transparent);\n }\n .debug-checkpoint-card__title {\n font-size: var(--tplane-chat-font-size-xs);\n font-weight: 500;\n color: var(--tplane-chat-text);\n margin: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .debug-checkpoint-card__meta {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n }\n .debug-checkpoint-card__badge {\n font-size: var(--tplane-chat-font-size-xs);\n padding: 2px 6px;\n border-radius: 4px;\n background: var(--tplane-chat-surface-alt);\n color: var(--tplane-chat-text-muted);\n }\n `,\n ],\n template: `\n <button\n class=\"debug-checkpoint-card\"\n [class.debug-checkpoint-card--selected]=\"isSelected()\"\n (click)=\"selected.emit()\"\n >\n <p class=\"debug-checkpoint-card__title\">{{ checkpoint().node ?? 'Unknown' }}</p>\n <div class=\"debug-checkpoint-card__meta\">\n @if (checkpoint().duration !== null && checkpoint().duration !== undefined) {\n <span class=\"debug-checkpoint-card__badge\">{{ checkpoint().duration }}ms</span>\n }\n @if (checkpoint().tokenCount !== null && checkpoint().tokenCount !== undefined) {\n <span class=\"debug-checkpoint-card__badge\">{{ checkpoint().tokenCount }} tok</span>\n }\n </div>\n </button>\n `,\n})\nexport class DebugCheckpointCardComponent {\n readonly checkpoint = input.required<DebugCheckpoint>();\n readonly isSelected = input<boolean>(false);\n readonly selected = output<void>();\n}\n","// SPDX-License-Identifier: MIT\n\n/**\n * Represents a single entry in a state diff.\n * - `added`: key exists in `after` but not `before`\n * - `removed`: key exists in `before` but not `after`\n * - `changed`: key exists in both but values differ\n */\nexport interface DiffEntry {\n path: string;\n type: 'added' | 'removed' | 'changed';\n before?: unknown;\n after?: unknown;\n}\n\n/**\n * Computes a recursive diff between two state objects.\n * Returns an array of DiffEntry describing added, removed, and changed keys.\n */\nexport function computeStateDiff(\n before: Record<string, unknown>,\n after: Record<string, unknown>,\n prefix = '',\n): DiffEntry[] {\n const entries: DiffEntry[] = [];\n const allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);\n\n for (const key of allKeys) {\n const path = prefix ? `${prefix}.${key}` : key;\n const inBefore = key in before;\n const inAfter = key in after;\n\n if (!inBefore && inAfter) {\n entries.push({ path, type: 'added', after: after[key] });\n } else if (inBefore && !inAfter) {\n entries.push({ path, type: 'removed', before: before[key] });\n } else {\n const bVal = before[key];\n const aVal = after[key];\n\n // Recurse into nested plain objects\n if (isPlainObject(bVal) && isPlainObject(aVal)) {\n entries.push(\n ...computeStateDiff(\n bVal as Record<string, unknown>,\n aVal as Record<string, unknown>,\n path,\n ),\n );\n } else if (!deepEqual(bVal, aVal)) {\n entries.push({ path, type: 'changed', before: bVal, after: aVal });\n }\n // If equal, no entry\n }\n }\n\n return entries;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.getPrototypeOf(value) === Object.prototype\n );\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a === null || b === null) return false;\n if (typeof a !== typeof b) return false;\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n return a.every((item, i) => deepEqual(item, b[i]));\n }\n\n if (isPlainObject(a) && isPlainObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every((key) => key in b && deepEqual(a[key], b[key]));\n }\n\n return false;\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n computed,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { JsonPipe } from '@angular/common';\nimport { computeStateDiff } from './state-diff';\nimport type { DiffEntry } from './state-diff';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\n@Component({\n selector: 'chat-debug-state-diff',\n standalone: true,\n imports: [JsonPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-state-diff__empty {\n font-size: var(--tplane-chat-font-size-xs);\n color: var(--tplane-chat-text-muted);\n font-style: italic;\n margin: 0;\n }\n .debug-state-diff__list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n .debug-state-diff__entry {\n font-size: var(--tplane-chat-font-size-xs);\n font-family: var(--tplane-chat-font-mono);\n padding: 4px 8px;\n border-radius: 4px;\n }\n .debug-state-diff__entry--added {\n background: var(--tplane-chat-surface-alt);\n color: var(--tplane-chat-success);\n }\n .debug-state-diff__entry--removed {\n background: var(--tplane-chat-error-bg);\n color: var(--tplane-chat-error-text);\n }\n .debug-state-diff__entry--changed {\n background: var(--tplane-chat-warning-bg);\n color: var(--tplane-chat-warning-text);\n }\n .debug-state-diff__key { font-weight: 600; }\n .debug-state-diff__value {\n display: block;\n padding-left: 16px;\n color: var(--tplane-chat-text-muted);\n }\n `,\n ],\n template: `\n @if (diffEntries().length === 0) {\n <p class=\"debug-state-diff__empty\">No changes</p>\n } @else {\n <div class=\"debug-state-diff__list\">\n @for (entry of diffEntries(); track entry.path) {\n <div class=\"debug-state-diff__entry\" [class]=\"entryClass(entry.type)\">\n <span class=\"debug-state-diff__key\">{{ prefix(entry.type) }} {{ entry.path }}</span>\n @if (entry.type === 'changed') {\n <span class=\"debug-state-diff__value\">{{ entry.before | json }} &rarr; {{ entry.after | json }}</span>\n } @else if (entry.type === 'added') {\n <span class=\"debug-state-diff__value\">{{ entry.after | json }}</span>\n } @else {\n <span class=\"debug-state-diff__value\">{{ entry.before | json }}</span>\n }\n </div>\n }\n </div>\n }\n `,\n})\nexport class DebugStateDiffComponent {\n readonly before = input<Record<string, unknown>>({});\n readonly after = input<Record<string, unknown>>({});\n\n readonly diffEntries = computed((): DiffEntry[] =>\n computeStateDiff(this.before(), this.after()),\n );\n\n prefix(type: DiffEntry['type']): string {\n switch (type) {\n case 'added': return '+';\n case 'removed': return '-';\n case 'changed': return '~';\n }\n }\n\n entryClass(type: DiffEntry['type']): string {\n switch (type) {\n case 'added': return 'debug-state-diff__entry--added';\n case 'removed': return 'debug-state-diff__entry--removed';\n case 'changed': return 'debug-state-diff__entry--changed';\n }\n }\n\n /** @deprecated Use entryClass instead — kept for backward compat if any template references it */\n colorClass(type: DiffEntry['type']): string {\n return this.entryClass(type);\n }\n}\n","// SPDX-License-Identifier: MIT\nimport type { DebugAgentCheckpoint } from './debug-agent';\nimport type { DebugCheckpoint } from './debug-checkpoint-card.component';\n\nexport function toDebugCheckpoint(cp: DebugAgentCheckpoint, index: number): DebugCheckpoint {\n return {\n node: cp.label ?? `Step ${index + 1}`,\n checkpointId: cp.id,\n };\n}\n\nexport function extractStateValues(cp: DebugAgentCheckpoint | undefined): Record<string, unknown> {\n return cp?.values ?? {};\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n output,\n signal,\n HostListener,\n} from '@angular/core';\nimport type { DebugAgentWithHistory } from '../debug-agent';\nimport { CHAT_DEBUG_TOKENS } from '../chat-debug-tokens';\nimport { DebugCheckpointCardComponent, type DebugCheckpoint } from '../debug-checkpoint-card.component';\nimport { DebugStateDiffComponent } from '../debug-state-diff.component';\nimport { toDebugCheckpoint, extractStateValues } from '../debug-utils';\n\nexport type Direction = 'up' | 'down' | 'home' | 'end';\n\n/**\n * Pure selection-step function. Exported for unit testing — the component's\n * keyboard handler delegates to it.\n */\nexport function stepSelection(dir: Direction, current: number, count: number): number {\n if (count === 0) return -1;\n switch (dir) {\n case 'down': return Math.min(current + 1, count - 1);\n case 'up': return Math.max(current - 1, 0);\n case 'home': return 0;\n case 'end': return count - 1;\n }\n}\n\n@Component({\n selector: 'chat-debug-timeline-inspector',\n standalone: true,\n imports: [DebugCheckpointCardComponent, DebugStateDiffComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host { display: flex; flex-direction: column; height: 100%; outline: none; }\n .timeline__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 16px;\n border-bottom: 1px solid var(--tplane-chat-debug-border);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--tplane-chat-debug-text-subtle);\n background: var(--tplane-chat-debug-bg);\n }\n .timeline__count { display: inline-flex; align-items: center; gap: 6px; }\n .timeline__count-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 22px;\n height: 18px;\n padding: 0 6px;\n border-radius: 9px;\n background: var(--tplane-chat-debug-surface);\n border: 1px solid var(--tplane-chat-debug-border);\n color: var(--tplane-chat-debug-text);\n font-size: 11px;\n font-weight: 500;\n letter-spacing: 0;\n text-transform: none;\n font-variant-numeric: tabular-nums;\n }\n .timeline__clear {\n background: transparent;\n border: 0;\n cursor: pointer;\n color: var(--tplane-chat-debug-text-subtle);\n font: inherit;\n font-size: 11px;\n letter-spacing: 0;\n text-transform: none;\n padding: 2px 6px;\n border-radius: 6px;\n transition: color 120ms ease, background 120ms ease;\n }\n .timeline__clear:hover:not(:disabled) {\n color: var(--tplane-chat-debug-text);\n background: var(--tplane-chat-debug-surface);\n }\n .timeline__clear:disabled { opacity: 0.4; cursor: default; }\n .timeline__list {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--tplane-chat-debug-bg);\n }\n .timeline__empty {\n padding: 24px 16px;\n text-align: center;\n color: var(--tplane-chat-debug-text-subtle);\n font-size: 13px;\n }\n .timeline__row { display: flex; flex-direction: column; gap: 8px; }\n .timeline__row-actions {\n display: none;\n gap: 8px;\n padding-left: 12px;\n }\n .timeline__row:hover .timeline__row-actions { display: flex; }\n .timeline__row button.row-action {\n background: var(--tplane-chat-debug-bg-deep);\n border: 1px solid var(--tplane-chat-debug-border);\n border-radius: 6px;\n padding: 3px 8px;\n font: inherit;\n font-size: 11px;\n color: var(--tplane-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n }\n .timeline__row button.row-action:hover {\n color: var(--tplane-chat-debug-text);\n border-color: var(--tplane-chat-debug-border-strong);\n }\n .timeline__diff {\n padding: 12px;\n background: var(--tplane-chat-debug-bg-deep);\n border: 1px solid var(--tplane-chat-debug-border);\n border-radius: var(--tplane-chat-debug-radius-input);\n color: var(--tplane-chat-debug-text);\n }\n `,\n ],\n template: `\n <div class=\"timeline__header\">\n <span class=\"timeline__count\">\n <span class=\"timeline__count-badge\">{{ checkpoints().length }}</span>\n <span>checkpoint{{ checkpoints().length === 1 ? '' : 's' }}</span>\n </span>\n <button\n type=\"button\"\n class=\"timeline__clear\"\n [disabled]=\"selectedIndex() < 0\"\n (click)=\"selectedIndex.set(-1)\"\n >Clear selection</button>\n </div>\n <div\n class=\"timeline__list\"\n tabindex=\"0\"\n role=\"listbox\"\n aria-label=\"Checkpoint timeline\"\n >\n @if (checkpoints().length === 0) {\n <div class=\"timeline__empty\">No checkpoints yet. Send a message to populate the timeline.</div>\n }\n @for (cp of checkpoints(); let i = $index; track cp.checkpointId ?? i) {\n <div class=\"timeline__row\">\n <chat-debug-checkpoint-card\n [checkpoint]=\"cp\"\n [isSelected]=\"i === selectedIndex()\"\n (selected)=\"selectedIndex.set(i)\"\n />\n @if (i === selectedIndex() && cp.checkpointId) {\n <div class=\"timeline__row-actions\">\n <button class=\"row-action\" type=\"button\" (click)=\"replayRequested.emit(cp.checkpointId!)\">Replay</button>\n <button class=\"row-action\" type=\"button\" (click)=\"forkRequested.emit(cp.checkpointId!)\">Fork</button>\n </div>\n }\n @if (i === selectedIndex()) {\n <div class=\"timeline__diff\">\n <chat-debug-state-diff\n [before]=\"previousStateAt(i)\"\n [after]=\"currentStateAt(i)\"\n />\n </div>\n }\n </div>\n }\n </div>\n `,\n})\nexport class TimelineInspectorComponent {\n readonly agent = input.required<DebugAgentWithHistory>();\n readonly replayRequested = output<string>();\n readonly forkRequested = output<string>();\n\n readonly selectedIndex = signal<number>(-1);\n\n readonly checkpoints = computed((): DebugCheckpoint[] =>\n this.agent().history().map((cp, i) => toDebugCheckpoint(cp, i)),\n );\n\n currentStateAt(i: number): Record<string, unknown> {\n return extractStateValues(this.agent().history()[i]);\n }\n\n previousStateAt(i: number): Record<string, unknown> {\n if (i <= 0) return {};\n return extractStateValues(this.agent().history()[i - 1]);\n }\n\n @HostListener('keydown', ['$event'])\n protected onKey(ev: KeyboardEvent): void {\n const map: Record<string, Direction | undefined> = {\n ArrowDown: 'down',\n ArrowUp: 'up',\n Home: 'home',\n End: 'end',\n };\n const dir = map[ev.key];\n if (!dir) return;\n ev.preventDefault();\n this.selectedIndex.set(stepSelection(dir, this.selectedIndex(), this.checkpoints().length));\n }\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { JsonPipe } from '@angular/common';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\n\n@Component({\n selector: 'chat-debug-state-inspector',\n standalone: true,\n imports: [JsonPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n .debug-state-inspector {\n overflow: auto;\n max-height: 256px;\n }\n .debug-state-inspector__pre {\n font-size: var(--tplane-chat-font-size-xs);\n font-family: var(--tplane-chat-font-mono);\n color: var(--tplane-chat-text);\n white-space: pre-wrap;\n word-break: break-all;\n margin: 0;\n }\n `,\n ],\n template: `\n <div class=\"debug-state-inspector\">\n <pre class=\"debug-state-inspector__pre\">{{ state() | json }}</pre>\n </div>\n `,\n})\nexport class DebugStateInspectorComponent {\n readonly state = input<Record<string, unknown>>({});\n}\n","// SPDX-License-Identifier: MIT\nimport { Component, ChangeDetectionStrategy, input, computed, signal } from '@angular/core';\nimport type { DebugAgent, DebugAgentWithHistory } from '../debug-agent';\nimport { CHAT_DEBUG_TOKENS } from '../chat-debug-tokens';\nimport { DebugStateInspectorComponent } from '../debug-state-inspector.component';\n\n@Component({\n selector: 'chat-debug-state-tab',\n standalone: true,\n imports: [DebugStateInspectorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host { display: flex; flex-direction: column; height: 100%; background: var(--tplane-chat-debug-bg); }\n .state__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 16px;\n border-bottom: 1px solid var(--tplane-chat-debug-border);\n background: var(--tplane-chat-debug-bg);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--tplane-chat-debug-text-subtle);\n }\n .state__copy {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--tplane-chat-debug-bg-deep);\n border: 1px solid var(--tplane-chat-debug-border);\n border-radius: 6px;\n padding: 3px 8px;\n font: inherit;\n font-size: 11px;\n letter-spacing: 0;\n text-transform: none;\n color: var(--tplane-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n }\n .state__copy:hover {\n color: var(--tplane-chat-debug-text);\n border-color: var(--tplane-chat-debug-border-strong);\n }\n .state__copy.is-copied {\n color: var(--tplane-chat-debug-success);\n border-color: var(--tplane-chat-debug-success);\n }\n .state__copy svg { display: block; }\n .state__body {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n color: var(--tplane-chat-debug-text);\n }\n `,\n ],\n template: `\n <div class=\"state__header\">\n <span>Current state</span>\n <button type=\"button\" class=\"state__copy\" [class.is-copied]=\"justCopied()\" (click)=\"copy()\">\n @if (justCopied()) {\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.5 6L5 8.5L9.5 3.5\"/></svg>\n <span>Copied</span>\n } @else {\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 14 14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"4\" y=\"4\" width=\"8\" height=\"8\" rx=\"1.2\"/><path d=\"M2 9V2.5C2 2.22 2.22 2 2.5 2H9\"/></svg>\n <span>Copy</span>\n }\n </button>\n </div>\n <div class=\"state__body\">\n <chat-debug-state-inspector [state]=\"state()\" />\n </div>\n `,\n})\nexport class StateInspectorComponent {\n readonly agent = input.required<DebugAgent | DebugAgentWithHistory>();\n\n readonly state = computed((): Record<string, unknown> => {\n return this.agent().state();\n });\n\n protected readonly justCopied = signal<boolean>(false);\n\n copy(): void {\n if (typeof navigator === 'undefined' || !navigator.clipboard) return;\n void navigator.clipboard.writeText(JSON.stringify(this.state(), null, 2));\n this.justCopied.set(true);\n setTimeout(() => this.justCopied.set(false), 1500);\n }\n}\n","// SPDX-License-Identifier: MIT\nexport interface Persistence {\n read<T = unknown>(key: string): T | undefined;\n write<T = unknown>(key: string, value: T): void;\n}\n\n/**\n * Tiny typed localStorage wrapper namespaced under `{prefix}:`. SSR-safe:\n * when `localStorage` is undefined (server build), read returns undefined\n * and write is a no-op.\n */\nexport function createPersistence(prefix: string): Persistence {\n const fullKey = (k: string) => `${prefix}:${k}`;\n return {\n read<T = unknown>(key: string): T | undefined {\n if (typeof localStorage === 'undefined') return undefined;\n const raw = localStorage.getItem(fullKey(key));\n if (raw === null) return undefined;\n try {\n return JSON.parse(raw) as T;\n } catch {\n return undefined;\n }\n },\n write<T = unknown>(key: string, value: T): void {\n if (typeof localStorage === 'undefined') return;\n localStorage.setItem(fullKey(key), JSON.stringify(value));\n },\n };\n}\n","// SPDX-License-Identifier: MIT\nimport {\n Component,\n ChangeDetectionStrategy,\n computed,\n effect,\n ElementRef,\n HostListener,\n afterNextRender,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { CHAT_DEBUG_TOKENS } from './chat-debug-tokens';\nimport { ensureChatDebugRootStyles } from './chat-debug-root-styles';\nimport type { DebugAgent, DebugAgentWithHistory } from './debug-agent';\nimport { TimelineInspectorComponent } from './inspectors/timeline-inspector.component';\nimport { StateInspectorComponent } from './inspectors/state-inspector.component';\nimport { createPersistence } from './persistence';\n\nexport type DockPosition = 'right' | 'bottom' | 'left';\n\ninterface TabEntry {\n readonly id: string;\n readonly label: string;\n readonly kind: 'builtin-timeline' | 'builtin-state';\n}\n\nfunction hasHistory(\n agent: DebugAgent | DebugAgentWithHistory\n): agent is DebugAgentWithHistory {\n return typeof (agent as DebugAgentWithHistory).history === 'function';\n}\n\n@Component({\n selector: 'chat-debug',\n standalone: true,\n imports: [TimelineInspectorComponent, StateInspectorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n CHAT_DEBUG_TOKENS,\n `\n :host {\n display: contents;\n }\n\n /* ── Status pill launcher ─────────────────────────────────────── */\n .launcher {\n position: fixed;\n top: 20px;\n right: 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: var(--tplane-chat-debug-radius-pill);\n background: var(--tplane-chat-debug-bg);\n border: 1px solid var(--tplane-chat-debug-border);\n color: var(--tplane-chat-debug-text);\n cursor: pointer;\n z-index: 990;\n box-shadow: var(--tplane-chat-debug-shadow-pill);\n transition: background 120ms ease, border-color 120ms ease;\n padding: 0;\n }\n .launcher:hover {\n background: var(--tplane-chat-debug-surface);\n border-color: var(--tplane-chat-debug-border-strong);\n }\n .launcher__dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--tplane-chat-debug-success);\n box-shadow: 0 0 8px\n color-mix(in srgb, var(--tplane-chat-debug-success) 60%, transparent);\n }\n .launcher__dot--streaming {\n background: var(--tplane-chat-debug-accent);\n box-shadow: 0 0 8px\n color-mix(in srgb, var(--tplane-chat-debug-accent) 70%, transparent);\n animation: chat-debug-pill-pulse 1.2s ease-in-out infinite;\n }\n @keyframes chat-debug-pill-pulse {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.6;\n transform: scale(0.85);\n }\n }\n\n /* ── Docked panel ─────────────────────────────────────────────── */\n .panel {\n position: fixed;\n background: var(--tplane-chat-debug-bg);\n color: var(--tplane-chat-debug-text);\n border: 1px solid var(--tplane-chat-debug-border);\n z-index: 991;\n display: flex;\n flex-direction: column;\n box-shadow: var(--tplane-chat-debug-shadow-panel);\n animation: chat-debug-panel-enter 120ms ease;\n }\n .panel--right {\n top: 0;\n right: var(--tplane-chat-sidebar-claim-right, 0);\n bottom: 0;\n width: var(--panel-size, 420px);\n border-right: 0;\n border-top-left-radius: var(--tplane-chat-debug-radius-panel);\n border-bottom-left-radius: var(--tplane-chat-debug-radius-panel);\n transform-origin: bottom right;\n transition: right 200ms ease-out;\n }\n .panel--left {\n top: 0;\n left: 0;\n bottom: 0;\n width: var(--panel-size, 420px);\n border-left: 0;\n border-top-right-radius: var(--tplane-chat-debug-radius-panel);\n border-bottom-right-radius: var(--tplane-chat-debug-radius-panel);\n transform-origin: bottom left;\n }\n .panel--bottom {\n left: 0;\n right: var(--tplane-chat-sidebar-claim-right, 0);\n bottom: 0;\n height: var(--panel-size, 40vh);\n border-bottom: 0;\n border-top-left-radius: var(--tplane-chat-debug-radius-panel);\n border-top-right-radius: var(--tplane-chat-debug-radius-panel);\n transform-origin: bottom right;\n transition: right 200ms ease-out;\n }\n /* Mobile breakpoint: when an edge-claimer occupies the right and\n the device is narrow, the bottom strip's effective width is\n ~zero. Explicitly hide it so it doesn't intercept pointer events\n on the sidebar drawer. The chat-debug launcher remains visible. */\n @media (max-width: 767px) {\n .panel--bottom {\n display: none;\n }\n }\n @keyframes chat-debug-panel-enter {\n from {\n opacity: 0;\n transform: scale(0.96);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n .panel__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid var(--tplane-chat-debug-border);\n min-height: 44px;\n box-sizing: border-box;\n }\n .panel__title {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n letter-spacing: -0.01em;\n color: var(--tplane-chat-debug-text);\n }\n .panel__actions {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .panel__dock-group {\n display: inline-flex;\n gap: 0;\n padding: 2px;\n background: var(--tplane-chat-debug-bg-deep);\n border: 1px solid var(--tplane-chat-debug-border);\n border-radius: 6px;\n }\n .panel__dock-btn {\n appearance: none;\n background: transparent;\n border: 0;\n border-radius: 4px;\n width: 24px;\n height: 22px;\n padding: 0;\n color: var(--tplane-chat-debug-text-subtle);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 120ms ease, color 120ms ease;\n }\n .panel__dock-btn:hover {\n color: var(--tplane-chat-debug-text);\n }\n .panel__dock-btn.is-active {\n background: var(--tplane-chat-debug-border);\n color: var(--tplane-chat-debug-text);\n }\n .panel__dock-btn svg {\n display: block;\n }\n\n .panel__close {\n appearance: none;\n background: transparent;\n border: 0;\n border-radius: 6px;\n width: 26px;\n height: 26px;\n margin-left: 4px;\n color: var(--tplane-chat-debug-text-subtle);\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 120ms ease, color 120ms ease;\n }\n .panel__close:hover {\n background: var(--tplane-chat-debug-surface);\n color: var(--tplane-chat-debug-text);\n }\n\n .panel__controls {\n border-bottom: 1px solid var(--tplane-chat-debug-border);\n overflow-y: auto;\n max-height: 50%;\n background: var(--tplane-chat-debug-bg);\n }\n .panel__controls:empty {\n display: none;\n }\n\n .panel__tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--tplane-chat-debug-border);\n padding: 0 12px;\n background: var(--tplane-chat-debug-bg);\n }\n .panel__tab {\n appearance: none;\n background: transparent;\n border: 0;\n border-bottom: 2px solid transparent;\n padding: 10px 8px;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--tplane-chat-debug-text-muted);\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n margin-bottom: -1px;\n }\n .panel__tab:hover {\n color: var(--tplane-chat-debug-text);\n }\n .panel__tab.is-active {\n color: var(--tplane-chat-debug-text);\n border-bottom-color: var(--tplane-chat-debug-accent);\n }\n\n .panel__body {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background: var(--tplane-chat-debug-bg);\n }\n `,\n ],\n template: `\n @if (!open() && launcher() === 'floating') {\n <button\n type=\"button\"\n class=\"launcher\"\n title=\"Open chat devtools\"\n aria-label=\"Open chat devtools\"\n [attr.aria-pressed]=\"false\"\n (click)=\"setOpen(true)\"\n >\n <span\n class=\"launcher__dot\"\n [class.launcher__dot--streaming]=\"isStreaming()\"\n aria-hidden=\"true\"\n ></span>\n </button>\n } @else if (open() && agent(); as currentAgent) {\n <div\n class=\"panel\"\n [class.panel--right]=\"dockState() === 'right'\"\n [class.panel--bottom]=\"dockState() === 'bottom'\"\n [class.panel--left]=\"dockState() === 'left'\"\n role=\"region\"\n aria-label=\"Chat devtools\"\n >\n <div class=\"panel__header\">\n <h3 class=\"panel__title\">Chat Devtools</h3>\n <div class=\"panel__actions\">\n <div\n class=\"panel__dock-group\"\n role=\"group\"\n aria-label=\"Dock position\"\n >\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'left'\"\n (click)=\"setDock('left')\"\n aria-label=\"Dock left\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"5.5\" y1=\"2.5\" x2=\"5.5\" y2=\"11.5\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'bottom'\"\n (click)=\"setDock('bottom')\"\n aria-label=\"Dock bottom\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"1.5\" y1=\"8.5\" x2=\"12.5\" y2=\"8.5\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"panel__dock-btn\"\n [class.is-active]=\"dockState() === 'right'\"\n (click)=\"setDock('right')\"\n aria-label=\"Dock right\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"9\" rx=\"1.2\" />\n <line x1=\"8.5\" y1=\"2.5\" x2=\"8.5\" y2=\"11.5\" />\n </svg>\n </button>\n </div>\n <button\n type=\"button\"\n class=\"panel__close\"\n (click)=\"setOpen(false)\"\n aria-label=\"Close\"\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <line x1=\"3\" y1=\"3\" x2=\"11\" y2=\"11\" />\n <line x1=\"11\" y1=\"3\" x2=\"3\" y2=\"11\" />\n </svg>\n </button>\n </div>\n </div>\n\n @if (tabs().length > 1) {\n <div class=\"panel__tabs\" role=\"tablist\">\n @for (tab of tabs(); track tab.id) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"panel__tab\"\n [class.is-active]=\"tab.id === activeTabId()\"\n [attr.aria-selected]=\"tab.id === activeTabId()\"\n (click)=\"setActiveTab(tab.id)\"\n >\n {{ tab.label }}\n </button>\n }\n </div>\n }\n\n <div class=\"panel__body\">\n @switch (activeTab()?.kind) { @case ('builtin-timeline') { @if\n (historyAgent(); as history) {\n <chat-debug-timeline-inspector\n [agent]=\"history\"\n (replayRequested)=\"replayRequested.emit($event)\"\n (forkRequested)=\"forkRequested.emit($event)\"\n />\n } } @case ('builtin-state') {\n <chat-debug-state-tab [agent]=\"currentAgent\" />\n } }\n </div>\n </div>\n }\n `,\n})\nexport class ChatDebugComponent {\n readonly agent = input<DebugAgent | DebugAgentWithHistory | null>(null);\n readonly dock = input<DockPosition>('right');\n readonly defaultOpen = input<boolean>(false);\n readonly launcher = input<'floating' | 'none'>('floating');\n readonly storageKey = input<string>('chat-debug');\n\n readonly replayRequested = output<string>();\n readonly forkRequested = output<string>();\n readonly openChange = output<boolean>();\n readonly dockChange = output<DockPosition>();\n\n protected readonly open = signal<boolean>(false);\n protected readonly dockState = signal<DockPosition>('right');\n /** Set to `true` the first time the user explicitly clicks a dock button.\n * Auto-dock detection becomes a no-op after this flips. Not persisted —\n * fresh session = fresh chance for the smart default. */\n private readonly userDockOverride = signal<boolean>(false);\n protected readonly activeTabId = signal<string>('timeline');\n protected readonly historyAgent = computed(() => {\n const agent = this.agent();\n return agent && hasHistory(agent) ? agent : null;\n });\n private readonly hydrated = signal(false);\n\n /** Reads `agent.status()` reactively for the launcher dot. */\n protected readonly isStreaming = computed(() => {\n const status = this.agent()?.status?.();\n return status === 'running';\n });\n\n protected readonly tabs = computed((): TabEntry[] => {\n if (!this.agent()) return [];\n return [\n ...(this.historyAgent()\n ? [\n {\n id: 'timeline',\n label: 'Timeline',\n kind: 'builtin-timeline',\n } satisfies TabEntry,\n ]\n : []),\n { id: 'state', label: 'State', kind: 'builtin-state' },\n ];\n });\n\n protected readonly activeTab = computed(() =>\n this.tabs().find((t) => t.id === this.activeTabId())\n );\n\n private readonly hostEl: ElementRef<HTMLElement> = inject(ElementRef);\n\n constructor() {\n // Inject chat lib root CSS custom properties so the theme-attribute\n // mappings + edge-claim primitive are in the document, even when\n // chat-debug is mounted without a sibling chat composition.\n ensureChatDebugRootStyles();\n\n effect(() => {\n const tabs = this.tabs();\n if (tabs.length === 0) return;\n if (tabs.some((tab) => tab.id === this.activeTabId())) return;\n this.activeTabId.set(tabs[0].id);\n });\n\n // Restore once after Angular has assigned bound input values. Doing this\n // synchronously in the constructor reads input defaults, then immediately\n // writes those defaults to storage and masks a consumer-provided\n // defaultOpen=true on first load.\n afterNextRender(() => {\n const restore = createPersistence(this.storageKey());\n const persistedOpen = restore.read<boolean>('open');\n if (!this.open()) {\n this.open.set(persistedOpen ?? this.defaultOpen());\n }\n const persistedDock = restore.read<DockPosition>('dock');\n this.dockState.set(persistedDock ?? this.dock());\n const persistedTab = restore.read<string>('tab');\n if (persistedTab) this.activeTabId.set(persistedTab);\n this.hydrated.set(true);\n });\n\n // Write-through effect — reads each writable signal so subsequent\n // changes trigger a fresh run that writes them all to storage.\n effect(() => {\n if (!this.hydrated()) return;\n const p = createPersistence(this.storageKey());\n p.write('open', this.open());\n p.write('dock', this.dockState());\n p.write('tab', this.activeTabId());\n });\n\n // Publish the dock the panel currently occupies. Peer panels\n // (e.g. chat-sidebar) read --tplane-chat-occupy-{right,bottom,left}\n // to avoid overlap.\n effect(() => {\n if (typeof document === 'undefined') return;\n const html = document.documentElement;\n if (this.open()) {\n html.dataset['threadplaneChatDebug'] = this.dockState();\n } else {\n delete html.dataset['threadplaneChatDebug'];\n }\n });\n\n // Auto-dock: when the panel transitions from closed → open AND a\n // sibling <chat-sidebar> exists on the page AND the user hasn't\n // overridden the dock this session, prefer bottom-dock so the two\n // panels coexist without stacking on the right edge.\n effect(() => {\n const isOpen = this.open();\n if (!isOpen) return;\n if (this.userDockOverride()) return;\n if (typeof document === 'undefined') return;\n if (!document.querySelector('chat-sidebar')) return;\n this.dockState.set('bottom');\n });\n }\n\n setOpen(value: boolean): void {\n this.open.set(value);\n this.openChange.emit(value);\n }\n\n setDock(next: DockPosition): void {\n this.userDockOverride.set(true);\n this.dockState.set(next);\n this.dockChange.emit(next);\n }\n\n setActiveTab(id: string): void {\n this.activeTabId.set(id);\n }\n\n @HostListener('document:keydown.escape')\n protected onEsc(): void {\n if (this.open()) this.setOpen(false);\n }\n\n /**\n * Click-outside dismiss. When the panel is open, any click whose\n * composed path doesn't include our host element closes the panel.\n */\n @HostListener('document:click', ['$event'])\n protected onDocumentClick(event: MouseEvent): void {\n if (!this.open()) return;\n const path = event.composedPath();\n if (path.includes(this.hostEl.nativeElement)) return;\n this.setOpen(false);\n }\n}\n","// SPDX-License-Identifier: MIT\nexport { ChatDebugComponent } from './src/lib/compositions/chat-debug/chat-debug.component';\nexport type { DockPosition } from './src/lib/compositions/chat-debug/chat-debug.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ChC;;AC3DD;AACA,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;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