stitchkit 0.118.1 → 0.119.0
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 +66 -0
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +6 -3
- package/dist/contract/client-types.d.ts.map +1 -1
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +18 -12
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/endpoint-capabilities.d.ts +28 -0
- package/dist/contract/endpoint-capabilities.d.ts.map +1 -0
- package/dist/contract/factory.d.ts +49 -19
- package/dist/contract/factory.d.ts.map +1 -1
- package/dist/contract/tool-view.d.ts +1 -1
- package/dist/contract/tool-view.d.ts.map +1 -1
- package/dist/contract/transports.d.ts +5 -0
- package/dist/contract/transports.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +6 -5
- package/dist/entrypoints/agent-runtime/harness.js +6 -5
- package/dist/entrypoints/agent-runtime/sandbox.js +6 -5
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +9 -8
- package/dist/entrypoints/agent-runtime/sqlite/node.js +9 -8
- package/dist/entrypoints/agent-runtime/testing.js +9 -8
- package/dist/entrypoints/agent-runtime.js +14 -13
- package/dist/entrypoints/application/diagnostic-journal.js +3 -3
- package/dist/entrypoints/application/directory-inbox.js +4 -4
- package/dist/entrypoints/application/opentelemetry.js +1 -1
- package/dist/entrypoints/application.js +5 -5
- package/dist/entrypoints/cli/publish.js +4 -4
- package/dist/entrypoints/cli.js +8 -7
- package/dist/entrypoints/contract.d.ts +1 -1
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +6 -4
- package/dist/entrypoints/files.js +3 -3
- package/dist/entrypoints/geo/contract.d.ts +7 -0
- package/dist/entrypoints/geo/contract.d.ts.map +1 -0
- package/dist/entrypoints/geo/contract.js +6 -0
- package/dist/entrypoints/geo.js +60 -23
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +8 -6
- package/dist/entrypoints/live.js +1 -1
- package/dist/entrypoints/node.js +7 -6
- package/dist/entrypoints/primitives.js +1 -1
- package/dist/entrypoints/process/owner-loss.js +1 -1
- package/dist/entrypoints/process.js +3 -3
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +4 -3
- package/dist/entrypoints/server.js +11 -10
- package/dist/entrypoints/telegram.js +2 -2
- package/dist/entrypoints/testing.js +7 -6
- package/dist/entrypoints/tools/connections.js +3 -2
- package/dist/entrypoints/tools/contract.js +1 -1
- package/dist/entrypoints/tools/invoker.js +5 -4
- package/dist/entrypoints/tools/mcp.js +7 -6
- package/dist/entrypoints/tools.js +17 -15
- package/dist/entrypoints/tracking/contract.js +5 -3
- package/dist/entrypoints/tracking/performance.js +3 -3
- package/dist/entrypoints/tracking.d.ts +1 -1
- package/dist/entrypoints/tracking.d.ts.map +1 -1
- package/dist/entrypoints/tracking.js +63 -83
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/geo/index.d.ts +2 -1
- package/dist/geo/index.d.ts.map +1 -1
- package/dist/geo/record.d.ts +8 -0
- package/dist/geo/record.d.ts.map +1 -0
- package/dist/geo/resolver.d.ts +1 -3
- package/dist/geo/resolver.d.ts.map +1 -1
- package/dist/geo/schema.d.ts +44 -0
- package/dist/geo/schema.d.ts.map +1 -0
- package/dist/geo/types.d.ts +2 -13
- package/dist/geo/types.d.ts.map +1 -1
- package/dist/{index-n5sv4z0w.js → index-1k18qzqa.js} +13 -15
- package/dist/{index-tsngj2b5.js → index-2dfvv1jg.js} +206 -206
- package/dist/{index-d9hq291n.js → index-4jpykzvw.js} +70 -81
- package/dist/{index-ghtpfz4z.js → index-57gqaq8b.js} +2 -2
- package/dist/index-69t14s4a.js +39 -0
- package/dist/{index-6p3frkv5.js → index-6a69xzrx.js} +4 -4
- package/dist/{index-dky0dcmf.js → index-72r9k0av.js} +6 -2
- package/dist/{index-vv1sch8a.js → index-8vzh5wpv.js} +13 -8
- package/dist/{index-xx1j310k.js → index-8yxgcyt6.js} +171 -169
- package/dist/{index-p6apg0jg.js → index-9frf01t9.js} +16 -9
- package/dist/{index-q0th8q0z.js → index-9mjrnqxs.js} +1 -3
- package/dist/{index-ega3yz4c.js → index-aqwg2dm5.js} +1 -1
- package/dist/{index-073nw9qr.js → index-ba7are04.js} +524 -522
- package/dist/{index-095ya5hm.js → index-bbvc59gw.js} +13 -11
- package/dist/{index-txg1npmg.js → index-cyxp8rbf.js} +1 -1
- package/dist/index-d3xdyjt6.js +38 -0
- package/dist/{index-n8z3rvzw.js → index-f4njz9j0.js} +3 -5
- package/dist/{index-90p34rts.js → index-fcqj44mb.js} +3 -1
- package/dist/{index-86nbfysb.js → index-ff39f9dr.js} +3 -3
- package/dist/{index-75ns2ybj.js → index-fqd4yqwd.js} +1 -1
- package/dist/{index-nqxrm176.js → index-g444vfz2.js} +1 -1
- package/dist/{index-vwhrnp67.js → index-kz9734jc.js} +3 -3
- package/dist/{index-dr3t5n1v.js → index-nn9qvkww.js} +46 -46
- package/dist/{index-qezhmp51.js → index-nz06qw5a.js} +3 -1
- package/dist/{index-1bx1xv1k.js → index-pfvde2fz.js} +5 -2
- package/dist/{index-s80awwsw.js → index-qch1vcaa.js} +3 -1
- package/dist/{index-cycp3r3e.js → index-rxcgp4b9.js} +2 -2
- package/dist/{index-w7jq3fz9.js → index-s0qjs6ee.js} +1198 -1196
- package/dist/{index-p0rf7sq9.js → index-s20s2mad.js} +209 -209
- package/dist/{index-v6vb5qx8.js → index-s3yxw6kt.js} +1 -1
- package/dist/{index-cqmqyjax.js → index-sa99p98w.js} +1 -1
- package/dist/{index-0gxvns6s.js → index-sba3e6m4.js} +1 -0
- package/dist/{index-f24bdt13.js → index-v1swr26p.js} +3 -1
- package/dist/{index-rhzkndr5.js → index-x4p3kw1p.js} +533 -530
- package/dist/{index-hdjmdwsj.js → index-x8d9fdeg.js} +513 -507
- package/dist/{index-htxh46ej.js → index-ycqhyars.js} +2 -2
- package/dist/{index-9bwcthxw.js → index-yj6saztf.js} +31 -13
- package/dist/{index-tdpmfks8.js → index-ynrf908v.js} +1 -1
- package/dist/{index-f6m4c545.js → index-zrdcmg6j.js} +4 -6
- package/dist/process/bun-child.d.ts +3 -2
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-canonical-types.d.ts +1 -1
- package/dist/tracking/attribution.d.ts +21 -25
- package/dist/tracking/attribution.d.ts.map +1 -1
- package/dist/tracking/client-visit.d.ts +5 -7
- package/dist/tracking/client-visit.d.ts.map +1 -1
- package/dist/tracking/client.d.ts +2 -2
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/contract.d.ts +1 -1
- package/dist/tracking/host.d.ts +0 -1
- package/dist/tracking/host.d.ts.map +1 -1
- package/dist/tracking/privacy.d.ts +6 -0
- package/dist/tracking/privacy.d.ts.map +1 -1
- package/dist/tracking/schemas.d.ts +2 -2
- package/dist/tracking/schemas.d.ts.map +1 -1
- package/llms/contract.txt +46 -24
- package/llms/geo-contract.txt +23 -0
- package/llms/geo.txt +40 -4
- package/llms/stitchkit.txt +4 -3
- package/llms/tools.2.txt +2 -2
- package/llms/tools.3.txt +1 -1
- package/llms/tracking-contract.txt +1 -1
- package/llms/tracking.txt +27 -5
- package/llms/{upgrading-0.105.0-0.118.0.txt → upgrading-0.106.0-0.119.0.txt} +121 -410
- package/llms/upgrading-0.37.0-0.53.0.txt +969 -0
- package/llms/{upgrading-0.44.0-0.62.0.txt → upgrading-0.55.0-0.68.0.txt} +509 -528
- package/llms/{upgrading-0.63.0-0.83.0.txt → upgrading-0.69.0-0.95.0.txt} +506 -509
- package/llms/{upgrading-0.84.0-0.104.0.txt → upgrading-0.96.0-0.105.0.txt} +410 -506
- package/llms/upgrading.txt +5 -5
- package/llms-full.txt +247 -38
- package/llms.txt +10 -9
- package/package.json +23 -19
- package/llms/upgrading-0.37.0-0.44.0.txt +0 -444
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import"../index-m38ej7e5.js";
|
|
2
2
|
import"../index-h2fhjqy7.js";
|
|
3
|
-
import"../index-
|
|
3
|
+
import"../index-9frf01t9.js";
|
|
4
|
+
import"../index-69t14s4a.js";
|
|
4
5
|
import {
|
|
5
6
|
endpointHasArguments,
|
|
6
7
|
createClient2
|
|
7
|
-
} from "../index-
|
|
8
|
+
} from "../index-2dfvv1jg.js";
|
|
8
9
|
import {
|
|
9
10
|
ApiError2
|
|
10
11
|
} from "../index-kfjkb396.js";
|
|
11
12
|
import {
|
|
12
13
|
contractMethodFields
|
|
13
|
-
} from "../index-
|
|
14
|
+
} from "../index-pfvde2fz.js";
|
|
14
15
|
import {
|
|
15
16
|
AppError2,
|
|
16
17
|
STITCH_ERROR_STATUS2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import"../index-2kbysk9s.js";
|
|
2
|
-
import"../index-
|
|
3
|
-
import"../index-
|
|
2
|
+
import"../index-f4njz9j0.js";
|
|
3
|
+
import"../index-ynrf908v.js";
|
|
4
4
|
import {
|
|
5
5
|
errorCode2,
|
|
6
6
|
normalizeError2
|
|
@@ -18,15 +18,16 @@ import {
|
|
|
18
18
|
ShutdownStatusSchema2,
|
|
19
19
|
ShutdownResultSchema2,
|
|
20
20
|
createServerLifecycle
|
|
21
|
-
} from "../index-
|
|
21
|
+
} from "../index-9mjrnqxs.js";
|
|
22
|
+
import"../index-69t14s4a.js";
|
|
22
23
|
import {
|
|
23
24
|
toJsonSchema,
|
|
24
25
|
jsonSchemaFields
|
|
25
26
|
} from "../index-ct75c3at.js";
|
|
26
27
|
import"../index-3za04re9.js";
|
|
27
28
|
import"../index-4s0fep5q.js";
|
|
28
|
-
import"../index-
|
|
29
|
-
import"../index-
|
|
29
|
+
import"../index-4jpykzvw.js";
|
|
30
|
+
import"../index-yj6saztf.js";
|
|
30
31
|
import"../index-xqhede6x.js";
|
|
31
32
|
import {
|
|
32
33
|
contextContributionDelta,
|
|
@@ -49,14 +50,14 @@ import {
|
|
|
49
50
|
socketIoLane2,
|
|
50
51
|
UnixClientTransportError2,
|
|
51
52
|
createUnixClientTransport2
|
|
52
|
-
} from "../index-
|
|
53
|
+
} from "../index-s20s2mad.js";
|
|
53
54
|
import {
|
|
54
55
|
createFileStateStore2
|
|
55
|
-
} from "../index-
|
|
56
|
+
} from "../index-fqd4yqwd.js";
|
|
56
57
|
import {
|
|
57
58
|
bindRealtimeServer2
|
|
58
59
|
} from "../index-2bqf0a74.js";
|
|
59
|
-
import"../index-
|
|
60
|
+
import"../index-g444vfz2.js";
|
|
60
61
|
import {
|
|
61
62
|
withDeadline
|
|
62
63
|
} from "../index-9tqbxv5p.js";
|
|
@@ -74,7 +75,7 @@ import {
|
|
|
74
75
|
implement2,
|
|
75
76
|
createImplement2,
|
|
76
77
|
createScopedImplement2
|
|
77
|
-
} from "../index-
|
|
78
|
+
} from "../index-sa99p98w.js";
|
|
78
79
|
import {
|
|
79
80
|
deriveCodeChallenge2
|
|
80
81
|
} from "../index-ap3gqe56.js";
|
|
@@ -99,7 +100,7 @@ import {
|
|
|
99
100
|
isWithinDir2,
|
|
100
101
|
realPathWithinDir
|
|
101
102
|
} from "../index-5cc6r990.js";
|
|
102
|
-
import"../index-
|
|
103
|
+
import"../index-pfvde2fz.js";
|
|
103
104
|
import {
|
|
104
105
|
readBoundedChunks,
|
|
105
106
|
concatChunks
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
backoffDelay
|
|
3
3
|
} from "../index-g6a3na27.js";
|
|
4
4
|
import"../index-2kbysk9s.js";
|
|
5
|
-
import"../index-
|
|
5
|
+
import"../index-f4njz9j0.js";
|
|
6
6
|
import {
|
|
7
7
|
attemptExclusiveLock
|
|
8
|
-
} from "../index-
|
|
8
|
+
} from "../index-ynrf908v.js";
|
|
9
9
|
import {
|
|
10
10
|
TELEGRAM_SEND_FAILURE_REASONS2,
|
|
11
11
|
classifyTelegramSendFailure2
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
joinRoutePath
|
|
3
3
|
} from "../index-m38ej7e5.js";
|
|
4
4
|
import"../index-h2fhjqy7.js";
|
|
5
|
-
import"../index-
|
|
6
|
-
import"../index-
|
|
5
|
+
import"../index-9frf01t9.js";
|
|
6
|
+
import"../index-9mjrnqxs.js";
|
|
7
7
|
import {
|
|
8
8
|
createApplication2
|
|
9
|
-
} from "../index-
|
|
9
|
+
} from "../index-cyxp8rbf.js";
|
|
10
10
|
import"../index-w5s3xftz.js";
|
|
11
11
|
import {
|
|
12
12
|
RealtimeRequestTimeoutError2,
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
} from "../index-4s0fep5q.js";
|
|
16
16
|
import {
|
|
17
17
|
TOOL_TRANSPORTS2
|
|
18
|
-
} from "../index-
|
|
18
|
+
} from "../index-69t14s4a.js";
|
|
19
|
+
import"../index-4jpykzvw.js";
|
|
19
20
|
import {
|
|
20
21
|
RealtimeRejectDirectionSchema,
|
|
21
22
|
RealtimeRejectPhaseSchema,
|
|
@@ -30,12 +31,12 @@ import {
|
|
|
30
31
|
projectToolSurface,
|
|
31
32
|
mcpProjectionCandidate,
|
|
32
33
|
prepareProjectedMcpTools
|
|
33
|
-
} from "../index-
|
|
34
|
+
} from "../index-x4p3kw1p.js";
|
|
34
35
|
import"../index-k42ckyzx.js";
|
|
35
36
|
import {
|
|
36
37
|
createClient2,
|
|
37
38
|
createClients2
|
|
38
|
-
} from "../index-
|
|
39
|
+
} from "../index-2dfvv1jg.js";
|
|
39
40
|
import {
|
|
40
41
|
assertPositiveSafeInteger
|
|
41
42
|
} from "../index-0s4xebbg.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import"../../index-69t14s4a.js";
|
|
1
2
|
import"../../index-ct75c3at.js";
|
|
2
3
|
import {
|
|
3
4
|
declaresDraft07,
|
|
4
5
|
withDraft2020Keywords
|
|
5
|
-
} from "../../index-
|
|
6
|
+
} from "../../index-x4p3kw1p.js";
|
|
6
7
|
import"../../index-k42ckyzx.js";
|
|
7
8
|
import {
|
|
8
9
|
markJsonSchemaObjectGuards,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
} from "../../index-9tqbxv5p.js";
|
|
14
15
|
import {
|
|
15
16
|
defineRuntimeTool2
|
|
16
|
-
} from "../../index-
|
|
17
|
+
} from "../../index-aqwg2dm5.js";
|
|
17
18
|
import {
|
|
18
19
|
TOOL_ERROR_PROJECTION
|
|
19
20
|
} from "../../index-98hv3sba.js";
|
|
@@ -2,12 +2,13 @@ import"../../index-k42ckyzx.js";
|
|
|
2
2
|
import"../../index-dsa676h8.js";
|
|
3
3
|
import"../../index-rbzq0q16.js";
|
|
4
4
|
import"../../index-ct75c3at.js";
|
|
5
|
-
import"../../index-
|
|
6
|
-
import"../../index-
|
|
7
|
-
import"../../index-
|
|
5
|
+
import"../../index-x4p3kw1p.js";
|
|
6
|
+
import"../../index-s3yxw6kt.js";
|
|
7
|
+
import"../../index-69t14s4a.js";
|
|
8
|
+
import"../../index-ycqhyars.js";
|
|
8
9
|
import {
|
|
9
10
|
createToolInvoker2
|
|
10
|
-
} from "../../index-
|
|
11
|
+
} from "../../index-kz9734jc.js";
|
|
11
12
|
export {
|
|
12
13
|
createToolInvoker2 as createToolInvoker
|
|
13
14
|
};
|
|
@@ -2,9 +2,10 @@ import"../../index-ct75c3at.js";
|
|
|
2
2
|
import"../../index-k42ckyzx.js";
|
|
3
3
|
import"../../index-dsa676h8.js";
|
|
4
4
|
import"../../index-rbzq0q16.js";
|
|
5
|
-
import"../../index-
|
|
6
|
-
import"../../index-
|
|
7
|
-
import"../../index-
|
|
5
|
+
import"../../index-x4p3kw1p.js";
|
|
6
|
+
import"../../index-s3yxw6kt.js";
|
|
7
|
+
import"../../index-69t14s4a.js";
|
|
8
|
+
import"../../index-ycqhyars.js";
|
|
8
9
|
import {
|
|
9
10
|
RESOURCE_MIME_TYPE2,
|
|
10
11
|
EXT_APPS_BUNDLE_PLACEHOLDER2,
|
|
@@ -20,9 +21,9 @@ import {
|
|
|
20
21
|
createMcpHttpRoute2,
|
|
21
22
|
createStdioMcpServer2,
|
|
22
23
|
bindStdioProcessSignals2
|
|
23
|
-
} from "../../index-
|
|
24
|
-
import"../../index-
|
|
25
|
-
import"../../index-
|
|
24
|
+
} from "../../index-bbvc59gw.js";
|
|
25
|
+
import"../../index-ff39f9dr.js";
|
|
26
|
+
import"../../index-aqwg2dm5.js";
|
|
26
27
|
export {
|
|
27
28
|
EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
|
|
28
29
|
MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
|
|
@@ -21,25 +21,27 @@ import {
|
|
|
21
21
|
findNonPortableFormats2,
|
|
22
22
|
flattenToolJsonSchema2,
|
|
23
23
|
findUntypedProperties2
|
|
24
|
-
} from "../index-
|
|
24
|
+
} from "../index-x4p3kw1p.js";
|
|
25
25
|
import {
|
|
26
26
|
ToolExecutionControlError2,
|
|
27
27
|
isToolExecutionControlError2
|
|
28
|
-
} from "../index-
|
|
28
|
+
} from "../index-s3yxw6kt.js";
|
|
29
|
+
import {
|
|
30
|
+
ALL_TRANSPORTS2,
|
|
31
|
+
TOOL_TRANSPORTS2
|
|
32
|
+
} from "../index-69t14s4a.js";
|
|
29
33
|
import {
|
|
30
34
|
collectTools2
|
|
31
|
-
} from "../index-
|
|
35
|
+
} from "../index-ycqhyars.js";
|
|
32
36
|
import {
|
|
33
37
|
mountAgent2,
|
|
34
38
|
describeToolCatalog2,
|
|
35
39
|
buildToolManifest2
|
|
36
|
-
} from "../index-
|
|
40
|
+
} from "../index-6a69xzrx.js";
|
|
37
41
|
import"../index-m38ej7e5.js";
|
|
38
42
|
import {
|
|
39
|
-
ALL_TRANSPORTS2,
|
|
40
|
-
TOOL_TRANSPORTS2,
|
|
41
43
|
defineContract2
|
|
42
|
-
} from "../index-
|
|
44
|
+
} from "../index-4jpykzvw.js";
|
|
43
45
|
import {
|
|
44
46
|
PROTECTED_RESOURCE_PATH2,
|
|
45
47
|
protectedResourceMetadataUrl2,
|
|
@@ -60,7 +62,7 @@ import {
|
|
|
60
62
|
createMcpHttpRoute2,
|
|
61
63
|
createStdioMcpServer2,
|
|
62
64
|
bindStdioProcessSignals2
|
|
63
|
-
} from "../index-
|
|
65
|
+
} from "../index-bbvc59gw.js";
|
|
64
66
|
import {
|
|
65
67
|
AsyncOperationCancelResultSchema2,
|
|
66
68
|
createAsyncOperationSnapshotSchema2,
|
|
@@ -69,12 +71,12 @@ import {
|
|
|
69
71
|
ViewFileErrorSchema2,
|
|
70
72
|
ViewFileOutputSchema2,
|
|
71
73
|
ViewFileInputSchema2
|
|
72
|
-
} from "../index-
|
|
74
|
+
} from "../index-sba3e6m4.js";
|
|
73
75
|
import {
|
|
74
76
|
WaitTimeoutError,
|
|
75
77
|
runWaitOperation,
|
|
76
78
|
createCli2
|
|
77
|
-
} from "../index-
|
|
79
|
+
} from "../index-s0qjs6ee.js";
|
|
78
80
|
import"../index-2kbysk9s.js";
|
|
79
81
|
import {
|
|
80
82
|
ManagedFilePathSchema2,
|
|
@@ -87,25 +89,25 @@ import {
|
|
|
87
89
|
import {
|
|
88
90
|
contractOnlyService,
|
|
89
91
|
mediaTypeEssence
|
|
90
|
-
} from "../index-
|
|
92
|
+
} from "../index-sa99p98w.js";
|
|
91
93
|
import {
|
|
92
94
|
DEFAULT_CORS_ALLOW_HEADERS2
|
|
93
95
|
} from "../index-yk4g8805.js";
|
|
94
96
|
import {
|
|
95
97
|
createToolInvoker2
|
|
96
|
-
} from "../index-
|
|
98
|
+
} from "../index-kz9734jc.js";
|
|
97
99
|
import"../index-q968hy6y.js";
|
|
98
100
|
import"../index-arjmb6de.js";
|
|
99
101
|
import {
|
|
100
102
|
collectToolSurface
|
|
101
|
-
} from "../index-
|
|
103
|
+
} from "../index-ff39f9dr.js";
|
|
102
104
|
import {
|
|
103
105
|
getTraceId2
|
|
104
106
|
} from "../index-r6v4mc67.js";
|
|
105
107
|
import {
|
|
106
108
|
defineRuntimeTool2,
|
|
107
109
|
createRuntimeToolFactory2
|
|
108
|
-
} from "../index-
|
|
110
|
+
} from "../index-aqwg2dm5.js";
|
|
109
111
|
import {
|
|
110
112
|
ManagedFileError2
|
|
111
113
|
} from "../index-364k2zwa.js";
|
|
@@ -114,7 +116,7 @@ import {
|
|
|
114
116
|
fetchPinnedDocument,
|
|
115
117
|
readCapped
|
|
116
118
|
} from "../index-mgb7r8b8.js";
|
|
117
|
-
import"../index-
|
|
119
|
+
import"../index-pfvde2fz.js";
|
|
118
120
|
import {
|
|
119
121
|
readBoundedChunks,
|
|
120
122
|
concatChunks
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import"../../index-m38ej7e5.js";
|
|
2
|
+
import"../../index-69t14s4a.js";
|
|
2
3
|
import {
|
|
3
4
|
defineContract2
|
|
4
|
-
} from "../../index-
|
|
5
|
+
} from "../../index-4jpykzvw.js";
|
|
5
6
|
|
|
6
7
|
// src/tracking/schemas.ts
|
|
7
8
|
import { z } from "zod";
|
|
@@ -14,6 +15,7 @@ var UtmDataSchema = z.object({
|
|
|
14
15
|
});
|
|
15
16
|
var AttributionDataSchema = z.object({
|
|
16
17
|
utm: UtmDataSchema.optional(),
|
|
18
|
+
clickId: z.string().min(1).max(200).optional(),
|
|
17
19
|
referrer: z.string().optional(),
|
|
18
20
|
landingPage: z.string().optional()
|
|
19
21
|
});
|
|
@@ -57,6 +59,7 @@ function visitEntryContextShape(buildIdPattern) {
|
|
|
57
59
|
landingPath: z.string().startsWith("/").max(300).regex(/^[^?#]*$/),
|
|
58
60
|
referrer: z.url().max(2000).optional(),
|
|
59
61
|
utm: UtmDataSchema.optional(),
|
|
62
|
+
clickId: AttributionDataSchema.shape.clickId,
|
|
60
63
|
displayMode: z.enum(["browser", "standalone"]),
|
|
61
64
|
screenWidth: z.number().int().positive().max(20000),
|
|
62
65
|
screenHeight: z.number().int().positive().max(20000),
|
|
@@ -75,8 +78,7 @@ function createTrackingSchemas(config) {
|
|
|
75
78
|
event,
|
|
76
79
|
request: z.object({
|
|
77
80
|
buildId: z.string().regex(buildIdPattern),
|
|
78
|
-
events: z.array(event).min(1).max(maxEvents)
|
|
79
|
-
utm: UtmDataSchema.optional()
|
|
81
|
+
events: z.array(event).min(1).max(maxEvents)
|
|
80
82
|
}),
|
|
81
83
|
response: TrackEventsResponseSchema,
|
|
82
84
|
disposition: TrackingDispositionSchema,
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
DEFAULT_BOT_USER_AGENT_PATTERN2
|
|
3
3
|
} from "../../index-1f40z584.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "../../index-
|
|
5
|
+
redactTrackingText2,
|
|
6
|
+
sendUnloadBeacon2
|
|
7
|
+
} from "../../index-8vzh5wpv.js";
|
|
8
8
|
|
|
9
9
|
// src/tracking/performance/collector.ts
|
|
10
10
|
var DEFAULT_EARLY_DELAY_MS = 5000;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* `stitchkit/tracking/contract`, the server half `stitchkit/tracking/server`.
|
|
9
9
|
* → ADR 0166, ADR 0280.
|
|
10
10
|
*/
|
|
11
|
-
export { type AttributionStorage,
|
|
11
|
+
export { type AttributionStorage, parseUtmFromSearch, type ResolveAttributionInput, type ResolvedAttribution, resolveAttribution, } from '../tracking/attribution.js';
|
|
12
12
|
export { sendUnloadBeacon } from '../tracking/beacon.js';
|
|
13
13
|
export { type ClickTarget, type ResolveTrackedClickOptions, resolveTrackedClick, type TrackedClick, type TrackedClickAttributes, } from '../tracking/clicks.js';
|
|
14
14
|
export { type BuiltinTrackingEventTypes, CONVENTIONAL_TRACKING_EVENT_TYPES, createTrackingClient, type EventsWithMetadata, type EventsWithoutMetadata, type TrackFn, type TrackingClient, type TrackingClientConfig, } from '../tracking/client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/entrypoints/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/entrypoints/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,yBAAyB,EAC9B,iCAAiC,EACjC,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,sBAAsB,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
sendUnloadBeacon2,
|
|
3
2
|
redactTrackingText2,
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
maskTrackingParameters,
|
|
4
|
+
redactTrackingValue2,
|
|
5
|
+
sendUnloadBeacon2
|
|
6
|
+
} from "../index-8vzh5wpv.js";
|
|
6
7
|
import {
|
|
7
8
|
ApiError2
|
|
8
9
|
} from "../index-kfjkb396.js";
|
|
@@ -27,49 +28,55 @@ function isStoredTouch(value) {
|
|
|
27
28
|
if (!isRecord(value) || !Number.isFinite(value.capturedAt))
|
|
28
29
|
return false;
|
|
29
30
|
const { data } = value;
|
|
30
|
-
return isRecord(data) && isUtm(data.utm) && isOptionalText(data.referrer) && isOptionalText(data.landingPage);
|
|
31
|
+
return isRecord(data) && isUtm(data.utm) && (data.clickId === undefined || typeof data.clickId === "string" && data.clickId.length > 0 && data.clickId.length <= MAX_UTM_LENGTH) && isOptionalText(data.referrer) && isOptionalText(data.landingPage);
|
|
31
32
|
}
|
|
32
33
|
function isStoredAttribution(value) {
|
|
33
|
-
return isRecord(value) &&
|
|
34
|
+
return isRecord(value) && value.version === 1 && isStoredTouch(value.firstTouch);
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function campaignValue(value) {
|
|
36
37
|
if (!value)
|
|
37
38
|
return;
|
|
38
|
-
return value
|
|
39
|
+
return redactTrackingText2(value).slice(0, MAX_UTM_LENGTH);
|
|
39
40
|
}
|
|
40
41
|
function parseUtmFromSearch(search) {
|
|
41
42
|
const params = new URLSearchParams(search);
|
|
42
|
-
const source =
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
return {
|
|
43
|
+
const source = campaignValue(params.get("utm_source"));
|
|
44
|
+
const utm = {
|
|
46
45
|
source,
|
|
47
|
-
medium:
|
|
48
|
-
campaign:
|
|
49
|
-
content:
|
|
50
|
-
term:
|
|
46
|
+
medium: campaignValue(params.get("utm_medium")),
|
|
47
|
+
campaign: campaignValue(params.get("utm_campaign")),
|
|
48
|
+
content: campaignValue(params.get("utm_content")),
|
|
49
|
+
term: campaignValue(params.get("utm_term"))
|
|
51
50
|
};
|
|
51
|
+
return Object.values(utm).some((value) => value !== undefined) ? utm : null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (hostname === currentHostname.toLowerCase())
|
|
59
|
-
return null;
|
|
60
|
-
const match = referrerMap.find((rule) => rule.pattern.test(hostname));
|
|
61
|
-
return match ? { source: match.source, medium: match.medium } : { source: hostname, medium: "referral" };
|
|
62
|
-
} catch {
|
|
63
|
-
return null;
|
|
53
|
+
function assertClickIdParams(names) {
|
|
54
|
+
for (const name of names) {
|
|
55
|
+
if (typeof name !== "string" || name.length === 0 || name.length > MAX_UTM_LENGTH) {
|
|
56
|
+
throw new TypeError("clickIdParams names must contain 1–200 characters");
|
|
57
|
+
}
|
|
64
58
|
}
|
|
65
59
|
}
|
|
60
|
+
function trackedReferrer(referrer, clickIdParams) {
|
|
61
|
+
return maskTrackingParameters(redactTrackingText2(referrer), new Set(clickIdParams));
|
|
62
|
+
}
|
|
63
|
+
function clickIdFromSearch(search, names) {
|
|
64
|
+
const params = new URLSearchParams(search);
|
|
65
|
+
return names.find((name) => params.getAll(name).some((value) => value.length > 0));
|
|
66
|
+
}
|
|
67
|
+
function isFresh(capturedAt, now, ttlMs) {
|
|
68
|
+
const age = now - capturedAt;
|
|
69
|
+
return age >= 0 && age <= ttlMs;
|
|
70
|
+
}
|
|
66
71
|
function readStored(storage, key, now, ttlMs) {
|
|
72
|
+
if (!storage)
|
|
73
|
+
return null;
|
|
67
74
|
try {
|
|
68
75
|
const raw = storage.getItem(key);
|
|
69
76
|
if (!raw)
|
|
70
77
|
return null;
|
|
71
78
|
const parsed = JSON.parse(raw);
|
|
72
|
-
if (!isStoredAttribution(parsed) ||
|
|
79
|
+
if (!isStoredAttribution(parsed) || !isFresh(parsed.firstTouch.capturedAt, now, ttlMs)) {
|
|
73
80
|
storage.removeItem(key);
|
|
74
81
|
return null;
|
|
75
82
|
}
|
|
@@ -79,6 +86,8 @@ function readStored(storage, key, now, ttlMs) {
|
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
function writeStored(storage, key, value) {
|
|
89
|
+
if (!storage)
|
|
90
|
+
return;
|
|
82
91
|
try {
|
|
83
92
|
storage.setItem(key, JSON.stringify(value));
|
|
84
93
|
} catch {}
|
|
@@ -87,47 +96,27 @@ function resolveAttribution({
|
|
|
87
96
|
search,
|
|
88
97
|
referrer,
|
|
89
98
|
pathname,
|
|
90
|
-
hostname,
|
|
91
99
|
storage,
|
|
92
|
-
|
|
100
|
+
clickIdParams = [],
|
|
93
101
|
storageKey = "tracking.attribution",
|
|
94
102
|
ttlMs = 90 * 24 * 60 * 60 * 1000,
|
|
95
103
|
now = Date.now()
|
|
96
104
|
}) {
|
|
105
|
+
assertClickIdParams(clickIdParams);
|
|
97
106
|
const stored = readStored(storage, storageKey, now, ttlMs);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
landingPage: pathname
|
|
104
|
-
};
|
|
105
|
-
const persisted = {
|
|
106
|
-
firstTouch: {
|
|
107
|
-
data: stored?.firstTouch.data ?? currentTouch,
|
|
108
|
-
capturedAt: stored?.firstTouch.capturedAt ?? now
|
|
109
|
-
},
|
|
110
|
-
currentTouch: { data: currentTouch, capturedAt: now }
|
|
111
|
-
};
|
|
112
|
-
writeStored(storage, storageKey, persisted);
|
|
113
|
-
return {
|
|
114
|
-
firstTouch: persisted.firstTouch.data,
|
|
115
|
-
currentTouch: persisted.currentTouch.data
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
if (stored)
|
|
119
|
-
return { firstTouch: stored.firstTouch.data, currentTouch: stored.currentTouch.data };
|
|
120
|
-
const fromReferrer = parseReferrer(referrer, hostname, referrerMap);
|
|
121
|
-
const firstTouch = {
|
|
122
|
-
utm: fromReferrer ? { source: fromReferrer.source, medium: fromReferrer.medium } : undefined,
|
|
123
|
-
referrer: referrer || undefined,
|
|
124
|
-
landingPage: pathname
|
|
107
|
+
const currentTouch = {
|
|
108
|
+
utm: parseUtmFromSearch(search) ?? undefined,
|
|
109
|
+
clickId: clickIdFromSearch(search, clickIdParams),
|
|
110
|
+
referrer: referrer ? trackedReferrer(referrer, clickIdParams) : undefined,
|
|
111
|
+
landingPage: redactTrackingText2(pathname)
|
|
125
112
|
};
|
|
113
|
+
if (stored)
|
|
114
|
+
return { firstTouch: stored.firstTouch.data, currentTouch };
|
|
126
115
|
writeStored(storage, storageKey, {
|
|
127
|
-
|
|
128
|
-
|
|
116
|
+
version: 1,
|
|
117
|
+
firstTouch: { data: currentTouch, capturedAt: now }
|
|
129
118
|
});
|
|
130
|
-
return { firstTouch, currentTouch
|
|
119
|
+
return { firstTouch: currentTouch, currentTouch };
|
|
131
120
|
}
|
|
132
121
|
// src/tracking/clicks.ts
|
|
133
122
|
function label(target) {
|
|
@@ -359,9 +348,10 @@ function bootstrapTrackingVisit(deps, renew) {
|
|
|
359
348
|
browserStreamId: visit.browserStreamId,
|
|
360
349
|
previousVisitId: visit.visitId ?? undefined,
|
|
361
350
|
origin: page.origin,
|
|
362
|
-
landingPath:
|
|
363
|
-
referrer:
|
|
364
|
-
utm: touch
|
|
351
|
+
landingPath: touch.currentTouch.landingPage,
|
|
352
|
+
referrer: touch.currentTouch.referrer,
|
|
353
|
+
utm: touch.currentTouch.utm,
|
|
354
|
+
clickId: touch.currentTouch.clickId,
|
|
365
355
|
displayMode: page.displayMode,
|
|
366
356
|
screenWidth: page.screenWidth,
|
|
367
357
|
screenHeight: page.screenHeight,
|
|
@@ -431,22 +421,18 @@ function createVisitSequences(outbox, visit, options, fail) {
|
|
|
431
421
|
} : undefined
|
|
432
422
|
});
|
|
433
423
|
}
|
|
434
|
-
function
|
|
435
|
-
return Object.fromEntries(Object.entries(utm).map(([field, value]) => [field, redactTrackingText2(value)]));
|
|
436
|
-
}
|
|
437
|
-
function pageAttribution(host, storage, referrerMap, search, pathname) {
|
|
424
|
+
function pageAttribution(host, clickIdParams, search, pathname) {
|
|
438
425
|
const page = host.page();
|
|
439
426
|
return resolveAttribution({
|
|
440
427
|
search,
|
|
441
428
|
pathname,
|
|
442
|
-
referrer:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
referrerMap,
|
|
429
|
+
referrer: page.referrer,
|
|
430
|
+
storage: host.storage,
|
|
431
|
+
clickIdParams,
|
|
446
432
|
now: host.wallClock()
|
|
447
433
|
});
|
|
448
434
|
}
|
|
449
|
-
function pageViewDraft(host, type, pathname, previous) {
|
|
435
|
+
function pageViewDraft(host, type, pathname, previous, clickIdParams) {
|
|
450
436
|
const page = host.page();
|
|
451
437
|
return {
|
|
452
438
|
type,
|
|
@@ -455,7 +441,7 @@ function pageViewDraft(host, type, pathname, previous) {
|
|
|
455
441
|
title: page.title,
|
|
456
442
|
screenWidth: page.viewportWidth,
|
|
457
443
|
screenHeight: page.viewportHeight,
|
|
458
|
-
referrer: previous || !page.referrer ? undefined :
|
|
444
|
+
referrer: previous || !page.referrer ? undefined : trackedReferrer(page.referrer, clickIdParams ?? [])
|
|
459
445
|
},
|
|
460
446
|
clientTimestamp: host.wallClock()
|
|
461
447
|
};
|
|
@@ -567,9 +553,6 @@ function chunk(items, size) {
|
|
|
567
553
|
function unloadBeacon(unloadUrl) {
|
|
568
554
|
return (request) => unloadUrl === undefined ? false : sendUnloadBeacon2(unloadUrl, JSON.stringify(request));
|
|
569
555
|
}
|
|
570
|
-
function currentUtmOf(attribution) {
|
|
571
|
-
return attribution?.currentTouch.utm?.source ? redactedUtm(attribution.currentTouch.utm) : undefined;
|
|
572
|
-
}
|
|
573
556
|
function trackingTimings(config) {
|
|
574
557
|
if (typeof config.buildId !== "string" || config.buildId.length === 0) {
|
|
575
558
|
throw new Error('[stitchkit] tracking client requires a buildId — a git SHA or "dev"');
|
|
@@ -584,6 +567,7 @@ function trackingTimings(config) {
|
|
|
584
567
|
function createTrackingClient(config) {
|
|
585
568
|
const { host, builtin, outbox } = config;
|
|
586
569
|
const { heartbeatMs, renewAfterHiddenMs, pendingLimit, batchSize } = trackingTimings(config);
|
|
570
|
+
assertClickIdParams(config.clickIdParams ?? []);
|
|
587
571
|
const fail = config.onFailure ?? (() => {
|
|
588
572
|
return;
|
|
589
573
|
});
|
|
@@ -604,13 +588,11 @@ function createTrackingClient(config) {
|
|
|
604
588
|
const scroll = createScrollMilestones(config.scrollMilestones);
|
|
605
589
|
const sequences = createVisitSequences(outbox, visit, config.sequence, fail);
|
|
606
590
|
const captureAttribution = (search, pathname) => {
|
|
607
|
-
|
|
608
|
-
return null;
|
|
609
|
-
attribution = pageAttribution(host, host.storage, config.referrerMap, search, pathname);
|
|
591
|
+
attribution = pageAttribution(host, config.clickIdParams, search, pathname);
|
|
610
592
|
return attribution;
|
|
611
593
|
};
|
|
612
594
|
const bootstrapVisit = (renew = false) => bootstrapTrackingVisit({ visit, config, host, outbox, sequences, captureAttribution, fail }, renew);
|
|
613
|
-
const deliver = (events) => deliverTrackedEvents(config, { buildId: config.buildId, events
|
|
595
|
+
const deliver = (events) => deliverTrackedEvents(config, { buildId: config.buildId, events }, fail);
|
|
614
596
|
const flushOutbox = createOutboxFlusher({
|
|
615
597
|
outbox,
|
|
616
598
|
isAvailable: () => visit.outboxAvailable,
|
|
@@ -672,7 +654,7 @@ function createTrackingClient(config) {
|
|
|
672
654
|
send([draft]);
|
|
673
655
|
return;
|
|
674
656
|
}
|
|
675
|
-
unload({ buildId: config.buildId, events: [event]
|
|
657
|
+
unload({ buildId: config.buildId, events: [event] });
|
|
676
658
|
if (outbox && visit.outboxAvailable)
|
|
677
659
|
outbox.enqueue(event).catch((error) => fail("unload event persistence", error));
|
|
678
660
|
};
|
|
@@ -695,7 +677,7 @@ function createTrackingClient(config) {
|
|
|
695
677
|
currentPage = pathname;
|
|
696
678
|
meter.checkpoint();
|
|
697
679
|
scroll.reset();
|
|
698
|
-
send([pageViewDraft(host, builtin.pageView, pathname, previous)]);
|
|
680
|
+
send([pageViewDraft(host, builtin.pageView, pathname, previous, config.clickIdParams)]);
|
|
699
681
|
};
|
|
700
682
|
const start = () => {
|
|
701
683
|
const generation = ++running;
|
|
@@ -754,7 +736,6 @@ function browserTrackingHost() {
|
|
|
754
736
|
pathname: window.location.pathname,
|
|
755
737
|
search: window.location.search,
|
|
756
738
|
origin: window.location.origin,
|
|
757
|
-
hostname: window.location.hostname,
|
|
758
739
|
title: document.title,
|
|
759
740
|
referrer: document.referrer,
|
|
760
741
|
viewportWidth: window.innerWidth,
|
|
@@ -1032,7 +1013,6 @@ export {
|
|
|
1032
1013
|
deliverTrackingBatch,
|
|
1033
1014
|
indexedDbOutboxStorage,
|
|
1034
1015
|
memoryOutboxStorage,
|
|
1035
|
-
parseReferrer,
|
|
1036
1016
|
parseUtmFromSearch,
|
|
1037
1017
|
redactTrackingText2 as redactTrackingText,
|
|
1038
1018
|
redactTrackingValue2 as redactTrackingValue,
|