@glasstrace/sdk 1.11.0 → 1.13.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/README.md +58 -6
- package/dist/async-context/index.cjs +1189 -440
- package/dist/async-context/index.cjs.map +1 -1
- package/dist/async-context/index.js +2 -2
- package/dist/{capture-error-BeuEXXJO.d.cts → capture-error-03qDnC5v.d.cts} +2 -2
- package/dist/{capture-error-D02pzB7q.d.ts → capture-error-CAfFUyIU.d.ts} +2 -2
- package/dist/{chunk-XG6WR2KS.js → chunk-6ST4QV7T.js} +3 -3
- package/dist/{chunk-6RKS3DNA.js → chunk-7LE2O4ZJ.js} +1153 -396
- package/dist/chunk-7LE2O4ZJ.js.map +1 -0
- package/dist/{chunk-RL43PU2X.js → chunk-F7A3QXCT.js} +2 -2
- package/dist/{chunk-M5GO2SSO.js → chunk-HMEHYSTS.js} +2 -2
- package/dist/{chunk-OXM2BZMF.js → chunk-LQZRGBN5.js} +2 -2
- package/dist/{chunk-QVTONMVZ.js → chunk-MP3QNDXQ.js} +2 -2
- package/dist/{chunk-D54FMQHF.js → chunk-VMK2G6QR.js} +2 -2
- package/dist/{chunk-DQFGNX3H.js → chunk-VWZMG3W2.js} +21 -20
- package/dist/chunk-VWZMG3W2.js.map +1 -0
- package/dist/{chunk-BSVWJSVX.js → chunk-XMD5OYD6.js} +2 -2
- package/dist/{chunk-FQ4SEG6Y.js → chunk-ZIYT2Y4B.js} +3 -3
- package/dist/cli/init.cjs +1266 -497
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +7 -7
- package/dist/cli/mcp-add.cjs +1171 -425
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +3 -3
- package/dist/cli/uninit.js +3 -3
- package/dist/cli/upgrade-instructions.cjs +1 -1
- package/dist/cli/upgrade-instructions.js +3 -3
- package/dist/cli/validate.cjs +1168 -422
- package/dist/cli/validate.cjs.map +1 -1
- package/dist/cli/validate.js +2 -2
- package/dist/{correlation-id-NAapJ5jn.d.cts → correlation-id-CZ2bstzA.d.cts} +1 -1
- package/dist/{correlation-id-B_K8adD6.d.ts → correlation-id-YcfcqOru.d.ts} +1 -1
- package/dist/edge-entry.cjs +1197 -448
- package/dist/edge-entry.cjs.map +1 -1
- package/dist/edge-entry.d.cts +2 -2
- package/dist/edge-entry.d.ts +2 -2
- package/dist/edge-entry.js +4 -4
- package/dist/index.cjs +1352 -555
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-CkTf_boH.d.ts → index.d-BQIJ5Dvc.d.cts} +44 -9
- package/dist/{index.d-CkTf_boH.d.cts → index.d-BQIJ5Dvc.d.ts} +44 -9
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +26 -14
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.cjs +1192 -443
- package/dist/middleware/index.cjs.map +1 -1
- package/dist/middleware/index.js +2 -2
- package/dist/node-entry.cjs +1323 -550
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.d.cts +3 -3
- package/dist/node-entry.d.ts +3 -3
- package/dist/node-entry.js +7 -7
- package/dist/node-subpath.cjs +1168 -422
- package/dist/node-subpath.cjs.map +1 -1
- package/dist/node-subpath.d.cts +1 -1
- package/dist/node-subpath.d.ts +1 -1
- package/dist/node-subpath.js +3 -3
- package/dist/{source-map-uploader-CLYCE2TZ.js → source-map-uploader-NUONOEJG.js} +3 -3
- package/dist/trpc/index.cjs +1187 -438
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-6RKS3DNA.js.map +0 -1
- package/dist/chunk-DQFGNX3H.js.map +0 -1
- /package/dist/{chunk-XG6WR2KS.js.map → chunk-6ST4QV7T.js.map} +0 -0
- /package/dist/{chunk-RL43PU2X.js.map → chunk-F7A3QXCT.js.map} +0 -0
- /package/dist/{chunk-M5GO2SSO.js.map → chunk-HMEHYSTS.js.map} +0 -0
- /package/dist/{chunk-OXM2BZMF.js.map → chunk-LQZRGBN5.js.map} +0 -0
- /package/dist/{chunk-QVTONMVZ.js.map → chunk-MP3QNDXQ.js.map} +0 -0
- /package/dist/{chunk-D54FMQHF.js.map → chunk-VMK2G6QR.js.map} +0 -0
- /package/dist/{chunk-BSVWJSVX.js.map → chunk-XMD5OYD6.js.map} +0 -0
- /package/dist/{chunk-FQ4SEG6Y.js.map → chunk-ZIYT2Y4B.js.map} +0 -0
- /package/dist/{source-map-uploader-CLYCE2TZ.js.map → source-map-uploader-NUONOEJG.js.map} +0 -0
package/README.md
CHANGED
|
@@ -522,13 +522,55 @@ flag.
|
|
|
522
522
|
What the SDK captures: a compact, normalized operation label, the
|
|
523
523
|
operation kind (`email`, `calendar_link`, `webhook`, `external_api`,
|
|
524
524
|
`queue`, `after_callback`), an optional lifecycle status
|
|
525
|
-
(`scheduled`, `started`, `succeeded`, `failed`, `unknown`), an
|
|
525
|
+
(`scheduled`, `started`, `succeeded`, `failed`, `unknown`), and an
|
|
526
526
|
optional execution phase (`request`, `post_response`, `background`,
|
|
527
|
-
`unknown`)
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
527
|
+
`unknown`). Per-span operation budget is five.
|
|
528
|
+
|
|
529
|
+
Semantic fields are admitted by **named-pattern admission**: a
|
|
530
|
+
stable-core literal set plus an open suffix family. Both halves are
|
|
531
|
+
valid; specialized validators on stable-core keys win over the
|
|
532
|
+
default suffix routing.
|
|
533
|
+
|
|
534
|
+
**Stable core** (7 keys, specialized validators): `templateKey`,
|
|
535
|
+
`providerOperation`, `role`, `locale`, `timezone`, `status`, `phase`.
|
|
536
|
+
Values are bounded to identifier-shaped compact tokens, with
|
|
537
|
+
specialized BCP-47 validation for `locale` and IANA validation for
|
|
538
|
+
`timezone`.
|
|
539
|
+
|
|
540
|
+
**Open pattern** (4 canonical suffixes): keys matching
|
|
541
|
+
`^[a-z][A-Za-z0-9]*(Class|Count|Kind|Role)$` are admitted alongside
|
|
542
|
+
the stable core. Value shapes are suffix-routed:
|
|
543
|
+
|
|
544
|
+
| Suffix | Value shape | Max length | Casing convention | Examples |
|
|
545
|
+
|---|---|---|---|---|
|
|
546
|
+
| `*Class` | identifier-shaped compact token | 80 | lowercase-kebab | `recipientClass=removed-participant`, `attachmentClass=no-timezone-ics` |
|
|
547
|
+
| `*Count` | non-negative integer string | 16 | digits only (no `-`, `.`, or letters) | `participantCount="2"`, `attemptCount="3"` |
|
|
548
|
+
| `*Kind` | identifier-shaped compact token | 80 | lowerCamel or `UPPERCASE-CONST` | `notificationKind=transactional` |
|
|
549
|
+
| `*Role` | identifier-shaped compact token | 80 | lowercase-kebab | `actorRole=operator` |
|
|
550
|
+
|
|
551
|
+
Value casing is preserved verbatim; normalize at the call site so
|
|
552
|
+
cross-trace comparisons collapse to the same identity. Non-digit
|
|
553
|
+
`*Count` values (`"many"`, `"1.5"`, `"-1"`) are rejected and counted
|
|
554
|
+
under the `raw_payload` omission reason. Keys that don't match the
|
|
555
|
+
pattern (snake_case, uppercase lead, no canonical suffix) are
|
|
556
|
+
rejected and counted under `unsupported_key`.
|
|
557
|
+
|
|
558
|
+
Forbidden values, regardless of suffix: identifiers (UUIDs,
|
|
559
|
+
account/request/message IDs), bearer tokens, API keys, secrets,
|
|
560
|
+
hashes, version strings, raw payloads, recipient PII (emails, names,
|
|
561
|
+
phone numbers), URLs, and free-form prose. The compact-token regex
|
|
562
|
+
admits these shapes syntactically; the SDK's privacy filter
|
|
563
|
+
(`detectUnsafePattern`) rejects email-shaped and bearer-shaped
|
|
564
|
+
values at the runtime layer, but semantic violations (a UUID-shaped
|
|
565
|
+
value passing the unsafe-pattern check) are the caller's
|
|
566
|
+
responsibility to avoid. Coerce sensitive shapes to a normalized
|
|
567
|
+
`*Class` vocabulary instead (e.g., `payloadClass=non-empty` rather
|
|
568
|
+
than `payloadHash=abc123`).
|
|
569
|
+
|
|
570
|
+
For compile-time autocomplete on the stable-core subset, import the
|
|
571
|
+
narrower type `SideEffectSemanticFieldStableCoreKey`. For runtime
|
|
572
|
+
validation of producer-supplied key names, use the exported guard
|
|
573
|
+
`isSideEffectSemanticFieldKey(key: string): boolean`.
|
|
532
574
|
|
|
533
575
|
What the SDK does not capture: recipient email addresses, sender or
|
|
534
576
|
recipient names, rendered email subjects or bodies, calendar links,
|
|
@@ -560,10 +602,20 @@ recordSideEffect({
|
|
|
560
602
|
status: "succeeded",
|
|
561
603
|
phase: "request",
|
|
562
604
|
fields: {
|
|
605
|
+
// Stable core
|
|
563
606
|
templateKey: "EventCanceledEmail",
|
|
564
607
|
role: "invitee",
|
|
565
608
|
locale: "en-US",
|
|
566
609
|
timezone: "Europe/Paris",
|
|
610
|
+
// Pattern: *Class
|
|
611
|
+
recipientClass: "removed-participant",
|
|
612
|
+
// Pattern: *Count (non-negative integer string)
|
|
613
|
+
participantCount: "2",
|
|
614
|
+
activeParticipantCount: "1",
|
|
615
|
+
// Pattern: *Kind
|
|
616
|
+
notificationKind: "transactional",
|
|
617
|
+
// Pattern: *Role
|
|
618
|
+
actorRole: "system-bot",
|
|
567
619
|
},
|
|
568
620
|
});
|
|
569
621
|
```
|