@lunora/react 1.0.0-alpha.43 → 1.0.0-alpha.44
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/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -46,7 +46,7 @@ interface LunoraProviderProps {
|
|
|
46
46
|
* route through the offline queue on the client), and `gcTime: 5min` (keep
|
|
47
47
|
* results around for a short return-to-view window).
|
|
48
48
|
*
|
|
49
|
-
* If a parent
|
|
49
|
+
* If a parent `<QueryClientProvider>` is already mounted, the provider
|
|
50
50
|
* uses *that* client and does NOT install an inner one (so apps with their
|
|
51
51
|
* own setup don't double-wrap).
|
|
52
52
|
*/
|
|
@@ -59,7 +59,7 @@ interface LunoraProviderProps {
|
|
|
59
59
|
*/
|
|
60
60
|
declare const LunoraProvider: ({ children, client, queryClient }: LunoraProviderProps) => ReactElement;
|
|
61
61
|
/**
|
|
62
|
-
* Read the {@link LunoraClient} from the nearest
|
|
62
|
+
* Read the {@link LunoraClient} from the nearest `<LunoraProvider>`. Kept
|
|
63
63
|
* colocated with the provider for back-compat.
|
|
64
64
|
*/
|
|
65
65
|
declare const useLunora: () => LunoraClient;
|
|
@@ -373,14 +373,14 @@ interface UseAgentOptions {
|
|
|
373
373
|
api: UseAgentApi;
|
|
374
374
|
/**
|
|
375
375
|
* Optional app mutation over the agent's cancel path
|
|
376
|
-
* (`ctx.agents
|
|
376
|
+
* (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
|
|
377
377
|
* When omitted (or no run is in flight) {@link UseAgentResult.cancel} is a
|
|
378
378
|
* no-op.
|
|
379
379
|
*/
|
|
380
380
|
cancel?: FunctionReference<"mutation">;
|
|
381
381
|
/**
|
|
382
382
|
* The app mutation that starts (or continues) a run — a thin wrapper over
|
|
383
|
-
* `ctx.agents
|
|
383
|
+
* `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
|
|
384
384
|
* {@link UseAgentOptions.runArgs} and the per-call args.
|
|
385
385
|
*/
|
|
386
386
|
run: FunctionReference<"mutation">;
|
|
@@ -412,7 +412,7 @@ interface UseAgentResult {
|
|
|
412
412
|
* `useAgentChat`.
|
|
413
413
|
*
|
|
414
414
|
* `run` and `cancel` stay generic over the app-defined mutations that wrap
|
|
415
|
-
* `ctx.agents
|
|
415
|
+
* `ctx.agents.<name>.run` / `.cancel`, so the hook hard-codes no function names
|
|
416
416
|
* beyond the `agents:*` surface.
|
|
417
417
|
*/
|
|
418
418
|
declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
|
|
@@ -524,7 +524,7 @@ interface UseAgentChatOptions {
|
|
|
524
524
|
api: UseAgentChatApi;
|
|
525
525
|
/**
|
|
526
526
|
* Optional app mutation over the agent's cancel path
|
|
527
|
-
* (`ctx.agents
|
|
527
|
+
* (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
|
|
528
528
|
* When omitted (or no run is in flight) {@link UseAgentChatResult.cancel} is a
|
|
529
529
|
* no-op.
|
|
530
530
|
*/
|
|
@@ -533,7 +533,7 @@ interface UseAgentChatOptions {
|
|
|
533
533
|
limit?: number;
|
|
534
534
|
/**
|
|
535
535
|
* The app mutation that starts (or continues) a run — a thin wrapper over
|
|
536
|
-
* `ctx.agents
|
|
536
|
+
* `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
|
|
537
537
|
* {@link UseAgentChatOptions.sendArgs} and the per-call args.
|
|
538
538
|
*/
|
|
539
539
|
send: FunctionReference<"mutation">;
|
|
@@ -841,7 +841,7 @@ interface UseHttpStreamOptions {
|
|
|
841
841
|
maxBuffer?: number;
|
|
842
842
|
}
|
|
843
843
|
/**
|
|
844
|
-
* Consume an **HTTP-SSE route stream** (`httpRoute
|
|
844
|
+
* Consume an **HTTP-SSE route stream** (`httpRoute.<verb>(path).stream()`) via
|
|
845
845
|
* `client.httpStream`. Distinct from `useStream`, which consumes the WS
|
|
846
846
|
* procedure stream (`kind: "stream"`). Returns the chunks received so far plus
|
|
847
847
|
* a lifecycle status and a cancel function. Changing the route or the
|
|
@@ -1180,9 +1180,9 @@ type CreateSpeaker = (config: {
|
|
|
1180
1180
|
audioFormat: VoiceAudioFormat;
|
|
1181
1181
|
}) => VoiceSpeaker;
|
|
1182
1182
|
/**
|
|
1183
|
-
* The `agents
|
|
1183
|
+
* The `agents.<name>Voice` reference codegen emits for a voice-enabled agent — a
|
|
1184
1184
|
* live, WS-backed session keyed by `threadKey`. A structural subset of the
|
|
1185
|
-
* generated member, so passing `api.agents
|
|
1185
|
+
* generated member, so passing `api.agents.<name>Voice` type-checks.
|
|
1186
1186
|
*/
|
|
1187
1187
|
type VoiceReference = FunctionReference<"stream", {
|
|
1188
1188
|
threadKey: string;
|
|
@@ -1224,7 +1224,7 @@ interface UseVoiceAgentOptions {
|
|
|
1224
1224
|
silenceThreshold?: number;
|
|
1225
1225
|
/** The thread to converse on — shared with the agent's text turns. */
|
|
1226
1226
|
threadKey: string;
|
|
1227
|
-
/** The generated `api.agents
|
|
1227
|
+
/** The generated `api.agents.<name>Voice` reference — identifies the voice DO endpoint. */
|
|
1228
1228
|
voice: VoiceReference;
|
|
1229
1229
|
}
|
|
1230
1230
|
interface UseVoiceAgentResult {
|
|
@@ -1256,7 +1256,7 @@ interface UseVoiceAgentResult {
|
|
|
1256
1256
|
* WebSocket to the agent's `VoiceSessionDO`, captures mic audio as 16 kHz PCM,
|
|
1257
1257
|
* streams the agent's synthesized speech back through the browser's audio output,
|
|
1258
1258
|
* and mirrors the call lifecycle (`status`, `transcript`, `interimTranscript`,
|
|
1259
|
-
* `audioLevel`) to React state. Pass the generated `api.agents
|
|
1259
|
+
* `audioLevel`) to React state. Pass the generated `api.agents.<name>Voice`
|
|
1260
1260
|
* reference (never a string), matching `useAgentChat`'s reference-passing style.
|
|
1261
1261
|
*
|
|
1262
1262
|
* v1 transport is plain binary WebSocket frames with push-to-talk / silence-timer
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface LunoraProviderProps {
|
|
|
46
46
|
* route through the offline queue on the client), and `gcTime: 5min` (keep
|
|
47
47
|
* results around for a short return-to-view window).
|
|
48
48
|
*
|
|
49
|
-
* If a parent
|
|
49
|
+
* If a parent `<QueryClientProvider>` is already mounted, the provider
|
|
50
50
|
* uses *that* client and does NOT install an inner one (so apps with their
|
|
51
51
|
* own setup don't double-wrap).
|
|
52
52
|
*/
|
|
@@ -59,7 +59,7 @@ interface LunoraProviderProps {
|
|
|
59
59
|
*/
|
|
60
60
|
declare const LunoraProvider: ({ children, client, queryClient }: LunoraProviderProps) => ReactElement;
|
|
61
61
|
/**
|
|
62
|
-
* Read the {@link LunoraClient} from the nearest
|
|
62
|
+
* Read the {@link LunoraClient} from the nearest `<LunoraProvider>`. Kept
|
|
63
63
|
* colocated with the provider for back-compat.
|
|
64
64
|
*/
|
|
65
65
|
declare const useLunora: () => LunoraClient;
|
|
@@ -373,14 +373,14 @@ interface UseAgentOptions {
|
|
|
373
373
|
api: UseAgentApi;
|
|
374
374
|
/**
|
|
375
375
|
* Optional app mutation over the agent's cancel path
|
|
376
|
-
* (`ctx.agents
|
|
376
|
+
* (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
|
|
377
377
|
* When omitted (or no run is in flight) {@link UseAgentResult.cancel} is a
|
|
378
378
|
* no-op.
|
|
379
379
|
*/
|
|
380
380
|
cancel?: FunctionReference<"mutation">;
|
|
381
381
|
/**
|
|
382
382
|
* The app mutation that starts (or continues) a run — a thin wrapper over
|
|
383
|
-
* `ctx.agents
|
|
383
|
+
* `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
|
|
384
384
|
* {@link UseAgentOptions.runArgs} and the per-call args.
|
|
385
385
|
*/
|
|
386
386
|
run: FunctionReference<"mutation">;
|
|
@@ -412,7 +412,7 @@ interface UseAgentResult {
|
|
|
412
412
|
* `useAgentChat`.
|
|
413
413
|
*
|
|
414
414
|
* `run` and `cancel` stay generic over the app-defined mutations that wrap
|
|
415
|
-
* `ctx.agents
|
|
415
|
+
* `ctx.agents.<name>.run` / `.cancel`, so the hook hard-codes no function names
|
|
416
416
|
* beyond the `agents:*` surface.
|
|
417
417
|
*/
|
|
418
418
|
declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
|
|
@@ -524,7 +524,7 @@ interface UseAgentChatOptions {
|
|
|
524
524
|
api: UseAgentChatApi;
|
|
525
525
|
/**
|
|
526
526
|
* Optional app mutation over the agent's cancel path
|
|
527
|
-
* (`ctx.agents
|
|
527
|
+
* (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
|
|
528
528
|
* When omitted (or no run is in flight) {@link UseAgentChatResult.cancel} is a
|
|
529
529
|
* no-op.
|
|
530
530
|
*/
|
|
@@ -533,7 +533,7 @@ interface UseAgentChatOptions {
|
|
|
533
533
|
limit?: number;
|
|
534
534
|
/**
|
|
535
535
|
* The app mutation that starts (or continues) a run — a thin wrapper over
|
|
536
|
-
* `ctx.agents
|
|
536
|
+
* `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
|
|
537
537
|
* {@link UseAgentChatOptions.sendArgs} and the per-call args.
|
|
538
538
|
*/
|
|
539
539
|
send: FunctionReference<"mutation">;
|
|
@@ -841,7 +841,7 @@ interface UseHttpStreamOptions {
|
|
|
841
841
|
maxBuffer?: number;
|
|
842
842
|
}
|
|
843
843
|
/**
|
|
844
|
-
* Consume an **HTTP-SSE route stream** (`httpRoute
|
|
844
|
+
* Consume an **HTTP-SSE route stream** (`httpRoute.<verb>(path).stream()`) via
|
|
845
845
|
* `client.httpStream`. Distinct from `useStream`, which consumes the WS
|
|
846
846
|
* procedure stream (`kind: "stream"`). Returns the chunks received so far plus
|
|
847
847
|
* a lifecycle status and a cancel function. Changing the route or the
|
|
@@ -1180,9 +1180,9 @@ type CreateSpeaker = (config: {
|
|
|
1180
1180
|
audioFormat: VoiceAudioFormat;
|
|
1181
1181
|
}) => VoiceSpeaker;
|
|
1182
1182
|
/**
|
|
1183
|
-
* The `agents
|
|
1183
|
+
* The `agents.<name>Voice` reference codegen emits for a voice-enabled agent — a
|
|
1184
1184
|
* live, WS-backed session keyed by `threadKey`. A structural subset of the
|
|
1185
|
-
* generated member, so passing `api.agents
|
|
1185
|
+
* generated member, so passing `api.agents.<name>Voice` type-checks.
|
|
1186
1186
|
*/
|
|
1187
1187
|
type VoiceReference = FunctionReference<"stream", {
|
|
1188
1188
|
threadKey: string;
|
|
@@ -1224,7 +1224,7 @@ interface UseVoiceAgentOptions {
|
|
|
1224
1224
|
silenceThreshold?: number;
|
|
1225
1225
|
/** The thread to converse on — shared with the agent's text turns. */
|
|
1226
1226
|
threadKey: string;
|
|
1227
|
-
/** The generated `api.agents
|
|
1227
|
+
/** The generated `api.agents.<name>Voice` reference — identifies the voice DO endpoint. */
|
|
1228
1228
|
voice: VoiceReference;
|
|
1229
1229
|
}
|
|
1230
1230
|
interface UseVoiceAgentResult {
|
|
@@ -1256,7 +1256,7 @@ interface UseVoiceAgentResult {
|
|
|
1256
1256
|
* WebSocket to the agent's `VoiceSessionDO`, captures mic audio as 16 kHz PCM,
|
|
1257
1257
|
* streams the agent's synthesized speech back through the browser's audio output,
|
|
1258
1258
|
* and mirrors the call lifecycle (`status`, `transcript`, `interimTranscript`,
|
|
1259
|
-
* `audioLevel`) to React state. Pass the generated `api.agents
|
|
1259
|
+
* `audioLevel`) to React state. Pass the generated `api.agents.<name>Voice`
|
|
1260
1260
|
* reference (never a string), matching `useAgentChat`'s reference-passing style.
|
|
1261
1261
|
*
|
|
1262
1262
|
* v1 transport is plain binary WebSocket frames with push-to-talk / silence-timer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/react",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.44",
|
|
4
4
|
"description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lunora/client": "1.0.0-alpha.
|
|
57
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
58
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
56
|
+
"@lunora/client": "1.0.0-alpha.40",
|
|
57
|
+
"@lunora/errors": "1.0.0-alpha.14",
|
|
58
|
+
"@lunora/ratelimit": "1.0.0-alpha.17",
|
|
59
59
|
"@visulima/storage-client": "1.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|