@tokamaq/sdk 0.0.0-stage → 0.1.0-dev.2

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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1403 -2
  3. package/build-internals.ts +25 -0
  4. package/caller/agent-launch.ts +60 -0
  5. package/client.tsx +498 -0
  6. package/component-actions.ts +327 -0
  7. package/component-alerts.ts +136 -0
  8. package/component-attributes.ts +340 -0
  9. package/component-parts.tsx +1177 -0
  10. package/core-contracts/auth.ts +40 -0
  11. package/package.json +98 -4
  12. package/quit.ts +58 -0
  13. package/regions.tsx +94 -0
  14. package/screen-search.ts +211 -0
  15. package/send-file.ts +175 -0
  16. package/server-build-internals.ts +11 -0
  17. package/solid.ts +132 -0
  18. package/src/agent-command.ts +48 -0
  19. package/src/agent-info-cache.ts +34 -0
  20. package/src/agent-reports.ts +140 -0
  21. package/src/agent-turn.ts +289 -0
  22. package/src/api.ts +174 -0
  23. package/src/auth.ts +39 -0
  24. package/src/call-error.ts +37 -0
  25. package/src/caller-storage.ts +32 -0
  26. package/src/client.ts +163 -0
  27. package/src/database.ts +322 -0
  28. package/src/functions.ts +726 -0
  29. package/src/hooks.ts +141 -0
  30. package/src/host.ts +211 -0
  31. package/src/http-action.ts +55 -0
  32. package/src/index.ts +126 -0
  33. package/src/internal/contracts.ts +260 -0
  34. package/src/internal/machine-scope.ts +21 -0
  35. package/src/local.ts +22 -0
  36. package/src/plugin.ts +162 -0
  37. package/src/points.ts +79 -0
  38. package/src/protocol.ts +64 -0
  39. package/src/schema.ts +136 -0
  40. package/src/storage.ts +193 -0
  41. package/src/thread-context.ts +42 -0
  42. package/src/transport.ts +421 -0
  43. package/src/triggers.ts +87 -0
  44. package/src/unstable.ts +66 -0
  45. package/src/validators.ts +248 -0
  46. package/src/values.ts +98 -0
  47. package/src/visibility.ts +8 -0
  48. package/src/websocket-transport.ts +91 -0
  49. package/src/window-state-protocol.ts +7 -0
  50. package/src/within.ts +24 -0
  51. package/src/worker-limits.ts +5 -0
  52. package/tools/bundle.mjs +490 -0
  53. package/tools/client-entry.mjs +10 -0
  54. package/tools/contracts.mjs +254 -0
  55. package/tools/http-actions.mjs +42 -0
  56. package/tools/placement.mjs +535 -0
  57. package/tools/plugin-boundary.mjs +592 -0
  58. package/tools/plugin-compiler.mjs +125 -0
  59. package/tools/plugin-descriptor.ts +75 -0
  60. package/tools/points.mjs +340 -0
  61. package/tools/result-validator.mjs +83 -0
  62. package/tools/server-builtins.mjs +82 -0
  63. package/tools/server-files.mjs +34 -0
  64. package/tools/table-references.mjs +98 -0
  65. package/tools/worker.mjs +110 -0
  66. package/tsconfig.plugin-server.json +12 -0
  67. package/tsconfig.plugin-window.json +15 -0
  68. package/view.ts +27 -0
  69. package/web.d.ts +6 -0
  70. package/window-state-host.ts +228 -0
  71. package/window-state.ts +43 -0
package/src/hooks.ts ADDED
@@ -0,0 +1,141 @@
1
+ import { functionKind, functionName, type ArgsOf, type HookReference, type ResultOf } from "./api";
2
+ import {
3
+ action,
4
+ mutation,
5
+ query,
6
+ createFunctions,
7
+ invokeFunction,
8
+ type CallerActionContext,
9
+ type Failure,
10
+ type MutationContext,
11
+ type FunctionKind,
12
+ type QueryContext,
13
+ } from "./functions";
14
+ import type { HostBridge } from "./host";
15
+ import type { DataModel, ModelFromSchema, SchemaDefinition } from "./schema";
16
+ import { jsonSnapshot, type JsonObject, type JsonValue } from "./values";
17
+ import { Visibility } from "./visibility";
18
+
19
+ const hookBrand = Symbol("tokamaq.hook");
20
+
21
+ type Reference = HookReference<FunctionKind, unknown, unknown>;
22
+ type HookKind = "query" | "mutation" | "action";
23
+ type Context<T extends Reference, M extends DataModel> =
24
+ T extends HookReference<"action", unknown, unknown>
25
+ ? CallerActionContext
26
+ : T extends HookReference<"mutation", unknown, unknown>
27
+ ? MutationContext<M>
28
+ : QueryContext<M>;
29
+ type OwnerOf<T> =
30
+ T extends HookReference<FunctionKind, unknown, unknown, Visibility, infer Owner> ? Owner : never;
31
+ type HookStage = "before" | "after";
32
+ type MaybePromise<T> = T | Promise<T>;
33
+
34
+ type HookHandlers<T extends Reference, M extends DataModel> = {
35
+ before?: (ctx: Context<T, M>, args: ArgsOf<T>) => MaybePromise<ArgsOf<T> | Failure<string, JsonValue>>;
36
+ after?: T extends { readonly pointBeforeOnly: true }
37
+ ? never
38
+ : (ctx: Context<T, M>, result: ResultOf<T>, args: ArgsOf<T>) => MaybePromise<ResultOf<T>>;
39
+ };
40
+
41
+ interface HookDefinition<T extends Reference = Reference> {
42
+ readonly [hookBrand]: true;
43
+ readonly reference: T;
44
+ readonly kind: HookKind;
45
+ readonly target: string;
46
+ readonly before: boolean;
47
+ readonly after: boolean;
48
+ invoke(stage: HookStage, input: JsonObject, host: HostBridge, targetKind?: HookKind): Promise<JsonValue>;
49
+ }
50
+
51
+ type HookBuilder<M extends DataModel> = <T extends Reference>(
52
+ target: T &
53
+ (T extends HookReference<HookKind, unknown, unknown>
54
+ ? string extends OwnerOf<T>
55
+ ? { readonly error: "hooks must target another plugin" }
56
+ : unknown
57
+ : { readonly error: "only queries, mutations and actions can be hooked" }),
58
+ handlers: HookHandlers<NoInfer<T>, M>,
59
+ ) => HookDefinition<T>;
60
+
61
+ function hookBuilder<M extends DataModel>(schema?: SchemaDefinition): HookBuilder<M> {
62
+ return (reference, handlers) => {
63
+ const target = reference[functionName];
64
+ const kind = reference[functionKind] ?? "query";
65
+ const functions = schema ? createFunctions(schema) : { query, mutation, action };
66
+ return Object.freeze({
67
+ [hookBrand]: true as const,
68
+ reference,
69
+ kind,
70
+ target,
71
+ before: !!handlers.before,
72
+ after: !!handlers.after,
73
+ invoke(stage: HookStage, input: JsonObject, host: HostBridge, targetKind = kind) {
74
+ const handler = async (context: unknown) => {
75
+ type Ctx = Parameters<NonNullable<typeof handlers.before>>[0];
76
+ const ctx = context as Ctx;
77
+ const value = await (stage === "before"
78
+ ? handlers.before!(ctx, input.args as never)
79
+ : handlers.after!(ctx as never, input.result as never, input.args as never));
80
+ return target.includes("#") && value !== undefined
81
+ ? jsonSnapshot(value, "point hook result", Infinity, true)
82
+ : value;
83
+ };
84
+ const definition =
85
+ targetKind === "action"
86
+ ? functions.action({ handler })
87
+ : targetKind === "mutation"
88
+ ? functions.mutation({ handler })
89
+ : functions.query({ handler });
90
+ return invokeFunction({ hook: definition }, { name: "hook", args: {} }, host);
91
+ },
92
+ });
93
+ };
94
+ }
95
+
96
+ export const hook = hookBuilder<Record<string, JsonObject>>();
97
+
98
+ export function createHook<S extends SchemaDefinition>(schema: S): HookBuilder<ModelFromSchema<S>> {
99
+ return hookBuilder(schema);
100
+ }
101
+
102
+ export function createHookRegistry(modules: Record<string, object>, kinds: Record<string, HookKind> = {}) {
103
+ return Object.fromEntries(
104
+ Object.entries(modules).flatMap(([module, exports]) =>
105
+ Object.entries(exports).flatMap(([name, value]) =>
106
+ value?.[hookBrand] === true
107
+ ? [
108
+ [
109
+ `${module}:${name}`,
110
+ { ...value, kind: kinds[`${module}:${name}`] ?? value.kind } as HookDefinition,
111
+ ] as const,
112
+ ]
113
+ : [],
114
+ ),
115
+ ),
116
+ );
117
+ }
118
+
119
+ export type HookRegistry = ReturnType<typeof createHookRegistry>;
120
+
121
+ export function hookMetadata(hooks: HookRegistry) {
122
+ return Object.entries(hooks).map(([name, { target, kind, before, after }]) => ({
123
+ name,
124
+ target,
125
+ kind,
126
+ before,
127
+ after,
128
+ }));
129
+ }
130
+
131
+ export function invokeHook(
132
+ hooks: HookRegistry,
133
+ request: { name: string; target?: string; stage: HookStage; args: JsonValue; result?: JsonValue },
134
+ host: HostBridge,
135
+ ) {
136
+ const hook = Object.hasOwn(hooks, request.name) ? hooks[request.name] : undefined;
137
+ if (!hook?.[request.stage] || (request.target !== undefined && request.target !== hook.target)) {
138
+ throw new Error(`Unknown hook stage: ${request.name}`);
139
+ }
140
+ return hook.invoke(request.stage, request, host, hook.kind);
141
+ }
package/src/host.ts ADDED
@@ -0,0 +1,211 @@
1
+ // This is the host operation contract, not a transport protocol. The runtime
2
+ // converts serde_json at the boundary and injects a bridge bound to ONE call.
3
+ // The host must reject expired calls and query writes, and own transactions;
4
+ // a feature must never obtain a process-global database capability.
5
+ import type { Id, JsonObject, JsonValue } from "./values";
6
+ import { assertJson } from "./values";
7
+
8
+ export type StoredDocument = JsonObject & { _id: Id; _creationTime: number };
9
+
10
+ export interface EqualityClause {
11
+ field: string;
12
+ value: JsonValue;
13
+ }
14
+
15
+ export interface RangeClause extends EqualityClause {
16
+ operator: "gt" | "gte" | "lt" | "lte";
17
+ }
18
+
19
+ export interface IndexQuery {
20
+ name: string;
21
+ eq: EqualityClause[];
22
+ range: RangeClause[];
23
+ }
24
+
25
+ export interface QueryRequest {
26
+ table: string;
27
+ where: EqualityClause[];
28
+ index?: IndexQuery;
29
+ order: "asc" | "desc";
30
+ limit: number | null;
31
+ }
32
+
33
+ /**
34
+ * Sole source for names and payload/result shapes used by the SDK and host.
35
+ * where clauses are ANDed, with JSON structural equality (object key order is
36
+ * irrelevant). Fields are top-level names, not SurrealQL or dotted paths.
37
+ * Unindexed queries sort by (_creationTime, _id). Indexed queries sort by index
38
+ * fields and ID; eq follows the leading fields, range bounds the next field.
39
+ * Indexed requests require an empty where array.
40
+ * Missing get -> null; missing patch/replace -> error; missing delete -> null.
41
+ * Patch merges top-level keys; replace preserves _id and _creationTime.
42
+ * Writes cannot supply system fields. No undefined/delete-field sentinel.
43
+ */
44
+ export interface HostOperations {
45
+ "user.current": { args: {}; result: import("./functions").User };
46
+ "auth.current": {
47
+ args: { call?: true };
48
+ result: (import("./functions").CallContext & { hookPoints?: readonly string[] }) | null;
49
+ };
50
+ "point.stage": {
51
+ args: { name: string; stage: "before" | "after" | "collect"; args: JsonValue; result?: JsonValue };
52
+ result: JsonValue;
53
+ };
54
+ "crypto.hashPassword": { args: { password: string }; result: string };
55
+ "crypto.verifyPassword": { args: { password: string; hash: string }; result: boolean };
56
+ "crypto.verifyAndRehashPassword": {
57
+ args: { password: string; hash: string };
58
+ result: { valid: boolean; replacementHash?: string };
59
+ };
60
+ "db.get": { args: { id: string }; result: StoredDocument | null };
61
+ "db.insert": { args: { table: string; value: JsonObject }; result: Id };
62
+ "db.patch": { args: { id: string; value: JsonObject }; result: null };
63
+ "db.replace": { args: { id: string; value: JsonObject }; result: null };
64
+ "db.delete": { args: { id: string }; result: null };
65
+ "db.query": { args: QueryRequest; result: StoredDocument[] };
66
+ "storage.get": { args: { id: string }; result: import("./storage").FileRecord | null };
67
+ "storage.byPath": { args: { path: string }; result: import("./storage").FileRecord | null };
68
+ "storage.list": { args: { prefix?: string }; result: import("./storage").FileRecord[] };
69
+ "storage.url": { args: { id: string }; result: string | null };
70
+ "storage.upload": { args: { field: string; path?: string; name?: string }; result: { url: string } };
71
+ "storage.uploadFile": {
72
+ args: { localPath: string; field: string; path?: string; name?: string };
73
+ result: string;
74
+ };
75
+ "storage.downloadTo": { args: { id: string; localPath: string }; result: null };
76
+ "storage.delete": { args: { id: string }; result: null };
77
+ "storage.readChunk": { args: { id: string; offset: number }; result: { size: number; chunk: string } };
78
+ "storage.beginStore": {
79
+ args: { field: string; length: number; path?: string; name?: string; type?: string };
80
+ result: string;
81
+ };
82
+ "storage.appendStore": { args: { upload: string; chunk: string }; result: null };
83
+ "storage.finishStore": { args: { upload: string }; result: string };
84
+ "storage.abortStore": { args: { upload: string }; result: null };
85
+ "machines.list": { args: {}; result: import("./unstable").MachineEntry[] };
86
+ "machines.listAll": { args: {}; result: import("./unstable").MachineEntry[] };
87
+ "machines.create": {
88
+ args: { name: string; member?: string };
89
+ result: import("./unstable").MachineCreation;
90
+ };
91
+ "machines.remove": {
92
+ args: { id: import("./functions").MachineId };
93
+ result: null | import("./functions").Failure<"machineForbidden", null>;
94
+ };
95
+ "machines.waitOnline": {
96
+ args: { id: import("./functions").MachineId; timeoutMs?: number };
97
+ result: null | import("./functions").Failure<"machineForbidden" | "machineOffline", null>;
98
+ };
99
+ "server.url": { args: {}; result: string | null };
100
+ "action.env": { args: { name: string }; result: string | null };
101
+ "action.runQuery": { args: { name: string; args: JsonValue }; result: JsonValue };
102
+ "action.runMutation": { args: { name: string; args: JsonValue }; result: JsonValue };
103
+ "local.contracts": {
104
+ args: { name: string; owner?: string };
105
+ result: (
106
+ | {
107
+ plugin: string;
108
+ registration: string;
109
+ own: boolean;
110
+ path?: string;
111
+ owner: string;
112
+ build?: string;
113
+ unavailable?: string;
114
+ incompatible?: never;
115
+ }
116
+ | { plugin: string; incompatible: true }
117
+ )[];
118
+ };
119
+ "local.contract.call": {
120
+ args: {
121
+ plugin: string;
122
+ owner: string;
123
+ name: string;
124
+ registration: string;
125
+ method: string;
126
+ invocationSignal?: true;
127
+ args: JsonValue[];
128
+ };
129
+ result: JsonValue;
130
+ };
131
+ "local.contract.describe": {
132
+ args: { plugin: string; owner: string; name: string; registration: string };
133
+ result: { data: JsonObject; methods: string[] };
134
+ };
135
+ "local.contract.peer": {
136
+ args: { channel?: number; method: string; args: JsonValue };
137
+ result: JsonValue;
138
+ };
139
+ "local.contract.close": { args: { channel: number }; result: null };
140
+ "local.contract.stopPrograms": { args: { channel: number }; result: null };
141
+ "plugin.call": {
142
+ args: {
143
+ name: string;
144
+ args: JsonValue;
145
+ kind?: import("./functions").FunctionKind;
146
+ contract?: string;
147
+ on?: import("./functions").ActionTarget;
148
+ };
149
+ result: JsonValue;
150
+ };
151
+ "contract.list": {
152
+ args: { name: string; owner?: string };
153
+ result: { id: string; data: JsonObject; methods: Record<string, string> }[];
154
+ };
155
+ }
156
+
157
+ export type HostOperation = keyof HostOperations;
158
+
159
+ /** Structural AbortSignal subset keeps the portable SDK free of DOM globals. */
160
+ export interface ActionSignal {
161
+ readonly aborted: boolean;
162
+ addEventListener(type: "abort", listener: () => void, options?: { once?: boolean }): void;
163
+ removeEventListener(type: "abort", listener: () => void): void;
164
+ }
165
+
166
+ export interface HostBridge {
167
+ /** The generated bundle entry binds the installed schema, even for loose builders. */
168
+ readonly bundleSchema?: import("./schema").SchemaDefinition;
169
+ readonly hookPoints?: readonly string[];
170
+ readonly pointOwner?: { name: string; declared?: readonly string[] };
171
+ readonly call?: import("./functions").CallContext | null;
172
+ readonly auth?: import("./functions").AuthContext | null;
173
+ readonly user?: import("./functions").User;
174
+ readonly signal?: ActionSignal;
175
+ readonly retiring?: ActionSignal;
176
+ readonly proc?: import("./local").LocalProcess;
177
+ readonly contracts?: import("./internal/contracts").ContractScope;
178
+ readonly channel?: {
179
+ open(payload: HostOperations["local.contract.call"]["args"], receive: ChannelHandler): LocalChannel;
180
+ receive(handler: ChannelHandler): void;
181
+ send: ChannelHandler;
182
+ };
183
+ readonly withPrograms?: <T>(
184
+ run: (forceStop: () => Promise<void>, host: HostBridge) => Promise<T>,
185
+ ) => Promise<T>;
186
+ /** Reject on errors. Values cross once, without an extra JSON string envelope. */
187
+ op(name: HostOperation, payload: JsonValue, signal?: ActionSignal): JsonValue | Promise<JsonValue>;
188
+ }
189
+
190
+ export type ChannelHandler = (method: string, args: JsonValue) => Promise<JsonValue> | JsonValue;
191
+ export interface LocalChannel {
192
+ readonly result: Promise<JsonValue>;
193
+ send(method: string, args: JsonValue): Promise<JsonValue>;
194
+ close(): Promise<void>;
195
+ stopPrograms(): Promise<void>;
196
+ }
197
+
198
+ export type RunnerCapability = "serverContracts" | "privateFunctions";
199
+
200
+ /** Keep operation call sites tied to the contract even though the bridge is erased. */
201
+ export async function callHost<K extends HostOperation>(
202
+ host: HostBridge,
203
+ name: K,
204
+ payload: HostOperations[K]["args"],
205
+ signal?: ActionSignal,
206
+ ): Promise<HostOperations[K]["result"]> {
207
+ assertJson(payload, `${name} payload`);
208
+ const result = await host.op(name, payload, signal);
209
+ assertJson(result, `${name} result`);
210
+ return result as HostOperations[K]["result"];
211
+ }
@@ -0,0 +1,55 @@
1
+ import { bindActionCall, type ActionContext } from "./functions";
2
+ import { callHost, type HostBridge } from "./host";
3
+ import { createStorage } from "./storage";
4
+
5
+ const httpActionBrand = Symbol("tokamaq.httpAction");
6
+
7
+ // Resolve the platform types in the author's project so the portable SDK can
8
+ // still be checked without the optional web declarations.
9
+ type WebType<K extends string> = typeof globalThis extends Record<K, { prototype: infer T }> ? T : never;
10
+
11
+ type HttpActionCapabilities = Pick<
12
+ ActionContext,
13
+ "runQuery" | "runMutation" | "runAction" | "env" | "storage"
14
+ >;
15
+
16
+ export interface HttpActionContext extends HttpActionCapabilities {
17
+ readonly serverUrl: string;
18
+ readonly path: string;
19
+ readonly originalHost: string | null;
20
+ readonly params: Readonly<Record<string, string>>;
21
+ }
22
+
23
+ export interface HttpActionDefinition<Path extends string = string> {
24
+ readonly [httpActionBrand]: true;
25
+ readonly path: Path;
26
+ readonly handler: (
27
+ ctx: HttpActionContext,
28
+ request: WebType<"Request">,
29
+ ) => WebType<"Response"> | Promise<WebType<"Response">>;
30
+ }
31
+
32
+ /** Declare an HTTP route in the plugin's server part. */
33
+ export function httpAction<const Path extends string>(
34
+ definition: Omit<HttpActionDefinition<Path>, typeof httpActionBrand>,
35
+ ): HttpActionDefinition<Path> {
36
+ return Object.freeze({ ...definition, [httpActionBrand]: true as const });
37
+ }
38
+
39
+ // The generated HTTP entry passes a request-scoped host bridge, never a global.
40
+ export function bindHttpAction({ handler }: HttpActionDefinition) {
41
+ return (
42
+ context: Omit<HttpActionContext, keyof HttpActionCapabilities>,
43
+ request: WebType<"Request">,
44
+ bridge: HostBridge,
45
+ ) => {
46
+ const capabilities = {
47
+ storage: createStorage(bridge, "action"),
48
+ runQuery: bindActionCall(bridge, "query"),
49
+ runMutation: bindActionCall(bridge, "mutation"),
50
+ runAction: bindActionCall(bridge, "action"),
51
+ env: (name: string) => callHost(bridge, "action.env", { name }),
52
+ } as HttpActionCapabilities;
53
+ return handler(Object.freeze(Object.assign(context, capabilities)), request);
54
+ };
55
+ }
package/src/index.ts ADDED
@@ -0,0 +1,126 @@
1
+ // Public portable SDK. Build-time helpers stay in tools/ and are not exported,
2
+ // so importing the SDK in QuickJS cannot load Bun or Node tooling.
3
+ export { point } from "./points";
4
+ export { hook, createHook, createHookRegistry, hookMetadata, invokeHook } from "./hooks";
5
+ export { trigger, createTrigger, createTriggerRegistry, triggerMetadata, invokeTrigger } from "./triggers";
6
+ export type { TriggerChange } from "./triggers";
7
+ export { v, validate } from "./validators";
8
+ export { contract, provide } from "./internal/contracts";
9
+ export type { Contract, ContractTarget, Provider } from "./internal/contracts";
10
+
11
+ export { definePlugin } from "./plugin";
12
+ export type { PluginDefinition } from "./plugin";
13
+ export type {
14
+ Validator,
15
+ ValidatorDescription,
16
+ TableReference,
17
+ TableDocument,
18
+ Fields,
19
+ Infer,
20
+ ObjectValue,
21
+ } from "./validators";
22
+
23
+ export { defineSchema, defineTable, schemaMetadata } from "./schema";
24
+ export type {
25
+ SchemaDefinition,
26
+ TableDefinition,
27
+ IndexDefinition,
28
+ DataModel,
29
+ ModelFromSchema,
30
+ } from "./schema";
31
+
32
+ export {
33
+ query,
34
+ mutation,
35
+ action,
36
+ internalQuery,
37
+ internalMutation,
38
+ internalAction,
39
+ pluginOnly,
40
+ fail,
41
+ isFailure,
42
+ createFunctions,
43
+ createRegistry,
44
+ functionMetadata,
45
+ invokeFunction,
46
+ FALLBACK_LOCAL_DEVICE,
47
+ LOCAL_USER,
48
+ SERVER_DEVICE_ID,
49
+ isServerCall,
50
+ } from "./functions";
51
+ export type {
52
+ FunctionDefinition,
53
+ Failure,
54
+ FunctionKind,
55
+ FunctionBuilder,
56
+ FunctionRegistry,
57
+ QueryContext,
58
+ User,
59
+ Device,
60
+ AuthContext,
61
+ CallContext,
62
+ MutationContext,
63
+ ActionContext,
64
+ CallerActionContext,
65
+ ActionTarget,
66
+ MachineId,
67
+ ActionOptions,
68
+ MachineFailure,
69
+ PluginCalls,
70
+ WireResult,
71
+ } from "./functions";
72
+ export type { LocalProcess, LocalProcessOptions, RunningProcess } from "./local";
73
+ export { within, TIMED_OUT } from "./within";
74
+
75
+ export type {
76
+ DatabaseReader,
77
+ DatabaseWriter,
78
+ Doc,
79
+ TableQuery,
80
+ FilteredQuery,
81
+ QueryResult,
82
+ IndexRange,
83
+ IndexBounds,
84
+ } from "./database";
85
+
86
+ export type {
87
+ HostBridge,
88
+ ActionSignal,
89
+ HostOperations,
90
+ HostOperation,
91
+ StoredDocument,
92
+ EqualityClause,
93
+ RangeClause,
94
+ IndexQuery,
95
+ QueryRequest,
96
+ } from "./host";
97
+
98
+ export { createApi, functionName } from "./api";
99
+ export type {
100
+ FunctionReference,
101
+ ApiFromModule,
102
+ QualifiedPluginApi,
103
+ InternalFromModule,
104
+ PluginFunctionsFromModule,
105
+ ReferenceFromDefinition,
106
+ HookReferenceFromDefinition,
107
+ PointReference,
108
+ ArgsOf,
109
+ ResultOf,
110
+ } from "./api";
111
+
112
+ export { TokamaqClient } from "./client";
113
+ export { authCaller, memberFields, onMember } from "./auth";
114
+ export type { MemberHook } from "./auth";
115
+ export type { ClientTransport, LocalTransport, SubscriptionEvent } from "./client";
116
+ export { isLocalReloadTimeout, LocalReloadTimeout } from "./client";
117
+ export { InProcessTransport, WebSocketTransport, RemoteFunctionError } from "./transport";
118
+ export { threadRecordBytes, threadPrompt } from "./thread-context";
119
+ export type { MessageConnection, ClientWebSocket } from "./transport";
120
+ export type { Request, Event } from "./protocol";
121
+
122
+ export type { Id, JsonValue, JsonObject } from "./values";
123
+ export { httpAction, type HttpActionContext, type HttpActionDefinition } from "./http-action";
124
+
125
+ export type { ActionStorage, FileRecord, StorageReader, StorageWriter } from "./storage";
126
+ export type { CallerStorage } from "./caller-storage";