stitchkit 0.112.1 → 0.112.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  3. package/dist/entrypoints/agent-runtime/harness.js +4 -4
  4. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  5. package/dist/entrypoints/agent-runtime/sqlite/bun.js +5 -5
  6. package/dist/entrypoints/agent-runtime/sqlite/node.js +5 -5
  7. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  8. package/dist/entrypoints/agent-runtime.js +10 -10
  9. package/dist/entrypoints/cli.js +6 -6
  10. package/dist/entrypoints/testing.js +1 -1
  11. package/dist/entrypoints/tools/connections.js +6 -6
  12. package/dist/entrypoints/tools/invoker.js +4 -4
  13. package/dist/entrypoints/tools/mcp.js +6 -6
  14. package/dist/entrypoints/tools.js +9 -9
  15. package/dist/entrypoints/tracking.js +12 -6
  16. package/dist/{index-jfk93gja.js → index-4dh3hfs7.js} +3 -3
  17. package/dist/{index-651xsm48.js → index-54q2mghq.js} +4 -4
  18. package/dist/{index-c7h371gr.js → index-5jjda9a4.js} +4 -4
  19. package/dist/{index-a0vj9edp.js → index-b9yqb9e7.js} +1 -1
  20. package/dist/{index-fh2ht88b.js → index-c9vpsxw4.js} +1 -1
  21. package/dist/{index-n0adphfg.js → index-dsxrcseb.js} +1 -1
  22. package/dist/{index-hvg9hctd.js → index-eddzs589.js} +3 -3
  23. package/dist/{index-38gvr73z.js → index-f2p949ax.js} +1 -1
  24. package/dist/{index-bd7spznx.js → index-gpbk7yse.js} +4 -4
  25. package/dist/{index-h7accrrv.js → index-jgwqc38k.js} +66 -6
  26. package/dist/{index-d4cnhfdn.js → index-kenvdagc.js} +1 -1
  27. package/dist/{index-ff3agzaf.js → index-nk1mh535.js} +1 -1
  28. package/dist/{index-02h0dfpr.js → index-z4ga1fa1.js} +1 -1
  29. package/dist/{index-vqdjym30.js → index-zm1k7hhv.js} +2 -2
  30. package/dist/json-schema/dialect.d.ts +12 -10
  31. package/dist/json-schema/dialect.d.ts.map +1 -1
  32. package/dist/tools/schema/presentation.d.ts +4 -3
  33. package/dist/tools/schema/presentation.d.ts.map +1 -1
  34. package/dist/tracking/clicks.d.ts +3 -1
  35. package/dist/tracking/clicks.d.ts.map +1 -1
  36. package/dist/tracking/client-listeners.d.ts +1 -0
  37. package/dist/tracking/client-listeners.d.ts.map +1 -1
  38. package/dist/tracking/client.d.ts +3 -1
  39. package/dist/tracking/client.d.ts.map +1 -1
  40. package/llms/tracking.txt +20 -2
  41. package/llms-full.txt +20 -2
  42. package/llms.txt +1 -1
  43. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -15,6 +15,19 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.112.3] - 2026-10-26
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/tools/mcp`, `stitchkit/tools/connections` — a tool whose input holds a `z.tuple` is now served as a valid 2020-12 schema: the tuple is written as `prefixItems` (rest as `items`) instead of draft-07's `items` list, which Claude's MCP client refused (`must be object,boolean`) and dropped the tool without a server-side error. The stitchkit MCP client reads a tuple from an older server's document with the same meaning. → ADR 0270
23
+ **Affects:** `stitchkit/tools/mcp` behaviour; `stitchkit/tools/connections` behaviour
24
+
25
+ ## [0.112.2] - 2026-10-25
26
+
27
+ ### Added
28
+
29
+ - `stitchkit/tracking` — `resolveTrackedClick` and `createTrackingClient` accept `hrefPolicy: 'full'` to retain internal and outbound click query parameters and fragments before consumer `decorate` redaction. The default `path-only` policy, navigation classification, labels and listener cleanup stay unchanged; URL credentials remain excluded.
30
+
18
31
  ## [0.112.1] - 2026-10-25
19
32
 
20
33
  ### Fixed
@@ -1,17 +1,17 @@
1
1
  import"../../index-ct75c3at.js";
2
- import"../../index-h7accrrv.js";
2
+ import"../../index-jgwqc38k.js";
3
3
  import"../../index-fynr93w4.js";
4
4
  import {
5
5
  AgentCodingToolLimitsSchema2,
6
6
  AgentCodingToolAuthorizationSchema2,
7
7
  AgentCodingToolPathAuthorizationSchema2,
8
8
  createAgentCodingTools2
9
- } from "../../index-n0adphfg.js";
9
+ } from "../../index-dsxrcseb.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import"../../index-84bf5spd.js";
12
12
  import"../../index-7r4knwf8.js";
13
13
  import"../../index-zrtrjkbf.js";
14
- import"../../index-ff3agzaf.js";
14
+ import"../../index-nk1mh535.js";
15
15
  export {
16
16
  AgentCodingToolAuthorizationSchema2 as AgentCodingToolAuthorizationSchema,
17
17
  AgentCodingToolLimitsSchema2 as AgentCodingToolLimitsSchema,
@@ -5,15 +5,15 @@ import"../../index-8kzct1d6.js";
5
5
  import {
6
6
  composeAgentPrompt2,
7
7
  createAgentRuntime2
8
- } from "../../index-a0vj9edp.js";
8
+ } from "../../index-b9yqb9e7.js";
9
9
  import"../../index-qaet40b2.js";
10
10
  import"../../index-mnkk1ffz.js";
11
11
  import"../../index-fynr93w4.js";
12
12
  import"../../index-epmnrnth.js";
13
13
  import"../../index-jy9wq8tp.js";
14
14
  import"../../index-ct75c3at.js";
15
- import"../../index-h7accrrv.js";
16
- import"../../index-02h0dfpr.js";
15
+ import"../../index-jgwqc38k.js";
16
+ import"../../index-z4ga1fa1.js";
17
17
  import"../../index-snef22zr.js";
18
18
  import"../../index-56yx8dxp.js";
19
19
  import"../../index-jna0ejsa.js";
@@ -29,7 +29,7 @@ import {
29
29
  } from "../../index-zrtrjkbf.js";
30
30
  import {
31
31
  defineRuntimeTool2
32
- } from "../../index-ff3agzaf.js";
32
+ } from "../../index-nk1mh535.js";
33
33
 
34
34
  // src/agent-runtime/harness-contract.ts
35
35
  import { z } from "zod";
@@ -3,9 +3,9 @@ import {
3
3
  missingSandboxRestrictions2,
4
4
  codingRefusal,
5
5
  createAgentCodingTools2
6
- } from "../../index-n0adphfg.js";
6
+ } from "../../index-dsxrcseb.js";
7
7
  import"../../index-ct75c3at.js";
8
- import"../../index-h7accrrv.js";
8
+ import"../../index-jgwqc38k.js";
9
9
  import"../../index-fynr93w4.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import {
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  MAX_TIMER_MS
27
27
  } from "../../index-eemvahkc.js";
28
- import"../../index-ff3agzaf.js";
28
+ import"../../index-nk1mh535.js";
29
29
 
30
30
  // src/agent-runtime/sandbox-bubblewrap.ts
31
31
  import { mkdir as mkdir2, mkdtemp, realpath, rm as rm2 } from "node:fs/promises";
@@ -1,22 +1,22 @@
1
1
  import"../../../index-jna0ejsa.js";
2
- import"../../../index-38gvr73z.js";
2
+ import"../../../index-f2p949ax.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-fh2ht88b.js";
7
+ } from "../../../index-c9vpsxw4.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
- import"../../../index-n0adphfg.js";
10
+ import"../../../index-dsxrcseb.js";
11
11
  import"../../../index-ct75c3at.js";
12
- import"../../../index-h7accrrv.js";
12
+ import"../../../index-jgwqc38k.js";
13
13
  import"../../../index-fynr93w4.js";
14
14
  import"../../../index-2kbysk9s.js";
15
15
  import"../../../index-84bf5spd.js";
16
16
  import"../../../index-7r4knwf8.js";
17
17
  import"../../../index-snef22zr.js";
18
18
  import"../../../index-zrtrjkbf.js";
19
- import"../../../index-ff3agzaf.js";
19
+ import"../../../index-nk1mh535.js";
20
20
 
21
21
  // src/agent-runtime/sqlite-bun.ts
22
22
  import { Database } from "bun:sqlite";
@@ -1,22 +1,22 @@
1
1
  import"../../../index-jna0ejsa.js";
2
- import"../../../index-38gvr73z.js";
2
+ import"../../../index-f2p949ax.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-fh2ht88b.js";
7
+ } from "../../../index-c9vpsxw4.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
- import"../../../index-n0adphfg.js";
10
+ import"../../../index-dsxrcseb.js";
11
11
  import"../../../index-ct75c3at.js";
12
- import"../../../index-h7accrrv.js";
12
+ import"../../../index-jgwqc38k.js";
13
13
  import"../../../index-fynr93w4.js";
14
14
  import"../../../index-2kbysk9s.js";
15
15
  import"../../../index-84bf5spd.js";
16
16
  import"../../../index-7r4knwf8.js";
17
17
  import"../../../index-snef22zr.js";
18
18
  import"../../../index-zrtrjkbf.js";
19
- import"../../../index-ff3agzaf.js";
19
+ import"../../../index-nk1mh535.js";
20
20
 
21
21
  // src/agent-runtime/sqlite-node.ts
22
22
  import { DatabaseSync } from "node:sqlite";
@@ -10,10 +10,10 @@ import {
10
10
  advanceToolChronology
11
11
  } from "../../index-jna0ejsa.js";
12
12
  import"../../index-5w6t91ze.js";
13
- import"../../index-n0adphfg.js";
14
- import"../../index-38gvr73z.js";
13
+ import"../../index-dsxrcseb.js";
14
+ import"../../index-f2p949ax.js";
15
15
  import"../../index-ct75c3at.js";
16
- import"../../index-h7accrrv.js";
16
+ import"../../index-jgwqc38k.js";
17
17
  import"../../index-fynr93w4.js";
18
18
  import"../../index-2kbysk9s.js";
19
19
  import"../../index-84bf5spd.js";
@@ -21,12 +21,12 @@ import"../../index-7r4knwf8.js";
21
21
  import"../../index-snef22zr.js";
22
22
  import {
23
23
  createMemoryAgentRuntimeStore2
24
- } from "../../index-d4cnhfdn.js";
24
+ } from "../../index-kenvdagc.js";
25
25
  import"../../index-zrtrjkbf.js";
26
26
  import {
27
27
  assertPositiveSafeInteger
28
28
  } from "../../index-0s4xebbg.js";
29
- import"../../index-ff3agzaf.js";
29
+ import"../../index-nk1mh535.js";
30
30
 
31
31
  // src/agent-runtime/fault-bench.ts
32
32
  import { createServer } from "node:http";
@@ -5,7 +5,7 @@ import {
5
5
  missingSandboxRestrictions2,
6
6
  recordAgentSandboxProbe2,
7
7
  refuseUnknownSpillReference
8
- } from "../index-n0adphfg.js";
8
+ } from "../index-dsxrcseb.js";
9
9
  import {
10
10
  AgentRecordIdSchema2,
11
11
  AgentRecordVersionSchema2,
@@ -58,7 +58,7 @@ import {
58
58
  AgentHistoryMutationSchema2,
59
59
  ACTIVE_AGENT_RUN_STATES2,
60
60
  createAgentRuntimeStore2
61
- } from "../index-38gvr73z.js";
61
+ } from "../index-f2p949ax.js";
62
62
  import {
63
63
  AgentStoreEventKindSchema2,
64
64
  AgentStoreEventEnvelopeSchema2,
@@ -123,7 +123,7 @@ import {
123
123
  agentGoalStateSlot2,
124
124
  agentTodoStateSlot2,
125
125
  createAgentRuntime2
126
- } from "../index-a0vj9edp.js";
126
+ } from "../index-b9yqb9e7.js";
127
127
  import {
128
128
  AgentConversationSummarySchema2,
129
129
  AgentConversationPageSchema2,
@@ -133,13 +133,13 @@ import"../index-fynr93w4.js";
133
133
  import"../index-epmnrnth.js";
134
134
  import"../index-jy9wq8tp.js";
135
135
  import"../index-ct75c3at.js";
136
- import"../index-h7accrrv.js";
137
- import"../index-02h0dfpr.js";
138
- import"../index-vqdjym30.js";
136
+ import"../index-jgwqc38k.js";
137
+ import"../index-z4ga1fa1.js";
138
+ import"../index-zm1k7hhv.js";
139
139
  import {
140
140
  mountAgent2,
141
141
  buildToolManifest2
142
- } from "../index-c7h371gr.js";
142
+ } from "../index-5jjda9a4.js";
143
143
  import {
144
144
  createBoundedSinkManager
145
145
  } from "../index-qaet40b2.js";
@@ -191,7 +191,7 @@ import"../index-84bf5spd.js";
191
191
  import"../index-7r4knwf8.js";
192
192
  import {
193
193
  createMemoryAgentRuntimeStore2
194
- } from "../index-d4cnhfdn.js";
194
+ } from "../index-kenvdagc.js";
195
195
  import {
196
196
  createAgentRuntimeEventSink2
197
197
  } from "../index-616xh7f2.js";
@@ -202,11 +202,11 @@ import {
202
202
  import {
203
203
  assertPositiveSafeInteger
204
204
  } from "../index-0s4xebbg.js";
205
- import"../index-hvg9hctd.js";
205
+ import"../index-eddzs589.js";
206
206
  import {
207
207
  defineRuntimeTool2,
208
208
  executableAgentRuntimeTools
209
- } from "../index-ff3agzaf.js";
209
+ } from "../index-nk1mh535.js";
210
210
  import {
211
211
  createTraceContext2,
212
212
  childSpan2
@@ -16,12 +16,12 @@ import {
16
16
  renderCliView2,
17
17
  pollUntilDone2,
18
18
  createCli2
19
- } from "../index-bd7spznx.js";
19
+ } from "../index-gpbk7yse.js";
20
20
  import"../index-fynr93w4.js";
21
21
  import"../index-ct75c3at.js";
22
- import"../index-h7accrrv.js";
23
- import"../index-02h0dfpr.js";
24
- import"../index-vqdjym30.js";
22
+ import"../index-jgwqc38k.js";
23
+ import"../index-z4ga1fa1.js";
24
+ import"../index-zm1k7hhv.js";
25
25
  import {
26
26
  CliBuildSignatureSchema2,
27
27
  cliManifestSigningPayload2,
@@ -44,8 +44,8 @@ import {
44
44
  import {
45
45
  writeFileAtomicSync2
46
46
  } from "../index-07dcf2yn.js";
47
- import"../index-hvg9hctd.js";
48
- import"../index-ff3agzaf.js";
47
+ import"../index-eddzs589.js";
48
+ import"../index-nk1mh535.js";
49
49
  import {
50
50
  safeJsonParse
51
51
  } from "../index-zsarb5xp.js";
@@ -30,7 +30,7 @@ import {
30
30
  projectToolSurface,
31
31
  mcpProjectionCandidate,
32
32
  prepareProjectedMcpTools
33
- } from "../index-h7accrrv.js";
33
+ } from "../index-jgwqc38k.js";
34
34
  import"../index-fynr93w4.js";
35
35
  import {
36
36
  createClient2,
@@ -1,8 +1,8 @@
1
1
  import"../../index-ct75c3at.js";
2
2
  import {
3
3
  declaresDraft07,
4
- withDefsDialect
5
- } from "../../index-h7accrrv.js";
4
+ withDraft2020Keywords
5
+ } from "../../index-jgwqc38k.js";
6
6
  import"../../index-fynr93w4.js";
7
7
  import {
8
8
  markJsonSchemaObjectGuards,
@@ -26,7 +26,7 @@ import {
26
26
  } from "../../index-0s4xebbg.js";
27
27
  import {
28
28
  defineRuntimeTool2
29
- } from "../../index-ff3agzaf.js";
29
+ } from "../../index-nk1mh535.js";
30
30
  import {
31
31
  TOOL_ERROR_PROJECTION
32
32
  } from "../../index-556g5hsh.js";
@@ -844,7 +844,7 @@ async function withConnectionToken(params, body) {
844
844
  function zodObjectFromJsonSchema(schema) {
845
845
  if (!schema || Object.keys(schema).length === 0)
846
846
  return z.looseObject({});
847
- const parsed = z.fromJSONSchema(reconcileDefinitionKeyword(schema));
847
+ const parsed = z.fromJSONSchema(reconcileDialect(schema));
848
848
  if (parsed instanceof z.ZodObject) {
849
849
  markJsonSchemaObjectGuards(parsed);
850
850
  markRemoteUnionVerdict(parsed);
@@ -852,8 +852,8 @@ function zodObjectFromJsonSchema(schema) {
852
852
  }
853
853
  return z.looseObject({});
854
854
  }
855
- function reconcileDefinitionKeyword(schema) {
856
- return declaresDraft07(schema.$schema) ? schema : withDefsDialect(schema);
855
+ function reconcileDialect(schema) {
856
+ return declaresDraft07(schema.$schema) ? schema : withDraft2020Keywords(schema);
857
857
  }
858
858
  function sanitizeToolName(value) {
859
859
  return value.replace(/[^a-zA-Z0-9_-]+/g, "_").replace(/^_+|_+$/g, "") || "operation";
@@ -2,12 +2,12 @@ import"../../index-fynr93w4.js";
2
2
  import"../../index-epmnrnth.js";
3
3
  import"../../index-jy9wq8tp.js";
4
4
  import"../../index-ct75c3at.js";
5
- import"../../index-h7accrrv.js";
6
- import"../../index-02h0dfpr.js";
7
- import"../../index-vqdjym30.js";
5
+ import"../../index-jgwqc38k.js";
6
+ import"../../index-z4ga1fa1.js";
7
+ import"../../index-zm1k7hhv.js";
8
8
  import {
9
9
  createToolInvoker2
10
- } from "../../index-jfk93gja.js";
10
+ } from "../../index-4dh3hfs7.js";
11
11
  export {
12
12
  createToolInvoker2 as createToolInvoker
13
13
  };
@@ -2,9 +2,9 @@ import"../../index-ct75c3at.js";
2
2
  import"../../index-fynr93w4.js";
3
3
  import"../../index-epmnrnth.js";
4
4
  import"../../index-jy9wq8tp.js";
5
- import"../../index-h7accrrv.js";
6
- import"../../index-02h0dfpr.js";
7
- import"../../index-vqdjym30.js";
5
+ import"../../index-jgwqc38k.js";
6
+ import"../../index-z4ga1fa1.js";
7
+ import"../../index-zm1k7hhv.js";
8
8
  import {
9
9
  RESOURCE_MIME_TYPE2,
10
10
  EXT_APPS_BUNDLE_PLACEHOLDER2,
@@ -20,9 +20,9 @@ import {
20
20
  createMcpHttpRoute2,
21
21
  createStdioMcpServer2,
22
22
  bindStdioProcessSignals2
23
- } from "../../index-651xsm48.js";
24
- import"../../index-hvg9hctd.js";
25
- import"../../index-ff3agzaf.js";
23
+ } from "../../index-54q2mghq.js";
24
+ import"../../index-eddzs589.js";
25
+ import"../../index-nk1mh535.js";
26
26
  export {
27
27
  EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
28
28
  MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
@@ -21,19 +21,19 @@ import {
21
21
  findNonPortableFormats2,
22
22
  flattenToolJsonSchema2,
23
23
  findUntypedProperties2
24
- } from "../index-h7accrrv.js";
24
+ } from "../index-jgwqc38k.js";
25
25
  import {
26
26
  ToolExecutionControlError2,
27
27
  isToolExecutionControlError2
28
- } from "../index-02h0dfpr.js";
28
+ } from "../index-z4ga1fa1.js";
29
29
  import {
30
30
  collectTools2
31
- } from "../index-vqdjym30.js";
31
+ } from "../index-zm1k7hhv.js";
32
32
  import {
33
33
  mountAgent2,
34
34
  describeToolCatalog2,
35
35
  buildToolManifest2
36
- } from "../index-c7h371gr.js";
36
+ } from "../index-5jjda9a4.js";
37
37
  import"../index-m38ej7e5.js";
38
38
  import {
39
39
  ALL_TRANSPORTS2,
@@ -60,7 +60,7 @@ import {
60
60
  createMcpHttpRoute2,
61
61
  createStdioMcpServer2,
62
62
  bindStdioProcessSignals2
63
- } from "../index-651xsm48.js";
63
+ } from "../index-54q2mghq.js";
64
64
  import {
65
65
  AsyncOperationCancelResultSchema2,
66
66
  createAsyncOperationSnapshotSchema2,
@@ -74,7 +74,7 @@ import {
74
74
  WaitTimeoutError,
75
75
  runWaitOperation,
76
76
  createCli2
77
- } from "../index-bd7spznx.js";
77
+ } from "../index-gpbk7yse.js";
78
78
  import {
79
79
  ManagedFilePathSchema2,
80
80
  ManagedFileRefSchema2
@@ -89,7 +89,7 @@ import {
89
89
  } from "../index-pzw0fpek.js";
90
90
  import {
91
91
  createToolInvoker2
92
- } from "../index-jfk93gja.js";
92
+ } from "../index-4dh3hfs7.js";
93
93
  import {
94
94
  ManagedFileError2
95
95
  } from "../index-2f9r0jgr.js";
@@ -111,14 +111,14 @@ import {
111
111
  } from "../index-yk4g8805.js";
112
112
  import {
113
113
  collectToolSurface
114
- } from "../index-hvg9hctd.js";
114
+ } from "../index-eddzs589.js";
115
115
  import {
116
116
  getTraceId2
117
117
  } from "../index-r6v4mc67.js";
118
118
  import {
119
119
  defineRuntimeTool2,
120
120
  createRuntimeToolFactory2
121
- } from "../index-ff3agzaf.js";
121
+ } from "../index-nk1mh535.js";
122
122
  import {
123
123
  formatZodError2
124
124
  } from "../index-1eeqpadm.js";
@@ -204,17 +204,18 @@ function sendUnloadBeacon(url, body, sender = typeof navigator === "undefined" ?
204
204
  function label(target) {
205
205
  return (target?.textContent ?? "").trim().slice(0, 100) || undefined;
206
206
  }
207
- function sanitizedHref(value, origin) {
207
+ function trackedHref(value, origin, policy) {
208
208
  if (!value)
209
209
  return;
210
210
  try {
211
211
  const url = new URL(value, origin);
212
- return url.origin === origin ? url.pathname : `${url.origin}${url.pathname}`;
212
+ const path = `${url.pathname}${policy === "full" ? url.search + url.hash : ""}`;
213
+ return url.origin === origin ? path : `${url.origin}${path}`;
213
214
  } catch {
214
215
  return;
215
216
  }
216
217
  }
217
- function resolveTrackedClick(target, { origin, attributes = {}, isAction = () => true }) {
218
+ function resolveTrackedClick(target, { origin, attributes = {}, isAction = () => true, hrefPolicy }) {
218
219
  if (!target)
219
220
  return null;
220
221
  const trackAttribute = attributes.track ?? "data-track";
@@ -247,12 +248,15 @@ function resolveTrackedClick(target, { origin, attributes = {}, isAction = () =>
247
248
  result.click = {
248
249
  element,
249
250
  elementText: label(tracked),
250
- href: sanitizedHref(href, origin)
251
+ href: trackedHref(href, origin, hrefPolicy)
251
252
  };
252
253
  }
253
254
  }
254
255
  if (outbound && href) {
255
- result.outbound = { href: sanitizedHref(href, origin) ?? href, label: label(anchor) };
256
+ result.outbound = {
257
+ href: trackedHref(href, origin, hrefPolicy) ?? href,
258
+ label: label(anchor)
259
+ };
256
260
  }
257
261
  return result.interaction || result.click || result.outbound ? result : null;
258
262
  }
@@ -299,7 +303,8 @@ function wireTrackingListeners(deps) {
299
303
  const click = resolveTrackedClick(target, {
300
304
  origin: host.page().origin,
301
305
  attributes: deps.clickAttributes,
302
- isAction: deps.isAction
306
+ isAction: deps.isAction,
307
+ hrefPolicy: deps.hrefPolicy
303
308
  });
304
309
  if (!click)
305
310
  return;
@@ -789,6 +794,7 @@ function createTrackingClient(config) {
789
794
  });
790
795
  },
791
796
  clickAttributes: config.clickAttributes,
797
+ hrefPolicy: config.hrefPolicy,
792
798
  isAction: config.isAction
793
799
  });
794
800
  return () => {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  assertUniqueToolName
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  toolErrorFromResult
6
- } from "./index-02h0dfpr.js";
6
+ } from "./index-z4ga1fa1.js";
7
7
  import {
8
8
  collectTools2,
9
9
  createToolRunner
10
- } from "./index-vqdjym30.js";
10
+ } from "./index-zm1k7hhv.js";
11
11
  import {
12
12
  AppError2
13
13
  } from "./index-j9gxbztg.js";
@@ -8,17 +8,17 @@ import {
8
8
  validateResolvedInputRounds,
9
9
  presentationMetadata,
10
10
  prepareProjectedMcpTools
11
- } from "./index-h7accrrv.js";
11
+ } from "./index-jgwqc38k.js";
12
12
  import {
13
13
  parseToolCallArguments,
14
14
  toolResultFromError,
15
15
  observed
16
- } from "./index-02h0dfpr.js";
16
+ } from "./index-z4ga1fa1.js";
17
17
  import {
18
18
  collectTools2,
19
19
  createToolRunner,
20
20
  formatToolError
21
- } from "./index-vqdjym30.js";
21
+ } from "./index-zm1k7hhv.js";
22
22
  import {
23
23
  DEFAULT_CORS_ALLOW_HEADERS2,
24
24
  DEFAULT_PROCESS_SIGNALS,
@@ -31,7 +31,7 @@ import {
31
31
  } from "./index-e6c2spsd.js";
32
32
  import {
33
33
  collectToolSurface
34
- } from "./index-hvg9hctd.js";
34
+ } from "./index-eddzs589.js";
35
35
  import {
36
36
  runWithRequestContext2,
37
37
  getRequestContext2
@@ -2,21 +2,21 @@ import {
2
2
  toolResultFromError,
3
3
  toolCauseFromResult,
4
4
  isToolExecutionControlError2
5
- } from "./index-02h0dfpr.js";
5
+ } from "./index-z4ga1fa1.js";
6
6
  import {
7
7
  createToolRunner,
8
8
  formatToolError
9
- } from "./index-vqdjym30.js";
9
+ } from "./index-zm1k7hhv.js";
10
10
  import {
11
11
  AgentToolError2,
12
12
  resolveToolDurability
13
13
  } from "./index-56yx8dxp.js";
14
14
  import {
15
15
  collectToolSurface
16
- } from "./index-hvg9hctd.js";
16
+ } from "./index-eddzs589.js";
17
17
  import {
18
18
  agentPresenterOf
19
- } from "./index-ff3agzaf.js";
19
+ } from "./index-nk1mh535.js";
20
20
  import {
21
21
  isRecord
22
22
  } from "./index-9jfdm5tg.js";
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  ToolExecutionControlError2,
16
16
  isToolExecutionControlError2
17
- } from "./index-02h0dfpr.js";
17
+ } from "./index-z4ga1fa1.js";
18
18
  import {
19
19
  agentDurableEventId2
20
20
  } from "./index-mnkk1ffz.js";
@@ -19,7 +19,7 @@ import {
19
19
  appendEventIn,
20
20
  ArchiveProjectionSchema,
21
21
  createAgentRuntimeStore2
22
- } from "./index-38gvr73z.js";
22
+ } from "./index-f2p949ax.js";
23
23
  import {
24
24
  AgentConversationPageSchema2,
25
25
  AgentConversationMessagePageSchema2
@@ -27,7 +27,7 @@ import {
27
27
  } from "./index-j4zh647a.js";
28
28
  import {
29
29
  defineRuntimeTool2
30
- } from "./index-ff3agzaf.js";
30
+ } from "./index-nk1mh535.js";
31
31
  import {
32
32
  AppError2,
33
33
  forbidden2,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  projectToolSurface
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  contractToolMountable
6
- } from "./index-vqdjym30.js";
6
+ } from "./index-zm1k7hhv.js";
7
7
  import {
8
8
  runtimeToolMountable
9
- } from "./index-ff3agzaf.js";
9
+ } from "./index-nk1mh535.js";
10
10
 
11
11
  // src/tools/surface.ts
12
12
  function collectToolSurface({
@@ -4,7 +4,7 @@ import {
4
4
  AgentSandboxRestrictionSchema2,
5
5
  AgentSandboxGradeSchema2,
6
6
  AGENT_CODING_TOOL_NAMES
7
- } from "./index-n0adphfg.js";
7
+ } from "./index-dsxrcseb.js";
8
8
  import {
9
9
  AgentRecordIdSchema2,
10
10
  AgentRecordVersionSchema2,
@@ -14,15 +14,15 @@ import {
14
14
  objectShapeKeys,
15
15
  assertUniqueToolName,
16
16
  buildToolPresentationSchema
17
- } from "./index-h7accrrv.js";
17
+ } from "./index-jgwqc38k.js";
18
18
  import {
19
19
  toolResultFromError,
20
20
  toolErrorFromResult
21
- } from "./index-02h0dfpr.js";
21
+ } from "./index-z4ga1fa1.js";
22
22
  import {
23
23
  createToolRunner,
24
24
  formatToolError
25
- } from "./index-vqdjym30.js";
25
+ } from "./index-zm1k7hhv.js";
26
26
  import {
27
27
  fetchGuarded,
28
28
  readCapped
@@ -35,7 +35,7 @@ import {
35
35
  } from "./index-eemvahkc.js";
36
36
  import {
37
37
  collectToolSurface
38
- } from "./index-hvg9hctd.js";
38
+ } from "./index-eddzs589.js";
39
39
  import {
40
40
  isUnsafeKey,
41
41
  safeJsonParse
@@ -763,6 +763,27 @@ import { z as z2 } from "zod";
763
763
  var DRAFT_07_MARKER = "draft-07";
764
764
  var DRAFT_07_KEYWORD = "definitions";
765
765
  var DEFS_KEYWORD = "$defs";
766
+ var SCHEMA_KEYWORDS = [
767
+ "items",
768
+ "additionalItems",
769
+ "additionalProperties",
770
+ "contains",
771
+ "propertyNames",
772
+ "not",
773
+ "if",
774
+ "then",
775
+ "else",
776
+ "unevaluatedItems",
777
+ "unevaluatedProperties"
778
+ ];
779
+ var SCHEMA_LIST_KEYWORDS = ["allOf", "anyOf", "oneOf", "prefixItems"];
780
+ var SCHEMA_MAP_KEYWORDS = [
781
+ "properties",
782
+ "patternProperties",
783
+ "dependentSchemas",
784
+ DRAFT_07_KEYWORD,
785
+ DEFS_KEYWORD
786
+ ];
766
787
  function declaresDraft07(dialect) {
767
788
  return typeof dialect === "string" && dialect.includes(DRAFT_07_MARKER);
768
789
  }
@@ -777,12 +798,51 @@ function rewriteDefinitionPointers(value) {
777
798
  }
778
799
  return rewritten;
779
800
  }
780
- function withDefsDialect(schema) {
781
- const definitions = schema[DRAFT_07_KEYWORD];
782
- if (!isRecord(definitions) || DEFS_KEYWORD in schema)
801
+ function mapValues(value, rewrite) {
802
+ if (!isRecord(value))
803
+ return value;
804
+ const rewritten = {};
805
+ for (const [name, child] of Object.entries(value))
806
+ rewritten[name] = rewrite(child);
807
+ return rewritten;
808
+ }
809
+ function withPositionalItems(schema) {
810
+ if (!isRecord(schema))
783
811
  return schema;
784
812
  const rewritten = {};
785
- for (const [key, value] of Object.entries(schema)) {
813
+ for (const [key, child] of Object.entries(schema)) {
814
+ if (SCHEMA_KEYWORDS.includes(key))
815
+ rewritten[key] = withPositionalItems(child);
816
+ else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
817
+ rewritten[key] = child.map(withPositionalItems);
818
+ } else if (SCHEMA_MAP_KEYWORDS.includes(key)) {
819
+ rewritten[key] = mapValues(child, withPositionalItems);
820
+ } else
821
+ rewritten[key] = child;
822
+ }
823
+ const { items, additionalItems } = rewritten;
824
+ if (!Array.isArray(items))
825
+ return rewritten;
826
+ const positional = {};
827
+ for (const [key, child] of Object.entries(rewritten)) {
828
+ if (key === "items")
829
+ positional.prefixItems = items;
830
+ else if (key !== "additionalItems")
831
+ positional[key] = child;
832
+ }
833
+ if (additionalItems !== undefined)
834
+ positional.items = additionalItems;
835
+ return positional;
836
+ }
837
+ function withDraft2020Keywords(schema) {
838
+ const positional = withPositionalItems(schema);
839
+ if (!isRecord(positional))
840
+ return schema;
841
+ const definitions = positional[DRAFT_07_KEYWORD];
842
+ if (!isRecord(definitions) || DEFS_KEYWORD in positional)
843
+ return positional;
844
+ const rewritten = {};
845
+ for (const [key, value] of Object.entries(positional)) {
786
846
  if (key === DRAFT_07_KEYWORD)
787
847
  continue;
788
848
  rewritten[key] = rewriteDefinitionPointers(value);
@@ -977,7 +1037,7 @@ function isObjectPresentationSchema(schema) {
977
1037
  return schema.type === "object" && isRecord(schema.properties);
978
1038
  }
979
1039
  function presentationMetadata(schema) {
980
- return withDefsDialect(withoutDialect(schema));
1040
+ return withDraft2020Keywords(withoutDialect(schema));
981
1041
  }
982
1042
 
983
1043
  // src/tools/internal/surface-projector.ts
@@ -1244,4 +1304,4 @@ function prepareProjectedMcpTools(tools, config = {}) {
1244
1304
  return prepared;
1245
1305
  }
1246
1306
 
1247
- export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, declaresDraft07, withDefsDialect, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
1307
+ export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, declaresDraft07, withDraft2020Keywords, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
@@ -17,7 +17,7 @@ import {
17
17
  replaceMessage,
18
18
  ArchiveSpillSchema,
19
19
  createAgentRuntimeStore2
20
- } from "./index-38gvr73z.js";
20
+ } from "./index-f2p949ax.js";
21
21
 
22
22
  // src/agent-runtime/store-memory.ts
23
23
  import { z as z2 } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  projectRuntimeTool
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  isRecord
6
6
  } from "./index-9jfdm5tg.js";
@@ -12,7 +12,7 @@ import {
12
12
  applyToolViewDefaults,
13
13
  projectToolView,
14
14
  objectShapeKeys
15
- } from "./index-h7accrrv.js";
15
+ } from "./index-jgwqc38k.js";
16
16
  import {
17
17
  runWithRequestContext2,
18
18
  getRequestContext2
@@ -3,11 +3,11 @@ import {
3
3
  mergeSchemas,
4
4
  assertToolExtensionCompatible,
5
5
  projectToolSurface
6
- } from "./index-h7accrrv.js";
6
+ } from "./index-jgwqc38k.js";
7
7
  import {
8
8
  toolErrorFromResult,
9
9
  executeToolMethod
10
- } from "./index-02h0dfpr.js";
10
+ } from "./index-z4ga1fa1.js";
11
11
  import {
12
12
  isRetryableStatus2
13
13
  } from "./index-j9gxbztg.js";
@@ -1,17 +1,19 @@
1
1
  /** True when a document says, in its own `$schema`, that it is draft-07. */
2
2
  export declare function declaresDraft07(dialect: unknown): boolean;
3
3
  /**
4
- * Move a document's top-level `definitions` to `$defs`, carrying its pointers.
4
+ * Write a document in the keywords of 2020-12, the dialect an MCP client reads
5
+ * tool schemas in. Two draft-07 keywords mean something else there or nothing:
6
+ * reusable subschemas move from `definitions` to `$defs` with their pointers,
7
+ * and a tuple's `items` list becomes `prefixItems`.
5
8
  *
6
- * A JSON Schema document that names one dialect and uses another's keyword is
7
- * not a style question: a reader registers reusable subschemas from the keyword
8
- * the dialect declares and then cannot resolve `#/definitions/x` at all. Both
9
- * halves of this framework met that document — the MCP SDK stamps 2020-12 onto
10
- * the metadata it is handed, and our own MCP client obeyed the stamp.
9
+ * A document that names one dialect and uses another's keyword is not a style
10
+ * question: a reader registers subschemas from the keyword its dialect declares
11
+ * and cannot resolve `#/definitions/x`, and a reader that validates the schema
12
+ * itself refuses an `items` list and drops the whole tool.
11
13
  *
12
- * Only the top level moves. A `definitions` deeper in the document may be a
13
- * property literally called "definitions", and guessing which is worse than
14
- * leaving it where the author put it.
14
+ * Only the top-level `definitions` moves. A `definitions` deeper in the
15
+ * document may be a property literally called "definitions", and guessing which
16
+ * is worse than leaving it where the author put it.
15
17
  */
16
- export declare function withDefsDialect(schema: Record<string, unknown>): Record<string, unknown>;
18
+ export declare function withDraft2020Keywords(schema: Record<string, unknown>): Record<string, unknown>;
17
19
  //# sourceMappingURL=dialect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialect.d.ts","sourceRoot":"","sources":["../../src/json-schema/dialect.ts"],"names":[],"mappings":"AAQA,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAeD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUxF"}
1
+ {"version":3,"file":"dialect.d.ts","sourceRoot":"","sources":["../../src/json-schema/dialect.ts"],"names":[],"mappings":"AAiCA,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAmDD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB"}
@@ -16,9 +16,10 @@ export declare function isObjectPresentationSchema(schema: ToolPresentationSchem
16
16
  * Metadata passed to the Zod identity carrier.
17
17
  *
18
18
  * The SDK supplies its own dialect and it is 2020-12, so the document has to
19
- * speak 2020-12: a draft-07 `definitions` block under a 2020-12 `$schema` is a
20
- * document that says one thing and does another, and a client that believes the
21
- * stamp cannot resolve a single `#/definitions/...` pointer in it.
19
+ * speak 2020-12: draft-07 `definitions` under a 2020-12 `$schema` leave every
20
+ * `#/definitions/...` pointer unresolvable, and a tuple's draft-07 `items` list
21
+ * is not a schema there, so a client that validates tool schemas drops the tool.
22
+ * → ADR 0185, ADR 0268.
22
23
  */
23
24
  export declare function presentationMetadata(schema: ToolPresentationSchema): ToolPresentationSchema;
24
25
  //# sourceMappingURL=presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AA+KD,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAkDxB;AAoCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE3F"}
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AA+KD,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAkDxB;AAoCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAElF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE3F"}
@@ -24,6 +24,8 @@ export interface ResolveTrackedClickOptions {
24
24
  attributes?: TrackedClickAttributes;
25
25
  /** Whether an action name is one the application knows. Default: any. */
26
26
  isAction?: (action: string) => boolean;
27
+ /** Click URLs omit query/fragment by default. `full` retains both for consumer redaction. */
28
+ hrefPolicy?: 'path-only' | 'full';
27
29
  }
28
30
  export interface TrackedClick {
29
31
  interaction?: {
@@ -42,5 +44,5 @@ export interface TrackedClick {
42
44
  /** The click navigates away — send its facts on the unload path. */
43
45
  leavesPage: boolean;
44
46
  }
45
- export declare function resolveTrackedClick(target: ClickTarget | null, { origin, attributes, isAction }: ResolveTrackedClickOptions): TrackedClick | null;
47
+ export declare function resolveTrackedClick(target: ClickTarget | null, { origin, attributes, isAction, hrefPolicy }: ResolveTrackedClickOptions): TrackedClick | null;
46
48
  //# sourceMappingURL=clicks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clicks.d.ts","sourceRoot":"","sources":["../../src/tracking/clicks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CA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AAW,YAAY;IAC3B,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;CACrB;AAqBD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,EAAE,MAAM,EAAE,UAAe,EAAE,QAAqB,EAAE,UAAU,EAAE,EAAE,0BAA0B,GACzF,YAAY,GAAG,IAAI,CA6CrB"}
@@ -25,6 +25,7 @@ export interface TrackingListenerDeps<TType extends string> {
25
25
  releaseLease(): void;
26
26
  readonly clickAttributes: Parameters<typeof resolveTrackedClick>[1]['attributes'];
27
27
  readonly isAction: Parameters<typeof resolveTrackedClick>[1]['isAction'];
28
+ readonly hrefPolicy: Parameters<typeof resolveTrackedClick>[1]['hrefPolicy'];
28
29
  }
29
30
  export declare function wireTrackingListeners<TType extends string>(deps: TrackingListenerDeps<TType>): Array<() => void>;
30
31
  //# sourceMappingURL=client-listeners.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-listeners.d.ts","sourceRoot":"","sources":["../../src/tracking/client-listeners.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,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G,IAAI,CAAC;IACxC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,WAAW,IAAI,MAAM,CAAC;IACtB,YAAY,IAAI,IAAI,CAAC;IACrB,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAClF,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACzE,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;CAC9E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,EACxD,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAChC,KAAK,CAAC,MAAM,IAAI,CAAC,CAuEnB"}
@@ -12,7 +12,7 @@
12
12
  * session. → ADR 0166.
13
13
  */
14
14
  import type { ReferrerRule, ResolvedAttribution } from './attribution.js';
15
- import type { TrackedClickAttributes } from './clicks.js';
15
+ import type { ResolveTrackedClickOptions, TrackedClickAttributes } from './clicks.js';
16
16
  import type { TrackingHost } from './host.js';
17
17
  import type { TrackingOutbox } from './outbox.js';
18
18
  import type { TrackEventsRequest, TrackEventsResponse, TrackingEventEnvelope, VisitBootstrapResponse, VisitEntryContext } from './schemas.js';
@@ -88,6 +88,8 @@ export interface TrackingClientConfig<TMetadata extends object, TEvent extends T
88
88
  isAction?: (action: string) => boolean;
89
89
  referrerMap?: readonly ReferrerRule[];
90
90
  clickAttributes?: TrackedClickAttributes;
91
+ /** Click URL retention before `decorate`. Default `path-only`; `full` includes query/fragment. */
92
+ hrefPolicy?: ResolveTrackedClickOptions['hrefPolicy'];
91
93
  scrollMilestones?: readonly number[];
92
94
  /** Heartbeat and flush period. Default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AE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACtD;AAED,MAAM,WAAW,cAAc,CAAC,SAAS,SAAS,MAAM;IACtD,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1B,sFAAsF;IACtF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACnD,yEAAyE;IACzE,KAAK,IAAI,MAAM,IAAI,CAAC;IACpB,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,IAAI,MAAM,GAAG,IAAI,CAAC;IACjC,8FAA8F;IAC9F,WAAW,IAAI,mBAAmB,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,KAAK,CAAC,KAAK,SAAS,MAAM,IAAI,IAAI,CAC5C,qBAAqB,CAAC,KAAK,CAAC,EAC5B,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,CAC9D,CAAC;AA0CF,wBAAgB,oBAAoB,CAClC,SAAS,SAAS,MAAM,EACxB,MAAM,SAAS,qBAAqB,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,qBAAqB,CACpF,MAAM,SAAS,GAAG,MAAM,CACzB,EACD,MAAM,EAAE,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAiM5E"}
package/llms/tracking.txt CHANGED
@@ -100,6 +100,24 @@ createTrackingClient<BrowserEvents, TrackingEventEnvelope<keyof BrowserEvents> &
100
100
  })
101
101
  ```
102
102
 
103
+ ### Click URL retention
104
+
105
+ `resolveTrackedClick(target, { origin, hrefPolicy: 'full' })` and
106
+ `createTrackingClient({ …, hrefPolicy: 'full' })` retain the clicked URL's pathname,
107
+ query and fragment. Internal URLs are relative (`/item?offer=one#details`);
108
+ outbound URLs include their origin (`https://other.example/item?offer=one#details`).
109
+ URL credentials are excluded. Omitting the option, or selecting `path-only`,
110
+ keeps the default that omits query and fragment. Navigation classification,
111
+ labels and subscriptions are independent of this policy.
112
+
113
+ Full URLs may contain sensitive values. Supply your application's password and
114
+ secret redactor through `decorate` before enabling `full`: it receives the retained
115
+ `event.metadata.href` and must return the redacted metadata. The returned event is
116
+ what the outbox, synchronous unload and normal delivery receive. The framework
117
+ has no application-specific password policy. This option controls click and
118
+ outbound-click metadata; it does not change attribution, page tracking or interaction
119
+ metadata. Use the same redactor on your other ingestion paths.
120
+
103
121
  A `bootstrap` operation that needs extra fields of its own (a locale, a RUM
104
122
  flag) is not the factory's: build the `entry` schema with
105
123
  `createTrackingSchemas(…).entry.extend({ … })` and declare that endpoint yourself.
@@ -234,7 +252,7 @@ application's — it owns the router and the session. The server half is
234
252
  | Export | Kind | Summary |
235
253
  |--------|------|---------|
236
254
  | `createTrackingClient` | function | the client: visit lease and renewal, pending queue, synchronous identity from reserved sequences, outbox and flush lease, delivery, the string-body page-leave beacon plus a queued copy, visible time, scroll milestones, declarative clicks, heartbeats |
237
- | `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `scrollMilestones`, `batchSize`, periods and limits |
255
+ | `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `hrefPolicy` (`path-only` by default; `full` retains click query/fragment before `decorate`), `scrollMilestones`, `batchSize`, periods and limits |
238
256
  | `TrackFn` / `EventsWithMetadata` / `EventsWithoutMetadata` | _type_ | `track(type)` / `track(type, metadata)` typed by the application's metadata map, and the two halves of that map |
239
257
  | `BuiltinTrackingEventTypes` / `CONVENTIONAL_TRACKING_EVENT_TYPES` | _type_ / const | the application's names for the events the client emits itself; the conventional `PAGE_VIEW` … `INTERACTION` set |
240
258
  | `browserTrackingHost` / `TrackingHost` / `TrackingPageContext` | function / _type_ | everything the client takes from a browser tab behind one interface — page context, visibility, scroll depth, events, intervals, clocks, storage — so a test or a non-tab host can supply its own |
@@ -258,6 +276,6 @@ application's — it owns the router and the session. The server half is
258
276
  | `createOncePerPage` / `OncePerPage` | function / _type_ | one fact per key per page within a window — the guard a twice-mounted component cannot keep itself |
259
277
  | `resolveAttribution` / `ResolveAttributionInput` / `ResolvedAttribution` / `AttributionStorage` / `ReferrerRule` | function / _type_ | first-touch once, current-touch on every new UTM; the referrer → source/medium map is the application's, there is no built-in list |
260
278
  | `parseUtmFromSearch` / `parseReferrer` | function | the two parsers `resolveAttribution` is built from |
261
- | `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `leavesPage` says which path to send on |
279
+ | `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `hrefPolicy: 'full'` retains query/fragment (default `path-only` omits them), URL credentials excluded; `leavesPage` says which path to send on |
262
280
 
263
281
  ---
package/llms-full.txt CHANGED
@@ -511,6 +511,24 @@ createTrackingClient<BrowserEvents, TrackingEventEnvelope<keyof BrowserEvents> &
511
511
  })
512
512
  ```
513
513
 
514
+ ### Click URL retention
515
+
516
+ `resolveTrackedClick(target, { origin, hrefPolicy: 'full' })` and
517
+ `createTrackingClient({ …, hrefPolicy: 'full' })` retain the clicked URL's pathname,
518
+ query and fragment. Internal URLs are relative (`/item?offer=one#details`);
519
+ outbound URLs include their origin (`https://other.example/item?offer=one#details`).
520
+ URL credentials are excluded. Omitting the option, or selecting `path-only`,
521
+ keeps the default that omits query and fragment. Navigation classification,
522
+ labels and subscriptions are independent of this policy.
523
+
524
+ Full URLs may contain sensitive values. Supply your application's password and
525
+ secret redactor through `decorate` before enabling `full`: it receives the retained
526
+ `event.metadata.href` and must return the redacted metadata. The returned event is
527
+ what the outbox, synchronous unload and normal delivery receive. The framework
528
+ has no application-specific password policy. This option controls click and
529
+ outbound-click metadata; it does not change attribution, page tracking or interaction
530
+ metadata. Use the same redactor on your other ingestion paths.
531
+
514
532
  A `bootstrap` operation that needs extra fields of its own (a locale, a RUM
515
533
  flag) is not the factory's: build the `entry` schema with
516
534
  `createTrackingSchemas(…).entry.extend({ … })` and declare that endpoint yourself.
@@ -23280,7 +23298,7 @@ application's — it owns the router and the session. The server half is
23280
23298
  | Export | Kind | Summary |
23281
23299
  |--------|------|---------|
23282
23300
  | `createTrackingClient` | function | the client: visit lease and renewal, pending queue, synchronous identity from reserved sequences, outbox and flush lease, delivery, the string-body page-leave beacon plus a queued copy, visible time, scroll milestones, declarative clicks, heartbeats |
23283
- | `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `scrollMilestones`, `batchSize`, periods and limits |
23301
+ | `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `hrefPolicy` (`path-only` by default; `full` retains click query/fragment before `decorate`), `scrollMilestones`, `batchSize`, periods and limits |
23284
23302
  | `TrackFn` / `EventsWithMetadata` / `EventsWithoutMetadata` | _type_ | `track(type)` / `track(type, metadata)` typed by the application's metadata map, and the two halves of that map |
23285
23303
  | `BuiltinTrackingEventTypes` / `CONVENTIONAL_TRACKING_EVENT_TYPES` | _type_ / const | the application's names for the events the client emits itself; the conventional `PAGE_VIEW` … `INTERACTION` set |
23286
23304
  | `browserTrackingHost` / `TrackingHost` / `TrackingPageContext` | function / _type_ | everything the client takes from a browser tab behind one interface — page context, visibility, scroll depth, events, intervals, clocks, storage — so a test or a non-tab host can supply its own |
@@ -23304,7 +23322,7 @@ application's — it owns the router and the session. The server half is
23304
23322
  | `createOncePerPage` / `OncePerPage` | function / _type_ | one fact per key per page within a window — the guard a twice-mounted component cannot keep itself |
23305
23323
  | `resolveAttribution` / `ResolveAttributionInput` / `ResolvedAttribution` / `AttributionStorage` / `ReferrerRule` | function / _type_ | first-touch once, current-touch on every new UTM; the referrer → source/medium map is the application's, there is no built-in list |
23306
23324
  | `parseUtmFromSearch` / `parseReferrer` | function | the two parsers `resolveAttribution` is built from |
23307
- | `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `leavesPage` says which path to send on |
23325
+ | `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `hrefPolicy: 'full'` retains query/fragment (default `path-only` omits them), URL credentials excluded; `leavesPage` says which path to send on |
23308
23326
 
23309
23327
  ---
23310
23328
 
package/llms.txt CHANGED
@@ -45,7 +45,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
45
45
  - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 36.6 KB
46
46
  - **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
47
47
  - **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
48
- - **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 16.8 KB
48
+ - **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 18.1 KB
49
49
  - **stitchkit/release**: [llms/release.txt](llms/release.txt) 8.9 KB
50
50
  - **stitchkit/tracking/server**: [llms/tracking-server.txt](llms/tracking-server.txt) 2.5 KB
51
51
  - **stitchkit/geo**: [llms/geo.txt](llms/geo.txt) 4.1 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.112.1",
3
+ "version": "0.112.3",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",
@@ -378,6 +378,7 @@
378
378
  "@types/react-dom": "^19.3.0",
379
379
  "@typescript/typescript6": "^6.0.2",
380
380
  "ai": "^7.0.111",
381
+ "ajv": "^8.20.0",
381
382
  "fake-indexeddb": "^6.2.5",
382
383
  "google-auth-library": "^11.1.0",
383
384
  "grammy": "^1.46.0",