@agent-native/core 0.207.1 → 0.207.2-nightly-20261012212922
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/client/action-query-cache.d.ts +3 -1
- package/dist/client/action-query-cache.js +628 -161
- package/dist/client/action-query-cache.session-test-fixture.d.ts +49 -0
- package/dist/client/action-query-cache.session-test-fixture.js +151 -0
- package/dist/client/action-query-cache.test-fixtures.d.ts +2 -0
- package/dist/client/action-query-cache.test-fixtures.js +56 -0
- package/dist/client/use-action.d.ts +10 -2
- package/dist/client/use-action.js +81 -12
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
- package/dist/observability/routes.d.ts +7 -7
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +10 -10
- package/dist/provider-api/actions/provider-api.d.ts +6 -6
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +5 -5
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-ollama-models-route.d.ts +2 -2
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/triggers/actions/manage-automation.d.ts +5 -5
- package/package.json +3 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { PersistedClient } from "@tanstack/query-persist-client-core";
|
|
2
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
4
|
+
import type { AuthSessionResponse } from "../server/auth.js";
|
|
5
|
+
import type { ActionQueryCacheStorage } from "./action-query-cache.js";
|
|
6
|
+
export type Gate = ComponentType<{
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
export type SessionUser = AuthSessionResponse;
|
|
10
|
+
export type ProbeRender = {
|
|
11
|
+
title: string | undefined;
|
|
12
|
+
status: string;
|
|
13
|
+
userId: string | undefined;
|
|
14
|
+
firstRead: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const ALICE: SessionUser;
|
|
17
|
+
export declare const BOB: SessionUser;
|
|
18
|
+
export declare function sessionResponse(user: SessionUser): Response;
|
|
19
|
+
export declare function transientSessionFailure(): Response;
|
|
20
|
+
export declare function designsResponse(title: string): Response;
|
|
21
|
+
export declare function memoryStorage(): {
|
|
22
|
+
records: Map<string, PersistedClient>;
|
|
23
|
+
storage: ActionQueryCacheStorage;
|
|
24
|
+
};
|
|
25
|
+
export declare function stubFetch(options: {
|
|
26
|
+
onSession: (request: number) => Promise<Response> | Response;
|
|
27
|
+
onAction: (request: number) => Promise<Response> | Response;
|
|
28
|
+
}): {
|
|
29
|
+
calls: {
|
|
30
|
+
kind: "session" | "action";
|
|
31
|
+
path: string;
|
|
32
|
+
}[];
|
|
33
|
+
sessionCount: () => number;
|
|
34
|
+
actionCount: () => number;
|
|
35
|
+
};
|
|
36
|
+
export declare function StatusProbe({ onStatus, }: {
|
|
37
|
+
onStatus: (value: {
|
|
38
|
+
status: string;
|
|
39
|
+
userId: string | undefined;
|
|
40
|
+
}) => void;
|
|
41
|
+
}): null;
|
|
42
|
+
export declare function mountProbe(GateComponent: Gate, queryClient: QueryClient, onRender: (value: ProbeRender) => void, onStatus?: (value: {
|
|
43
|
+
status: string;
|
|
44
|
+
userId: string | undefined;
|
|
45
|
+
}) => void): Promise<HTMLDivElement>;
|
|
46
|
+
export declare function settle(ms?: number): Promise<void>;
|
|
47
|
+
export declare function waitUntil(predicate: () => boolean, timeoutMs?: number): Promise<boolean>;
|
|
48
|
+
export declare function unmountAll(): Promise<void>;
|
|
49
|
+
export { QueryClient };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
+
import { act } from "react";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
import { vi } from "vitest";
|
|
6
|
+
import { useActionQuery } from "./use-action.js";
|
|
7
|
+
import { isSessionFromFirstRead, useSession } from "./use-session.js";
|
|
8
|
+
const roots = [];
|
|
9
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
10
|
+
let restoreLocalStorage;
|
|
11
|
+
function installLocalStorageForTest() {
|
|
12
|
+
if (restoreLocalStorage)
|
|
13
|
+
return;
|
|
14
|
+
const descriptor = Object.getOwnPropertyDescriptor(window, "localStorage");
|
|
15
|
+
Object.defineProperty(window, "localStorage", {
|
|
16
|
+
configurable: true,
|
|
17
|
+
value: {
|
|
18
|
+
length: 0,
|
|
19
|
+
setItem: () => { },
|
|
20
|
+
getItem: () => null,
|
|
21
|
+
removeItem: () => { },
|
|
22
|
+
clear: () => { },
|
|
23
|
+
key: () => null,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
restoreLocalStorage = () => {
|
|
27
|
+
if (descriptor)
|
|
28
|
+
Object.defineProperty(window, "localStorage", descriptor);
|
|
29
|
+
else
|
|
30
|
+
Reflect.deleteProperty(window, "localStorage");
|
|
31
|
+
restoreLocalStorage = undefined;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const ALICE = {
|
|
35
|
+
email: "alice@example.com",
|
|
36
|
+
userId: "user-alice",
|
|
37
|
+
orgId: "org-1",
|
|
38
|
+
testIdentity: false,
|
|
39
|
+
};
|
|
40
|
+
export const BOB = {
|
|
41
|
+
email: "bob@example.com",
|
|
42
|
+
userId: "user-bob",
|
|
43
|
+
orgId: "org-1",
|
|
44
|
+
testIdentity: false,
|
|
45
|
+
};
|
|
46
|
+
export function sessionResponse(user) {
|
|
47
|
+
return new Response(JSON.stringify(user), {
|
|
48
|
+
status: 200,
|
|
49
|
+
headers: { "Content-Type": "application/json" },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export function transientSessionFailure() {
|
|
53
|
+
return new Response("temporarily unavailable", { status: 503 });
|
|
54
|
+
}
|
|
55
|
+
export function designsResponse(title) {
|
|
56
|
+
return new Response(JSON.stringify({ designs: [{ title }] }), {
|
|
57
|
+
status: 200,
|
|
58
|
+
headers: {
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
"X-Agent-Native-Browser-Persist": "allow",
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export function memoryStorage() {
|
|
65
|
+
const records = new Map();
|
|
66
|
+
const storage = {
|
|
67
|
+
get: async (key) => records.get(key),
|
|
68
|
+
set: async (key, value) => {
|
|
69
|
+
records.set(key, value);
|
|
70
|
+
},
|
|
71
|
+
del: async (key) => {
|
|
72
|
+
records.delete(key);
|
|
73
|
+
},
|
|
74
|
+
keys: async () => [...records.keys()],
|
|
75
|
+
clear: async () => {
|
|
76
|
+
records.clear();
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
return { records, storage };
|
|
80
|
+
}
|
|
81
|
+
export function stubFetch(options) {
|
|
82
|
+
let sessionRequests = 0;
|
|
83
|
+
let actionRequests = 0;
|
|
84
|
+
const calls = [];
|
|
85
|
+
vi.stubGlobal("fetch", vi.fn(async (input) => {
|
|
86
|
+
const raw = typeof input === "object" && "url" in input
|
|
87
|
+
? String(input.url)
|
|
88
|
+
: String(input);
|
|
89
|
+
const url = new URL(raw, window.location.href);
|
|
90
|
+
calls.push({ kind: "session", path: url.pathname });
|
|
91
|
+
if (url.pathname.endsWith("/_agent-native/auth/session")) {
|
|
92
|
+
sessionRequests += 1;
|
|
93
|
+
calls[calls.length - 1].kind = "session";
|
|
94
|
+
return options.onSession(sessionRequests);
|
|
95
|
+
}
|
|
96
|
+
if (url.pathname.includes("/_agent-native/actions/")) {
|
|
97
|
+
actionRequests += 1;
|
|
98
|
+
calls[calls.length - 1].kind = "action";
|
|
99
|
+
return options.onAction(actionRequests);
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Unexpected fetch in private probe: ${url.pathname}`);
|
|
102
|
+
}));
|
|
103
|
+
return {
|
|
104
|
+
calls,
|
|
105
|
+
sessionCount: () => sessionRequests,
|
|
106
|
+
actionCount: () => actionRequests,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function DesignsProbe({ onRender, }) {
|
|
110
|
+
const { status, session } = useSession();
|
|
111
|
+
const query = useActionQuery("list-designs");
|
|
112
|
+
const title = query.data?.designs[0]?.title;
|
|
113
|
+
onRender({
|
|
114
|
+
title,
|
|
115
|
+
status,
|
|
116
|
+
userId: session?.userId,
|
|
117
|
+
firstRead: isSessionFromFirstRead(),
|
|
118
|
+
});
|
|
119
|
+
return _jsx("span", { "data-result": true, children: title ?? "pending" });
|
|
120
|
+
}
|
|
121
|
+
export function StatusProbe({ onStatus, }) {
|
|
122
|
+
const { status, session } = useSession();
|
|
123
|
+
onStatus({ status, userId: session?.userId });
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
export async function mountProbe(GateComponent, queryClient, onRender, onStatus) {
|
|
127
|
+
installLocalStorageForTest();
|
|
128
|
+
const container = document.createElement("div");
|
|
129
|
+
document.body.appendChild(container);
|
|
130
|
+
const root = createRoot(container);
|
|
131
|
+
roots.push({ root, container });
|
|
132
|
+
await act(async () => root.render(_jsxs(QueryClientProvider, { client: queryClient, children: [onStatus ? _jsx(StatusProbe, { onStatus: onStatus }) : null, _jsx(GateComponent, { children: _jsx(DesignsProbe, { onRender: onRender }) })] })));
|
|
133
|
+
return container;
|
|
134
|
+
}
|
|
135
|
+
export async function settle(ms = 20) {
|
|
136
|
+
await act(async () => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
137
|
+
}
|
|
138
|
+
export async function waitUntil(predicate, timeoutMs = 4_000) {
|
|
139
|
+
const deadline = Date.now() + timeoutMs;
|
|
140
|
+
while (!predicate() && Date.now() < deadline)
|
|
141
|
+
await settle(20);
|
|
142
|
+
return predicate();
|
|
143
|
+
}
|
|
144
|
+
export async function unmountAll() {
|
|
145
|
+
for (const { root, container } of roots.splice(0)) {
|
|
146
|
+
await act(async () => root.unmount());
|
|
147
|
+
container.remove();
|
|
148
|
+
}
|
|
149
|
+
restoreLocalStorage?.();
|
|
150
|
+
}
|
|
151
|
+
export { QueryClient };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { beforeEach } from "vitest";
|
|
2
|
+
const epochKey = "agent-native.action-query-cache.epoch";
|
|
3
|
+
const values = new Map();
|
|
4
|
+
const localStorageShim = {
|
|
5
|
+
get length() {
|
|
6
|
+
return values.size;
|
|
7
|
+
},
|
|
8
|
+
key(index) {
|
|
9
|
+
return [...values.keys()][index] ?? null;
|
|
10
|
+
},
|
|
11
|
+
getItem(key) {
|
|
12
|
+
return values.get(key) ?? null;
|
|
13
|
+
},
|
|
14
|
+
setItem(key, value) {
|
|
15
|
+
values.set(key, value);
|
|
16
|
+
},
|
|
17
|
+
removeItem(key) {
|
|
18
|
+
values.delete(key);
|
|
19
|
+
},
|
|
20
|
+
clear() {
|
|
21
|
+
values.clear();
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
values.clear();
|
|
26
|
+
values.set(epochKey, TEST_CACHE_EPOCH);
|
|
27
|
+
const global = globalThis;
|
|
28
|
+
if (!global.window) {
|
|
29
|
+
Object.defineProperty(globalThis, "window", {
|
|
30
|
+
configurable: true,
|
|
31
|
+
value: { localStorage: localStorageShim },
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(global.window, "localStorage", {
|
|
36
|
+
configurable: true,
|
|
37
|
+
value: localStorageShim,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export const TEST_CACHE_EPOCH = "cache-test-epoch";
|
|
41
|
+
const CURRENT_CACHE_BUSTER = "action-query-cache-v1";
|
|
42
|
+
const CACHE_EPOCH_KEY = "agent-native.action-query-cache.epoch";
|
|
43
|
+
function currentTestEpoch() {
|
|
44
|
+
try {
|
|
45
|
+
return window.localStorage.getItem(CACHE_EPOCH_KEY) ?? TEST_CACHE_EPOCH;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return TEST_CACHE_EPOCH;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function cacheBuster(buster = CURRENT_CACHE_BUSTER) {
|
|
52
|
+
if (buster === CURRENT_CACHE_BUSTER) {
|
|
53
|
+
return `${CURRENT_CACHE_BUSTER}:${currentTestEpoch()}`;
|
|
54
|
+
}
|
|
55
|
+
return buster;
|
|
56
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Query, UseQueryOptions, UseMutationOptions } from "@tanstack/react-query";
|
|
1
|
+
import type { Query, QueryClient, UseQueryOptions, UseMutationOptions } from "@tanstack/react-query";
|
|
2
2
|
/** @internal exported for tests */
|
|
3
3
|
export declare function defaultActionQueryRetry(failureCount: number, error: unknown): boolean;
|
|
4
4
|
/** @internal alias kept for existing specs. */
|
|
@@ -105,10 +105,18 @@ export declare function guardActionQueryRefetchInterval<TData = unknown>(refetch
|
|
|
105
105
|
export declare function resolveActionQueryRetry(retry: unknown, failureCount: number, error: unknown): boolean;
|
|
106
106
|
/** @internal exported for tests */
|
|
107
107
|
export declare function resetActionCircuitTripEventsForTests(): void;
|
|
108
|
+
export declare function registerActionQueryCacheRevoker(client: QueryClient, revoke: () => void, bindingToken?: object): void;
|
|
109
|
+
/** @internal set only by the scoped action-query cache binder. */
|
|
110
|
+
export declare function setActionQueryCacheBindingToken(token: object | undefined): void;
|
|
111
|
+
export declare function setAccessDeniedActionQueryBinding(query: Query, token: object | undefined): void;
|
|
112
|
+
export declare function getAccessDeniedActionQueryBinding(query: Query): object | undefined;
|
|
113
|
+
export declare function clearAccessDeniedActionQueryBinding(query: Query): void;
|
|
108
114
|
/** @internal read by the persisted query cache. */
|
|
109
115
|
export declare function isBrowserPersistableActionQuery(query: Query): boolean;
|
|
116
|
+
/** @internal a response is persistable only in the binding active at fetch start. */
|
|
117
|
+
export declare function isBrowserPersistableActionQueryForBinding(query: Query, token: object): boolean;
|
|
110
118
|
/** @internal used only after a persisted action result is accepted and hydrated. */
|
|
111
|
-
export declare function markRestoredBrowserPersistableActionQuery(query: Query): void;
|
|
119
|
+
export declare function markRestoredBrowserPersistableActionQuery(query: Query, token?: object): void;
|
|
112
120
|
export declare function revokeBrowserPersistableActionQuery(query: Query): void;
|
|
113
121
|
export declare function useActionQuery<TResult = undefined, TName extends ActionName = ActionName>(actionName: TName, params?: ActionParams<TName>, options?: Omit<UseQueryOptions<TResult extends undefined ? ActionResult<TName> : TResult>, "queryKey" | "queryFn"> & {
|
|
114
122
|
queryKeyScope?: readonly unknown[];
|
|
@@ -776,18 +776,60 @@ function trackActionCircuitTrip(actionName, error, trip) {
|
|
|
776
776
|
}
|
|
777
777
|
// Identical keys in another client or auth scope must earn their own permission.
|
|
778
778
|
const browserPersistableActionQueries = new WeakSet();
|
|
779
|
+
const browserPersistableActionQueryBindings = new WeakMap();
|
|
780
|
+
const actionQueryCacheRevokers = new WeakMap();
|
|
781
|
+
const actionQueryCacheBindingRevokers = new WeakMap();
|
|
782
|
+
let actionQueryCacheBindingToken;
|
|
783
|
+
export function registerActionQueryCacheRevoker(client, revoke, bindingToken) {
|
|
784
|
+
actionQueryCacheRevokers.set(client, revoke);
|
|
785
|
+
if (bindingToken)
|
|
786
|
+
actionQueryCacheBindingRevokers.set(bindingToken, revoke);
|
|
787
|
+
}
|
|
788
|
+
function revokeActionQueryCacheForClient(client, bindingToken) {
|
|
789
|
+
const bindingRevoker = bindingToken
|
|
790
|
+
? actionQueryCacheBindingRevokers.get(bindingToken)
|
|
791
|
+
: undefined;
|
|
792
|
+
(bindingRevoker ?? actionQueryCacheRevokers.get(client))?.();
|
|
793
|
+
}
|
|
794
|
+
/** @internal set only by the scoped action-query cache binder. */
|
|
795
|
+
export function setActionQueryCacheBindingToken(token) {
|
|
796
|
+
actionQueryCacheBindingToken = token;
|
|
797
|
+
}
|
|
798
|
+
const accessDeniedActionQueryBindings = new WeakMap();
|
|
799
|
+
export function setAccessDeniedActionQueryBinding(query, token) {
|
|
800
|
+
if (token)
|
|
801
|
+
accessDeniedActionQueryBindings.set(query, token);
|
|
802
|
+
else
|
|
803
|
+
accessDeniedActionQueryBindings.delete(query);
|
|
804
|
+
}
|
|
805
|
+
export function getAccessDeniedActionQueryBinding(query) {
|
|
806
|
+
return accessDeniedActionQueryBindings.get(query);
|
|
807
|
+
}
|
|
808
|
+
export function clearAccessDeniedActionQueryBinding(query) {
|
|
809
|
+
accessDeniedActionQueryBindings.delete(query);
|
|
810
|
+
}
|
|
779
811
|
/** @internal read by the persisted query cache. */
|
|
780
812
|
export function isBrowserPersistableActionQuery(query) {
|
|
781
813
|
return (query.queryKey[0] === "action" &&
|
|
782
814
|
query.state.status === "success" &&
|
|
783
815
|
browserPersistableActionQueries.has(query));
|
|
784
816
|
}
|
|
817
|
+
/** @internal a response is persistable only in the binding active at fetch start. */
|
|
818
|
+
export function isBrowserPersistableActionQueryForBinding(query, token) {
|
|
819
|
+
return (isBrowserPersistableActionQuery(query) &&
|
|
820
|
+
browserPersistableActionQueryBindings.get(query) === token);
|
|
821
|
+
}
|
|
785
822
|
/** @internal used only after a persisted action result is accepted and hydrated. */
|
|
786
|
-
export function markRestoredBrowserPersistableActionQuery(query) {
|
|
823
|
+
export function markRestoredBrowserPersistableActionQuery(query, token) {
|
|
787
824
|
browserPersistableActionQueries.add(query);
|
|
825
|
+
if (token)
|
|
826
|
+
browserPersistableActionQueryBindings.set(query, token);
|
|
827
|
+
else
|
|
828
|
+
browserPersistableActionQueryBindings.delete(query);
|
|
788
829
|
}
|
|
789
830
|
export function revokeBrowserPersistableActionQuery(query) {
|
|
790
831
|
browserPersistableActionQueries.delete(query);
|
|
832
|
+
browserPersistableActionQueryBindings.delete(query);
|
|
791
833
|
}
|
|
792
834
|
export function useActionQuery(actionName, params, options) {
|
|
793
835
|
const apiDisabled = Boolean(agentNativeApiDisabledReason());
|
|
@@ -799,22 +841,49 @@ export function useActionQuery(actionName, params, options) {
|
|
|
799
841
|
queryFn: async ({ signal, client }) => {
|
|
800
842
|
const key = circuitKey();
|
|
801
843
|
const query = client.getQueryCache().find({ queryKey, exact: true });
|
|
844
|
+
const bindingTokenAtFetch = actionQueryCacheBindingToken;
|
|
802
845
|
assertActionCircuitClosed(key);
|
|
803
846
|
let browserPersist = false;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
847
|
+
let result;
|
|
848
|
+
try {
|
|
849
|
+
result = await actionFetch(actionName, "GET", params, {
|
|
850
|
+
signal,
|
|
851
|
+
onResponse: (response) => {
|
|
852
|
+
browserPersist =
|
|
853
|
+
response.headers.get(ACTION_BROWSER_PERSIST_HEADER) ===
|
|
854
|
+
ACTION_BROWSER_PERSIST_ALLOW;
|
|
855
|
+
},
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
const status = actionErrorStatus(error);
|
|
860
|
+
if (!signal.aborted &&
|
|
861
|
+
(status === 401 || status === 403 || status === 404)) {
|
|
862
|
+
if (query) {
|
|
863
|
+
setAccessDeniedActionQueryBinding(query, bindingTokenAtFetch);
|
|
864
|
+
revokeBrowserPersistableActionQuery(query);
|
|
865
|
+
query.setState({ data: undefined, dataUpdatedAt: 0 });
|
|
866
|
+
}
|
|
867
|
+
revokeActionQueryCacheForClient(client, bindingTokenAtFetch);
|
|
868
|
+
}
|
|
869
|
+
throw error;
|
|
870
|
+
}
|
|
812
871
|
resetActionFailureCircuit(key);
|
|
813
872
|
if (query && !signal.aborted) {
|
|
814
|
-
|
|
873
|
+
clearAccessDeniedActionQueryBinding(query);
|
|
874
|
+
if (browserPersist) {
|
|
815
875
|
browserPersistableActionQueries.add(query);
|
|
816
|
-
|
|
817
|
-
|
|
876
|
+
if (bindingTokenAtFetch !== undefined &&
|
|
877
|
+
actionQueryCacheBindingToken === bindingTokenAtFetch) {
|
|
878
|
+
browserPersistableActionQueryBindings.set(query, bindingTokenAtFetch);
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
browserPersistableActionQueryBindings.delete(query);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
revokeBrowserPersistableActionQuery(query);
|
|
886
|
+
}
|
|
818
887
|
}
|
|
819
888
|
return result;
|
|
820
889
|
},
|
|
@@ -38,19 +38,19 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
38
38
|
error: string;
|
|
39
39
|
states?: undefined;
|
|
40
40
|
} | {
|
|
41
|
-
error?: undefined;
|
|
42
41
|
states: {
|
|
43
42
|
clientId: number;
|
|
44
43
|
state: string;
|
|
45
44
|
}[];
|
|
45
|
+
error?: undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
48
48
|
error: string;
|
|
49
49
|
users?: undefined;
|
|
50
50
|
} | {
|
|
51
|
-
error?: undefined;
|
|
52
51
|
users: {
|
|
53
52
|
clientId: number;
|
|
54
53
|
lastSeen: number;
|
|
55
54
|
}[];
|
|
55
|
+
error?: undefined;
|
|
56
56
|
}>>;
|
|
@@ -11,9 +11,9 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
11
11
|
enabled?: undefined;
|
|
12
12
|
nextRun?: undefined;
|
|
13
13
|
} | {
|
|
14
|
-
deleted?: undefined;
|
|
15
14
|
name: string;
|
|
16
15
|
enabled: boolean;
|
|
17
16
|
nextRun: string;
|
|
17
|
+
deleted?: undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export default _default;
|
|
@@ -27,43 +27,43 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
27
27
|
thumbsUpRate: number;
|
|
28
28
|
avgEvalScore: number;
|
|
29
29
|
} | {
|
|
30
|
+
ok?: undefined;
|
|
30
31
|
error: string;
|
|
31
32
|
message: string;
|
|
32
33
|
summary?: undefined;
|
|
33
34
|
spans?: undefined;
|
|
34
|
-
ok?: undefined;
|
|
35
35
|
} | {
|
|
36
|
+
error?: undefined;
|
|
37
|
+
ok?: undefined;
|
|
36
38
|
message?: undefined;
|
|
37
39
|
summary: import("./types.js").TraceSummary;
|
|
38
40
|
spans: import("./types.js").TraceSpan[];
|
|
41
|
+
} | {
|
|
39
42
|
error?: undefined;
|
|
40
43
|
ok?: undefined;
|
|
41
|
-
} | {
|
|
42
44
|
message?: undefined;
|
|
43
45
|
summary?: undefined;
|
|
44
46
|
spans?: undefined;
|
|
45
47
|
traceMissing: true;
|
|
46
48
|
id: string;
|
|
49
|
+
} | {
|
|
47
50
|
error?: undefined;
|
|
48
51
|
ok?: undefined;
|
|
49
|
-
} | {
|
|
50
52
|
message?: undefined;
|
|
51
53
|
summary?: undefined;
|
|
52
54
|
spans?: undefined;
|
|
53
55
|
traceMissing?: undefined;
|
|
54
56
|
id: string;
|
|
55
|
-
error?: undefined;
|
|
56
|
-
ok?: undefined;
|
|
57
57
|
} | {
|
|
58
|
+
ok?: undefined;
|
|
58
59
|
message?: undefined;
|
|
59
60
|
summary?: undefined;
|
|
60
61
|
spans?: undefined;
|
|
61
62
|
error: any;
|
|
62
|
-
ok?: undefined;
|
|
63
63
|
} | {
|
|
64
|
+
error?: undefined;
|
|
64
65
|
message?: undefined;
|
|
65
66
|
summary?: undefined;
|
|
66
67
|
spans?: undefined;
|
|
67
|
-
error?: undefined;
|
|
68
68
|
ok: boolean;
|
|
69
69
|
}>>;
|
|
@@ -75,7 +75,7 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
-
|
|
78
|
+
id?: undefined;
|
|
79
79
|
found?: undefined;
|
|
80
80
|
providers: {
|
|
81
81
|
id: string;
|
|
@@ -90,42 +90,42 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
90
90
|
provider?: undefined;
|
|
91
91
|
deleted?: undefined;
|
|
92
92
|
registered?: undefined;
|
|
93
|
-
id?: undefined;
|
|
94
93
|
label?: undefined;
|
|
95
|
-
} | {
|
|
96
|
-
count?: undefined;
|
|
97
94
|
message?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
id?: undefined;
|
|
98
97
|
providers?: undefined;
|
|
98
|
+
count?: undefined;
|
|
99
99
|
found: boolean;
|
|
100
100
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
101
101
|
deleted?: undefined;
|
|
102
102
|
registered?: undefined;
|
|
103
|
-
id?: undefined;
|
|
104
103
|
label?: undefined;
|
|
105
|
-
} | {
|
|
106
|
-
count?: undefined;
|
|
107
104
|
message?: undefined;
|
|
105
|
+
} | {
|
|
108
106
|
providers?: undefined;
|
|
107
|
+
count?: undefined;
|
|
109
108
|
provider?: undefined;
|
|
110
109
|
found: boolean;
|
|
111
110
|
id: string;
|
|
112
111
|
deleted?: undefined;
|
|
113
112
|
registered?: undefined;
|
|
114
113
|
label?: undefined;
|
|
115
|
-
} | {
|
|
116
|
-
count?: undefined;
|
|
117
114
|
message?: undefined;
|
|
115
|
+
} | {
|
|
118
116
|
found?: undefined;
|
|
119
117
|
providers?: undefined;
|
|
118
|
+
count?: undefined;
|
|
120
119
|
provider?: undefined;
|
|
121
120
|
deleted: boolean;
|
|
122
121
|
id: string;
|
|
123
122
|
registered?: undefined;
|
|
124
123
|
label?: undefined;
|
|
124
|
+
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
count?: undefined;
|
|
127
126
|
found?: undefined;
|
|
128
127
|
providers?: undefined;
|
|
128
|
+
count?: undefined;
|
|
129
129
|
provider?: undefined;
|
|
130
130
|
deleted?: undefined;
|
|
131
131
|
registered: boolean;
|
|
@@ -311,7 +311,6 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
-
id?: undefined;
|
|
315
314
|
message?: undefined;
|
|
316
315
|
found?: undefined;
|
|
317
316
|
providers: {
|
|
@@ -327,21 +326,22 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
327
326
|
provider?: undefined;
|
|
328
327
|
deleted?: undefined;
|
|
329
328
|
registered?: undefined;
|
|
329
|
+
id?: undefined;
|
|
330
330
|
label?: undefined;
|
|
331
331
|
} | {
|
|
332
|
-
|
|
332
|
+
count?: undefined;
|
|
333
333
|
message?: undefined;
|
|
334
334
|
providers?: undefined;
|
|
335
|
-
count?: undefined;
|
|
336
335
|
found: boolean;
|
|
337
336
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
338
337
|
deleted?: undefined;
|
|
339
338
|
registered?: undefined;
|
|
339
|
+
id?: undefined;
|
|
340
340
|
label?: undefined;
|
|
341
341
|
} | {
|
|
342
|
+
count?: undefined;
|
|
342
343
|
message?: undefined;
|
|
343
344
|
providers?: undefined;
|
|
344
|
-
count?: undefined;
|
|
345
345
|
provider?: undefined;
|
|
346
346
|
found: boolean;
|
|
347
347
|
id: string;
|
|
@@ -349,19 +349,19 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
349
349
|
registered?: undefined;
|
|
350
350
|
label?: undefined;
|
|
351
351
|
} | {
|
|
352
|
+
count?: undefined;
|
|
352
353
|
message?: undefined;
|
|
353
354
|
found?: undefined;
|
|
354
355
|
providers?: undefined;
|
|
355
|
-
count?: undefined;
|
|
356
356
|
provider?: undefined;
|
|
357
357
|
deleted: boolean;
|
|
358
358
|
id: string;
|
|
359
359
|
registered?: undefined;
|
|
360
360
|
label?: undefined;
|
|
361
361
|
} | {
|
|
362
|
+
count?: undefined;
|
|
362
363
|
found?: undefined;
|
|
363
364
|
providers?: undefined;
|
|
364
|
-
count?: undefined;
|
|
365
365
|
provider?: undefined;
|
|
366
366
|
deleted?: undefined;
|
|
367
367
|
registered: boolean;
|
|
@@ -39,8 +39,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
39
39
|
error: string;
|
|
40
40
|
}>;
|
|
41
41
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
42
|
-
error: string;
|
|
43
42
|
ok?: undefined;
|
|
43
|
+
error: string;
|
|
44
44
|
} | {
|
|
45
45
|
error?: undefined;
|
|
46
46
|
ok: boolean;
|