@glasstrace/sdk 1.10.2 → 1.12.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.
Files changed (91) hide show
  1. package/README.md +63 -8
  2. package/dist/async-context/index.cjs +1189 -440
  3. package/dist/async-context/index.cjs.map +1 -1
  4. package/dist/async-context/index.js +2 -2
  5. package/dist/{capture-error-BeuEXXJO.d.cts → capture-error-CRQSqKgd.d.cts} +2 -2
  6. package/dist/{capture-error-D02pzB7q.d.ts → capture-error-CqCbjoMq.d.ts} +2 -2
  7. package/dist/{chunk-OXM2BZMF.js → chunk-4YRYR32D.js} +2 -2
  8. package/dist/{chunk-XG6WR2KS.js → chunk-6NKMAKMI.js} +3 -3
  9. package/dist/{chunk-6RKS3DNA.js → chunk-BN5DVIUO.js} +1176 -424
  10. package/dist/chunk-BN5DVIUO.js.map +1 -0
  11. package/dist/{chunk-QS5RZ2TC.js → chunk-CZQN6G4I.js} +28 -22
  12. package/dist/chunk-CZQN6G4I.js.map +1 -0
  13. package/dist/{chunk-D54FMQHF.js → chunk-FFNGE5RR.js} +2 -2
  14. package/dist/{chunk-RL43PU2X.js → chunk-J3ZCVE67.js} +2 -2
  15. package/dist/{chunk-BSVWJSVX.js → chunk-KBHGPQZ2.js} +2 -2
  16. package/dist/{chunk-CIKPFJOM.js → chunk-KOYZJN6G.js} +310 -20
  17. package/dist/chunk-KOYZJN6G.js.map +1 -0
  18. package/dist/{chunk-M5GO2SSO.js → chunk-M3ZTG4P5.js} +2 -2
  19. package/dist/{chunk-UMGZJYC4.js → chunk-V75ZB4G4.js} +10 -5
  20. package/dist/chunk-V75ZB4G4.js.map +1 -0
  21. package/dist/{chunk-ZBQQXVHD.js → chunk-YIEXKQYP.js} +2 -67
  22. package/dist/chunk-YIEXKQYP.js.map +1 -0
  23. package/dist/{chunk-QVTONMVZ.js → chunk-ZIL2IY4C.js} +2 -2
  24. package/dist/cli/init.cjs +1672 -576
  25. package/dist/cli/init.cjs.map +1 -1
  26. package/dist/cli/init.js +33 -20
  27. package/dist/cli/init.js.map +1 -1
  28. package/dist/cli/mcp-add.cjs +1509 -521
  29. package/dist/cli/mcp-add.cjs.map +1 -1
  30. package/dist/cli/mcp-add.js +34 -16
  31. package/dist/cli/mcp-add.js.map +1 -1
  32. package/dist/cli/status.cjs +6 -1
  33. package/dist/cli/status.cjs.map +1 -1
  34. package/dist/cli/status.js +7 -2
  35. package/dist/cli/status.js.map +1 -1
  36. package/dist/cli/uninit.cjs +6 -1
  37. package/dist/cli/uninit.cjs.map +1 -1
  38. package/dist/cli/uninit.js +4 -4
  39. package/dist/cli/upgrade-instructions.cjs +383 -112
  40. package/dist/cli/upgrade-instructions.cjs.map +1 -1
  41. package/dist/cli/upgrade-instructions.js +72 -20
  42. package/dist/cli/upgrade-instructions.js.map +1 -1
  43. package/dist/cli/validate.cjs +1168 -422
  44. package/dist/cli/validate.cjs.map +1 -1
  45. package/dist/cli/validate.js +2 -2
  46. package/dist/{correlation-id-NAapJ5jn.d.cts → correlation-id-CFpyJsKv.d.cts} +1 -1
  47. package/dist/{correlation-id-B_K8adD6.d.ts → correlation-id-DPXyY9-3.d.ts} +1 -1
  48. package/dist/edge-entry.cjs +1197 -448
  49. package/dist/edge-entry.cjs.map +1 -1
  50. package/dist/edge-entry.d.cts +2 -2
  51. package/dist/edge-entry.d.ts +2 -2
  52. package/dist/edge-entry.js +4 -4
  53. package/dist/index.cjs +1341 -553
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/{index.d-CkTf_boH.d.cts → index.d-D-jdiIPU.d.cts} +1 -1
  56. package/dist/{index.d-CkTf_boH.d.ts → index.d-D-jdiIPU.d.ts} +1 -1
  57. package/dist/index.d.cts +4 -4
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +14 -7
  60. package/dist/index.js.map +1 -1
  61. package/dist/middleware/index.cjs +1192 -443
  62. package/dist/middleware/index.cjs.map +1 -1
  63. package/dist/middleware/index.js +2 -2
  64. package/dist/node-entry.cjs +1329 -551
  65. package/dist/node-entry.cjs.map +1 -1
  66. package/dist/node-entry.d.cts +3 -3
  67. package/dist/node-entry.d.ts +3 -3
  68. package/dist/node-entry.js +8 -8
  69. package/dist/node-subpath.cjs +1168 -422
  70. package/dist/node-subpath.cjs.map +1 -1
  71. package/dist/node-subpath.d.cts +1 -1
  72. package/dist/node-subpath.d.ts +1 -1
  73. package/dist/node-subpath.js +3 -3
  74. package/dist/{source-map-uploader-CLYCE2TZ.js → source-map-uploader-K67LTPBG.js} +3 -3
  75. package/dist/trpc/index.cjs +1187 -438
  76. package/dist/trpc/index.cjs.map +1 -1
  77. package/dist/trpc/index.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/chunk-6RKS3DNA.js.map +0 -1
  80. package/dist/chunk-CIKPFJOM.js.map +0 -1
  81. package/dist/chunk-QS5RZ2TC.js.map +0 -1
  82. package/dist/chunk-UMGZJYC4.js.map +0 -1
  83. package/dist/chunk-ZBQQXVHD.js.map +0 -1
  84. /package/dist/{chunk-OXM2BZMF.js.map → chunk-4YRYR32D.js.map} +0 -0
  85. /package/dist/{chunk-XG6WR2KS.js.map → chunk-6NKMAKMI.js.map} +0 -0
  86. /package/dist/{chunk-D54FMQHF.js.map → chunk-FFNGE5RR.js.map} +0 -0
  87. /package/dist/{chunk-RL43PU2X.js.map → chunk-J3ZCVE67.js.map} +0 -0
  88. /package/dist/{chunk-BSVWJSVX.js.map → chunk-KBHGPQZ2.js.map} +0 -0
  89. /package/dist/{chunk-M5GO2SSO.js.map → chunk-M3ZTG4P5.js.map} +0 -0
  90. /package/dist/{chunk-QVTONMVZ.js.map → chunk-ZIL2IY4C.js.map} +0 -0
  91. /package/dist/{source-map-uploader-CLYCE2TZ.js.map → source-map-uploader-K67LTPBG.js.map} +0 -0
package/README.md CHANGED
@@ -113,11 +113,49 @@ including composite invocations like `glasstrace init --yes --help`
113
113
  ## Refreshing agent instruction guidance
114
114
 
115
115
  `glasstrace init` and `glasstrace mcp add` write a managed Glasstrace
116
- MCP section into your project's agent instruction file (CLAUDE.md /
117
- codex.md / .cursorrules). The section opens with a cost-aware
118
- cross-tool decision paragraph telling your AI agent **when** Glasstrace
119
- MCP is worth calling and **which** tool is the cheapest first call for
120
- each symptom class.
116
+ MCP section into your project's agent instruction file(s). Per the
117
+ 2026 cross-tool standard governed by the Agentic AI Foundation under
118
+ the Linux Foundation (`agents.md`), the SDK writes:
119
+
120
+ - **`AGENTS.md`** — universal cross-tool destination. Read by Cursor,
121
+ Codex, Claude Code, GitHub Copilot, Devin, Windsurf, and Gemini CLI.
122
+ Always written.
123
+ - **`CLAUDE.md`** — Claude Code primary canonical destination.
124
+ - **`GEMINI.md`** — Gemini CLI primary canonical destination (default
125
+ `context.fileName`).
126
+ - **`.cursor/rules/glasstrace.mdc`** — Cursor canonical 2026
127
+ destination (Markdown-extension format with YAML frontmatter
128
+ `alwaysApply: true`); plus `.cursorrules` written unconditionally
129
+ as a transitional fallback for migration teams on mixed Cursor
130
+ versions.
131
+ - **`.windsurf/rules/glasstrace.md`** — Windsurf workspace-rules
132
+ directory (active first-class format per Windsurf's docs at
133
+ `windsurf.com/university`).
134
+
135
+ The section opens with explicit "Call Glasstrace FIRST when" / "SKIP
136
+ Glasstrace when" decision rules telling your AI agent **when**
137
+ Glasstrace MCP is worth calling and **which** tool is the cheapest
138
+ first call for each symptom class.
139
+
140
+ ### Migration from legacy filenames
141
+
142
+ If you installed `@glasstrace/sdk` before v1.11 (Wave 18 / DISC-1782),
143
+ your project may have a managed Glasstrace block in legacy
144
+ destinations the SDK no longer writes to as primary:
145
+
146
+ - `codex.md` (Codex now reads `AGENTS.md` by default)
147
+ - `.windsurfrules` (Windsurf moved to `.windsurf/rules/*.md`)
148
+
149
+ Run `npx glasstrace upgrade-instructions` to migrate: the managed
150
+ section is created at the new canonical destination(s). The legacy
151
+ files are left untouched (their managed sections become stale but
152
+ your free-text content is preserved); copy any custom prose from the
153
+ legacy file to `AGENTS.md` to keep your agent's visibility into it.
154
+
155
+ If you need to roll back to a pre-v1.11 SDK, pin to `~1.10.0` in
156
+ `package.json`; the older SDK does not recognize `AGENTS.md` /
157
+ `GEMINI.md` / `.cursor/rules/` as agent-instruction targets so its
158
+ stale-section warning will not see them.
121
159
 
122
160
  The managed section's start marker carries an SDK version stamp, e.g.
123
161
  `<!-- glasstrace:mcp:start v=1.5.0 -->`. When you upgrade
@@ -488,9 +526,23 @@ operation kind (`email`, `calendar_link`, `webhook`, `external_api`,
488
526
  optional execution phase (`request`, `post_response`, `background`,
489
527
  `unknown`), and a small set of allowlisted semantic fields:
490
528
  `templateKey`, `providerOperation`, `role`, `locale`, `timezone`,
491
- `status`, `phase`. Each value is bounded to compact tokens — IANA
492
- timezones, BCP-47 locales, identifier-shaped enum tokens. The
493
- per-trace operation budget is five.
529
+ `status`, `phase`, `recipientClass`, `participantCount`,
530
+ `activeParticipantCount`. Each value is bounded to compact tokens
531
+ IANA timezones, BCP-47 locales, identifier-shaped enum tokens, or
532
+ non-negative integer strings for the count fields. The per-span
533
+ operation budget is five.
534
+
535
+ `recipientClass`, `participantCount`, and `activeParticipantCount`
536
+ let you record concise causal evidence about which recipient class
537
+ was targeted and how many domain entities were included. The two
538
+ count fields validate strictly as non-negative integer strings —
539
+ `"0"`, `"1"`, `"12"` are accepted; `"-1"`, `"1.5"`, `"many"`, or
540
+ any value with a non-digit character is rejected and counted under
541
+ the `raw_payload` omission reason. `recipientClass` uses the
542
+ identifier-shaped compact-token validator and preserves case
543
+ verbatim, so normalize labels at the call site —
544
+ `recipientClass="removed-participant"` (lowercase-kebab) is the
545
+ recommended convention.
494
546
 
495
547
  What the SDK does not capture: recipient email addresses, sender or
496
548
  recipient names, rendered email subjects or bodies, calendar links,
@@ -526,6 +578,9 @@ recordSideEffect({
526
578
  role: "invitee",
527
579
  locale: "en-US",
528
580
  timezone: "Europe/Paris",
581
+ recipientClass: "removed-participant",
582
+ participantCount: "2",
583
+ activeParticipantCount: "1",
529
584
  },
530
585
  });
531
586
  ```