@powerhousedao/reactor-browser 6.2.2-dev.75 → 6.2.2-dev.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attachment-service-DTFJRf5j.d.ts → attachment-service-LwpgZ358.d.ts} +4 -4
- package/dist/{attachment-service-DTFJRf5j.d.ts.map → attachment-service-LwpgZ358.d.ts.map} +1 -1
- package/dist/{client-Zz_l9QzI.js → client-B8ezRmBB.js} +1 -1
- package/dist/{client-Zz_l9QzI.js.map → client-B8ezRmBB.js.map} +1 -1
- package/dist/{client-DjkEpwu_.d.ts → client-BIHN_UyR.d.ts} +2 -2
- package/dist/{client-DjkEpwu_.d.ts.map → client-BIHN_UyR.d.ts.map} +1 -1
- package/dist/{client-DB8gP4hz.js → client-D66jVnot.js} +1 -1
- package/dist/{client-DB8gP4hz.js.map → client-D66jVnot.js.map} +1 -1
- package/dist/document-model-modules-BB9s6a3m.js +377 -0
- package/dist/document-model-modules-BB9s6a3m.js.map +1 -0
- package/dist/{document-operations-B2lxu6qg.js → document-operations-I1cGIcPg.js} +15 -378
- package/dist/document-operations-I1cGIcPg.js.map +1 -0
- package/dist/{global-pg5gy2eZ.d.ts → global-1rvI8VdA.d.ts} +4 -4
- package/dist/{global-pg5gy2eZ.d.ts.map → global-1rvI8VdA.d.ts.map} +1 -1
- package/dist/{index-BV00np9e.d.ts → index-BE3wBHLP.d.ts} +3 -3
- package/dist/index-BE3wBHLP.d.ts.map +1 -0
- package/dist/{index-CxxxP14A.d.ts → index-BIVDXw3K.d.ts} +2 -2
- package/dist/{index-CxxxP14A.d.ts.map → index-BIVDXw3K.d.ts.map} +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -45
- package/dist/index.js.map +1 -1
- package/dist/{inspector-proxy-CaCFdEG4.d.ts → inspector-proxy-6h5VKAwt.d.ts} +1 -1
- package/dist/{inspector-proxy-CaCFdEG4.d.ts.map → inspector-proxy-6h5VKAwt.d.ts.map} +1 -1
- package/dist/{pglite-CntadC_p-BtEalg1H.d.ts → pglite-CntadC_p-9NDG14dS.d.ts} +1 -1
- package/dist/{pglite-CntadC_p-BtEalg1H.d.ts.map → pglite-CntadC_p-9NDG14dS.d.ts.map} +1 -1
- package/dist/{relational-C_0GdGVN.js → relational-D4sxGPz7.js} +1 -1
- package/dist/{relational-C_0GdGVN.js.map → relational-D4sxGPz7.js.map} +1 -1
- package/dist/{renown-6w_ImTvm.js → renown-BHxwP7xU.js} +1 -1
- package/dist/{renown-6w_ImTvm.js.map → renown-BHxwP7xU.js.map} +1 -1
- package/dist/{renown-DRnlawbP.js → renown-BIEv6bSI.js} +3 -3
- package/dist/renown-BIEv6bSI.js.map +1 -0
- package/dist/selected-document-CtRlEZyi.js +42 -0
- package/dist/selected-document-CtRlEZyi.js.map +1 -0
- package/dist/src/ai/index.d.ts +267 -0
- package/dist/src/ai/index.d.ts.map +1 -0
- package/dist/src/ai/index.js +951 -0
- package/dist/src/ai/index.js.map +1 -0
- package/dist/src/analytics/index.d.ts +1 -1
- package/dist/src/analytics/index.js +1 -1
- package/dist/src/graphql/client.d.ts +2 -2
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +3 -3
- package/dist/src/graphql-client/entry.js +2 -1
- package/dist/src/relational/index.d.ts +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +1 -1
- package/dist/src/renown/index.js +2 -2
- package/dist/src/rpc/index.d.ts +2 -2
- package/dist/src/rpc/index.js +1 -1
- package/dist/{store-DAJq6vSs.js → store-BJYcr_FL.js} +1 -1
- package/dist/{store-DAJq6vSs.js.map → store-BJYcr_FL.js.map} +1 -1
- package/dist/{types-wGaiXwjh.d.ts → types-6vDzbRRS.d.ts} +1 -1
- package/dist/{types-wGaiXwjh.d.ts.map → types-6vDzbRRS.d.ts.map} +1 -1
- package/dist/{types-4rfAFZQd.d.ts → types-Dcv1ZLoW.d.ts} +1 -1
- package/dist/{types-4rfAFZQd.d.ts.map → types-Dcv1ZLoW.d.ts.map} +1 -1
- package/package.json +19 -9
- package/dist/document-operations-B2lxu6qg.js.map +0 -1
- package/dist/index-BV00np9e.d.ts.map +0 -1
- package/dist/renown-DRnlawbP.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selected-document-CtRlEZyi.js","names":[],"sources":["../src/hooks/document-of-type.ts","../src/hooks/selected-document.ts"],"sourcesContent":["import { ModuleNotFoundError } from \"@powerhousedao/reactor\";\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { DocumentTypeMismatchError } from \"../errors.js\";\nimport { useDocumentById } from \"./document-by-id.js\";\nimport { useDocumentModelModuleById } from \"./document-model-modules.js\";\n\n/** Returns a document of a specific type, throws an error if the found document has a different type */\nexport function useDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(\n documentId: string | null | undefined,\n documentType: string | null | undefined,\n) {\n const [document, dispatch] = useDocumentById(documentId);\n const documentModelModule = useDocumentModelModuleById(documentType);\n\n if (!documentId || !documentType) return [];\n\n if (!document) {\n throw new Error(`Document not found: ${documentId}`);\n }\n if (!documentModelModule) {\n throw new ModuleNotFoundError(documentType);\n }\n\n if (document.header.documentType !== documentType) {\n throw new DocumentTypeMismatchError(\n documentId,\n documentType,\n document.header.documentType,\n );\n }\n\n return [document, dispatch] as [TDocument, DocumentDispatch<TAction>];\n}\n","import type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport { isFileNode } from \"@powerhousedao/shared/document-drive\";\nimport type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { NoSelectedDocumentError } from \"../errors.js\";\nimport type { DispatchFn, UseDispatchResult } from \"./dispatch.js\";\nimport { useDocumentById } from \"./document-by-id.js\";\nimport { useDocumentOfType } from \"./document-of-type.js\";\nimport { useSelectedNode } from \"./selected-node.js\";\n\n/** Returns the selected document id */\nexport function useSelectedDocumentId(): string | undefined {\n const selectedNode = useSelectedNode();\n return selectedNode && isFileNode(selectedNode) ? selectedNode.id : undefined;\n}\n\n/** Returns the selected document. */\nexport function useSelectedDocument(): readonly [\n PHDocument,\n DispatchFn<Action>,\n] {\n const selectedDocumentId = useSelectedDocumentId();\n const [document, dispatch] = useDocumentById(selectedDocumentId);\n if (!document) {\n throw new NoSelectedDocumentError();\n }\n return [document, dispatch] as const;\n}\n\n/** Returns the selected document. */\nexport function useSelectedDocumentSafe(): UseDispatchResult<\n PHDocument,\n Action\n> {\n const selectedDocumentId = useSelectedDocumentId();\n return useDocumentById(selectedDocumentId);\n}\n\n/** Returns the selected document of a specific type, throws an error if the found document has a different type */\nexport function useSelectedDocumentOfType(\n documentType: null | undefined,\n): never[];\nexport function useSelectedDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(documentType: string): [TDocument, DocumentDispatch<TAction>];\nexport function useSelectedDocumentOfType<\n TDocument extends PHDocument,\n TAction extends Action,\n>(\n documentType: string | null | undefined,\n): never[] | [TDocument, DocumentDispatch<TAction>] {\n const documentId = useSelectedDocumentId();\n\n if (!documentType) {\n return [];\n }\n if (!documentId) {\n throw new NoSelectedDocumentError();\n }\n return useDocumentOfType<TDocument, TAction>(documentId, documentType);\n}\n"],"mappings":";;;;;;AAQA,SAAgB,kBAId,YACA,cACA;CACA,MAAM,CAAC,UAAU,YAAY,gBAAgB,WAAW;CACxD,MAAM,sBAAsB,2BAA2B,aAAa;AAEpE,KAAI,CAAC,cAAc,CAAC,aAAc,QAAO,EAAE;AAE3C,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,uBAAuB,aAAa;AAEtD,KAAI,CAAC,oBACH,OAAM,IAAI,oBAAoB,aAAa;AAG7C,KAAI,SAAS,OAAO,iBAAiB,aACnC,OAAM,IAAI,0BACR,YACA,cACA,SAAS,OAAO,aACjB;AAGH,QAAO,CAAC,UAAU,SAAS;;;;;ACzB7B,SAAgB,wBAA4C;CAC1D,MAAM,eAAe,iBAAiB;AACtC,QAAO,gBAAgB,WAAW,aAAa,GAAG,aAAa,KAAK,KAAA;;;AAItE,SAAgB,sBAGd;CAEA,MAAM,CAAC,UAAU,YAAY,gBADF,uBAAuB,CACc;AAChE,KAAI,CAAC,SACH,OAAM,IAAI,yBAAyB;AAErC,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,0BAGd;AAEA,QAAO,gBADoB,uBAAuB,CACR;;AAW5C,SAAgB,0BAId,cACkD;CAClD,MAAM,aAAa,uBAAuB;AAE1C,KAAI,CAAC,aACH,QAAO,EAAE;AAEX,KAAI,CAAC,WACH,OAAM,IAAI,yBAAyB;AAErC,QAAO,kBAAsC,YAAY,aAAa"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { ZodRawShape } from "zod";
|
|
3
|
+
import { LanguageModel, ModelMessage } from "ai";
|
|
4
|
+
|
|
5
|
+
//#region src/ai/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Browser-side AI chat over the reactor.
|
|
8
|
+
*
|
|
9
|
+
* The chat agent is tool-agnostic: consumers (e.g. Connect) pass a lazy
|
|
10
|
+
* provider of {@link AiToolDescriptor}s. The descriptors mirror the
|
|
11
|
+
* provider-agnostic tool core in `@powerhousedao/reactor-mcp/tools`, so the
|
|
12
|
+
* same tool definitions drive both the MCP server and the in-browser chat.
|
|
13
|
+
*/
|
|
14
|
+
/** User-configured LLM connection settings, persisted in localStorage. */
|
|
15
|
+
interface AiSettings {
|
|
16
|
+
/** Master on/off for the in-browser assistant. Off by default. */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/** OpenAI-compatible base URL, e.g. `https://api.openai.com/v1` */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
/** API key. Sent only to the configured endpoint, never to Powerhouse. */
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/** Model id the endpoint serves, e.g. `gpt-4o-mini`. */
|
|
23
|
+
model: string;
|
|
24
|
+
/**
|
|
25
|
+
* When false (default), write tools render an approval card and pause the
|
|
26
|
+
* agent loop until the user approves or rejects the action.
|
|
27
|
+
*/
|
|
28
|
+
autoApproveWrites: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** MCP-compatible annotation hints; structural, no MCP SDK dependency. */
|
|
31
|
+
type AiToolAnnotations = {
|
|
32
|
+
title?: string;
|
|
33
|
+
readOnlyHint?: boolean;
|
|
34
|
+
destructiveHint?: boolean;
|
|
35
|
+
idempotentHint?: boolean;
|
|
36
|
+
openWorldHint?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Provider-agnostic tool descriptor accepted by the chat agent.
|
|
40
|
+
*
|
|
41
|
+
* Structurally compatible with the MCP tool records produced by
|
|
42
|
+
* `createReactorMcpProvider`: the callback parameter is `never` so any
|
|
43
|
+
* per-tool-args function type is assignable, and the result is `unknown`
|
|
44
|
+
* because the envelope shape (MCP `CallToolResult`) is unwrapped at the
|
|
45
|
+
* adapter boundary.
|
|
46
|
+
*/
|
|
47
|
+
type AiToolDescriptor = {
|
|
48
|
+
name: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
inputSchema: ZodRawShape;
|
|
51
|
+
annotations?: AiToolAnnotations;
|
|
52
|
+
callback: (args: never) => Promise<unknown>;
|
|
53
|
+
};
|
|
54
|
+
/** Tool descriptors the app resolves when the user sends a message. */
|
|
55
|
+
type AiToolsProvider = () => Promise<AiToolDescriptor[]>;
|
|
56
|
+
/** Tool names whose execution mutates the reactor and requires approval. */
|
|
57
|
+
declare const WRITE_TOOLS: ReadonlySet<string>;
|
|
58
|
+
declare function isWriteTool(name: string): boolean;
|
|
59
|
+
type ToolCallState = "awaiting-approval" | "executing" | "done" | "error" | "rejected";
|
|
60
|
+
/** One rendered unit inside a chat message. */
|
|
61
|
+
type ChatPart = {
|
|
62
|
+
type: "text";
|
|
63
|
+
text: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: "tool";
|
|
66
|
+
toolCallId: string;
|
|
67
|
+
name: string;
|
|
68
|
+
args: unknown;
|
|
69
|
+
state: ToolCallState;
|
|
70
|
+
result?: unknown;
|
|
71
|
+
error?: string;
|
|
72
|
+
};
|
|
73
|
+
interface ChatMessage {
|
|
74
|
+
id: string;
|
|
75
|
+
role: "user" | "assistant";
|
|
76
|
+
parts: ChatPart[];
|
|
77
|
+
}
|
|
78
|
+
/** A write tool call the user must approve or reject. */
|
|
79
|
+
interface PendingApproval {
|
|
80
|
+
toolCallId: string;
|
|
81
|
+
name: string;
|
|
82
|
+
args: unknown;
|
|
83
|
+
}
|
|
84
|
+
/** Context snapshot injected into the agent system prompt. */
|
|
85
|
+
interface ChatContext {
|
|
86
|
+
driveId?: string;
|
|
87
|
+
driveName?: string;
|
|
88
|
+
nodeId?: string;
|
|
89
|
+
nodeName?: string;
|
|
90
|
+
nodeKind?: "file" | "folder";
|
|
91
|
+
documentType?: string;
|
|
92
|
+
documentName?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Events the agent emits while running a turn. */
|
|
95
|
+
type AgentEvent = {
|
|
96
|
+
type: "text-delta";
|
|
97
|
+
delta: string;
|
|
98
|
+
} | {
|
|
99
|
+
type: "tool-start";
|
|
100
|
+
toolCallId: string;
|
|
101
|
+
name: string;
|
|
102
|
+
args: unknown;
|
|
103
|
+
} | {
|
|
104
|
+
type: "approval-request";
|
|
105
|
+
toolCallId: string;
|
|
106
|
+
name: string;
|
|
107
|
+
args: unknown;
|
|
108
|
+
} | {
|
|
109
|
+
type: "approval-resolved";
|
|
110
|
+
toolCallId: string;
|
|
111
|
+
approved: boolean;
|
|
112
|
+
} | {
|
|
113
|
+
type: "tool-result";
|
|
114
|
+
toolCallId: string;
|
|
115
|
+
name: string;
|
|
116
|
+
state: "done" | "error" | "rejected";
|
|
117
|
+
result?: unknown;
|
|
118
|
+
error?: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: "finish";
|
|
121
|
+
} | {
|
|
122
|
+
type: "error";
|
|
123
|
+
error: string;
|
|
124
|
+
};
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/ai/agent.d.ts
|
|
127
|
+
/** Hard cap on model round-trips per user message (each tool step counts). */
|
|
128
|
+
declare const MAX_AGENT_STEPS = 10;
|
|
129
|
+
declare function createReactorChatModel(settings: AiSettings): LanguageModel;
|
|
130
|
+
/**
|
|
131
|
+
* Unwraps the MCP `CallToolResult` envelope produced by the reactor tool
|
|
132
|
+
* core into a plain value for the AI SDK. Throws for error results so the
|
|
133
|
+
* SDK surfaces them as tool errors in the next model step.
|
|
134
|
+
*/
|
|
135
|
+
declare function unwrapToolResult(raw: unknown): unknown;
|
|
136
|
+
/** Builds the system prompt, grounding the agent in the current selection. */
|
|
137
|
+
declare function buildSystemPrompt(context: ChatContext): string;
|
|
138
|
+
interface ReactorChatAgentOptions {
|
|
139
|
+
settings: AiSettings;
|
|
140
|
+
tools: AiToolDescriptor[];
|
|
141
|
+
context: ChatContext;
|
|
142
|
+
onEvent: (event: AgentEvent) => void;
|
|
143
|
+
signal?: AbortSignal;
|
|
144
|
+
/** Test seam: override the model (e.g. a mock language model). */
|
|
145
|
+
model?: LanguageModel;
|
|
146
|
+
/** Prior conversation to continue (see {@link ReactorChatAgent.getHistory}). */
|
|
147
|
+
history?: ModelMessage[];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Runs one tool-loop conversation turn against an OpenAI-compatible model.
|
|
151
|
+
*
|
|
152
|
+
* The agent keeps the model message history across turns. Write tools are
|
|
153
|
+
* gated by the AI SDK's tool approval: when auto-approval is off, the
|
|
154
|
+
* pending user decision is bridged through {@link approve}/{@link reject}.
|
|
155
|
+
*/
|
|
156
|
+
declare class ReactorChatAgent {
|
|
157
|
+
private readonly options;
|
|
158
|
+
private history;
|
|
159
|
+
private approvals;
|
|
160
|
+
constructor(options: ReactorChatAgentOptions);
|
|
161
|
+
/** The model history after the last completed turn, for the next agent. */
|
|
162
|
+
getHistory(): ModelMessage[];
|
|
163
|
+
/** Clears the conversation history (a fresh chat). */
|
|
164
|
+
reset(): void;
|
|
165
|
+
/** Approves a pending write tool call, resuming the agent loop. */
|
|
166
|
+
approve(toolCallId: string): void;
|
|
167
|
+
/** Rejects a pending write tool call; the rejection is fed to the model. */
|
|
168
|
+
reject(toolCallId: string): void;
|
|
169
|
+
private resolveApproval;
|
|
170
|
+
private cancelPendingApprovals;
|
|
171
|
+
/** Runs one user turn: appends the message, streams the model, commits history. */
|
|
172
|
+
send(text: string): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Removes tool calls that were never executed (step cap or abort):
|
|
175
|
+
* OpenAI-compatible APIs reject a tool call without its tool result.
|
|
176
|
+
*/
|
|
177
|
+
private dropUnresolvedToolCalls;
|
|
178
|
+
private handleStreamPart;
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/ai/components/approval-card.d.ts
|
|
182
|
+
/**
|
|
183
|
+
* In-chat approval card for a write tool call. Approving or rejecting
|
|
184
|
+
* resolves the pending approval inside the agent loop.
|
|
185
|
+
*/
|
|
186
|
+
declare function ApprovalCard({
|
|
187
|
+
approval,
|
|
188
|
+
onApprove,
|
|
189
|
+
onReject
|
|
190
|
+
}: {
|
|
191
|
+
approval: PendingApproval;
|
|
192
|
+
onApprove: (toolCallId: string) => void;
|
|
193
|
+
onReject: (toolCallId: string) => void;
|
|
194
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/ai/use-reactor-chat.d.ts
|
|
197
|
+
interface UseReactorChatResult {
|
|
198
|
+
messages: ChatMessage[];
|
|
199
|
+
isStreaming: boolean;
|
|
200
|
+
pendingApprovals: PendingApproval[];
|
|
201
|
+
error: string | null;
|
|
202
|
+
settings: AiSettings;
|
|
203
|
+
configured: boolean;
|
|
204
|
+
send: (text: string) => void;
|
|
205
|
+
stop: () => void;
|
|
206
|
+
approve: (toolCallId: string) => void;
|
|
207
|
+
reject: (toolCallId: string) => void;
|
|
208
|
+
clear: () => void;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Drives one in-browser chat conversation against the reactor tools.
|
|
212
|
+
*
|
|
213
|
+
* `toolsProvider` lazily resolves the tool descriptors (e.g. from
|
|
214
|
+
* `createReactorMcpProvider` bound to `window.ph.reactorClient`) when the
|
|
215
|
+
* user sends a message, so the reactor does not need to be ready at render
|
|
216
|
+
* time.
|
|
217
|
+
*/
|
|
218
|
+
declare function useReactorChat(toolsProvider?: AiToolsProvider): UseReactorChatResult;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/ai/components/chat-window.d.ts
|
|
221
|
+
/** The chat window panel, anchored above the FAB in the bottom-right. */
|
|
222
|
+
declare function ChatWindow({
|
|
223
|
+
chat,
|
|
224
|
+
onClose
|
|
225
|
+
}: {
|
|
226
|
+
chat: UseReactorChatResult;
|
|
227
|
+
onClose: () => void;
|
|
228
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/ai/components/reactor-chat-fab.d.ts
|
|
231
|
+
/**
|
|
232
|
+
* Bottom-right floating action button that opens the reactor AI chat window.
|
|
233
|
+
*
|
|
234
|
+
* `getTools` lazily resolves the reactor tool descriptors (from
|
|
235
|
+
* `createReactorMcpProvider` bound to the browser reactor client) when the
|
|
236
|
+
* user sends a message.
|
|
237
|
+
*/
|
|
238
|
+
declare function ReactorChatFab({
|
|
239
|
+
getTools
|
|
240
|
+
}: {
|
|
241
|
+
getTools?: AiToolsProvider;
|
|
242
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/ai/context.d.ts
|
|
245
|
+
/**
|
|
246
|
+
* Snapshot of the current selection in the drive explorer, used to make the
|
|
247
|
+
* chat context-aware: "create a budget here" targets the selected drive,
|
|
248
|
+
* "summarize this document" targets the selected document.
|
|
249
|
+
*/
|
|
250
|
+
declare function useChatContext(): ChatContext;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/ai/settings-store.d.ts
|
|
253
|
+
declare const DEFAULT_AI_SETTINGS: AiSettings;
|
|
254
|
+
type Listener = () => void;
|
|
255
|
+
/** Returns the current settings (stable snapshot for useSyncExternalStore). */
|
|
256
|
+
declare function getAiSettings(): AiSettings;
|
|
257
|
+
/** Merges a partial update, persists, and notifies subscribers. */
|
|
258
|
+
declare function updateAiSettings(patch: Partial<AiSettings>): AiSettings;
|
|
259
|
+
/** Clears all stored settings. */
|
|
260
|
+
declare function clearAiSettings(): void;
|
|
261
|
+
/** Subscribes to settings changes. Returns the unsubscribe function. */
|
|
262
|
+
declare function subscribeAiSettings(listener: Listener): () => void;
|
|
263
|
+
/** True when the endpoint, key and model are all configured. */
|
|
264
|
+
declare function isAiConfigured(settings: AiSettings): boolean;
|
|
265
|
+
//#endregion
|
|
266
|
+
export { AgentEvent, AiSettings, AiToolAnnotations, AiToolDescriptor, AiToolsProvider, ApprovalCard, ChatContext, ChatMessage, ChatPart, ChatWindow, DEFAULT_AI_SETTINGS, MAX_AGENT_STEPS, PendingApproval, ReactorChatAgent, ReactorChatAgentOptions, ReactorChatFab, ToolCallState, UseReactorChatResult, WRITE_TOOLS, buildSystemPrompt, clearAiSettings, createReactorChatModel, getAiSettings, isAiConfigured, isWriteTool, subscribeAiSettings, unwrapToolResult, updateAiSettings, useChatContext, useReactorChat };
|
|
267
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/ai/types.ts","../../../src/ai/agent.ts","../../../src/ai/components/approval-card.tsx","../../../src/ai/use-reactor-chat.ts","../../../src/ai/components/chat-window.tsx","../../../src/ai/components/reactor-chat-fab.tsx","../../../src/ai/context.ts","../../../src/ai/settings-store.ts"],"mappings":";;;;;;;;;AAYA;;;;;UAAiB,UAAA;EAMf;EAJA,OAAA;EAWA;EATA,OAAA;EASiB;EAPj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