Skip to content

Commit e8541da

Browse files
bloveclaude
andauthored
feat(ag-ui): FakeAgent for offline cockpit demo (#140)
* docs: AG-UI FakeAgent implementation plan 5 tasks: implement FakeAgent + spec, provideFakeAgUiAgent + spec, public-api exports, cockpit demo rewiring, verify + PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(ag-ui): FakeAgent + provideFakeAgUiAgent for offline demos In-process AbstractAgent subclass that emits a canned streaming response. Drop-in replacement for provideAgUiAgent({ url }) when no real backend is available. Tests cover event ordering, token streaming, and unsubscribe cancellation. Deviation from plan: FakeAgent.run() is public (not protected) to satisfy AbstractAgent's public abstract signature in @ag-ui/client@0.0.53. Spec calls agent.run() directly rather than via (agent as any).run(). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(cockpit): wire AG-UI streaming demo to FakeAgent Demo runs end-to-end with no backend or network. Real-backend wiring is one line away via provideAgUiAgent({ url: ... }). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: override rxjs version to dedupe @ag-ui/client's nested install @ag-ui/client@0.0.52 pins rxjs@7.8.1 exactly, which caused npm to install rxjs in two locations (top-level 7.8.2 and nested 7.8.1 under node_modules/@ag-ui/client/). TypeScript saw the two Observable types as incompatible across module boundaries when the AG-UI adapter tried to subscribe to source.agent(). The npm override forces all rxjs resolutions to follow the project's ~7.8.0 range, deduping to a single hoisted install. ABI-compatible. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: preserve cross-platform swc bindings in lockfile after rxjs override Previous commit (43ad74f) regenerated package-lock.json on macOS, which silently dropped optional platform-specific @next/swc-* bindings for non-darwin platforms. CI on Linux failed with 'Failed to load native binding' on apps/cockpit/next.config.ts and apps/website/. Restore main's lockfile then surgically remove only the nested @ag-ui/client/node_modules/rxjs entry (the override target). Verified: all 24 @next/swc-* entries present, single hoisted rxjs, npm ci passes on clean checkout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 68dce15 commit e8541da

9 files changed

Lines changed: 621 additions & 12 deletions

File tree

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
22
import { ApplicationConfig } from '@angular/core';
3-
import { provideAgUiAgent } from '@cacheplane/ag-ui';
4-
import { environment } from '../environments/environment';
3+
import { provideFakeAgUiAgent } from '@cacheplane/ag-ui';
54

65
export const appConfig: ApplicationConfig = {
76
providers: [
8-
provideAgUiAgent({ url: environment.agUiUrl }),
7+
provideFakeAgUiAgent({
8+
tokens: [
9+
'This', ' is', ' the', ' AG-UI', ' streaming', ' demo.',
10+
' Messages', ' are', ' generated', ' in-process', ' by', ' a', ' FakeAgent',
11+
' that', ' emits', ' canned', ' AG-UI', ' events.',
12+
' Swap', ' to', ' provideAgUiAgent({ url })', ' to', ' connect', ' a', ' real', ' backend.',
13+
],
14+
delayMs: 50,
15+
}),
916
],
1017
};

0 commit comments

Comments
 (0)