diff --git a/apps/website/content/docs/ag-ui/api/api-docs.json b/apps/website/content/docs/ag-ui/api/api-docs.json new file mode 100644 index 000000000..2e17267c0 --- /dev/null +++ b/apps/website/content/docs/ag-ui/api/api-docs.json @@ -0,0 +1,488 @@ +[ + { + "name": "FakeAgent", + "kind": "class", + "description": "In-process AG-UI agent that emits a canned streaming response.\n\nUse for offline demos and tests where a real backend isn't available.\nEchoes a fixed assistant reply token-by-token with realistic timing.\n\nNOT for production use.", + "params": [ + { + "name": "opts", + "type": "object", + "description": "", + "optional": false + } + ], + "examples": [], + "properties": [ + { + "name": "agentId", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "description", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "isRunning", + "type": "boolean", + "description": "", + "optional": false + }, + { + "name": "messages", + "type": "object | object | object | object | object | object | object[]", + "description": "", + "optional": false + }, + { + "name": "state", + "type": "any", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + }, + { + "name": "threadId", + "type": "string", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "abortRun", + "signature": "abortRun()", + "description": "", + "params": [] + }, + { + "name": "addMessage", + "signature": "addMessage(message: object | object | object | object | object | object | object)", + "description": "", + "params": [ + { + "name": "message", + "type": "object | object | object | object | object | object | object", + "description": "", + "optional": false + } + ] + }, + { + "name": "addMessages", + "signature": "addMessages(messages: object | object | object | object | object | object | object[])", + "description": "", + "params": [ + { + "name": "messages", + "type": "object | object | object | object | object | object | object[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "apply", + "signature": "apply(input: object, events$: Observable>, subscribers: AgentSubscriber[])", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable>", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "clone", + "signature": "clone()", + "description": "", + "params": [] + }, + { + "name": "connect", + "signature": "connect(input: object)", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + } + ] + }, + { + "name": "connectAgent", + "signature": "connectAgent(parameters: Partial>, subscriber: AgentSubscriber)", + "description": "", + "params": [ + { + "name": "parameters", + "type": "Partial>", + "description": "", + "optional": true + }, + { + "name": "subscriber", + "type": "AgentSubscriber", + "description": "", + "optional": true + } + ] + }, + { + "name": "detachActiveRun", + "signature": "detachActiveRun()", + "description": "", + "params": [] + }, + { + "name": "getCapabilities", + "signature": "getCapabilities()", + "description": "Returns the agent's current capabilities.\nOptional — subclasses implement this to advertise what they support.", + "params": [] + }, + { + "name": "legacy_to_be_removed_runAgentBridged", + "signature": "legacy_to_be_removed_runAgentBridged(config: Partial>)", + "description": "", + "params": [ + { + "name": "config", + "type": "Partial>", + "description": "", + "optional": true + } + ] + }, + { + "name": "onError", + "signature": "onError(input: object, error: Error, subscribers: AgentSubscriber[])", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "error", + "type": "Error", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "onFinalize", + "signature": "onFinalize(input: object, subscribers: AgentSubscriber[])", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "onInitialize", + "signature": "onInitialize(input: object, subscribers: AgentSubscriber[])", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "prepareRunAgentInput", + "signature": "prepareRunAgentInput(parameters: Partial>)", + "description": "", + "params": [ + { + "name": "parameters", + "type": "Partial>", + "description": "", + "optional": true + } + ] + }, + { + "name": "processApplyEvents", + "signature": "processApplyEvents(input: object, events$: Observable, subscribers: AgentSubscriber[])", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "subscribers", + "type": "AgentSubscriber[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "run", + "signature": "run(input: object)", + "description": "", + "params": [ + { + "name": "input", + "type": "object", + "description": "", + "optional": false + } + ] + }, + { + "name": "runAgent", + "signature": "runAgent(parameters: Partial>, subscriber: AgentSubscriber)", + "description": "", + "params": [ + { + "name": "parameters", + "type": "Partial>", + "description": "", + "optional": true + }, + { + "name": "subscriber", + "type": "AgentSubscriber", + "description": "", + "optional": true + } + ] + }, + { + "name": "setMessages", + "signature": "setMessages(messages: object | object | object | object | object | object | object[])", + "description": "", + "params": [ + { + "name": "messages", + "type": "object | object | object | object | object | object | object[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "setState", + "signature": "setState(state: any)", + "description": "", + "params": [ + { + "name": "state", + "type": "any", + "description": "", + "optional": false + } + ] + }, + { + "name": "subscribe", + "signature": "subscribe(subscriber: AgentSubscriber)", + "description": "", + "params": [ + { + "name": "subscriber", + "type": "AgentSubscriber", + "description": "", + "optional": false + } + ] + }, + { + "name": "use", + "signature": "use(middlewares: Middleware<> | MiddlewareFunction[])", + "description": "", + "params": [ + { + "name": "middlewares", + "type": "Middleware<> | MiddlewareFunction[]", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "AgUiAgentConfig", + "kind": "interface", + "description": "Configuration for the AG-UI agent provider.\nHttpAgentConfig shape (from @ag-ui/client@0.0.52):\n - url: string (required) — endpoint for the HTTP agent\n - agentId: string (optional) — agent identifier\n - threadId: string (optional) — thread identifier\n - headers: Record (optional) — custom HTTP headers", + "properties": [ + { + "name": "agentId", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "headers", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "threadId", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "url", + "type": "string", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "FakeAgUiAgentConfig", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "delayMs", + "type": "number", + "description": "Milliseconds between successive token emissions.", + "optional": true + }, + { + "name": "tokens", + "type": "string[]", + "description": "Tokens streamed back as the assistant reply.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "injectAgUiAgent", + "kind": "function", + "description": "Injects the AG_UI_AGENT from Angular's dependency injection container.\nUse this in components or services that have been provided via provideAgUiAgent().", + "signature": "injectAgUiAgent(): Agent", + "params": [], + "returns": { + "type": "Agent", + "description": "" + }, + "examples": [] + }, + { + "name": "provideAgUiAgent", + "kind": "function", + "description": "Provides an Agent instance wired through HttpAgent and toAgent.\nConstructs an HttpAgent from config and wraps it in the runtime-neutral\nAgent contract via toAgent(). Returns a provider array suitable for\nbootstrapApplication or TestBed.configureTestingModule().", + "signature": "provideAgUiAgent(config: AgUiAgentConfig): Provider[]", + "params": [ + { + "name": "config", + "type": "AgUiAgentConfig", + "description": "", + "optional": false + } + ], + "returns": { + "type": "Provider[]", + "description": "" + }, + "examples": [] + }, + { + "name": "provideFakeAgUiAgent", + "kind": "function", + "description": "Registers an in-process FakeAgent under AG_UI_AGENT.\n\nUse for offline demos and development. Drop-in replacement for\nprovideAgUiAgent({ url }) when no real backend is available.", + "signature": "provideFakeAgUiAgent(config: FakeAgUiAgentConfig): Provider[]", + "params": [ + { + "name": "config", + "type": "FakeAgUiAgentConfig", + "description": "", + "optional": false + } + ], + "returns": { + "type": "Provider[]", + "description": "" + }, + "examples": [] + }, + { + "name": "toAgent", + "kind": "function", + "description": "Wraps an AG-UI AbstractAgent into the runtime-neutral Agent contract.\n\nThe adapter subscribes to source.subscribe({ onEvent }) and reduces every\nevent into the produced Agent's signals. submit() optimistically appends the\nuser message to both our signals and the source agent's internal message\nlist, then calls source.runAgent(). stop() calls source.abortRun().\n\nSubscription cleanup: the returned Agent does NOT manage its own lifetime.\nCallers using DI should rely on the provider's destroy hook; direct callers\nof toAgent() should treat the returned object's lifecycle as tied to the\nagent instance they constructed. The subscriber registered via\nsource.subscribe() will fire for the lifetime of source.", + "signature": "toAgent(source: AbstractAgent<>): Agent", + "params": [ + { + "name": "source", + "type": "AbstractAgent<>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "Agent", + "description": "" + }, + "examples": [] + } +] \ No newline at end of file diff --git a/apps/website/content/docs/agent/api/api-docs.json b/apps/website/content/docs/agent/api/api-docs.json index 0637a088a..b60e0c8d3 100644 --- a/apps/website/content/docs/agent/api/api-docs.json +++ b/apps/website/content/docs/agent/api/api-docs.json @@ -1 +1,1035 @@ -[] \ No newline at end of file +[ + { + "name": "FetchStreamTransport", + "kind": "class", + "description": "Production transport that connects to a LangGraph Platform API via HTTP and SSE.\n\nCreates threads automatically if no threadId is provided, and streams events\nusing the LangGraph SDK client.", + "params": [ + { + "name": "apiUrl", + "type": "string", + "description": "Base URL of the LangGraph Platform API", + "optional": false + }, + { + "name": "onThreadId", + "type": "object", + "description": "Optional callback invoked when a new thread is created", + "optional": true + } + ], + "examples": [ + "```typescript\nconst transport = new FetchStreamTransport(\n 'http://localhost:2024',\n (id) => console.log('New thread:', id),\n);\n```" + ], + "properties": [], + "methods": [ + { + "name": "joinStream", + "signature": "joinStream(threadId: string, runId: string, lastEventId: string | undefined, signal: AbortSignal)", + "description": "Join an already-started run without creating a new thread.", + "params": [ + { + "name": "threadId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "runId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "lastEventId", + "type": "string | undefined", + "description": "", + "optional": false + }, + { + "name": "signal", + "type": "AbortSignal", + "description": "", + "optional": false + } + ] + }, + { + "name": "stream", + "signature": "stream(assistantId: string, threadId: string | null, payload: unknown, signal: AbortSignal)", + "description": "Open a streaming connection, creating a thread if needed.", + "params": [ + { + "name": "assistantId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "threadId", + "type": "string | null", + "description": "", + "optional": false + }, + { + "name": "payload", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "signal", + "type": "AbortSignal", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "MockAgentTransport", + "kind": "class", + "description": "Test transport for deterministic agent testing without a real LangGraph server.\n\nScript event batches upfront, then emit them manually or step through them\nin your test specs. Supports error injection and close control.", + "params": [ + { + "name": "script", + "type": "StreamEvent[][]", + "description": "Array of event batches. Each batch is emitted as a group.", + "optional": false + } + ], + "examples": [ + "```typescript\nconst transport = new MockAgentTransport([\n [{ type: 'values', data: { messages: [aiMsg('Hello')] } }],\n [{ type: 'values', data: { status: 'done' } }],\n]);\n```" + ], + "properties": [], + "methods": [ + { + "name": "close", + "signature": "close()", + "description": "Close the stream. Remaining queued events are drained before completion.", + "params": [] + }, + { + "name": "emit", + "signature": "emit(events: StreamEvent[])", + "description": "Manually emit events into the stream.", + "params": [ + { + "name": "events", + "type": "StreamEvent[]", + "description": "", + "optional": false + } + ] + }, + { + "name": "emitError", + "signature": "emitError(err: Error)", + "description": "Inject an error into the stream.", + "params": [ + { + "name": "err", + "type": "Error", + "description": "", + "optional": false + } + ] + }, + { + "name": "isStreaming", + "signature": "isStreaming()", + "description": "Returns true if a stream is currently active.", + "params": [] + }, + { + "name": "nextBatch", + "signature": "nextBatch()", + "description": "Advance to the next scripted batch and return its events.", + "params": [] + }, + { + "name": "stream", + "signature": "stream(_assistantId: string, _threadId: string | null, _payload: unknown, signal: AbortSignal)", + "description": "Open a streaming connection to an agent and yield events.", + "params": [ + { + "name": "_assistantId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "_threadId", + "type": "string | null", + "description": "", + "optional": false + }, + { + "name": "_payload", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "signal", + "type": "AbortSignal", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "AgentConfig", + "kind": "interface", + "description": "Global configuration for agent instances.\nProperties set here serve as defaults that can be overridden per-call.", + "properties": [ + { + "name": "__licenseEnvHint", + "type": "object", + "description": "Test-only env hint override. Not part of the stable API.", + "optional": true + }, + { + "name": "__licensePublicKey", + "type": "Uint8Array", + "description": "Test-only public-key override. Defaults to the compile-time embedded\n`LICENSE_PUBLIC_KEY`. Not part of the stable API.", + "optional": true + }, + { + "name": "apiUrl", + "type": "string", + "description": "Base URL of the LangGraph Platform API (e.g., `'http://localhost:2024'`).", + "optional": true + }, + { + "name": "license", + "type": "string", + "description": "Signed license token from cacheplane.dev. Optional; omitted in dev.", + "optional": true + }, + { + "name": "transport", + "type": "AgentTransport", + "description": "Custom transport implementation. Defaults to FetchStreamTransport.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "AgentOptions", + "kind": "interface", + "description": "Options for creating a streaming resource via agent.", + "properties": [ + { + "name": "apiUrl", + "type": "string", + "description": "Base URL of the LangGraph Platform API.", + "optional": false + }, + { + "name": "assistantId", + "type": "string", + "description": "Agent or graph identifier on the LangGraph platform.", + "optional": false + }, + { + "name": "filterSubagentMessages", + "type": "boolean", + "description": "When true, subagent messages are filtered from the main messages signal.", + "optional": true + }, + { + "name": "initialValues", + "type": "Partial", + "description": "Initial state values before the first stream response arrives.", + "optional": true + }, + { + "name": "messagesKey", + "type": "string", + "description": "Key in the state object that contains the messages array. Defaults to `'messages'`.", + "optional": true + }, + { + "name": "onThreadId", + "type": "object", + "description": "Called when a new thread is auto-created by the transport.", + "optional": true + }, + { + "name": "subagentToolNames", + "type": "string[]", + "description": "Tool names that indicate a subagent invocation.", + "optional": true + }, + { + "name": "threadId", + "type": "string | Signal | null", + "description": "Thread ID to connect to. Pass a Signal for reactive thread switching.", + "optional": true + }, + { + "name": "throttle", + "type": "number | false", + "description": "Throttle signal updates in milliseconds. `false` to disable.", + "optional": true + }, + { + "name": "toMessage", + "type": "object", + "description": "Custom message deserializer for non-standard message formats.", + "optional": true + }, + { + "name": "transport", + "type": "AgentTransport", + "description": "Custom transport. Defaults to FetchStreamTransport.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "AgentTransport", + "kind": "interface", + "description": "Transport interface for connecting to a LangGraph agent.", + "properties": [ + { + "name": "joinStream", + "type": "unknown", + "description": "", + "optional": true + }, + { + "name": "stream", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "CustomStreamEvent", + "kind": "interface", + "description": "A custom event emitted by the LangGraph backend via adispatch_custom_event().", + "properties": [ + { + "name": "data", + "type": "unknown", + "description": "Arbitrary payload from the backend.", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "Event name set by the backend (e.g., 'state_update').", + "optional": false + } + ], + "examples": [] + }, + { + "name": "Interrupt", + "kind": "interface", + "description": "An interrupt thrown inside a thread.", + "properties": [ + { + "name": "id", + "type": "string", + "description": "The ID of the interrupt.", + "optional": true + }, + { + "name": "ns", + "type": "string[]", + "description": "The namespace of the interrupt.", + "optional": true + }, + { + "name": "resumable", + "type": "boolean", + "description": "Whether the interrupt can be resumed.", + "optional": true + }, + { + "name": "value", + "type": "TValue", + "description": "The value of the interrupt.", + "optional": true + }, + { + "name": "when", + "type": "string & {} | \"during\"", + "description": "Will be deprecated in the future.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "LangGraphAgent", + "kind": "interface", + "description": "Unified LangGraph agent surface returned by `agent({...})`.\n\nExtends the runtime-neutral `AgentWithHistory` contract (chat-consumable)\nwith the full LangGraph-specific API. One object drives both `` and\nany LangGraph-specific demo. Raw LangGraph signals are prefixed with\n`langGraph` to avoid collision with the runtime-neutral names.", + "properties": [ + { + "name": "activeSubagents", + "type": "Signal", + "description": "Filtered list of subagents with status 'running'.", + "optional": false + }, + { + "name": "branch", + "type": "Signal", + "description": "Current branch identifier for time-travel navigation.", + "optional": false + }, + { + "name": "customEvents", + "type": "Signal", + "description": "Raw custom events stream (signal of array). The runtime-neutral\n `events$` Observable is derived from this.", + "optional": false + }, + { + "name": "error", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "getMessagesMetadata", + "type": "object", + "description": "Get metadata for a specific message by index.", + "optional": false + }, + { + "name": "getToolCalls", + "type": "object", + "description": "Get tool call results associated with an AI message (LangGraph types).", + "optional": false + }, + { + "name": "hasValue", + "type": "Signal", + "description": "True once at least one value or message has been received.", + "optional": false + }, + { + "name": "history", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "Signal", + "description": "", + "optional": true + }, + { + "name": "isLoading", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "isThreadLoading", + "type": "Signal", + "description": "True while a thread switch is loading state from the server.", + "optional": false + }, + { + "name": "joinStream", + "type": "object", + "description": "Join an already-running stream by run ID.", + "optional": false + }, + { + "name": "langGraphHistory", + "type": "Signal[]>", + "description": "Raw LangGraph history (ThreadState[]). Use `history` for AgentCheckpoint[].", + "optional": false + }, + { + "name": "langGraphInterrupts", + "type": "Signal[]>", + "description": "All interrupts received during the current run (raw LangGraph shape).", + "optional": false + }, + { + "name": "langGraphMessages", + "type": "Signal, MessageType>[]>", + "description": "Raw LangChain BaseMessage list. Use `messages` for chat rendering.", + "optional": false + }, + { + "name": "langGraphToolCalls", + "type": "Signal[]>", + "description": "Raw LangGraph tool calls (with run-state). Use `toolCalls` for chat rendering.", + "optional": false + }, + { + "name": "messages", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "reload", + "type": "object", + "description": "Re-submit the last input to restart the stream.", + "optional": false + }, + { + "name": "setBranch", + "type": "object", + "description": "Set the active branch for time-travel navigation.", + "optional": false + }, + { + "name": "state", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "stop", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subagents", + "type": "Signal>", + "description": "", + "optional": true + }, + { + "name": "submit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "switchThread", + "type": "object", + "description": "Switch to a different thread, resetting derived state.", + "optional": false + }, + { + "name": "toolCalls", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "toolProgress", + "type": "Signal", + "description": "Progress updates for currently executing tools.", + "optional": false + }, + { + "name": "value", + "type": "Signal", + "description": "Current agent state values (raw, typed per the type parameter T).", + "optional": false + } + ], + "examples": [] + }, + { + "name": "MockLangGraphAgent", + "kind": "interface", + "description": "A LangGraphAgent mock with writable signals for easy test control.\n\nCast the result of `mockLangGraphAgent()` to this type to access\nwritable signals without unsafe casts in test files.", + "properties": [ + { + "name": "activeSubagents", + "type": "WritableSignal", + "description": "Filtered list of subagents with status 'running'.", + "optional": false + }, + { + "name": "branch", + "type": "WritableSignal", + "description": "Current branch identifier for time-travel navigation.", + "optional": false + }, + { + "name": "customEvents", + "type": "WritableSignal", + "description": "Raw custom events stream (signal of array). The runtime-neutral\n `events$` Observable is derived from this.", + "optional": false + }, + { + "name": "error", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "getMessagesMetadata", + "type": "object", + "description": "Get metadata for a specific message by index.", + "optional": false + }, + { + "name": "getToolCalls", + "type": "object", + "description": "Get tool call results associated with an AI message (LangGraph types).", + "optional": false + }, + { + "name": "hasValue", + "type": "WritableSignal", + "description": "True once at least one value or message has been received.", + "optional": false + }, + { + "name": "history", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "isLoading", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "isThreadLoading", + "type": "WritableSignal", + "description": "True while a thread switch is loading state from the server.", + "optional": false + }, + { + "name": "joinStream", + "type": "object", + "description": "Join an already-running stream by run ID.", + "optional": false + }, + { + "name": "langGraphHistory", + "type": "WritableSignal[]>", + "description": "Raw LangGraph history (ThreadState[]). Use `history` for AgentCheckpoint[].", + "optional": false + }, + { + "name": "langGraphInterrupts", + "type": "WritableSignal[]>", + "description": "All interrupts received during the current run (raw LangGraph shape).", + "optional": false + }, + { + "name": "langGraphMessages", + "type": "WritableSignal, MessageType>[]>", + "description": "Raw LangChain BaseMessage list. Use `messages` for chat rendering.", + "optional": false + }, + { + "name": "langGraphToolCalls", + "type": "WritableSignal[]>", + "description": "Raw LangGraph tool calls (with run-state). Use `toolCalls` for chat rendering.", + "optional": false + }, + { + "name": "messages", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "reload", + "type": "object", + "description": "Re-submit the last input to restart the stream.", + "optional": false + }, + { + "name": "setBranch", + "type": "object", + "description": "Set the active branch for time-travel navigation.", + "optional": false + }, + { + "name": "state", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "stop", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subagents", + "type": "WritableSignal>", + "description": "", + "optional": false + }, + { + "name": "submit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "switchThread", + "type": "object", + "description": "Switch to a different thread, resetting derived state.", + "optional": false + }, + { + "name": "toolCalls", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "toolProgress", + "type": "WritableSignal", + "description": "Progress updates for currently executing tools.", + "optional": false + }, + { + "name": "value", + "type": "WritableSignal", + "description": "Current agent state values (raw, typed per the type parameter T).", + "optional": false + } + ], + "examples": [] + }, + { + "name": "StreamEvent", + "kind": "interface", + "description": "An event emitted by a LangGraph stream.", + "properties": [ + { + "name": "type", + "type": "\"error\" | \"values\" | \"messages\" | `messages/${string}` | \"updates\" | \"tools\" | \"custom\" | \"metadata\" | \"checkpoints\" | \"tasks\" | \"debug\" | \"events\" | \"interrupt\" | \"interrupts\"", + "description": "Event type identifier (e.g., 'values', 'messages', 'error', 'interrupt').", + "optional": false + } + ], + "examples": [] + }, + { + "name": "SubagentStreamRef", + "kind": "interface", + "description": "Reference to a subagent's streaming state.", + "properties": [ + { + "name": "messages", + "type": "Signal, MessageType>[]>", + "description": "Messages from the subagent conversation.", + "optional": false + }, + { + "name": "status", + "type": "Signal<\"running\" | \"error\" | \"pending\" | \"complete\">", + "description": "Current execution status of the subagent.", + "optional": false + }, + { + "name": "toolCallId", + "type": "string", + "description": "The tool call ID that spawned this subagent.", + "optional": false + }, + { + "name": "values", + "type": "Signal>", + "description": "Current state values from the subagent.", + "optional": false + } + ], + "examples": [] + }, + { + "name": "SubmitOptions", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "checkpoint", + "type": "Omit | null", + "description": "", + "optional": true + }, + { + "name": "command", + "type": "Command", + "description": "", + "optional": true + }, + { + "name": "config", + "type": "ConfigWithConfigurable", + "description": "", + "optional": true + }, + { + "name": "context", + "type": "ContextType", + "description": "", + "optional": true + }, + { + "name": "durability", + "type": "Durability", + "description": "Whether to checkpoint during the run (or only at the end/interruption).\n- `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n- `\"sync\"`: Save checkpoint synchronously before the next step starts.\n- `\"exit\"`: Save checkpoint only when the graph exits.", + "optional": true + }, + { + "name": "feedbackKeys", + "type": "string[]", + "description": "", + "optional": true + }, + { + "name": "interruptAfter", + "type": "string[] | \"*\"", + "description": "", + "optional": true + }, + { + "name": "interruptBefore", + "type": "string[] | \"*\"", + "description": "", + "optional": true + }, + { + "name": "metadata", + "type": "Metadata", + "description": "", + "optional": true + }, + { + "name": "multitaskStrategy", + "type": "MultitaskStrategy", + "description": "", + "optional": true + }, + { + "name": "onCompletion", + "type": "OnCompletionBehavior", + "description": "", + "optional": true + }, + { + "name": "onDisconnect", + "type": "DisconnectMode", + "description": "", + "optional": true + }, + { + "name": "onError", + "type": "object", + "description": "Callback that is called when an error occurs during this specific submit call.\nUnlike the hook-level `onError`, this allows handling errors on a per-submit basis,\ne.g. to show a retry button or a specific error message to the user.", + "optional": true + }, + { + "name": "optimisticValues", + "type": "Partial | object", + "description": "", + "optional": true + }, + { + "name": "runId", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "streamMode", + "type": "StreamMode[]", + "description": "", + "optional": true + }, + { + "name": "streamResumable", + "type": "boolean", + "description": "Mark the stream as resumable. All events emitted during the run will be temporarily persisted\nin order to be re-emitted if the stream is re-joined.", + "optional": true + }, + { + "name": "streamSubgraphs", + "type": "boolean", + "description": "Whether or not to stream the nodes of any subgraphs called\nby the assistant.", + "optional": true + }, + { + "name": "threadId", + "type": "string", + "description": "The ID to use when creating a new thread. When provided, this ID will be used\nfor thread creation when threadId is `null` or `undefined`.\nThis enables optimistic UI updates where you know the thread ID\nbefore the thread is actually created.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "ThreadState", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "checkpoint", + "type": "Checkpoint", + "description": "Checkpoint of the thread state", + "optional": false + }, + { + "name": "created_at", + "type": "Optional", + "description": "Time of state creation", + "optional": false + }, + { + "name": "metadata", + "type": "Metadata", + "description": "Metadata for this state", + "optional": false + }, + { + "name": "next", + "type": "string[]", + "description": "The next nodes to execute. If empty, the thread is done until new input is received", + "optional": false + }, + { + "name": "parent_checkpoint", + "type": "Optional", + "description": "The parent checkpoint. If missing, this is the root checkpoint", + "optional": false + }, + { + "name": "tasks", + "type": "ThreadTask[]", + "description": "Tasks to execute in this step. If already attempted, may contain an error", + "optional": false + }, + { + "name": "values", + "type": "ValuesType", + "description": "The state values", + "optional": false + } + ], + "examples": [] + }, + { + "name": "BagTemplate", + "kind": "type", + "description": "Template for the bag type.", + "signature": "unknown", + "examples": [] + }, + { + "name": "InferBag", + "kind": "type", + "description": "Infer the Bag type from an agent, defaulting to the provided Bag.\n\nCurrently returns the provided Bag for all types.\nCan be extended in the future to extract Bag from agent types.", + "signature": "T extends { ~agentTypes: unknown } ? BagTemplate : B", + "examples": [] + }, + { + "name": "ResourceStatus", + "kind": "type", + "description": "Runtime constant mirroring Angular's ResourceStatus string-union type.\nAngular 21 ships ResourceStatus as a pure string-union type (no runtime value),\nso we provide a const-object shim for code that needs runtime comparisons.", + "signature": "NgResourceStatus", + "examples": [] + }, + { + "name": "agent", + "kind": "function", + "description": "Creates a streaming resource connected to a LangGraph agent.\n\nMust be called within an Angular injection context (component constructor,\nfield initializer, or `runInInjectionContext`). Returns a unified\nLangGraphAgent whose properties are Angular Signals that update\nin real-time as the agent streams.", + "signature": "agent(options: AgentOptions>): LangGraphAgent>", + "params": [ + { + "name": "options", + "type": "AgentOptions>", + "description": "Configuration for the streaming resource", + "optional": false + } + ], + "returns": { + "type": "LangGraphAgent>", + "description": "" + }, + "examples": [ + "```typescript\n// In a component field initializer\nconst chat = agent<{ messages: BaseMessage[] }>({\n assistantId: 'chat_agent',\n apiUrl: 'http://localhost:2024',\n threadId: signal(this.savedThreadId),\n onThreadId: (id) => localStorage.setItem('threadId', id),\n});\n\n// Access signals in template\n// chat.messages(), chat.status(), chat.error()\n```" + ] + }, + { + "name": "mockLangGraphAgent", + "kind": "function", + "description": "Creates a mock LangGraphAgent with writable signals for testing.\nControl state by writing to the returned writable signals directly.", + "signature": "mockLangGraphAgent(initial: object): MockLangGraphAgent<>", + "params": [ + { + "name": "initial", + "type": "object", + "description": "", + "optional": false + } + ], + "returns": { + "type": "MockLangGraphAgent<>", + "description": "" + }, + "examples": [] + }, + { + "name": "provideAgent", + "kind": "function", + "description": "Angular provider factory that registers global defaults for all\nagent instances in the application.", + "signature": "provideAgent(config: AgentConfig): Provider", + "params": [ + { + "name": "config", + "type": "AgentConfig", + "description": "", + "optional": false + } + ], + "returns": { + "type": "Provider", + "description": "" + }, + "examples": [] + } +] \ No newline at end of file diff --git a/apps/website/content/docs/chat/api/api-docs.json b/apps/website/content/docs/chat/api/api-docs.json new file mode 100644 index 000000000..767973347 --- /dev/null +++ b/apps/website/content/docs/chat/api/api-docs.json @@ -0,0 +1,3388 @@ +[ + { + "name": "A2uiAudioPlayerComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "autoplay", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "controls", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "url", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiButtonComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "disabled", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "variant", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "handleClick", + "signature": "handleClick()", + "description": "", + "params": [] + } + ] + }, + { + "name": "A2uiCardComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "title", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiCheckBoxComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "checked", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onChange", + "signature": "onChange(event: Event)", + "description": "", + "params": [ + { + "name": "event", + "type": "Event", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiChoicePickerComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "_inputId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "options", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "selected", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onChange", + "signature": "onChange(event: Event)", + "description": "", + "params": [ + { + "name": "event", + "type": "Event", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiColumnComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiDateTimeInputComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "_inputId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "inputType", + "type": "InputSignal<\"date\" | \"time\" | \"datetime-local\">", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "max", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "min", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "value", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onChange", + "signature": "onChange(event: Event)", + "description": "", + "params": [ + { + "name": "event", + "type": "Event", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiDividerComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [], + "methods": [] + }, + { + "name": "A2uiIconComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "name", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiImageComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "alt", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "url", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiListComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiModalComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "dismissible", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "open", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "title", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onBackdropClick", + "signature": "onBackdropClick()", + "description": "", + "params": [] + } + ] + }, + { + "name": "A2uiRowComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiSliderComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "_inputId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "max", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "min", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "step", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "value", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onInput", + "signature": "onInput(event: Event)", + "description": "", + "params": [ + { + "name": "event", + "type": "Event", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiSurfaceComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "action", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "catalog", + "type": "InputSignal>>>", + "description": "", + "optional": false + }, + { + "name": "events", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "handlers", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "internalHandlers", + "type": "Signal", + "description": "Merge built-in A2UI handlers with consumer-provided handlers.", + "optional": false + }, + { + "name": "registry", + "type": "Signal", + "description": "Convert ViewRegistry to AngularRegistry for RenderSpecComponent.", + "optional": false + }, + { + "name": "spec", + "type": "Signal", + "description": "Convert the A2UI surface to a json-render Spec for rendering.", + "optional": false + }, + { + "name": "surface", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onRenderEvent", + "signature": "onRenderEvent(event: RenderEvent)", + "description": "", + "params": [ + { + "name": "event", + "type": "RenderEvent", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiTabsComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "activeChildKeys", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "activeIndex", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "childKeys", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "selected", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "tabs", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "selectTab", + "signature": "selectTab(index: number)", + "description": "", + "params": [ + { + "name": "index", + "type": "number", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiTextComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "text", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiTextFieldComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "_bindings", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "_inputId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "emit", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "label", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "placeholder", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "validationResult", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "value", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onInput", + "signature": "onInput(event: Event)", + "description": "", + "params": [ + { + "name": "event", + "type": "Event", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "A2uiValidationErrorsComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "result", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiVideoComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "autoplay", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "controls", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "poster", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "url", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "activeThreadId", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "handlers", + "type": "InputSignal>", + "description": "", + "optional": false + }, + { + "name": "messageContent", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "renderEvent", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "renderRegistry", + "type": "Signal", + "description": "Convert ViewRegistry → AngularRegistry for ChatGenerativeUiComponent.", + "optional": false + }, + { + "name": "resolvedStore", + "type": "Signal", + "description": "Resolved store: use the explicitly provided store input, or fall back to\nan internal store when `views` are provided (generative-ui use case).", + "optional": false + }, + { + "name": "sidebarOpen", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "store", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "threads", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "threadSelected", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "views", + "type": "InputSignal>> | undefined>", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "classifyMessage", + "signature": "classifyMessage(content: string, index: number)", + "description": "", + "params": [ + { + "name": "content", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "index", + "type": "number", + "description": "", + "optional": false + } + ] + }, + { + "name": "clearClassifiers", + "signature": "clearClassifiers()", + "description": "", + "params": [] + }, + { + "name": "onA2uiAction", + "signature": "onA2uiAction(message: A2uiActionMessage)", + "description": "", + "params": [ + { + "name": "message", + "type": "A2uiActionMessage", + "description": "", + "optional": false + } + ] + }, + { + "name": "onA2uiEvent", + "signature": "onA2uiEvent(event: RenderEvent, messageIndex: number, surfaceId: string)", + "description": "", + "params": [ + { + "name": "event", + "type": "RenderEvent", + "description": "", + "optional": false + }, + { + "name": "messageIndex", + "type": "number", + "description": "", + "optional": false + }, + { + "name": "surfaceId", + "type": "string", + "description": "", + "optional": false + } + ] + }, + { + "name": "onSpecEvent", + "signature": "onSpecEvent(event: RenderEvent, messageIndex: number)", + "description": "", + "params": [ + { + "name": "event", + "type": "RenderEvent", + "description": "", + "optional": false + }, + { + "name": "messageIndex", + "type": "number", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatDebugComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "checkpoints", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "debugOpen", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "messageContent", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "previousState", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "selectedCheckpointIndex", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "selectedState", + "type": "Signal>", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "jumpToEnd", + "signature": "jumpToEnd()", + "description": "", + "params": [] + }, + { + "name": "jumpToStart", + "signature": "jumpToStart()", + "description": "", + "params": [] + }, + { + "name": "renderMd", + "signature": "renderMd(content: string)", + "description": "", + "params": [ + { + "name": "content", + "type": "string", + "description": "", + "optional": false + } + ] + }, + { + "name": "stepBack", + "signature": "stepBack()", + "description": "", + "params": [] + }, + { + "name": "stepForward", + "signature": "stepForward()", + "description": "", + "params": [] + } + ] + }, + { + "name": "ChatErrorComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "errorMessage", + "type": "Signal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatInputComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "focused", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "isDisabled", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "messageText", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "placeholder", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "submitOnEnter", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "submitted", + "type": "OutputEmitterRef", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "onKeydown", + "signature": "onKeydown(event: KeyboardEvent)", + "description": "", + "params": [ + { + "name": "event", + "type": "KeyboardEvent", + "description": "", + "optional": false + } + ] + }, + { + "name": "onSubmit", + "signature": "onSubmit()", + "description": "", + "params": [] + } + ] + }, + { + "name": "ChatInterruptComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "Signal | undefined>", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatInterruptPanelComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "action", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "interruptPayload", + "type": "Signal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatMessagesComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "getMessageType", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "messages", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "messageTemplates", + "type": "Signal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "findTemplate", + "signature": "findTemplate(type: MessageTemplateType)", + "description": "", + "params": [ + { + "name": "type", + "type": "MessageTemplateType", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatSubagentCardComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "expanded", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "latestMessageContent", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "statusColor", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "subagent", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatSubagentsComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "activeSubagents", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "Signal | undefined>", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatThreadListComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "activeThreadId", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "Signal | undefined>", + "description": "", + "optional": false + }, + { + "name": "threads", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "threadSelected", + "type": "OutputEmitterRef", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "selectThread", + "signature": "selectThread(threadId: string)", + "description": "", + "params": [ + { + "name": "threadId", + "type": "string", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatTimelineComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "checkpointSelected", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "history", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "Signal | undefined>", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "selectCheckpoint", + "signature": "selectCheckpoint(cp: AgentCheckpoint)", + "description": "", + "params": [ + { + "name": "cp", + "type": "AgentCheckpoint", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatTimelineSliderComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "forkRequested", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "history", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "replayRequested", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "selectedIndex", + "type": "WritableSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "fork", + "signature": "fork(cp: AgentCheckpoint, index: number)", + "description": "", + "params": [ + { + "name": "cp", + "type": "AgentCheckpoint", + "description": "", + "optional": false + }, + { + "name": "index", + "type": "number", + "description": "", + "optional": false + } + ] + }, + { + "name": "replay", + "signature": "replay(cp: AgentCheckpoint)", + "description": "", + "params": [ + { + "name": "cp", + "type": "AgentCheckpoint", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatToolCallCardComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "expanded", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "toolCall", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "formatJson", + "signature": "formatJson(value: unknown)", + "description": "", + "params": [ + { + "name": "value", + "type": "unknown", + "description": "", + "optional": false + } + ] + } + ] + }, + { + "name": "ChatToolCallsComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "message", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "Signal | undefined>", + "description": "", + "optional": false + }, + { + "name": "toolCalls", + "type": "Signal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "ChatTypingIndicatorComponent", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "agent", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "visible", + "type": "Signal", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "MessageTemplateDirective", + "kind": "class", + "description": "", + "params": [], + "examples": [], + "properties": [ + { + "name": "chatMessageTemplate", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "templateRef", + "type": "TemplateRef", + "description": "", + "optional": false + } + ], + "methods": [] + }, + { + "name": "A2uiActionMessage", + "kind": "interface", + "description": "v0.9 outbound action message — sent when a component's event action fires.", + "properties": [ + { + "name": "action", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "metadata", + "type": "object", + "description": "", + "optional": true + }, + { + "name": "version", + "type": "\"v0.9\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiCheckRule", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "condition", + "type": "DynamicBoolean", + "description": "", + "optional": false + }, + { + "name": "message", + "type": "string", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiClientDataModel", + "kind": "interface", + "description": "v0.9 client data model envelope — attached when sendDataModel is true.", + "properties": [ + { + "name": "surfaces", + "type": "Record>", + "description": "", + "optional": false + }, + { + "name": "version", + "type": "\"v0.9\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiComponent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "action", + "type": "A2uiAction", + "description": "", + "optional": true + }, + { + "name": "checks", + "type": "A2uiCheckRule[]", + "description": "", + "optional": true + }, + { + "name": "children", + "type": "A2uiChildList", + "description": "", + "optional": true + }, + { + "name": "component", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "id", + "type": "string", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiFunctionCall", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "args", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "call", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "returnType", + "type": "string", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "A2uiPathRef", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "path", + "type": "string", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiSurface", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "catalogId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "components", + "type": "Map", + "description": "", + "optional": false + }, + { + "name": "dataModel", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "sendDataModel", + "type": "boolean", + "description": "", + "optional": true + }, + { + "name": "surfaceId", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "theme", + "type": "A2uiTheme", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "A2uiSurfaceStore", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "surfaces", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "apply", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "surface", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "A2uiTheme", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "agentDisplayName", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "iconUrl", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "primaryColor", + "type": "string", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "A2uiValidationResult", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "errors", + "type": "string[]", + "description": "", + "optional": false + }, + { + "name": "valid", + "type": "boolean", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "Agent", + "kind": "interface", + "description": "Runtime-neutral contract chat primitives consume.\n\nImplementations are produced by runtime adapters (e.g. a LangGraph or\nAG-UI adapter) or by user code for custom backends.\n\n`interrupt` and `subagents` are optional: runtimes that do not support these\nconcepts should leave them undefined, and primitives that need them check\npresence and render a neutral fallback when absent.\n\nInvariant: state lives on signals; `events$` carries only things that are\nnot derivable from signals.", + "properties": [ + { + "name": "error", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "Signal", + "description": "", + "optional": true + }, + { + "name": "isLoading", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "messages", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "state", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "stop", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subagents", + "type": "Signal>", + "description": "", + "optional": true + }, + { + "name": "submit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "toolCalls", + "type": "Signal", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AgentCheckpoint", + "kind": "interface", + "description": "Runtime-neutral snapshot of a point in an agent's execution history.\n\nConsumed by time-travel / debug UIs. `id` is adapter-opaque — UIs emit\nit back to the parent app on replay/fork, and the parent app dispatches\nto the underlying runtime.", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Adapter-opaque checkpoint identifier (e.g. LangGraph checkpoint_id).", + "optional": true + }, + { + "name": "label", + "type": "string", + "description": "Human-friendly label for the checkpoint (e.g. next node name).", + "optional": true + }, + { + "name": "values", + "type": "Record", + "description": "State snapshot at this checkpoint.", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AgentCustomEvent", + "kind": "interface", + "description": "Escape hatch for runtime-specific or user-defined events that do not\n(yet) have a well-known structured variant. `name` carries the runtime\nevent name; `data` carries the payload verbatim.", + "properties": [ + { + "name": "data", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "type", + "type": "\"custom\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AgentInterrupt", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "id", + "type": "string", + "description": "Stable identifier for this interrupt instance.", + "optional": false + }, + { + "name": "resumable", + "type": "boolean", + "description": "True when the runtime supports resuming via `submit({ resume })`.", + "optional": false + }, + { + "name": "value", + "type": "unknown", + "description": "Opaque payload the app renders. Runtime-specific shape.", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AgentStateUpdateEvent", + "kind": "interface", + "description": "Render-state-store sync event. Adapters emit this when the runtime\npublishes a state-snapshot intended for the chat library's render store\n(used by generative UI and a2ui surfaces).", + "properties": [ + { + "name": "data", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "type", + "type": "\"state_update\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AgentSubmitInput", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "message", + "type": "string | ContentBlock[]", + "description": "New user message to append. May be combined with `resume` and/or `state` in the same submit call.", + "optional": true + }, + { + "name": "resume", + "type": "unknown", + "description": "Resume payload for an active interrupt.", + "optional": true + }, + { + "name": "state", + "type": "Record", + "description": "State patch to merge before submitting (runtime-interpreted).", + "optional": true + } + ], + "examples": [] + }, + { + "name": "AgentSubmitOptions", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "signal", + "type": "AbortSignal", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "AgentWithHistory", + "kind": "interface", + "description": "Extends Agent with a required `history` signal.\n\nCompositions that need time-travel / checkpoint data (chat-timeline,\nchat-debug) take this richer contract. Adapters that cannot supply\nhistory should return plain Agent instead of stubbing an empty array.", + "properties": [ + { + "name": "error", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "history", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "interrupt", + "type": "Signal", + "description": "", + "optional": true + }, + { + "name": "isLoading", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "messages", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "state", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "stop", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "subagents", + "type": "Signal>", + "description": "", + "optional": true + }, + { + "name": "submit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "toolCalls", + "type": "Signal", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "ChatConfig", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "__licenseEnvHint", + "type": "object", + "description": "Test-only env hint override. Not part of the stable API.", + "optional": true + }, + { + "name": "__licensePublicKey", + "type": "Uint8Array", + "description": "Test-only public-key override. Defaults to the compile-time embedded\n`LICENSE_PUBLIC_KEY`. Not part of the stable API.", + "optional": true + }, + { + "name": "assistantName", + "type": "string", + "description": "Override the default assistant display name (default: \"Assistant\").", + "optional": true + }, + { + "name": "avatarLabel", + "type": "string", + "description": "Override the default AI avatar label (default: \"A\").", + "optional": true + }, + { + "name": "license", + "type": "string", + "description": "Signed license token from cacheplane.dev. Optional; omitted in dev.", + "optional": true + }, + { + "name": "renderRegistry", + "type": "AngularRegistry", + "description": "Default render registry for generative UI components.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "ChatRenderEvent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "event", + "type": "RenderEvent", + "description": "", + "optional": false + }, + { + "name": "messageIndex", + "type": "number", + "description": "", + "optional": false + }, + { + "name": "surfaceId", + "type": "string", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "ContentClassifier", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "a2uiSurfaces", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "elementStates", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "errors", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "markdown", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "streaming", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "type", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "dispose", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "update", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "ElementAccumulationState", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "hasChildren", + "type": "boolean", + "description": "", + "optional": false + }, + { + "name": "hasProps", + "type": "boolean", + "description": "", + "optional": false + }, + { + "name": "hasType", + "type": "boolean", + "description": "", + "optional": false + }, + { + "name": "streaming", + "type": "boolean", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "Message", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "content", + "type": "string | ContentBlock[]", + "description": "Plain text, or a list of structured content blocks.", + "optional": false + }, + { + "name": "extra", + "type": "Record", + "description": "Runtime-specific extras; do not rely on shape in portable code.", + "optional": true + }, + { + "name": "id", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "Optional display/author name.", + "optional": true + }, + { + "name": "role", + "type": "Role", + "description": "", + "optional": false + }, + { + "name": "toolCallId", + "type": "string", + "description": "Present when role === 'tool'.", + "optional": true + } + ], + "examples": [] + }, + { + "name": "MockAgent", + "kind": "interface", + "description": "Runtime-neutral contract chat primitives consume.\n\nImplementations are produced by runtime adapters (e.g. a LangGraph or\nAG-UI adapter) or by user code for custom backends.\n\n`interrupt` and `subagents` are optional: runtimes that do not support these\nconcepts should leave them undefined, and primitives that need them check\npresence and render a neutral fallback when absent.\n\nInvariant: state lives on signals; `events$` carries only things that are\nnot derivable from signals.", + "properties": [ + { + "name": "error", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": false + }, + { + "name": "history", + "type": "WritableSignal", + "description": "", + "optional": true + }, + { + "name": "interrupt", + "type": "WritableSignal", + "description": "", + "optional": true + }, + { + "name": "isLoading", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "messages", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "state", + "type": "WritableSignal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "WritableSignal", + "description": "", + "optional": false + }, + { + "name": "stop", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "stopCount", + "type": "number", + "description": "Count of stop() invocations.", + "optional": false + }, + { + "name": "subagents", + "type": "WritableSignal>", + "description": "", + "optional": true + }, + { + "name": "submit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "submitCalls", + "type": "object[]", + "description": "Captured calls to submit() in order.", + "optional": false + }, + { + "name": "toolCalls", + "type": "WritableSignal", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "MockAgentOptions", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "error", + "type": "unknown", + "description": "", + "optional": true + }, + { + "name": "events$", + "type": "Observable", + "description": "", + "optional": true + }, + { + "name": "history", + "type": "AgentCheckpoint[]", + "description": "", + "optional": true + }, + { + "name": "isLoading", + "type": "boolean", + "description": "", + "optional": true + }, + { + "name": "messages", + "type": "Message[]", + "description": "", + "optional": true + }, + { + "name": "state", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "status", + "type": "AgentStatus", + "description": "", + "optional": true + }, + { + "name": "toolCalls", + "type": "ToolCall[]", + "description": "", + "optional": true + }, + { + "name": "withInterrupt", + "type": "boolean", + "description": "", + "optional": true + }, + { + "name": "withSubagents", + "type": "boolean", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "ParseTreeStore", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "elementStates", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "push", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "Subagent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "messages", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "Optional human-readable name.", + "optional": true + }, + { + "name": "state", + "type": "Signal>", + "description": "", + "optional": false + }, + { + "name": "status", + "type": "Signal", + "description": "", + "optional": false + }, + { + "name": "toolCallId", + "type": "string", + "description": "Tool call ID that spawned this subagent.", + "optional": false + } + ], + "examples": [] + }, + { + "name": "ToolCall", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "args", + "type": "unknown", + "description": "Arguments. May be partial while streaming (`status !== 'complete'`).", + "optional": false + }, + { + "name": "error", + "type": "unknown", + "description": "Optional error payload when status === 'error'.", + "optional": true + }, + { + "name": "id", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "result", + "type": "unknown", + "description": "Present when status === 'complete' or 'error'.", + "optional": true + }, + { + "name": "status", + "type": "ToolCallStatus", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "ToolCallInfo", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "args", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "id", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "name", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "result", + "type": "unknown", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "AgentEvent", + "kind": "type", + "description": "Discriminated union of events flowing on `Agent.events$`.\n\nInvariant: state lives on signals (`messages`, `status`, `toolCalls`,\n`state`, `interrupt`, `subagents`, `history`); events on `events$`\ncarry only things that are not derivable from signals. New variants\nare added purely additively when patterns prove necessary.", + "signature": "AgentStateUpdateEvent | AgentCustomEvent", + "examples": [] + }, + { + "name": "AgentStatus", + "kind": "type", + "description": "", + "signature": "\"idle\" | \"running\" | \"error\"", + "examples": [] + }, + { + "name": "ContentBlock", + "kind": "type", + "description": "", + "signature": "object | object | object | object", + "examples": [] + }, + { + "name": "ContentType", + "kind": "type", + "description": "", + "signature": "\"undetermined\" | \"markdown\" | \"json-render\" | \"a2ui\" | \"mixed\"", + "examples": [] + }, + { + "name": "DynamicBoolean", + "kind": "type", + "description": "", + "signature": "DynamicValue", + "examples": [] + }, + { + "name": "DynamicNumber", + "kind": "type", + "description": "", + "signature": "DynamicValue", + "examples": [] + }, + { + "name": "DynamicString", + "kind": "type", + "description": "", + "signature": "DynamicValue", + "examples": [] + }, + { + "name": "DynamicValue", + "kind": "type", + "description": "A value that can be a literal, a path reference, or a function call.", + "signature": "T | A2uiPathRef | A2uiFunctionCall", + "examples": [] + }, + { + "name": "InterruptAction", + "kind": "type", + "description": "", + "signature": "\"accept\" | \"edit\" | \"respond\" | \"ignore\"", + "examples": [] + }, + { + "name": "MessageTemplateType", + "kind": "type", + "description": "", + "signature": "\"human\" | \"ai\" | \"tool\" | \"system\" | \"function\"", + "examples": [] + }, + { + "name": "Role", + "kind": "type", + "description": "", + "signature": "\"user\" | \"assistant\" | \"system\" | \"tool\"", + "examples": [] + }, + { + "name": "SubagentStatus", + "kind": "type", + "description": "", + "signature": "\"pending\" | \"running\" | \"complete\" | \"error\"", + "examples": [] + }, + { + "name": "Thread", + "kind": "type", + "description": "", + "signature": "unknown", + "examples": [] + }, + { + "name": "ToolCallStatus", + "kind": "type", + "description": "", + "signature": "\"pending\" | \"running\" | \"complete\" | \"error\"", + "examples": [] + }, + { + "name": "ViewRegistry", + "kind": "type", + "description": "A registry of view components available for generative UI rendering.\nPlain frozen object mapping view names to Angular component types.\nCompose via object spread: `views({ ...base, ...more })`.", + "signature": "Readonly>>", + "examples": [] + }, + { + "name": "a2uiBasicCatalog", + "kind": "function", + "description": "", + "signature": "a2uiBasicCatalog(): ViewRegistry", + "params": [], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "buildA2uiActionMessage", + "kind": "function", + "description": "Builds a v0.9 A2uiActionMessage from handler params and the current surface.", + "signature": "buildA2uiActionMessage(params: Record, surface: A2uiSurface): A2uiActionMessage", + "params": [ + { + "name": "params", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "surface", + "type": "A2uiSurface", + "description": "", + "optional": false + } + ], + "returns": { + "type": "A2uiActionMessage", + "description": "" + }, + "examples": [] + }, + { + "name": "createA2uiSurfaceStore", + "kind": "function", + "description": "", + "signature": "createA2uiSurfaceStore(): A2uiSurfaceStore", + "params": [], + "returns": { + "type": "A2uiSurfaceStore", + "description": "" + }, + "examples": [] + }, + { + "name": "createContentClassifier", + "kind": "function", + "description": "", + "signature": "createContentClassifier(): ContentClassifier", + "params": [], + "returns": { + "type": "ContentClassifier", + "description": "" + }, + "examples": [] + }, + { + "name": "createParseTreeStore", + "kind": "function", + "description": "", + "signature": "createParseTreeStore(parser: PartialJsonParser): ParseTreeStore", + "params": [ + { + "name": "parser", + "type": "PartialJsonParser", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ParseTreeStore", + "description": "" + }, + "examples": [] + }, + { + "name": "emitBinding", + "kind": "function", + "description": "Emits a data model binding event if the prop has a binding path.", + "signature": "emitBinding(emit: object, bindings: Record | undefined, prop: string, value: unknown): void", + "params": [ + { + "name": "emit", + "type": "object", + "description": "", + "optional": false + }, + { + "name": "bindings", + "type": "Record | undefined", + "description": "", + "optional": false + }, + { + "name": "prop", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "value", + "type": "unknown", + "description": "", + "optional": false + } + ], + "returns": { + "type": "void", + "description": "" + }, + "examples": [] + }, + { + "name": "extractErrorMessage", + "kind": "function", + "description": "", + "signature": "extractErrorMessage(error: unknown): string | null", + "params": [ + { + "name": "error", + "type": "unknown", + "description": "", + "optional": false + } + ], + "returns": { + "type": "string | null", + "description": "" + }, + "examples": [] + }, + { + "name": "getInterrupt", + "kind": "function", + "description": "Retrieves the current interrupt value from an Agent, or undefined when\nthe runtime does not expose interrupts.\nExported for unit testing without DOM rendering.", + "signature": "getInterrupt(agent: Agent): AgentInterrupt | undefined", + "params": [ + { + "name": "agent", + "type": "Agent", + "description": "", + "optional": false + } + ], + "returns": { + "type": "AgentInterrupt | undefined", + "description": "" + }, + "examples": [] + }, + { + "name": "getMessageType", + "kind": "function", + "description": "Maps a Message to a MessageTemplateType.\nExported as a standalone function so it can be unit-tested without DOM rendering.", + "signature": "getMessageType(message: Message): MessageTemplateType", + "params": [ + { + "name": "message", + "type": "Message", + "description": "", + "optional": false + } + ], + "returns": { + "type": "MessageTemplateType", + "description": "" + }, + "examples": [] + }, + { + "name": "isAssistantMessage", + "kind": "function", + "description": "", + "signature": "isAssistantMessage(m: Message): m is Message & { role: \"assistant\" }", + "params": [ + { + "name": "m", + "type": "Message", + "description": "", + "optional": false + } + ], + "returns": { + "type": "m is Message & { role: \"assistant\" }", + "description": "" + }, + "examples": [] + }, + { + "name": "isFunctionCall", + "kind": "function", + "description": "Narrows an unknown value to A2uiFunctionCall — has `call` and `args`.", + "signature": "isFunctionCall(value: unknown): value is A2uiFunctionCall", + "params": [ + { + "name": "value", + "type": "unknown", + "description": "", + "optional": false + } + ], + "returns": { + "type": "value is A2uiFunctionCall", + "description": "" + }, + "examples": [] + }, + { + "name": "isPathRef", + "kind": "function", + "description": "Narrows an unknown value to A2uiPathRef — has `path` but not `call`.", + "signature": "isPathRef(value: unknown): value is A2uiPathRef", + "params": [ + { + "name": "value", + "type": "unknown", + "description": "", + "optional": false + } + ], + "returns": { + "type": "value is A2uiPathRef", + "description": "" + }, + "examples": [] + }, + { + "name": "isSystemMessage", + "kind": "function", + "description": "", + "signature": "isSystemMessage(m: Message): m is Message & { role: \"system\" }", + "params": [ + { + "name": "m", + "type": "Message", + "description": "", + "optional": false + } + ], + "returns": { + "type": "m is Message & { role: \"system\" }", + "description": "" + }, + "examples": [] + }, + { + "name": "isToolMessage", + "kind": "function", + "description": "", + "signature": "isToolMessage(m: Message): m is Message & { role: \"tool\" }", + "params": [ + { + "name": "m", + "type": "Message", + "description": "", + "optional": false + } + ], + "returns": { + "type": "m is Message & { role: \"tool\" }", + "description": "" + }, + "examples": [] + }, + { + "name": "isTyping", + "kind": "function", + "description": "", + "signature": "isTyping(agent: Agent): boolean", + "params": [ + { + "name": "agent", + "type": "Agent", + "description": "", + "optional": false + } + ], + "returns": { + "type": "boolean", + "description": "" + }, + "examples": [] + }, + { + "name": "isUserMessage", + "kind": "function", + "description": "", + "signature": "isUserMessage(m: Message): m is Message & { role: \"user\" }", + "params": [ + { + "name": "m", + "type": "Message", + "description": "", + "optional": false + } + ], + "returns": { + "type": "m is Message & { role: \"user\" }", + "description": "" + }, + "examples": [] + }, + { + "name": "messageContent", + "kind": "function", + "description": "Extracts a human-readable string from a message's content.\nHandles string content directly; serializes structured (array) content to JSON.", + "signature": "messageContent(message: BaseMessage<>): string", + "params": [ + { + "name": "message", + "type": "BaseMessage<>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "string", + "description": "" + }, + "examples": [] + }, + { + "name": "mockAgent", + "kind": "function", + "description": "", + "signature": "mockAgent(opts: MockAgentOptions): MockAgent", + "params": [ + { + "name": "opts", + "type": "MockAgentOptions", + "description": "", + "optional": false + } + ], + "returns": { + "type": "MockAgent", + "description": "" + }, + "examples": [] + }, + { + "name": "provideChat", + "kind": "function", + "description": "", + "signature": "provideChat(config: ChatConfig): EnvironmentProviders", + "params": [ + { + "name": "config", + "type": "ChatConfig", + "description": "", + "optional": false + } + ], + "returns": { + "type": "EnvironmentProviders", + "description": "" + }, + "examples": [] + }, + { + "name": "provideViews", + "kind": "function", + "description": "", + "signature": "provideViews(registry: ViewRegistry): EnvironmentProviders", + "params": [ + { + "name": "registry", + "type": "ViewRegistry", + "description": "", + "optional": false + } + ], + "returns": { + "type": "EnvironmentProviders", + "description": "" + }, + "examples": [] + }, + { + "name": "renderMarkdown", + "kind": "function", + "description": "Renders markdown content to sanitized HTML.\nFalls back to plain text with newline->br conversion if `marked` is not installed.", + "signature": "renderMarkdown(content: string, sanitizer: DomSanitizer<>): SafeHtml", + "params": [ + { + "name": "content", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "sanitizer", + "type": "DomSanitizer<>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "SafeHtml", + "description": "" + }, + "examples": [] + }, + { + "name": "runAgentConformance", + "kind": "function", + "description": "Runs a suite of contract conformance assertions against a factory that\nproduces a fresh Agent. Adapter packages should call this in their\nown test suites to verify the contract is satisfied.", + "signature": "runAgentConformance(label: string, factory: object): void", + "params": [ + { + "name": "label", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "factory", + "type": "object", + "description": "", + "optional": false + } + ], + "returns": { + "type": "void", + "description": "" + }, + "examples": [] + }, + { + "name": "runAgentWithHistoryConformance", + "kind": "function", + "description": "Conformance suite for AgentWithHistory implementations.\n\nRuns the base Agent conformance suite, then verifies the history\nsignal is present and returns an array of AgentCheckpoint-shaped entries.", + "signature": "runAgentWithHistoryConformance(label: string, factory: object): void", + "params": [ + { + "name": "label", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "factory", + "type": "object", + "description": "", + "optional": false + } + ], + "returns": { + "type": "void", + "description": "" + }, + "examples": [] + }, + { + "name": "submitMessage", + "kind": "function", + "description": "", + "signature": "submitMessage(agent: Agent, text: string): string | null", + "params": [ + { + "name": "agent", + "type": "Agent", + "description": "", + "optional": false + }, + { + "name": "text", + "type": "string", + "description": "", + "optional": false + } + ], + "returns": { + "type": "string | null", + "description": "" + }, + "examples": [] + }, + { + "name": "surfaceToSpec", + "kind": "function", + "description": "Converts an A2UI surface to a json-render Spec by:\n1. Walking the flat component map\n2. Resolving DynamicValue props against the data model\n3. Mapping A2UI children (string[] or template) to json-render children\n4. Producing a Spec with root + elements", + "signature": "surfaceToSpec(surface: A2uiSurface): Spec | null", + "params": [ + { + "name": "surface", + "type": "A2uiSurface", + "description": "", + "optional": false + } + ], + "returns": { + "type": "Spec | null", + "description": "" + }, + "examples": [] + }, + { + "name": "toRenderRegistry", + "kind": "function", + "description": "Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.", + "signature": "toRenderRegistry(registry: ViewRegistry): AngularRegistry", + "params": [ + { + "name": "registry", + "type": "ViewRegistry", + "description": "", + "optional": false + } + ], + "returns": { + "type": "AngularRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "views", + "kind": "function", + "description": "Creates a view registry from a name → component map.", + "signature": "views(map: Record>): ViewRegistry", + "params": [ + { + "name": "map", + "type": "Record>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "withoutViews", + "kind": "function", + "description": "Removes views from a registry by name.", + "signature": "withoutViews(base: ViewRegistry, names: string[]): ViewRegistry", + "params": [ + { + "name": "base", + "type": "ViewRegistry", + "description": "", + "optional": false + }, + { + "name": "names", + "type": "string[]", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "withViews", + "kind": "function", + "description": "Adds views to a registry without overwriting existing entries.\nNew keys are added; keys that already exist in `base` are preserved.", + "signature": "withViews(base: ViewRegistry, additions: Record>): ViewRegistry", + "params": [ + { + "name": "base", + "type": "ViewRegistry", + "description": "", + "optional": false + }, + { + "name": "additions", + "type": "Record>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + } +] \ No newline at end of file diff --git a/apps/website/content/docs/render/api/api-docs.json b/apps/website/content/docs/render/api/api-docs.json new file mode 100644 index 000000000..63e1ce0c6 --- /dev/null +++ b/apps/website/content/docs/render/api/api-docs.json @@ -0,0 +1,605 @@ +[ + { + "name": "RenderElementComponent", + "kind": "class", + "description": "Recursive element renderer.\n\nFor each element key it:\n1. Looks up the UIElement from spec.elements\n2. Resolves the component class from the registry\n3. Evaluates visibility\n4. Resolves prop expressions and bindings\n5. Renders via NgComponentOutlet with resolved inputs\n\nFor elements with `repeat`, it iterates over the state array,\ncreating a child Injector with RepeatScope for each item.", + "params": [], + "examples": [], + "properties": [ + { + "name": "componentClass", + "type": "Signal", + "description": "The Angular component class for this element type.", + "optional": false + }, + { + "name": "element", + "type": "Signal> | undefined>", + "description": "The UIElement definition from the spec. Only propagates when reference changes.", + "optional": false + }, + { + "name": "elementKey", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "parentInjector", + "type": "Injector<>", + "description": "", + "optional": false + }, + { + "name": "repeatInjectors", + "type": "Signal[]>", + "description": "One child Injector per repeat item, providing RepeatScope.", + "optional": false + }, + { + "name": "repeatInputs", + "type": "Signal", + "description": "Resolved inputs for each repeat item.", + "optional": false + }, + { + "name": "resolvedInputs", + "type": "Signal", + "description": "Resolved inputs for non-repeat elements.", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "visible", + "type": "Signal", + "description": "Whether the element is visible (non-repeat path).", + "optional": false + } + ], + "methods": [ + { + "name": "ngOnInit", + "signature": "ngOnInit()", + "description": "A callback method that is invoked immediately after the\ndefault change detector has checked the directive's\ndata-bound properties for the first time,\nand before any of the view or content children have been checked.\nIt is invoked only once when the directive is instantiated.", + "params": [] + } + ] + }, + { + "name": "RenderSpecComponent", + "kind": "class", + "description": "Top-level entry point for rendering a json-render spec.\n\nAccepts the spec, registry, store, functions, handlers, and loading\nas inputs. Provides `RENDER_CONTEXT` to child `RenderElementComponent`\ninstances via `viewProviders`.\n\nFalls back to `RENDER_CONFIG` (from `provideRender()`) for registry\nand store defaults when inputs are not provided.", + "params": [], + "examples": [ + "```html\n\n```" + ], + "properties": [ + { + "name": "_context", + "type": "Signal", + "description": "The RenderContext provided to children via viewProviders.", + "optional": false + }, + { + "name": "events", + "type": "OutputEmitterRef", + "description": "", + "optional": false + }, + { + "name": "functions", + "type": "InputSignal | undefined>", + "description": "", + "optional": false + }, + { + "name": "handlers", + "type": "InputSignal | undefined>", + "description": "", + "optional": false + }, + { + "name": "loading", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "registry", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "spec", + "type": "InputSignal", + "description": "", + "optional": false + }, + { + "name": "store", + "type": "InputSignal", + "description": "", + "optional": false + } + ], + "methods": [ + { + "name": "ngOnInit", + "signature": "ngOnInit()", + "description": "A callback method that is invoked immediately after the\ndefault change detector has checked the directive's\ndata-bound properties for the first time,\nand before any of the view or content children have been checked.\nIt is invoked only once when the directive is instantiated.", + "params": [] + } + ] + }, + { + "name": "AngularComponentInputs", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "bindings", + "type": "Record", + "description": "Two-way binding paths: prop name → absolute state path", + "optional": true + }, + { + "name": "childKeys", + "type": "string[]", + "description": "Child element keys for recursive rendering", + "optional": false + }, + { + "name": "emit", + "type": "object", + "description": "Emit a named event", + "optional": false + }, + { + "name": "loading", + "type": "boolean", + "description": "Whether the spec is currently streaming", + "optional": true + }, + { + "name": "spec", + "type": "Spec", + "description": "The full spec (for child resolution)", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AngularRegistry", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "get", + "type": "unknown", + "description": "", + "optional": false + }, + { + "name": "names", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "RenderConfig", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "__licenseEnvHint", + "type": "object", + "description": "Test-only env hint override. Not part of the stable API.", + "optional": true + }, + { + "name": "__licensePublicKey", + "type": "Uint8Array", + "description": "Test-only public-key override. Defaults to the compile-time embedded\n`LICENSE_PUBLIC_KEY`. Not part of the stable API.", + "optional": true + }, + { + "name": "functions", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "handlers", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "license", + "type": "string", + "description": "Signed license token from cacheplane.dev. Optional; omitted in dev.", + "optional": true + }, + { + "name": "registry", + "type": "AngularRegistry", + "description": "", + "optional": true + }, + { + "name": "store", + "type": "StateStore", + "description": "", + "optional": true + } + ], + "examples": [] + }, + { + "name": "RenderContext", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "emitEvent", + "type": "object", + "description": "", + "optional": true + }, + { + "name": "functions", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "handlers", + "type": "Record", + "description": "", + "optional": true + }, + { + "name": "loading", + "type": "boolean", + "description": "", + "optional": true + }, + { + "name": "registry", + "type": "AngularRegistry", + "description": "", + "optional": false + }, + { + "name": "store", + "type": "StateStore", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "RenderHandlerEvent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "action", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "params", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "result", + "type": "unknown", + "description": "", + "optional": true + }, + { + "name": "type", + "type": "\"handler\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "RenderLifecycleEvent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "elementKey", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "elementType", + "type": "string", + "description": "", + "optional": true + }, + { + "name": "event", + "type": "\"mounted\" | \"destroyed\"", + "description": "", + "optional": false + }, + { + "name": "scope", + "type": "\"spec\" | \"element\"", + "description": "", + "optional": false + }, + { + "name": "type", + "type": "\"lifecycle\"", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "RenderStateChangeEvent", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "path", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "snapshot", + "type": "Record", + "description": "", + "optional": false + }, + { + "name": "type", + "type": "\"stateChange\"", + "description": "", + "optional": false + }, + { + "name": "value", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "RepeatScope", + "kind": "interface", + "description": "", + "properties": [ + { + "name": "basePath", + "type": "string", + "description": "", + "optional": false + }, + { + "name": "index", + "type": "number", + "description": "", + "optional": false + }, + { + "name": "item", + "type": "unknown", + "description": "", + "optional": false + } + ], + "examples": [] + }, + { + "name": "AngularComponentRenderer", + "kind": "type", + "description": "", + "signature": "Type", + "examples": [] + }, + { + "name": "RenderEvent", + "kind": "type", + "description": "", + "signature": "RenderHandlerEvent | RenderStateChangeEvent | RenderLifecycleEvent", + "examples": [] + }, + { + "name": "ViewRegistry", + "kind": "type", + "description": "A registry of view components available for generative UI rendering.\nPlain frozen object mapping view names to Angular component types.\nCompose via object spread: `views({ ...base, ...more })`.", + "signature": "Readonly>>", + "examples": [] + }, + { + "name": "defineAngularRegistry", + "kind": "function", + "description": "", + "signature": "defineAngularRegistry(componentMap: Record): AngularRegistry", + "params": [ + { + "name": "componentMap", + "type": "Record", + "description": "", + "optional": false + } + ], + "returns": { + "type": "AngularRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "provideRender", + "kind": "function", + "description": "", + "signature": "provideRender(config: RenderConfig): EnvironmentProviders", + "params": [ + { + "name": "config", + "type": "RenderConfig", + "description": "", + "optional": false + } + ], + "returns": { + "type": "EnvironmentProviders", + "description": "" + }, + "examples": [] + }, + { + "name": "provideViews", + "kind": "function", + "description": "", + "signature": "provideViews(registry: ViewRegistry): EnvironmentProviders", + "params": [ + { + "name": "registry", + "type": "ViewRegistry", + "description": "", + "optional": false + } + ], + "returns": { + "type": "EnvironmentProviders", + "description": "" + }, + "examples": [] + }, + { + "name": "signalStateStore", + "kind": "function", + "description": "", + "signature": "signalStateStore(initialState: StateModel): StateStore", + "params": [ + { + "name": "initialState", + "type": "StateModel", + "description": "", + "optional": false + } + ], + "returns": { + "type": "StateStore", + "description": "" + }, + "examples": [] + }, + { + "name": "toRenderRegistry", + "kind": "function", + "description": "Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.", + "signature": "toRenderRegistry(registry: ViewRegistry): AngularRegistry", + "params": [ + { + "name": "registry", + "type": "ViewRegistry", + "description": "", + "optional": false + } + ], + "returns": { + "type": "AngularRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "views", + "kind": "function", + "description": "Creates a view registry from a name → component map.", + "signature": "views(map: Record>): ViewRegistry", + "params": [ + { + "name": "map", + "type": "Record>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "withoutViews", + "kind": "function", + "description": "Removes views from a registry by name.", + "signature": "withoutViews(base: ViewRegistry, names: string[]): ViewRegistry", + "params": [ + { + "name": "base", + "type": "ViewRegistry", + "description": "", + "optional": false + }, + { + "name": "names", + "type": "string[]", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + }, + { + "name": "withViews", + "kind": "function", + "description": "Adds views to a registry without overwriting existing entries.\nNew keys are added; keys that already exist in `base` are preserved.", + "signature": "withViews(base: ViewRegistry, additions: Record>): ViewRegistry", + "params": [ + { + "name": "base", + "type": "ViewRegistry", + "description": "", + "optional": false + }, + { + "name": "additions", + "type": "Record>", + "description": "", + "optional": false + } + ], + "returns": { + "type": "ViewRegistry", + "description": "" + }, + "examples": [] + } +] \ No newline at end of file diff --git a/apps/website/scripts/generate-api-docs.ts b/apps/website/scripts/generate-api-docs.ts index b8ca0069d..2a4be552e 100644 --- a/apps/website/scripts/generate-api-docs.ts +++ b/apps/website/scripts/generate-api-docs.ts @@ -119,33 +119,42 @@ function reflectionToEntry(ref: any): ApiDocEntry | null { return null; } -async function main() { - const candidates = [ - 'libs/angular/src/public-api.ts', - 'packages/angular/src/public-api.ts', - ]; - const entryPoint = candidates.find((p) => fs.existsSync(p)); - if (!entryPoint) { - console.warn('Library entry point not found — generating empty api-docs.json'); - const outDir = 'apps/website/content/docs/agent/api'; +interface LibraryEntryConfig { + /** Doc-site library slug (e.g. 'agent', 'chat') — used as the output folder under apps/website/content/docs/. */ + docSlug: string; + /** TypeDoc entry point — usually libs//src/public-api.ts. */ + entryPoint: string; +} + +const LIBRARIES: LibraryEntryConfig[] = [ + { docSlug: 'agent', entryPoint: 'libs/langgraph/src/public-api.ts' }, + { docSlug: 'chat', entryPoint: 'libs/chat/src/public-api.ts' }, + { docSlug: 'render', entryPoint: 'libs/render/src/public-api.ts' }, + { docSlug: 'ag-ui', entryPoint: 'libs/ag-ui/src/public-api.ts' }, +]; + +async function generateForLibrary(cfg: LibraryEntryConfig): Promise { + const outDir = `apps/website/content/docs/${cfg.docSlug}/api`; + if (!fs.existsSync(cfg.entryPoint)) { + console.warn(`Entry point not found for ${cfg.docSlug}: ${cfg.entryPoint} — writing empty api-docs.json`); fs.mkdirSync(outDir, { recursive: true }); fs.writeFileSync(path.join(outDir, 'api-docs.json'), JSON.stringify([], null, 2)); return; } - const libDir = path.dirname(path.dirname(entryPoint)); + const libDir = path.dirname(path.dirname(cfg.entryPoint)); const libTsconfig = fs.existsSync(path.join(libDir, 'tsconfig.lib.json')) ? path.join(libDir, 'tsconfig.lib.json') : undefined; const app = await Application.bootstrapWithPlugins({ - entryPoints: [entryPoint], + entryPoints: [cfg.entryPoint], skipErrorChecking: true, ...(libTsconfig ? { tsconfig: libTsconfig } : {}), }); app.options.addReader(new TSConfigReader()); const project = await app.convert(); - if (!project) throw new Error('TypeDoc failed to convert project'); + if (!project) throw new Error(`TypeDoc failed to convert ${cfg.docSlug}`); const entries: ApiDocEntry[] = []; for (const child of project.children ?? []) { @@ -153,10 +162,15 @@ async function main() { if (entry) entries.push(entry); } - const outDir = 'apps/website/content/docs/agent/api'; fs.mkdirSync(outDir, { recursive: true }); fs.writeFileSync(path.join(outDir, 'api-docs.json'), JSON.stringify(entries, null, 2)); - console.log(`✓ api-docs.json written (${entries.length} entries)`); + console.log(`✓ ${cfg.docSlug}/api/api-docs.json (${entries.length} entries)`); +} + +async function main() { + for (const cfg of LIBRARIES) { + await generateForLibrary(cfg); + } } main().catch((e) => { console.error(e); process.exit(1); }); diff --git a/docs/superpowers/plans/2026-05-01-fix-and-publish-002.md b/docs/superpowers/plans/2026-05-01-fix-and-publish-002.md new file mode 100644 index 000000000..9120b340a --- /dev/null +++ b/docs/superpowers/plans/2026-05-01-fix-and-publish-002.md @@ -0,0 +1,324 @@ +# Fix Packaging Bugs and Publish 0.0.2 + +> Driven by smoke-test findings (`docs/superpowers/plans/2026-05-01-fresh-install-smoke.md`). The 0.0.1 release is unusable end-to-end; three packages shipped raw source, one bundles vitest into runtime. + +**Goal:** Land three packaging fixes, verify locally with `npm pack` + smoke-workspace install, then ship 0.0.2 to npm. + +--- + +## Bug summary + +1. **`@ngaf/a2ui`, `@ngaf/partial-json`, `@ngaf/licensing` published as source.** No explicit `nx-release-publish` target in their `project.json`; Nx defaulted to publishing the project root rather than `dist/`. +2. **`@ngaf/chat` bundles vitest into runtime.** `runAgentConformance` and `runAgentWithHistoryConformance` are exported from the main public-api and `import { describe, it, expect } from 'vitest'` at module level. ng-packagr bundles vitest into the FESM file. +3. **`@ngaf/render` import of `@ngaf/licensing` fails to resolve** — consequence of bug #1; fixes itself once `@ngaf/licensing` ships actual JS. + +--- + +## Strategy + +- **Fix 1 (mechanical):** Add `nx-release-publish` target to the three TS-only libs. +- **Fix 2 (entry point):** Move conformance helpers to `@ngaf/chat/testing` secondary entry point. `mockAgent` stays on the main entry (no vitest dep) for ergonomic test-fixture use without separate import. +- **Verification before publish:** `npm pack` each lib, install tarballs into `~/tmp/ngaf/smoke-workspace`, confirm build passes. +- **Publish 0.0.2:** standard `nx release version 0.0.2 --specifier=patch && nx release publish` flow. + +`@ngaf/langgraph` test helpers (`mockLangGraphAgent`) don't import vitest; leave on main entry. AG-UI's `FakeAgent` and `provideFakeAgUiAgent` are runtime utilities (not tests), no vitest dep; leave on main entry. + +--- + +### Task 1: Add publish config to TS-only libs + +**Files:** `libs/a2ui/project.json`, `libs/partial-json/project.json`, `libs/licensing/project.json` + +For each, add: +```json +"nx-release-publish": { + "options": { + "packageRoot": "dist/{projectRoot}" + } +} +``` +to the `targets` block. + +- [ ] **Step 1: Edit each project.json** + +```bash +for lib in a2ui partial-json licensing; do + jq '.targets["nx-release-publish"] = { options: { packageRoot: "dist/{projectRoot}" } }' \ + libs/$lib/project.json > libs/$lib/project.json.tmp \ + && mv libs/$lib/project.json.tmp libs/$lib/project.json +done +``` + +- [ ] **Step 2: Verify** + +```bash +for lib in a2ui partial-json licensing; do + echo "=== $lib ===" + jq '.targets["nx-release-publish"]' libs/$lib/project.json +done +``` + +Expected: each shows `{"options": {"packageRoot": "dist/{projectRoot}"}}`. + +--- + +### Task 2: Move conformance helpers to `@ngaf/chat/testing` + +**Files:** `libs/chat/src/lib/testing/`, `libs/chat/src/public-api.ts`, new `libs/chat/testing/` secondary entry point. + +ng-packagr secondary entry points are colocated subdirectories with their own `ng-package.json`. Convention: + +``` +libs/chat/ +├── ng-package.json # main entry +├── src/ +│ ├── public-api.ts +│ └── lib/ +│ └── testing/ # source files +│ ├── agent-conformance.ts +│ └── agent-with-history-conformance.ts +└── testing/ # NEW — secondary entry + ├── ng-package.json + └── public-api.ts +``` + +The secondary `testing/public-api.ts` re-exports from the source files. The main `src/public-api.ts` STOPS exporting the conformance helpers. + +- [ ] **Step 1: Create `libs/chat/testing/ng-package.json`** + +```json +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "public-api.ts" + } +} +``` + +- [ ] **Step 2: Create `libs/chat/testing/public-api.ts`** + +```ts +// SPDX-License-Identifier: MIT +export { runAgentConformance } from '../src/lib/testing/agent-conformance'; +export { runAgentWithHistoryConformance } from '../src/lib/testing/agent-with-history-conformance'; +``` + +(Keep `mockAgent` on the main entry; it's pure factory code with no vitest dep and is ergonomically useful for component tests.) + +- [ ] **Step 3: Update `libs/chat/src/public-api.ts`** + +Remove these lines: +```ts +export { runAgentConformance } from './lib/testing/agent-conformance'; +export { runAgentWithHistoryConformance } from './lib/testing/agent-with-history-conformance'; +``` + +Keep: +```ts +export { mockAgent } from './lib/testing/mock-agent'; +export type { MockAgent, MockAgentOptions } from './lib/testing/mock-agent'; +``` + +- [ ] **Step 4: Update internal references** + +`libs/langgraph/src/lib/agent.conformance.spec.ts` imports `runAgentConformance` — currently from `@ngaf/chat`; should now be `@ngaf/chat/testing`. + +```bash +rg -l "runAgentConformance|runAgentWithHistoryConformance" libs/ apps/ cockpit/ --glob '!**/dist/**' +``` + +For each result, change `from '@ngaf/chat'` → `from '@ngaf/chat/testing'` for these specific imports. + +- [ ] **Step 5: Verify chat builds** + +```bash +npx nx build chat --skip-nx-cache 2>&1 | tail -3 +ls dist/libs/chat/ +``` + +Expected: PASS. `dist/libs/chat/` contains both the main FESM and a `testing/` subdirectory with its own `package.json`/types. + +The published artifact will have `exports`: +```json +{ + ".": { ... main entry ... }, + "./testing": { ... testing entry ... } +} +``` + +(ng-packagr generates this automatically.) + +--- + +### Task 3: Local pack + install verification + +Before publishing to npm, validate the fix locally. + +- [ ] **Step 1: Build all 7 publishable libs** + +```bash +npx nx run-many -t build --projects=chat,langgraph,ag-ui,render,a2ui,partial-json,licensing --skip-nx-cache 2>&1 | tail -3 +``` + +- [ ] **Step 2: Verify each dist has proper artifacts** + +```bash +for lib in chat langgraph ag-ui render a2ui partial-json licensing; do + echo "=== $lib ===" + ls dist/libs/$lib/ | head -8 + echo "---" + jq '{name, main, module, types, exports: (.exports // "none")}' dist/libs/$lib/package.json 2>&1 | head -10 +done +``` + +Expected for ng-packagr libs (chat/langgraph/ag-ui/render): `fesm2022/`, `types/`, `exports.{".":...}` block. + +Expected for tsc libs (a2ui/partial-json/licensing): compiled `.js` + `.d.ts` files, valid `main`/`module`/`types`. + +If any lib's `dist/` is missing or has only source: that lib's build target needs investigation. + +- [ ] **Step 3: Pack each as a local tarball** + +```bash +mkdir -p ~/tmp/ngaf/local-tarballs +rm -f ~/tmp/ngaf/local-tarballs/*.tgz + +for lib in chat langgraph ag-ui render a2ui partial-json licensing; do + cd dist/libs/$lib && npm pack --pack-destination ~/tmp/ngaf/local-tarballs && cd - +done + +ls ~/tmp/ngaf/local-tarballs/ +``` + +Expected: 7 `.tgz` files. + +- [ ] **Step 4: Install local tarballs into smoke workspace** + +```bash +cd ~/tmp/ngaf/smoke-workspace +npm install \ + ~/tmp/ngaf/local-tarballs/ngaf-chat-0.0.1.tgz \ + ~/tmp/ngaf/local-tarballs/ngaf-ag-ui-0.0.1.tgz \ + ~/tmp/ngaf/local-tarballs/ngaf-render-0.0.1.tgz \ + ~/tmp/ngaf/local-tarballs/ngaf-licensing-0.0.1.tgz \ + ~/tmp/ngaf/local-tarballs/ngaf-a2ui-0.0.1.tgz \ + ~/tmp/ngaf/local-tarballs/ngaf-partial-json-0.0.1.tgz +``` + +- [ ] **Step 5: Re-run the AG-UI smoke build** + +```bash +cd ~/tmp/ngaf/smoke-workspace +npx ng build ag-ui-fake 2>&1 | tail -10 +``` + +Expected: PASS. If build still fails: capture the new error, address before publish. + +If the test imports of `runAgentConformance` need updating to `@ngaf/chat/testing` in the smoke app — they shouldn't, since the AG-UI smoke doesn't use conformance. Only internal lib tests use it. + +- [ ] **Step 6: Run dev server (optional but valuable)** + +```bash +cd ~/tmp/ngaf/smoke-workspace +npx ng serve ag-ui-fake --port 4300 & +sleep 8 +curl -sIo /dev/null -w "%{http_code}\n" http://localhost:4300/ +# kill the server +kill %1 2>/dev/null +``` + +Expected: HTTP 200. Real interactive testing requires browser. + +--- + +### Task 4: Bump and publish 0.0.2 + +- [ ] **Step 1: Build everything from clean state** + +```bash +cd /Users/blove/repos/angular-agent-framework/.claude/worktrees/post-unification-cleanup +rm -rf dist/ +npx nx run-many -t build --projects=chat,langgraph,ag-ui,render,a2ui,partial-json,licensing --skip-nx-cache 2>&1 | tail -3 +``` + +- [ ] **Step 2: Version bump** + +```bash +npx nx release version --specifier=patch 2>&1 | tail -10 +``` + +Expected: all 7 publishable lib package.json files updated to 0.0.2 (synchronized fixed group). + +- [ ] **Step 3: Generate changelog + tag** + +```bash +npx nx release changelog 0.0.2 2>&1 | tail -10 +``` + +Expected: `CHANGELOG.md` updated with 0.0.2 entry. New commit `chore(release): publish v0.0.2`. New tag `v0.0.2` (the post-#147 tag pattern; `nx.json` was updated). + +- [ ] **Step 4: Source NPM_TOKEN and run publish** + +```bash +set -a; source /Users/blove/repos/angular-agent-framework/.env; set +a +npx nx release publish --groups=publishable --access=public --otp=NNNNNN +``` + +(User provides the OTP at run time; trusted publishing is configured but local-publish still goes through 2FA per npm account settings.) + +Expected: 7 packages publish successfully. + +- [ ] **Step 5: Push commit + tag** + +```bash +git push origin HEAD:main +git push origin v0.0.2 +``` + +Workflow fires on tag push but is idempotent. + +- [ ] **Step 6: Verify all 7 at 0.0.2** + +```bash +for pkg in chat langgraph ag-ui render a2ui partial-json licensing; do + echo -n "@ngaf/$pkg: " + npm view @ngaf/$pkg version +done +``` + +Expected: all 7 print `0.0.2`. + +--- + +### Task 5: Re-run the smoke against 0.0.2 + +After 0.0.2 is on npm: + +```bash +cd ~/tmp/ngaf/smoke-workspace +rm -rf node_modules package-lock.json +npm install +# package.json already references @ngaf/* without version pins; will pull 0.0.2 + +npx ng build ag-ui-fake +npx ng build langgraph-build +``` + +Expected: both build clean. Then `ng serve ag-ui-fake --port 4300` and confirm in browser. + +If anything else fails: capture findings, repeat the fix-publish cycle. + +--- + +## Out of Scope + +- Renaming or moving `mockAgent` / `mockLangGraphAgent` / `FakeAgent` / `provideFakeAgUiAgent`. They don't import vitest; their bundle cost is negligible. +- Renaming `lib/testing/` directories. +- Improving Tailwind / theming setup in the smoke app. +- Adding LangGraph live-backend test. + +## Risk + +- **Multi-package version skew during publish.** If the publish for 0.0.2 fails partway (e.g., OTP timeout), some packages land at 0.0.2 while others stay at 0.0.1. The synchronized fixed group + the `--first-release` style retry pattern (re-run with same OTP for missed packages) mitigates this. +- **Secondary entry-point convention.** Some Angular consumers (older ng-packagr, certain bundlers) have rough edges with secondary entry points. Smoke-test against the AG-UI app catches obvious cases. +- **`@ngaf/langgraph` may have similar issues** that didn't surface yet because the smoke didn't actually try to build the langgraph-build app. After 0.0.2 publishes, the smoke MUST build langgraph-build successfully or we have a third packaging bug. diff --git a/docs/superpowers/plans/2026-05-01-fresh-install-smoke.md b/docs/superpowers/plans/2026-05-01-fresh-install-smoke.md new file mode 100644 index 000000000..e9fc2abfb --- /dev/null +++ b/docs/superpowers/plans/2026-05-01-fresh-install-smoke.md @@ -0,0 +1,301 @@ +# Fresh-Install Smoke Test Plan + +> Manual validation. Not auto-executable; not part of CI. Output: a working demo app at `~/tmp/ngaf/smoke-app/` proving `@ngaf/*@0.0.1` packages install + build + run from npm. + +**Goal:** Prove the published `@ngaf/chat`, `@ngaf/ag-ui`, and `@ngaf/langgraph` packages work in a fresh Angular 20+ project outside this monorepo. Catches packaging bugs (missing files, broken peerDeps, bad exports) that internal tsconfig-paths resolution hides. + +**Working directory:** `~/tmp/ngaf/` + +**Strategy:** Two thin Angular apps share one workspace. +- **`ag-ui-fake`** — uses `@ngaf/ag-ui`'s `FakeAgent` for end-to-end runtime testing (no backend required). +- **`langgraph-build`** — uses `@ngaf/langgraph`'s `agent()` factory; build-only smoke (no live backend). + +End-to-end validation: type a message in the AG-UI app, see streaming canned reply. + +--- + +## Pre-flight + +- [ ] **Step 1: Confirm Node version** + +```bash +node --version # expect >= 22.0.0 +``` + +- [ ] **Step 2: Confirm npm cache is clean** (avoid stale package resolution) + +```bash +npm cache clean --force 2>&1 | tail -1 +``` + +- [ ] **Step 3: Verify all 7 packages resolve from npm** + +```bash +for pkg in chat langgraph ag-ui render a2ui partial-json licensing; do + echo -n "@ngaf/$pkg: " + npm view @ngaf/$pkg version 2>/dev/null || echo "NOT FOUND" +done +``` + +Expected: all 7 print `0.0.1`. If any returns NOT FOUND, the publish was incomplete; fix before proceeding. + +--- + +## Task 1: Create Angular workspace + +- [ ] **Step 1: Create the workspace under `~/tmp/ngaf`** + +```bash +cd ~/tmp/ngaf +rm -rf smoke-workspace 2>/dev/null +npx -p @angular/cli@latest ng new smoke-workspace \ + --create-application=false \ + --package-manager=npm \ + --skip-git \ + --skip-install +cd smoke-workspace +``` + +Defaults: routing optional, CSS, no SSR (we're testing the SDK, not Angular SSR). + +- [ ] **Step 2: Pin Angular to a specific stable version** + +Verify: +```bash +cat package.json | jq '.dependencies."@angular/core"' +``` + +Should be Angular 20 or 21 (whatever the CLI default produces). Ensure it matches one of the peer-dep ranges in `@ngaf/chat`'s `package.json` (`^20.0.0 || ^21.0.0`). + +- [ ] **Step 3: Install workspace deps** + +```bash +npm install +``` + +If npm flags missing peer-deps as warnings, that's fine — we'll install our targets next. + +--- + +## Task 2: AG-UI + FakeAgent app + +- [ ] **Step 1: Generate the app** + +```bash +cd ~/tmp/ngaf/smoke-workspace +npx ng generate application ag-ui-fake \ + --routing=false \ + --style=css \ + --standalone \ + --skip-tests +``` + +- [ ] **Step 2: Install `@ngaf/chat` + `@ngaf/ag-ui`** + +```bash +npm install @ngaf/chat @ngaf/ag-ui +``` + +Expected: clean install, no errors. Watch for warnings about unmet peerDeps — those reveal packaging gaps. + +- [ ] **Step 3: Wire the app config** + +`projects/ag-ui-fake/src/app/app.config.ts`: + +```ts +import { ApplicationConfig } from '@angular/core'; +import { provideFakeAgUiAgent } from '@ngaf/ag-ui'; + +export const appConfig: ApplicationConfig = { + providers: [ + provideFakeAgUiAgent({ + tokens: ['Hi! ', 'I\'m ', 'a ', 'fake ', 'agent ', 'streaming ', 'tokens.'], + delayMs: 60, + }), + ], +}; +``` + +- [ ] **Step 4: Wire the root component** + +`projects/ag-ui-fake/src/app/app.component.ts`: + +```ts +import { Component, inject } from '@angular/core'; +import { ChatComponent } from '@ngaf/chat'; +import { AG_UI_AGENT } from '@ngaf/ag-ui'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [ChatComponent], + template: ` +
+ +
+ `, +}) +export class AppComponent { + protected readonly agent = inject(AG_UI_AGENT); +} +``` + +- [ ] **Step 5: Build** + +```bash +npx ng build ag-ui-fake +``` + +Expected: PASS with no errors. Check bundle size — should be reasonable (< 1MB initial JS gzipped). Watch for: +- "Cannot find module '@ngaf/...'" → packaging bug. +- Type-check failures → public-api missing exports. +- ng-packagr-related warnings about dist consumption. + +- [ ] **Step 6: Run dev server** + +```bash +npx ng serve ag-ui-fake --port 4300 +``` + +Open http://localhost:4300 in a browser. Type a message into the chat input. Expected: streaming canned reply appears token-by-token. + +If reply doesn't stream: likely DI wiring; check console for errors. +If page doesn't render: likely CSS/Tailwind dependency missing (chat assumes Tailwind tokens; verify `chat-theme.css` is loaded somehow). + +⚠️ **Known concern:** `@ngaf/chat` uses Tailwind utility classes for its components. The smoke app may need a tailwind config + base styles for the rendered components to look right. The build/run will succeed without it; just visuals will be unstyled. That's acceptable for a smoke test focused on packaging. + +--- + +## Task 3: LangGraph build-only smoke + +- [ ] **Step 1: Generate the app** + +```bash +cd ~/tmp/ngaf/smoke-workspace +npx ng generate application langgraph-build \ + --routing=false \ + --style=css \ + --standalone \ + --skip-tests +``` + +- [ ] **Step 2: Install `@ngaf/langgraph`** (chat already installed in Task 2) + +```bash +npm install @ngaf/langgraph +``` + +- [ ] **Step 3: Wire the app config** + +`projects/langgraph-build/src/app/app.config.ts`: + +```ts +import { ApplicationConfig } from '@angular/core'; + +export const appConfig: ApplicationConfig = { + providers: [], +}; +``` + +- [ ] **Step 4: Wire the root component** + +`projects/langgraph-build/src/app/app.component.ts`: + +```ts +import { Component } from '@angular/core'; +import { ChatComponent } from '@ngaf/chat'; +import { agent } from '@ngaf/langgraph'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [ChatComponent], + template: ` +
+ +
+ `, +}) +export class AppComponent { + // No live backend. agent() factory must compile + type-check. + // We don't actually run a stream; just verify the integration shape. + protected readonly lgAgent = agent({ + apiUrl: 'http://localhost:2024', + assistantId: 'chat_agent', + }); +} +``` + +- [ ] **Step 5: Build** + +```bash +npx ng build langgraph-build +``` + +Expected: PASS. We're not running it — this just confirms packaging + types compile against a real published artifact. + +If the build fails: probably `@ngaf/langgraph`'s peerDeps weren't installed (e.g., `@langchain/core`, `@langchain/langgraph-sdk`). npm 7+ doesn't auto-install peerDeps; the build error will name what's missing. Install and retry. + +--- + +## Task 4: Bundle audit + +- [ ] **Step 1: Inspect produced bundles** + +```bash +cd ~/tmp/ngaf/smoke-workspace +ls -lh dist/ag-ui-fake/browser/*.js | head +ls -lh dist/langgraph-build/browser/*.js | head +``` + +Note any bundle that's surprisingly large (initial JS > 1MB suggests a tree-shaking gap). + +- [ ] **Step 2: Verify no `apps/minting-service` content shipped** + +```bash +grep -r "minting-service" dist/ 2>&1 | head -5 +``` + +Expected: zero hits. Catches accidental leakage of proprietary code into the user-facing bundle. + +- [ ] **Step 3: Verify license coverage** + +Look at `dist/*/browser/3rdpartylicenses.txt` (Angular CLI auto-generates this). Should list `@ngaf/*` packages with MIT license. + +```bash +grep -A 1 "@ngaf/" dist/ag-ui-fake/browser/3rdpartylicenses.txt | head -20 +``` + +--- + +## Task 5: Capture findings + +Record any issues discovered into a finding-list. Each finding is one of: +- **Packaging bug** (lib doesn't install/build clean) → file an issue, fix in a PR. +- **Documentation gap** (e.g., the smoke needs Tailwind config; should be in `installation.mdx`) → docs PR. +- **API ergonomics paper cut** (e.g., FakeAgent token list awkwardly long) → consider for next release. + +Document in: +- `~/tmp/ngaf/smoke-findings.md` — local notes. +- A GitHub issue for each Severity-1+ finding (packaging or runtime bug). + +--- + +## Out of Scope + +- LangGraph live backend testing — no backend running locally. +- AG-UI live backend testing — no public AG-UI-native HTTP endpoint available. +- E2E test automation — this is a one-time smoke pass, not a regression suite. +- Tailwind / theming setup — visuals may render unstyled; not the point. +- React / non-Angular consumer paths — out of scope for `@ngaf/*` (Angular-only). +- Verifying SSR / SSG compatibility — not in scope. + +## Cleanup + +After smoke pass completes: + +```bash +# Optionally keep ~/tmp/ngaf/smoke-workspace for re-runs +# Or remove: +rm -rf ~/tmp/ngaf/smoke-workspace +``` diff --git a/libs/a2ui/project.json b/libs/a2ui/project.json index a040a3565..f1b0df103 100644 --- a/libs/a2ui/project.json +++ b/libs/a2ui/project.json @@ -3,21 +3,35 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/a2ui/src", "projectType": "library", - "tags": ["scope:shared", "type:lib"], + "tags": [ + "scope:shared", + "type:lib" + ], "targets": { "build": { "executor": "@nx/js:tsc", - "outputs": ["{workspaceRoot}/dist/libs/a2ui"], + "outputs": [ + "{workspaceRoot}/dist/libs/a2ui" + ], "options": { "outputPath": "dist/libs/a2ui", "main": "libs/a2ui/src/index.ts", "tsConfig": "libs/a2ui/tsconfig.lib.json" } }, - "lint": { "executor": "@nx/eslint:lint" }, + "lint": { + "executor": "@nx/eslint:lint" + }, "test": { "executor": "@nx/vitest:test", - "options": { "configFile": "libs/a2ui/vite.config.mts" } + "options": { + "configFile": "libs/a2ui/vite.config.mts" + } + }, + "nx-release-publish": { + "options": { + "packageRoot": "dist/{projectRoot}" + } } } } diff --git a/libs/a2ui/tsconfig.lib.json b/libs/a2ui/tsconfig.lib.json index 48fc200a0..6ad422f39 100644 --- a/libs/a2ui/tsconfig.lib.json +++ b/libs/a2ui/tsconfig.lib.json @@ -1,6 +1,14 @@ { "extends": "./tsconfig.json", - "compilerOptions": { "outDir": "../../dist/out-tsc", "declaration": true }, - "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts"] + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "emitDeclarationOnly": false + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.spec.ts" + ] } diff --git a/libs/ag-ui/src/lib/to-agent.conformance.spec.ts b/libs/ag-ui/src/lib/to-agent.conformance.spec.ts index 6d4dc4cce..98644dba3 100644 --- a/libs/ag-ui/src/lib/to-agent.conformance.spec.ts +++ b/libs/ag-ui/src/lib/to-agent.conformance.spec.ts @@ -2,7 +2,7 @@ import { Observable } from 'rxjs'; import type { AbstractAgent, BaseEvent } from '@ag-ui/client'; import type { RunAgentInput } from '@ag-ui/core'; -import { runAgentConformance } from '@ngaf/chat'; +import { runAgentConformance } from '@ngaf/chat/testing'; import { toAgent } from './to-agent'; /** diff --git a/libs/chat/src/public-api.ts b/libs/chat/src/public-api.ts index d62cf0656..6741e021f 100644 --- a/libs/chat/src/public-api.ts +++ b/libs/chat/src/public-api.ts @@ -119,8 +119,9 @@ export type { } from '@ngaf/a2ui'; export { isPathRef, isFunctionCall } from '@ngaf/a2ui'; -// Test utilities +// Test utilities (no vitest dep — safe to ship in the main runtime bundle) export { mockAgent } from './lib/testing/mock-agent'; export type { MockAgent, MockAgentOptions } from './lib/testing/mock-agent'; -export { runAgentConformance } from './lib/testing/agent-conformance'; -export { runAgentWithHistoryConformance } from './lib/testing/agent-with-history-conformance'; + +// Conformance helpers ship from the secondary entry point @ngaf/chat/testing +// (they import vitest at module level; keeping them out of the main bundle). diff --git a/libs/chat/src/lib/testing/agent-conformance.spec.ts b/libs/chat/testing/agent-conformance.spec.ts similarity index 100% rename from libs/chat/src/lib/testing/agent-conformance.spec.ts rename to libs/chat/testing/agent-conformance.spec.ts diff --git a/libs/chat/src/lib/testing/agent-conformance.ts b/libs/chat/testing/agent-conformance.ts similarity index 97% rename from libs/chat/src/lib/testing/agent-conformance.ts rename to libs/chat/testing/agent-conformance.ts index 410808ca8..4d055d4b6 100644 --- a/libs/chat/src/lib/testing/agent-conformance.ts +++ b/libs/chat/testing/agent-conformance.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT import { describe, it, expect } from 'vitest'; -import type { Agent } from '../agent'; +import type { Agent } from '@ngaf/chat'; /** * Runs a suite of contract conformance assertions against a factory that diff --git a/libs/chat/src/lib/testing/agent-with-history-conformance.ts b/libs/chat/testing/agent-with-history-conformance.ts similarity index 94% rename from libs/chat/src/lib/testing/agent-with-history-conformance.ts rename to libs/chat/testing/agent-with-history-conformance.ts index da5f4983e..7c0d54116 100644 --- a/libs/chat/src/lib/testing/agent-with-history-conformance.ts +++ b/libs/chat/testing/agent-with-history-conformance.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT import { describe, it, expect } from 'vitest'; -import type { AgentWithHistory, AgentCheckpoint } from '../agent'; +import type { AgentWithHistory, AgentCheckpoint } from '@ngaf/chat'; import { runAgentConformance } from './agent-conformance'; /** diff --git a/libs/chat/testing/ng-package.json b/libs/chat/testing/ng-package.json new file mode 100644 index 000000000..ed278942e --- /dev/null +++ b/libs/chat/testing/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "public-api.ts" + } +} diff --git a/libs/chat/testing/public-api.ts b/libs/chat/testing/public-api.ts new file mode 100644 index 000000000..931591f53 --- /dev/null +++ b/libs/chat/testing/public-api.ts @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: MIT +export { runAgentConformance } from './agent-conformance'; +export { runAgentWithHistoryConformance } from './agent-with-history-conformance'; diff --git a/libs/langgraph/src/lib/agent.conformance.spec.ts b/libs/langgraph/src/lib/agent.conformance.spec.ts index 05aa7240d..9e1e538ed 100644 --- a/libs/langgraph/src/lib/agent.conformance.spec.ts +++ b/libs/langgraph/src/lib/agent.conformance.spec.ts @@ -8,7 +8,7 @@ // construction time (they arrive via the stream transport). The history signal // is exercised in agent.fn.spec.ts instead. import { TestBed } from '@angular/core/testing'; -import { runAgentConformance } from '@ngaf/chat'; +import { runAgentConformance } from '@ngaf/chat/testing'; import { agent } from './agent.fn'; import { MockAgentTransport } from './transport/mock-stream.transport'; diff --git a/libs/langgraph/src/lib/agent.types.ts b/libs/langgraph/src/lib/agent.types.ts index 3b7f4a04d..051ca1722 100644 --- a/libs/langgraph/src/lib/agent.types.ts +++ b/libs/langgraph/src/lib/agent.types.ts @@ -128,70 +128,6 @@ export interface SubagentStreamRef { messages: Signal; } -// ── AgentRef ──────────────────────────────────────────────────────── - -/** Reactive reference returned by {@link agent}. All properties are Angular Signals. */ -export interface AgentRef { - // ResourceRef compatible members (duck-typed, not inherited) - /** Current agent state values. */ - value: Signal; - /** Current resource status: idle, loading, resolved, or error. */ - status: Signal; - /** True when the resource is actively streaming. */ - isLoading: Signal; - /** Last error, if any. */ - error: Signal; - /** True once at least one value or message has been received. */ - hasValue: Signal; - /** Re-submits the last input to restart the stream. */ - reload: () => void; - - // Streaming state - /** Current list of messages from the agent conversation. */ - messages: Signal; - /** Current interrupt data, if the agent is paused for input. */ - interrupt: Signal | undefined>; - /** All interrupts received during the current run. */ - interrupts: Signal[]>; - /** Progress updates for currently executing tools. */ - toolProgress: Signal; - /** Completed tool calls with their results. */ - toolCalls: Signal; - - // Thread & history - /** Current branch identifier for time-travel navigation. */ - branch: Signal; - /** Full execution history of the current thread. */ - history: Signal[]>; - /** True while a thread switch is loading state from the server. */ - isThreadLoading: Signal; - - // Subagents - /** Map of active subagent streams keyed by tool call ID. */ - subagents: Signal>; - /** Filtered list of subagents with status 'running'. */ - activeSubagents: Signal; - - /** Custom events emitted by the LangGraph backend during the current run. */ - customEvents: Signal; - - // Actions - /** Send a message or resume from an interrupt. Returns immediately. */ - submit: (values: ResolvedBag['UpdateType'] | null, opts?: SubmitOptions) => Promise; - /** Abort the current stream. */ - stop: () => Promise; - /** Switch to a different thread, resetting derived state. */ - switchThread: (threadId: string | null) => void; - /** Join an already-running stream by run ID. */ - joinStream: (runId: string, lastEventId?: string) => Promise; - /** Set the active branch for time-travel navigation. */ - setBranch: (branch: string) => void; - /** Get metadata for a specific message by index. */ - getMessagesMetadata: (msg: BaseMessage, idx?: number) => MessageMetadata> | undefined; - /** Get tool call results associated with an AI message. */ - getToolCalls: (msg: CoreAIMessage) => ToolCallWithResult[]; -} - // ── LangGraphAgent ──────────────────────────────────────────────────────────── /** diff --git a/libs/licensing/project.json b/libs/licensing/project.json index 579562cf9..c2fecc175 100644 --- a/libs/licensing/project.json +++ b/libs/licensing/project.json @@ -3,7 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/licensing/src", "projectType": "library", - "tags": ["scope:shared", "type:lib"], + "tags": [ + "scope:shared", + "type:lib" + ], "targets": { "prebuild": { "executor": "nx:run-commands", @@ -13,19 +16,34 @@ }, "build": { "executor": "@nx/js:tsc", - "dependsOn": ["prebuild"], - "outputs": ["{workspaceRoot}/dist/libs/licensing"], + "dependsOn": [ + "prebuild" + ], + "outputs": [ + "{workspaceRoot}/dist/libs/licensing" + ], "options": { "outputPath": "dist/libs/licensing", "main": "libs/licensing/src/index.ts", "tsConfig": "libs/licensing/tsconfig.lib.json" } }, - "lint": { "executor": "@nx/eslint:lint" }, + "lint": { + "executor": "@nx/eslint:lint" + }, "test": { "executor": "@nx/vitest:test", - "dependsOn": ["prebuild"], - "options": { "configFile": "libs/licensing/vite.config.mts" } + "dependsOn": [ + "prebuild" + ], + "options": { + "configFile": "libs/licensing/vite.config.mts" + } + }, + "nx-release-publish": { + "options": { + "packageRoot": "dist/{projectRoot}" + } } } } diff --git a/libs/partial-json/project.json b/libs/partial-json/project.json index 1a796319a..841eb2710 100644 --- a/libs/partial-json/project.json +++ b/libs/partial-json/project.json @@ -3,11 +3,16 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/partial-json/src", "projectType": "library", - "tags": ["scope:shared", "type:lib"], + "tags": [ + "scope:shared", + "type:lib" + ], "targets": { "build": { "executor": "@nx/js:tsc", - "outputs": ["{workspaceRoot}/dist/libs/partial-json"], + "outputs": [ + "{workspaceRoot}/dist/libs/partial-json" + ], "options": { "outputPath": "dist/libs/partial-json", "main": "libs/partial-json/src/index.ts", @@ -22,6 +27,11 @@ "options": { "configFile": "libs/partial-json/vite.config.mts" } + }, + "nx-release-publish": { + "options": { + "packageRoot": "dist/{projectRoot}" + } } } } diff --git a/libs/partial-json/tsconfig.lib.json b/libs/partial-json/tsconfig.lib.json index 643573425..6ad422f39 100644 --- a/libs/partial-json/tsconfig.lib.json +++ b/libs/partial-json/tsconfig.lib.json @@ -2,8 +2,13 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "declaration": true + "declaration": true, + "emitDeclarationOnly": false }, - "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts"] + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.spec.ts" + ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index 87dfd8e47..7383df9e0 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,6 +18,7 @@ "@ngaf/ag-ui": ["libs/ag-ui/src/public-api.ts"], "@ngaf/a2ui": ["libs/a2ui/src/index.ts"], "@ngaf/chat": ["libs/chat/src/public-api.ts"], + "@ngaf/chat/testing": ["libs/chat/testing/public-api.ts"], "@ngaf/cockpit-docs": ["libs/cockpit-docs/src/index.ts"], "@ngaf/cockpit-langgraph-streaming-python": [ "cockpit/langgraph/streaming/python/src/index.ts"