@dxos/effect 0.13.0 → 0.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.
@@ -7,6 +7,7 @@ var SpanAttributes_exports = /* @__PURE__ */ __exportAll({
7
7
  LAYER: () => LAYER,
8
8
  OPERATION: () => OPERATION,
9
9
  PROCESS: () => PROCESS,
10
+ SAMPLING: () => SAMPLING,
10
11
  SPACE_ID: () => SPACE_ID,
11
12
  TRIGGER: () => TRIGGER,
12
13
  annotateSpace: () => annotateSpace
@@ -53,11 +54,15 @@ var TRIGGER = {
53
54
  id: "dxos.trigger.id",
54
55
  kind: "dxos.trigger.kind"
55
56
  };
57
+ /** Attributes that steer tail sampling. */
58
+ var SAMPLING = {
59
+ /** Set on a rare span whose every occurrence is counted, so tail sampling never drops it. */
60
+ keep: "dxos.sampling.keep" };
56
61
  /** Attribute naming the operation an invocation runs. */
57
62
  var OPERATION = { key: "dxos.operation.key" };
58
63
  /** Attribute listing the service keys a layer materialization provides. */
59
64
  var LAYER = { provides: "dxos.layer.provides" };
60
65
  //#endregion
61
- export { AI, AI_KIND, LAYER, OPERATION, PROCESS, SPACE_ID, TRIGGER, annotateSpace, SpanAttributes_exports as t };
66
+ export { AI, AI_KIND, LAYER, OPERATION, PROCESS, SAMPLING, SPACE_ID, TRIGGER, annotateSpace, SpanAttributes_exports as t };
62
67
 
63
68
  //# sourceMappingURL=SpanAttributes.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpanAttributes.mjs","names":[],"sources":["../../src/SpanAttributes.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\n/**\n * Attribute naming the space a span's work ran in. One key everywhere — ECHO, the process runtime,\n * the stores, the AI stack — so one filter finds all of a space's work.\n */\nexport const SPACE_ID = 'spaceId';\n\n/**\n * Stamps the space on every span the effect opens, for a caller that knows the space but not which\n * spans the work below it will open. Leaves the effect alone when there is no space.\n */\nexport const annotateSpace =\n (spaceId: string | null | undefined) =>\n <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>\n spaceId ? Effect.annotateSpans(SPACE_ID, spaceId)(effect) : effect;\n\n/** Attributes the AI stack stamps on its spans and the AI analytics sink reads; one definition for both. */\nexport const AI = {\n /** Conversation identity, so the sink can group a conversation's turns. */\n sessionId: 'dxos.ai.session_id',\n input: 'dxos.ai.input',\n output: 'dxos.ai.output',\n tools: 'dxos.ai.tools',\n /** Set when any of the above was cut to fit, so a consumer does not read a fragment as the whole. */\n truncated: 'dxos.ai.truncated',\n /** Prompt-cache token counts, which the GenAI conventions have nowhere for. */\n cacheReadTokens: 'dxos.ai.cache_read_tokens',\n cacheWriteTokens: 'dxos.ai.cache_write_tokens',\n /** What a non-model span is to the sink: one of {@link AI_KIND}. */\n kind: 'dxos.ai.kind',\n /** Display name for a span whose OTel name is generic, e.g. the tool a `callTool` span ran. */\n name: 'dxos.ai.name',\n} as const;\n\nexport const AI_KIND = {\n turn: 'turn',\n tool: 'tool',\n} as const;\n\n/** Attributes the process runtime stamps on the span around each handler dispatch. */\nexport const PROCESS = {\n id: 'dxos.process.id',\n key: 'dxos.process.key',\n parentId: 'dxos.process.parent_id',\n} as const;\n\n/** Attributes the trigger dispatcher stamps on a trigger invocation. */\nexport const TRIGGER = {\n id: 'dxos.trigger.id',\n kind: 'dxos.trigger.kind',\n} as const;\n\n/** Attribute naming the operation an invocation runs. */\nexport const OPERATION = {\n key: 'dxos.operation.key',\n} as const;\n\n/** Attribute listing the service keys a layer materialization provides. */\nexport const LAYER = {\n provides: 'dxos.layer.provides',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,IAAa,WAAW;;;;;AAMxB,IAAa,iBACV,aACS,WACR,UAAU,OAAO,cAAc,UAAU,OAAO,CAAC,CAAC,MAAM,IAAI;;AAGhE,IAAa,KAAK;;CAEhB,WAAW;CACX,OAAO;CACP,QAAQ;CACR,OAAO;;CAEP,WAAW;;CAEX,iBAAiB;CACjB,kBAAkB;;CAElB,MAAM;;CAEN,MAAM;AACR;AAEA,IAAa,UAAU;CACrB,MAAM;CACN,MAAM;AACR;;AAGA,IAAa,UAAU;CACrB,IAAI;CACJ,KAAK;CACL,UAAU;AACZ;;AAGA,IAAa,UAAU;CACrB,IAAI;CACJ,MAAM;AACR;;AAGA,IAAa,YAAY,EACvB,KAAK,qBACP;;AAGA,IAAa,QAAQ,EACnB,UAAU,sBACZ"}
1
+ {"version":3,"file":"SpanAttributes.mjs","names":[],"sources":["../../src/SpanAttributes.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\n/**\n * Attribute naming the space a span's work ran in. One key everywhere — ECHO, the process runtime,\n * the stores, the AI stack — so one filter finds all of a space's work.\n */\nexport const SPACE_ID = 'spaceId';\n\n/**\n * Stamps the space on every span the effect opens, for a caller that knows the space but not which\n * spans the work below it will open. Leaves the effect alone when there is no space.\n */\nexport const annotateSpace =\n (spaceId: string | null | undefined) =>\n <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>\n spaceId ? Effect.annotateSpans(SPACE_ID, spaceId)(effect) : effect;\n\n/** Attributes the AI stack stamps on its spans and the AI analytics sink reads; one definition for both. */\nexport const AI = {\n /** Conversation identity, so the sink can group a conversation's turns. */\n sessionId: 'dxos.ai.session_id',\n input: 'dxos.ai.input',\n output: 'dxos.ai.output',\n tools: 'dxos.ai.tools',\n /** Set when any of the above was cut to fit, so a consumer does not read a fragment as the whole. */\n truncated: 'dxos.ai.truncated',\n /** Prompt-cache token counts, which the GenAI conventions have nowhere for. */\n cacheReadTokens: 'dxos.ai.cache_read_tokens',\n cacheWriteTokens: 'dxos.ai.cache_write_tokens',\n /** What a non-model span is to the sink: one of {@link AI_KIND}. */\n kind: 'dxos.ai.kind',\n /** Display name for a span whose OTel name is generic, e.g. the tool a `callTool` span ran. */\n name: 'dxos.ai.name',\n} as const;\n\nexport const AI_KIND = {\n turn: 'turn',\n tool: 'tool',\n} as const;\n\n/** Attributes the process runtime stamps on the span around each handler dispatch. */\nexport const PROCESS = {\n id: 'dxos.process.id',\n key: 'dxos.process.key',\n parentId: 'dxos.process.parent_id',\n} as const;\n\n/** Attributes the trigger dispatcher stamps on a trigger invocation. */\nexport const TRIGGER = {\n id: 'dxos.trigger.id',\n kind: 'dxos.trigger.kind',\n} as const;\n\n/** Attributes that steer tail sampling. */\nexport const SAMPLING = {\n /** Set on a rare span whose every occurrence is counted, so tail sampling never drops it. */\n keep: 'dxos.sampling.keep',\n} as const;\n\n/** Attribute naming the operation an invocation runs. */\nexport const OPERATION = {\n key: 'dxos.operation.key',\n} as const;\n\n/** Attribute listing the service keys a layer materialization provides. */\nexport const LAYER = {\n provides: 'dxos.layer.provides',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,IAAa,WAAW;;;;;AAMxB,IAAa,iBACV,aACS,WACR,UAAU,OAAO,cAAc,UAAU,OAAO,CAAC,CAAC,MAAM,IAAI;;AAGhE,IAAa,KAAK;;CAEhB,WAAW;CACX,OAAO;CACP,QAAQ;CACR,OAAO;;CAEP,WAAW;;CAEX,iBAAiB;CACjB,kBAAkB;;CAElB,MAAM;;CAEN,MAAM;AACR;AAEA,IAAa,UAAU;CACrB,MAAM;CACN,MAAM;AACR;;AAGA,IAAa,UAAU;CACrB,IAAI;CACJ,KAAK;CACL,UAAU;AACZ;;AAGA,IAAa,UAAU;CACrB,IAAI;CACJ,MAAM;AACR;;AAGA,IAAa,WAAW;;AAEtB,MAAM,qBACR;;AAGA,IAAa,YAAY,EACvB,KAAK,qBACP;;AAGA,IAAa,QAAQ,EACnB,UAAU,sBACZ"}
@@ -41,6 +41,11 @@ export declare const TRIGGER: {
41
41
  readonly id: 'dxos.trigger.id';
42
42
  readonly kind: 'dxos.trigger.kind';
43
43
  };
44
+ /** Attributes that steer tail sampling. */
45
+ export declare const SAMPLING: {
46
+ /** Set on a rare span whose every occurrence is counted, so tail sampling never drops it. */
47
+ readonly keep: 'dxos.sampling.keep';
48
+ };
44
49
  /** Attribute naming the operation an invocation runs. */
45
50
  export declare const OPERATION: {
46
51
  readonly key: 'dxos.operation.key';
@@ -1 +1 @@
1
- {"version":3,"file":"SpanAttributes.d.ts","sourceRoot":"","sources":["../../../src/SpanAttributes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,aAAa,YACd,MAAM,GAAG,IAAI,GAAG,SAAS,MAClC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CACI,CAAC;AAEvE,4GAA4G;AAC5G,eAAO,MAAM,EAAE;IACb,2EAA2E;aAC3E,SAAS,EAAE,oBAAoB;aAC/B,KAAK,EAAE,eAAe;aACtB,MAAM,EAAE,gBAAgB;aACxB,KAAK,EAAE,eAAe;IACtB,qGAAqG;aACrG,SAAS,EAAE,mBAAmB;IAC9B,+EAA+E;aAC/E,eAAe,EAAE,2BAA2B;aAC5C,gBAAgB,EAAE,4BAA4B;IAC9C,oEAAoE;aACpE,IAAI,EAAE,cAAc;IACpB,+FAA+F;aAC/F,IAAI,EAAE,cAAc;CACZ,CAAC;AAEX,eAAO,MAAM,OAAO;aAClB,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,sFAAsF;AACtF,eAAO,MAAM,OAAO;aAClB,EAAE,EAAE,iBAAiB;aACrB,GAAG,EAAE,kBAAkB;aACvB,QAAQ,EAAE,wBAAwB;CAC1B,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,OAAO;aAClB,EAAE,EAAE,iBAAiB;aACrB,IAAI,EAAE,mBAA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