stitchkit 0.103.13 → 0.104.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/CHANGELOG.md +120 -0
- package/darwin-native.cjs +1 -3
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +10 -10
- package/dist/agent-runtime/store-conformance-support.d.ts +5 -5
- package/dist/application/directory-inbox-accept.d.ts +13 -0
- package/dist/application/directory-inbox-accept.d.ts.map +1 -0
- package/dist/application/directory-inbox-contract.d.ts +42 -5
- package/dist/application/directory-inbox-contract.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts +14 -0
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -0
- package/dist/application/directory-inbox-files.d.ts +28 -0
- package/dist/application/directory-inbox-files.d.ts.map +1 -0
- package/dist/application/directory-inbox-state.d.ts +14 -0
- package/dist/application/directory-inbox-state.d.ts.map +1 -0
- package/dist/application/directory-inbox.d.ts +2 -1
- package/dist/application/directory-inbox.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +2 -8
- package/dist/application/file-state-store.d.ts.map +1 -1
- package/dist/application/state-store.d.ts +6 -1
- package/dist/application/state-store.d.ts.map +1 -1
- package/dist/browser/client-arguments.d.ts +4 -0
- package/dist/browser/client-arguments.d.ts.map +1 -0
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http.d.ts +2 -1
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/native-fetch.d.ts +8 -0
- package/dist/browser/native-fetch.d.ts.map +1 -0
- package/dist/contract/errors.d.ts +16 -12
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +5 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/contract/stream.d.ts +1 -0
- package/dist/contract/stream.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +3 -3
- package/dist/entrypoints/agent-runtime/coding-tools.js +6 -6
- package/dist/entrypoints/agent-runtime/harness-tools.js +8 -8
- package/dist/entrypoints/agent-runtime/harness.js +11 -11
- package/dist/entrypoints/agent-runtime/realtime.js +3 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +6 -6
- package/dist/entrypoints/agent-runtime.js +13 -13
- package/dist/entrypoints/application/diagnostic-journal.js +1 -1
- package/dist/entrypoints/application/directory-inbox.js +424 -119
- package/dist/entrypoints/application/grammy.js +1 -1
- package/dist/entrypoints/application.d.ts +2 -2
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +7 -3
- package/dist/entrypoints/cli.d.ts +2 -0
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +757 -136
- package/dist/entrypoints/contract.js +3 -3
- package/dist/entrypoints/files/packaging.d.ts +3 -0
- package/dist/entrypoints/files/packaging.d.ts.map +1 -0
- package/dist/entrypoints/files/packaging.js +133 -0
- package/dist/entrypoints/files.js +10 -107
- package/dist/entrypoints/index.js +7 -7
- package/dist/entrypoints/node.js +8 -8
- package/dist/entrypoints/observability.js +2 -2
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +19 -6
- package/dist/entrypoints/server.d.ts +1 -1
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +23 -17
- package/dist/entrypoints/telegram.d.ts +1 -0
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +214 -98
- package/dist/entrypoints/testing.js +7 -7
- package/dist/entrypoints/tools/connections.d.ts +2 -2
- package/dist/entrypoints/tools/connections.d.ts.map +1 -1
- package/dist/entrypoints/tools/connections.js +427 -294
- package/dist/entrypoints/tools/invoker.js +6 -6
- package/dist/entrypoints/tools/mcp.d.ts +12 -0
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -0
- package/dist/entrypoints/tools/mcp.js +45 -0
- package/dist/entrypoints/tools.d.ts +1 -0
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +82 -1147
- package/dist/entrypoints/tracking.js +1 -1
- package/dist/files/boundary.d.ts +2 -8
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +0 -5
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/native-packaging-layout.d.ts +12 -0
- package/dist/files/native-packaging-layout.d.ts.map +1 -0
- package/dist/files/native-packaging.d.ts +72 -0
- package/dist/files/native-packaging.d.ts.map +1 -0
- package/dist/files/read.d.ts +2 -2
- package/dist/files/read.d.ts.map +1 -1
- package/dist/index-1a6jtnd9.js +88 -0
- package/dist/index-269zqj8m.js +77 -0
- package/dist/{index-r34mvse1.js → index-27a2pj09.js} +1 -1
- package/dist/{index-r956rndn.js → index-2hyavjjj.js} +3 -3
- package/dist/{index-m2xqkv55.js → index-2vnh05w4.js} +83 -14
- package/dist/{index-pw99k9h5.js → index-43p08g7t.js} +1 -1
- package/dist/{index-xwq9j1sf.js → index-4e0ah203.js} +9 -7
- package/dist/{index-qapzv4p5.js → index-5z6jn897.js} +1 -1
- package/dist/{index-ahvsksw5.js → index-6d9xaxw1.js} +1 -1
- package/dist/{index-8zfsgar0.js → index-6drst9sg.js} +11 -5
- package/dist/{index-x87j7csh.js → index-77nxk6ay.js} +2 -2
- package/dist/{index-dnn9z96q.js → index-a0zzh8ak.js} +3 -3
- package/dist/{index-kmpzj1cq.js → index-a3wma1hk.js} +1 -1
- package/dist/{index-j8aw2c0e.js → index-bakgedh8.js} +35 -7
- package/dist/index-bhb950qs.js +1145 -0
- package/dist/{index-tgzhq07n.js → index-cvda079a.js} +1 -1
- package/dist/{index-n2gre124.js → index-fa4wg312.js} +4 -4
- package/dist/{index-zp4jpkp0.js → index-fk18k56k.js} +2 -2
- package/dist/{index-afjvjyck.js → index-g2j7pnak.js} +2 -134
- package/dist/index-g95fk660.js +116 -0
- package/dist/{index-r5c4fedv.js → index-h2fhjqy7.js} +2 -1
- package/dist/{index-sybedc8b.js → index-hbd32c6a.js} +23 -94
- package/dist/{index-fyphpknh.js → index-hp9d77wk.js} +1 -1
- package/dist/index-jd470k6q.js +109 -0
- package/dist/{index-b2bz0kdm.js → index-kb8styz3.js} +4 -3
- package/dist/{index-0c419yx7.js → index-kemm0ej5.js} +12 -9
- package/dist/{index-db2spkv1.js → index-ptn0g0gj.js} +3 -3
- package/dist/{index-w575evhq.js → index-r4r70zmh.js} +1 -1
- package/dist/{index-12m2v2a9.js → index-s4evrmp5.js} +1 -1
- package/dist/{index-1khy8y7n.js → index-t1sr4aks.js} +3 -3
- package/dist/{index-45tdvqa3.js → index-wh0ecvyk.js} +1 -1
- package/dist/{index-n53mswt3.js → index-x928baz2.js} +8 -1
- package/dist/index-yk4g8805.js +133 -0
- package/dist/{index-ygkka6zn.js → index-ywppsaby.js} +28 -5
- package/dist/{index-9853ymwb.js → index-za6j7nwy.js} +18 -4
- package/dist/internal/bounded-file-read.d.ts +41 -0
- package/dist/internal/bounded-file-read.d.ts.map +1 -0
- package/dist/internal/exclusive-lock.d.ts +2 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/with-exclusive-lock.d.ts +4 -2
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
- package/dist/telegram/broadcast-delivery.d.ts +23 -0
- package/dist/telegram/broadcast-delivery.d.ts.map +1 -0
- package/dist/telegram/broadcast-failure.d.ts +22 -0
- package/dist/telegram/broadcast-failure.d.ts.map +1 -0
- package/dist/telegram/broadcast-state.d.ts +6 -3
- package/dist/telegram/broadcast-state.d.ts.map +1 -1
- package/dist/telegram/broadcast.d.ts +10 -5
- package/dist/telegram/broadcast.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -2
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/publication-assets.d.ts +10 -0
- package/dist/tools/cli/publication-assets.d.ts.map +1 -0
- package/dist/tools/cli/publication-contract.d.ts +75 -0
- package/dist/tools/cli/publication-contract.d.ts.map +1 -0
- package/dist/tools/cli/publication-control.d.ts +4 -0
- package/dist/tools/cli/publication-control.d.ts.map +1 -0
- package/dist/tools/cli/publication-storage.d.ts +32 -0
- package/dist/tools/cli/publication-storage.d.ts.map +1 -0
- package/dist/tools/cli/publication.d.ts +35 -0
- package/dist/tools/cli/publication.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts.map +1 -1
- package/dist/tools/connections/error-projection.d.ts +4 -0
- package/dist/tools/connections/error-projection.d.ts.map +1 -0
- package/dist/tools/connections/errors.d.ts +24 -8
- package/dist/tools/connections/errors.d.ts.map +1 -1
- package/dist/tools/connections/limits.d.ts +11 -31
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts +6 -4
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/operation-limits.d.ts +25 -0
- package/dist/tools/connections/operation-limits.d.ts.map +1 -0
- package/dist/tools/connections/sse-frames.d.ts +11 -2
- package/dist/tools/connections/sse-frames.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts +15 -2
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +19 -1
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/execute-result.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/observe-hook.d.ts +3 -0
- package/dist/tools/internal/observe-hook.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +2 -1
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +2 -2
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +4 -5
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +4 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool-execution.d.ts +65 -0
- package/dist/tools/runtime-tool-execution.d.ts.map +1 -0
- package/dist/tools/runtime-tool-mcp.d.ts +27 -0
- package/dist/tools/runtime-tool-mcp.d.ts.map +1 -0
- package/dist/tools/runtime-tool.d.ts +9 -60
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/surface.d.ts +12 -14
- package/dist/tools/surface.d.ts.map +1 -1
- package/llms/application.2.txt +221 -44
- package/llms/application.3.txt +3 -1
- package/llms/application.txt +1 -1
- package/llms/cli.2.txt +144 -1
- package/llms/cli.txt +123 -104
- package/llms/contract.txt +1 -1
- package/llms/files-packaging.txt +27 -0
- package/llms/process.txt +63 -1
- package/llms/server.4.txt +4 -1
- package/llms/server.5.txt +1 -0
- package/llms/stitchkit.2.txt +14 -0
- package/llms/stitchkit.txt +6 -4
- package/llms/telegram.txt +64 -2
- package/llms/tools-connections.txt +3 -0
- package/llms/tools-mcp.txt +29 -0
- package/llms/tools.2.txt +59 -0
- package/llms/tools.3.txt +1 -0
- package/llms/tools.txt +11 -52
- package/llms/upgrading-0.37.0-0.44.0.txt +444 -0
- package/llms/{upgrading-0.44.0-0.60.0.txt → upgrading-0.44.0-0.61.0.txt} +140 -271
- package/llms/{upgrading-0.61.0-0.74.0.txt → upgrading-0.62.0-0.80.0.txt} +217 -140
- package/llms/{upgrading-0.75.0-0.103.0.txt → upgrading-0.81.0-0.104.0.txt} +154 -217
- package/llms/upgrading.txt +4 -4
- package/llms-full.txt +745 -60
- package/llms.txt +14 -12
- package/native-assets.json +8 -0
- package/package.json +12 -3
- package/dist/index-wykebpn9.js +0 -221
- package/llms/upgrading-0.37.0.txt +0 -176
- package/dist/{index-69nvze1q.js → index-pptyv13k.js} +3 -3
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RequestCancellationError,
|
|
3
3
|
createRequestCancellation,
|
|
4
|
+
resolveClientFetch,
|
|
4
5
|
responseTraceId,
|
|
5
6
|
uploadProgressRoute,
|
|
6
7
|
withUploadProgress,
|
|
7
8
|
ApiError2,
|
|
8
9
|
refuseLocally,
|
|
9
10
|
parseApiErrorBody
|
|
10
|
-
} from "./index-
|
|
11
|
+
} from "./index-ywppsaby.js";
|
|
11
12
|
import {
|
|
12
13
|
parseTrailingWildcard
|
|
13
14
|
} from "./index-m38ej7e5.js";
|
|
14
15
|
import {
|
|
15
16
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
16
17
|
ContractStreamFrameSchema2
|
|
17
|
-
} from "./index-
|
|
18
|
+
} from "./index-h2fhjqy7.js";
|
|
18
19
|
import {
|
|
19
20
|
inputIsQuery
|
|
20
21
|
} from "./index-xhzq2qvj.js";
|
|
@@ -133,6 +134,11 @@ async function* parseSSE2(response, options) {
|
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
|
|
137
|
+
// src/browser/client-arguments.ts
|
|
138
|
+
function endpointHasArguments(endpoint) {
|
|
139
|
+
return Boolean(endpoint.params || endpoint.input || endpoint.multipart);
|
|
140
|
+
}
|
|
141
|
+
|
|
136
142
|
// src/browser/client-multipart.ts
|
|
137
143
|
function isFileDescriptor(value) {
|
|
138
144
|
return typeof value === "object" && value !== null && !(value instanceof Blob) && "uri" in value && typeof value.uri === "string" && "name" in value && typeof value.name === "string" && "type" in value && typeof value.type === "string";
|
|
@@ -367,7 +373,7 @@ async function* readContractStream(response, descriptor, abort) {
|
|
|
367
373
|
}
|
|
368
374
|
const frame = parsedFrame.data;
|
|
369
375
|
if (frame.type === "error") {
|
|
370
|
-
throw new ApiError2(frame.error.code, 0, frame.error.details, frame.error.message, frame.error.hint);
|
|
376
|
+
throw new ApiError2(frame.error.code, 0, frame.error.details, frame.error.message, frame.error.hint, undefined, undefined, frame.error.retryable);
|
|
371
377
|
}
|
|
372
378
|
if (frame.type === "end") {
|
|
373
379
|
if (!terminalSeen) {
|
|
@@ -503,7 +509,7 @@ function createHttpExecutor(endpoint, prefix, client, config) {
|
|
|
503
509
|
};
|
|
504
510
|
}
|
|
505
511
|
function createFetchExecutor(endpoint, prefix, config, contractConfig) {
|
|
506
|
-
const executeFetch = config.fetch
|
|
512
|
+
const executeFetch = resolveClientFetch(config.fetch);
|
|
507
513
|
return async (requestArgs, options) => {
|
|
508
514
|
const plan = planClientRequest(endpoint, prefix, requestArgs, contractConfig);
|
|
509
515
|
const url = joinClientBaseUrl(config.baseUrl, plan.relativeUrl);
|
|
@@ -587,7 +593,7 @@ async function throwForErrorResponse(res, config, fallbackBody) {
|
|
|
587
593
|
config.onError?.(res.status, body);
|
|
588
594
|
const parsed = parseApiErrorBody(body);
|
|
589
595
|
if (parsed) {
|
|
590
|
-
throw new ApiError2(parsed.code, res.status, parsed.details, parsed.message, parsed.hint, responseTraceId(res));
|
|
596
|
+
throw new ApiError2(parsed.code, res.status, parsed.details, parsed.message, parsed.hint, responseTraceId(res), undefined, parsed.retryable);
|
|
591
597
|
}
|
|
592
598
|
throw new ApiError2("HTTP_ERROR", res.status, { body }, undefined, undefined, responseTraceId(res));
|
|
593
599
|
}
|
|
@@ -691,9 +697,6 @@ function refuseExtraWithOptionsArguments(endpoint, received, expected) {
|
|
|
691
697
|
const shape = expected === 1 ? "withOptions(options)" : "withOptions(args, options)";
|
|
692
698
|
throw new TypeError(`${endpoint.method} ${endpoint.path}: this endpoint declares ${expected === 1 ? "no input" : "an input"}, so its method is ${shape} — it received ${received} arguments. ` + "An extra argument here is dropped, and a request options object in the dropped position " + "sends the request without them: an abort signal placed there never reaches the server.");
|
|
693
699
|
}
|
|
694
|
-
function endpointHasArguments(endpoint) {
|
|
695
|
-
return Boolean(endpoint.params || endpoint.input || endpoint.multipart);
|
|
696
|
-
}
|
|
697
700
|
function readClientRequestArgs(requestArgs) {
|
|
698
701
|
if (requestArgs !== undefined && !isRecord(requestArgs)) {
|
|
699
702
|
throw new TypeError("Endpoint arguments must be an object");
|
|
@@ -751,4 +754,4 @@ function createScopedUrlBuilders2(contracts, source, scopeConfigs) {
|
|
|
751
754
|
return buildScopedRegistry(contracts, scopeConfigs, "URL builder", (contract, config) => createUrlBuilder2(contract, source, config));
|
|
752
755
|
}
|
|
753
756
|
|
|
754
|
-
export { parseNDJSON2, parseSSE2, contractEndpointMatchers2, createClient2, createClients2, createScopedClients2, createUrlBuilder2, createUrlBuilders2, createScopedUrlBuilders2 };
|
|
757
|
+
export { endpointHasArguments, parseNDJSON2, parseSSE2, contractEndpointMatchers2, createClient2, createClients2, createScopedClients2, createUrlBuilder2, createUrlBuilders2, createScopedUrlBuilders2 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
forbidden2,
|
|
3
3
|
conflict2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-x928baz2.js";
|
|
5
5
|
import {
|
|
6
6
|
loadDarwinBinding
|
|
7
7
|
} from "./index-v5ee8ath.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
codingRefusal,
|
|
18
18
|
codingPathRefusal,
|
|
19
19
|
refuseMissingCodingPath
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-6d9xaxw1.js";
|
|
21
21
|
import {
|
|
22
22
|
NumericFileHandle,
|
|
23
23
|
descriptorPath,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./index-gxm9rc97.js";
|
|
35
35
|
import {
|
|
36
36
|
defineRuntimeTool2
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-cvda079a.js";
|
|
38
38
|
|
|
39
39
|
// src/agent-runtime/coding-tool-contract.ts
|
|
40
40
|
import { z } from "zod";
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
toolResultFromError,
|
|
7
7
|
toolCauseFromResult,
|
|
8
8
|
isToolExecutionControlError2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-2vnh05w4.js";
|
|
10
10
|
import {
|
|
11
11
|
createToolRunner,
|
|
12
12
|
formatToolError
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-2hyavjjj.js";
|
|
14
14
|
import {
|
|
15
15
|
collectToolSurface
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-a0zzh8ak.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./index-9jfdm5tg.js";
|
|
@@ -28,7 +28,8 @@ class AppError2 extends Error {
|
|
|
28
28
|
code: this.code,
|
|
29
29
|
message: this.message,
|
|
30
30
|
...this.details && { details: this.details },
|
|
31
|
-
...this.hint && { hint: this.hint }
|
|
31
|
+
...this.hint && { hint: this.hint },
|
|
32
|
+
...typeof this.retryable === "boolean" && { retryable: this.retryable }
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
}
|
|
@@ -59,6 +60,8 @@ var STITCH_ERROR_STATUS2 = {
|
|
|
59
60
|
METHOD_NOT_ALLOWED: 405,
|
|
60
61
|
CONFLICT: 409,
|
|
61
62
|
RATE_LIMITED: 429,
|
|
63
|
+
REQUEST_ABORTED: 499,
|
|
64
|
+
REQUEST_TIMEOUT: 408,
|
|
62
65
|
VALIDATION_ERROR: 400,
|
|
63
66
|
FILE_INVALID_PATH: 400,
|
|
64
67
|
FILE_OUTSIDE_ROOT: 400,
|
|
@@ -75,6 +78,10 @@ var STITCH_ERROR_STATUS2 = {
|
|
|
75
78
|
WAIT_FAILED: 409,
|
|
76
79
|
DOWNLOAD_NOT_FOUND: 404,
|
|
77
80
|
VIEW_HTTP_ERROR: 502,
|
|
81
|
+
CONNECTION_TIMEOUT: 504,
|
|
82
|
+
CONNECTION_RESPONSE_TOO_LARGE: 413,
|
|
83
|
+
CONNECTION_REQUEST_FAILED: 502,
|
|
84
|
+
UPSTREAM_TOOL_ERROR: 502,
|
|
78
85
|
OPERATION_NOT_SUCCEEDED: 409,
|
|
79
86
|
STREAM_ITEM_INVALID: 500,
|
|
80
87
|
STREAM_FRAME_TOO_LARGE: 500,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// src/server/middleware/cors.ts
|
|
2
|
+
var DEFAULT_CORS_ALLOW_HEADERS2 = "Content-Type, Authorization, X-Trace-Id, traceparent, tracestate";
|
|
3
|
+
var DEFAULT_CORS_EXPOSE_HEADERS2 = "Content-Disposition, Content-Length, Content-Range, Accept-Ranges, ETag, Last-Modified, X-Request-Id, X-Build-Id";
|
|
4
|
+
function assertCorsConfig(config) {
|
|
5
|
+
if (config.credentials && (config.origin === undefined || config.origin === "*")) {
|
|
6
|
+
throw new Error("[stitchkit] cors: `credentials: true` cannot be combined with a wildcard origin. " + "Set `origin` to an explicit string or list.");
|
|
7
|
+
}
|
|
8
|
+
if (config.origin === undefined) {
|
|
9
|
+
throw new Error("[stitchkit] cors: `origin` is required. Pass an explicit origin (or list), or '*' to deliberately allow every origin — omit `cors` entirely to emit no CORS headers.");
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(config.origin) && config.origin.length === 0) {
|
|
12
|
+
throw new Error("[stitchkit] cors: `origin` cannot be an empty list. Pass explicit origins, or '*' to deliberately allow every origin.");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function resolveOrigin(config, requestOrigin) {
|
|
16
|
+
if (config.origin === undefined)
|
|
17
|
+
return;
|
|
18
|
+
if (config.origin === "*") {
|
|
19
|
+
return "*";
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(config.origin)) {
|
|
22
|
+
if (!requestOrigin)
|
|
23
|
+
return;
|
|
24
|
+
const lower = requestOrigin.toLowerCase();
|
|
25
|
+
return config.origin.some((o) => o.toLowerCase() === lower) ? requestOrigin : undefined;
|
|
26
|
+
}
|
|
27
|
+
return config.origin;
|
|
28
|
+
}
|
|
29
|
+
function isOriginAllowed(config, requestOrigin) {
|
|
30
|
+
if (!config || config.origin === undefined || config.origin === "*")
|
|
31
|
+
return false;
|
|
32
|
+
if (!requestOrigin || requestOrigin === "null")
|
|
33
|
+
return false;
|
|
34
|
+
const lower = requestOrigin.toLowerCase();
|
|
35
|
+
const allowed = Array.isArray(config.origin) ? config.origin : [config.origin];
|
|
36
|
+
return allowed.some((origin) => origin.toLowerCase() === lower);
|
|
37
|
+
}
|
|
38
|
+
function corsHeaders2(config, requestOrigin) {
|
|
39
|
+
const allowOrigin = resolveOrigin(config, requestOrigin);
|
|
40
|
+
const headers = {
|
|
41
|
+
"Access-Control-Allow-Methods": config.methods ?? "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS",
|
|
42
|
+
"Access-Control-Allow-Headers": config.headers ?? DEFAULT_CORS_ALLOW_HEADERS2
|
|
43
|
+
};
|
|
44
|
+
const expose = Array.isArray(config.exposeHeaders) ? config.exposeHeaders.join(", ") : config.exposeHeaders ?? DEFAULT_CORS_EXPOSE_HEADERS2;
|
|
45
|
+
if (expose !== "") {
|
|
46
|
+
headers["Access-Control-Expose-Headers"] = expose;
|
|
47
|
+
}
|
|
48
|
+
if (allowOrigin !== undefined) {
|
|
49
|
+
headers["Access-Control-Allow-Origin"] = allowOrigin;
|
|
50
|
+
if (config.credentials) {
|
|
51
|
+
headers["Access-Control-Allow-Credentials"] = "true";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(config.origin)) {
|
|
55
|
+
headers.Vary = "Origin";
|
|
56
|
+
}
|
|
57
|
+
return headers;
|
|
58
|
+
}
|
|
59
|
+
function corsPreflightResponse2(config, req) {
|
|
60
|
+
return new Response(null, {
|
|
61
|
+
status: 204,
|
|
62
|
+
headers: corsHeaders2(config, req.headers.get("origin"))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function requestCorsHeaders(cors, req) {
|
|
66
|
+
if (!cors)
|
|
67
|
+
return {};
|
|
68
|
+
return corsHeaders2(cors, req.headers.get("origin"));
|
|
69
|
+
}
|
|
70
|
+
function applyCors(res, cors, req) {
|
|
71
|
+
const extra = requestCorsHeaders(cors, req);
|
|
72
|
+
if (Object.keys(extra).length === 0)
|
|
73
|
+
return res;
|
|
74
|
+
try {
|
|
75
|
+
for (const [key, value] of Object.entries(extra))
|
|
76
|
+
setCorsHeader(res.headers, key, value);
|
|
77
|
+
return res;
|
|
78
|
+
} catch {
|
|
79
|
+
const headers = new Headers(res.headers);
|
|
80
|
+
for (const [key, value] of Object.entries(extra))
|
|
81
|
+
setCorsHeader(headers, key, value);
|
|
82
|
+
return new Response(res.body, {
|
|
83
|
+
status: res.status,
|
|
84
|
+
statusText: res.statusText,
|
|
85
|
+
headers
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function setCorsHeader(headers, key, value) {
|
|
90
|
+
if (key !== "Vary") {
|
|
91
|
+
headers.set(key, value);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const existing = headers.get("Vary");
|
|
95
|
+
if (existing === null || existing.trim() === "") {
|
|
96
|
+
headers.set("Vary", value);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const present = existing.split(",").some((field) => field.trim().toLowerCase() === "origin");
|
|
100
|
+
if (!present)
|
|
101
|
+
headers.set("Vary", `${existing}, ${value}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/server/process-signal-common.ts
|
|
105
|
+
var DEFAULT_PROCESS_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
106
|
+
var defaultSignalSource = {
|
|
107
|
+
on: (signal, handler) => {
|
|
108
|
+
process.on(signal, handler);
|
|
109
|
+
},
|
|
110
|
+
off: (signal, handler) => {
|
|
111
|
+
process.off(signal, handler);
|
|
112
|
+
},
|
|
113
|
+
raiseDefault: (signal) => {
|
|
114
|
+
if (process.listenerCount(signal) > 0)
|
|
115
|
+
return false;
|
|
116
|
+
process.kill(process.pid, signal);
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
function reportSignalError(phase, error, onError) {
|
|
121
|
+
try {
|
|
122
|
+
onError?.(phase, error);
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
function guardSignalCallback(run, phase, onError) {
|
|
126
|
+
try {
|
|
127
|
+
run();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
reportSignalError(phase, error, onError);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { DEFAULT_CORS_ALLOW_HEADERS2, DEFAULT_CORS_EXPOSE_HEADERS2, assertCorsConfig, isOriginAllowed, corsHeaders2, corsPreflightResponse2, requestCorsHeaders, applyCors, DEFAULT_PROCESS_SIGNALS, defaultSignalSource, reportSignalError, guardSignalCallback };
|
|
@@ -138,6 +138,26 @@ async function readResponse(pending, responseType) {
|
|
|
138
138
|
return await response.json();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// src/browser/native-fetch.ts
|
|
142
|
+
var NATIVE_FETCH_SOURCE = /^function fetch\(\)\s*\{\s*\[native code\]\s*\}$/;
|
|
143
|
+
function isNativeBunFetch(candidate) {
|
|
144
|
+
const bun = Reflect.get(globalThis, "Bun");
|
|
145
|
+
return typeof bun === "object" && bun !== null && NATIVE_FETCH_SOURCE.test(Function.prototype.toString.call(candidate));
|
|
146
|
+
}
|
|
147
|
+
function resolveClientFetch(explicitFetch) {
|
|
148
|
+
if (explicitFetch !== undefined)
|
|
149
|
+
return explicitFetch;
|
|
150
|
+
const defaultFetch = globalThis.fetch;
|
|
151
|
+
const nativeBun = isNativeBunFetch(defaultFetch);
|
|
152
|
+
const transport = defaultFetch.bind(globalThis);
|
|
153
|
+
if (!nativeBun)
|
|
154
|
+
return transport;
|
|
155
|
+
return (input, init) => {
|
|
156
|
+
const nativeInit = { ...init, timeout: 0 };
|
|
157
|
+
return transport(input, nativeInit);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
141
161
|
// src/browser/request-id.ts
|
|
142
162
|
var REQUEST_ID_HEADER = "x-request-id";
|
|
143
163
|
function responseTraceId(response) {
|
|
@@ -357,13 +377,15 @@ class ApiError2 extends Error {
|
|
|
357
377
|
details;
|
|
358
378
|
hint;
|
|
359
379
|
traceId;
|
|
360
|
-
|
|
380
|
+
retryable;
|
|
381
|
+
constructor(code, status = 0, details, message, hint, traceId, options, retryable) {
|
|
361
382
|
super(messageForCode(code, message), options);
|
|
362
383
|
this.code = code;
|
|
363
384
|
this.status = status;
|
|
364
385
|
this.details = details;
|
|
365
386
|
this.hint = hint;
|
|
366
387
|
this.traceId = traceId;
|
|
388
|
+
this.retryable = retryable;
|
|
367
389
|
this.name = "ApiError";
|
|
368
390
|
Object.defineProperty(this, API_ERROR_BRAND, { value: true });
|
|
369
391
|
}
|
|
@@ -398,7 +420,8 @@ function parseApiErrorBody(body) {
|
|
|
398
420
|
code: error.code,
|
|
399
421
|
message: typeof error.message === "string" ? error.message : undefined,
|
|
400
422
|
details: error.details,
|
|
401
|
-
hint: typeof error.hint === "string" ? error.hint : undefined
|
|
423
|
+
hint: typeof error.hint === "string" ? error.hint : undefined,
|
|
424
|
+
retryable: typeof error.retryable === "boolean" ? error.retryable : undefined
|
|
402
425
|
};
|
|
403
426
|
}
|
|
404
427
|
function assertTransportChoice(config) {
|
|
@@ -503,14 +526,14 @@ function createHttpClient2(config) {
|
|
|
503
526
|
const parsed = body === null ? null : parseError(body);
|
|
504
527
|
if (!parsed)
|
|
505
528
|
return error;
|
|
506
|
-
return new ApiError2(parsed.code, error.response.status, parsed.details, parsed.message, parsed.hint, responseTraceId(error.response));
|
|
529
|
+
return new ApiError2(parsed.code, error.response.status, parsed.details, parsed.message, parsed.hint, responseTraceId(error.response), undefined, typeof parsed.retryable === "boolean" ? parsed.retryable : undefined);
|
|
507
530
|
}
|
|
508
531
|
]
|
|
509
532
|
}
|
|
510
533
|
});
|
|
511
534
|
async function request(method, url, data, options = {}) {
|
|
512
535
|
const cancellation = createRequestCancellation(options.signal, options.timeout ?? config.timeout ?? 30000);
|
|
513
|
-
const transport = config.fetch
|
|
536
|
+
const transport = resolveClientFetch(config.fetch);
|
|
514
537
|
const kyOptions = {
|
|
515
538
|
fetch: createRetryAwareFetch(options.onUploadProgress ? withUploadProgress(transport, options.onUploadProgress, {
|
|
516
539
|
route: uploadProgressRoute(config.fetch !== undefined || config.unix !== undefined),
|
|
@@ -558,4 +581,4 @@ function createHttpClient2(config) {
|
|
|
558
581
|
};
|
|
559
582
|
}
|
|
560
583
|
|
|
561
|
-
export { RequestCancellationError, createRequestCancellation, responseTraceId, uploadProgressRoute, withUploadProgress, ApiError2, refuseLocally, isAbortLikeError, parseApiErrorBody, createHttpClient2 };
|
|
584
|
+
export { RequestCancellationError, createRequestCancellation, resolveClientFetch, responseTraceId, uploadProgressRoute, withUploadProgress, ApiError2, refuseLocally, isAbortLikeError, parseApiErrorBody, createHttpClient2 };
|
|
@@ -81,10 +81,13 @@ function readOwner(text) {
|
|
|
81
81
|
try {
|
|
82
82
|
parsed = JSON.parse(text);
|
|
83
83
|
} catch {
|
|
84
|
-
return;
|
|
84
|
+
return { owner: undefined, ownerless: true };
|
|
85
85
|
}
|
|
86
86
|
const owner = ExclusiveLockOwnerSchema.safeParse(parsed);
|
|
87
|
-
|
|
87
|
+
if (owner.success)
|
|
88
|
+
return { owner: owner.data, ownerless: false };
|
|
89
|
+
const ownerlike = isRecord(parsed) && ["pid", "token", "host", "machine", "process", "acquiredAt"].some((key) => Object.hasOwn(parsed, key));
|
|
90
|
+
return { owner: undefined, ownerless: !ownerlike };
|
|
88
91
|
}
|
|
89
92
|
function attribute(owner, identity) {
|
|
90
93
|
if (identity !== null && owner.machine !== undefined) {
|
|
@@ -105,7 +108,7 @@ async function readLockFile(path, onFailure, signal) {
|
|
|
105
108
|
try {
|
|
106
109
|
const record = await readLockRecord(path, undefined, signal);
|
|
107
110
|
return {
|
|
108
|
-
|
|
111
|
+
...readOwner(record.text),
|
|
109
112
|
ino: record.info.ino,
|
|
110
113
|
dev: record.info.dev,
|
|
111
114
|
mtimeMs: record.info.mtimeMs
|
|
@@ -159,11 +162,22 @@ async function createOwned(path, options, reclaimed) {
|
|
|
159
162
|
}
|
|
160
163
|
const ownedInode = ino;
|
|
161
164
|
const ownedDevice = dev;
|
|
165
|
+
const ownedRecord = `${JSON.stringify(owner)}
|
|
166
|
+
`;
|
|
162
167
|
let released = false;
|
|
163
168
|
return {
|
|
164
169
|
path,
|
|
165
170
|
owner,
|
|
166
171
|
reclaimed,
|
|
172
|
+
async assertHeld() {
|
|
173
|
+
if (released)
|
|
174
|
+
throw new LockRecordError("LOCK_RECORD_CHANGED", "Lock is released");
|
|
175
|
+
const record = await readLockRecord(path);
|
|
176
|
+
const descriptor = await handle.stat();
|
|
177
|
+
if (released || !descriptor.isFile() || descriptor.nlink !== 1 || descriptor.ino !== ownedInode || descriptor.dev !== ownedDevice || record.info.ino !== ownedInode || record.info.dev !== ownedDevice || record.text !== ownedRecord) {
|
|
178
|
+
throw new LockRecordError("LOCK_RECORD_CHANGED", "Held lock generation changed");
|
|
179
|
+
}
|
|
180
|
+
},
|
|
167
181
|
async release() {
|
|
168
182
|
if (released)
|
|
169
183
|
return;
|
|
@@ -179,7 +193,7 @@ async function createOwned(path, options, reclaimed) {
|
|
|
179
193
|
function reclaimable(state, diagnosis, graceMs) {
|
|
180
194
|
if (state.owner)
|
|
181
195
|
return diagnosis.liveness === "gone";
|
|
182
|
-
return typeof graceMs === "number" && Date.now() - state.mtimeMs >= graceMs;
|
|
196
|
+
return state.ownerless && typeof graceMs === "number" && Date.now() - state.mtimeMs >= graceMs;
|
|
183
197
|
}
|
|
184
198
|
async function reclaimUnderGuard(path, options, depth) {
|
|
185
199
|
const guardPath = `${path}.reclaim`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface FileObservation {
|
|
2
|
+
dev: number;
|
|
3
|
+
ino: number;
|
|
4
|
+
size: number;
|
|
5
|
+
nlink: number;
|
|
6
|
+
mtimeMs: number;
|
|
7
|
+
ctimeMs: number;
|
|
8
|
+
}
|
|
9
|
+
interface FileReadStat extends FileObservation {
|
|
10
|
+
isFile(): boolean;
|
|
11
|
+
}
|
|
12
|
+
interface FileReadDescriptor {
|
|
13
|
+
stat(): Promise<FileReadStat>;
|
|
14
|
+
read(buffer: Uint8Array, offset: number, length: number): Promise<{
|
|
15
|
+
bytesRead: number;
|
|
16
|
+
}>;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class BoundedFileReadError extends Error {
|
|
20
|
+
readonly code: 'FILE_UNSUPPORTED' | 'FILE_NOT_REGULAR' | 'FILE_UNSAFE_LINK' | 'FILE_TOO_LARGE' | 'FILE_CHANGED';
|
|
21
|
+
readonly observation?: FileObservation | undefined;
|
|
22
|
+
constructor(code: 'FILE_UNSUPPORTED' | 'FILE_NOT_REGULAR' | 'FILE_UNSAFE_LINK' | 'FILE_TOO_LARGE' | 'FILE_CHANGED', message: string, observation?: FileObservation | undefined);
|
|
23
|
+
}
|
|
24
|
+
export interface BoundedFileReadOptions {
|
|
25
|
+
rejectSymlinks?: boolean;
|
|
26
|
+
singleLink?: boolean;
|
|
27
|
+
stable?: boolean;
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
/** The descriptor decides kind/link/stability; bytes are capped before allocation grows. */
|
|
31
|
+
export declare function readBoundedFile(target: string, maxBytes: number, options?: BoundedFileReadOptions, openDescriptor?: (path: string, flags: number) => Promise<FileReadDescriptor>): Promise<{
|
|
32
|
+
bytes: Uint8Array;
|
|
33
|
+
observation: FileObservation;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function readHandle(handle: {
|
|
36
|
+
read(buffer: Uint8Array, offset: number, length: number): Promise<{
|
|
37
|
+
bytesRead: number;
|
|
38
|
+
}>;
|
|
39
|
+
}, maxBytes: number, signal?: AbortSignal): Promise<Uint8Array>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=bounded-file-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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OAAO,GAAE,sBAA2B,EACpC,cAAc,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAQ,GAClF,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,eAAe,CAAA;CAAE,CAAC,CA+D9D;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE;IACN,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1F,EACD,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAwCrB"}
|
|
@@ -31,6 +31,8 @@ export interface HeldExclusiveLock {
|
|
|
31
31
|
readonly owner: ExclusiveLockOwner;
|
|
32
32
|
/** The lock was taken from an owner that was provably gone, or never recorded. */
|
|
33
33
|
readonly reclaimed: boolean;
|
|
34
|
+
/** Refuse a released, replaced or changed descriptor/path generation. */
|
|
35
|
+
assertHeld(): Promise<void>;
|
|
34
36
|
/** Close the descriptor and remove the file — only if it is still this lock's file. */
|
|
35
37
|
release(): Promise<void>;
|
|
36
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/exclusive-lock.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,oBAAoB,CAAC;AAG5B,gDAAgD;AAChD,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;iBAO5B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,wCAAwC;AACxC,MAAM,WAAW,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,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACpC;IACE,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;CAC7C,CAAC;AAiQN;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,2BAA2B,EACpC,KAAK,SAAI,GACR,OAAO,CAAC,oBAAoB,CAAC,CAgC/B;AAED,gFAAgF;AAChF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAEpC"}
|
|
@@ -40,15 +40,17 @@ export interface ExclusiveLock {
|
|
|
40
40
|
readonly owner: ExclusiveLockOwner;
|
|
41
41
|
/** Taken from an owner that was provably gone, or that never recorded itself. */
|
|
42
42
|
readonly reclaimed: boolean;
|
|
43
|
+
/** Refuse after release or if the descriptor, path or owner record changed. */
|
|
44
|
+
assertHeld(): Promise<void>;
|
|
43
45
|
}
|
|
44
46
|
/** A lock that was not taken: the wait ran out, or was cancelled. */
|
|
45
47
|
export declare class ExclusiveLockError extends Error {
|
|
46
|
-
readonly code: 'LOCK_TIMEOUT' | 'LOCK_ABORTED';
|
|
48
|
+
readonly code: 'LOCK_TIMEOUT' | 'LOCK_ABORTED' | 'LOCK_LOST';
|
|
47
49
|
readonly label: string;
|
|
48
50
|
/** Who held it at the last attempt; `null` when the lock recorded no readable owner. */
|
|
49
51
|
readonly holder: ExclusiveLockOwner | null;
|
|
50
52
|
name: string;
|
|
51
|
-
constructor(code: 'LOCK_TIMEOUT' | 'LOCK_ABORTED', label: string,
|
|
53
|
+
constructor(code: 'LOCK_TIMEOUT' | 'LOCK_ABORTED' | 'LOCK_LOST', label: string,
|
|
52
54
|
/** Who held it at the last attempt; `null` when the lock recorded no readable owner. */
|
|
53
55
|
holder: ExclusiveLockOwner | null, message: string, options?: {
|
|
54
56
|
cause?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/with-exclusive-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gIAAgI;IAChI,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,qEAAqE;AACrE,qBAAa,kBAAmB,SAAQ,KAAK;IAGzC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc;
|
|
1
|
+
{"version":3,"file":"with-exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/with-exclusive-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,kBAAkB,EAAE,MAAM,k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K,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5C,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,CAAC,CAAC,CAwFZ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TelegramBroadcastConfig } from './broadcast.js';
|
|
2
|
+
import { type TelegramBroadcastFailure } from './broadcast-failure.js';
|
|
3
|
+
import type { TelegramBroadcastOutcome, TelegramBroadcastRecipient } from './broadcast-state.js';
|
|
4
|
+
export type RecipientOutcome = {
|
|
5
|
+
kind: 'settled';
|
|
6
|
+
outcome: TelegramBroadcastOutcome;
|
|
7
|
+
reason?: string;
|
|
8
|
+
halt?: TelegramBroadcastFailure;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'halted';
|
|
11
|
+
failure: TelegramBroadcastFailure;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'stopped';
|
|
14
|
+
};
|
|
15
|
+
export declare function broadcastLimits(config: TelegramBroadcastConfig): {
|
|
16
|
+
intervalMs: number;
|
|
17
|
+
maxAttempts: number;
|
|
18
|
+
maxRetryDelayMs: number;
|
|
19
|
+
progressEveryMs: number;
|
|
20
|
+
};
|
|
21
|
+
/** One recipient under the existing runner's pacing, journal and provider-injected policy. */
|
|
22
|
+
export declare function broadcastDelivery(config: TelegramBroadcastConfig, limits: ReturnType<typeof broadcastLimits>, assertHeld: () => Promise<void>): (recipient: TelegramBroadcastRecipient) => Promise<RecipientOutcome>;
|
|
23
|
+
//# sourceMappingURL=broadcast-delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast-delivery.d.ts","sourceRoot":"","sources":["../../src/telegram/broadcast-delivery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE9F,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACjC,GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,wBAAwB,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAexB,wBAAgB,eAAe,CAAC,MAAM,EAAE,uBAAuB;IAO3D,UAAU;IACV,WAAW;IAKX,eAAe;IAKf,eAAe;EAMlB;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EAC1C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,eAoBN,0BAA0B,KAAG,OAAO,CAAC,gBAAgB,CAAC,CA2ChF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Retry variants certify that the failed attempt did not apply the external effect. */
|
|
3
|
+
export declare const TelegramBroadcastFailureSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"retry-after">;
|
|
5
|
+
retryAfterMs: z.ZodInt;
|
|
6
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"transient">;
|
|
9
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
11
|
+
kind: z.ZodLiteral<"permanent">;
|
|
12
|
+
recipientUnreachable: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
stopBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"ambiguous">;
|
|
17
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>], "kind">;
|
|
19
|
+
export type TelegramBroadcastFailure = z.infer<typeof TelegramBroadcastFailureSchema>;
|
|
20
|
+
/** Bot refusals retain their known policy; an unknown send outcome never certifies a retry. */
|
|
21
|
+
export declare function classifyBotBroadcastFailure(error: unknown): TelegramBroadcastFailure;
|
|
22
|
+
//# sourceMappingURL=broadcast-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast-failure.d.ts","sourceRoot":"","sources":["../../src/telegram/broadcast-failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,wFAAwF;AACxF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;4BAkBzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,+FAA+F;AAC/F,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAgBpF"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* of a broadcast is the failure a subscriber notices.
|
|
15
15
|
*/
|
|
16
16
|
import { z } from 'zod';
|
|
17
|
+
import { type HeldExclusiveLock } from '../internal/exclusive-lock.js';
|
|
17
18
|
export declare const TelegramBroadcastOutcomeSchema: z.ZodEnum<{
|
|
18
19
|
delivered: "delivered";
|
|
19
20
|
failed: "failed";
|
|
@@ -50,18 +51,20 @@ export interface BroadcastFiles {
|
|
|
50
51
|
}
|
|
51
52
|
export declare function broadcastFiles(directory: string, name: string): BroadcastFiles;
|
|
52
53
|
export declare function readRecipients(files: BroadcastFiles): Promise<TelegramBroadcastRecipient[] | null>;
|
|
53
|
-
export declare function writeRecipients(files: BroadcastFiles, recipients: readonly TelegramBroadcastRecipient[]): Promise<void>;
|
|
54
|
+
export declare function writeRecipients(files: BroadcastFiles, recipients: readonly TelegramBroadcastRecipient[], lock: HeldExclusiveLock): Promise<void>;
|
|
55
|
+
/** Persist the journal directory entry before its first sending intent can be acknowledged. */
|
|
56
|
+
export declare function prepareJournal(files: BroadcastFiles, lock: HeldExclusiveLock): Promise<void>;
|
|
54
57
|
/**
|
|
55
58
|
* Replay the journal. A torn last line — the process died mid-append — is
|
|
56
59
|
* skipped; every complete line before it stands.
|
|
57
60
|
*/
|
|
58
61
|
export declare function readProgress(files: BroadcastFiles): Promise<BroadcastProgress>;
|
|
59
|
-
export declare function appendJournal(files: BroadcastFiles, line: JournalLine): Promise<void>;
|
|
62
|
+
export declare function appendJournal(files: BroadcastFiles, line: JournalLine, lock: HeldExclusiveLock): Promise<void>;
|
|
60
63
|
/**
|
|
61
64
|
* One runner per broadcast name. Two would each read the same pending
|
|
62
65
|
* recipients and send them twice. A lock left by a process that is gone is
|
|
63
66
|
* taken over.
|
|
64
67
|
*/
|
|
65
|
-
export declare function lockBroadcast(directory: string, files: BroadcastFiles): Promise<
|
|
68
|
+
export declare function lockBroadcast(directory: string, files: BroadcastFiles): Promise<HeldExclusiveLock>;
|
|
66
69
|
export {};
|
|
67
70
|
//# sourceMappingURL=broadcast-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast-state.d.ts","sourceRoot":"","sources":["../../src/telegram/broadcast-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8BAA8B;;;;;EAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,QAAA,MAAM,YAAY,iDAAyD,CAAC;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAA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