1+ [
2+ {
3+ "name" : " SignalChatResourceLike" ,
4+ "kind" : " interface" ,
5+ "description" : " Minimal structural contract required to adapt a signal-backed chat resource." ,
6+ "properties" : [
7+ {
8+ "name" : " error" ,
9+ "type" : " Signal<Error | undefined>" ,
10+ "description" : " Current resource error, if any." ,
11+ "optional" : false
12+ },
13+ {
14+ "name" : " isLoading" ,
15+ "type" : " Signal<boolean>" ,
16+ "description" : " Whether the resource is currently producing a response." ,
17+ "optional" : false
18+ },
19+ {
20+ "name" : " reload" ,
21+ "type" : " () => boolean" ,
22+ "description" : " Reload the resource, used as a fallback for `Agent.regenerate()`." ,
23+ "optional" : true
24+ },
25+ {
26+ "name" : " resendMessages" ,
27+ "type" : " () => void" ,
28+ "description" : " Re-run against the current history, if supported by the resource." ,
29+ "optional" : true
30+ },
31+ {
32+ "name" : " sendMessage" ,
33+ "type" : " (message: object) => void" ,
34+ "description" : " Send a new user message." ,
35+ "optional" : false
36+ },
37+ {
38+ "name" : " setMessages" ,
39+ "type" : " (messages: SignalChatResourceMessage[]) => void" ,
40+ "description" : " Replace resource message history. Used by `Agent.regenerate()`." ,
41+ "optional" : false
42+ },
43+ {
44+ "name" : " stop" ,
45+ "type" : " () => void" ,
46+ "description" : " Stop the current response. Called only while `isLoading()` is true." ,
47+ "optional" : false
48+ },
49+ {
50+ "name" : " value" ,
51+ "type" : " Signal<SignalChatResourceMessage[]>" ,
52+ "description" : " Current resource message history." ,
53+ "optional" : false
54+ }
55+ ],
56+ "examples" : []
57+ },
58+ {
59+ "name" : " SignalChatResourceToolCall" ,
60+ "kind" : " interface" ,
61+ "description" : " Tool-call shape exposed by a signal-backed chat resource." ,
62+ "properties" : [
63+ {
64+ "name" : " args" ,
65+ "type" : " unknown" ,
66+ "description" : " Parsed tool arguments." ,
67+ "optional" : false
68+ },
69+ {
70+ "name" : " name" ,
71+ "type" : " string" ,
72+ "description" : " Tool name shown in Threadplane tool-call UI." ,
73+ "optional" : false
74+ },
75+ {
76+ "name" : " result" ,
77+ "type" : " PromiseSettledResult<unknown>" ,
78+ "description" : " Settled tool result, when the resource exposes one." ,
79+ "optional" : true
80+ },
81+ {
82+ "name" : " status" ,
83+ "type" : " \" pending\" | \" done\" " ,
84+ "description" : " Resource-specific lifecycle state for the tool call." ,
85+ "optional" : false
86+ },
87+ {
88+ "name" : " toolCallId" ,
89+ "type" : " string" ,
90+ "description" : " Stable identifier for linking assistant messages to tool-call details." ,
91+ "optional" : false
92+ }
93+ ],
94+ "examples" : []
95+ },
96+ {
97+ "name" : " SignalChatResourceMessage" ,
98+ "kind" : " type" ,
99+ "description" : " Message shape consumed by the signal-resource adapter." ,
100+ "signature" : " object | object | object" ,
101+ "examples" : []
102+ },
103+ {
104+ "name" : " SignalResourceAgentSource" ,
105+ "kind" : " type" ,
106+ "description" : " Resource instance or factory accepted by `provideAgent()`." ,
107+ "signature" : " SignalChatResourceLike | () => SignalChatResourceLike" ,
108+ "examples" : []
109+ },
110+ {
111+ "name" : " injectAgent" ,
112+ "kind" : " function" ,
113+ "description" : " Injects the signal-resource-backed Agent registered by provideAgent()." ,
114+ "signature" : " injectAgent(): Agent<>" ,
115+ "params" : [],
116+ "returns" : {
117+ "type" : " Agent<>" ,
118+ "description" : " "
119+ },
120+ "examples" : [
121+ " ```ts\n import { injectAgent } from '@threadplane/signal-resource';\n\n const agent = injectAgent();\n ```"
122+ ]
123+ },
124+ {
125+ "name" : " provideAgent" ,
126+ "kind" : " function" ,
127+ "description" : " Provides a signal-resource-backed Agent through Angular dependency injection." ,
128+ "signature" : " provideAgent(ref: AgentRef<T>, sourceOrFactory: SignalResourceAgentSource): Provider[]" ,
129+ "params" : [
130+ {
131+ "name" : " ref" ,
132+ "type" : " AgentRef<T>" ,
133+ "description" : " " ,
134+ "optional" : false
135+ },
136+ {
137+ "name" : " sourceOrFactory" ,
138+ "type" : " SignalResourceAgentSource" ,
139+ "description" : " " ,
140+ "optional" : false
141+ }
142+ ],
143+ "returns" : {
144+ "type" : " Provider[]" ,
145+ "description" : " "
146+ },
147+ "examples" : [
148+ " ```ts\n import { provideAgent } from '@threadplane/signal-resource';\n\n bootstrapApplication(AppComponent, {\n providers: [provideAgent(() => resource)],\n });\n ```"
149+ ]
150+ },
151+ {
152+ "name" : " toAgent" ,
153+ "kind" : " function" ,
154+ "description" : " Wrap a signal-backed chat resource in the runtime-neutral Agent contract." ,
155+ "signature" : " toAgent(resource: SignalChatResourceLike): Agent<>" ,
156+ "params" : [
157+ {
158+ "name" : " resource" ,
159+ "type" : " SignalChatResourceLike" ,
160+ "description" : " " ,
161+ "optional" : false
162+ }
163+ ],
164+ "returns" : {
165+ "type" : " Agent<>" ,
166+ "description" : " "
167+ },
168+ "examples" : [
169+ " ```ts\n import { toAgent } from '@threadplane/signal-resource';\n\n const agent = toAgent(resource);\n ```"
170+ ]
171+ }
172+ ]
0 commit comments