@glasstrace/sdk 1.3.8 → 1.4.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 +68 -0
- package/dist/capture-error-BmQz7xF6.d.cts +455 -0
- package/dist/capture-error-CTgSYxek.d.ts +455 -0
- package/dist/{chunk-XS5W3SPL.js → chunk-4WI7B5FQ.js} +91 -5
- package/dist/chunk-4WI7B5FQ.js.map +1 -0
- package/dist/{chunk-NKRD3MKG.js → chunk-JZ475QRH.js} +2 -1
- package/dist/chunk-JZ475QRH.js.map +1 -0
- package/dist/{chunk-GYTCZSAV.js → chunk-MFYOQOD7.js} +2 -2
- package/dist/{chunk-4WUHMLMM.js → chunk-MMKFFF2L.js} +2 -2
- package/dist/{chunk-FKBCEOJ5.js → chunk-Q42BY5BA.js} +2 -2
- package/dist/{chunk-DBKG6SRI.js → chunk-QU26IKIJ.js} +2 -2
- package/dist/{chunk-ADUD4PEK.js → chunk-TANUWTFO.js} +3 -3
- package/dist/{chunk-LJMZXJ45.js → chunk-VJQIFY33.js} +3 -3
- package/dist/{chunk-E23HN24Z.js → chunk-VQDYXXVS.js} +9 -9
- package/dist/cli/init.cjs +14 -2
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +7 -7
- package/dist/cli/mcp-add.cjs +13 -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/validate.cjs +12 -1
- package/dist/cli/validate.cjs.map +1 -1
- package/dist/cli/validate.js +2 -2
- package/dist/{edge-entry-BSKA1l_0.d.ts → edge-entry-AWO70gje.d.ts} +1 -1
- package/dist/{edge-entry-DyMWa6JK.d.cts → edge-entry-DaeG7D7S.d.cts} +1 -1
- package/dist/edge-entry.cjs +43 -2
- 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 +2 -2
- package/dist/index.cjs +369 -8
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-Bo_Rxund.d.cts → index.d-Dq33YwFT.d.cts} +91 -1
- package/dist/{index.d-Bo_Rxund.d.ts → index.d-Dq33YwFT.d.ts} +91 -1
- package/dist/index.d.cts +91 -431
- package/dist/index.d.ts +91 -431
- package/dist/index.js +290 -6
- package/dist/index.js.map +1 -1
- package/dist/node-entry.cjs +49 -7
- 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 +12 -1
- 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-FSTHCYDR.js → source-map-uploader-PB3M4PPP.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-NKRD3MKG.js.map +0 -1
- package/dist/chunk-XS5W3SPL.js.map +0 -1
- /package/dist/{chunk-GYTCZSAV.js.map → chunk-MFYOQOD7.js.map} +0 -0
- /package/dist/{chunk-4WUHMLMM.js.map → chunk-MMKFFF2L.js.map} +0 -0
- /package/dist/{chunk-FKBCEOJ5.js.map → chunk-Q42BY5BA.js.map} +0 -0
- /package/dist/{chunk-DBKG6SRI.js.map → chunk-QU26IKIJ.js.map} +0 -0
- /package/dist/{chunk-ADUD4PEK.js.map → chunk-TANUWTFO.js.map} +0 -0
- /package/dist/{chunk-LJMZXJ45.js.map → chunk-VJQIFY33.js.map} +0 -0
- /package/dist/{chunk-E23HN24Z.js.map → chunk-VQDYXXVS.js.map} +0 -0
- /package/dist/{source-map-uploader-FSTHCYDR.js.map → source-map-uploader-PB3M4PPP.js.map} +0 -0
|
@@ -42,6 +42,7 @@ declare const CaptureConfigSchema: z.ZodObject<{
|
|
|
42
42
|
importGraph: z.ZodBoolean;
|
|
43
43
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
44
44
|
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
|
+
sideEffectEvidence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
46
|
}, z.core.$strip>;
|
|
46
47
|
type CaptureConfig = z.infer<typeof CaptureConfigSchema>;
|
|
47
48
|
/** Developer-facing config for registerGlasstrace(). */
|
|
@@ -110,6 +111,7 @@ declare const SdkInitResponseSchema: z.ZodObject<{
|
|
|
110
111
|
importGraph: z.ZodBoolean;
|
|
111
112
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
112
113
|
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
114
|
+
sideEffectEvidence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
113
115
|
}, z.core.$strip>;
|
|
114
116
|
subscriptionStatus: z.ZodString;
|
|
115
117
|
linkedAccountId: z.ZodOptional<z.ZodString>;
|
|
@@ -191,4 +193,92 @@ type SourceMapManifestResponse = z.infer<typeof SourceMapManifestResponseSchema>
|
|
|
191
193
|
*/
|
|
192
194
|
declare function deriveSessionId(apiKey: string, origin: string, date: string, windowIndex: number): SessionId;
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Side-effect evidence value-enum constants.
|
|
198
|
+
*
|
|
199
|
+
* The runtime `as const` tuples are the source of truth for the
|
|
200
|
+
* allowlisted value sets. TypeScript types are derived via
|
|
201
|
+
* `typeof T[number]` so consumers get a literal-type union without a
|
|
202
|
+
* separate string-literal-union declaration that could silently drift
|
|
203
|
+
* from the runtime allowlist.
|
|
204
|
+
*
|
|
205
|
+
* These tuples align verbatim with the product-side wire schema in
|
|
206
|
+
* `glasstrace-product/shared/types/agent-evidence.ts`. Members must
|
|
207
|
+
* remain in sync across both repos; the SDK enforces these allowlists
|
|
208
|
+
* client-side as defense-in-depth before any attribute reaches the
|
|
209
|
+
* wire (the product's storage filter is a second defense, not the
|
|
210
|
+
* primary boundary).
|
|
211
|
+
*
|
|
212
|
+
* @drift-check ../../glasstrace-product/docs/component-designs/side-effect-evidence-summaries.md
|
|
213
|
+
*/
|
|
214
|
+
/**
|
|
215
|
+
* Allowlisted side-effect operation kinds (v1).
|
|
216
|
+
*
|
|
217
|
+
* Each kind names a category of side effect the receiver projects in
|
|
218
|
+
* MCP tool responses. New kinds require a coordinated bump across
|
|
219
|
+
* SCHEMA-036 (product), this tuple (SDK), and any downstream consumer
|
|
220
|
+
* that switches on the kind.
|
|
221
|
+
*/
|
|
222
|
+
declare const SIDE_EFFECT_OPERATION_KINDS: readonly ["email", "calendar_link", "webhook", "external_api", "queue", "after_callback"];
|
|
223
|
+
/**
|
|
224
|
+
* One of the allowlisted side-effect operation kinds.
|
|
225
|
+
*
|
|
226
|
+
* @see {@link SIDE_EFFECT_OPERATION_KINDS}
|
|
227
|
+
*/
|
|
228
|
+
type SideEffectOperationKind = (typeof SIDE_EFFECT_OPERATION_KINDS)[number];
|
|
229
|
+
/**
|
|
230
|
+
* Allowlisted semantic field keys for `recordSideEffect()` evidence.
|
|
231
|
+
*
|
|
232
|
+
* Only fields named here may be attached to a side-effect operation
|
|
233
|
+
* summary. Any other key is silently dropped at the SDK boundary and
|
|
234
|
+
* counted under the `unsupported_key` omission reason.
|
|
235
|
+
*/
|
|
236
|
+
declare const SIDE_EFFECT_SEMANTIC_FIELD_KEYS: readonly ["templateKey", "providerOperation", "role", "locale", "timezone", "status", "phase"];
|
|
237
|
+
/**
|
|
238
|
+
* One of the allowlisted side-effect semantic field keys.
|
|
239
|
+
*
|
|
240
|
+
* @see {@link SIDE_EFFECT_SEMANTIC_FIELD_KEYS}
|
|
241
|
+
*/
|
|
242
|
+
type SideEffectSemanticFieldKey = (typeof SIDE_EFFECT_SEMANTIC_FIELD_KEYS)[number];
|
|
243
|
+
/**
|
|
244
|
+
* Allowlisted reasons a side-effect value may be omitted from the
|
|
245
|
+
* emitted summary.
|
|
246
|
+
*
|
|
247
|
+
* The SDK records counts under these reasons rather than the rejected
|
|
248
|
+
* values themselves so unsafe input never appears anywhere on the
|
|
249
|
+
* wire. The set is fixed by SCHEMA-036; new reasons require a
|
|
250
|
+
* coordinated cross-repo bump.
|
|
251
|
+
*/
|
|
252
|
+
declare const SIDE_EFFECT_OMISSION_REASONS: readonly ["pii", "secret", "raw_payload", "unsupported_key", "value_too_long", "not_emitted", "capture_disabled"];
|
|
253
|
+
/**
|
|
254
|
+
* One of the allowlisted side-effect omission reasons.
|
|
255
|
+
*
|
|
256
|
+
* @see {@link SIDE_EFFECT_OMISSION_REASONS}
|
|
257
|
+
*/
|
|
258
|
+
type SideEffectOmissionReason = (typeof SIDE_EFFECT_OMISSION_REASONS)[number];
|
|
259
|
+
/**
|
|
260
|
+
* Allowlisted side-effect operation lifecycle statuses.
|
|
261
|
+
*/
|
|
262
|
+
declare const SIDE_EFFECT_OPERATION_STATUSES: readonly ["scheduled", "started", "succeeded", "failed", "unknown"];
|
|
263
|
+
/**
|
|
264
|
+
* One of the allowlisted side-effect operation statuses.
|
|
265
|
+
*
|
|
266
|
+
* @see {@link SIDE_EFFECT_OPERATION_STATUSES}
|
|
267
|
+
*/
|
|
268
|
+
type SideEffectOperationStatus = (typeof SIDE_EFFECT_OPERATION_STATUSES)[number];
|
|
269
|
+
/**
|
|
270
|
+
* Allowlisted side-effect operation execution phases.
|
|
271
|
+
*
|
|
272
|
+
* Distinguishes side effects that ran inside the request handler from
|
|
273
|
+
* those that ran after the response was sent (e.g., `after()` hook,
|
|
274
|
+
* background job).
|
|
275
|
+
*/
|
|
276
|
+
declare const SIDE_EFFECT_OPERATION_PHASES: readonly ["request", "post_response", "background", "unknown"];
|
|
277
|
+
/**
|
|
278
|
+
* One of the allowlisted side-effect operation phases.
|
|
279
|
+
*
|
|
280
|
+
* @see {@link SIDE_EFFECT_OPERATION_PHASES}
|
|
281
|
+
*/
|
|
282
|
+
type SideEffectOperationPhase = (typeof SIDE_EFFECT_OPERATION_PHASES)[number];
|
|
283
|
+
|
|
284
|
+
export { type AnonApiKey as A, type CaptureConfig as C, type GlasstraceEnvVars as G, type ImportGraphPayload as I, type SideEffectOperationKind as S, type SideEffectOperationStatus as a, type SideEffectOperationPhase as b, type SideEffectSemanticFieldKey as c, deriveSessionId as d, type SideEffectOmissionReason as e, type GlasstraceOptions as f, type SdkInitResponse as g, type SdkHealthReport as h, type SdkDiagnosticCode as i, type SessionId as j, type SourceMapUploadResponse as k, type SourceMapManifestResponse as l };
|
|
@@ -42,6 +42,7 @@ declare const CaptureConfigSchema: z.ZodObject<{
|
|
|
42
42
|
importGraph: z.ZodBoolean;
|
|
43
43
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
44
44
|
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
|
+
sideEffectEvidence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
46
|
}, z.core.$strip>;
|
|
46
47
|
type CaptureConfig = z.infer<typeof CaptureConfigSchema>;
|
|
47
48
|
/** Developer-facing config for registerGlasstrace(). */
|
|
@@ -110,6 +111,7 @@ declare const SdkInitResponseSchema: z.ZodObject<{
|
|
|
110
111
|
importGraph: z.ZodBoolean;
|
|
111
112
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
112
113
|
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
114
|
+
sideEffectEvidence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
113
115
|
}, z.core.$strip>;
|
|
114
116
|
subscriptionStatus: z.ZodString;
|
|
115
117
|
linkedAccountId: z.ZodOptional<z.ZodString>;
|
|
@@ -191,4 +193,92 @@ type SourceMapManifestResponse = z.infer<typeof SourceMapManifestResponseSchema>
|
|
|
191
193
|
*/
|
|
192
194
|
declare function deriveSessionId(apiKey: string, origin: string, date: string, windowIndex: number): SessionId;
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Side-effect evidence value-enum constants.
|
|
198
|
+
*
|
|
199
|
+
* The runtime `as const` tuples are the source of truth for the
|
|
200
|
+
* allowlisted value sets. TypeScript types are derived via
|
|
201
|
+
* `typeof T[number]` so consumers get a literal-type union without a
|
|
202
|
+
* separate string-literal-union declaration that could silently drift
|
|
203
|
+
* from the runtime allowlist.
|
|
204
|
+
*
|
|
205
|
+
* These tuples align verbatim with the product-side wire schema in
|
|
206
|
+
* `glasstrace-product/shared/types/agent-evidence.ts`. Members must
|
|
207
|
+
* remain in sync across both repos; the SDK enforces these allowlists
|
|
208
|
+
* client-side as defense-in-depth before any attribute reaches the
|
|
209
|
+
* wire (the product's storage filter is a second defense, not the
|
|
210
|
+
* primary boundary).
|
|
211
|
+
*
|
|
212
|
+
* @drift-check ../../glasstrace-product/docs/component-designs/side-effect-evidence-summaries.md
|
|
213
|
+
*/
|
|
214
|
+
/**
|
|
215
|
+
* Allowlisted side-effect operation kinds (v1).
|
|
216
|
+
*
|
|
217
|
+
* Each kind names a category of side effect the receiver projects in
|
|
218
|
+
* MCP tool responses. New kinds require a coordinated bump across
|
|
219
|
+
* SCHEMA-036 (product), this tuple (SDK), and any downstream consumer
|
|
220
|
+
* that switches on the kind.
|
|
221
|
+
*/
|
|
222
|
+
declare const SIDE_EFFECT_OPERATION_KINDS: readonly ["email", "calendar_link", "webhook", "external_api", "queue", "after_callback"];
|
|
223
|
+
/**
|
|
224
|
+
* One of the allowlisted side-effect operation kinds.
|
|
225
|
+
*
|
|
226
|
+
* @see {@link SIDE_EFFECT_OPERATION_KINDS}
|
|
227
|
+
*/
|
|
228
|
+
type SideEffectOperationKind = (typeof SIDE_EFFECT_OPERATION_KINDS)[number];
|
|
229
|
+
/**
|
|
230
|
+
* Allowlisted semantic field keys for `recordSideEffect()` evidence.
|
|
231
|
+
*
|
|
232
|
+
* Only fields named here may be attached to a side-effect operation
|
|
233
|
+
* summary. Any other key is silently dropped at the SDK boundary and
|
|
234
|
+
* counted under the `unsupported_key` omission reason.
|
|
235
|
+
*/
|
|
236
|
+
declare const SIDE_EFFECT_SEMANTIC_FIELD_KEYS: readonly ["templateKey", "providerOperation", "role", "locale", "timezone", "status", "phase"];
|
|
237
|
+
/**
|
|
238
|
+
* One of the allowlisted side-effect semantic field keys.
|
|
239
|
+
*
|
|
240
|
+
* @see {@link SIDE_EFFECT_SEMANTIC_FIELD_KEYS}
|
|
241
|
+
*/
|
|
242
|
+
type SideEffectSemanticFieldKey = (typeof SIDE_EFFECT_SEMANTIC_FIELD_KEYS)[number];
|
|
243
|
+
/**
|
|
244
|
+
* Allowlisted reasons a side-effect value may be omitted from the
|
|
245
|
+
* emitted summary.
|
|
246
|
+
*
|
|
247
|
+
* The SDK records counts under these reasons rather than the rejected
|
|
248
|
+
* values themselves so unsafe input never appears anywhere on the
|
|
249
|
+
* wire. The set is fixed by SCHEMA-036; new reasons require a
|
|
250
|
+
* coordinated cross-repo bump.
|
|
251
|
+
*/
|
|
252
|
+
declare const SIDE_EFFECT_OMISSION_REASONS: readonly ["pii", "secret", "raw_payload", "unsupported_key", "value_too_long", "not_emitted", "capture_disabled"];
|
|
253
|
+
/**
|
|
254
|
+
* One of the allowlisted side-effect omission reasons.
|
|
255
|
+
*
|
|
256
|
+
* @see {@link SIDE_EFFECT_OMISSION_REASONS}
|
|
257
|
+
*/
|
|
258
|
+
type SideEffectOmissionReason = (typeof SIDE_EFFECT_OMISSION_REASONS)[number];
|
|
259
|
+
/**
|
|
260
|
+
* Allowlisted side-effect operation lifecycle statuses.
|
|
261
|
+
*/
|
|
262
|
+
declare const SIDE_EFFECT_OPERATION_STATUSES: readonly ["scheduled", "started", "succeeded", "failed", "unknown"];
|
|
263
|
+
/**
|
|
264
|
+
* One of the allowlisted side-effect operation statuses.
|
|
265
|
+
*
|
|
266
|
+
* @see {@link SIDE_EFFECT_OPERATION_STATUSES}
|
|
267
|
+
*/
|
|
268
|
+
type SideEffectOperationStatus = (typeof SIDE_EFFECT_OPERATION_STATUSES)[number];
|
|
269
|
+
/**
|
|
270
|
+
* Allowlisted side-effect operation execution phases.
|
|
271
|
+
*
|
|
272
|
+
* Distinguishes side effects that ran inside the request handler from
|
|
273
|
+
* those that ran after the response was sent (e.g., `after()` hook,
|
|
274
|
+
* background job).
|
|
275
|
+
*/
|
|
276
|
+
declare const SIDE_EFFECT_OPERATION_PHASES: readonly ["request", "post_response", "background", "unknown"];
|
|
277
|
+
/**
|
|
278
|
+
* One of the allowlisted side-effect operation phases.
|
|
279
|
+
*
|
|
280
|
+
* @see {@link SIDE_EFFECT_OPERATION_PHASES}
|
|
281
|
+
*/
|
|
282
|
+
type SideEffectOperationPhase = (typeof SIDE_EFFECT_OPERATION_PHASES)[number];
|
|
283
|
+
|
|
284
|
+
export { type AnonApiKey as A, type CaptureConfig as C, type GlasstraceEnvVars as G, type ImportGraphPayload as I, type SideEffectOperationKind as S, type SideEffectOperationStatus as a, type SideEffectOperationPhase as b, type SideEffectSemanticFieldKey as c, deriveSessionId as d, type SideEffectOmissionReason as e, type GlasstraceOptions as f, type SdkInitResponse as g, type SdkHealthReport as h, type SdkDiagnosticCode as i, type SessionId as j, type SourceMapUploadResponse as k, type SourceMapManifestResponse as l };
|