Skip to content

Commit 4614ad7

Browse files
bloveclaude
andauthored
feat(chat): complete runtime decoupling — compositions back to @cacheplane/chat (#136)
* docs: phase-2 design for finishing chat-runtime decoupling Defines the ChatAgentWithHistory sub-contract, ChatCheckpoint neutral shape, file-movement plan (three compositions back to @cacheplane/chat), and public-API delta. Replay/fork stay as composition outputs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: phase-2 implementation plan 9 tasks: add sub-contract types, extend mock/conformance, widen toChatAgent, move three compositions back to @cacheplane/chat, rebind cockpit consumers, verify dep graph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(chat): add ChatAgentWithHistory sub-contract and ChatCheckpoint Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(chat): extend mockChatAgent with optional history Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * test(chat): add ChatAgentWithHistory conformance helper Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(langgraph): widen toChatAgent to ChatAgentWithHistory, translate history Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(chat,langgraph): move chat-timeline primitive to chat, retarget to ChatAgentWithHistory Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(chat,langgraph): move chat-timeline-slider to chat, retarget to ChatAgentWithHistory Moves ChatTimelineSliderComponent from @cacheplane/langgraph to @cacheplane/chat, replacing the LangGraph-specific AgentRef/ThreadState types with the runtime-neutral ChatAgentWithHistory/ChatCheckpoint contract. Updates both public-api.ts files accordingly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(chat,langgraph): move chat-debug composition tree to chat, retarget to ChatCheckpoint Moves all 11 files from libs/langgraph/src/lib/compositions/chat-debug/ to libs/chat/src/lib/compositions/chat-debug/. Rewires chat-debug.component.ts to use ChatAgentWithHistory (replacing AgentRef + toChatAgent adapter) and debug-utils.ts to consume ChatCheckpoint (replacing ThreadState). Updates public APIs: ChatDebugComponent exported from @cacheplane/chat; all debug-* re-exports removed from @cacheplane/langgraph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(cockpit): rebind chat-debug and chat-timeline demos to @cacheplane/chat Move ChatDebugComponent and ChatTimelineSliderComponent imports from @cacheplane/langgraph to @cacheplane/chat, and update consumer bindings to use [agent] instead of [ref] for consistency with Phase-2 primitives. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(chat): allow vitest in @nx/dependency-checks ignore list Conformance helpers (chat-agent-conformance, chat-agent-with-history- conformance) legitimately import from vitest. Adding to ignoredDependencies matches how vite/@nx/vite are already excluded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(langgraph): drop unused @angular/common, @angular/platform-browser peer-deps After the chat-debug tree moved to @cacheplane/chat in Phase-2, @cacheplane/langgraph no longer consumes NgTemplateOutlet or DomSanitizer. @nx/dependency-checks correctly flagged both as unused. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 71f290e commit 4614ad7

35 files changed

Lines changed: 1439 additions & 274 deletions

cockpit/chat/debug/angular/src/app/debug.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
22
import { Component } from '@angular/core';
3-
import { ChatDebugComponent } from '@cacheplane/langgraph';
4-
import { agent } from '@cacheplane/langgraph';
3+
import { ChatDebugComponent } from '@cacheplane/chat';
4+
import { agent, toChatAgent } from '@cacheplane/langgraph';
55
import { ExampleChatLayoutComponent } from '@cacheplane/example-layouts';
66
import { environment } from '../environments/environment';
77

@@ -16,7 +16,7 @@ import { environment } from '../environments/environment';
1616
imports: [ChatDebugComponent, ExampleChatLayoutComponent],
1717
template: `
1818
<example-chat-layout>
19-
<chat-debug main [ref]="stream" />
19+
<chat-debug main [agent]="chatAgent" />
2020
</example-chat-layout>
2121
`,
2222
})
@@ -25,4 +25,5 @@ export class DebugPageComponent {
2525
apiUrl: environment.langGraphApiUrl,
2626
assistantId: environment.streamingAssistantId,
2727
});
28+
protected readonly chatAgent = toChatAgent(this.stream);
2829
}

cockpit/chat/timeline/angular/src/app/timeline.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
22
import { Component } from '@angular/core';
3-
import { ChatComponent } from '@cacheplane/chat';
3+
import { ChatComponent, ChatTimelineSliderComponent } from '@cacheplane/chat';
44
import { ExampleChatLayoutComponent } from '@cacheplane/example-layouts';
5-
import { agent, toChatAgent, ChatTimelineSliderComponent } from '@cacheplane/langgraph';
5+
import { agent, toChatAgent } from '@cacheplane/langgraph';
66
import { environment } from '../environments/environment';
77

88
/**
@@ -20,7 +20,7 @@ import { environment } from '../environments/environment';
2020
<div sidebar class="p-4 space-y-4" style="background: var(--chat-bg, #171717); color: var(--chat-text, #e0e0e0);">
2121
<h3 class="text-xs font-semibold uppercase tracking-wide"
2222
style="color: var(--chat-text-muted, #777);">Timeline</h3>
23-
<chat-timeline-slider [ref]="stream" />
23+
<chat-timeline-slider [agent]="chatAgent" />
2424
<div class="mt-4">
2525
<h4 class="text-xs font-semibold uppercase tracking-wide mb-2"
2626
style="color: var(--chat-text-muted, #777);">How It Works</h4>

0 commit comments

Comments
 (0)