Skip to content

Commit fe01b39

Browse files
bloveclaude
andauthored
docs: complete docs content authoring - 15 pages (#5)
* docs: add glassy gradient redesign spec Design spec for refactoring the website from dark navy to light frosted-glass aesthetic with dual-brand Angular/LangGraph gradients. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add glassy gradient redesign implementation plan 22-task plan covering token updates, global CSS, and all component sweeps for the light frosted-glass redesign. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): update design tokens for glassy gradient redesign * feat(website): update global CSS for light glassy theme * feat(website): apply gradient background and glass to Hero * feat(website): update ArchDiagram for light glassy theme * feat(website): apply glass cards to FeatureStrip * feat(website): apply glass treatment to ApiRefTable * feat(website): apply glass border to CodeBlock * feat(website): add gradient background to API reference page * feat(website): apply glass cards to PricingGrid * feat(website): apply glass container to CompareTable * feat(website): apply glass treatment to LeadForm * feat(website): add gradient background to pricing page * feat(website): update GenerativeUIFrame outer frame for glass theme * feat(website): apply gradient background to landing page * feat(website): apply glass treatment to Nav * feat(website): apply glass treatment to Footer * feat(website): apply glass treatment to InstallStrip * feat(website): update CopyPromptButton to new accent colors * feat(website): apply glass treatment to DocsSidebar * feat(website): switch MdxRenderer to light prose theme * feat(website): add gradient background to docs page * fix(website): correct design-tokens import paths Subagents used incorrect relative paths (../../lib instead of ../../../lib) for components nested in src/components/*/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(website): use unicode chars instead of HTML entities in JSX JSX doesn't interpret &check; entity — use ✓ character directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): expand architecture diagram with two-row layout and descriptions * feat(website): redesign hero animation with multi-step agent UI Replace quarterly revenue report demo with a 4-phase agent flow: Phase 1 user message word-by-word, Phase 2 planning card with 3 steps, Phase 3 sequential step execution with database preview and churn metric, Phase 4 streaming summary card. Loop fades at 5.5s, restarts at 7s. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(website): make API reference gradient fill full viewport * feat(website): add GitHub link to nav bar * feat(website): update hero copy button to full setup snippet * feat(website): remove live demo section from landing page * docs: add homepage expansion implementation plan 7-task plan for adding ValueProps, LangGraph/DeepAgents showcases, CockpitCTA, and StatsStrip sections to the landing page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): add interactive tabbed ValueProps section * feat(website): add reusable CapabilityCard component * feat(website): add CockpitCTA and StatsStrip sections * feat(website): add LangGraph and Deep Agents capability showcases * feat(website): wire up all new homepage sections Adds ValueProps, LangGraphShowcase, DeepAgentsShowcase, CockpitCTA, and StatsStrip to the landing page with distributed gradient blobs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(website): reorder homepage for optimal landing page flow Hook → Trust → Value → Proof → Depth → Architecture → Features → Convert Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): redesign architecture as interactive vertical glass layout Replaces SVG diagram with clickable vertical node stack + detail panel. Each node shows description on click with glass treatment and color coding. Animated dots on connectors. Sticky detail panel on desktop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(website): mobile responsive polish - Nav: hamburger menu on mobile, hidden desktop links - Footer: stack copyright on small screens - CockpitCTA: hide sidebar mock on mobile, reduce padding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): expand footer and add scroll animations Footer: 4-column grid layout with brand description, GitHub/npm icons, Product and Resources link columns, hover effects on all links. Animations: CSS scroll-triggered fadeInUp for server components (ValueProps, CodeBlock, showcases). Smooth scrolling enabled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add docs refresh design spec Mintlify-inspired custom build with Diataxis structure, 19 pages, custom MDX components, Cmd+K search, and glass design treatment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add docs infrastructure implementation plan 14-task plan for Mintlify-inspired docs framework: new routing, collapsible sidebar, 5 MDX components, Cmd+K search, breadcrumbs, prev/next navigation, 3 placeholder content pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(website): add docs navigation config * feat(website): add new docs loader (cockpit-independent) * feat(website): add placeholder docs content (3 pages) * feat(website): add custom MDX components (Callout, Steps, Tabs, Card, CodeGroup) * feat(website): add collapsible docs sidebar with section groups * feat(website): add DocsBreadcrumb and DocsPrevNext components * feat(website): add Cmd+K search modal for docs * feat(website): wire up new docs routing with MDX components and sidebar Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(website): make Tabs items prop optional with fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(website): fix DocsSidebarNew type error in useState Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(website): remove old docs system and shadcn UI remnants - Remove /api-reference page (replaced by /docs/api/stream-resource) - Update nav API link to point to docs - Remove old DocsSidebar.tsx and open-in-cockpit.tsx - Remove shadcn UI components from merge conflict - Fix DocsSidebarNew useState type error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add autogenerated API reference design spec JSDoc + TypeDoc pipeline + glass card rendering in docs framework. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(website): update e2e and unit tests for new docs system - Update e2e tests for new routing (/docs/getting-started/introduction) - Update docs spec to test new docs-new.ts loader - Remove references to old /api-reference page and 5-segment slugs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add API reference autogen implementation plan 8-task plan: JSDoc annotations, TypeDoc pipeline enhancement, ApiDocRenderer component, MDX pages, and CI integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(stream-resource): add JSDoc to streamResource() and provideStreamResource() * docs(stream-resource): add JSDoc to all public types and interfaces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(stream-resource): add JSDoc to FetchStreamTransport and MockStreamTransport * feat(website): add API reference MDX stub pages * feat(website): enhance TypeDoc script for structured API docs JSON * feat(website): add ApiDocRenderer component for autogenerated API docs * feat(website): wire API doc pages with autogenerated content from JSON * ci: add generate-api-docs step before website build * chore: trigger CI * docs: add docs content authoring plan 15-task plan for writing all docs pages with real code examples from cockpit implementations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(website): write Quick Start guide * docs(website): write Time Travel guide * docs(website): write Subgraphs guide * docs(website): write Persistence guide * docs(website): write Installation guide * docs(website): write Interrupts guide * docs(website): write Testing guide * docs(website): write Deployment guide * docs(website): write Memory guide * docs(website): write Angular Signals concept page * docs(website): write LangGraph Basics concept page * docs(website): write Agent Architecture concept page * docs(website): write State Management concept page * docs(website): enhance Introduction page with expanded content --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0e90ce9 commit fe01b39

15 files changed

Lines changed: 2462 additions & 11 deletions
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Agent Architecture
2+
3+
How AI agents work — the planning, execution, and tool-calling lifecycle that streamResource() connects your Angular app to.
4+
5+
## The agent loop
6+
7+
An AI agent follows a cycle:
8+
9+
<Steps>
10+
<Step title="Receive input">
11+
The user sends a message via `submit()`. streamResource() posts it to LangGraph Platform.
12+
</Step>
13+
<Step title="Plan">
14+
The LLM decides what to do next — respond directly, call a tool, or delegate to a subagent.
15+
</Step>
16+
<Step title="Execute">
17+
Tools run (database queries, API calls, code execution). Results feed back into state.
18+
</Step>
19+
<Step title="Respond">
20+
The agent streams its response token-by-token. streamResource() updates the `messages()` signal in real-time.
21+
</Step>
22+
<Step title="Checkpoint">
23+
State is checkpointed. The agent may loop back to Plan, or finish.
24+
</Step>
25+
</Steps>
26+
27+
## Tool calling
28+
29+
Agents extend their capabilities through tools. streamResource() tracks tool execution:
30+
31+
```typescript
32+
const agent = streamResource<AgentState>({
33+
assistantId: 'research_agent',
34+
});
35+
36+
// Currently executing tools
37+
const tools = computed(() => agent.toolProgress());
38+
39+
// Completed tool calls with results
40+
const completedTools = computed(() => agent.toolCalls());
41+
```
42+
43+
## Multi-agent patterns
44+
45+
Complex tasks use multiple agents working together:
46+
47+
- **Orchestrator** — one agent delegates to specialized subagents
48+
- **Pipeline** — agents process sequentially, each refining the output
49+
- **Debate** — agents review each other's work
50+
51+
streamResource() supports these patterns through the `subagents()` and `activeSubagents()` signals.
52+
53+
<Callout type="tip" title="Start simple">
54+
Most applications only need a single agent with tools. Add subagents when you need true task delegation with isolated state.
55+
</Callout>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Angular Signals
2+
3+
streamResource() is built on Angular Signals — the reactive primitive introduced in Angular 16+. Every property on a StreamResourceRef is a Signal, making it work seamlessly with OnPush change detection, computed values, and effect callbacks.
4+
5+
## Signals primer
6+
7+
A Signal is a reactive value container. When a Signal's value changes, Angular automatically re-renders any template that reads it.
8+
9+
```typescript
10+
// streamResource returns Signals, not Observables
11+
const chat = streamResource<ChatState>({ assistantId: 'agent' });
12+
13+
chat.messages() // Signal<BaseMessage[]> — call to read
14+
chat.status() // Signal<ResourceStatus>
15+
chat.error() // Signal<unknown>
16+
chat.isLoading() // Signal<boolean> (computed)
17+
```
18+
19+
## Computed values
20+
21+
Use `computed()` to derive new Signals from streamResource signals.
22+
23+
```typescript
24+
const lastMessage = computed(() =>
25+
chat.messages().at(-1)?.content ?? ''
26+
);
27+
28+
const messageCount = computed(() =>
29+
chat.messages().length
30+
);
31+
32+
const isIdle = computed(() =>
33+
chat.status() === 'idle'
34+
);
35+
```
36+
37+
## OnPush change detection
38+
39+
Because Signals trigger change detection automatically, streamResource works perfectly with `ChangeDetectionStrategy.OnPush`.
40+
41+
```typescript
42+
@Component({
43+
changeDetection: ChangeDetectionStrategy.OnPush,
44+
template: `
45+
@for (msg of chat.messages(); track $index) {
46+
<p>{{ msg.content }}</p>
47+
}
48+
`,
49+
})
50+
export class ChatComponent {
51+
chat = streamResource<ChatState>({ assistantId: 'agent' });
52+
}
53+
```
54+
55+
## No RxJS required
56+
57+
Unlike traditional Angular HTTP patterns, streamResource doesn't use Observables. There are no subscriptions to manage, no async pipes needed, and no memory leak risks.
58+
59+
<Callout type="tip" title="Why Signals over RxJS?">
60+
Signals are simpler for UI state. They synchronously read the latest value, compose with computed(), and integrate with Angular's template syntax. streamResource handles the async SSE connection internally and surfaces results as Signals.
61+
</Callout>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# LangGraph Basics
2+
3+
LangGraph is a framework for building stateful AI agents as directed graphs. This page explains the core concepts for Angular developers who are new to agent development.
4+
5+
## Graphs, nodes, and edges
6+
7+
A LangGraph agent is a directed graph where:
8+
9+
<Steps>
10+
<Step title="Nodes are functions">
11+
Each node performs one action — calling an LLM, querying a database, or making an API request. Nodes receive state and return updated state.
12+
</Step>
13+
<Step title="Edges define flow">
14+
Edges connect nodes. Conditional edges route execution based on state, enabling branching logic.
15+
</Step>
16+
<Step title="State is shared">
17+
All nodes read from and write to a shared state object. This state is what streamResource() exposes through its signals.
18+
</Step>
19+
</Steps>
20+
21+
## How streamResource connects
22+
23+
Your Angular app doesn't run the graph — LangGraph Platform does. streamResource() is the bridge:
24+
25+
1. Your component calls `submit()` with user input
26+
2. FetchStreamTransport sends an HTTP POST to LangGraph Platform
27+
3. The platform runs the graph and streams state updates via SSE
28+
4. streamResource() updates its Signals as events arrive
29+
5. Angular re-renders your templates automatically
30+
31+
## State design
32+
33+
The generic type parameter in `streamResource<T>()` defines your agent's state shape.
34+
35+
```typescript
36+
// Simple chat state
37+
streamResource<{ messages: BaseMessage[] }>({ ... })
38+
39+
// Rich agent state with custom fields
40+
interface AgentState {
41+
messages: BaseMessage[];
42+
plan: string[];
43+
currentStep: number;
44+
results: Record<string, unknown>;
45+
}
46+
streamResource<AgentState>({ ... })
47+
```
48+
49+
<Callout type="info" title="Learn more">
50+
For deeper LangGraph concepts (persistence, interrupts, memory), see the individual guide pages.
51+
</Callout>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# State Management
2+
3+
How state flows through streamResource() — from LangGraph's server-side state machine to Angular Signals in your templates.
4+
5+
## State lives on the server
6+
7+
Unlike traditional Angular state management (NgRx, signals stores), agent state lives on the LangGraph Platform. Your Angular app is a stateless view layer.
8+
9+
```
10+
LangGraph Platform (source of truth)
11+
↓ SSE stream
12+
FetchStreamTransport (transport layer)
13+
↓ events
14+
streamResource() (signal conversion)
15+
↓ Signals
16+
Angular templates (reactive rendering)
17+
```
18+
19+
## The state shape
20+
21+
Your state type defines what the agent manages. The `value()` signal exposes the full state object.
22+
23+
```typescript
24+
interface ProjectState {
25+
messages: BaseMessage[];
26+
files: string[];
27+
analysis: { score: number; issues: string[] };
28+
}
29+
30+
const agent = streamResource<ProjectState>({
31+
assistantId: 'project_agent',
32+
});
33+
34+
// Access any state field as a reactive value
35+
const files = computed(() => agent.value().files);
36+
const score = computed(() => agent.value().analysis.score);
37+
```
38+
39+
## Thread state vs application state
40+
41+
<Callout type="info" title="Two kinds of state">
42+
Thread state (managed by LangGraph) and application state (managed by Angular) are separate concerns. Don't try to sync them — read thread state from signals, manage UI state with Angular signals.
43+
</Callout>
44+
45+
```typescript
46+
// Thread state — from the agent
47+
const messages = agent.messages(); // Read-only signal
48+
const agentStatus = agent.status(); // Read-only signal
49+
50+
// Application state — your Angular code
51+
const sidebarOpen = signal(true); // Your UI state
52+
const selectedTab = signal('chat'); // Your UI state
53+
```
54+
55+
## State updates are immutable
56+
57+
Every state update from the agent creates a new signal value. Angular's change detection picks this up automatically.
58+
59+
```typescript
60+
// This works with OnPush because the Signal reference changes
61+
@for (msg of agent.messages(); track $index) {
62+
<p>{{ msg.content }}</p>
63+
}
64+
65+
// Computed values re-evaluate when dependencies change
66+
const hasErrors = computed(() =>
67+
agent.value().analysis.issues.length > 0
68+
);
69+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Installation
2+
3+
Detailed setup guide for streamResource() in your Angular application.
4+
5+
## Requirements
6+
7+
<Steps>
8+
<Step title="Angular 20+">
9+
streamResource() uses Angular Signals and the modern injection context API. Angular 20 or later is required.
10+
</Step>
11+
<Step title="Node.js 18+">
12+
Required for the build toolchain and package installation.
13+
</Step>
14+
<Step title="LangGraph Platform">
15+
A running LangGraph agent accessible via HTTP. Can be local (langgraph dev) or deployed (LangGraph Cloud).
16+
</Step>
17+
</Steps>
18+
19+
## Install the package
20+
21+
```bash
22+
npm install @cacheplane/stream-resource
23+
```
24+
25+
This installs the library and its peer dependencies including `@langchain/langgraph-sdk`.
26+
27+
## Configure the provider
28+
29+
Add `provideStreamResource()` to your application configuration. This sets global defaults for all streamResource instances.
30+
31+
```typescript
32+
// app.config.ts
33+
import { ApplicationConfig } from '@angular/core';
34+
import { provideStreamResource } from '@cacheplane/stream-resource';
35+
36+
export const appConfig: ApplicationConfig = {
37+
providers: [
38+
provideStreamResource({
39+
apiUrl: process.env['LANGGRAPH_URL'] ?? 'http://localhost:2024',
40+
}),
41+
],
42+
};
43+
```
44+
45+
<Callout type="tip" title="Per-call overrides">
46+
Any option passed to `streamResource()` directly overrides the global provider config. You can set a default `apiUrl` globally and override it for specific agents.
47+
</Callout>
48+
49+
## Environment setup
50+
51+
<Tabs items={['Development', 'Production']}>
52+
<Tab>
53+
54+
For local development, run a LangGraph server:
55+
56+
```bash
57+
# Start LangGraph dev server
58+
langgraph dev
59+
60+
# Your agent will be available at http://localhost:2024
61+
```
62+
63+
</Tab>
64+
<Tab>
65+
66+
For production, point to your LangGraph Cloud deployment:
67+
68+
```typescript
69+
provideStreamResource({
70+
apiUrl: 'https://your-project.langgraph.app',
71+
})
72+
```
73+
74+
</Tab>
75+
</Tabs>
76+
77+
## Verify installation
78+
79+
Create a minimal test to verify the setup works:
80+
81+
```typescript
82+
import { streamResource } from '@cacheplane/stream-resource';
83+
84+
// In a component
85+
const test = streamResource({
86+
assistantId: 'chat_agent',
87+
});
88+
89+
// If status() returns 'idle', the setup is correct
90+
console.log(test.status()); // 'idle'
91+
```
92+
93+
## Next steps
94+
95+
<CardGroup cols={2}>
96+
<Card title="Quick Start" href="/docs/getting-started/quickstart">
97+
Build your first chat component in 5 minutes
98+
</Card>
99+
<Card title="Angular Signals" href="/docs/concepts/angular-signals">
100+
Understand how Signals power streamResource
101+
</Card>
102+
</CardGroup>

0 commit comments

Comments
 (0)