mayura 1.2.0-rc.1 → 1.2.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 (54) hide show
  1. package/docs/guides/release-readiness.md +58 -21
  2. package/lib/adapter-code-docker/image/Dockerfile +1 -1
  3. package/lib/adapter-code-docker/package.json +1 -1
  4. package/lib/adapter-code-quickjs/package.json +1 -1
  5. package/lib/adapter-mcp/package.json +1 -1
  6. package/lib/ag-ui/package.json +1 -1
  7. package/lib/artifacts/package.json +1 -1
  8. package/lib/auth/package.json +1 -1
  9. package/lib/authz/package.json +1 -1
  10. package/lib/browser/package.json +1 -1
  11. package/lib/cli/package.json +1 -1
  12. package/lib/client/package.json +1 -1
  13. package/lib/client-react/package.json +1 -1
  14. package/lib/code-mode/package.json +1 -1
  15. package/lib/code-mode-workflows/package.json +1 -1
  16. package/lib/context/package.json +1 -1
  17. package/lib/core/package.json +1 -1
  18. package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
  19. package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
  20. package/lib/exporter-otlp/dist/signals.js +2 -2
  21. package/lib/exporter-otlp/dist/signals.js.map +1 -1
  22. package/lib/exporter-otlp/package.json +1 -1
  23. package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
  24. package/lib/exporter-otlp/src/signals.ts +2 -2
  25. package/lib/files/package.json +1 -1
  26. package/lib/guardrails/package.json +1 -1
  27. package/lib/helpers/package.json +1 -1
  28. package/lib/keys/package.json +1 -1
  29. package/lib/memory/package.json +1 -1
  30. package/lib/memory-remote/package.json +1 -1
  31. package/lib/observability/package.json +1 -1
  32. package/lib/provider-anthropic/package.json +1 -1
  33. package/lib/provider-openai/package.json +1 -1
  34. package/lib/rag/package.json +1 -1
  35. package/lib/runtime/package.json +1 -1
  36. package/lib/sandbox/package.json +1 -1
  37. package/lib/sdk/package.json +1 -1
  38. package/lib/server/package.json +1 -1
  39. package/lib/server-node/package.json +1 -1
  40. package/lib/skills/package.json +1 -1
  41. package/lib/storage/package.json +1 -1
  42. package/lib/storage-contracts/package.json +1 -1
  43. package/lib/storage-postgres/package.json +1 -1
  44. package/lib/storage-sql/package.json +1 -1
  45. package/lib/storage-sqlite/package.json +1 -1
  46. package/lib/terminal/package.json +1 -1
  47. package/lib/testing/package.json +1 -1
  48. package/lib/threads/package.json +1 -1
  49. package/lib/tools/package.json +1 -1
  50. package/lib/voice/package.json +1 -1
  51. package/lib/workflows/package.json +1 -1
  52. package/lib/workstream/package.json +1 -1
  53. package/llms-full.txt +58 -21
  54. package/package.json +1 -1
@@ -3,14 +3,46 @@ title: "V1.2 release validation status"
3
3
  description: "Completed local and CI qualification, experimental surfaces and the checks still required before releasing Mayura V1.2."
4
4
  ---
5
5
 
6
- V1.2 is unreleased. The full release-branch qualification matrix passed on **2026-10-21** at commit
7
- `f443c76e822eef27b143d318d748ed513599e00c`. The local qualification snapshot below is retained separately;
8
- neither result establishes compatibility with unqualified real external services.
6
+ Stable V1.2 is prepared for review and is not yet published. The implementation and full-release safeguards are
7
+ merged into `main`, whose full qualification passed on **2026-10-23** at
8
+ `a9b5c565167170e4b35b5f42cf7df58a64b485e8`. The coordinated **1.2.0** version PR needs its own qualification and
9
+ green main checks after merging. The reviewed 22-package set was previously published as
10
+ **1.2.0-rc.1 under `next`**, through trusted publishing, with all existing `latest` tags unchanged. The local and
11
+ earlier release-branch snapshots below remain historical evidence; none establishes interoperability with
12
+ unqualified real external services.
9
13
 
10
14
  ## Completed CI qualification
11
15
 
12
- The **Mayura qualification** workflow, run `39576846216`, completed successfully on `release-1.2` at the commit
13
- above. All **13 configured jobs passed**, with zero failed jobs:
16
+ The [main qualification run 39903621300](https://github.com/KartikeyAI/mayura/actions/runs/39903621300) passed all
17
+ **39 jobs**, including the required **Qualification gate**: shared checks, six OS/Node consumer lanes, 12 unit-test
18
+ shards, 12 bundle shards, four database integration shards, shared runtimes and two container lanes. Linux, macOS and
19
+ Windows retain Node 22.23.2 and 24.14.1 coverage. Branch protection requires the aggregate gate. The
20
+ [main website run 39903621303](https://github.com/KartikeyAI/mayura/actions/runs/39903621303) also passed.
21
+
22
+ [PR #21](https://github.com/KartikeyAI/mayura/pull/21) passed all 39 qualification jobs before merging at the main
23
+ commit above. The full publisher now requires a committed version, exact-main qualification and source-bound
24
+ archive/receipt verification, and creates only the version tag and GitHub Release after publication. It does not
25
+ commit, rebase or push main. A local 1.2.0 rehearsal passed build, upgrade from V1.1.0, all 106 archive checks,
26
+ 450-component SBOM checks with no license findings, and 106 offline npm dry runs. These local archives are rehearsal
27
+ evidence, not the final stable publication artifacts.
28
+
29
+ The [RC1 release run 39884720470](https://github.com/KartikeyAI/mayura/actions/runs/39884720470) succeeded through
30
+ `release.yml` and the protected `release` environment at `ba4a1e868904453e533e57e2876d64ab8536c454`, after
31
+ [its 39-job main qualification](https://github.com/KartikeyAI/mayura/actions/runs/39879429442). All 22 selected archives matched
32
+ their public npm integrity metadata, every version had provenance, and `next` resolved to `1.2.0-rc.1`. Existing
33
+ `latest` values remained `1.1.0` for `mayura` and the OpenAI provider, and `1.2.0-rc.0` for the 20 newly introduced
34
+ extensions. This proves OIDC publication for those 22 packages, not the full 106-package stable release.
35
+
36
+ On **2026-10-23**, read-only npm checks confirmed that all other **84 packages** have the expected trusted-publisher
37
+ configuration: `KartikeyAI/mayura`, `release.yml`, environment `release`, and direct publishing allowed. No trust
38
+ settings were changed. The CLI readback does not expose activation or expiry status and is not proof of a successful
39
+ OIDC exchange; the first live publication remains unproven for those packages. Recheck eligibility at release time
40
+ and recreate any expired configurations. Public registry preflight also found all 106 stable `1.2.0` versions unused.
41
+
42
+ ### Historical release-branch run
43
+
44
+ The **Mayura qualification** workflow, run `39576846216`, completed successfully on `release-1.2` at
45
+ `f443c76e822eef27b143d318d748ed513599e00c`. All **13 configured jobs passed**, with zero failed jobs:
14
46
 
15
47
  | Job group | Result |
16
48
  | --- | --- |
@@ -23,8 +55,8 @@ The consumer jobs include unit tests, packed consumers, runnable examples, templ
23
55
  documentation, API/version checks, release archives and SBOM checks. Earlier failed or canceled attempts remain
24
56
  historical evidence; this result is a complete successful run on the recorded commit.
25
57
 
26
- This documentation follow-up also incorporates newer `main` changes. The updated branch and the pull-request
27
- merge commit require their own qualification; the earlier green run is not evidence for those later commits.
58
+ The later main run above supersedes this branch-only gate for its recorded source commit. Further release-tooling,
59
+ documentation or version changes still require their own green PR and main qualification.
28
60
 
29
61
  ## Completed local qualification
30
62
 
@@ -62,8 +94,11 @@ concurrent builds and unit-suite load. The subsequent complete CI pass is record
62
94
 
63
95
  ## Remaining qualifications and limitations
64
96
 
65
- - **Merge CI:** the release-branch matrix passed at the recorded commit. Require green checks for the updated
66
- branch and pull-request merge commit, then qualify `main`, the only publishing branch, before releasing.
97
+ - **Stable publication:** full-release safeguards passed PR and main qualification at the recorded source; scoped
98
+ RC1 publication passed at its separately recorded source. The stable version PR still needs review, qualification
99
+ and green main checks, then a final-source workflow rehearsal and publication approval. All other 84 publisher
100
+ configurations matched in read-only checks, but were not exercised by RC1 and their activation/expiry status was
101
+ not exposed by the CLI. Recheck eligibility and replace any expired configurations before full publication.
67
102
  - **Providers and gateways:** offline transports and the provider harness dry run passed. Paid inference, real
68
103
  embedding endpoints, gateway accounting and remote discovery behavior have not been qualified.
69
104
  - **Authorization:** OpenFGA, Cedar, Permit.io and Oso passed offline tests and package checks. Real provider/native
@@ -87,15 +122,17 @@ sufficient evidence for that claim.
87
122
 
88
123
  ## Release preparation
89
124
 
90
- 1. Review the complete V1.2 implementation, validation fixes and updated documentation in the merge pull request
91
- from `release-1.2` into `main`.
92
- 2. Require the documentation follow-up and merge commit to pass qualification; the earlier release-branch CI gate
93
- is complete at the commit recorded above.
94
- 3. Merge through the reviewed path into `main`, the only publishing branch, and require its qualification to pass.
95
- 4. Verify npm credentials or trusted publishing for the core package and extensions, the protected release
96
- environment, and the publishing enablement setting.
97
- 5. Dry-run the release workflow for **1.2.0** to regenerate versioned archives, checksums, SBOM and release notes from
98
- the final source. Publish and tag only through the approved release workflow.
99
-
100
- Source manifests remain at 1.1.0 until the release workflow applies the coordinated version bump. The release branch
101
- has been pushed for review; V1.2 has not been tagged, published or deployed.
125
+ 1. Full-release publisher/recovery changes are merged and qualified on main; review these updated release records.
126
+ 2. Review the prepared coordinated **1.2.0** version/changelog PR, committed without `[skip ci]`, merge through normal branch
127
+ protection and require the pushed main commit's complete qualification to pass. The publisher does not write main.
128
+ 3. Verify trusted publishing for all 106 packages, the protected `release` environment, tag creation permission and
129
+ publishing enablement. Preserve the experimental labels and limitations above.
130
+ 4. Rehearse **1.2.0** with `package_set=all` and `dry_run=true`, regenerating archives, checksums, SBOM and notes from
131
+ the final source. Dry runs do not validate unexercised package trust.
132
+ 5. Approve publication from that qualified main commit with `dry_run=false`. Verify all 106 versions, `latest` tags,
133
+ provenance and the source-bound tag/GitHub Release. Recover partial publication from the original run's saved
134
+ archives and receipt, without replaying accepted or uncertain uploads.
135
+
136
+ This version PR sets source manifests and version references to **1.2.0** and prepares the changelog. It does not
137
+ publish to npm, change distribution tags, create `v1.2.0` or create a stable GitHub Release. Stable publication and
138
+ deployment remain outstanding; RC1 availability is not evidence of live-service or rendered browser qualification.
@@ -2,7 +2,7 @@ FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e443129
2
2
 
3
3
  ARG MAYURA_PROVENANCE
4
4
  LABEL org.opencontainers.image.title="Mayura Code Sandbox" \
5
- org.opencontainers.image.version="1.2.0-rc.1" \
5
+ org.opencontainers.image.version="1.2.0" \
6
6
  org.opencontainers.image.base.name="node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5" \
7
7
  dev.mayura.code-sandbox.provenance="${MAYURA_PROVENANCE}"
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -91,7 +91,7 @@ function request(events, serviceName, serviceVersion) {
91
91
  const attributes = [attribute('service.name', serviceName)];
92
92
  if (serviceVersion)
93
93
  attributes.push(attribute('service.version', serviceVersion));
94
- return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, logRecords: events.map(record) }] }] };
94
+ return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, logRecords: events.map(record) }] }] };
95
95
  }
96
96
  async function abortable(operation, signal) {
97
97
  if (signal.aborted) {
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-http-json.js","sourceRoot":"","sources":["../src/otlp-http-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAkD,MAAM,cAAc,CAAC;AAC7H,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9H,MAAM,UAAU,GAAG,qCAAqC,CAAC;AACzD,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAC1D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACtI,MAAM,WAAW,GAAG,CAAC,kBAAkB,EAAE,kBAAkB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ositiveInteger, jsonValue, MayuraError, type JsonObject, type JsonValue, type RunEvent } from '@mayura/core';\nimport { snapshotRunEventMetadata } from '@mayura/observability';\nimport type { ExactCount, OtlpHttpJsonLogExporter, OtlpHttpJsonLogExporterOptions, OtlpLogExporterMetrics, OtlpLogExporterSnapshot } from './contracts.js';\n\nconst defaults = Object.freeze({ timeoutMs: 5_000, maxBatchSize: 256, maxRequestBytes: 1_048_576, maxResponseBytes: 65_536 });\nconst headerName = /^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,128}$/;\nconst stableName = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;\nconst blockedHeaders = new Set(['connection', 'content-length', 'content-type', 'cookie', 'host', 'set-cookie', 'transfer-encoding']);\nconst metricNames = ['batchesAttempted', 'recordsAttempted', 'recordsAccepted', 'recordsDropped', 'partialResponses', 'failedRequests', 'timedOutRequests', 'cancelledRequests', 'requestBytes', 'responseBytes'] as const;\ntype Metric = typeof metricNames[number];\n\nconst failed = (): never => { throw new MayuraError('TOOL_FAILED', 'The telemetry export failed. Inspect authorized local diagnostics.'); };\nfunction exact(value: bigint): ExactCount { return value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString(); }\nfunction object(value: JsonValue | undefined): JsonObject {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return failed();\n return value;\n}\nfunction stable(value: unknown): string {\n if (typeof value !== 'string' || !stableName.test(value)) throw new MayuraError('INVALID_CONFIG', 'Exporter names must be bounded stable identifiers.');\n return value;\n}\nfunction endpoint(value: unknown, allowInsecureLoopback: boolean): string {\n try {\n if (typeof value !== 'string' || value.length > 2_048) throw new Error();\n const url = new URL(value);\n const loopback = ['127.0.0.1', '[::1]'].includes(url.hostname);\n if ((url.protocol !== 'https:' && !(allowInsecureLoopback && url.protocol === 'http:' && loopback))\n || url.username || url.password || url.search || url.hash || !url.pathname.endsWith('/v1/logs')) throw new Error();\n return url.href;\n } catch { throw new MayuraError('INVALID_CONFIG', 'OTLP logs require an explicit HTTPS endpoint ending in /v1/logs.'); }\n}\nfunction headers(value: OtlpHttpJsonLogExporterOptions['headers']): Readonly<Record<string, string>> {\n try {\n if (value === undefined) return Object.freeze({ 'Content-Type': 'application/json' });\n const descriptors = Object.getOwnPropertyDescriptors(value);\n if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw new Error();\n const result: Record<string, string> = { 'Content-Type': 'application/json' };\n const seen = new Set(['content-type']);\n if (Object.getOwnPropertySymbols(value).length > 0 || Object.keys(descriptors).length > 32) throw new Error();\n for (const [key, descriptor] of Object.entries(descriptors)) {\n const normalized = key.toLowerCase();\n if (!descriptor.enumerable || !('value' in descriptor) || !headerName.test(key) || blockedHeaders.has(normalized) || seen.has(normalized)\n || typeof descriptor.value !== 'string' || descriptor.value.length > 4_096 || /[\\r\\n\\0]/.test(descriptor.value)) throw new Error();\n seen.add(normalized);\n result[key] = descriptor.value;\n }\n return Object.freeze(result);\n } catch { throw new MayuraError('INVALID_CONFIG', 'Exporter headers must be bounded explicit HTTP fields.'); }\n}\n\nfunction anyValue(value: string | number | boolean): JsonObject {\n if (typeof value === 'string') return { stringValue: value };\n if (typeof value === 'boolean') return { boolValue: value };\n return Number.isInteger(value) ? { intValue: String(value) } : { doubleValue: value };\n}\nfunction attribute(key: string, value: string | number | boolean): JsonObject { return { key, value: anyValue(value) }; }\nfunction severity(event: RunEvent): readonly [number, string] {\n if (event.type === 'events.gap') return [13, 'WARN'];\n if (event.type !== 'run.completed' && event.type !== 'tool.completed' && event.type !== 'hook.completed' && event.type !== 'delegate.completed') return [9, 'INFO'];\n const status = event.metadata['status'];\n if (status === 'failed' || status === 'outcome_unknown') return [17, 'ERROR'];\n if (status === 'blocked' || status === 'cancelled') return [13, 'WARN'];\n return [9, 'INFO'];\n}\nfunction record(event: RunEvent): JsonObject {\n const [severityNumber, severityText] = severity(event);\n const attributes = [attribute('mayura.run.id', event.runId), attribute('mayura.event.sequence', event.sequence)];\n for (const [key, value] of Object.entries(event.metadata)) attributes.push(attribute(`mayura.${key}`, value));\n return {\n timeUnixNano: (BigInt(Date.parse(event.timestamp)) * 1_000_000n).toString(),\n severityNumber, severityText, body: { stringValue: event.type }, attributes,\n };\n}\nfunction request(events: readonly RunEvent[], serviceName: string, serviceVersion?: string): JsonObject {\n const attributes = [attribute('service.name', serviceName)];\n if (serviceVersion) attributes.push(attribute('service.version', serviceVersion));\n return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, logRecords: events.map(record) }] }] };\n}\n\nasync function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void operation.catch(() => undefined); throw signal.reason; }\n let listener: (() => void) | undefined;\n try {\n return await Promise.race([operation, new Promise<never>((_, reject) => {\n listener = () => reject(signal.reason); signal.addEventListener('abort', listener, { once: true });\n if (signal.aborted) listener();\n })]);\n } finally { if (listener) signal.removeEventListener('abort', listener); }\n}\nasync function responsePayload(response: Response, limit: number, signal: AbortSignal, charge: (bytes: number) => void): Promise<JsonObject> {\n if (response.status !== 200 || response.redirected) { void response.body?.cancel().catch(() => undefined); return failed(); }\n if (!response.body) return {};\n const length = response.headers.get('content-length');\n if (length !== null && (!/^\\d+$/.test(length) || Number(length) > limit)) { void response.body.cancel().catch(() => undefined); return failed(); }\n const reader = response.body.getReader(); const chunks: Uint8Array[] = []; let size = 0;\n try {\n for (;;) {\n const item = await abortable(reader.read(), signal);\n if (item.done) break;\n size += item.value.byteLength; charge(item.value.byteLength);\n if (size > limit) return failed();\n chunks.push(item.value);\n }\n if (size === 0) return {};\n const bytes = new Uint8Array(size); let offset = 0;\n for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }\n const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);\n const type = response.headers.get('content-type') ?? '';\n if (!/^application\\/json(?:\\s*;|$)/iu.test(type)) {\n // Some services (LangSmith) answer full success as `{}` labelled text/plain. Only that empty answer is taken\n // without the JSON type: anything that could report partial success must say it is JSON.\n if (/^text\\/plain(?:\\s*;|$)/iu.test(type) && text.trim() === '{}') return {};\n return failed();\n }\n return object(jsonValue(JSON.parse(text), { maxBytes: limit, maxDepth: 8, maxNodes: 1_024 }));\n } finally { void reader.cancel().catch(() => undefined); reader.releaseLock(); }\n}\nfunction rejectedRecords(payload: JsonObject, sent: number): number {\n const partial = payload['partialSuccess'];\n if (partial === undefined) return 0;\n const value = object(partial)['rejectedLogRecords'];\n if (value === undefined) return 0;\n const text = typeof value === 'number' && Number.isSafeInteger(value) ? String(value) : value;\n if (typeof text !== 'string' || !/^\\d{1,20}$/.test(text)) return failed();\n const rejected = BigInt(text);\n if (rejected > BigInt(sent)) return failed();\n return Number(rejected);\n}\n\n/** Explicit OTLP/HTTP JSON log export with bounded metadata-only delivery and no retries. */\nexport function createOtlpHttpJsonLogExporter(options: OtlpHttpJsonLogExporterOptions): OtlpHttpJsonLogExporter {\n let config: typeof defaults; let destination: string; let serviceName: string; let serviceVersion: string | undefined;\n let transport: typeof globalThis.fetch; let fixedHeaders: Readonly<Record<string, string>>;\n try {\n const allowInsecureLoopback = options.allowInsecureLoopback ?? false;\n if (typeof allowInsecureLoopback !== 'boolean') throw new Error();\n config = Object.freeze(Object.fromEntries(Object.entries(defaults).map(([key, fallback]) => [key, options[key as keyof typeof defaults] ?? fallback]))) as typeof defaults;\n for (const [key, value] of Object.entries(config)) assertPositiveInteger(value, key);\n if (config.timeoutMs > 2_147_483_647 || config.maxBatchSize > 256 || config.maxRequestBytes > 16_777_216 || config.maxResponseBytes > 1_048_576) throw new Error();\n destination = endpoint(options.endpoint, allowInsecureLoopback); serviceName = stable(options.serviceName);\n serviceVersion = options.serviceVersion === undefined ? undefined : stable(options.serviceVersion);\n fixedHeaders = headers(options.headers); transport = options.fetch ?? globalThis.fetch;\n if (typeof transport !== 'function') throw new Error();\n } catch (error) {\n if (error instanceof MayuraError) throw error;\n throw new MayuraError('INVALID_CONFIG', 'OTLP exporter configuration must contain supported explicit bounds and transport.');\n }\n const metrics = Object.fromEntries(metricNames.map(key => [key, 0n])) as Record<Metric, bigint>;\n const count = (key: Metric, amount = 1): void => { metrics[key] += BigInt(amount); };\n let closed = false; let inFlight = false; let active: AbortController | undefined;\n const inspect = (): OtlpLogExporterSnapshot => Object.freeze({ state: closed ? 'closed' : 'active', inFlight,\n metrics: Object.freeze(Object.fromEntries(metricNames.map(key => [key, exact(metrics[key])]))) as unknown as OtlpLogExporterMetrics,\n });\n const sink = async (rawEvents: readonly RunEvent[], context: { readonly signal: AbortSignal }): Promise<void> => {\n if (closed) throw new MayuraError('CONFLICT', 'The telemetry exporter is closed.');\n if (inFlight) throw new MayuraError('CONFLICT', 'The telemetry exporter already has an active request.');\n if (!Array.isArray(rawEvents) || rawEvents.length === 0 || rawEvents.length > config.maxBatchSize || !(context.signal instanceof AbortSignal)) {\n if (Array.isArray(rawEvents)) count('recordsDropped', rawEvents.length);\n throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted events, a signal and supported bounds.');\n }\n count('batchesAttempted'); count('recordsAttempted', rawEvents.length);\n let events: readonly RunEvent[]; let body: string;\n try {\n events = Object.freeze(rawEvents.map(value => snapshotRunEventMetadata(value)));\n body = JSON.stringify(jsonValue(request(events, serviceName, serviceVersion), { maxBytes: config.maxRequestBytes, maxDepth: 12, maxNodes: 32_768 }));\n const bytes = new TextEncoder().encode(body).byteLength;\n if (bytes > config.maxRequestBytes) throw new Error();\n count('requestBytes', bytes);\n } catch {\n count('recordsDropped', rawEvents.length); throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted events within the configured request bound.');\n }\n const controller = new AbortController(); active = controller; inFlight = true; let timedOut = false;\n const timer = setTimeout(() => { timedOut = true; controller.abort(); }, config.timeoutMs);\n const relay = (): void => { controller.abort(); };\n context.signal.addEventListener('abort', relay, { once: true }); if (context.signal.aborted) relay();\n try {\n if (controller.signal.aborted) throw controller.signal.reason;\n const response = await abortable(Promise.resolve(transport(destination, {\n method: 'POST', headers: fixedHeaders, body, signal: controller.signal, redirect: 'error', credentials: 'omit', cache: 'no-store',\n })), controller.signal);\n const payload = await responsePayload(response, config.maxResponseBytes, controller.signal, bytes => count('responseBytes', bytes));\n const rejected = rejectedRecords(payload, events.length);\n count('recordsAccepted', events.length - rejected);\n if (rejected > 0) { count('recordsDropped', rejected); count('partialResponses'); }\n } catch {\n count('recordsDropped', events.length);\n if (timedOut) { count('timedOutRequests'); throw new MayuraError('TIMEOUT', 'The telemetry export timed out.'); }\n if (context.signal.aborted || closed) { count('cancelledRequests'); throw new MayuraError('CANCELLED', 'The telemetry export was cancelled.'); }\n count('failedRequests'); return failed();\n } finally {\n clearTimeout(timer); context.signal.removeEventListener('abort', relay); active = undefined; inFlight = false;\n }\n };\n const close = (): void => { if (!closed) { closed = true; active?.abort(); } };\n return Object.freeze({ sink, inspect, close });\n}\n"]}
1
+ {"version":3,"file":"otlp-http-json.js","sourceRoot":"","sources":["../src/otlp-http-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAkD,MAAM,cAAc,CAAC;AAC7H,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9H,MAAM,UAAU,GAAG,qCAAqC,CAAC;AACzD,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAC1D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACtI,MAAM,WAAW,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,g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JsonObject, type JsonValue, type RunEvent } from '@mayura/core';\nimport { snapshotRunEventMetadata } from '@mayura/observability';\nimport type { ExactCount, OtlpHttpJsonLogExporter, OtlpHttpJsonLogExporterOptions, OtlpLogExporterMetrics, OtlpLogExporterSnapshot } from './contracts.js';\n\nconst defaults = Object.freeze({ timeoutMs: 5_000, maxBatchSize: 256, maxRequestBytes: 1_048_576, maxResponseBytes: 65_536 });\nconst headerName = /^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,128}$/;\nconst stableName = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;\nconst blockedHeaders = new Set(['connection', 'content-length', 'content-type', 'cookie', 'host', 'set-cookie', 'transfer-encoding']);\nconst metricNames = ['batchesAttempted', 'recordsAttempted', 'recordsAccepted', 'recordsDropped', 'partialResponses', 'failedRequests', 'timedOutRequests', 'cancelledRequests', 'requestBytes', 'responseBytes'] as const;\ntype Metric = typeof metricNames[number];\n\nconst failed = (): never => { throw new MayuraError('TOOL_FAILED', 'The telemetry export failed. Inspect authorized local diagnostics.'); };\nfunction exact(value: bigint): ExactCount { return value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString(); }\nfunction object(value: JsonValue | undefined): JsonObject {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return failed();\n return value;\n}\nfunction stable(value: unknown): string {\n if (typeof value !== 'string' || !stableName.test(value)) throw new MayuraError('INVALID_CONFIG', 'Exporter names must be bounded stable identifiers.');\n return value;\n}\nfunction endpoint(value: unknown, allowInsecureLoopback: boolean): string {\n try {\n if (typeof value !== 'string' || value.length > 2_048) throw new Error();\n const url = new URL(value);\n const loopback = ['127.0.0.1', '[::1]'].includes(url.hostname);\n if ((url.protocol !== 'https:' && !(allowInsecureLoopback && url.protocol === 'http:' && loopback))\n || url.username || url.password || url.search || url.hash || !url.pathname.endsWith('/v1/logs')) throw new Error();\n return url.href;\n } catch { throw new MayuraError('INVALID_CONFIG', 'OTLP logs require an explicit HTTPS endpoint ending in /v1/logs.'); }\n}\nfunction headers(value: OtlpHttpJsonLogExporterOptions['headers']): Readonly<Record<string, string>> {\n try {\n if (value === undefined) return Object.freeze({ 'Content-Type': 'application/json' });\n const descriptors = Object.getOwnPropertyDescriptors(value);\n if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw new Error();\n const result: Record<string, string> = { 'Content-Type': 'application/json' };\n const seen = new Set(['content-type']);\n if (Object.getOwnPropertySymbols(value).length > 0 || Object.keys(descriptors).length > 32) throw new Error();\n for (const [key, descriptor] of Object.entries(descriptors)) {\n const normalized = key.toLowerCase();\n if (!descriptor.enumerable || !('value' in descriptor) || !headerName.test(key) || blockedHeaders.has(normalized) || seen.has(normalized)\n || typeof descriptor.value !== 'string' || descriptor.value.length > 4_096 || /[\\r\\n\\0]/.test(descriptor.value)) throw new Error();\n seen.add(normalized);\n result[key] = descriptor.value;\n }\n return Object.freeze(result);\n } catch { throw new MayuraError('INVALID_CONFIG', 'Exporter headers must be bounded explicit HTTP fields.'); }\n}\n\nfunction anyValue(value: string | number | boolean): JsonObject {\n if (typeof value === 'string') return { stringValue: value };\n if (typeof value === 'boolean') return { boolValue: value };\n return Number.isInteger(value) ? { intValue: String(value) } : { doubleValue: value };\n}\nfunction attribute(key: string, value: string | number | boolean): JsonObject { return { key, value: anyValue(value) }; }\nfunction severity(event: RunEvent): readonly [number, string] {\n if (event.type === 'events.gap') return [13, 'WARN'];\n if (event.type !== 'run.completed' && event.type !== 'tool.completed' && event.type !== 'hook.completed' && event.type !== 'delegate.completed') return [9, 'INFO'];\n const status = event.metadata['status'];\n if (status === 'failed' || status === 'outcome_unknown') return [17, 'ERROR'];\n if (status === 'blocked' || status === 'cancelled') return [13, 'WARN'];\n return [9, 'INFO'];\n}\nfunction record(event: RunEvent): JsonObject {\n const [severityNumber, severityText] = severity(event);\n const attributes = [attribute('mayura.run.id', event.runId), attribute('mayura.event.sequence', event.sequence)];\n for (const [key, value] of Object.entries(event.metadata)) attributes.push(attribute(`mayura.${key}`, value));\n return {\n timeUnixNano: (BigInt(Date.parse(event.timestamp)) * 1_000_000n).toString(),\n severityNumber, severityText, body: { stringValue: event.type }, attributes,\n };\n}\nfunction request(events: readonly RunEvent[], serviceName: string, serviceVersion?: string): JsonObject {\n const attributes = [attribute('service.name', serviceName)];\n if (serviceVersion) attributes.push(attribute('service.version', serviceVersion));\n return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, logRecords: events.map(record) }] }] };\n}\n\nasync function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void operation.catch(() => undefined); throw signal.reason; }\n let listener: (() => void) | undefined;\n try {\n return await Promise.race([operation, new Promise<never>((_, reject) => {\n listener = () => reject(signal.reason); signal.addEventListener('abort', listener, { once: true });\n if (signal.aborted) listener();\n })]);\n } finally { if (listener) signal.removeEventListener('abort', listener); }\n}\nasync function responsePayload(response: Response, limit: number, signal: AbortSignal, charge: (bytes: number) => void): Promise<JsonObject> {\n if (response.status !== 200 || response.redirected) { void response.body?.cancel().catch(() => undefined); return failed(); }\n if (!response.body) return {};\n const length = response.headers.get('content-length');\n if (length !== null && (!/^\\d+$/.test(length) || Number(length) > limit)) { void response.body.cancel().catch(() => undefined); return failed(); }\n const reader = response.body.getReader(); const chunks: Uint8Array[] = []; let size = 0;\n try {\n for (;;) {\n const item = await abortable(reader.read(), signal);\n if (item.done) break;\n size += item.value.byteLength; charge(item.value.byteLength);\n if (size > limit) return failed();\n chunks.push(item.value);\n }\n if (size === 0) return {};\n const bytes = new Uint8Array(size); let offset = 0;\n for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }\n const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);\n const type = response.headers.get('content-type') ?? '';\n if (!/^application\\/json(?:\\s*;|$)/iu.test(type)) {\n // Some services (LangSmith) answer full success as `{}` labelled text/plain. Only that empty answer is taken\n // without the JSON type: anything that could report partial success must say it is JSON.\n if (/^text\\/plain(?:\\s*;|$)/iu.test(type) && text.trim() === '{}') return {};\n return failed();\n }\n return object(jsonValue(JSON.parse(text), { maxBytes: limit, maxDepth: 8, maxNodes: 1_024 }));\n } finally { void reader.cancel().catch(() => undefined); reader.releaseLock(); }\n}\nfunction rejectedRecords(payload: JsonObject, sent: number): number {\n const partial = payload['partialSuccess'];\n if (partial === undefined) return 0;\n const value = object(partial)['rejectedLogRecords'];\n if (value === undefined) return 0;\n const text = typeof value === 'number' && Number.isSafeInteger(value) ? String(value) : value;\n if (typeof text !== 'string' || !/^\\d{1,20}$/.test(text)) return failed();\n const rejected = BigInt(text);\n if (rejected > BigInt(sent)) return failed();\n return Number(rejected);\n}\n\n/** Explicit OTLP/HTTP JSON log export with bounded metadata-only delivery and no retries. */\nexport function createOtlpHttpJsonLogExporter(options: OtlpHttpJsonLogExporterOptions): OtlpHttpJsonLogExporter {\n let config: typeof defaults; let destination: string; let serviceName: string; let serviceVersion: string | undefined;\n let transport: typeof globalThis.fetch; let fixedHeaders: Readonly<Record<string, string>>;\n try {\n const allowInsecureLoopback = options.allowInsecureLoopback ?? false;\n if (typeof allowInsecureLoopback !== 'boolean') throw new Error();\n config = Object.freeze(Object.fromEntries(Object.entries(defaults).map(([key, fallback]) => [key, options[key as keyof typeof defaults] ?? fallback]))) as typeof defaults;\n for (const [key, value] of Object.entries(config)) assertPositiveInteger(value, key);\n if (config.timeoutMs > 2_147_483_647 || config.maxBatchSize > 256 || config.maxRequestBytes > 16_777_216 || config.maxResponseBytes > 1_048_576) throw new Error();\n destination = endpoint(options.endpoint, allowInsecureLoopback); serviceName = stable(options.serviceName);\n serviceVersion = options.serviceVersion === undefined ? undefined : stable(options.serviceVersion);\n fixedHeaders = headers(options.headers); transport = options.fetch ?? globalThis.fetch;\n if (typeof transport !== 'function') throw new Error();\n } catch (error) {\n if (error instanceof MayuraError) throw error;\n throw new MayuraError('INVALID_CONFIG', 'OTLP exporter configuration must contain supported explicit bounds and transport.');\n }\n const metrics = Object.fromEntries(metricNames.map(key => [key, 0n])) as Record<Metric, bigint>;\n const count = (key: Metric, amount = 1): void => { metrics[key] += BigInt(amount); };\n let closed = false; let inFlight = false; let active: AbortController | undefined;\n const inspect = (): OtlpLogExporterSnapshot => Object.freeze({ state: closed ? 'closed' : 'active', inFlight,\n metrics: Object.freeze(Object.fromEntries(metricNames.map(key => [key, exact(metrics[key])]))) as unknown as OtlpLogExporterMetrics,\n });\n const sink = async (rawEvents: readonly RunEvent[], context: { readonly signal: AbortSignal }): Promise<void> => {\n if (closed) throw new MayuraError('CONFLICT', 'The telemetry exporter is closed.');\n if (inFlight) throw new MayuraError('CONFLICT', 'The telemetry exporter already has an active request.');\n if (!Array.isArray(rawEvents) || rawEvents.length === 0 || rawEvents.length > config.maxBatchSize || !(context.signal instanceof AbortSignal)) {\n if (Array.isArray(rawEvents)) count('recordsDropped', rawEvents.length);\n throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted events, a signal and supported bounds.');\n }\n count('batchesAttempted'); count('recordsAttempted', rawEvents.length);\n let events: readonly RunEvent[]; let body: string;\n try {\n events = Object.freeze(rawEvents.map(value => snapshotRunEventMetadata(value)));\n body = JSON.stringify(jsonValue(request(events, serviceName, serviceVersion), { maxBytes: config.maxRequestBytes, maxDepth: 12, maxNodes: 32_768 }));\n const bytes = new TextEncoder().encode(body).byteLength;\n if (bytes > config.maxRequestBytes) throw new Error();\n count('requestBytes', bytes);\n } catch {\n count('recordsDropped', rawEvents.length); throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted events within the configured request bound.');\n }\n const controller = new AbortController(); active = controller; inFlight = true; let timedOut = false;\n const timer = setTimeout(() => { timedOut = true; controller.abort(); }, config.timeoutMs);\n const relay = (): void => { controller.abort(); };\n context.signal.addEventListener('abort', relay, { once: true }); if (context.signal.aborted) relay();\n try {\n if (controller.signal.aborted) throw controller.signal.reason;\n const response = await abortable(Promise.resolve(transport(destination, {\n method: 'POST', headers: fixedHeaders, body, signal: controller.signal, redirect: 'error', credentials: 'omit', cache: 'no-store',\n })), controller.signal);\n const payload = await responsePayload(response, config.maxResponseBytes, controller.signal, bytes => count('responseBytes', bytes));\n const rejected = rejectedRecords(payload, events.length);\n count('recordsAccepted', events.length - rejected);\n if (rejected > 0) { count('recordsDropped', rejected); count('partialResponses'); }\n } catch {\n count('recordsDropped', events.length);\n if (timedOut) { count('timedOutRequests'); throw new MayuraError('TIMEOUT', 'The telemetry export timed out.'); }\n if (context.signal.aborted || closed) { count('cancelledRequests'); throw new MayuraError('CANCELLED', 'The telemetry export was cancelled.'); }\n count('failedRequests'); return failed();\n } finally {\n clearTimeout(timer); context.signal.removeEventListener('abort', relay); active = undefined; inFlight = false;\n }\n };\n const close = (): void => { if (!closed) { closed = true; active?.abort(); } };\n return Object.freeze({ sink, inspect, close });\n}\n"]}
@@ -168,7 +168,7 @@ function point(value) {
168
168
  }
169
169
  function resource(setup) { return { attributes: [...attributes({ 'service.name': setup.serviceName, 'service.version': setup.serviceVersion }), ...setup.resource] }; }
170
170
  function traceRequest(records, setup) {
171
- return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };
171
+ return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };
172
172
  }
173
173
  function metricRequest(records, setup) {
174
174
  const grouped = new Map();
@@ -185,7 +185,7 @@ function metricRequest(records, setup) {
185
185
  ...(first.kind === 'gauge' ? { gauge: { dataPoints: items.map(item => item.data) } }
186
186
  : { sum: { dataPoints: items.map(item => item.data), aggregationTemporality: 2, isMonotonic: first.monotonic } }) };
187
187
  });
188
- return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, metrics: encoded }] }] };
188
+ return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, metrics: encoded }] }] };
189
189
  }
190
190
  async function abortable(operation, signal) {
191
191
  if (signal.aborted) {
@@ -1 +1 @@
1
- {"version":3,"file":"signals.js","sourceRoot":"","sources":["../src/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAmC,MAAM,cAAc,CAAC;AAM9G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9H,MAAM,OAAO,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,CAAU,CAAC;AAEvN,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACtI,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAC3C,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAC1C,MAAM,SAAS,GAAG,qBAA2B,CAAC;AAC9C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,uBAAuB,CAAC,CAAC,CAAC;AACxJ,4GAA4G;AAC5G,M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AAK,CAAC,CAAC;YAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAAC,MAAM,GAAG,SAAS,CAAC;YAAC,QAAQ,GAAG,KAAK,CAAC;QAAC,CAAC;IAC5H,CAAC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAS,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,MAAM,GAAG,IAAI,CAAC;YAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACnH,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,OAAyC;IACvF,OAAO,oBAAoB,CAAgB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;AAC/F,CAAC;AACD;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CAAC,OAA6C;IAC/F,OAAO,oBAAoB,CAAgB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;AAC3G,CAAC;AACD,MAAM,UAAU,gCAAgC,CAAC,OAA0C;IACzF,OAAO,oBAAoB,CAAkB,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;AACxG,CAAC","sourcesContent":["import { assertPositiveInteger, jsonValue, MayuraError, type JsonObject, type JsonValue } from '@mayura/core';\nimport type {\n ExactCount, OtlpHttpJsonMetricExporter, OtlpHttpJsonMetricExporterOptions, OtlpHttpJsonSignalExporterOptions,\n OtlpHttpJsonTraceExporter, OtlpHttpJsonTraceExporterOptions, OtlpHttpProtobufTraceExporter, OtlpHttpProtobufTraceExporterOptions, OtlpLogExporterMetrics, OtlpMetricPoint,\n OtlpExtraAttributes, OtlpSignalExporterSnapshot, OtlpSpanAttributeName, OtlpSpanAttributes, OtlpTraceSpan,\n} from './contracts.js';\nimport { otlpPartialSuccess, otlpTraceProtobuf } from './protobuf.js';\n\nconst defaults = Object.freeze({ timeoutMs: 5_000, maxBatchSize: 256, maxRequestBytes: 1_048_576, maxResponseBytes: 65_536 });\nconst metrics = ['batchesAttempted', 'recordsAttempted', 'recordsAccepted', 'recordsDropped', 'partialResponses', 'failedRequests', 'timedOutRequests', 'cancelledRequests', 'requestBytes', 'responseBytes'] as const;\ntype Metric = typeof metrics[number];\nconst stablePattern = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;\nconst headerPattern = /^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,128}$/;\nconst blockedHeaders = new Set(['connection', 'content-length', 'content-type', 'cookie', 'host', 'set-cookie', 'transfer-encoding']);\nconst decimal = /^(?:0|[1-9]\\d{0,19})$/;\nconst traceId = /^(?!0{32}$)[a-f0-9]{32}$/;\nconst spanId = /^(?!0{16}$)[a-f0-9]{16}$/;\nconst uint64Max = 18_446_744_073_709_551_615n;\nconst metricNames = new Set(['mayura.runs', 'mayura.events', 'mayura.model.calls', 'mayura.tool.calls', 'mayura.cost.micros', 'mayura.export.dropped']);\n// Keep in sync with OtlpSpanAttributeName; a key outside this set rejects the whole batch before transport.\nconst spanAttributeNames: ReadonlySet<string> = new Set<OtlpSpanAttributeName>([\n 'mayura.workflow.definition.id', 'mayura.workflow.definition.version', 'mayura.workflow.definition.digest', 'mayura.workflow.status', 'mayura.workflow.events',\n 'mayura.workflow.node.id', 'mayura.workflow.node.kind', 'mayura.workflow.step.status', 'mayura.workflow.step.code', 'mayura.workflow.receipt.execution',\n 'mayura.workflow.child.run.id', 'mayura.agent.id', 'mayura.run.status', 'mayura.model.call', 'mayura.tool.id', 'mayura.tool.version', 'mayura.tool.status',\n 'mayura.budget.spent_micros', 'mayura.budget.reserved_micros', 'mayura.budget.max_micros', 'mayura.budget.step_cost_micros', 'mayura.model.id', 'mayura.cost.micros',\n 'gen_ai.operation.name', 'gen_ai.provider.name', 'gen_ai.request.model', 'gen_ai.agent.id', 'gen_ai.agent.name', 'gen_ai.tool.name', 'gen_ai.tool.call.id', 'gen_ai.tool.type', 'gen_ai.usage.input_tokens', 'gen_ai.usage.output_tokens']);\n\nconst failed = (): never => { throw new MayuraError('TOOL_FAILED', 'The telemetry export failed. Inspect authorized local diagnostics.'); };\nfunction exact(value: bigint): ExactCount { return value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString(); }\nfunction object(value: JsonValue | undefined): JsonObject { if (!value || typeof value !== 'object' || Array.isArray(value)) return failed(); return value; }\nfunction stable(value: unknown): string {\n if (typeof value !== 'string' || !stablePattern.test(value)) throw new MayuraError('INVALID_CONFIG', 'Exporter names must be bounded stable identifiers.');\n return value;\n}\nfunction destination(value: unknown, signal: 'traces' | 'metrics', allowLoopback: boolean, standardPath: boolean): string {\n try {\n if (typeof value !== 'string' || value.length > 2_048) throw new Error(); const url = new URL(value);\n const loopback = ['127.0.0.1', '[::1]'].includes(url.hostname);\n if ((url.protocol !== 'https:' && !(allowLoopback && url.protocol === 'http:' && loopback)) || url.username || url.password || url.search || url.hash || (standardPath && !url.pathname.endsWith(`/v1/${signal}`))) throw new Error();\n return url.href;\n } catch { throw new MayuraError('INVALID_CONFIG', `OTLP ${signal} require an explicit HTTPS endpoint ending in /v1/${signal}.`); }\n}\nfunction fixedHeaders(value: OtlpHttpJsonSignalExporterOptions['headers']): Readonly<Record<string, string>> {\n try {\n if (value === undefined) return Object.freeze({ 'Content-Type': 'application/json' });\n if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw new Error();\n const descriptors = Object.getOwnPropertyDescriptors(value); const result: Record<string, string> = { 'Content-Type': 'application/json' }; const seen = new Set(['content-type']);\n if (Object.getOwnPropertySymbols(value).length || Object.keys(descriptors).length > 32) throw new Error();\n for (const [key, descriptor] of Object.entries(descriptors)) {\n const normalized = key.toLowerCase();\n if (!descriptor.enumerable || !('value' in descriptor) || !headerPattern.test(key) || blockedHeaders.has(normalized) || seen.has(normalized)\n || typeof descriptor.value !== 'string' || descriptor.value.length > 4_096 || /[\\r\\n\\0]/.test(descriptor.value)) throw new Error();\n seen.add(normalized); result[key] = descriptor.value;\n }\n return Object.freeze(result);\n } catch { throw new MayuraError('INVALID_CONFIG', 'Exporter headers must be bounded explicit HTTP fields.'); }\n}\nfunction attributes(values: Readonly<Record<string, string | undefined>>): JsonObject[] {\n return Object.entries(values).filter((entry): entry is [string, string] => entry[1] !== undefined).map(([key, value]) => ({ key, value: { stringValue: value } }));\n}\nfunction nano(value: unknown, field: string): string {\n if (typeof value !== 'string' || !decimal.test(value) || BigInt(value) > uint64Max) throw new MayuraError('INVALID_INPUT', `${field} must be an unsigned 64-bit decimal nanosecond timestamp.`);\n return value;\n}\n/** Catalog attributes, validated and encoded in key order so one span always encodes identically. */\nfunction spanAttributes(value: JsonValue | undefined): JsonObject[] {\n if (value === undefined) return [];\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n return Object.keys(value).sort().map(key => {\n const item = value[key];\n if (!spanAttributeNames.has(key) || !((typeof item === 'string' && stablePattern.test(item)) || (typeof item === 'number' && Number.isSafeInteger(item) && item >= 0))) {\n throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n }\n return { key, value: typeof item === 'string' ? { stringValue: item } : { intValue: String(item) } };\n });\n}\nconst extraKey = /^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$/u;\n/** A provider's extra attributes, checked and encoded in key order; `refuse` reports anything outside the rules. */\nfunction extraAttributes(value: unknown, reserved: ReadonlySet<string>, refuse: () => never): JsonObject[] {\n if (value === undefined) return [];\n if (!value || typeof value !== 'object' || Array.isArray(value) || (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)) return refuse();\n const descriptors = Object.getOwnPropertyDescriptors(value);\n if (Object.getOwnPropertySymbols(value).length || Object.keys(descriptors).length > 16) return refuse();\n return Object.keys(descriptors).sort().map(key => {\n const descriptor = descriptors[key]!; const item: unknown = descriptor.value;\n if (!descriptor.enumerable || !('value' in descriptor) || key.length > 128 || !extraKey.test(key) || reserved.has(key) || key.startsWith('mayura.') || key.startsWith('service.')\n || !((typeof item === 'string' && stablePattern.test(item)) || (typeof item === 'number' && Number.isSafeInteger(item) && item >= 0))) return refuse();\n return { key, value: typeof item === 'string' ? { stringValue: item } : { intValue: String(item) } };\n });\n}\nconst refusedSpan = (): never => { throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.'); };\ntype SpanAttributeHook = (span: OtlpTraceSpan) => OtlpExtraAttributes | undefined;\ninterface EncodeSetup { readonly serviceName: string; readonly serviceVersion: string | undefined; readonly resource: readonly JsonObject[]; readonly spanAttributes: SpanAttributeHook | undefined }\n\n/** A span checked against the bounds and the attribute catalog, as a plain copy: what the OTLP encoder and the OpenTelemetry bridge accept. */\nexport function checkedSpan(value: unknown): OtlpTraceSpan {\n const raw = object(jsonValue(value, { maxBytes: 8_192, maxDepth: 4, maxNodes: 96 }));\n if (Object.keys(raw).some(key => !['traceId', 'spanId', 'parentSpanId', 'name', 'startTimeUnixNano', 'endTimeUnixNano', 'status', 'runId', 'attributes'].includes(key))\n || typeof raw['traceId'] !== 'string' || !traceId.test(raw['traceId']) || typeof raw['spanId'] !== 'string' || !spanId.test(raw['spanId'])\n || (raw['parentSpanId'] !== undefined && (typeof raw['parentSpanId'] !== 'string' || !spanId.test(raw['parentSpanId']) || raw['parentSpanId'] === raw['spanId']))\n || typeof raw['name'] !== 'string' || !stablePattern.test(raw['name']) || !['unset', 'ok', 'error'].includes(raw['status'] as string)\n || (raw['runId'] !== undefined && (typeof raw['runId'] !== 'string' || !stablePattern.test(raw['runId'])))) throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n const start = nano(raw['startTimeUnixNano'], 'Span start'); const end = nano(raw['endTimeUnixNano'], 'Span end');\n if (BigInt(end) < BigInt(start)) throw new MayuraError('INVALID_INPUT', 'Span end must not precede its start.');\n spanAttributes(raw['attributes']);\n return { traceId: raw['traceId'], spanId: raw['spanId'], ...(raw['parentSpanId'] === undefined ? {} : { parentSpanId: raw['parentSpanId'] as string }), name: raw['name'],\n startTimeUnixNano: start, endTimeUnixNano: end, status: raw['status'] as OtlpTraceSpan['status'], ...(raw['runId'] === undefined ? {} : { runId: raw['runId'] as string }),\n ...(raw['attributes'] === undefined ? {} : { attributes: raw['attributes'] as OtlpSpanAttributes }) };\n}\nfunction span(value: unknown, hook: SpanAttributeHook | undefined): JsonObject {\n const checked = checkedSpan(value);\n let added: JsonObject[] = [];\n if (hook) {\n let derived: unknown;\n try { derived = hook(Object.freeze({ ...checked, ...(checked.attributes === undefined ? {} : { attributes: Object.freeze({ ...checked.attributes }) }) })); } catch { return refusedSpan(); }\n added = extraAttributes(derived, spanAttributeNames, refusedSpan);\n }\n const status = checked.status === 'ok' ? 1 : checked.status === 'error' ? 2 : 0;\n return { traceId: checked.traceId, spanId: checked.spanId, ...(checked.parentSpanId === undefined ? {} : { parentSpanId: checked.parentSpanId }), name: checked.name, kind: 1,\n startTimeUnixNano: checked.startTimeUnixNano, endTimeUnixNano: checked.endTimeUnixNano, status: { code: status },\n attributes: [...attributes({ 'mayura.run.id': checked.runId }), ...spanAttributes(checked.attributes as JsonValue | undefined), ...added] };\n}\nfunction point(value: unknown): { readonly name: string; readonly kind: 'gauge'; readonly data: JsonObject }\n | { readonly name: string; readonly kind: 'sum'; readonly data: JsonObject; readonly monotonic: boolean } {\n const raw = object(jsonValue(value, { maxBytes: 4_096, maxDepth: 4, maxNodes: 32 }));\n if (Object.keys(raw).some(key => !['name', 'kind', 'value', 'timeUnixNano', 'startTimeUnixNano', 'monotonic', 'runId', 'profile', 'status'].includes(key))\n || typeof raw['name'] !== 'string' || !metricNames.has(raw['name']) || !['gauge', 'sum'].includes(raw['kind'] as string)\n || typeof raw['value'] !== 'number' || !Number.isFinite(raw['value']) || raw['value'] < 0\n || (raw['runId'] !== undefined && (typeof raw['runId'] !== 'string' || !stablePattern.test(raw['runId'])))\n || (raw['profile'] !== undefined && !['ephemeral', 'scheduled', 'workflow-tree'].includes(raw['profile'] as string))\n || (raw['status'] !== undefined && !['running', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown'].includes(raw['status'] as string))) throw new MayuraError('INVALID_INPUT', 'Metric point metadata is invalid.');\n const time = nano(raw['timeUnixNano'], 'Metric time'); const kind = raw['kind'] as 'gauge' | 'sum';\n if (kind === 'gauge' && (raw['startTimeUnixNano'] !== undefined || raw['monotonic'] !== undefined)) throw new MayuraError('INVALID_INPUT', 'Gauge points cannot declare sum fields.');\n if (kind === 'sum' && (raw['startTimeUnixNano'] === undefined || typeof raw['monotonic'] !== 'boolean')) throw new MayuraError('INVALID_INPUT', 'Sum points require start time and monotonicity.');\n const start = raw['startTimeUnixNano'] === undefined ? undefined : nano(raw['startTimeUnixNano'], 'Metric start');\n if (start !== undefined && BigInt(time) < BigInt(start)) throw new MayuraError('INVALID_INPUT', 'Metric time must not precede its start.');\n const data = { attributes: attributes({ 'mayura.run.id': raw['runId'] as string | undefined, 'mayura.profile': raw['profile'] as string | undefined, 'mayura.status': raw['status'] as string | undefined }),\n ...(start === undefined ? {} : { startTimeUnixNano: start }), timeUnixNano: time, asDouble: raw['value'] };\n return kind === 'gauge' ? { name: raw['name'], kind, data } : { name: raw['name'], kind, data, monotonic: raw['monotonic'] as boolean };\n}\nfunction resource(setup: EncodeSetup): JsonObject { return { attributes: [...attributes({ 'service.name': setup.serviceName, 'service.version': setup.serviceVersion }), ...setup.resource] }; }\nfunction traceRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {\n return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };\n}\nfunction metricRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {\n const grouped = new Map<string, ReturnType<typeof point>[]>();\n for (const item of records.map(point)) {\n const existing = grouped.get(item.name) ?? [];\n if (existing.some(other => other.kind !== item.kind || (other.kind === 'sum' && item.kind === 'sum' && other.monotonic !== item.monotonic))) throw new MayuraError('INVALID_INPUT', 'One metric identity cannot change aggregation within a batch.');\n existing.push(item); grouped.set(item.name, existing);\n }\n const encoded = [...grouped.values()].map(items => { const first = items[0]!; return { name: first.name,\n ...(first.kind === 'gauge' ? { gauge: { dataPoints: items.map(item => item.data) } }\n : { sum: { dataPoints: items.map(item => item.data), aggregationTemporality: 2, isMonotonic: first.monotonic } }) }; });\n return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, metrics: encoded }] }] };\n}\nasync function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void operation.catch(() => undefined); throw signal.reason; } let listener: (() => void) | undefined;\n try { return await Promise.race([operation, new Promise<never>((_, reject) => { listener = () => reject(signal.reason); signal.addEventListener('abort', listener, { once: true }); if (signal.aborted) listener(); })]); }\n finally { if (listener) signal.removeEventListener('abort', listener); }\n}\nasync function responsePayload(response: Response, limit: number, signal: AbortSignal, charge: (bytes: number) => void,\n protobuf?: 'rejectedSpans' | 'rejectedDataPoints'): Promise<JsonObject> {\n if (response.status !== 200 || response.redirected) { void response.body?.cancel().catch(() => undefined); return failed(); }\n if (!response.body) return {}; const length = response.headers.get('content-length');\n if (length !== null && (!/^\\d+$/.test(length) || Number(length) > limit)) { void response.body.cancel().catch(() => undefined); return failed(); }\n const reader = response.body.getReader(); const chunks: Uint8Array[] = []; let size = 0;\n try {\n for (;;) { const item = await abortable(reader.read(), signal); if (item.done) break; size += item.value.byteLength; charge(item.value.byteLength); if (size > limit) return failed(); chunks.push(item.value); }\n if (!size) return {}; const type = response.headers.get('content-type') ?? '';\n const bytes = new Uint8Array(size); let offset = 0; for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }\n // A protobuf request is answered in protobuf, though a collector may answer in JSON.\n if (protobuf && /^application\\/x-protobuf(?:\\s*;|$)/iu.test(type)) return otlpPartialSuccess(bytes, protobuf);\n const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);\n if (!/^application\\/json(?:\\s*;|$)/iu.test(type)) {\n // Some services (LangSmith) answer full success as `{}` labelled text/plain. Only that empty answer is taken\n // without the JSON type: anything that could report partial success must say it is JSON.\n if (/^text\\/plain(?:\\s*;|$)/iu.test(type) && text.trim() === '{}') return {};\n return failed();\n }\n return object(jsonValue(JSON.parse(text), { maxBytes: limit, maxDepth: 8, maxNodes: 1_024 }));\n } finally { void reader.cancel().catch(() => undefined); reader.releaseLock(); }\n}\nfunction rejected(payload: JsonObject, field: 'rejectedSpans' | 'rejectedDataPoints', sent: number): number {\n if (payload['partialSuccess'] === undefined) return 0; const value = object(payload['partialSuccess'])[field]; if (value === undefined) return 0;\n const text = typeof value === 'number' && Number.isSafeInteger(value) ? String(value) : value;\n if (typeof text !== 'string' || !/^\\d{1,20}$/.test(text) || BigInt(text) > BigInt(sent)) return failed(); return Number(text);\n}\n\nfunction createSignalExporter<T>(signalName: 'traces' | 'metrics', options: OtlpHttpJsonSignalExporterOptions,\n encode: (records: readonly T[], setup: EncodeSetup) => JsonObject, rejectedField: 'rejectedSpans' | 'rejectedDataPoints', format: 'json' | 'protobuf' = 'json') {\n let config: typeof defaults; let endpoint: string; let setup: EncodeSetup; let headers: Readonly<Record<string, string>>; let transport: typeof globalThis.fetch;\n try {\n const allow = options.allowInsecureLoopback ?? false; if (typeof allow !== 'boolean') throw new Error();\n config = Object.freeze(Object.fromEntries(Object.entries(defaults).map(([key, fallback]) => [key, options[key as keyof typeof defaults] ?? fallback]))) as typeof defaults;\n for (const [key, value] of Object.entries(config)) assertPositiveInteger(value, key);\n if (config.timeoutMs > 2_147_483_647 || config.maxBatchSize > 256 || config.maxRequestBytes > 16_777_216 || config.maxResponseBytes > 1_048_576) throw new Error();\n const standardPath = options.standardPath ?? true; if (typeof standardPath !== 'boolean') throw new Error();\n endpoint = destination(options.endpoint, signalName, allow, standardPath);\n const hook = (options as OtlpHttpJsonTraceExporterOptions).spanAttributes;\n if (hook !== undefined && (signalName !== 'traces' || typeof hook !== 'function')) throw new Error();\n setup = Object.freeze({ serviceName: stable(options.serviceName), serviceVersion: options.serviceVersion === undefined ? undefined : stable(options.serviceVersion),\n resource: Object.freeze(extraAttributes(options.resourceAttributes, new Set(), () => { throw new Error(); })), spanAttributes: hook });\n headers = fixedHeaders(options.headers); if (format === 'protobuf') headers = Object.freeze({ ...headers, 'Content-Type': 'application/x-protobuf' }); transport = options.fetch ?? globalThis.fetch; if (typeof transport !== 'function') throw new Error();\n } catch (error) { if (error instanceof MayuraError) throw error; throw new MayuraError('INVALID_CONFIG', 'OTLP exporter configuration must contain supported explicit bounds and transport.'); }\n const counts = Object.fromEntries(metrics.map(key => [key, 0n])) as Record<Metric, bigint>; const count = (key: Metric, amount = 1): void => { counts[key] += BigInt(amount); };\n let closed = false; let inFlight = false; let active: AbortController | undefined;\n const inspect = (): OtlpSignalExporterSnapshot => Object.freeze({ state: closed ? 'closed' : 'active', inFlight,\n metrics: Object.freeze(Object.fromEntries(metrics.map(key => [key, exact(counts[key])]))) as unknown as OtlpLogExporterMetrics });\n const sink = async (records: readonly T[], context: { readonly signal: AbortSignal }): Promise<void> => {\n if (closed || inFlight) throw new MayuraError('CONFLICT', closed ? 'The telemetry exporter is closed.' : 'The telemetry exporter already has an active request.');\n if (!Array.isArray(records) || !records.length || records.length > config.maxBatchSize || !(context.signal instanceof AbortSignal)) { if (Array.isArray(records)) count('recordsDropped', records.length); throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted records, a signal and supported bounds.'); }\n count('batchesAttempted'); count('recordsAttempted', records.length); let body: string | Uint8Array<ArrayBuffer>;\n try {\n // The OTLP/JSON request is built and checked first; protobuf is smaller, so its JSON may be up to four times the bound.\n const request = jsonValue(encode(records, setup), { maxBytes: config.maxRequestBytes * (format === 'protobuf' ? 4 : 1), maxDepth: 16, maxNodes: 32_768 });\n body = format === 'protobuf' ? otlpTraceProtobuf(object(request)) : JSON.stringify(request);\n const bytes = typeof body === 'string' ? new TextEncoder().encode(body).byteLength : body.byteLength; if (bytes > config.maxRequestBytes) throw new Error(); count('requestBytes', bytes);\n }\n catch (error) { count('recordsDropped', records.length); if (error instanceof MayuraError && error.code === 'INVALID_INPUT') throw error; throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted records within the configured request bound.'); }\n const controller = new AbortController(); active = controller; inFlight = true; let timedOut = false; const timer = setTimeout(() => { timedOut = true; controller.abort(); }, config.timeoutMs);\n const relay = (): void => controller.abort(); context.signal.addEventListener('abort', relay, { once: true }); if (context.signal.aborted) relay();\n try {\n if (controller.signal.aborted) throw controller.signal.reason;\n const response = await abortable(Promise.resolve(transport(endpoint, { method: 'POST', headers, body, signal: controller.signal, redirect: 'error', credentials: 'omit', cache: 'no-store' })), controller.signal);\n const payload = await responsePayload(response, config.maxResponseBytes, controller.signal, bytes => count('responseBytes', bytes), format === 'protobuf' ? rejectedField : undefined); const dropped = rejected(payload, rejectedField, records.length);\n count('recordsAccepted', records.length - dropped); if (dropped) { count('recordsDropped', dropped); count('partialResponses'); }\n } catch { count('recordsDropped', records.length); if (timedOut) { count('timedOutRequests'); throw new MayuraError('TIMEOUT', 'The telemetry export timed out.'); } if (context.signal.aborted || closed) { count('cancelledRequests'); throw new MayuraError('CANCELLED', 'The telemetry export was cancelled.'); } count('failedRequests'); return failed(); }\n finally { clearTimeout(timer); context.signal.removeEventListener('abort', relay); active = undefined; inFlight = false; }\n };\n return Object.freeze({ sink, inspect, close: (): void => { if (!closed) { closed = true; active?.abort(); } } });\n}\n\nexport function createOtlpHttpJsonTraceExporter(options: OtlpHttpJsonTraceExporterOptions): OtlpHttpJsonTraceExporter {\n return createSignalExporter<OtlpTraceSpan>('traces', options, traceRequest, 'rejectedSpans');\n}\n/**\n * The same trace exporter, sending OTLP's protobuf encoding (`application/x-protobuf`) for collectors and providers\n * that take only protobuf, such as Arize Phoenix. Spans are checked exactly as for JSON.\n */\nexport function createOtlpHttpProtobufTraceExporter(options: OtlpHttpProtobufTraceExporterOptions): OtlpHttpProtobufTraceExporter {\n return createSignalExporter<OtlpTraceSpan>('traces', options, traceRequest, 'rejectedSpans', 'protobuf');\n}\nexport function createOtlpHttpJsonMetricExporter(options: OtlpHttpJsonMetricExporterOptions): OtlpHttpJsonMetricExporter {\n return createSignalExporter<OtlpMetricPoint>('metrics', options, metricRequest, 'rejectedDataPoints');\n}\n"]}
1
+ {"version":3,"file":"signals.js","sourceRoot":"","sources":["../src/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAmC,MAAM,cAAc,CAAC;AAM9G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9H,MAAM,OAAO,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,CAAU,CAAC;AAEvN,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACtI,MAAM,OAAO,GAAG,uBAAuB,CAAC;AACxC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAC3C,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAC1C,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CAAC,CAAC;gBAAC,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,qCAAqC,CAAC,CAAC;YAAC,CAAC;YAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAAC,OAAO,MAAM,EAAE,CAAC;QAAC,CAAC;gBACzV,CAAC;YAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAAC,MAAM,GAAG,SAAS,CAAC;YAAC,QAAQ,GAAG,KAAK,CAAC;QAAC,CAAC;IAC5H,CAAC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAS,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,MAAM,GAAG,IAAI,CAAC;YAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACnH,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,OAAyC;IACvF,OAAO,oBAAoB,CAAgB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;AAC/F,CAAC;AACD;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CAAC,OAA6C;IAC/F,OAAO,oBAAoB,CAAgB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;AAC3G,CAAC;AACD,MAAM,UAAU,gCAAgC,CAAC,OAA0C;IACzF,OAAO,oBAAoB,CAAkB,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;AACxG,CAAC","sourcesContent":["import { assertPositiveInteger, jsonValue, MayuraError, type JsonObject, type JsonValue } from '@mayura/core';\nimport type {\n ExactCount, OtlpHttpJsonMetricExporter, OtlpHttpJsonMetricExporterOptions, OtlpHttpJsonSignalExporterOptions,\n OtlpHttpJsonTraceExporter, OtlpHttpJsonTraceExporterOptions, OtlpHttpProtobufTraceExporter, OtlpHttpProtobufTraceExporterOptions, OtlpLogExporterMetrics, OtlpMetricPoint,\n OtlpExtraAttributes, OtlpSignalExporterSnapshot, OtlpSpanAttributeName, OtlpSpanAttributes, OtlpTraceSpan,\n} from './contracts.js';\nimport { otlpPartialSuccess, otlpTraceProtobuf } from './protobuf.js';\n\nconst defaults = Object.freeze({ timeoutMs: 5_000, maxBatchSize: 256, maxRequestBytes: 1_048_576, maxResponseBytes: 65_536 });\nconst metrics = ['batchesAttempted', 'recordsAttempted', 'recordsAccepted', 'recordsDropped', 'partialResponses', 'failedRequests', 'timedOutRequests', 'cancelledRequests', 'requestBytes', 'responseBytes'] as const;\ntype Metric = typeof metrics[number];\nconst stablePattern = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;\nconst headerPattern = /^[!#$%&'*+.^_`|~0-9A-Za-z-]{1,128}$/;\nconst blockedHeaders = new Set(['connection', 'content-length', 'content-type', 'cookie', 'host', 'set-cookie', 'transfer-encoding']);\nconst decimal = /^(?:0|[1-9]\\d{0,19})$/;\nconst traceId = /^(?!0{32}$)[a-f0-9]{32}$/;\nconst spanId = /^(?!0{16}$)[a-f0-9]{16}$/;\nconst uint64Max = 18_446_744_073_709_551_615n;\nconst metricNames = new Set(['mayura.runs', 'mayura.events', 'mayura.model.calls', 'mayura.tool.calls', 'mayura.cost.micros', 'mayura.export.dropped']);\n// Keep in sync with OtlpSpanAttributeName; a key outside this set rejects the whole batch before transport.\nconst spanAttributeNames: ReadonlySet<string> = new Set<OtlpSpanAttributeName>([\n 'mayura.workflow.definition.id', 'mayura.workflow.definition.version', 'mayura.workflow.definition.digest', 'mayura.workflow.status', 'mayura.workflow.events',\n 'mayura.workflow.node.id', 'mayura.workflow.node.kind', 'mayura.workflow.step.status', 'mayura.workflow.step.code', 'mayura.workflow.receipt.execution',\n 'mayura.workflow.child.run.id', 'mayura.agent.id', 'mayura.run.status', 'mayura.model.call', 'mayura.tool.id', 'mayura.tool.version', 'mayura.tool.status',\n 'mayura.budget.spent_micros', 'mayura.budget.reserved_micros', 'mayura.budget.max_micros', 'mayura.budget.step_cost_micros', 'mayura.model.id', 'mayura.cost.micros',\n 'gen_ai.operation.name', 'gen_ai.provider.name', 'gen_ai.request.model', 'gen_ai.agent.id', 'gen_ai.agent.name', 'gen_ai.tool.name', 'gen_ai.tool.call.id', 'gen_ai.tool.type', 'gen_ai.usage.input_tokens', 'gen_ai.usage.output_tokens']);\n\nconst failed = (): never => { throw new MayuraError('TOOL_FAILED', 'The telemetry export failed. Inspect authorized local diagnostics.'); };\nfunction exact(value: bigint): ExactCount { return value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value.toString(); }\nfunction object(value: JsonValue | undefined): JsonObject { if (!value || typeof value !== 'object' || Array.isArray(value)) return failed(); return value; }\nfunction stable(value: unknown): string {\n if (typeof value !== 'string' || !stablePattern.test(value)) throw new MayuraError('INVALID_CONFIG', 'Exporter names must be bounded stable identifiers.');\n return value;\n}\nfunction destination(value: unknown, signal: 'traces' | 'metrics', allowLoopback: boolean, standardPath: boolean): string {\n try {\n if (typeof value !== 'string' || value.length > 2_048) throw new Error(); const url = new URL(value);\n const loopback = ['127.0.0.1', '[::1]'].includes(url.hostname);\n if ((url.protocol !== 'https:' && !(allowLoopback && url.protocol === 'http:' && loopback)) || url.username || url.password || url.search || url.hash || (standardPath && !url.pathname.endsWith(`/v1/${signal}`))) throw new Error();\n return url.href;\n } catch { throw new MayuraError('INVALID_CONFIG', `OTLP ${signal} require an explicit HTTPS endpoint ending in /v1/${signal}.`); }\n}\nfunction fixedHeaders(value: OtlpHttpJsonSignalExporterOptions['headers']): Readonly<Record<string, string>> {\n try {\n if (value === undefined) return Object.freeze({ 'Content-Type': 'application/json' });\n if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw new Error();\n const descriptors = Object.getOwnPropertyDescriptors(value); const result: Record<string, string> = { 'Content-Type': 'application/json' }; const seen = new Set(['content-type']);\n if (Object.getOwnPropertySymbols(value).length || Object.keys(descriptors).length > 32) throw new Error();\n for (const [key, descriptor] of Object.entries(descriptors)) {\n const normalized = key.toLowerCase();\n if (!descriptor.enumerable || !('value' in descriptor) || !headerPattern.test(key) || blockedHeaders.has(normalized) || seen.has(normalized)\n || typeof descriptor.value !== 'string' || descriptor.value.length > 4_096 || /[\\r\\n\\0]/.test(descriptor.value)) throw new Error();\n seen.add(normalized); result[key] = descriptor.value;\n }\n return Object.freeze(result);\n } catch { throw new MayuraError('INVALID_CONFIG', 'Exporter headers must be bounded explicit HTTP fields.'); }\n}\nfunction attributes(values: Readonly<Record<string, string | undefined>>): JsonObject[] {\n return Object.entries(values).filter((entry): entry is [string, string] => entry[1] !== undefined).map(([key, value]) => ({ key, value: { stringValue: value } }));\n}\nfunction nano(value: unknown, field: string): string {\n if (typeof value !== 'string' || !decimal.test(value) || BigInt(value) > uint64Max) throw new MayuraError('INVALID_INPUT', `${field} must be an unsigned 64-bit decimal nanosecond timestamp.`);\n return value;\n}\n/** Catalog attributes, validated and encoded in key order so one span always encodes identically. */\nfunction spanAttributes(value: JsonValue | undefined): JsonObject[] {\n if (value === undefined) return [];\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n return Object.keys(value).sort().map(key => {\n const item = value[key];\n if (!spanAttributeNames.has(key) || !((typeof item === 'string' && stablePattern.test(item)) || (typeof item === 'number' && Number.isSafeInteger(item) && item >= 0))) {\n throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n }\n return { key, value: typeof item === 'string' ? { stringValue: item } : { intValue: String(item) } };\n });\n}\nconst extraKey = /^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$/u;\n/** A provider's extra attributes, checked and encoded in key order; `refuse` reports anything outside the rules. */\nfunction extraAttributes(value: unknown, reserved: ReadonlySet<string>, refuse: () => never): JsonObject[] {\n if (value === undefined) return [];\n if (!value || typeof value !== 'object' || Array.isArray(value) || (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)) return refuse();\n const descriptors = Object.getOwnPropertyDescriptors(value);\n if (Object.getOwnPropertySymbols(value).length || Object.keys(descriptors).length > 16) return refuse();\n return Object.keys(descriptors).sort().map(key => {\n const descriptor = descriptors[key]!; const item: unknown = descriptor.value;\n if (!descriptor.enumerable || !('value' in descriptor) || key.length > 128 || !extraKey.test(key) || reserved.has(key) || key.startsWith('mayura.') || key.startsWith('service.')\n || !((typeof item === 'string' && stablePattern.test(item)) || (typeof item === 'number' && Number.isSafeInteger(item) && item >= 0))) return refuse();\n return { key, value: typeof item === 'string' ? { stringValue: item } : { intValue: String(item) } };\n });\n}\nconst refusedSpan = (): never => { throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.'); };\ntype SpanAttributeHook = (span: OtlpTraceSpan) => OtlpExtraAttributes | undefined;\ninterface EncodeSetup { readonly serviceName: string; readonly serviceVersion: string | undefined; readonly resource: readonly JsonObject[]; readonly spanAttributes: SpanAttributeHook | undefined }\n\n/** A span checked against the bounds and the attribute catalog, as a plain copy: what the OTLP encoder and the OpenTelemetry bridge accept. */\nexport function checkedSpan(value: unknown): OtlpTraceSpan {\n const raw = object(jsonValue(value, { maxBytes: 8_192, maxDepth: 4, maxNodes: 96 }));\n if (Object.keys(raw).some(key => !['traceId', 'spanId', 'parentSpanId', 'name', 'startTimeUnixNano', 'endTimeUnixNano', 'status', 'runId', 'attributes'].includes(key))\n || typeof raw['traceId'] !== 'string' || !traceId.test(raw['traceId']) || typeof raw['spanId'] !== 'string' || !spanId.test(raw['spanId'])\n || (raw['parentSpanId'] !== undefined && (typeof raw['parentSpanId'] !== 'string' || !spanId.test(raw['parentSpanId']) || raw['parentSpanId'] === raw['spanId']))\n || typeof raw['name'] !== 'string' || !stablePattern.test(raw['name']) || !['unset', 'ok', 'error'].includes(raw['status'] as string)\n || (raw['runId'] !== undefined && (typeof raw['runId'] !== 'string' || !stablePattern.test(raw['runId'])))) throw new MayuraError('INVALID_INPUT', 'Trace span metadata is invalid.');\n const start = nano(raw['startTimeUnixNano'], 'Span start'); const end = nano(raw['endTimeUnixNano'], 'Span end');\n if (BigInt(end) < BigInt(start)) throw new MayuraError('INVALID_INPUT', 'Span end must not precede its start.');\n spanAttributes(raw['attributes']);\n return { traceId: raw['traceId'], spanId: raw['spanId'], ...(raw['parentSpanId'] === undefined ? {} : { parentSpanId: raw['parentSpanId'] as string }), name: raw['name'],\n startTimeUnixNano: start, endTimeUnixNano: end, status: raw['status'] as OtlpTraceSpan['status'], ...(raw['runId'] === undefined ? {} : { runId: raw['runId'] as string }),\n ...(raw['attributes'] === undefined ? {} : { attributes: raw['attributes'] as OtlpSpanAttributes }) };\n}\nfunction span(value: unknown, hook: SpanAttributeHook | undefined): JsonObject {\n const checked = checkedSpan(value);\n let added: JsonObject[] = [];\n if (hook) {\n let derived: unknown;\n try { derived = hook(Object.freeze({ ...checked, ...(checked.attributes === undefined ? {} : { attributes: Object.freeze({ ...checked.attributes }) }) })); } catch { return refusedSpan(); }\n added = extraAttributes(derived, spanAttributeNames, refusedSpan);\n }\n const status = checked.status === 'ok' ? 1 : checked.status === 'error' ? 2 : 0;\n return { traceId: checked.traceId, spanId: checked.spanId, ...(checked.parentSpanId === undefined ? {} : { parentSpanId: checked.parentSpanId }), name: checked.name, kind: 1,\n startTimeUnixNano: checked.startTimeUnixNano, endTimeUnixNano: checked.endTimeUnixNano, status: { code: status },\n attributes: [...attributes({ 'mayura.run.id': checked.runId }), ...spanAttributes(checked.attributes as JsonValue | undefined), ...added] };\n}\nfunction point(value: unknown): { readonly name: string; readonly kind: 'gauge'; readonly data: JsonObject }\n | { readonly name: string; readonly kind: 'sum'; readonly data: JsonObject; readonly monotonic: boolean } {\n const raw = object(jsonValue(value, { maxBytes: 4_096, maxDepth: 4, maxNodes: 32 }));\n if (Object.keys(raw).some(key => !['name', 'kind', 'value', 'timeUnixNano', 'startTimeUnixNano', 'monotonic', 'runId', 'profile', 'status'].includes(key))\n || typeof raw['name'] !== 'string' || !metricNames.has(raw['name']) || !['gauge', 'sum'].includes(raw['kind'] as string)\n || typeof raw['value'] !== 'number' || !Number.isFinite(raw['value']) || raw['value'] < 0\n || (raw['runId'] !== undefined && (typeof raw['runId'] !== 'string' || !stablePattern.test(raw['runId'])))\n || (raw['profile'] !== undefined && !['ephemeral', 'scheduled', 'workflow-tree'].includes(raw['profile'] as string))\n || (raw['status'] !== undefined && !['running', 'succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown'].includes(raw['status'] as string))) throw new MayuraError('INVALID_INPUT', 'Metric point metadata is invalid.');\n const time = nano(raw['timeUnixNano'], 'Metric time'); const kind = raw['kind'] as 'gauge' | 'sum';\n if (kind === 'gauge' && (raw['startTimeUnixNano'] !== undefined || raw['monotonic'] !== undefined)) throw new MayuraError('INVALID_INPUT', 'Gauge points cannot declare sum fields.');\n if (kind === 'sum' && (raw['startTimeUnixNano'] === undefined || typeof raw['monotonic'] !== 'boolean')) throw new MayuraError('INVALID_INPUT', 'Sum points require start time and monotonicity.');\n const start = raw['startTimeUnixNano'] === undefined ? undefined : nano(raw['startTimeUnixNano'], 'Metric start');\n if (start !== undefined && BigInt(time) < BigInt(start)) throw new MayuraError('INVALID_INPUT', 'Metric time must not precede its start.');\n const data = { attributes: attributes({ 'mayura.run.id': raw['runId'] as string | undefined, 'mayura.profile': raw['profile'] as string | undefined, 'mayura.status': raw['status'] as string | undefined }),\n ...(start === undefined ? {} : { startTimeUnixNano: start }), timeUnixNano: time, asDouble: raw['value'] };\n return kind === 'gauge' ? { name: raw['name'], kind, data } : { name: raw['name'], kind, data, monotonic: raw['monotonic'] as boolean };\n}\nfunction resource(setup: EncodeSetup): JsonObject { return { attributes: [...attributes({ 'service.name': setup.serviceName, 'service.version': setup.serviceVersion }), ...setup.resource] }; }\nfunction traceRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {\n return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };\n}\nfunction metricRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {\n const grouped = new Map<string, ReturnType<typeof point>[]>();\n for (const item of records.map(point)) {\n const existing = grouped.get(item.name) ?? [];\n if (existing.some(other => other.kind !== item.kind || (other.kind === 'sum' && item.kind === 'sum' && other.monotonic !== item.monotonic))) throw new MayuraError('INVALID_INPUT', 'One metric identity cannot change aggregation within a batch.');\n existing.push(item); grouped.set(item.name, existing);\n }\n const encoded = [...grouped.values()].map(items => { const first = items[0]!; return { name: first.name,\n ...(first.kind === 'gauge' ? { gauge: { dataPoints: items.map(item => item.data) } }\n : { sum: { dataPoints: items.map(item => item.data), aggregationTemporality: 2, isMonotonic: first.monotonic } }) }; });\n return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, metrics: encoded }] }] };\n}\nasync function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {\n if (signal.aborted) { void operation.catch(() => undefined); throw signal.reason; } let listener: (() => void) | undefined;\n try { return await Promise.race([operation, new Promise<never>((_, reject) => { listener = () => reject(signal.reason); signal.addEventListener('abort', listener, { once: true }); if (signal.aborted) listener(); })]); }\n finally { if (listener) signal.removeEventListener('abort', listener); }\n}\nasync function responsePayload(response: Response, limit: number, signal: AbortSignal, charge: (bytes: number) => void,\n protobuf?: 'rejectedSpans' | 'rejectedDataPoints'): Promise<JsonObject> {\n if (response.status !== 200 || response.redirected) { void response.body?.cancel().catch(() => undefined); return failed(); }\n if (!response.body) return {}; const length = response.headers.get('content-length');\n if (length !== null && (!/^\\d+$/.test(length) || Number(length) > limit)) { void response.body.cancel().catch(() => undefined); return failed(); }\n const reader = response.body.getReader(); const chunks: Uint8Array[] = []; let size = 0;\n try {\n for (;;) { const item = await abortable(reader.read(), signal); if (item.done) break; size += item.value.byteLength; charge(item.value.byteLength); if (size > limit) return failed(); chunks.push(item.value); }\n if (!size) return {}; const type = response.headers.get('content-type') ?? '';\n const bytes = new Uint8Array(size); let offset = 0; for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }\n // A protobuf request is answered in protobuf, though a collector may answer in JSON.\n if (protobuf && /^application\\/x-protobuf(?:\\s*;|$)/iu.test(type)) return otlpPartialSuccess(bytes, protobuf);\n const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);\n if (!/^application\\/json(?:\\s*;|$)/iu.test(type)) {\n // Some services (LangSmith) answer full success as `{}` labelled text/plain. Only that empty answer is taken\n // without the JSON type: anything that could report partial success must say it is JSON.\n if (/^text\\/plain(?:\\s*;|$)/iu.test(type) && text.trim() === '{}') return {};\n return failed();\n }\n return object(jsonValue(JSON.parse(text), { maxBytes: limit, maxDepth: 8, maxNodes: 1_024 }));\n } finally { void reader.cancel().catch(() => undefined); reader.releaseLock(); }\n}\nfunction rejected(payload: JsonObject, field: 'rejectedSpans' | 'rejectedDataPoints', sent: number): number {\n if (payload['partialSuccess'] === undefined) return 0; const value = object(payload['partialSuccess'])[field]; if (value === undefined) return 0;\n const text = typeof value === 'number' && Number.isSafeInteger(value) ? String(value) : value;\n if (typeof text !== 'string' || !/^\\d{1,20}$/.test(text) || BigInt(text) > BigInt(sent)) return failed(); return Number(text);\n}\n\nfunction createSignalExporter<T>(signalName: 'traces' | 'metrics', options: OtlpHttpJsonSignalExporterOptions,\n encode: (records: readonly T[], setup: EncodeSetup) => JsonObject, rejectedField: 'rejectedSpans' | 'rejectedDataPoints', format: 'json' | 'protobuf' = 'json') {\n let config: typeof defaults; let endpoint: string; let setup: EncodeSetup; let headers: Readonly<Record<string, string>>; let transport: typeof globalThis.fetch;\n try {\n const allow = options.allowInsecureLoopback ?? false; if (typeof allow !== 'boolean') throw new Error();\n config = Object.freeze(Object.fromEntries(Object.entries(defaults).map(([key, fallback]) => [key, options[key as keyof typeof defaults] ?? fallback]))) as typeof defaults;\n for (const [key, value] of Object.entries(config)) assertPositiveInteger(value, key);\n if (config.timeoutMs > 2_147_483_647 || config.maxBatchSize > 256 || config.maxRequestBytes > 16_777_216 || config.maxResponseBytes > 1_048_576) throw new Error();\n const standardPath = options.standardPath ?? true; if (typeof standardPath !== 'boolean') throw new Error();\n endpoint = destination(options.endpoint, signalName, allow, standardPath);\n const hook = (options as OtlpHttpJsonTraceExporterOptions).spanAttributes;\n if (hook !== undefined && (signalName !== 'traces' || typeof hook !== 'function')) throw new Error();\n setup = Object.freeze({ serviceName: stable(options.serviceName), serviceVersion: options.serviceVersion === undefined ? undefined : stable(options.serviceVersion),\n resource: Object.freeze(extraAttributes(options.resourceAttributes, new Set(), () => { throw new Error(); })), spanAttributes: hook });\n headers = fixedHeaders(options.headers); if (format === 'protobuf') headers = Object.freeze({ ...headers, 'Content-Type': 'application/x-protobuf' }); transport = options.fetch ?? globalThis.fetch; if (typeof transport !== 'function') throw new Error();\n } catch (error) { if (error instanceof MayuraError) throw error; throw new MayuraError('INVALID_CONFIG', 'OTLP exporter configuration must contain supported explicit bounds and transport.'); }\n const counts = Object.fromEntries(metrics.map(key => [key, 0n])) as Record<Metric, bigint>; const count = (key: Metric, amount = 1): void => { counts[key] += BigInt(amount); };\n let closed = false; let inFlight = false; let active: AbortController | undefined;\n const inspect = (): OtlpSignalExporterSnapshot => Object.freeze({ state: closed ? 'closed' : 'active', inFlight,\n metrics: Object.freeze(Object.fromEntries(metrics.map(key => [key, exact(counts[key])]))) as unknown as OtlpLogExporterMetrics });\n const sink = async (records: readonly T[], context: { readonly signal: AbortSignal }): Promise<void> => {\n if (closed || inFlight) throw new MayuraError('CONFLICT', closed ? 'The telemetry exporter is closed.' : 'The telemetry exporter already has an active request.');\n if (!Array.isArray(records) || !records.length || records.length > config.maxBatchSize || !(context.signal instanceof AbortSignal)) { if (Array.isArray(records)) count('recordsDropped', records.length); throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted records, a signal and supported bounds.'); }\n count('batchesAttempted'); count('recordsAttempted', records.length); let body: string | Uint8Array<ArrayBuffer>;\n try {\n // The OTLP/JSON request is built and checked first; protobuf is smaller, so its JSON may be up to four times the bound.\n const request = jsonValue(encode(records, setup), { maxBytes: config.maxRequestBytes * (format === 'protobuf' ? 4 : 1), maxDepth: 16, maxNodes: 32_768 });\n body = format === 'protobuf' ? otlpTraceProtobuf(object(request)) : JSON.stringify(request);\n const bytes = typeof body === 'string' ? new TextEncoder().encode(body).byteLength : body.byteLength; if (bytes > config.maxRequestBytes) throw new Error(); count('requestBytes', bytes);\n }\n catch (error) { count('recordsDropped', records.length); if (error instanceof MayuraError && error.code === 'INVALID_INPUT') throw error; throw new MayuraError('INVALID_INPUT', 'Telemetry batches require admitted records within the configured request bound.'); }\n const controller = new AbortController(); active = controller; inFlight = true; let timedOut = false; const timer = setTimeout(() => { timedOut = true; controller.abort(); }, config.timeoutMs);\n const relay = (): void => controller.abort(); context.signal.addEventListener('abort', relay, { once: true }); if (context.signal.aborted) relay();\n try {\n if (controller.signal.aborted) throw controller.signal.reason;\n const response = await abortable(Promise.resolve(transport(endpoint, { method: 'POST', headers, body, signal: controller.signal, redirect: 'error', credentials: 'omit', cache: 'no-store' })), controller.signal);\n const payload = await responsePayload(response, config.maxResponseBytes, controller.signal, bytes => count('responseBytes', bytes), format === 'protobuf' ? rejectedField : undefined); const dropped = rejected(payload, rejectedField, records.length);\n count('recordsAccepted', records.length - dropped); if (dropped) { count('recordsDropped', dropped); count('partialResponses'); }\n } catch { count('recordsDropped', records.length); if (timedOut) { count('timedOutRequests'); throw new MayuraError('TIMEOUT', 'The telemetry export timed out.'); } if (context.signal.aborted || closed) { count('cancelledRequests'); throw new MayuraError('CANCELLED', 'The telemetry export was cancelled.'); } count('failedRequests'); return failed(); }\n finally { clearTimeout(timer); context.signal.removeEventListener('abort', relay); active = undefined; inFlight = false; }\n };\n return Object.freeze({ sink, inspect, close: (): void => { if (!closed) { closed = true; active?.abort(); } } });\n}\n\nexport function createOtlpHttpJsonTraceExporter(options: OtlpHttpJsonTraceExporterOptions): OtlpHttpJsonTraceExporter {\n return createSignalExporter<OtlpTraceSpan>('traces', options, traceRequest, 'rejectedSpans');\n}\n/**\n * The same trace exporter, sending OTLP's protobuf encoding (`application/x-protobuf`) for collectors and providers\n * that take only protobuf, such as Arize Phoenix. Spans are checked exactly as for JSON.\n */\nexport function createOtlpHttpProtobufTraceExporter(options: OtlpHttpProtobufTraceExporterOptions): OtlpHttpProtobufTraceExporter {\n return createSignalExporter<OtlpTraceSpan>('traces', options, traceRequest, 'rejectedSpans', 'protobuf');\n}\nexport function createOtlpHttpJsonMetricExporter(options: OtlpHttpJsonMetricExporterOptions): OtlpHttpJsonMetricExporter {\n return createSignalExporter<OtlpMetricPoint>('metrics', options, metricRequest, 'rejectedDataPoints');\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -74,7 +74,7 @@ function record(event: RunEvent): JsonObject {
74
74
  function request(events: readonly RunEvent[], serviceName: string, serviceVersion?: string): JsonObject {
75
75
  const attributes = [attribute('service.name', serviceName)];
76
76
  if (serviceVersion) attributes.push(attribute('service.version', serviceVersion));
77
- return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, logRecords: events.map(record) }] }] };
77
+ return { resourceLogs: [{ resource: { attributes }, scopeLogs: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, logRecords: events.map(record) }] }] };
78
78
  }
79
79
 
80
80
  async function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {
@@ -140,7 +140,7 @@ function point(value: unknown): { readonly name: string; readonly kind: 'gauge';
140
140
  }
141
141
  function resource(setup: EncodeSetup): JsonObject { return { attributes: [...attributes({ 'service.name': setup.serviceName, 'service.version': setup.serviceVersion }), ...setup.resource] }; }
142
142
  function traceRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {
143
- return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };
143
+ return { resourceSpans: [{ resource: resource(setup), scopeSpans: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, spans: records.map(record => span(record, setup.spanAttributes)) }] }] };
144
144
  }
145
145
  function metricRequest(records: readonly unknown[], setup: EncodeSetup): JsonObject {
146
146
  const grouped = new Map<string, ReturnType<typeof point>[]>();
@@ -152,7 +152,7 @@ function metricRequest(records: readonly unknown[], setup: EncodeSetup): JsonObj
152
152
  const encoded = [...grouped.values()].map(items => { const first = items[0]!; return { name: first.name,
153
153
  ...(first.kind === 'gauge' ? { gauge: { dataPoints: items.map(item => item.data) } }
154
154
  : { sum: { dataPoints: items.map(item => item.data), aggregationTemporality: 2, isMonotonic: first.monotonic } }) }; });
155
- return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0-rc.1' }, metrics: encoded }] }] };
155
+ return { resourceMetrics: [{ resource: resource(setup), scopeMetrics: [{ scope: { name: '@mayura/observability', version: '1.2.0' }, metrics: encoded }] }] };
156
156
  }
157
157
  async function abortable<T>(operation: Promise<T>, signal: AbortSignal): Promise<T> {
158
158
  if (signal.aborted) { void operation.catch(() => undefined); throw signal.reason; } let listener: (() => void) | undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "private": true
5
5
  }
package/llms-full.txt CHANGED
@@ -396,14 +396,46 @@ Source: docs/guides/release-readiness.md
396
396
 
397
397
  Completed local and CI qualification, experimental surfaces and the checks still required before releasing Mayura V1.2.
398
398
 
399
- V1.2 is unreleased. The full release-branch qualification matrix passed on **2026-10-21** at commit
400
- `f443c76e822eef27b143d318d748ed513599e00c`. The local qualification snapshot below is retained separately;
401
- neither result establishes compatibility with unqualified real external services.
399
+ Stable V1.2 is prepared for review and is not yet published. The implementation and full-release safeguards are
400
+ merged into `main`, whose full qualification passed on **2026-10-23** at
401
+ `a9b5c565167170e4b35b5f42cf7df58a64b485e8`. The coordinated **1.2.0** version PR needs its own qualification and
402
+ green main checks after merging. The reviewed 22-package set was previously published as
403
+ **1.2.0-rc.1 under `next`**, through trusted publishing, with all existing `latest` tags unchanged. The local and
404
+ earlier release-branch snapshots below remain historical evidence; none establishes interoperability with
405
+ unqualified real external services.
402
406
 
403
407
  ## Completed CI qualification
404
408
 
405
- The **Mayura qualification** workflow, run `39576846216`, completed successfully on `release-1.2` at the commit
406
- above. All **13 configured jobs passed**, with zero failed jobs:
409
+ The [main qualification run 39903621300](https://github.com/KartikeyAI/mayura/actions/runs/39903621300) passed all
410
+ **39 jobs**, including the required **Qualification gate**: shared checks, six OS/Node consumer lanes, 12 unit-test
411
+ shards, 12 bundle shards, four database integration shards, shared runtimes and two container lanes. Linux, macOS and
412
+ Windows retain Node 22.23.2 and 24.14.1 coverage. Branch protection requires the aggregate gate. The
413
+ [main website run 39903621303](https://github.com/KartikeyAI/mayura/actions/runs/39903621303) also passed.
414
+
415
+ [PR #21](https://github.com/KartikeyAI/mayura/pull/21) passed all 39 qualification jobs before merging at the main
416
+ commit above. The full publisher now requires a committed version, exact-main qualification and source-bound
417
+ archive/receipt verification, and creates only the version tag and GitHub Release after publication. It does not
418
+ commit, rebase or push main. A local 1.2.0 rehearsal passed build, upgrade from V1.1.0, all 106 archive checks,
419
+ 450-component SBOM checks with no license findings, and 106 offline npm dry runs. These local archives are rehearsal
420
+ evidence, not the final stable publication artifacts.
421
+
422
+ The [RC1 release run 39884720470](https://github.com/KartikeyAI/mayura/actions/runs/39884720470) succeeded through
423
+ `release.yml` and the protected `release` environment at `ba4a1e868904453e533e57e2876d64ab8536c454`, after
424
+ [its 39-job main qualification](https://github.com/KartikeyAI/mayura/actions/runs/39879429442). All 22 selected archives matched
425
+ their public npm integrity metadata, every version had provenance, and `next` resolved to `1.2.0-rc.1`. Existing
426
+ `latest` values remained `1.1.0` for `mayura` and the OpenAI provider, and `1.2.0-rc.0` for the 20 newly introduced
427
+ extensions. This proves OIDC publication for those 22 packages, not the full 106-package stable release.
428
+
429
+ On **2026-10-23**, read-only npm checks confirmed that all other **84 packages** have the expected trusted-publisher
430
+ configuration: `KartikeyAI/mayura`, `release.yml`, environment `release`, and direct publishing allowed. No trust
431
+ settings were changed. The CLI readback does not expose activation or expiry status and is not proof of a successful
432
+ OIDC exchange; the first live publication remains unproven for those packages. Recheck eligibility at release time
433
+ and recreate any expired configurations. Public registry preflight also found all 106 stable `1.2.0` versions unused.
434
+
435
+ ### Historical release-branch run
436
+
437
+ The **Mayura qualification** workflow, run `39576846216`, completed successfully on `release-1.2` at
438
+ `f443c76e822eef27b143d318d748ed513599e00c`. All **13 configured jobs passed**, with zero failed jobs:
407
439
 
408
440
  | Job group | Result |
409
441
  | --- | --- |
@@ -416,8 +448,8 @@ The consumer jobs include unit tests, packed consumers, runnable examples, templ
416
448
  documentation, API/version checks, release archives and SBOM checks. Earlier failed or canceled attempts remain
417
449
  historical evidence; this result is a complete successful run on the recorded commit.
418
450
 
419
- This documentation follow-up also incorporates newer `main` changes. The updated branch and the pull-request
420
- merge commit require their own qualification; the earlier green run is not evidence for those later commits.
451
+ The later main run above supersedes this branch-only gate for its recorded source commit. Further release-tooling,
452
+ documentation or version changes still require their own green PR and main qualification.
421
453
 
422
454
  ## Completed local qualification
423
455
 
@@ -455,8 +487,11 @@ concurrent builds and unit-suite load. The subsequent complete CI pass is record
455
487
 
456
488
  ## Remaining qualifications and limitations
457
489
 
458
- - **Merge CI:** the release-branch matrix passed at the recorded commit. Require green checks for the updated
459
- branch and pull-request merge commit, then qualify `main`, the only publishing branch, before releasing.
490
+ - **Stable publication:** full-release safeguards passed PR and main qualification at the recorded source; scoped
491
+ RC1 publication passed at its separately recorded source. The stable version PR still needs review, qualification
492
+ and green main checks, then a final-source workflow rehearsal and publication approval. All other 84 publisher
493
+ configurations matched in read-only checks, but were not exercised by RC1 and their activation/expiry status was
494
+ not exposed by the CLI. Recheck eligibility and replace any expired configurations before full publication.
460
495
  - **Providers and gateways:** offline transports and the provider harness dry run passed. Paid inference, real
461
496
  embedding endpoints, gateway accounting and remote discovery behavior have not been qualified.
462
497
  - **Authorization:** OpenFGA, Cedar, Permit.io and Oso passed offline tests and package checks. Real provider/native
@@ -480,18 +515,20 @@ sufficient evidence for that claim.
480
515
 
481
516
  ## Release preparation
482
517
 
483
- 1. Review the complete V1.2 implementation, validation fixes and updated documentation in the merge pull request
484
- from `release-1.2` into `main`.
485
- 2. Require the documentation follow-up and merge commit to pass qualification; the earlier release-branch CI gate
486
- is complete at the commit recorded above.
487
- 3. Merge through the reviewed path into `main`, the only publishing branch, and require its qualification to pass.
488
- 4. Verify npm credentials or trusted publishing for the core package and extensions, the protected release
489
- environment, and the publishing enablement setting.
490
- 5. Dry-run the release workflow for **1.2.0** to regenerate versioned archives, checksums, SBOM and release notes from
491
- the final source. Publish and tag only through the approved release workflow.
492
-
493
- Source manifests remain at 1.1.0 until the release workflow applies the coordinated version bump. The release branch
494
- has been pushed for review; V1.2 has not been tagged, published or deployed.
518
+ 1. Full-release publisher/recovery changes are merged and qualified on main; review these updated release records.
519
+ 2. Review the prepared coordinated **1.2.0** version/changelog PR, committed without `[skip ci]`, merge through normal branch
520
+ protection and require the pushed main commit's complete qualification to pass. The publisher does not write main.
521
+ 3. Verify trusted publishing for all 106 packages, the protected `release` environment, tag creation permission and
522
+ publishing enablement. Preserve the experimental labels and limitations above.
523
+ 4. Rehearse **1.2.0** with `package_set=all` and `dry_run=true`, regenerating archives, checksums, SBOM and notes from
524
+ the final source. Dry runs do not validate unexercised package trust.
525
+ 5. Approve publication from that qualified main commit with `dry_run=false`. Verify all 106 versions, `latest` tags,
526
+ provenance and the source-bound tag/GitHub Release. Recover partial publication from the original run's saved
527
+ archives and receipt, without replaying accepted or uncertain uploads.
528
+
529
+ This version PR sets source manifests and version references to **1.2.0** and prepares the changelog. It does not
530
+ publish to npm, change distribution tags, create `v1.2.0` or create a stable GitHub Release. Stable publication and
531
+ deployment remain outstanding; RC1 availability is not evidence of live-service or rendered browser qualification.
495
532
 
496
533
  ---
497
534
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mayura",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0",
4
4
  "description": "A TypeScript framework for agents, typed tools and durable workflows.",
5
5
  "keywords": [
6
6
  "agents",