stitchkit 0.68.0 → 0.68.1
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/agent-runtime/admission-lanes.d.ts +1 -1
- package/dist/agent-runtime/compaction.d.ts +2 -2
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/history.d.ts +1 -1
- package/dist/agent-runtime/history.d.ts.map +1 -1
- package/dist/agent-runtime/injection.d.ts +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -3
- package/dist/agent-runtime/models.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/prompt.d.ts +1 -1
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/protocol.d.ts +19 -1
- package/dist/agent-runtime/protocol.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts +5 -5
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +1 -1
- package/dist/agent-runtime/runtime-result.d.ts +1 -1
- package/dist/agent-runtime/runtime.d.ts +14 -12
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +2 -2
- package/dist/agent-runtime/store.d.ts +2 -2
- package/dist/agent-runtime/terminal-commit.d.ts +2 -2
- package/dist/agent-runtime/terminal-status.d.ts +1 -1
- package/dist/agent-runtime-openrouter.d.ts +1 -1
- package/dist/agent-runtime.d.ts +15 -15
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +87 -26
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/events.d.ts +2 -2
- package/dist/application/grammy.d.ts +2 -2
- package/dist/application/graph.d.ts +1 -1
- package/dist/application/health.d.ts +1 -1
- package/dist/application/kernel.d.ts +3 -3
- package/dist/application/opentelemetry.d.ts +3 -3
- package/dist/application/resource.d.ts +1 -1
- package/dist/application/schedule.d.ts +1 -1
- package/dist/application/server-resource.d.ts +7 -9
- package/dist/application/server-resource.d.ts.map +1 -1
- package/dist/application-grammy.d.ts +1 -1
- package/dist/application-opentelemetry.d.ts +1 -1
- package/dist/application.d.ts +11 -11
- package/dist/application.js +7 -7
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-url.d.ts +2 -2
- package/dist/browser/client.d.ts +4 -4
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/http.d.ts +7 -7
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/socket-io.d.ts +12 -31
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +2 -2
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +4 -3
- package/dist/contract/errors-factory.d.ts +1 -1
- package/dist/contract/factory.d.ts +1 -1
- package/dist/contract/index.d.ts +7 -7
- package/dist/files/boundary.d.ts +1 -1
- package/dist/files.d.ts +2 -2
- package/dist/{index-zd4v31v2.js → index-2ve29dzn.js} +3 -3
- package/dist/index-7etq650s.js +75 -0
- package/dist/{index-7pn02bgv.js → index-cszjsxy5.js} +22 -83
- package/dist/index-g2j2m6vv.js +63 -0
- package/dist/{index-nymn7wbg.js → index-nck3yx3y.js} +15 -8
- package/dist/index.d.ts +10 -10
- package/dist/index.js +4 -4
- package/dist/internal/errors.d.ts +1 -1
- package/dist/internal/observability-sink.d.ts +1 -1
- package/dist/node.d.ts +11 -11
- package/dist/node.js +2 -2
- package/dist/observability/audit.d.ts +5 -5
- package/dist/observability/context.d.ts +2 -2
- package/dist/observability/event.d.ts +2 -2
- package/dist/observability/index.d.ts +6 -6
- package/dist/react/entity-cache.d.ts +26 -1
- package/dist/react/entity-cache.d.ts.map +1 -1
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +136 -38
- package/dist/realtime/contract.d.ts +1 -1
- package/dist/realtime/index.d.ts +4 -4
- package/dist/realtime/rejection.d.ts +1 -1
- package/dist/realtime/request.d.ts +1 -1
- package/dist/realtime/socket.d.ts +2 -2
- package/dist/remote.d.ts +1 -1
- package/dist/remote.js +1 -1
- package/dist/server/bun.d.ts +3 -3
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context.d.ts +4 -4
- package/dist/server/contract-stream.d.ts +2 -2
- package/dist/server/create.d.ts +1 -1
- package/dist/server/error-hook.d.ts +3 -3
- package/dist/server/file.d.ts +1 -1
- package/dist/server/implement.d.ts +2 -2
- package/dist/server/index.d.ts +31 -31
- package/dist/server/index.js +9 -9
- package/dist/server/lifecycle.d.ts +1 -1
- package/dist/server/logging.d.ts +1 -1
- package/dist/server/middleware/auth.d.ts +2 -2
- package/dist/server/multipart.d.ts +2 -2
- package/dist/server/node.d.ts +2 -2
- package/dist/server/openapi.d.ts +1 -1
- package/dist/server/process-signal-common.d.ts +1 -1
- package/dist/server/process-signals.d.ts +1 -1
- package/dist/server/realtime.d.ts +4 -4
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/router.d.ts +1 -1
- package/dist/server/shutdown.d.ts +1 -1
- package/dist/server/socket-io-node.d.ts +3 -3
- package/dist/server/socket-io.d.ts +6 -6
- package/dist/server/streaming-route.d.ts +2 -2
- package/dist/server/types.d.ts +6 -6
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +2 -2
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/agent-store-conformance.d.ts +1 -1
- package/dist/testing/managed-resource-conformance-contract.d.ts +1 -1
- package/dist/testing/managed-resource-conformance-driver.d.ts +2 -2
- package/dist/testing/managed-resource-conformance-scenarios.d.ts +2 -2
- package/dist/testing/managed-resource-conformance.d.ts +2 -2
- package/dist/testing/surface-conformance.d.ts +3 -3
- package/dist/testing/surface-manifest.d.ts +5 -5
- package/dist/testing.d.ts +8 -8
- package/dist/testing.js +1 -1
- package/dist/tool-invoker.d.ts +9 -0
- package/dist/tool-invoker.d.ts.map +1 -0
- package/dist/tool-invoker.js +16 -0
- package/dist/tools/agent.d.ts +4 -4
- package/dist/tools/async-operation.d.ts +3 -3
- package/dist/tools/cli-command.d.ts +3 -3
- package/dist/tools/cli-format.d.ts +1 -1
- package/dist/tools/cli-policy.d.ts +1 -1
- package/dist/tools/cli-wait.d.ts +1 -1
- package/dist/tools/cli.d.ts +7 -7
- package/dist/tools/define-download-tool.d.ts +4 -4
- package/dist/tools/define-upload-tool.d.ts +3 -3
- package/dist/tools/define-view-file-tool.d.ts +3 -3
- package/dist/tools/define-wait-tool.d.ts +2 -2
- package/dist/tools/download-core.d.ts +2 -2
- package/dist/tools/execute.d.ts +2 -2
- package/dist/tools/flatten-join.d.ts +1 -1
- package/dist/tools/internal/surface-projector.d.ts +3 -3
- package/dist/tools/invoker.d.ts +4 -4
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/list-names.d.ts +2 -2
- package/dist/tools/managed-file-error.d.ts +1 -1
- package/dist/tools/manifest.d.ts +3 -3
- package/dist/tools/mcp-handler.d.ts +4 -4
- package/dist/tools/mcp-prepare.d.ts +8 -8
- package/dist/tools/mcp-round-policy.d.ts +1 -1
- package/dist/tools/mcp-round.d.ts +3 -3
- package/dist/tools/mcp-stdio-signals.d.ts +2 -2
- package/dist/tools/mcp-stdio.d.ts +3 -3
- package/dist/tools/mcp.d.ts +7 -7
- package/dist/tools/mount-download.d.ts +1 -1
- package/dist/tools/mount-upload.d.ts +1 -1
- package/dist/tools/mount.d.ts +5 -5
- package/dist/tools/native-definition.d.ts +2 -2
- package/dist/tools/native-mcp.d.ts +3 -3
- package/dist/tools/oauth-metadata.d.ts +1 -1
- package/dist/tools/oauth-provider.d.ts +1 -1
- package/dist/tools/presentation.d.ts +1 -1
- package/dist/tools/remote.d.ts +3 -3
- package/dist/tools/runtime-tool.d.ts +2 -2
- package/dist/tools/surface.d.ts +5 -5
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/toolkit.d.ts +7 -7
- package/dist/tools/transports.d.ts +2 -2
- package/dist/tools/upload-core.d.ts +1 -1
- package/dist/tools/view-file.d.ts +1 -1
- package/dist/tools.d.ts +42 -42
- package/dist/tools.js +18 -61
- package/llms-full.txt +169 -18
- package/package.json +8 -4
- package/dist/{index-avjd67h6.js → index-cz32amcb.js} +3 -3
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
contractToolMountable,
|
|
3
|
+
createToolRunner,
|
|
4
|
+
formatToolError
|
|
5
|
+
} from "./index-7etq650s.js";
|
|
1
6
|
import {
|
|
2
7
|
coerceJsonArgs,
|
|
3
|
-
executeToolMethod,
|
|
4
8
|
toolResultFromError
|
|
5
|
-
} from "./index-
|
|
9
|
+
} from "./index-cz32amcb.js";
|
|
6
10
|
import {
|
|
7
11
|
isWithinDir
|
|
8
12
|
} from "./index-sbdmyz75.js";
|
|
9
13
|
import {
|
|
10
|
-
assertToolExtensionCompatible,
|
|
11
14
|
assertUniqueToolName,
|
|
12
15
|
buildToolPresentationSchema,
|
|
13
16
|
projectRuntimeTool,
|
|
14
17
|
projectToolSurface
|
|
15
18
|
} from "./index-vkk06pv1.js";
|
|
16
19
|
import {
|
|
17
|
-
|
|
18
|
-
objectShapeKeys,
|
|
19
|
-
rebuildObject
|
|
20
|
+
objectShapeKeys
|
|
20
21
|
} from "./index-6djpbnda.js";
|
|
21
22
|
import {
|
|
22
23
|
jsonSchemaFields
|
|
@@ -31,68 +32,6 @@ import {
|
|
|
31
32
|
isRecord
|
|
32
33
|
} from "./index-smpbdg6k.js";
|
|
33
34
|
|
|
34
|
-
// src/tools/mount.ts
|
|
35
|
-
import { z } from "zod";
|
|
36
|
-
function applyExtend(base, extra) {
|
|
37
|
-
if (base instanceof z.ZodObject) {
|
|
38
|
-
assertToolExtensionCompatible(base, extra);
|
|
39
|
-
return rebuildObject(base, { ...extra, ...base.shape });
|
|
40
|
-
}
|
|
41
|
-
return z.intersection(z.object(extra), base);
|
|
42
|
-
}
|
|
43
|
-
function contractToolMountable(projected, extend) {
|
|
44
|
-
const method = projected.source;
|
|
45
|
-
const baseArgumentSchema = mergeSchemas(method.paramsSchema, method.inputSchema);
|
|
46
|
-
const argumentSchema = projected.shouldExtend && extend ? applyExtend(baseArgumentSchema, extend.schema) : baseArgumentSchema;
|
|
47
|
-
return {
|
|
48
|
-
method,
|
|
49
|
-
name: projected.name,
|
|
50
|
-
argumentSchema,
|
|
51
|
-
presentationSchema: projected.presentationSchema,
|
|
52
|
-
shouldExtend: projected.shouldExtend
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function collectTools(service, transport, config = {}) {
|
|
56
|
-
const { extend, flattenUnionInput = false, assertNames = true } = config;
|
|
57
|
-
const tools = [];
|
|
58
|
-
for (const projected of projectToolSurface({ services: [service] }, transport === "HTTP" ? "AGENT" : transport, {
|
|
59
|
-
extend,
|
|
60
|
-
flattenUnionInput,
|
|
61
|
-
assertNames,
|
|
62
|
-
assertUniqueNames: false
|
|
63
|
-
})) {
|
|
64
|
-
if (projected.kind !== "contract")
|
|
65
|
-
continue;
|
|
66
|
-
tools.push(contractToolMountable(projected, extend));
|
|
67
|
-
}
|
|
68
|
-
return tools;
|
|
69
|
-
}
|
|
70
|
-
function createToolRunner(config) {
|
|
71
|
-
const extension = config.extend ? {
|
|
72
|
-
schema: z.object(config.extend.schema),
|
|
73
|
-
resolve: config.extend.resolve
|
|
74
|
-
} : undefined;
|
|
75
|
-
return async function runOneToolCall(tool, rawArgs, context) {
|
|
76
|
-
return executeToolMethod(tool.method, tool.name, rawArgs, { ...config.context, ...context, source: config.source }, config.hooks, config.lifecycle, config.coerceJsonArgs ?? true, config.onOutputStrip ? (paths) => config.onOutputStrip?.(tool.name, paths) : undefined, tool.shouldExtend ? extension : undefined);
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function formatToolError(result, toolName, errorHint) {
|
|
80
|
-
const err = { error: result.code };
|
|
81
|
-
if (result.details)
|
|
82
|
-
err.details = result.details;
|
|
83
|
-
const hints = [];
|
|
84
|
-
if (result.hint)
|
|
85
|
-
hints.push(result.hint);
|
|
86
|
-
if (errorHint && toolName) {
|
|
87
|
-
const global = errorHint(toolName, result.code);
|
|
88
|
-
if (global)
|
|
89
|
-
hints.push(global);
|
|
90
|
-
}
|
|
91
|
-
if (hints.length > 0)
|
|
92
|
-
err._hint = hints.join(" ");
|
|
93
|
-
return err;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
35
|
// src/tools/runtime-tool.ts
|
|
97
36
|
function defineRuntimeTool(definition) {
|
|
98
37
|
if (definition.transports?.length === 0) {
|
|
@@ -175,7 +114,7 @@ function runtimeToolMountable(definition, assertName = true) {
|
|
|
175
114
|
}
|
|
176
115
|
|
|
177
116
|
// src/tools/cli-args.ts
|
|
178
|
-
import { z
|
|
117
|
+
import { z } from "zod";
|
|
179
118
|
var NUMERIC_VALUE = /^-(\d+\.?\d*|\.\d+)$/;
|
|
180
119
|
var BOOL_OPTIONS = new Set(["json", "wait", "quiet", "dry-run", "help"]);
|
|
181
120
|
var VALUE_OPTIONS = new Set(["wait-timeout", "output-dir"]);
|
|
@@ -284,27 +223,27 @@ class CliArgumentError extends Error {
|
|
|
284
223
|
name = "CliArgumentError";
|
|
285
224
|
}
|
|
286
225
|
function unwrap(field) {
|
|
287
|
-
if (field instanceof
|
|
226
|
+
if (field instanceof z.ZodOptional || field instanceof z.ZodNullable || field instanceof z.ZodDefault) {
|
|
288
227
|
return unwrap(field.unwrap());
|
|
289
228
|
}
|
|
290
229
|
return field;
|
|
291
230
|
}
|
|
292
231
|
function classify(field) {
|
|
293
|
-
if (field instanceof
|
|
232
|
+
if (field instanceof z.ZodBoolean)
|
|
294
233
|
return "boolean";
|
|
295
|
-
if (field instanceof
|
|
234
|
+
if (field instanceof z.ZodNumber)
|
|
296
235
|
return "number";
|
|
297
|
-
if (field instanceof
|
|
236
|
+
if (field instanceof z.ZodBigInt)
|
|
298
237
|
return "bigint";
|
|
299
|
-
if (field instanceof
|
|
238
|
+
if (field instanceof z.ZodDate)
|
|
300
239
|
return "date";
|
|
301
|
-
if (field instanceof
|
|
240
|
+
if (field instanceof z.ZodEnum)
|
|
302
241
|
return "enum";
|
|
303
|
-
if (field instanceof
|
|
242
|
+
if (field instanceof z.ZodArray)
|
|
304
243
|
return "array";
|
|
305
|
-
if (field instanceof
|
|
244
|
+
if (field instanceof z.ZodObject)
|
|
306
245
|
return "object";
|
|
307
|
-
if (field instanceof
|
|
246
|
+
if (field instanceof z.ZodString || field instanceof z.ZodLiteral)
|
|
308
247
|
return "string";
|
|
309
248
|
return "other";
|
|
310
249
|
}
|
|
@@ -324,11 +263,11 @@ function mergeField(fields, name, info) {
|
|
|
324
263
|
}
|
|
325
264
|
function collectSchemaFields(schema, fields) {
|
|
326
265
|
const base = unwrap(schema);
|
|
327
|
-
if (base instanceof
|
|
266
|
+
if (base instanceof z.ZodObject) {
|
|
328
267
|
for (const [name, raw] of Object.entries(base.shape)) {
|
|
329
268
|
const fieldBase = unwrap(raw);
|
|
330
269
|
const kind = classify(fieldBase);
|
|
331
|
-
if (kind === "array" && fieldBase instanceof
|
|
270
|
+
if (kind === "array" && fieldBase instanceof z.ZodArray) {
|
|
332
271
|
mergeField(fields, name, { kind, elementKind: classify(unwrap(fieldBase.element)) });
|
|
333
272
|
} else {
|
|
334
273
|
mergeField(fields, name, { kind });
|
|
@@ -336,12 +275,12 @@ function collectSchemaFields(schema, fields) {
|
|
|
336
275
|
}
|
|
337
276
|
return;
|
|
338
277
|
}
|
|
339
|
-
if (base instanceof
|
|
278
|
+
if (base instanceof z.ZodUnion) {
|
|
340
279
|
for (const option of base.def.options)
|
|
341
280
|
collectSchemaFields(option, fields);
|
|
342
281
|
return;
|
|
343
282
|
}
|
|
344
|
-
if (base instanceof
|
|
283
|
+
if (base instanceof z.ZodIntersection) {
|
|
345
284
|
collectSchemaFields(base.def.left, fields);
|
|
346
285
|
collectSchemaFields(base.def.right, fields);
|
|
347
286
|
return;
|
|
@@ -1735,4 +1674,4 @@ async function createCli(config) {
|
|
|
1735
1674
|
return exit(downloadsOk ? exitCode : 1);
|
|
1736
1675
|
}
|
|
1737
1676
|
|
|
1738
|
-
export {
|
|
1677
|
+
export { defineRuntimeTool, createRuntimeToolFactory, collectToolSurface, WaitTimeoutError, runWaitOperation, fetchGuarded, fetchPinnedDocument, readCapped, parseCliArgs, defineCliCommand, DEFAULT_EXIT_CODES, emitResult, pollUntilDone, createCli };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectTools,
|
|
3
|
+
createToolRunner
|
|
4
|
+
} from "./index-7etq650s.js";
|
|
5
|
+
import {
|
|
6
|
+
toolErrorFromResult
|
|
7
|
+
} from "./index-cz32amcb.js";
|
|
8
|
+
import {
|
|
9
|
+
assertUniqueToolName
|
|
10
|
+
} from "./index-vkk06pv1.js";
|
|
11
|
+
import {
|
|
12
|
+
AppError
|
|
13
|
+
} from "./index-0w9abg87.js";
|
|
14
|
+
|
|
15
|
+
// src/tools/invoker.ts
|
|
16
|
+
function createToolInvoker(services, config) {
|
|
17
|
+
const serviceList = Array.isArray(services) ? services : [services];
|
|
18
|
+
const tools = new Map;
|
|
19
|
+
for (const service of serviceList) {
|
|
20
|
+
for (const tool of collectTools(service, config.transport, {
|
|
21
|
+
extend: config.extend,
|
|
22
|
+
flattenUnionInput: config.flattenUnionInput
|
|
23
|
+
})) {
|
|
24
|
+
assertUniqueToolName(tool.name, tools.has(tool.name), "in-process tool name");
|
|
25
|
+
tools.set(tool.name, tool);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const names = Object.freeze([...tools.keys()].sort());
|
|
29
|
+
const operation = (name) => {
|
|
30
|
+
const tool = tools.get(name);
|
|
31
|
+
if (tool)
|
|
32
|
+
return tool;
|
|
33
|
+
throw new AppError("NOT_FOUND", `Unknown tool: ${name}`, 404, {
|
|
34
|
+
available: names
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const run = (name, args, options = {}) => {
|
|
38
|
+
const runTool = createToolRunner({
|
|
39
|
+
source: options.source ?? "internal",
|
|
40
|
+
context: options.context,
|
|
41
|
+
hooks: options.hooks,
|
|
42
|
+
lifecycle: options.lifecycle,
|
|
43
|
+
extend: config.extend,
|
|
44
|
+
coerceJsonArgs: config.coerceJsonArgs,
|
|
45
|
+
onOutputStrip: options.onOutputStrip
|
|
46
|
+
});
|
|
47
|
+
return runTool(operation(name), args);
|
|
48
|
+
};
|
|
49
|
+
return Object.freeze({
|
|
50
|
+
names,
|
|
51
|
+
invoke(name, args, options) {
|
|
52
|
+
return run(name, args, options);
|
|
53
|
+
},
|
|
54
|
+
async invokeOrThrow(name, args, options) {
|
|
55
|
+
const result = await run(name, args, options);
|
|
56
|
+
if (!result.ok)
|
|
57
|
+
throw toolErrorFromResult(result);
|
|
58
|
+
return result.data;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { createToolInvoker };
|
|
@@ -8,9 +8,6 @@ import {
|
|
|
8
8
|
guardSignalCallback,
|
|
9
9
|
reportSignalError
|
|
10
10
|
} from "./index-pr0qsmjy.js";
|
|
11
|
-
import {
|
|
12
|
-
ShutdownOptionsSchema
|
|
13
|
-
} from "./index-dk6e56g0.js";
|
|
14
11
|
import {
|
|
15
12
|
extractIp,
|
|
16
13
|
getClientInfo,
|
|
@@ -22,6 +19,9 @@ import {
|
|
|
22
19
|
setRequestEndpoint,
|
|
23
20
|
setRequestError
|
|
24
21
|
} from "./index-69m2278y.js";
|
|
22
|
+
import {
|
|
23
|
+
ShutdownOptionsSchema
|
|
24
|
+
} from "./index-dk6e56g0.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
|
|
27
27
|
errorCode,
|
|
@@ -2759,14 +2759,13 @@ function bunUnixRequest(options) {
|
|
|
2759
2759
|
return;
|
|
2760
2760
|
}
|
|
2761
2761
|
const bytes = Math.min(chunkRemaining, wire.byteLength, MAX_BODY_CHUNK_BYTES);
|
|
2762
|
-
|
|
2763
|
-
if (settled)
|
|
2764
|
-
return;
|
|
2762
|
+
const value = takeWire(bytes);
|
|
2765
2763
|
chunkRemaining -= bytes;
|
|
2766
2764
|
if (chunkRemaining === 0) {
|
|
2767
2765
|
chunkRemaining = undefined;
|
|
2768
2766
|
expectChunkCrlf = true;
|
|
2769
2767
|
}
|
|
2768
|
+
enqueue(value);
|
|
2770
2769
|
return;
|
|
2771
2770
|
}
|
|
2772
2771
|
};
|
|
@@ -2816,7 +2815,7 @@ function bunUnixRequest(options) {
|
|
|
2816
2815
|
}
|
|
2817
2816
|
return;
|
|
2818
2817
|
}
|
|
2819
|
-
if (headerEnd > options.maxHeaderBytes) {
|
|
2818
|
+
if (headerEnd + 4 > options.maxHeaderBytes) {
|
|
2820
2819
|
fail(new UnixClientTransportError("UNIX_HEADERS_TOO_LARGE", `Unix response headers exceed the ${options.maxHeaderBytes} byte limit`, "response-received"));
|
|
2821
2820
|
return;
|
|
2822
2821
|
}
|
|
@@ -2988,6 +2987,9 @@ function responseHeaders2(response) {
|
|
|
2988
2987
|
}
|
|
2989
2988
|
return headers;
|
|
2990
2989
|
}
|
|
2990
|
+
function isNodeHeaderOverflow(error) {
|
|
2991
|
+
return typeof error === "object" && error !== null && Reflect.get(error, "code") === "HPE_HEADER_OVERFLOW";
|
|
2992
|
+
}
|
|
2991
2993
|
function redirectedRequest(request, location, status, body) {
|
|
2992
2994
|
const url = new URL(location, request.url);
|
|
2993
2995
|
const changesToGet = status === 303 || (status === 301 || status === 302) && request.method === "POST";
|
|
@@ -3083,7 +3085,8 @@ function createUnixClientTransport(config) {
|
|
|
3083
3085
|
method: request.method,
|
|
3084
3086
|
headers,
|
|
3085
3087
|
agent,
|
|
3086
|
-
signal: request.signal
|
|
3088
|
+
signal: request.signal,
|
|
3089
|
+
maxHeaderSize: maxHeaderBytes
|
|
3087
3090
|
}, resolveOnce);
|
|
3088
3091
|
let connected = false;
|
|
3089
3092
|
let requestStartBytes = 0;
|
|
@@ -3106,6 +3109,10 @@ function createUnixClientTransport(config) {
|
|
|
3106
3109
|
timer.unref();
|
|
3107
3110
|
outgoing.once("response", () => clearTimeout(timer));
|
|
3108
3111
|
outgoing.once("error", (error) => {
|
|
3112
|
+
if (isNodeHeaderOverflow(error)) {
|
|
3113
|
+
rejectOnce(new UnixClientTransportError("UNIX_HEADERS_TOO_LARGE", `Unix response headers exceed the ${maxHeaderBytes} byte limit`, "response-received", { cause: error }));
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3109
3116
|
const dispatched = connected && (outgoing.socket?.bytesWritten ?? requestStartBytes) > requestStartBytes;
|
|
3110
3117
|
rejectOnce(new UnixClientTransportError(dispatched ? "UNIX_DELIVERY_UNCERTAIN" : "UNIX_CONNECT_FAILED", dispatched ? "Unix request transport failed after dispatch may have begun" : "Unix socket connection failed before request dispatch", dispatched ? "possibly-dispatched" : "not-dispatched", { cause: error }));
|
|
3111
3118
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { type ClientConfig, type ClientContract, type ClientFetch, type ClientRegistryValue, type ContractClientConfig, contractEndpointMatchers, createClient, createClients, createScopedClients, createScopedUrlBuilders, createUrlBuilder, createUrlBuilders, type PathPrefixArgs, type RegistryScope, type ScopeClientConfigs, type ScopedClientRegistry, type ScopedUrlBuilderRegistry, type UrlBuilderConfig, } from './browser/client';
|
|
2
|
-
export { ApiError, type ApiEvent, type ApiEventListener, type ConfiguredHttpClient, createHttpClient, type HeaderProvider, type HttpClient, type HttpClientConfig, type RequestOptions, type UnauthorizedMatcher, } from './browser/http';
|
|
3
|
-
export type { BindRealtimeClientOptions, BoundRealtimeClient, RealtimeClient, RealtimeClientOptions, RealtimeClientTransport, SocketEventMap, SocketIOClient, SocketIOClientConfig, SocketIOClientPeerLoaders, } from './browser/socket-io';
|
|
4
|
-
export { bindRealtimeClient, createRealtimeClient, createSocketIOClient, } from './browser/socket-io';
|
|
5
|
-
export { type ParseNDJSONOptions, type ParseSSEOptions, parseNDJSON, parseSSE, } from './browser/stream';
|
|
6
|
-
export * from './contract';
|
|
7
|
-
export type { StitchLogger } from './logger';
|
|
8
|
-
export { childSpan, createTraceContext, formatTraceparent, parseTraceparent, type TraceContext, } from './observability/trace';
|
|
9
|
-
export * from './realtime';
|
|
10
|
-
export { createRetainedTopics, type RetainedTopics } from './retained';
|
|
1
|
+
export { type ClientConfig, type ClientContract, type ClientFetch, type ClientRegistryValue, type ContractClientConfig, contractEndpointMatchers, createClient, createClients, createScopedClients, createScopedUrlBuilders, createUrlBuilder, createUrlBuilders, type PathPrefixArgs, type RegistryScope, type ScopeClientConfigs, type ScopedClientRegistry, type ScopedUrlBuilderRegistry, type UrlBuilderConfig, } from './browser/client.js';
|
|
2
|
+
export { ApiError, type ApiEvent, type ApiEventListener, type ConfiguredHttpClient, createHttpClient, type HeaderProvider, type HttpClient, type HttpClientConfig, type RequestOptions, type UnauthorizedMatcher, } from './browser/http.js';
|
|
3
|
+
export type { BindRealtimeClientOptions, BoundRealtimeClient, RealtimeClient, RealtimeClientOptions, RealtimeClientTransport, SocketEventMap, SocketIOClient, SocketIOClientConfig, SocketIOClientPeerLoaders, } from './browser/socket-io.js';
|
|
4
|
+
export { bindRealtimeClient, createRealtimeClient, createSocketIOClient, } from './browser/socket-io.js';
|
|
5
|
+
export { type ParseNDJSONOptions, type ParseSSEOptions, parseNDJSON, parseSSE, } from './browser/stream.js';
|
|
6
|
+
export * from './contract/index.js';
|
|
7
|
+
export type { StitchLogger } from './logger.js';
|
|
8
|
+
export { childSpan, createTraceContext, formatTraceparent, parseTraceparent, type TraceContext, } from './observability/trace.js';
|
|
9
|
+
export * from './realtime/index.js';
|
|
10
|
+
export { createRetainedTopics, type RetainedTopics } from './retained.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -464,8 +464,8 @@ class ApiError extends Error {
|
|
|
464
464
|
details;
|
|
465
465
|
hint;
|
|
466
466
|
traceId;
|
|
467
|
-
constructor(code, status = 0, details, message, hint, traceId) {
|
|
468
|
-
super(message ?? `API Error: ${code}
|
|
467
|
+
constructor(code, status = 0, details, message, hint, traceId, options) {
|
|
468
|
+
super(message ?? `API Error: ${code}`, options);
|
|
469
469
|
this.code = code;
|
|
470
470
|
this.status = status;
|
|
471
471
|
this.details = details;
|
|
@@ -1004,7 +1004,7 @@ function createFetchExecutor(endpoint, prefix, config, contractConfig) {
|
|
|
1004
1004
|
if (ApiError.is(error))
|
|
1005
1005
|
throw error;
|
|
1006
1006
|
const message = error instanceof Error ? error.message : undefined;
|
|
1007
|
-
throw new ApiError("UNKNOWN_ERROR", 0, message ? { message } : undefined, message);
|
|
1007
|
+
throw new ApiError("UNKNOWN_ERROR", 0, message ? { message } : undefined, message, undefined, undefined, { cause: error });
|
|
1008
1008
|
}
|
|
1009
1009
|
};
|
|
1010
1010
|
}
|
|
@@ -1446,7 +1446,7 @@ var SOCKET_IO_CLIENT = "socket.io-client";
|
|
|
1446
1446
|
var ioLoader = null;
|
|
1447
1447
|
function loadIo() {
|
|
1448
1448
|
if (!ioLoader) {
|
|
1449
|
-
ioLoader = import(SOCKET_IO_CLIENT).then((mod) => mod.io, (cause) => {
|
|
1449
|
+
ioLoader = import(/* webpackIgnore: true */ SOCKET_IO_CLIENT).then((mod) => mod.io, (cause) => {
|
|
1450
1450
|
ioLoader = null;
|
|
1451
1451
|
throw new Error("stitchkit: createSocketIOClient needs the \"socket.io-client\" peer — install it (e.g. `bun add socket.io-client`). Shipping one self-contained artifact instead? Pass `peers: { client: () => import('socket.io-client') }` so your bundler puts it inside.", { cause });
|
|
1452
1452
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ZodType, z } from 'zod';
|
|
2
|
-
import { AppError } from '../contract';
|
|
2
|
+
import { AppError } from '../contract/index.js';
|
|
3
3
|
export declare function formatZodError(error: z.ZodError): string;
|
|
4
4
|
/** One field-level validation issue — the structured sibling of `formatZodError`. */
|
|
5
5
|
export interface ZodIssueSummary {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ObservabilitySinkStatus } from '../observability/status';
|
|
1
|
+
import { type ObservabilitySinkStatus } from '../observability/status.js';
|
|
2
2
|
export type BoundedSinkDropReason = 'capacity' | 'closed';
|
|
3
3
|
export interface BoundedSinkError<EVENT> {
|
|
4
4
|
error: unknown;
|
package/dist/node.d.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* srvx-backed `serveNode`, `implement`, the error helpers and (lazily-loaded,
|
|
5
5
|
* Node-safe) `createSocketIOServer`.
|
|
6
6
|
*/
|
|
7
|
-
export { AppError, appError, badRequest, conflict, forbidden, notFound, rateLimited, unauthorized, } from './contract';
|
|
8
|
-
export { createHandler } from './server/create';
|
|
9
|
-
export { createImplement, createImplementRegistry, createMultipartStream, createScopedImplement, createScopedImplementRegistry, type ExactRegistryHandlers, type ExactScopedRegistryHandlers, type ImplementationRegistry, implement, implementRegistry, type KeyedServices, type MultipartStreamConfig, type RegistryHandlers, type ScopedImplementationRegistry, type ScopedRegistryHandlers, type StreamScope, } from './server/implement';
|
|
10
|
-
export type { LogFormat } from './server/logger';
|
|
11
|
-
export { type NodeRuntimeServer, type NodeServerConfig, type NodeServerHandle, type NodeSocketLifecycle, serveNode, } from './server/node';
|
|
12
|
-
export { bindProcessSignals, type ProcessSignalName, type ProcessSignalsBinding, type ProcessSignalsErrorPhase, type ProcessSignalsOptions, type ShutdownTarget, type SignalSource, } from './server/process-signals';
|
|
13
|
-
export { bindRealtimeServer, type RealtimeServer, type RealtimeServerConnection, type RealtimeServerHandle, } from './server/realtime';
|
|
14
|
-
export { type ManagedServerHandle, type ShutdownOptions, ShutdownOptionsSchema, type ShutdownResult, ShutdownResultSchema, type ShutdownState, ShutdownStateSchema, type ShutdownStatus, ShutdownStatusSchema, } from './server/shutdown';
|
|
15
|
-
export { createNodeSocketIOServer as createSocketIOServer, type NodeSocketIOServerHandle as SocketIOServerHandle, type SocketIOHandshakeConfig, type SocketIOPeerLoaders, type SocketIORequestPolicy, type SocketIOServerConfig, } from './server/socket-io-node';
|
|
16
|
-
export type { EffectiveScope, FetchComposition, FetchHandler, HandlerConfig, LoggingConfig, LogOutcome, RawRoute, RawRouteContext, ScopeContexts, ScopedHandlers, ServiceDef, } from './server/types';
|
|
17
|
-
export { createUnixClientTransport, type UnixClientDeliveryState, type UnixClientTransport, type UnixClientTransportConfig, UnixClientTransportError, type UnixClientTransportErrorCode, } from './server/unix-client';
|
|
7
|
+
export { AppError, appError, badRequest, conflict, forbidden, notFound, rateLimited, unauthorized, } from './contract/index.js';
|
|
8
|
+
export { createHandler } from './server/create.js';
|
|
9
|
+
export { createImplement, createImplementRegistry, createMultipartStream, createScopedImplement, createScopedImplementRegistry, type ExactRegistryHandlers, type ExactScopedRegistryHandlers, type ImplementationRegistry, implement, implementRegistry, type KeyedServices, type MultipartStreamConfig, type RegistryHandlers, type ScopedImplementationRegistry, type ScopedRegistryHandlers, type StreamScope, } from './server/implement.js';
|
|
10
|
+
export type { LogFormat } from './server/logger.js';
|
|
11
|
+
export { type NodeRuntimeServer, type NodeServerConfig, type NodeServerHandle, type NodeSocketLifecycle, serveNode, } from './server/node.js';
|
|
12
|
+
export { bindProcessSignals, type ProcessSignalName, type ProcessSignalsBinding, type ProcessSignalsErrorPhase, type ProcessSignalsOptions, type ShutdownTarget, type SignalSource, } from './server/process-signals.js';
|
|
13
|
+
export { bindRealtimeServer, type RealtimeServer, type RealtimeServerConnection, type RealtimeServerHandle, } from './server/realtime.js';
|
|
14
|
+
export { type ManagedServerHandle, type ShutdownOptions, ShutdownOptionsSchema, type ShutdownResult, ShutdownResultSchema, type ShutdownState, ShutdownStateSchema, type ShutdownStatus, ShutdownStatusSchema, } from './server/shutdown.js';
|
|
15
|
+
export { createNodeSocketIOServer as createSocketIOServer, type NodeSocketIOServerHandle as SocketIOServerHandle, type SocketIOHandshakeConfig, type SocketIOPeerLoaders, type SocketIORequestPolicy, type SocketIOServerConfig, } from './server/socket-io-node.js';
|
|
16
|
+
export type { EffectiveScope, FetchComposition, FetchHandler, HandlerConfig, LoggingConfig, LogOutcome, RawRoute, RawRouteContext, ScopeContexts, ScopedHandlers, ServiceDef, } from './server/types.js';
|
|
17
|
+
export { createUnixClientTransport, type UnixClientDeliveryState, type UnixClientTransport, type UnixClientTransportConfig, UnixClientTransportError, type UnixClientTransportErrorCode, } from './server/unix-client.js';
|
|
18
18
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createHandler,
|
|
6
6
|
createSocketIOServer,
|
|
7
7
|
createUnixClientTransport
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-nck3yx3y.js";
|
|
9
9
|
import {
|
|
10
10
|
createImplement,
|
|
11
11
|
createImplementRegistry,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
implement,
|
|
16
16
|
implementRegistry
|
|
17
17
|
} from "./index-pr0qsmjy.js";
|
|
18
|
+
import"./index-69m2278y.js";
|
|
18
19
|
import"./index-557by2db.js";
|
|
19
20
|
import {
|
|
20
21
|
ShutdownOptionsSchema,
|
|
@@ -23,7 +24,6 @@ import {
|
|
|
23
24
|
ShutdownStatusSchema,
|
|
24
25
|
createServerLifecycle
|
|
25
26
|
} from "./index-dk6e56g0.js";
|
|
26
|
-
import"./index-69m2278y.js";
|
|
27
27
|
import"./index-9ky9hhg3.js";
|
|
28
28
|
import"./index-smpbdg6k.js";
|
|
29
29
|
import {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ToolCallHooks } from '../tools/execute';
|
|
2
|
-
import { type RequestContext } from './context';
|
|
3
|
-
import type { RequestEvent } from './event';
|
|
4
|
-
import { type SanitizeOptions } from './sanitize';
|
|
5
|
-
import { type ObservabilityDrainReport, type ObservabilityStatus } from './status';
|
|
1
|
+
import type { ToolCallHooks } from '../tools/execute.js';
|
|
2
|
+
import { type RequestContext } from './context.js';
|
|
3
|
+
import type { RequestEvent } from './event.js';
|
|
4
|
+
import { type SanitizeOptions } from './sanitize.js';
|
|
5
|
+
import { type ObservabilityDrainReport, type ObservabilityStatus } from './status.js';
|
|
6
6
|
/** One isolated RequestEvent sink and its sanitisation policy. */
|
|
7
7
|
export interface RequestEventSinkConfig {
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TransportSource } from '../contract';
|
|
2
|
-
import { type TraceContext } from './trace';
|
|
1
|
+
import type { TransportSource } from '../contract/index.js';
|
|
2
|
+
import { type TraceContext } from './trace.js';
|
|
3
3
|
/** Everything known about the request in flight. */
|
|
4
4
|
export interface RequestContext {
|
|
5
5
|
/** W3C trace ids for this request. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HttpMethod, McpCallContext, TransportSource } from '../contract';
|
|
2
|
-
import type { JsonValue } from './sanitize';
|
|
1
|
+
import type { HttpMethod, McpCallContext, TransportSource } from '../contract/index.js';
|
|
2
|
+
import type { JsonValue } from './sanitize.js';
|
|
3
3
|
/**
|
|
4
4
|
* A normalised audit event — one shape for a completed call on any surface
|
|
5
5
|
* (an HTTP request, an MCP tool call, an agent tool call). `createObservability`
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* framework-owned HTTP completion plus canonical tool hooks into independent
|
|
7
7
|
* sinks.
|
|
8
8
|
*/
|
|
9
|
-
export { createObservability, type HttpRequestCompletion, type HttpRequestObserver, type Observability, type ObservabilityConfig, type RequestEventSinkConfig, type RequestObservabilityConfig, type SinkDrop, type SinkDropReason, type SinkError, } from './audit';
|
|
10
|
-
export { getRequestContext, getTraceId, getUserId, type RequestContext, runWithRequestContext, setRequestDimensions, setRequestEndpoint, setRequestError, setRequestUser, type WrapRequestContextOptions, wrapInRequestContext, } from './context';
|
|
11
|
-
export type { RequestEvent } from './event';
|
|
12
|
-
export { type JsonValue, measureSize, redact, type SanitizeOptions, type SizeMeasure, sanitizePayload, truncatePreview, } from './sanitize';
|
|
13
|
-
export { type ObservabilityDrainReport, ObservabilityDrainReportSchema, type ObservabilitySinkStatus, ObservabilitySinkStatusSchema, type ObservabilityStatus, ObservabilityStatusSchema, } from './status';
|
|
14
|
-
export { childSpan, createTraceContext, formatTraceparent, parseTraceparent, resolvePropagationContext, resolveTraceContext, type TraceContext, } from './trace';
|
|
9
|
+
export { createObservability, type HttpRequestCompletion, type HttpRequestObserver, type Observability, type ObservabilityConfig, type RequestEventSinkConfig, type RequestObservabilityConfig, type SinkDrop, type SinkDropReason, type SinkError, } from './audit.js';
|
|
10
|
+
export { getRequestContext, getTraceId, getUserId, type RequestContext, runWithRequestContext, setRequestDimensions, setRequestEndpoint, setRequestError, setRequestUser, type WrapRequestContextOptions, wrapInRequestContext, } from './context.js';
|
|
11
|
+
export type { RequestEvent } from './event.js';
|
|
12
|
+
export { type JsonValue, measureSize, redact, type SanitizeOptions, type SizeMeasure, sanitizePayload, truncatePreview, } from './sanitize.js';
|
|
13
|
+
export { type ObservabilityDrainReport, ObservabilityDrainReportSchema, type ObservabilitySinkStatus, ObservabilitySinkStatusSchema, type ObservabilityStatus, ObservabilityStatusSchema, } from './status.js';
|
|
14
|
+
export { childSpan, createTraceContext, formatTraceparent, parseTraceparent, resolvePropagationContext, resolveTraceContext, type TraceContext, } from './trace.js';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* infinite TanStack Query data without changing its envelope metadata.
|
|
5
5
|
*/
|
|
6
6
|
import type { QueryKey } from '@tanstack/react-query';
|
|
7
|
-
import type { CacheBridgeHandler } from './cache-bridge';
|
|
7
|
+
import type { CacheBridgeHandler } from './cache-bridge.js';
|
|
8
8
|
/** The `deleted` event may carry the whole entity or only its id. */
|
|
9
9
|
export type DeletedPayload<TData> = TData | {
|
|
10
10
|
id: string;
|
|
@@ -26,6 +26,27 @@ export type EntityCacheEvent<TData> = {
|
|
|
26
26
|
/** A static cache key/prefix or an event-aware key factory. */
|
|
27
27
|
export type EntityCacheKey<TData> = QueryKey | ((event: EntityCacheEvent<TData>) => QueryKey);
|
|
28
28
|
export type EntityCacheListShape = 'array' | 'paginated' | 'infinite-array' | 'infinite-paginated';
|
|
29
|
+
export type EntityCacheMembership = 'include' | 'exclude' | 'unknown';
|
|
30
|
+
export interface EntityCacheMembershipPolicy<TData> {
|
|
31
|
+
/** Backend-equivalent membership for this exact cached query key. */
|
|
32
|
+
evaluate(event: EntityCacheEvent<TData>, queryKey: QueryKey): EntityCacheMembership;
|
|
33
|
+
/** What to do when the event cannot prove membership. Default `preserve`. */
|
|
34
|
+
unknown?: 'preserve' | 'invalidate';
|
|
35
|
+
}
|
|
36
|
+
export interface EntityCacheTotalDeltaInput<TData> {
|
|
37
|
+
event: EntityCacheEvent<TData>;
|
|
38
|
+
queryKey: QueryKey;
|
|
39
|
+
present: boolean;
|
|
40
|
+
membership: EntityCacheMembership;
|
|
41
|
+
}
|
|
42
|
+
export interface EntityCacheTotalPolicy<TData> {
|
|
43
|
+
/** Reconcile a numeric `total` field when the event proves a delta. */
|
|
44
|
+
mode: 'reconcile';
|
|
45
|
+
/** Override the conservative built-in delta when the event carries transition evidence. */
|
|
46
|
+
delta?(input: EntityCacheTotalDeltaInput<TData>): number | 'unknown';
|
|
47
|
+
/** What to do when an unseen id makes the delta unknowable. Default `preserve`. */
|
|
48
|
+
unknown?: 'preserve' | 'invalidate';
|
|
49
|
+
}
|
|
29
50
|
/** List envelope, scoped key and explicit CRUD policies. */
|
|
30
51
|
export interface EntityCacheListConfig<TData, TListItem> {
|
|
31
52
|
/** Static query-key prefix or an event-aware scoped key factory. */
|
|
@@ -38,6 +59,10 @@ export interface EntityCacheListConfig<TData, TListItem> {
|
|
|
38
59
|
compare?: (left: TListItem, right: TListItem) => number;
|
|
39
60
|
/** Cached data envelope; no runtime shape inference is performed. */
|
|
40
61
|
shape: EntityCacheListShape;
|
|
62
|
+
/** Optional per-query filter membership. Omit for the envelope-preserving legacy path. */
|
|
63
|
+
membership?: EntityCacheMembershipPolicy<TData>;
|
|
64
|
+
/** Optional reconciliation of a numeric paginated `total` field. */
|
|
65
|
+
total?: EntityCacheTotalPolicy<TData>;
|
|
41
66
|
}
|
|
42
67
|
/** Config for `createEntityCacheHandlers`. */
|
|
43
68
|
export interface EntityCacheConfig<TData, TListItem = TData> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-cache.d.ts","sourceRoot":"","sources":["../../src/react/entity-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAgB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,KAAK,EAAsB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,qEAAqE;AACrE,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,KAAK,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,CAAC,KAAK,IAC9B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,+DAA+D;AAC/D,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC;AAE9F,MAAM,MAAM,oBAAoB,GAC5B,OAAO,GACP,WAAW,GACX,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,4DAA4D;AAC5D,MAA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Handler, type CacheBridgeHandlers, type CacheBridgeSocket, createCacheBridge, } from './react/cache-bridge';
|
|
2
|
-
export { type CursorQueryConfig, createCursorQuery } from './react/cursor-query';
|
|
3
|
-
export { createEntityCacheHandlers, type DeletedPayload, type EntityCacheConfig, type EntityCacheEvent, type EntityCacheHandlers, type EntityCacheKey, type EntityCacheListConfig, type EntityCacheListShape, } from './react/entity-cache';
|
|
1
|
+
export { type CacheBridge, type CacheBridgeConfig, type CacheBridgeContext, type CacheBridgeHandler, type CacheBridgeHandlers, type CacheBridgeSocket, createCacheBridge, } from './react/cache-bridge.js';
|
|
2
|
+
export { type CursorQueryConfig, createCursorQuery } from './react/cursor-query.js';
|
|
3
|
+
export { createEntityCacheHandlers, type DeletedPayload, type EntityCacheConfig, type EntityCacheEvent, type EntityCacheHandlers, type EntityCacheKey, type EntityCacheListConfig, type EntityCacheListShape, type EntityCacheMembership, type EntityCacheMembershipPolicy, type EntityCacheTotalDeltaInput, type EntityCacheTotalPolicy, } from './react/entity-cache.js';
|
|
4
4
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,yBAAyB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,yBAAyB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC"}
|