|
457 | 457 | }, |
458 | 458 | { |
459 | 459 | "name": "state", |
460 | | - "type": "Signal<Record<string, unknown>>", |
| 460 | + "type": "Signal<TState>", |
461 | 461 | "description": "", |
462 | 462 | "optional": false |
463 | 463 | }, |
|
556 | 556 | { |
557 | 557 | "name": "injectAgent", |
558 | 558 | "kind": "function", |
559 | | - "description": "Injects the AG-UI agent from Angular's dependency injection container.\nUse this in components or services provided via `provideAgent()` (or\n`provideFakeAgent()`).\n\nReturns an `AgUiAgent` — the runtime-neutral `Agent` contract plus the\nAG-UI-specific `customEvents` signal — so `customEvents` is reachable\ndirectly, without casting.", |
560 | | - "signature": "injectAgent(): AgUiAgent", |
| 559 | + "description": "Injects the AG-UI agent from Angular's dependency injection container.\nUse this in components or services provided via `provideAgent()` (or\n`provideFakeAgent()`).\n\nReturns an `AgUiAgent` — the runtime-neutral `Agent` contract plus the\nAG-UI-specific `customEvents` signal — so `customEvents` is reachable\ndirectly, without casting.\n\n**Typed state via AgentRef.** Pass the same ref that was supplied to\n`provideAgent(ref, …)` to carry the state type through DI without repeating\nthe generic at every call site:\n\n```ts\nconst agent = injectAgent(TRIP); // AgUiAgent<TripState>\n```\n\nThe no-arg form defaults to `AgUiAgent<Record<string, unknown>>`.", |
| 560 | + "signature": "injectAgent(): AgUiAgent<>", |
561 | 561 | "params": [], |
562 | 562 | "returns": { |
563 | | - "type": "AgUiAgent", |
| 563 | + "type": "AgUiAgent<>", |
564 | 564 | "description": "" |
565 | 565 | }, |
566 | 566 | "examples": [] |
567 | 567 | }, |
568 | 568 | { |
569 | 569 | "name": "provideAgent", |
570 | 570 | "kind": "function", |
571 | | - "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().\n\n**Static vs factory config.** Pass a plain `AgentConfig` object when the\nconfig is known up front. Pass a `() => AgentConfig` factory when the config\ndepends on runtime/DI state — the factory runs inside an Angular injection\ncontext, so it may call `inject()` to read services or route params.", |
572 | | - "signature": "provideAgent(configOrFactory: AgentConfig | () => AgentConfig): Provider[]", |
| 571 | + "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().\n\n**Static vs factory config.** Pass a plain `AgentConfig` object when the\nconfig is known up front. Pass a `() => AgentConfig` factory when the config\ndepends on runtime/DI state — the factory runs inside an Angular injection\ncontext, so it may call `inject()` to read services or route params.\n\n**Typed state via AgentRef.** Pass a typed ref as the first argument to flow\nthe state shape from `provideAgent` to `injectAgent` without repeating the\ngeneric at every call site:\n\n```ts\ninterface TripState { day: number; places: string[]; }\nexport const TRIP = createAgentRef<TripState>('trip');\n// app.config.ts:\nproviders: [provideAgent(TRIP, { url: 'http://localhost:8000/agent' })]\n// component:\nconst agent = injectAgent(TRIP); // AgUiAgent<TripState>\n```", |
| 572 | + "signature": "provideAgent(ref: AgentRef<T>, configOrFactory: AgentConfig | () => AgentConfig): Provider[]", |
573 | 573 | "params": [ |
| 574 | + { |
| 575 | + "name": "ref", |
| 576 | + "type": "AgentRef<T>", |
| 577 | + "description": "", |
| 578 | + "optional": false |
| 579 | + }, |
574 | 580 | { |
575 | 581 | "name": "configOrFactory", |
576 | 582 | "type": "AgentConfig | () => AgentConfig", |
|
607 | 613 | "name": "toAgent", |
608 | 614 | "kind": "function", |
609 | 615 | "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.", |
610 | | - "signature": "toAgent(source: AbstractAgent<>, options: ToAgentOptions): AgUiAgent", |
| 616 | + "signature": "toAgent(source: AbstractAgent<>, options: ToAgentOptions): AgUiAgent<>", |
611 | 617 | "params": [ |
612 | 618 | { |
613 | 619 | "name": "source", |
|
623 | 629 | } |
624 | 630 | ], |
625 | 631 | "returns": { |
626 | | - "type": "AgUiAgent", |
| 632 | + "type": "AgUiAgent<>", |
627 | 633 | "description": "" |
628 | 634 | }, |
629 | 635 | "examples": [] |
|
0 commit comments