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
package/dist/react.js
CHANGED
|
@@ -104,20 +104,29 @@ function insertAt(items, item, at, compare) {
|
|
|
104
104
|
function mutateItemArrays(arrays, mutation, config, getId) {
|
|
105
105
|
const present = arrays.some((items) => items.some((item) => getId(item) === mutation.id));
|
|
106
106
|
if (mutation.type === "created" && present)
|
|
107
|
-
return arrays;
|
|
107
|
+
return { arrays, present };
|
|
108
108
|
if (mutation.type === "updated" && !present && config.updateMissing === "skip") {
|
|
109
|
-
return arrays;
|
|
109
|
+
return { arrays, present };
|
|
110
110
|
}
|
|
111
111
|
if (mutation.type !== "deleted" && (!present || mutation.type === "created")) {
|
|
112
112
|
if (arrays.length === 0)
|
|
113
|
-
return arrays;
|
|
113
|
+
return { arrays, present };
|
|
114
114
|
const target = config.createAt === "start" ? 0 : arrays.length - 1;
|
|
115
|
-
return
|
|
115
|
+
return {
|
|
116
|
+
arrays: arrays.map((items, index) => index === target ? insertAt(items, mutation.item, config.createAt, config.compare) : items),
|
|
117
|
+
present
|
|
118
|
+
};
|
|
116
119
|
}
|
|
117
120
|
if (mutation.type === "deleted") {
|
|
118
|
-
return
|
|
121
|
+
return {
|
|
122
|
+
arrays: arrays.map((items) => items.filter((item) => getId(item) !== mutation.id)),
|
|
123
|
+
present
|
|
124
|
+
};
|
|
119
125
|
}
|
|
120
|
-
return
|
|
126
|
+
return {
|
|
127
|
+
arrays: arrays.map((items) => ordered(items.map((item) => getId(item) === mutation.id ? mutation.item : item), config.compare)),
|
|
128
|
+
present
|
|
129
|
+
};
|
|
121
130
|
}
|
|
122
131
|
function firstArray(arrays) {
|
|
123
132
|
const first = arrays[0];
|
|
@@ -125,51 +134,140 @@ function firstArray(arrays) {
|
|
|
125
134
|
throw new Error("Entity cache list adapter lost its only item array");
|
|
126
135
|
return first;
|
|
127
136
|
}
|
|
137
|
+
function totalDelta(mutation, present, membership) {
|
|
138
|
+
if (mutation.type === "deleted") {
|
|
139
|
+
if (present)
|
|
140
|
+
return -1;
|
|
141
|
+
return "unknown";
|
|
142
|
+
}
|
|
143
|
+
if (membership === "unknown")
|
|
144
|
+
return "unknown";
|
|
145
|
+
if (mutation.type === "created") {
|
|
146
|
+
if (present)
|
|
147
|
+
return 0;
|
|
148
|
+
return membership === "include" ? 1 : 0;
|
|
149
|
+
}
|
|
150
|
+
if (present)
|
|
151
|
+
return membership === "exclude" ? -1 : 0;
|
|
152
|
+
return "unknown";
|
|
153
|
+
}
|
|
154
|
+
function reconcileTotal(value, delta) {
|
|
155
|
+
if (delta === "unknown")
|
|
156
|
+
return value;
|
|
157
|
+
if (!Number.isSafeInteger(delta)) {
|
|
158
|
+
throw new Error('Entity cache total delta must be a safe integer or "unknown"');
|
|
159
|
+
}
|
|
160
|
+
const current = Reflect.get(value, "total");
|
|
161
|
+
if (typeof current !== "number" || !Number.isSafeInteger(current) || current < 0) {
|
|
162
|
+
return value;
|
|
163
|
+
}
|
|
164
|
+
return { ...value, total: Math.max(0, current + delta) };
|
|
165
|
+
}
|
|
128
166
|
function unsupportedListShape(shape) {
|
|
129
167
|
throw new Error(`Unsupported entity cache list shape: ${String(shape)}`);
|
|
130
168
|
}
|
|
131
|
-
function patchList(context, key, config, mutation, getId) {
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
case "infinite-array":
|
|
141
|
-
context.queryClient.setQueriesData({ queryKey: key }, (old) => isRecord(old) && Array.isArray(old.pages) && old.pages.every((page) => Array.isArray(page)) ? { ...old, pages: mutate(old.pages) } : old);
|
|
142
|
-
return;
|
|
143
|
-
case "infinite-paginated":
|
|
144
|
-
context.queryClient.setQueriesData({ queryKey: key }, (old) => {
|
|
145
|
-
if (!isRecord(old) || !Array.isArray(old.pages) || !old.pages.every((page) => isRecord(page) && Array.isArray(page.items))) {
|
|
146
|
-
return old;
|
|
147
|
-
}
|
|
148
|
-
const items = mutate(old.pages.map((page) => page.items));
|
|
149
|
-
return {
|
|
150
|
-
...old,
|
|
151
|
-
pages: old.pages.map((page, index) => {
|
|
152
|
-
const pageItems = items[index];
|
|
153
|
-
if (!pageItems) {
|
|
154
|
-
throw new Error("Entity cache list adapter changed the page count");
|
|
155
|
-
}
|
|
156
|
-
return { ...page, items: pageItems };
|
|
157
|
-
})
|
|
158
|
-
};
|
|
159
|
-
});
|
|
169
|
+
function patchList(context, key, config, event, mutation, getId) {
|
|
170
|
+
const queries = context.queryClient.getQueryCache().findAll({ queryKey: key });
|
|
171
|
+
const patchExact = (exactKey, membership) => {
|
|
172
|
+
const effectiveMutation = membership === "exclude" && mutation.type !== "deleted" ? { type: "deleted", id: mutation.id } : mutation;
|
|
173
|
+
const unknown = membership === "unknown";
|
|
174
|
+
if (unknown && mutation.type !== "deleted") {
|
|
175
|
+
if (config.membership?.unknown === "invalidate" || config.total?.unknown === "invalidate") {
|
|
176
|
+
context.queryClient.invalidateQueries({ queryKey: exactKey, exact: true });
|
|
177
|
+
}
|
|
160
178
|
return;
|
|
161
|
-
|
|
162
|
-
|
|
179
|
+
}
|
|
180
|
+
let invalidateMembership = false;
|
|
181
|
+
const mutate = (arrays) => {
|
|
182
|
+
const result = mutateItemArrays(arrays, effectiveMutation, config, getId);
|
|
183
|
+
if (membership === "unknown" && mutation.type === "deleted" && !result.present && config.membership?.unknown === "invalidate") {
|
|
184
|
+
invalidateMembership = true;
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
};
|
|
188
|
+
let invalidateTotal = false;
|
|
189
|
+
const reconcile = (value, delta) => {
|
|
190
|
+
if (delta === "unknown" && config.total?.unknown === "invalidate") {
|
|
191
|
+
invalidateTotal = true;
|
|
192
|
+
}
|
|
193
|
+
return reconcileTotal(value, delta);
|
|
194
|
+
};
|
|
195
|
+
const invalidateIfNeeded = () => {
|
|
196
|
+
if (invalidateMembership || invalidateTotal) {
|
|
197
|
+
context.queryClient.invalidateQueries({ queryKey: exactKey, exact: true });
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
switch (config.shape) {
|
|
201
|
+
case "array":
|
|
202
|
+
context.queryClient.setQueryData(exactKey, (old) => Array.isArray(old) ? firstArray(mutate([old]).arrays) : old);
|
|
203
|
+
invalidateIfNeeded();
|
|
204
|
+
return;
|
|
205
|
+
case "paginated":
|
|
206
|
+
context.queryClient.setQueryData(exactKey, (old) => {
|
|
207
|
+
if (!isRecord(old) || !Array.isArray(old.items))
|
|
208
|
+
return old;
|
|
209
|
+
const result = mutate([old.items]);
|
|
210
|
+
const patched = { ...old, items: firstArray(result.arrays) };
|
|
211
|
+
const delta = config.total?.delta?.({
|
|
212
|
+
event,
|
|
213
|
+
queryKey: exactKey,
|
|
214
|
+
present: result.present,
|
|
215
|
+
membership
|
|
216
|
+
}) ?? totalDelta(mutation, result.present, membership);
|
|
217
|
+
return config.total ? reconcile(patched, delta) : patched;
|
|
218
|
+
});
|
|
219
|
+
invalidateIfNeeded();
|
|
220
|
+
return;
|
|
221
|
+
case "infinite-array":
|
|
222
|
+
context.queryClient.setQueryData(exactKey, (old) => isRecord(old) && Array.isArray(old.pages) && old.pages.every((page) => Array.isArray(page)) ? { ...old, pages: mutate(old.pages).arrays } : old);
|
|
223
|
+
invalidateIfNeeded();
|
|
224
|
+
return;
|
|
225
|
+
case "infinite-paginated":
|
|
226
|
+
context.queryClient.setQueryData(exactKey, (old) => {
|
|
227
|
+
if (!isRecord(old) || !Array.isArray(old.pages) || !old.pages.every((page) => isRecord(page) && Array.isArray(page.items))) {
|
|
228
|
+
return old;
|
|
229
|
+
}
|
|
230
|
+
const result = mutate(old.pages.map((page) => page.items));
|
|
231
|
+
const delta = config.total?.delta?.({
|
|
232
|
+
event,
|
|
233
|
+
queryKey: exactKey,
|
|
234
|
+
present: result.present,
|
|
235
|
+
membership
|
|
236
|
+
}) ?? totalDelta(mutation, result.present, membership);
|
|
237
|
+
return {
|
|
238
|
+
...old,
|
|
239
|
+
pages: old.pages.map((page, index) => {
|
|
240
|
+
const pageItems = result.arrays[index];
|
|
241
|
+
if (!pageItems) {
|
|
242
|
+
throw new Error("Entity cache list adapter changed the page count");
|
|
243
|
+
}
|
|
244
|
+
const patched = { ...page, items: pageItems };
|
|
245
|
+
return config.total ? reconcile(patched, delta) : patched;
|
|
246
|
+
})
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
invalidateIfNeeded();
|
|
250
|
+
return;
|
|
251
|
+
default:
|
|
252
|
+
unsupportedListShape(config.shape);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
for (const query of queries) {
|
|
256
|
+
const exactKey = query.queryKey;
|
|
257
|
+
patchExact(exactKey, config.membership?.evaluate(event, exactKey) ?? "include");
|
|
163
258
|
}
|
|
164
259
|
}
|
|
165
260
|
function createEntityCacheHandlers(config) {
|
|
261
|
+
if (config.list.total && config.list.shape !== "paginated" && config.list.shape !== "infinite-paginated") {
|
|
262
|
+
throw new Error("Entity cache total policy requires a paginated list shape");
|
|
263
|
+
}
|
|
166
264
|
const deletedId = config.getDeletedId ?? ((payload) => idOf(payload, config.getId));
|
|
167
265
|
const apply = (event, mutation, context) => {
|
|
168
266
|
const listKey = resolveKey(config.list.key, event);
|
|
169
267
|
const detailKey = config.detailKey ? resolveKey(config.detailKey, event) : undefined;
|
|
170
268
|
if (context.isFresh(detailKey ?? listKey))
|
|
171
269
|
return false;
|
|
172
|
-
patchList(context, listKey, config.list, mutation, config.getListItemId);
|
|
270
|
+
patchList(context, listKey, config.list, event, mutation, config.getListItemId);
|
|
173
271
|
return true;
|
|
174
272
|
};
|
|
175
273
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { AppError } from '../contract/errors';
|
|
2
|
+
import type { AppError } from '../contract/errors.js';
|
|
3
3
|
export interface RealtimeEventDefinition<TArgs extends z.ZodType<unknown[]> = z.ZodType<unknown[]>, TAck extends z.ZodType | undefined = z.ZodType | undefined> {
|
|
4
4
|
args: TArgs;
|
|
5
5
|
ack?: TAck;
|
package/dist/realtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defineRealtimeContract, type InferRealtimeEventMap, type RealtimeAcknowledgedEvent, type RealtimeAcknowledgement, type RealtimeContract, type RealtimeEmitArguments, type RealtimeEventArguments, type RealtimeEventDefinition, type RealtimeEventHandler, type RealtimeEventRegistry, type RealtimeRejectDirection, type RealtimeRejectedEvent, type RealtimeRejectedEventHook, type RealtimeRequestArguments, } from './contract';
|
|
2
|
-
export { asRealtimeRejection, REALTIME_REJECTION_KEY, type RealtimeRejectionEnvelope, type RealtimeRejectionIssue, type RealtimeRejectionReport, } from './rejected-frame';
|
|
3
|
-
export { RealtimeRequestDisconnectedError, RealtimeRequestInvalidAcknowledgementError, type RealtimeRequestOptions, RealtimeRequestRejectedError, RealtimeRequestTimeoutError, } from './request';
|
|
4
|
-
export type { ValidatedRealtimeSocket } from './socket';
|
|
1
|
+
export { defineRealtimeContract, type InferRealtimeEventMap, type RealtimeAcknowledgedEvent, type RealtimeAcknowledgement, type RealtimeContract, type RealtimeEmitArguments, type RealtimeEventArguments, type RealtimeEventDefinition, type RealtimeEventHandler, type RealtimeEventRegistry, type RealtimeRejectDirection, type RealtimeRejectedEvent, type RealtimeRejectedEventHook, type RealtimeRequestArguments, } from './contract.js';
|
|
2
|
+
export { asRealtimeRejection, REALTIME_REJECTION_KEY, type RealtimeRejectionEnvelope, type RealtimeRejectionIssue, type RealtimeRejectionReport, } from './rejected-frame.js';
|
|
3
|
+
export { RealtimeRequestDisconnectedError, RealtimeRequestInvalidAcknowledgementError, type RealtimeRequestOptions, RealtimeRequestRejectedError, RealtimeRequestTimeoutError, } from './request.js';
|
|
4
|
+
export type { ValidatedRealtimeSocket } from './socket.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RealtimeRejectDirection, RealtimeRejectedEvent } from './contract';
|
|
1
|
+
import type { RealtimeRejectDirection, RealtimeRejectedEvent } from './contract.js';
|
|
2
2
|
export declare function realtimeContractViolation(options: {
|
|
3
3
|
event: string;
|
|
4
4
|
direction: RealtimeRejectDirection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RealtimeRejectionIssue } from './rejected-frame';
|
|
1
|
+
import type { RealtimeRejectionIssue } from './rejected-frame.js';
|
|
2
2
|
export interface RealtimeRequestOptions {
|
|
3
3
|
/** Maximum acknowledgement wait in milliseconds. Must be finite and > 0. */
|
|
4
4
|
timeoutMs: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { StitchLogger } from '../logger';
|
|
3
|
-
import type { RealtimeEmitArguments, RealtimeEventHandler, RealtimeEventRegistry, RealtimeRejectDirection, RealtimeRejectedEventHook } from './contract';
|
|
2
|
+
import type { StitchLogger } from '../logger.js';
|
|
3
|
+
import type { RealtimeEmitArguments, RealtimeEventHandler, RealtimeEventRegistry, RealtimeRejectDirection, RealtimeRejectedEventHook } from './contract.js';
|
|
4
4
|
interface ValidatedRealtimeSocketOptions<TInbound extends RealtimeEventRegistry, TOutbound extends RealtimeEventRegistry> {
|
|
5
5
|
target: object;
|
|
6
6
|
inbound: TInbound;
|
package/dist/remote.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* own entrypoint lets CLI and other thin processes proxy a deployed API without
|
|
6
6
|
* importing the MCP SDK or the AI SDK through the broad tools barrel.
|
|
7
7
|
*/
|
|
8
|
-
export { type ImplementRemoteOptions, implementRemote } from './tools/remote';
|
|
8
|
+
export { type ImplementRemoteOptions, implementRemote } from './tools/remote.js';
|
|
9
9
|
//# sourceMappingURL=remote.d.ts.map
|
package/dist/remote.js
CHANGED
package/dist/server/bun.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ManagedServerHandle } from './shutdown';
|
|
2
|
-
import type { SocketIOServerLifecycle } from './socket-io';
|
|
3
|
-
import type { FetchComposition, FetchHandler, HandlerConfig, RawRoute, RawRouteContext } from './types';
|
|
1
|
+
import { type ManagedServerHandle } from './shutdown.js';
|
|
2
|
+
import type { SocketIOServerLifecycle } from './socket-io.js';
|
|
3
|
+
import type { FetchComposition, FetchHandler, HandlerConfig, RawRoute, RawRouteContext } from './types.js';
|
|
4
4
|
/** The concrete `Bun.serve` server instance passed to Bun raw routes. */
|
|
5
5
|
export type BunServer = ReturnType<typeof Bun.serve>;
|
|
6
6
|
export type BunRawRoute = RawRoute<BunServer>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimeContext } from '../contract';
|
|
1
|
+
import type { RuntimeContext } from '../contract/index.js';
|
|
2
2
|
/** Keys whose value is owned by a transport/runtime boundary, never by application enrichment. */
|
|
3
3
|
export declare const RUNTIME_CONTEXT_RESERVED_KEYS: Set<string>;
|
|
4
4
|
/**
|
package/dist/server/context.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* `RuntimeContext` assembly — parses params / body / multipart against the
|
|
3
3
|
* endpoint schemas and gathers request metadata (trace id, client info).
|
|
4
4
|
*/
|
|
5
|
-
import { type RuntimeContext } from '../contract';
|
|
6
|
-
import { type MultipartLifecycle } from './multipart';
|
|
7
|
-
import { type ClientIpOptions } from './request';
|
|
8
|
-
import type { AuthorizationContext, MethodDef } from './types';
|
|
5
|
+
import { type RuntimeContext } from '../contract/index.js';
|
|
6
|
+
import { type MultipartLifecycle } from './multipart.js';
|
|
7
|
+
import { type ClientIpOptions } from './request.js';
|
|
8
|
+
import type { AuthorizationContext, MethodDef } from './types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Assemble everything knowable from the URL alone — path params, the request,
|
|
11
11
|
* trace id and client info — **before** any schema parsing. Bound first so a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EndpointStreamDescriptor } from '../contract';
|
|
2
|
-
import type { RawRouteContext } from './types';
|
|
1
|
+
import { type EndpointStreamDescriptor } from '../contract/index.js';
|
|
2
|
+
import type { RawRouteContext } from './types.js';
|
|
3
3
|
/** Build the HTTP response for one contract-declared stream. */
|
|
4
4
|
export declare function contractStreamResponse(request: Request, context: RawRouteContext, source: AsyncIterable<unknown>, descriptor: EndpointStreamDescriptor, operationAbort: AbortController): Promise<Response>;
|
|
5
5
|
//# sourceMappingURL=contract-stream.d.ts.map
|
package/dist/server/create.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FetchHandler, HandlerConfig } from './types';
|
|
1
|
+
import type { FetchHandler, HandlerConfig } from './types.js';
|
|
2
2
|
export declare function createHandler<TServer = unknown>(config: HandlerConfig<TServer>): FetchHandler<TServer>;
|
|
3
3
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
* createServer({ services, hooks: { onError } });
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
import type { RuntimeContext } from '../contract';
|
|
39
|
-
import { type StitchErrorCode } from '../contract';
|
|
40
|
-
import type { LifecycleHooks, MethodDef } from './types';
|
|
38
|
+
import type { RuntimeContext } from '../contract/index.js';
|
|
39
|
+
import { type StitchErrorCode } from '../contract/index.js';
|
|
40
|
+
import type { LifecycleHooks, MethodDef } from './types.js';
|
|
41
41
|
/** The normalised error handed to `render` — code already remapped. */
|
|
42
42
|
export interface ResolvedError {
|
|
43
43
|
/** Wire code — the app code from `codeMap` for a stitch error, else the thrown code. */
|
package/dist/server/file.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
|
-
import type { ContractDef, EndpointDef, MultipartDescriptor, RuntimeContext } from '../contract';
|
|
3
|
-
import type { EndpointHandlerContext, Handlers, MultipartReceiver, ScopeContexts, ScopedHandlers, ServiceDef, StreamingMultipartImplementation } from './types';
|
|
2
|
+
import type { ContractDef, EndpointDef, MultipartDescriptor, RuntimeContext } from '../contract/index.js';
|
|
3
|
+
import type { EndpointHandlerContext, Handlers, MultipartReceiver, ScopeContexts, ScopedHandlers, ServiceDef, StreamingMultipartImplementation } from './types.js';
|
|
4
4
|
type StreamingEndpoint = EndpointDef & {
|
|
5
5
|
multipart: MultipartDescriptor & {
|
|
6
6
|
delivery: 'stream';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export { AppError, appError, badRequest, conflict, forbidden, isStitchErrorCode, notFound, rateLimited, STITCH_ERROR_STATUS, type StitchErrorCode, unauthorized, } from '../contract';
|
|
2
|
-
export { errorCode, formatZodError, normalizeError, type ZodIssueSummary, zodIssues, } from '../internal/errors';
|
|
3
|
-
export { isWithinDir } from '../internal/within-dir';
|
|
4
|
-
export { type BunFetchComposition as FetchComposition, type BunFetchHandler as FetchHandler, type BunHandlerConfig as HandlerConfig, type BunRawRoute as RawRoute, type BunRawRouteContext as RawRouteContext, type BunServer, type BunServerConfig, type BunServerHandle, createServer, type ServerPassthrough, type UnixListenConfig, } from './bun';
|
|
5
|
-
export { type CacheOptions, cacheHeaders, createCache } from './cache';
|
|
6
|
-
export { createHandler } from './create';
|
|
7
|
-
export { createErrorHook, type ErrorHookConfig, type ResolvedError, } from './error-hook';
|
|
8
|
-
export { createEventBus, type DefaultEventMap, type EventBus, type EventBusOptions, type EventHandler, } from './event-bus';
|
|
9
|
-
export { type ByteRange, parseByteRange, type ServeFileOptions, serveFile, staticRoute, weakETag, } from './file';
|
|
10
|
-
export { createImplement, createImplementRegistry, createMultipartStream, createScopedImplement, createScopedImplementRegistry, defineMultipartStream, type ExactRegistryHandlers, type ExactScopedRegistryHandlers, type ImplementationRegistry, implement, implementRegistry, type KeyedServices, type MultipartStreamConfig, type RegistryHandlers, type ScopedImplementationRegistry, type ScopedRegistryHandlers, type StreamScope, } from './implement';
|
|
11
|
-
export { composeLifecycleHooks } from './lifecycle';
|
|
12
|
-
export type { LogFormat } from './logger';
|
|
13
|
-
export { type AuthHook, type AuthHookConfig, type AuthRule, type AuthRuleContribution, type AuthRules, type AuthScopes, type BearerResolverConfig, type ComposeAuthHooksConfig, type ComposedAuthScopes, composeAuthHooks, createAuthHook, createBearerResolver, extractToken, type JwtPayload, type RuleScopes, type ScopedAuthHook, type ScopedAuthRule, type SignJwtOptions, signJwt, type VerifyJwtOptions, verifyJwt, } from './middleware/auth';
|
|
14
|
-
export { type CookieDef, type CookieOptions, defineCookie, parseCookies, serializeCookie, } from './middleware/cookies';
|
|
15
|
-
export { type CorsConfig, corsHeaders, corsPreflightResponse, DEFAULT_CORS_ALLOW_HEADERS, DEFAULT_CORS_EXPOSE_HEADERS, } from './middleware/cors';
|
|
16
|
-
export { deriveCodeChallenge, type PkceMethod, verifyPkce } from './middleware/pkce';
|
|
17
|
-
export { type MultipartLifecycle, type MultipartResult, parseMultipart } from './multipart';
|
|
18
|
-
export { generateOpenApiDocument, type OpenApiConfig, type OpenApiDocument, type OpenApiInfo, type OpenApiServer, openApiRoute, } from './openapi';
|
|
19
|
-
export { bindProcessSignals, type ProcessSignalName, type ProcessSignalsBinding, type ProcessSignalsErrorPhase, type ProcessSignalsOptions, type ShutdownTarget, type SignalSource, } from './process-signals';
|
|
20
|
-
export { createRateLimiter, type RateLimitConfig } from './rate-limit';
|
|
21
|
-
export { errorResponse, parseBody, respondJson } from './raw';
|
|
22
|
-
export { bindRealtimeServer, type RealtimeServer, type RealtimeServerConnection, type RealtimeServerHandle, } from './realtime';
|
|
23
|
-
export { type ClientIpOptions, extractIp, generateTraceId, getClientInfo, resolveSocketIp, resolveTraceId, } from './request';
|
|
24
|
-
export { type ManagedServerHandle, type ShutdownOptions, ShutdownOptionsSchema, type ShutdownResult, ShutdownResultSchema, type ShutdownState, ShutdownStateSchema, type ShutdownStatus, ShutdownStatusSchema, } from './shutdown';
|
|
25
|
-
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, SocketIOServerHandle, SocketIOServerLifecycle, } from './socket-io';
|
|
26
|
-
export { createSocketIOServer, socketIoLane } from './socket-io';
|
|
27
|
-
export { type ParseSSEOptions, parseSSE, streamSSE } from './stream';
|
|
28
|
-
export { DEFAULT_STREAM_HEARTBEAT_MS, ndjsonRoute, type StreamingFormat, type StreamingRouteOptions, type StreamingSourceContext, sseRoute, streamingRoute, } from './streaming-route';
|
|
29
|
-
export type { AuthorizationContext, EffectiveScope, EndpointHandlerContext, Handlers, LifecycleHooks, LoggingConfig, LogOutcome, MethodDef, MultipartFileMetadata, MultipartReceiver, MultipartReceiverResult, OperationIdentity, RouteGroup, ScopeContexts, ScopedHandlers, ServiceDef, StitchLogger, StreamingMultipartImplementation, } from './types';
|
|
30
|
-
export { createUnixClientTransport, type UnixClientDeliveryState, type UnixClientTransport, type UnixClientTransportConfig, UnixClientTransportError, type UnixClientTransportErrorCode, } from './unix-client';
|
|
31
|
-
export { type ComposedLane, composeWebSocketHandlers, type WebSocketComposeConfig, type WebSocketLane, webSocketLane, } from './websocket';
|
|
1
|
+
export { AppError, appError, badRequest, conflict, forbidden, isStitchErrorCode, notFound, rateLimited, STITCH_ERROR_STATUS, type StitchErrorCode, unauthorized, } from '../contract/index.js';
|
|
2
|
+
export { errorCode, formatZodError, normalizeError, type ZodIssueSummary, zodIssues, } from '../internal/errors.js';
|
|
3
|
+
export { isWithinDir } from '../internal/within-dir.js';
|
|
4
|
+
export { type BunFetchComposition as FetchComposition, type BunFetchHandler as FetchHandler, type BunHandlerConfig as HandlerConfig, type BunRawRoute as RawRoute, type BunRawRouteContext as RawRouteContext, type BunServer, type BunServerConfig, type BunServerHandle, createServer, type ServerPassthrough, type UnixListenConfig, } from './bun.js';
|
|
5
|
+
export { type CacheOptions, cacheHeaders, createCache } from './cache.js';
|
|
6
|
+
export { createHandler } from './create.js';
|
|
7
|
+
export { createErrorHook, type ErrorHookConfig, type ResolvedError, } from './error-hook.js';
|
|
8
|
+
export { createEventBus, type DefaultEventMap, type EventBus, type EventBusOptions, type EventHandler, } from './event-bus.js';
|
|
9
|
+
export { type ByteRange, parseByteRange, type ServeFileOptions, serveFile, staticRoute, weakETag, } from './file.js';
|
|
10
|
+
export { createImplement, createImplementRegistry, createMultipartStream, createScopedImplement, createScopedImplementRegistry, defineMultipartStream, type ExactRegistryHandlers, type ExactScopedRegistryHandlers, type ImplementationRegistry, implement, implementRegistry, type KeyedServices, type MultipartStreamConfig, type RegistryHandlers, type ScopedImplementationRegistry, type ScopedRegistryHandlers, type StreamScope, } from './implement.js';
|
|
11
|
+
export { composeLifecycleHooks } from './lifecycle.js';
|
|
12
|
+
export type { LogFormat } from './logger.js';
|
|
13
|
+
export { type AuthHook, type AuthHookConfig, type AuthRule, type AuthRuleContribution, type AuthRules, type AuthScopes, type BearerResolverConfig, type ComposeAuthHooksConfig, type ComposedAuthScopes, composeAuthHooks, createAuthHook, createBearerResolver, extractToken, type JwtPayload, type RuleScopes, type ScopedAuthHook, type ScopedAuthRule, type SignJwtOptions, signJwt, type VerifyJwtOptions, verifyJwt, } from './middleware/auth.js';
|
|
14
|
+
export { type CookieDef, type CookieOptions, defineCookie, parseCookies, serializeCookie, } from './middleware/cookies.js';
|
|
15
|
+
export { type CorsConfig, corsHeaders, corsPreflightResponse, DEFAULT_CORS_ALLOW_HEADERS, DEFAULT_CORS_EXPOSE_HEADERS, } from './middleware/cors.js';
|
|
16
|
+
export { deriveCodeChallenge, type PkceMethod, verifyPkce } from './middleware/pkce.js';
|
|
17
|
+
export { type MultipartLifecycle, type MultipartResult, parseMultipart } from './multipart.js';
|
|
18
|
+
export { generateOpenApiDocument, type OpenApiConfig, type OpenApiDocument, type OpenApiInfo, type OpenApiServer, openApiRoute, } from './openapi.js';
|
|
19
|
+
export { bindProcessSignals, type ProcessSignalName, type ProcessSignalsBinding, type ProcessSignalsErrorPhase, type ProcessSignalsOptions, type ShutdownTarget, type SignalSource, } from './process-signals.js';
|
|
20
|
+
export { createRateLimiter, type RateLimitConfig } from './rate-limit.js';
|
|
21
|
+
export { errorResponse, parseBody, respondJson } from './raw.js';
|
|
22
|
+
export { bindRealtimeServer, type RealtimeServer, type RealtimeServerConnection, type RealtimeServerHandle, } from './realtime.js';
|
|
23
|
+
export { type ClientIpOptions, extractIp, generateTraceId, getClientInfo, resolveSocketIp, resolveTraceId, } from './request.js';
|
|
24
|
+
export { type ManagedServerHandle, type ShutdownOptions, ShutdownOptionsSchema, type ShutdownResult, ShutdownResultSchema, type ShutdownState, ShutdownStateSchema, type ShutdownStatus, ShutdownStatusSchema, } from './shutdown.js';
|
|
25
|
+
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, SocketIOServerHandle, SocketIOServerLifecycle, } from './socket-io.js';
|
|
26
|
+
export { createSocketIOServer, socketIoLane } from './socket-io.js';
|
|
27
|
+
export { type ParseSSEOptions, parseSSE, streamSSE } from './stream.js';
|
|
28
|
+
export { DEFAULT_STREAM_HEARTBEAT_MS, ndjsonRoute, type StreamingFormat, type StreamingRouteOptions, type StreamingSourceContext, sseRoute, streamingRoute, } from './streaming-route.js';
|
|
29
|
+
export type { AuthorizationContext, EffectiveScope, EndpointHandlerContext, Handlers, LifecycleHooks, LoggingConfig, LogOutcome, MethodDef, MultipartFileMetadata, MultipartReceiver, MultipartReceiverResult, OperationIdentity, RouteGroup, ScopeContexts, ScopedHandlers, ServiceDef, StitchLogger, StreamingMultipartImplementation, } from './types.js';
|
|
30
|
+
export { createUnixClientTransport, type UnixClientDeliveryState, type UnixClientTransport, type UnixClientTransportConfig, UnixClientTransportError, type UnixClientTransportErrorCode, } from './unix-client.js';
|
|
31
|
+
export { type ComposedLane, composeWebSocketHandlers, type WebSocketComposeConfig, type WebSocketLane, webSocketLane, } from './websocket.js';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/server/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
sseRoute,
|
|
14
14
|
streamingRoute,
|
|
15
15
|
webSocketLane
|
|
16
|
-
} from "../index-
|
|
16
|
+
} from "../index-nck3yx3y.js";
|
|
17
17
|
import {
|
|
18
18
|
composeAuthHooks,
|
|
19
19
|
createAuthHook,
|
|
@@ -41,6 +41,14 @@ import {
|
|
|
41
41
|
implement,
|
|
42
42
|
implementRegistry
|
|
43
43
|
} from "../index-pr0qsmjy.js";
|
|
44
|
+
import {
|
|
45
|
+
extractIp,
|
|
46
|
+
generateTraceId,
|
|
47
|
+
getClientInfo,
|
|
48
|
+
getTraceId,
|
|
49
|
+
resolveSocketIp,
|
|
50
|
+
resolveTraceId
|
|
51
|
+
} from "../index-69m2278y.js";
|
|
44
52
|
import {
|
|
45
53
|
isWithinDir,
|
|
46
54
|
realPathWithinDir
|
|
@@ -62,14 +70,6 @@ import {
|
|
|
62
70
|
parseSSE,
|
|
63
71
|
streamSSE
|
|
64
72
|
} from "../index-v5bayx1z.js";
|
|
65
|
-
import {
|
|
66
|
-
extractIp,
|
|
67
|
-
generateTraceId,
|
|
68
|
-
getClientInfo,
|
|
69
|
-
getTraceId,
|
|
70
|
-
resolveSocketIp,
|
|
71
|
-
resolveTraceId
|
|
72
|
-
} from "../index-69m2278y.js";
|
|
73
73
|
import {
|
|
74
74
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
|
|
75
75
|
errorCode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LifecycleHooks } from './types';
|
|
1
|
+
import type { LifecycleHooks } from './types.js';
|
|
2
2
|
/** Compose ordinary HTTP lifecycle hooks inside each existing phase slot. */
|
|
3
3
|
export declare function composeLifecycleHooks(...hooks: readonly (LifecycleHooks | undefined)[]): LifecycleHooks;
|
|
4
4
|
//# sourceMappingURL=lifecycle.d.ts.map
|
package/dist/server/logging.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LoggingConfig, LogOutcome } from './types';
|
|
1
|
+
import type { LoggingConfig, LogOutcome } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Normalise `logging` into either a config or `null` (off). `true` is shorthand
|
|
4
4
|
* for `{}`: any object turns logging on, and `logger` decides which sink writes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RuntimeContext } from '../../contract';
|
|
2
|
-
import type { AuthorizationContext, OperationIdentity } from '../types';
|
|
1
|
+
import type { RuntimeContext } from '../../contract/index.js';
|
|
2
|
+
import type { AuthorizationContext, OperationIdentity } from '../types.js';
|
|
3
3
|
export interface JwtPayload {
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MultipartDescriptor } from '../contract';
|
|
2
|
-
import type { MultipartReceiver } from './types';
|
|
1
|
+
import type { MultipartDescriptor } from '../contract/index.js';
|
|
2
|
+
import type { MultipartReceiver } from './types.js';
|
|
3
3
|
export interface MultipartLifecycle {
|
|
4
4
|
rollback(): Promise<void>;
|
|
5
5
|
}
|
package/dist/server/node.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Server as HttpServer } from 'node:http';
|
|
2
2
|
import { serve } from 'srvx/node';
|
|
3
|
-
import { type ManagedServerHandle } from './shutdown';
|
|
4
|
-
import type { FetchComposition, HandlerConfig } from './types';
|
|
3
|
+
import { type ManagedServerHandle } from './shutdown.js';
|
|
4
|
+
import type { FetchComposition, HandlerConfig } from './types.js';
|
|
5
5
|
export interface NodeSocketLifecycle {
|
|
6
6
|
attach(server: HttpServer): void;
|
|
7
7
|
beginShutdown(): void;
|
package/dist/server/openapi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* emits — not a divergent code path. Schemas are inlined (valid OpenAPI);
|
|
11
11
|
* `$ref` de-duplication can come later if a spec grows unwieldy.
|
|
12
12
|
*/
|
|
13
|
-
import type { MethodDef, RawRoute, ServiceDef } from './types';
|
|
13
|
+
import type { MethodDef, RawRoute, ServiceDef } from './types.js';
|
|
14
14
|
export interface OpenApiInfo {
|
|
15
15
|
title: string;
|
|
16
16
|
version: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProcessSignalName, SignalSource } from './process-signals';
|
|
1
|
+
import type { ProcessSignalName, SignalSource } from './process-signals.js';
|
|
2
2
|
export declare const DEFAULT_PROCESS_SIGNALS: readonly ProcessSignalName[];
|
|
3
3
|
export declare const defaultSignalSource: SignalSource;
|
|
4
4
|
export declare function reportSignalError<TPhase extends string>(phase: TPhase, error: unknown, onError: ((phase: TPhase, error: unknown) => void) | undefined): void;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* throws, and a third signal on a process whose default disposition the first
|
|
10
10
|
* `process.on` already suppressed. → ADR 0076
|
|
11
11
|
*/
|
|
12
|
-
import type { ShutdownOptions, ShutdownResult } from './shutdown';
|
|
12
|
+
import type { ShutdownOptions, ShutdownResult } from './shutdown.js';
|
|
13
13
|
/**
|
|
14
14
|
* Signal names this binding can listen for.
|
|
15
15
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DefaultEventsMap, Socket, Server as SocketIOServer } from 'socket.io';
|
|
2
|
-
import type { SocketEventMap } from '../browser/socket-io';
|
|
3
|
-
import type { StitchLogger } from '../logger';
|
|
4
|
-
import type { RealtimeContract, RealtimeEventRegistry, RealtimeRejectedEventHook } from '../realtime/contract';
|
|
5
|
-
import { type ValidatedRealtimeSocket } from '../realtime/socket';
|
|
2
|
+
import type { SocketEventMap } from '../browser/socket-io.js';
|
|
3
|
+
import type { StitchLogger } from '../logger.js';
|
|
4
|
+
import type { RealtimeContract, RealtimeEventRegistry, RealtimeRejectedEventHook } from '../realtime/contract.js';
|
|
5
|
+
import { type ValidatedRealtimeSocket } from '../realtime/socket.js';
|
|
6
6
|
export interface RealtimeServerConnection<TServerToClient extends RealtimeEventRegistry, TClientToServer extends RealtimeEventRegistry, TData = any> {
|
|
7
7
|
/**
|
|
8
8
|
* Raw Socket.IO socket for rooms and application-owned delivery policy.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResponseMetadata } from '../contract';
|
|
1
|
+
import type { ResponseMetadata } from '../contract/index.js';
|
|
2
2
|
/** Create one isolated outbound collector for a response-metadata handler. */
|
|
3
3
|
export declare function createResponseMetadata(): ResponseMetadata;
|
|
4
4
|
/**
|
package/dist/server/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LifecycleHooks, MethodDef, RawRoute, ServiceDef } from './types';
|
|
1
|
+
import type { LifecycleHooks, MethodDef, RawRoute, ServiceDef } from './types.js';
|
|
2
2
|
/** A service mounted under a path prefix, carrying optional group hooks. */
|
|
3
3
|
export interface NormalizedGroup {
|
|
4
4
|
prefix: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Node-facing Socket.IO surface without Bun engine declarations. */
|
|
2
2
|
import type { Server as HttpServer } from 'node:http';
|
|
3
3
|
import type { DefaultEventsMap, Server as SocketIOServer } from 'socket.io';
|
|
4
|
-
import type { SocketEventMap } from '../browser/socket-io';
|
|
5
|
-
import type { SocketIOServerConfig } from './socket-io-config';
|
|
6
|
-
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, } from './socket-io-config';
|
|
4
|
+
import type { SocketEventMap } from '../browser/socket-io.js';
|
|
5
|
+
import type { SocketIOServerConfig } from './socket-io-config.js';
|
|
6
|
+
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, } from './socket-io-config.js';
|
|
7
7
|
/** The runtime-neutral part of a Socket.IO handle used by `serveNode`. */
|
|
8
8
|
export interface NodeSocketIOServerHandle<TServerEvents extends SocketEventMap, TClientEvents extends SocketEventMap, TData = any> {
|
|
9
9
|
io: SocketIOServer<TClientEvents, TServerEvents, DefaultEventsMap, TData>;
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
import type { Server as HttpServer } from 'node:http';
|
|
19
19
|
import type { Server as BunEngine } from '@socket.io/bun-engine';
|
|
20
20
|
import type { DefaultEventsMap, Server as SocketIOServer } from 'socket.io';
|
|
21
|
-
import type { SocketEventMap } from '../browser/socket-io';
|
|
22
|
-
import type { BunServer } from './bun';
|
|
23
|
-
import type { SocketIOServerConfig } from './socket-io-config';
|
|
24
|
-
import type { RawRoute } from './types';
|
|
25
|
-
import { type ComposedLane } from './websocket';
|
|
26
|
-
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, } from './socket-io-config';
|
|
21
|
+
import type { SocketEventMap } from '../browser/socket-io.js';
|
|
22
|
+
import type { BunServer } from './bun.js';
|
|
23
|
+
import type { SocketIOServerConfig } from './socket-io-config.js';
|
|
24
|
+
import type { RawRoute } from './types.js';
|
|
25
|
+
import { type ComposedLane } from './websocket.js';
|
|
26
|
+
export type { SocketIOHandshakeConfig, SocketIOPeerLoaders, SocketIORequestPolicy, SocketIOServerConfig, } from './socket-io-config.js';
|
|
27
27
|
export interface SocketIOServerLifecycle {
|
|
28
28
|
/**
|
|
29
29
|
* WebSocket handler for `Bun.serve({ websocket })`. Real on Bun; on Node it is
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
* iterable is returned, so a departed subscriber does not leave live work
|
|
40
40
|
* running on the server.
|
|
41
41
|
*/
|
|
42
|
-
import type { HttpMethod } from '../contract/define';
|
|
43
|
-
import type { RawRoute, RawRouteContext } from './types';
|
|
42
|
+
import type { HttpMethod } from '../contract/define.js';
|
|
43
|
+
import type { RawRoute, RawRouteContext } from './types.js';
|
|
44
44
|
/** How a value becomes bytes on the wire. The only thing the two formats differ in. */
|
|
45
45
|
export type StreamingFormat = 'ndjson' | 'sse';
|
|
46
46
|
/**
|