@baseera/react 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +456 -2
- package/dist/index.cjs +812 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +283 -0
- package/dist/index.d.ts +283 -0
- package/dist/index.js +766 -0
- package/dist/index.js.map +1 -0
- package/package.json +81 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
BaseeraProvider: () => BaseeraProvider,
|
|
25
|
+
BaseeraRejection: () => import_core6.BaseeraRejection,
|
|
26
|
+
CHECK_FAILED_MESSAGE: () => import_core6.CHECK_FAILED_MESSAGE,
|
|
27
|
+
FEEDBACK_REASON_MAX: () => import_core7.FEEDBACK_REASON_MAX,
|
|
28
|
+
FOCUS_FIELD_TOOL: () => FOCUS_FIELD_TOOL,
|
|
29
|
+
PREFILL_DRAFT_TOOL: () => PREFILL_DRAFT_TOOL,
|
|
30
|
+
PROTOCOL_VERSION: () => import_core7.PROTOCOL_VERSION,
|
|
31
|
+
firstControl: () => firstControl,
|
|
32
|
+
useBaseeraAgentTheme: () => useBaseeraAgentTheme,
|
|
33
|
+
useBaseeraApprovals: () => useBaseeraApprovals,
|
|
34
|
+
useBaseeraChat: () => useBaseeraChat,
|
|
35
|
+
useBaseeraContext: () => useBaseeraContext,
|
|
36
|
+
useBaseeraFeedback: () => useBaseeraFeedback,
|
|
37
|
+
useBaseeraField: () => useBaseeraField,
|
|
38
|
+
useBaseeraImmersive: () => useBaseeraImmersive,
|
|
39
|
+
useBaseeraImmersiveState: () => useBaseeraImmersiveState,
|
|
40
|
+
useBaseeraKnowledgeUpload: () => useBaseeraKnowledgeUpload,
|
|
41
|
+
useBaseeraSignal: () => useBaseeraSignal,
|
|
42
|
+
useBaseeraTheme: () => useBaseeraTheme,
|
|
43
|
+
useBaseeraTool: () => useBaseeraTool,
|
|
44
|
+
useBaseeraToolDefinition: () => useBaseeraToolDefinition
|
|
45
|
+
});
|
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
|
47
|
+
|
|
48
|
+
// src/provider.tsx
|
|
49
|
+
var import_core3 = require("@baseera/core");
|
|
50
|
+
|
|
51
|
+
// src/page-context.ts
|
|
52
|
+
var import_core = require("@baseera/core");
|
|
53
|
+
var MAX_TEXT = 200;
|
|
54
|
+
function isProduction() {
|
|
55
|
+
try {
|
|
56
|
+
return process.env.NODE_ENV === "production";
|
|
57
|
+
} catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function merge(layers) {
|
|
62
|
+
const out = {};
|
|
63
|
+
for (const layer of layers) {
|
|
64
|
+
if (!layer) continue;
|
|
65
|
+
if (layer.page !== void 0) out.page = layer.page;
|
|
66
|
+
if (layer.entity !== void 0) out.entity = layer.entity;
|
|
67
|
+
if (layer.data !== void 0) out.data = { ...out.data, ...layer.data };
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
var byteLength = (text) => new TextEncoder().encode(text).length;
|
|
72
|
+
function createContextStore() {
|
|
73
|
+
const entries = /* @__PURE__ */ new Map();
|
|
74
|
+
let nextOrder = 0;
|
|
75
|
+
const warned = /* @__PURE__ */ new Set();
|
|
76
|
+
const warnOnce = (key, message) => {
|
|
77
|
+
if (isProduction() || warned.has(key)) return;
|
|
78
|
+
warned.add(key);
|
|
79
|
+
console.warn(message);
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
claim: () => ({ order: nextOrder++ }),
|
|
83
|
+
set: (id, input) => void entries.set(id, input),
|
|
84
|
+
remove: (id) => void entries.delete(id),
|
|
85
|
+
resolve(override) {
|
|
86
|
+
const merged = merge([...[...entries].sort((a, b) => a[0].order - b[0].order).map(([, v]) => v), override]);
|
|
87
|
+
const out = {};
|
|
88
|
+
if (merged.page !== void 0) out.page = merged.page.slice(0, MAX_TEXT);
|
|
89
|
+
if (merged.entity !== void 0) {
|
|
90
|
+
const { type, ref, title } = merged.entity;
|
|
91
|
+
out.entity = {
|
|
92
|
+
type: type.slice(0, MAX_TEXT),
|
|
93
|
+
ref: ref.slice(0, MAX_TEXT),
|
|
94
|
+
...title !== void 0 ? { title: title.slice(0, MAX_TEXT) } : {}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (merged.data !== void 0) {
|
|
98
|
+
let size = null;
|
|
99
|
+
try {
|
|
100
|
+
size = byteLength(JSON.stringify(merged.data));
|
|
101
|
+
} catch {
|
|
102
|
+
warnOnce("unserializable", "[baseera] Context data could not be serialized to JSON, so it was left out of the turn.");
|
|
103
|
+
}
|
|
104
|
+
if (size !== null && size <= import_core.LIMITS.contextDataBytes) out.data = merged.data;
|
|
105
|
+
else if (size !== null) {
|
|
106
|
+
warnOnce(
|
|
107
|
+
`size:${size}`,
|
|
108
|
+
`[baseera] Context data is ${size} bytes serialized, over the ${import_core.LIMITS.contextDataBytes} byte limit, so it was left out of the turn. Send less in \`data\`.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/provider.tsx
|
|
118
|
+
var import_react = require("react");
|
|
119
|
+
|
|
120
|
+
// src/ui-tools.ts
|
|
121
|
+
var import_core2 = require("@baseera/core");
|
|
122
|
+
var FOCUS_FIELD_TOOL = "ui.focusField";
|
|
123
|
+
var PREFILL_DRAFT_TOOL = "ui.prefillDraft";
|
|
124
|
+
var MAX_REASON = 500;
|
|
125
|
+
var NOT_ON_SCREEN = "That field isn't on the screen";
|
|
126
|
+
var DRAFT_CANCELLED_REASON = "the request was cancelled";
|
|
127
|
+
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
128
|
+
function readField(input) {
|
|
129
|
+
if (!isRecord(input)) return { ok: false, error: "input must be an object." };
|
|
130
|
+
const { field } = input;
|
|
131
|
+
if (typeof field !== "string" || field === "" || field.length > import_core2.LIMITS.immersiveIdChars) return { ok: false, error: "`field` must be the name of a field." };
|
|
132
|
+
return { ok: true, field, rest: input };
|
|
133
|
+
}
|
|
134
|
+
function createUiTools(immersive) {
|
|
135
|
+
const focusField = {
|
|
136
|
+
spec: {
|
|
137
|
+
name: FOCUS_FIELD_TOOL,
|
|
138
|
+
kind: "read",
|
|
139
|
+
description: "Points the user at one field of the record they have open: scrolls it into view, moves the cursor into it and highlights it for a moment. Use it when your answer is about a field, so the user sees which one. It changes nothing in the record.",
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: { field: { type: "string", description: "The name of a field, as listed in the record." } },
|
|
143
|
+
required: ["field"],
|
|
144
|
+
additionalProperties: false
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
validate(input) {
|
|
148
|
+
const read = readField(input);
|
|
149
|
+
return read.ok ? { ok: true, value: { field: read.field } } : read;
|
|
150
|
+
},
|
|
151
|
+
run(input) {
|
|
152
|
+
const { field } = input;
|
|
153
|
+
if (immersive.focusField(field) === "not_bound") throw new Error(NOT_ON_SCREEN);
|
|
154
|
+
return { ok: true };
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const prefillDraft = {
|
|
158
|
+
spec: {
|
|
159
|
+
name: PREFILL_DRAFT_TOOL,
|
|
160
|
+
kind: "draft",
|
|
161
|
+
description: "Proposes a value for one field of the record the user has open. It appears next to the field, marked as a Baseera draft, with Approve and Reject buttons. Nothing is written until the user approves; the result tells you whether they approved, or rejected and why. Use it for a field that is empty or wrong when you know the right value, and say where it came from in `reason`. Do not propose again for a field the user rejected unless they ask.",
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
field: { type: "string", description: "The name of a field, as listed in the record." },
|
|
166
|
+
value: { description: `The proposed value as JSON (text, number, boolean, null, ...), at most ${import_core2.LIMITS.immersiveFieldValueBytes / 1024} KB serialized. Match the field's kind.` },
|
|
167
|
+
reason: { type: "string", maxLength: MAX_REASON, description: "One short sentence for the user: where the value comes from." }
|
|
168
|
+
},
|
|
169
|
+
required: ["field", "value"],
|
|
170
|
+
additionalProperties: false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
inlineApproval: true,
|
|
174
|
+
validate(input) {
|
|
175
|
+
const read = readField(input);
|
|
176
|
+
if (!read.ok) return read;
|
|
177
|
+
const { field, rest } = read;
|
|
178
|
+
const snap = immersive.getSnapshot();
|
|
179
|
+
if (!snap.fieldNames.includes(field)) return { ok: false, error: `"${field}" is not a field of this record.` };
|
|
180
|
+
if (!snap.boundFields.includes(field)) return { ok: false, error: NOT_ON_SCREEN + "." };
|
|
181
|
+
let json;
|
|
182
|
+
try {
|
|
183
|
+
json = JSON.stringify(rest.value);
|
|
184
|
+
} catch {
|
|
185
|
+
json = void 0;
|
|
186
|
+
}
|
|
187
|
+
if (json === void 0) return { ok: false, error: "`value` must be JSON." };
|
|
188
|
+
const bytes = new TextEncoder().encode(json).length;
|
|
189
|
+
if (bytes > import_core2.LIMITS.immersiveFieldValueBytes) return { ok: false, error: `\`value\` is ${bytes} bytes; the limit is ${import_core2.LIMITS.immersiveFieldValueBytes}.` };
|
|
190
|
+
const { reason } = rest;
|
|
191
|
+
if (reason !== void 0 && typeof reason !== "string") return { ok: false, error: "`reason` must be text." };
|
|
192
|
+
return { ok: true, value: { field, value: JSON.parse(json), ...reason ? { reason: reason.trim().slice(0, MAX_REASON) } : {} } };
|
|
193
|
+
},
|
|
194
|
+
describe: (input) => `Draft a value for ${input.field}`,
|
|
195
|
+
async run(input, context) {
|
|
196
|
+
const { field, value, reason } = input;
|
|
197
|
+
const decision = immersive.proposeDraft({ field, value, ...reason ? { reason } : {}, source: "model" });
|
|
198
|
+
const mine = immersive.getSnapshot().pendingDrafts.find((d) => d.field === field);
|
|
199
|
+
context?.signal.addEventListener(
|
|
200
|
+
"abort",
|
|
201
|
+
() => {
|
|
202
|
+
if (immersive.getSnapshot().pendingDrafts.find((d) => d.field === field) === mine) immersive.resolveDraft(field, { approved: false, reason: DRAFT_CANCELLED_REASON });
|
|
203
|
+
},
|
|
204
|
+
{ once: true }
|
|
205
|
+
);
|
|
206
|
+
const result = await decision;
|
|
207
|
+
if (!result.approved) throw new import_core2.BaseeraRejection(result.reason);
|
|
208
|
+
return { ok: true, field, written: true };
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return [focusField, prefillDraft];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// src/provider.tsx
|
|
215
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
216
|
+
var BaseeraContext = (0, import_react.createContext)(null);
|
|
217
|
+
function useBaseeraInternals() {
|
|
218
|
+
const value = (0, import_react.useContext)(BaseeraContext);
|
|
219
|
+
if (!value) throw new Error("useBaseeraChat and useBaseeraTool must be used inside <BaseeraProvider>.");
|
|
220
|
+
return value;
|
|
221
|
+
}
|
|
222
|
+
function useBaseeraTheme() {
|
|
223
|
+
return useBaseeraInternals().theme;
|
|
224
|
+
}
|
|
225
|
+
function useBaseeraAgentTheme() {
|
|
226
|
+
return useBaseeraInternals().agentLook;
|
|
227
|
+
}
|
|
228
|
+
function createToolRegistry() {
|
|
229
|
+
const stacks = /* @__PURE__ */ new Map();
|
|
230
|
+
return {
|
|
231
|
+
register(tool) {
|
|
232
|
+
const name = tool.spec.name;
|
|
233
|
+
const stack = stacks.get(name) ?? [];
|
|
234
|
+
if (stack.length > 0) console.warn(`[baseera] Tool "${name}" is registered more than once. The latest registration wins.`);
|
|
235
|
+
stack.push(tool);
|
|
236
|
+
stacks.set(name, stack);
|
|
237
|
+
return () => {
|
|
238
|
+
const current = stacks.get(name);
|
|
239
|
+
if (!current) return;
|
|
240
|
+
const index = current.lastIndexOf(tool);
|
|
241
|
+
if (index === -1) return;
|
|
242
|
+
current.splice(index, 1);
|
|
243
|
+
if (current.length === 0) stacks.delete(name);
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
list: () => [...stacks.values()].map((stack) => stack[stack.length - 1])
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
var sessionStorageSafe = {
|
|
250
|
+
get(key) {
|
|
251
|
+
try {
|
|
252
|
+
return window.sessionStorage.getItem(key);
|
|
253
|
+
} catch {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
set(key, value) {
|
|
258
|
+
try {
|
|
259
|
+
window.sessionStorage.setItem(key, value);
|
|
260
|
+
} catch {
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
remove(key) {
|
|
264
|
+
try {
|
|
265
|
+
window.sessionStorage.removeItem(key);
|
|
266
|
+
} catch {
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
function BuiltInUiTools() {
|
|
271
|
+
const { immersive, registry } = useBaseeraInternals();
|
|
272
|
+
const snap = (0, import_react.useSyncExternalStore)(immersive.subscribe, immersive.getSnapshot, immersive.getSnapshot);
|
|
273
|
+
const enabled = snap.active && snap.boundFields.length > 0;
|
|
274
|
+
(0, import_react.useEffect)(() => {
|
|
275
|
+
if (!enabled) return;
|
|
276
|
+
const offs = createUiTools(immersive).map((tool) => registry.register(tool));
|
|
277
|
+
return () => {
|
|
278
|
+
for (const off of offs) off();
|
|
279
|
+
};
|
|
280
|
+
}, [enabled, immersive, registry]);
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
function BaseeraProvider(props) {
|
|
284
|
+
const { publishableKey, baseUrl, theme, children } = props;
|
|
285
|
+
const getUserTokenRef = (0, import_react.useRef)(props.getUserToken);
|
|
286
|
+
getUserTokenRef.current = props.getUserToken;
|
|
287
|
+
const onErrorRef = (0, import_react.useRef)(props.onError);
|
|
288
|
+
onErrorRef.current = props.onError;
|
|
289
|
+
const [core] = (0, import_react.useState)(() => {
|
|
290
|
+
const registry = createToolRegistry();
|
|
291
|
+
const make = props.createClient ?? import_core3.createBaseeraClient;
|
|
292
|
+
const client = make({
|
|
293
|
+
publishableKey,
|
|
294
|
+
baseUrl,
|
|
295
|
+
...props.getUserToken ? { getUserToken: () => getUserTokenRef.current() } : {}
|
|
296
|
+
});
|
|
297
|
+
const contextStore = createContextStore();
|
|
298
|
+
const immersiveSlot = { owner: null, nextOrder: 0 };
|
|
299
|
+
let base;
|
|
300
|
+
const trail = (0, import_core3.createTrailBatcher)({
|
|
301
|
+
ensureSession: () => base.ensureSession(),
|
|
302
|
+
currentSessionId: () => base.getSnapshot().sessionId,
|
|
303
|
+
send: (sessionId, events, options) => client.appendImmersiveEvents(sessionId, events, options)
|
|
304
|
+
});
|
|
305
|
+
const immersive = (0, import_core3.createImmersiveController)({
|
|
306
|
+
recordFinish: async (request) => client.recordFinish(await base.ensureSession(), request),
|
|
307
|
+
// AI checks (GNA-82) run against the same session, starting one if needed.
|
|
308
|
+
runAiChecks: async (wire) => client.runAiChecks(await base.ensureSession(), wire),
|
|
309
|
+
trail
|
|
310
|
+
});
|
|
311
|
+
base = (0, import_core3.createChatController)({
|
|
312
|
+
client,
|
|
313
|
+
getTools: registry.list,
|
|
314
|
+
storage: sessionStorageSafe,
|
|
315
|
+
publishableKey,
|
|
316
|
+
getContext: () => contextStore.resolve(),
|
|
317
|
+
getImmersive: () => immersive.toWire(),
|
|
318
|
+
onImmersiveEvent: (event) => immersive.handleEvent(event),
|
|
319
|
+
onError: (error) => onErrorRef.current?.(error)
|
|
320
|
+
});
|
|
321
|
+
const controller = {
|
|
322
|
+
...base,
|
|
323
|
+
send: (text, options) => base.send(text, { context: contextStore.resolve(options?.context) })
|
|
324
|
+
};
|
|
325
|
+
return { registry, client, contextStore, controller, immersive, immersiveSlot };
|
|
326
|
+
});
|
|
327
|
+
(0, import_react.useEffect)(() => {
|
|
328
|
+
void core.controller.hydrate();
|
|
329
|
+
}, [core]);
|
|
330
|
+
const [agentTheme, setAgentTheme] = (0, import_react.useState)(null);
|
|
331
|
+
const [logoUrl, setLogoUrl] = (0, import_react.useState)(null);
|
|
332
|
+
(0, import_react.useEffect)(() => {
|
|
333
|
+
let cancelled = false;
|
|
334
|
+
let objectUrl = null;
|
|
335
|
+
void (async () => {
|
|
336
|
+
try {
|
|
337
|
+
const published = await core.client.getTheme?.() ?? null;
|
|
338
|
+
if (cancelled) return;
|
|
339
|
+
setAgentTheme(published);
|
|
340
|
+
if (published?.logo && typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
|
|
341
|
+
const blob = await core.client.getLogo?.(published.logo);
|
|
342
|
+
if (!blob) return;
|
|
343
|
+
if (cancelled) return;
|
|
344
|
+
objectUrl = URL.createObjectURL(blob);
|
|
345
|
+
setLogoUrl(objectUrl);
|
|
346
|
+
}
|
|
347
|
+
} catch {
|
|
348
|
+
}
|
|
349
|
+
})();
|
|
350
|
+
return () => {
|
|
351
|
+
cancelled = true;
|
|
352
|
+
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
353
|
+
};
|
|
354
|
+
}, [core]);
|
|
355
|
+
const agentLook = (0, import_react.useMemo)(() => ({ theme: agentTheme, logoUrl }), [agentTheme, logoUrl]);
|
|
356
|
+
const value = (0, import_react.useMemo)(() => ({ ...core, theme, agentLook, connection: { publishableKey, baseUrl } }), [core, theme, agentLook, publishableKey, baseUrl]);
|
|
357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(BaseeraContext.Provider, { value, children: [
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BuiltInUiTools, {}),
|
|
359
|
+
children
|
|
360
|
+
] });
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// src/use-chat.ts
|
|
364
|
+
var import_react2 = require("react");
|
|
365
|
+
var SERVER_STATE = { sessionId: null, messages: [], status: "idle", error: null, pendingApprovals: [] };
|
|
366
|
+
var getServerSnapshot = () => SERVER_STATE;
|
|
367
|
+
function useBaseeraChat() {
|
|
368
|
+
const { controller, client } = useBaseeraInternals();
|
|
369
|
+
const state = (0, import_react2.useSyncExternalStore)(controller.subscribe, controller.getSnapshot, getServerSnapshot);
|
|
370
|
+
return (0, import_react2.useMemo)(
|
|
371
|
+
() => ({
|
|
372
|
+
messages: state.messages,
|
|
373
|
+
status: state.status,
|
|
374
|
+
error: state.error,
|
|
375
|
+
pendingApprovals: state.pendingApprovals,
|
|
376
|
+
send: controller.send,
|
|
377
|
+
stop: controller.stop,
|
|
378
|
+
reset: controller.reset,
|
|
379
|
+
approve: controller.approve,
|
|
380
|
+
reject: controller.reject,
|
|
381
|
+
undo: controller.undo,
|
|
382
|
+
openSource: async (source) => {
|
|
383
|
+
if (typeof window === "undefined") return false;
|
|
384
|
+
const tab = window.open("about:blank", "_blank");
|
|
385
|
+
if (tab) tab.opener = null;
|
|
386
|
+
try {
|
|
387
|
+
const link = await client.getSourceLink(source);
|
|
388
|
+
if (!tab) return false;
|
|
389
|
+
tab.location.href = link.url;
|
|
390
|
+
return true;
|
|
391
|
+
} catch {
|
|
392
|
+
tab?.close();
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}),
|
|
397
|
+
[controller, client, state]
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// src/use-feedback.ts
|
|
402
|
+
var import_react3 = require("react");
|
|
403
|
+
function useBaseeraFeedback() {
|
|
404
|
+
const { controller, client } = useBaseeraInternals();
|
|
405
|
+
const [ratings, setRatings] = (0, import_react3.useState)({});
|
|
406
|
+
const rate = (0, import_react3.useCallback)(
|
|
407
|
+
async (messageId, rating, reason) => {
|
|
408
|
+
const sessionId = controller.getSnapshot().sessionId;
|
|
409
|
+
if (!sessionId) return false;
|
|
410
|
+
try {
|
|
411
|
+
await client.sendFeedback(sessionId, messageId, rating, reason);
|
|
412
|
+
} catch {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
setRatings((r) => ({ ...r, [messageId]: rating }));
|
|
416
|
+
return true;
|
|
417
|
+
},
|
|
418
|
+
[controller, client]
|
|
419
|
+
);
|
|
420
|
+
return (0, import_react3.useMemo)(() => ({ rate, ratings }), [rate, ratings]);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// src/use-context.ts
|
|
424
|
+
var import_react4 = require("react");
|
|
425
|
+
function useBaseeraContext(input) {
|
|
426
|
+
const { contextStore } = useBaseeraInternals();
|
|
427
|
+
const idRef = (0, import_react4.useRef)(null);
|
|
428
|
+
idRef.current ??= contextStore.claim();
|
|
429
|
+
const id = idRef.current;
|
|
430
|
+
const inputRef = (0, import_react4.useRef)(input);
|
|
431
|
+
inputRef.current = input;
|
|
432
|
+
let key;
|
|
433
|
+
try {
|
|
434
|
+
key = JSON.stringify(input) ?? "";
|
|
435
|
+
} catch {
|
|
436
|
+
key = String(Math.random());
|
|
437
|
+
}
|
|
438
|
+
(0, import_react4.useEffect)(() => {
|
|
439
|
+
contextStore.set(id, inputRef.current);
|
|
440
|
+
}, [contextStore, id, key]);
|
|
441
|
+
(0, import_react4.useEffect)(() => () => contextStore.remove(id), [contextStore, id]);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/use-approvals.ts
|
|
445
|
+
var import_react5 = require("react");
|
|
446
|
+
var EMPTY = { sessionId: null, messages: [], status: "idle", error: null, pendingApprovals: [] };
|
|
447
|
+
var getServerSnapshot2 = () => EMPTY;
|
|
448
|
+
function useBaseeraApprovals() {
|
|
449
|
+
const { controller } = useBaseeraInternals();
|
|
450
|
+
const state = (0, import_react5.useSyncExternalStore)(controller.subscribe, controller.getSnapshot, getServerSnapshot2);
|
|
451
|
+
return (0, import_react5.useMemo)(
|
|
452
|
+
() => ({
|
|
453
|
+
pending: state.pendingApprovals,
|
|
454
|
+
approve: controller.approve,
|
|
455
|
+
reject: controller.reject,
|
|
456
|
+
approveAll: () => {
|
|
457
|
+
for (const a of controller.getSnapshot().pendingApprovals) controller.approve(a.callId);
|
|
458
|
+
},
|
|
459
|
+
rejectAll: (reason) => {
|
|
460
|
+
for (const a of controller.getSnapshot().pendingApprovals) controller.reject(a.callId, reason);
|
|
461
|
+
}
|
|
462
|
+
}),
|
|
463
|
+
[controller, state.pendingApprovals]
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// src/use-immersive.ts
|
|
468
|
+
var import_core4 = require("@baseera/core");
|
|
469
|
+
var import_react6 = require("react");
|
|
470
|
+
function isProduction2() {
|
|
471
|
+
try {
|
|
472
|
+
return process.env.NODE_ENV === "production";
|
|
473
|
+
} catch {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function valuesKey(def) {
|
|
478
|
+
const parts = def.fields.map((field) => {
|
|
479
|
+
let json;
|
|
480
|
+
try {
|
|
481
|
+
json = JSON.stringify(field.get());
|
|
482
|
+
} catch {
|
|
483
|
+
json = "[unserializable]";
|
|
484
|
+
}
|
|
485
|
+
return `${JSON.stringify(field.name)}:${json ?? "undefined"}`;
|
|
486
|
+
});
|
|
487
|
+
return parts.join(",");
|
|
488
|
+
}
|
|
489
|
+
function useBaseeraImmersive(def) {
|
|
490
|
+
const { immersive, immersiveSlot } = useBaseeraInternals();
|
|
491
|
+
const claimRef = (0, import_react6.useRef)(null);
|
|
492
|
+
claimRef.current ??= { order: immersiveSlot.nextOrder++, entity: null };
|
|
493
|
+
const claim = claimRef.current;
|
|
494
|
+
const defRef = (0, import_react6.useRef)(def);
|
|
495
|
+
defRef.current = def;
|
|
496
|
+
const key = valuesKey(def);
|
|
497
|
+
const lastKey = (0, import_react6.useRef)(key);
|
|
498
|
+
(0, import_react6.useEffect)(() => {
|
|
499
|
+
const latest = defRef.current;
|
|
500
|
+
claim.entity = { type: latest.entity.type, ref: latest.entity.ref };
|
|
501
|
+
const current = immersiveSlot.owner;
|
|
502
|
+
if (current && current !== claim) {
|
|
503
|
+
const [replaced, by] = current.order > claim.order ? [claim, current] : [current, claim];
|
|
504
|
+
if (!isProduction2()) {
|
|
505
|
+
console.warn(
|
|
506
|
+
`[baseera] Immersive mode was on for ${replaced.entity?.type} ${replaced.entity?.ref} and is replaced by ${by.entity?.type} ${by.entity?.ref}. Only one record can be in immersive mode at a time.`
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
if (current.order > claim.order) return;
|
|
510
|
+
}
|
|
511
|
+
immersiveSlot.owner = claim;
|
|
512
|
+
immersive.start(latest);
|
|
513
|
+
return () => {
|
|
514
|
+
if (immersiveSlot.owner !== claim) return;
|
|
515
|
+
immersiveSlot.owner = null;
|
|
516
|
+
immersive.stop();
|
|
517
|
+
};
|
|
518
|
+
}, [immersive, immersiveSlot, claim]);
|
|
519
|
+
(0, import_react6.useEffect)(() => {
|
|
520
|
+
if (immersiveSlot.owner === claim) immersive.update(def);
|
|
521
|
+
});
|
|
522
|
+
(0, import_react6.useEffect)(() => {
|
|
523
|
+
if (lastKey.current === key) return;
|
|
524
|
+
lastKey.current = key;
|
|
525
|
+
if (immersiveSlot.owner === claim) immersive.recheck();
|
|
526
|
+
}, [key, immersive, immersiveSlot, claim]);
|
|
527
|
+
}
|
|
528
|
+
var SERVER_SNAPSHOT = (0, import_core4.createImmersiveController)().getSnapshot();
|
|
529
|
+
var getServerSnapshot3 = () => SERVER_SNAPSHOT;
|
|
530
|
+
function useImmersiveSnapshot() {
|
|
531
|
+
const { immersive } = useBaseeraInternals();
|
|
532
|
+
return (0, import_react6.useSyncExternalStore)(immersive.subscribe, immersive.getSnapshot, getServerSnapshot3);
|
|
533
|
+
}
|
|
534
|
+
function useBaseeraImmersiveState() {
|
|
535
|
+
const { immersive } = useBaseeraInternals();
|
|
536
|
+
const snap = (0, import_react6.useSyncExternalStore)(immersive.subscribe, immersive.getSnapshot, getServerSnapshot3);
|
|
537
|
+
return (0, import_react6.useMemo)(() => {
|
|
538
|
+
const open = snap.results.filter((r) => r.status === "open");
|
|
539
|
+
return {
|
|
540
|
+
active: snap.active,
|
|
541
|
+
entity: snap.entity,
|
|
542
|
+
openChecks: {
|
|
543
|
+
blocking: open.filter((r) => r.severity === "blocking"),
|
|
544
|
+
warning: open.filter((r) => r.severity === "warning"),
|
|
545
|
+
info: open.filter((r) => r.severity === "info")
|
|
546
|
+
},
|
|
547
|
+
results: snap.results,
|
|
548
|
+
counts: snap.counts,
|
|
549
|
+
canFinish: snap.canFinish,
|
|
550
|
+
canOverride: snap.canOverride,
|
|
551
|
+
openBlocking: snap.openBlocking,
|
|
552
|
+
checksFailed: snap.checksFailed,
|
|
553
|
+
finishStatus: snap.finishStatus,
|
|
554
|
+
finishError: snap.finishError,
|
|
555
|
+
finishLabel: snap.finishLabel,
|
|
556
|
+
pendingDrafts: snap.pendingDrafts,
|
|
557
|
+
aiChecks: snap.aiChecks,
|
|
558
|
+
fieldLabels: snap.fieldLabels,
|
|
559
|
+
boundFields: snap.boundFields,
|
|
560
|
+
lastApplied: snap.lastApplied,
|
|
561
|
+
lastRunAt: snap.lastRunAt,
|
|
562
|
+
recheck: immersive.recheck,
|
|
563
|
+
acknowledge: immersive.acknowledge,
|
|
564
|
+
applyCheckFix: immersive.applyCheckFix,
|
|
565
|
+
focusField: immersive.focusField,
|
|
566
|
+
undoLastDraft: immersive.undoLastDraft,
|
|
567
|
+
finish: immersive.finish
|
|
568
|
+
};
|
|
569
|
+
}, [immersive, snap]);
|
|
570
|
+
}
|
|
571
|
+
function useBaseeraSignal() {
|
|
572
|
+
const { immersive } = useBaseeraInternals();
|
|
573
|
+
return immersive.signal;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// src/use-knowledge-upload.ts
|
|
577
|
+
var import_core5 = require("@baseera/core");
|
|
578
|
+
var import_react7 = require("react");
|
|
579
|
+
var SERVER_STATE2 = { sources: null, uploads: [], loading: true, error: null, disabled: false };
|
|
580
|
+
function useBaseeraKnowledgeUpload(options) {
|
|
581
|
+
const { connection } = useBaseeraInternals();
|
|
582
|
+
const tokenRef = (0, import_react7.useRef)(options.getUploadToken);
|
|
583
|
+
tokenRef.current = options.getUploadToken;
|
|
584
|
+
const [controller] = (0, import_react7.useState)(
|
|
585
|
+
() => (0, import_core5.createTenantUploadController)({ publishableKey: connection.publishableKey, baseUrl: connection.baseUrl, getUploadToken: () => tokenRef.current(), ...options.pollMs ? { pollMs: options.pollMs } : {} })
|
|
586
|
+
);
|
|
587
|
+
const state = (0, import_react7.useSyncExternalStore)(controller.subscribe, controller.getSnapshot, () => SERVER_STATE2);
|
|
588
|
+
(0, import_react7.useEffect)(() => {
|
|
589
|
+
controller.start();
|
|
590
|
+
return () => controller.stop();
|
|
591
|
+
}, [controller]);
|
|
592
|
+
return (0, import_react7.useMemo)(
|
|
593
|
+
() => ({
|
|
594
|
+
...state,
|
|
595
|
+
upload: (files) => controller.upload(Array.from(files)),
|
|
596
|
+
remove: controller.remove,
|
|
597
|
+
refresh: controller.refresh
|
|
598
|
+
}),
|
|
599
|
+
[controller, state]
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// src/use-field.ts
|
|
604
|
+
var import_react8 = require("react");
|
|
605
|
+
var MAX_REASON2 = 500;
|
|
606
|
+
var FOCUSABLE = 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), a[href], [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
607
|
+
var SEVERITY_RANK = { info: 1, warning: 2, blocking: 3 };
|
|
608
|
+
function firstControl(root) {
|
|
609
|
+
for (const el of root.querySelectorAll(FOCUSABLE)) if (!el.closest("[data-baseera-ui]")) return el;
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
function prefersReducedMotion() {
|
|
613
|
+
try {
|
|
614
|
+
return typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
615
|
+
} catch {
|
|
616
|
+
return false;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function useBaseeraField(name, options) {
|
|
620
|
+
const { immersive } = useBaseeraInternals();
|
|
621
|
+
const snap = useImmersiveSnapshot();
|
|
622
|
+
const elementRef = (0, import_react8.useRef)(null);
|
|
623
|
+
const onChangeRef = (0, import_react8.useRef)(options.onChange);
|
|
624
|
+
onChangeRef.current = options.onChange;
|
|
625
|
+
const focusControl = (0, import_react8.useCallback)(() => {
|
|
626
|
+
const el = elementRef.current;
|
|
627
|
+
if (el) firstControl(el)?.focus({ preventScroll: true });
|
|
628
|
+
}, []);
|
|
629
|
+
(0, import_react8.useEffect)(
|
|
630
|
+
() => immersive.bindField(name, {
|
|
631
|
+
write(value) {
|
|
632
|
+
onChangeRef.current(value);
|
|
633
|
+
},
|
|
634
|
+
focus() {
|
|
635
|
+
const el = elementRef.current;
|
|
636
|
+
if (!el) return;
|
|
637
|
+
if (typeof el.scrollIntoView === "function") el.scrollIntoView({ block: "center", behavior: prefersReducedMotion() ? "auto" : "smooth" });
|
|
638
|
+
firstControl(el)?.focus({ preventScroll: true });
|
|
639
|
+
}
|
|
640
|
+
}),
|
|
641
|
+
[immersive, name]
|
|
642
|
+
);
|
|
643
|
+
const bindRef = (0, import_react8.useCallback)((element) => {
|
|
644
|
+
elementRef.current = element;
|
|
645
|
+
}, []);
|
|
646
|
+
const pending = snap.pendingDrafts.find((d) => d.field === name);
|
|
647
|
+
const draft = (0, import_react8.useMemo)(() => pending ? { value: pending.value, reason: pending.reason, source: pending.source } : null, [pending]);
|
|
648
|
+
const flag = (0, import_react8.useMemo)(() => {
|
|
649
|
+
let best = null;
|
|
650
|
+
for (const r of snap.results) {
|
|
651
|
+
if (r.status !== "open" || !r.fields.includes(name)) continue;
|
|
652
|
+
if (!best || SEVERITY_RANK[r.severity] > SEVERITY_RANK[best.severity]) best = { severity: r.severity, message: r.message, checkId: r.id };
|
|
653
|
+
}
|
|
654
|
+
return best;
|
|
655
|
+
}, [snap.results, name]);
|
|
656
|
+
const focusedAt = snap.focused?.field === name ? snap.focused.at : null;
|
|
657
|
+
const focused = (0, import_react8.useMemo)(() => focusedAt === null ? null : { at: focusedAt }, [focusedAt]);
|
|
658
|
+
const approve = (0, import_react8.useCallback)(() => {
|
|
659
|
+
const current = immersive.getSnapshot().pendingDrafts.find((d) => d.field === name);
|
|
660
|
+
if (!current) return;
|
|
661
|
+
const previous = immersive.readField(name);
|
|
662
|
+
onChangeRef.current(current.value);
|
|
663
|
+
immersive.resolveDraft(name, { approved: true }, { previous });
|
|
664
|
+
}, [immersive, name]);
|
|
665
|
+
const reject = (0, import_react8.useCallback)(
|
|
666
|
+
(reason) => {
|
|
667
|
+
const text = reason?.trim().slice(0, MAX_REASON2);
|
|
668
|
+
immersive.resolveDraft(name, { approved: false, ...text ? { reason: text } : {} });
|
|
669
|
+
},
|
|
670
|
+
[immersive, name]
|
|
671
|
+
);
|
|
672
|
+
return (0, import_react8.useMemo)(() => ({ draft, flag, focused, approve, reject, bindRef, focusControl }), [draft, flag, focused, approve, reject, bindRef, focusControl]);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// src/index.ts
|
|
676
|
+
var import_core6 = require("@baseera/core");
|
|
677
|
+
|
|
678
|
+
// src/use-tool.ts
|
|
679
|
+
var import_react9 = require("react");
|
|
680
|
+
var import_zod = require("zod");
|
|
681
|
+
var NAME_PATTERN = /^[a-zA-Z0-9_.-]{1,64}$/;
|
|
682
|
+
var MAX_DESCRIPTION = 2e3;
|
|
683
|
+
var MAX_SCHEMA_BYTES = 16e3;
|
|
684
|
+
var MAX_ERROR = 1e3;
|
|
685
|
+
function useBaseeraToolDefinition(tool) {
|
|
686
|
+
const latest = (0, import_react9.useRef)(tool);
|
|
687
|
+
latest.current = tool;
|
|
688
|
+
useRegistration(tool.spec.name, latest);
|
|
689
|
+
}
|
|
690
|
+
function useRegistration(key, latest) {
|
|
691
|
+
const { registry } = useBaseeraInternals();
|
|
692
|
+
(0, import_react9.useEffect)(() => {
|
|
693
|
+
const registered = {
|
|
694
|
+
get spec() {
|
|
695
|
+
return latest.current.spec;
|
|
696
|
+
},
|
|
697
|
+
run: (input, context) => latest.current.run(input, context),
|
|
698
|
+
get inlineApproval() {
|
|
699
|
+
return latest.current.inlineApproval;
|
|
700
|
+
},
|
|
701
|
+
validate: (input) => latest.current.validate ? latest.current.validate(input) : { ok: true, value: input },
|
|
702
|
+
describe: (input) => latest.current.describe?.(input) ?? "",
|
|
703
|
+
// Present only while the latest registration has one: the controller offers Undo from this.
|
|
704
|
+
get undo() {
|
|
705
|
+
const undo = latest.current.undo;
|
|
706
|
+
return undo ? (input, output) => latest.current.undo?.(input, output) : void 0;
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
return registry.register(registered);
|
|
710
|
+
}, [registry, key, latest]);
|
|
711
|
+
}
|
|
712
|
+
var schemaCache = /* @__PURE__ */ new WeakMap();
|
|
713
|
+
function toWireSchema(name, input) {
|
|
714
|
+
const def = input?._zod?.def;
|
|
715
|
+
if (!input || typeof input !== "object" || def?.type !== "object") {
|
|
716
|
+
throw new Error(`useBaseeraTool("${name}"): \`input\` must be a z.object(...) schema.`);
|
|
717
|
+
}
|
|
718
|
+
const cached = schemaCache.get(input);
|
|
719
|
+
if (cached) return cached;
|
|
720
|
+
let json;
|
|
721
|
+
try {
|
|
722
|
+
json = { ...import_zod.z.toJSONSchema(input) };
|
|
723
|
+
} catch (error) {
|
|
724
|
+
throw new Error(`useBaseeraTool("${name}"): the input schema cannot be converted to JSON Schema (${error instanceof Error ? error.message : "unknown error"}).`);
|
|
725
|
+
}
|
|
726
|
+
delete json.$schema;
|
|
727
|
+
json.type = "object";
|
|
728
|
+
const bytes = new TextEncoder().encode(JSON.stringify(json)).length;
|
|
729
|
+
if (bytes > MAX_SCHEMA_BYTES) {
|
|
730
|
+
throw new Error(`useBaseeraTool("${name}"): the input schema is ${bytes} bytes as JSON Schema; the limit is ${MAX_SCHEMA_BYTES}.`);
|
|
731
|
+
}
|
|
732
|
+
schemaCache.set(input, json);
|
|
733
|
+
return json;
|
|
734
|
+
}
|
|
735
|
+
function summarize(error) {
|
|
736
|
+
let text;
|
|
737
|
+
try {
|
|
738
|
+
text = typeof import_zod.z.prettifyError === "function" ? import_zod.z.prettifyError(error) : "";
|
|
739
|
+
} catch {
|
|
740
|
+
text = "";
|
|
741
|
+
}
|
|
742
|
+
if (!text) text = error.issues.map((i) => `${i.path.join(".") || "input"}: ${i.message}`).join("; ");
|
|
743
|
+
return text.slice(0, MAX_ERROR);
|
|
744
|
+
}
|
|
745
|
+
function useBaseeraTool(options) {
|
|
746
|
+
const { name, description, input, kind } = options;
|
|
747
|
+
const spec = (0, import_react9.useMemo)(() => {
|
|
748
|
+
if (typeof name !== "string" || !NAME_PATTERN.test(name)) {
|
|
749
|
+
throw new Error(`useBaseeraTool: invalid name ${JSON.stringify(name)}. Use 1 to 64 letters, digits, "_", "." or "-".`);
|
|
750
|
+
}
|
|
751
|
+
if (typeof description !== "string" || description.trim() === "" || description.length > MAX_DESCRIPTION) {
|
|
752
|
+
throw new Error(`useBaseeraTool("${name}"): \`description\` must be 1 to ${MAX_DESCRIPTION} characters.`);
|
|
753
|
+
}
|
|
754
|
+
return { name, description, kind, inputSchema: toWireSchema(name, input) };
|
|
755
|
+
}, [name, description, kind, input]);
|
|
756
|
+
const optionsRef = (0, import_react9.useRef)(options);
|
|
757
|
+
optionsRef.current = options;
|
|
758
|
+
const specRef = (0, import_react9.useRef)(spec);
|
|
759
|
+
specRef.current = spec;
|
|
760
|
+
const latest = (0, import_react9.useRef)(null);
|
|
761
|
+
latest.current ??= {
|
|
762
|
+
get spec() {
|
|
763
|
+
return specRef.current;
|
|
764
|
+
},
|
|
765
|
+
run: (value) => optionsRef.current.run(value),
|
|
766
|
+
validate: (value) => {
|
|
767
|
+
const parsed = optionsRef.current.input.safeParse(value);
|
|
768
|
+
return parsed.success ? { ok: true, value: parsed.data } : { ok: false, error: summarize(parsed.error) };
|
|
769
|
+
},
|
|
770
|
+
describe: (value) => optionsRef.current.describe?.(value) ?? "",
|
|
771
|
+
get undo() {
|
|
772
|
+
return optionsRef.current.undo ? (value, output) => optionsRef.current.undo?.(value, output) : void 0;
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
const key = (0, import_react9.useMemo)(() => JSON.stringify([spec.name, spec.kind, spec.description]), [spec]);
|
|
776
|
+
useRegistration(`${key}:${schemaId(input)}`, latest);
|
|
777
|
+
}
|
|
778
|
+
var ids = /* @__PURE__ */ new WeakMap();
|
|
779
|
+
var nextId = 0;
|
|
780
|
+
function schemaId(schema) {
|
|
781
|
+
let id = ids.get(schema);
|
|
782
|
+
if (id === void 0) ids.set(schema, id = ++nextId);
|
|
783
|
+
return id;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// src/index.ts
|
|
787
|
+
var import_core7 = require("@baseera/core");
|
|
788
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
789
|
+
0 && (module.exports = {
|
|
790
|
+
BaseeraProvider,
|
|
791
|
+
BaseeraRejection,
|
|
792
|
+
CHECK_FAILED_MESSAGE,
|
|
793
|
+
FEEDBACK_REASON_MAX,
|
|
794
|
+
FOCUS_FIELD_TOOL,
|
|
795
|
+
PREFILL_DRAFT_TOOL,
|
|
796
|
+
PROTOCOL_VERSION,
|
|
797
|
+
firstControl,
|
|
798
|
+
useBaseeraAgentTheme,
|
|
799
|
+
useBaseeraApprovals,
|
|
800
|
+
useBaseeraChat,
|
|
801
|
+
useBaseeraContext,
|
|
802
|
+
useBaseeraFeedback,
|
|
803
|
+
useBaseeraField,
|
|
804
|
+
useBaseeraImmersive,
|
|
805
|
+
useBaseeraImmersiveState,
|
|
806
|
+
useBaseeraKnowledgeUpload,
|
|
807
|
+
useBaseeraSignal,
|
|
808
|
+
useBaseeraTheme,
|
|
809
|
+
useBaseeraTool,
|
|
810
|
+
useBaseeraToolDefinition
|
|
811
|
+
});
|
|
812
|
+
//# sourceMappingURL=index.cjs.map
|