@glasstrace/sdk 1.12.0 → 1.14.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 +55 -20
- package/dist/async-context/index.cjs.map +1 -1
- package/dist/async-context/index.js +2 -2
- package/dist/{capture-error-CRQSqKgd.d.cts → capture-error-03qDnC5v.d.cts} +2 -2
- package/dist/{capture-error-CqCbjoMq.d.ts → capture-error-CAfFUyIU.d.ts} +2 -2
- package/dist/{chunk-6NKMAKMI.js → chunk-6ST4QV7T.js} +3 -3
- package/dist/{chunk-BN5DVIUO.js → chunk-7LE2O4ZJ.js} +12 -7
- package/dist/{chunk-BN5DVIUO.js.map → chunk-7LE2O4ZJ.js.map} +1 -1
- package/dist/{chunk-CZQN6G4I.js → chunk-E2F4S5IJ.js} +362 -11
- package/dist/chunk-E2F4S5IJ.js.map +1 -0
- package/dist/{chunk-J3ZCVE67.js → chunk-F7A3QXCT.js} +2 -2
- package/dist/{chunk-M3ZTG4P5.js → chunk-HMEHYSTS.js} +2 -2
- package/dist/{chunk-4YRYR32D.js → chunk-LQZRGBN5.js} +2 -2
- package/dist/{chunk-ZIL2IY4C.js → chunk-MP3QNDXQ.js} +2 -2
- package/dist/{chunk-FFNGE5RR.js → chunk-VMK2G6QR.js} +2 -2
- package/dist/{chunk-KBHGPQZ2.js → chunk-XMD5OYD6.js} +2 -2
- package/dist/{chunk-V75ZB4G4.js → chunk-ZIYT2Y4B.js} +3 -3
- package/dist/cli/init.cjs +4 -4
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +7 -7
- package/dist/cli/mcp-add.cjs +1 -1
- 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.map +1 -1
- package/dist/cli/validate.js +2 -2
- package/dist/{correlation-id-CFpyJsKv.d.cts → correlation-id-CZ2bstzA.d.cts} +1 -1
- package/dist/{correlation-id-DPXyY9-3.d.ts → correlation-id-YcfcqOru.d.ts} +1 -1
- 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 +1033 -960
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-D-jdiIPU.d.cts → index.d-BQIJ5Dvc.d.cts} +44 -9
- package/dist/{index.d-D-jdiIPU.d.ts → 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 +10 -297
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.cjs.map +1 -1
- package/dist/middleware/index.js +2 -2
- package/dist/node-entry.cjs +12 -5
- 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.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-K67LTPBG.js → source-map-uploader-NUONOEJG.js} +3 -3
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CZQN6G4I.js.map +0 -1
- /package/dist/{chunk-6NKMAKMI.js.map → chunk-6ST4QV7T.js.map} +0 -0
- /package/dist/{chunk-J3ZCVE67.js.map → chunk-F7A3QXCT.js.map} +0 -0
- /package/dist/{chunk-M3ZTG4P5.js.map → chunk-HMEHYSTS.js.map} +0 -0
- /package/dist/{chunk-4YRYR32D.js.map → chunk-LQZRGBN5.js.map} +0 -0
- /package/dist/{chunk-ZIL2IY4C.js.map → chunk-MP3QNDXQ.js.map} +0 -0
- /package/dist/{chunk-FFNGE5RR.js.map → chunk-VMK2G6QR.js.map} +0 -0
- /package/dist/{chunk-KBHGPQZ2.js.map → chunk-XMD5OYD6.js.map} +0 -0
- /package/dist/{chunk-V75ZB4G4.js.map → chunk-ZIYT2Y4B.js.map} +0 -0
- /package/dist/{source-map-uploader-K67LTPBG.js.map → source-map-uploader-NUONOEJG.js.map} +0 -0
package/README.md
CHANGED
|
@@ -522,27 +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
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
`
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
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`.
|
|
546
574
|
|
|
547
575
|
What the SDK does not capture: recipient email addresses, sender or
|
|
548
576
|
recipient names, rendered email subjects or bodies, calendar links,
|
|
@@ -574,13 +602,20 @@ recordSideEffect({
|
|
|
574
602
|
status: "succeeded",
|
|
575
603
|
phase: "request",
|
|
576
604
|
fields: {
|
|
605
|
+
// Stable core
|
|
577
606
|
templateKey: "EventCanceledEmail",
|
|
578
607
|
role: "invitee",
|
|
579
608
|
locale: "en-US",
|
|
580
609
|
timezone: "Europe/Paris",
|
|
610
|
+
// Pattern: *Class
|
|
581
611
|
recipientClass: "removed-participant",
|
|
612
|
+
// Pattern: *Count (non-negative integer string)
|
|
582
613
|
participantCount: "2",
|
|
583
614
|
activeParticipantCount: "1",
|
|
615
|
+
// Pattern: *Kind
|
|
616
|
+
notificationKind: "transactional",
|
|
617
|
+
// Pattern: *Role
|
|
618
|
+
actorRole: "system-bot",
|
|
584
619
|
},
|
|
585
620
|
});
|
|
586
621
|
```
|