@skillrecordings/cli 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skill.mjs +21 -0
- package/dist/chunk-2NCCVTEE.js +22342 -0
- package/dist/chunk-2NCCVTEE.js.map +1 -0
- package/dist/chunk-3E3GYSZR.js +7071 -0
- package/dist/chunk-3E3GYSZR.js.map +1 -0
- package/dist/chunk-F4EM72IH.js +86 -0
- package/dist/chunk-F4EM72IH.js.map +1 -0
- package/dist/chunk-FGP7KUQW.js +432 -0
- package/dist/chunk-FGP7KUQW.js.map +1 -0
- package/dist/chunk-H3D6VCME.js +55 -0
- package/dist/chunk-H3D6VCME.js.map +1 -0
- package/dist/chunk-HK3PEWFD.js +208 -0
- package/dist/chunk-HK3PEWFD.js.map +1 -0
- package/dist/chunk-KEV3QKXP.js +4495 -0
- package/dist/chunk-KEV3QKXP.js.map +1 -0
- package/dist/chunk-MG37YDAK.js +882 -0
- package/dist/chunk-MG37YDAK.js.map +1 -0
- package/dist/chunk-MLNDSBZ4.js +482 -0
- package/dist/chunk-MLNDSBZ4.js.map +1 -0
- package/dist/chunk-N2WIV2JV.js +22 -0
- package/dist/chunk-N2WIV2JV.js.map +1 -0
- package/dist/chunk-PWWRCN5W.js +2067 -0
- package/dist/chunk-PWWRCN5W.js.map +1 -0
- package/dist/chunk-SKHBM3XP.js +7746 -0
- package/dist/chunk-SKHBM3XP.js.map +1 -0
- package/dist/chunk-WFANXVQG.js +64 -0
- package/dist/chunk-WFANXVQG.js.map +1 -0
- package/dist/chunk-WYKL32C3.js +275 -0
- package/dist/chunk-WYKL32C3.js.map +1 -0
- package/dist/chunk-ZNF7XD2S.js +134 -0
- package/dist/chunk-ZNF7XD2S.js.map +1 -0
- package/dist/config-AUAIYDSI.js +20 -0
- package/dist/config-AUAIYDSI.js.map +1 -0
- package/dist/fileFromPath-XN7LXIBI.js +134 -0
- package/dist/fileFromPath-XN7LXIBI.js.map +1 -0
- package/dist/getMachineId-bsd-KW2E7VK3.js +42 -0
- package/dist/getMachineId-bsd-KW2E7VK3.js.map +1 -0
- package/dist/getMachineId-darwin-ROXJUJX5.js +42 -0
- package/dist/getMachineId-darwin-ROXJUJX5.js.map +1 -0
- package/dist/getMachineId-linux-KVZEHQSU.js +34 -0
- package/dist/getMachineId-linux-KVZEHQSU.js.map +1 -0
- package/dist/getMachineId-unsupported-PPRILPPA.js +25 -0
- package/dist/getMachineId-unsupported-PPRILPPA.js.map +1 -0
- package/dist/getMachineId-win-IIF36LEJ.js +44 -0
- package/dist/getMachineId-win-IIF36LEJ.js.map +1 -0
- package/dist/index.js +112703 -0
- package/dist/index.js.map +1 -0
- package/dist/lib-R6DEEJCP.js +7623 -0
- package/dist/lib-R6DEEJCP.js.map +1 -0
- package/dist/pipeline-IAVVAKTU.js +120 -0
- package/dist/pipeline-IAVVAKTU.js.map +1 -0
- package/dist/query-NTP5NVXN.js +25 -0
- package/dist/query-NTP5NVXN.js.map +1 -0
- package/dist/routing-BAEPFB7V.js +390 -0
- package/dist/routing-BAEPFB7V.js.map +1 -0
- package/dist/stripe-lookup-charge-EPRUMZDL.js +56 -0
- package/dist/stripe-lookup-charge-EPRUMZDL.js.map +1 -0
- package/dist/stripe-payment-history-SJPKA63N.js +67 -0
- package/dist/stripe-payment-history-SJPKA63N.js.map +1 -0
- package/dist/stripe-subscription-status-L4Z65GB3.js +58 -0
- package/dist/stripe-subscription-status-L4Z65GB3.js.map +1 -0
- package/dist/stripe-verify-refund-FZDKCIUQ.js +54 -0
- package/dist/stripe-verify-refund-FZDKCIUQ.js.map +1 -0
- package/dist/support-memory-WSG7SDKG.js +10 -0
- package/dist/support-memory-WSG7SDKG.js.map +1 -0
- package/package.json +10 -7
- package/.env.encrypted +0 -0
- package/CHANGELOG.md +0 -35
- package/data/tt-archive-dataset.json +0 -1
- package/data/validate-test-dataset.json +0 -97
- package/docs/CLI-AUTH.md +0 -504
- package/preload.ts +0 -18
- package/src/__tests__/init.test.ts +0 -74
- package/src/alignment-test.ts +0 -64
- package/src/check-apps.ts +0 -16
- package/src/commands/auth/decrypt.ts +0 -123
- package/src/commands/auth/encrypt.ts +0 -81
- package/src/commands/auth/index.ts +0 -50
- package/src/commands/auth/keygen.ts +0 -41
- package/src/commands/auth/status.ts +0 -164
- package/src/commands/axiom/forensic.ts +0 -868
- package/src/commands/axiom/index.ts +0 -697
- package/src/commands/build-dataset.ts +0 -311
- package/src/commands/db-status.ts +0 -47
- package/src/commands/deploys.ts +0 -219
- package/src/commands/eval-local/compare.ts +0 -171
- package/src/commands/eval-local/health.ts +0 -212
- package/src/commands/eval-local/index.ts +0 -76
- package/src/commands/eval-local/real-tools.ts +0 -416
- package/src/commands/eval-local/run.ts +0 -1168
- package/src/commands/eval-local/score-production.ts +0 -256
- package/src/commands/eval-local/seed.ts +0 -276
- package/src/commands/eval-pipeline/index.ts +0 -53
- package/src/commands/eval-pipeline/real-tools.ts +0 -492
- package/src/commands/eval-pipeline/run.ts +0 -1316
- package/src/commands/eval-pipeline/seed.ts +0 -395
- package/src/commands/eval-prompt.ts +0 -496
- package/src/commands/eval.test.ts +0 -253
- package/src/commands/eval.ts +0 -108
- package/src/commands/faq-classify.ts +0 -460
- package/src/commands/faq-cluster.ts +0 -135
- package/src/commands/faq-extract.ts +0 -249
- package/src/commands/faq-mine.ts +0 -432
- package/src/commands/faq-review.ts +0 -426
- package/src/commands/front/index.ts +0 -351
- package/src/commands/front/pull-conversations.ts +0 -275
- package/src/commands/front/tags.ts +0 -825
- package/src/commands/front-cache.ts +0 -1277
- package/src/commands/front-stats.ts +0 -75
- package/src/commands/health.test.ts +0 -82
- package/src/commands/health.ts +0 -362
- package/src/commands/init.test.ts +0 -89
- package/src/commands/init.ts +0 -106
- package/src/commands/inngest/client.ts +0 -294
- package/src/commands/inngest/events.ts +0 -296
- package/src/commands/inngest/investigate.ts +0 -382
- package/src/commands/inngest/runs.ts +0 -149
- package/src/commands/inngest/signal.ts +0 -143
- package/src/commands/kb-sync.ts +0 -498
- package/src/commands/memory/find.ts +0 -135
- package/src/commands/memory/get.ts +0 -87
- package/src/commands/memory/index.ts +0 -97
- package/src/commands/memory/stats.ts +0 -163
- package/src/commands/memory/store.ts +0 -49
- package/src/commands/memory/vote.ts +0 -159
- package/src/commands/pipeline.ts +0 -127
- package/src/commands/responses.ts +0 -856
- package/src/commands/tools.ts +0 -293
- package/src/commands/wizard.ts +0 -319
- package/src/index.ts +0 -172
- package/src/lib/crypto.ts +0 -56
- package/src/lib/env-loader.ts +0 -206
- package/src/lib/onepassword.ts +0 -137
- package/src/test-agent-local.ts +0 -115
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -10
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_esm_shims
|
|
3
|
+
} from "./chunk-WFANXVQG.js";
|
|
4
|
+
|
|
5
|
+
// ../core/src/tools/create-tool.ts
|
|
6
|
+
init_esm_shims();
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
var globalAuditHooks = {};
|
|
9
|
+
function createTool(config) {
|
|
10
|
+
return {
|
|
11
|
+
name: config.name,
|
|
12
|
+
description: config.description,
|
|
13
|
+
parameters: config.parameters,
|
|
14
|
+
requiresApproval: config.requiresApproval,
|
|
15
|
+
execute: async (params, context) => {
|
|
16
|
+
try {
|
|
17
|
+
const validatedParams = config.parameters.parse(params);
|
|
18
|
+
try {
|
|
19
|
+
await globalAuditHooks.onPreExecute?.({
|
|
20
|
+
toolName: config.name,
|
|
21
|
+
params: validatedParams,
|
|
22
|
+
context
|
|
23
|
+
});
|
|
24
|
+
} catch (hookError) {
|
|
25
|
+
console.error(
|
|
26
|
+
"[create-tool] Pre-execution audit hook failed:",
|
|
27
|
+
hookError
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
const result = await config.execute(validatedParams, context);
|
|
31
|
+
try {
|
|
32
|
+
await globalAuditHooks.onPostExecute?.({
|
|
33
|
+
toolName: config.name,
|
|
34
|
+
params: validatedParams,
|
|
35
|
+
result,
|
|
36
|
+
context
|
|
37
|
+
});
|
|
38
|
+
} catch (hookError) {
|
|
39
|
+
console.error(
|
|
40
|
+
"[create-tool] Post-execution audit hook failed:",
|
|
41
|
+
hookError
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
data: result
|
|
47
|
+
};
|
|
48
|
+
} catch (error) {
|
|
49
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
50
|
+
try {
|
|
51
|
+
await globalAuditHooks.onError?.({
|
|
52
|
+
toolName: config.name,
|
|
53
|
+
params,
|
|
54
|
+
error: err,
|
|
55
|
+
context
|
|
56
|
+
});
|
|
57
|
+
} catch (hookError) {
|
|
58
|
+
console.error("[create-tool] Error audit hook failed:", hookError);
|
|
59
|
+
}
|
|
60
|
+
if (error instanceof z.ZodError) {
|
|
61
|
+
return {
|
|
62
|
+
success: false,
|
|
63
|
+
error: {
|
|
64
|
+
code: "VALIDATION_ERROR",
|
|
65
|
+
message: "Invalid parameters",
|
|
66
|
+
details: error.format()
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
error: {
|
|
73
|
+
code: "EXECUTION_ERROR",
|
|
74
|
+
message: err.message,
|
|
75
|
+
details: err.stack
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
createTool
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=chunk-F4EM72IH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../core/src/tools/create-tool.ts"],"sourcesContent":["import { z } from 'zod'\nimport type {\n ExecutionContext,\n SupportTool,\n ToolContext,\n ToolResult,\n} from './types'\n\n/**\n * Configuration for creating a support tool.\n *\n * @typeParam TInput - Input type (what callers pass in)\n * @typeParam TOutput - Output type (after Zod parsing, with defaults applied)\n * @typeParam TResult - Tool result type\n */\nexport interface CreateToolConfig<TInput, TOutput, TResult> {\n /**\n * Unique tool identifier (snake_case)\n */\n name: string\n\n /**\n * Human-readable description for agent context\n */\n description: string\n\n /**\n * Zod schema for parameter validation\n */\n parameters: z.ZodType<TOutput, TInput>\n\n /**\n * Optional approval gate (receives parsed/validated params)\n */\n requiresApproval?: (params: TOutput, context: ToolContext) => boolean\n\n /**\n * Tool execution function (receives parsed/validated params)\n */\n execute: (params: TOutput, context: ExecutionContext) => Promise<TResult>\n}\n\n/**\n * Audit logging hooks\n */\nexport interface AuditHooks {\n /**\n * Called before tool execution\n */\n onPreExecute?: (config: {\n toolName: string\n params: unknown\n context: ExecutionContext\n }) => Promise<void> | void\n\n /**\n * Called after successful execution\n */\n onPostExecute?: (config: {\n toolName: string\n params: unknown\n result: unknown\n context: ExecutionContext\n }) => Promise<void> | void\n\n /**\n * Called on execution error\n */\n onError?: (config: {\n toolName: string\n params: unknown\n error: Error\n context: ExecutionContext\n }) => Promise<void> | void\n}\n\n/**\n * Global audit hooks registry\n */\nlet globalAuditHooks: AuditHooks = {}\n\n/**\n * Register global audit hooks for all tools.\n *\n * @param hooks - Audit logging callbacks\n */\nexport function setAuditHooks(hooks: AuditHooks): void {\n globalAuditHooks = hooks\n}\n\n/**\n * Create a type-safe support tool with parameter validation and error handling.\n *\n * @param config - Tool configuration\n * @returns Wrapped SupportTool with validation and audit logging\n *\n * @example\n * ```typescript\n * const lookupUser = createTool({\n * name: 'lookup_user',\n * description: 'Look up user by email',\n * parameters: z.object({\n * email: z.string().email(),\n * appId: z.string(),\n * }),\n * execute: async ({ email, appId }) => {\n * const app = await appRegistry.get(appId)\n * return app.integration.lookupUser(email)\n * },\n * })\n * ```\n */\nexport function createTool<TInput, TOutput, TResult>(\n config: CreateToolConfig<TInput, TOutput, TResult>\n): SupportTool<TInput, TOutput, TResult> {\n return {\n name: config.name,\n description: config.description,\n parameters: config.parameters,\n requiresApproval: config.requiresApproval,\n\n execute: async (\n params: TInput,\n context: ExecutionContext\n ): Promise<ToolResult<TResult>> => {\n try {\n // Validate parameters\n const validatedParams = config.parameters.parse(params)\n\n // Pre-execution hook (swallow errors to prevent audit failures from blocking execution)\n try {\n await globalAuditHooks.onPreExecute?.({\n toolName: config.name,\n params: validatedParams,\n context,\n })\n } catch (hookError) {\n console.error(\n '[create-tool] Pre-execution audit hook failed:',\n hookError\n )\n }\n\n // Execute tool\n const result = await config.execute(validatedParams, context)\n\n // Post-execution hook (swallow errors to prevent audit failures from blocking execution)\n try {\n await globalAuditHooks.onPostExecute?.({\n toolName: config.name,\n params: validatedParams,\n result,\n context,\n })\n } catch (hookError) {\n console.error(\n '[create-tool] Post-execution audit hook failed:',\n hookError\n )\n }\n\n return {\n success: true,\n data: result,\n }\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error))\n\n // Error hook (swallow errors to prevent audit failures from blocking execution)\n try {\n await globalAuditHooks.onError?.({\n toolName: config.name,\n params,\n error: err,\n context,\n })\n } catch (hookError) {\n console.error('[create-tool] Error audit hook failed:', hookError)\n }\n\n // Handle Zod validation errors specifically\n if (error instanceof z.ZodError) {\n return {\n success: false,\n error: {\n code: 'VALIDATION_ERROR',\n message: 'Invalid parameters',\n details: error.format(),\n },\n }\n }\n\n // Generic error response\n return {\n success: false,\n error: {\n code: 'EXECUTION_ERROR',\n message: err.message,\n details: err.stack,\n },\n }\n }\n },\n }\n}\n"],"mappings":";;;;;AAAA;AAAA,SAAS,SAAS;AA+ElB,IAAI,mBAA+B,CAAC;AAiC7B,SAAS,WACd,QACuC;AACvC,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,YAAY,OAAO;AAAA,IACnB,kBAAkB,OAAO;AAAA,IAEzB,SAAS,OACP,QACA,YACiC;AACjC,UAAI;AAEF,cAAM,kBAAkB,OAAO,WAAW,MAAM,MAAM;AA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} from "./chunk-WFANXVQG.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js
|
|
7
|
+
var _globalThis;
|
|
8
|
+
var init_globalThis = __esm({
|
|
9
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js"() {
|
|
10
|
+
"use strict";
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
_globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/node/index.js
|
|
17
|
+
var init_node = __esm({
|
|
18
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/node/index.js"() {
|
|
19
|
+
"use strict";
|
|
20
|
+
init_esm_shims();
|
|
21
|
+
init_globalThis();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/index.js
|
|
26
|
+
var init_platform = __esm({
|
|
27
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/index.js"() {
|
|
28
|
+
"use strict";
|
|
29
|
+
init_esm_shims();
|
|
30
|
+
init_node();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/version.js
|
|
35
|
+
var VERSION;
|
|
36
|
+
var init_version = __esm({
|
|
37
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/version.js"() {
|
|
38
|
+
"use strict";
|
|
39
|
+
init_esm_shims();
|
|
40
|
+
VERSION = "1.9.0";
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
45
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
46
|
+
var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
47
|
+
var rejectedVersions = /* @__PURE__ */ new Set();
|
|
48
|
+
var myVersionMatch = ownVersion.match(re);
|
|
49
|
+
if (!myVersionMatch) {
|
|
50
|
+
return function() {
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var ownVersionParsed = {
|
|
55
|
+
major: +myVersionMatch[1],
|
|
56
|
+
minor: +myVersionMatch[2],
|
|
57
|
+
patch: +myVersionMatch[3],
|
|
58
|
+
prerelease: myVersionMatch[4]
|
|
59
|
+
};
|
|
60
|
+
if (ownVersionParsed.prerelease != null) {
|
|
61
|
+
return function isExactmatch(globalVersion) {
|
|
62
|
+
return globalVersion === ownVersion;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function _reject(v) {
|
|
66
|
+
rejectedVersions.add(v);
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
function _accept(v) {
|
|
70
|
+
acceptedVersions.add(v);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return function isCompatible2(globalVersion) {
|
|
74
|
+
if (acceptedVersions.has(globalVersion)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (rejectedVersions.has(globalVersion)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
var globalVersionMatch = globalVersion.match(re);
|
|
81
|
+
if (!globalVersionMatch) {
|
|
82
|
+
return _reject(globalVersion);
|
|
83
|
+
}
|
|
84
|
+
var globalVersionParsed = {
|
|
85
|
+
major: +globalVersionMatch[1],
|
|
86
|
+
minor: +globalVersionMatch[2],
|
|
87
|
+
patch: +globalVersionMatch[3],
|
|
88
|
+
prerelease: globalVersionMatch[4]
|
|
89
|
+
};
|
|
90
|
+
if (globalVersionParsed.prerelease != null) {
|
|
91
|
+
return _reject(globalVersion);
|
|
92
|
+
}
|
|
93
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
94
|
+
return _reject(globalVersion);
|
|
95
|
+
}
|
|
96
|
+
if (ownVersionParsed.major === 0) {
|
|
97
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
98
|
+
return _accept(globalVersion);
|
|
99
|
+
}
|
|
100
|
+
return _reject(globalVersion);
|
|
101
|
+
}
|
|
102
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
103
|
+
return _accept(globalVersion);
|
|
104
|
+
}
|
|
105
|
+
return _reject(globalVersion);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
var re, isCompatible;
|
|
109
|
+
var init_semver = __esm({
|
|
110
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js"() {
|
|
111
|
+
"use strict";
|
|
112
|
+
init_esm_shims();
|
|
113
|
+
init_version();
|
|
114
|
+
re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
115
|
+
isCompatible = _makeCompatibilityCheck(VERSION);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
120
|
+
function registerGlobal(type, instance, diag2, allowOverride) {
|
|
121
|
+
var _a;
|
|
122
|
+
if (allowOverride === void 0) {
|
|
123
|
+
allowOverride = false;
|
|
124
|
+
}
|
|
125
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
126
|
+
version: VERSION
|
|
127
|
+
};
|
|
128
|
+
if (!allowOverride && api[type]) {
|
|
129
|
+
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
130
|
+
diag2.error(err.stack || err.message);
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (api.version !== VERSION) {
|
|
134
|
+
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION);
|
|
135
|
+
diag2.error(err.stack || err.message);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
api[type] = instance;
|
|
139
|
+
diag2.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
function getGlobal(type) {
|
|
143
|
+
var _a, _b;
|
|
144
|
+
var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
145
|
+
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
149
|
+
}
|
|
150
|
+
function unregisterGlobal(type, diag2) {
|
|
151
|
+
diag2.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
|
|
152
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
153
|
+
if (api) {
|
|
154
|
+
delete api[type];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
var major, GLOBAL_OPENTELEMETRY_API_KEY, _global;
|
|
158
|
+
var init_global_utils = __esm({
|
|
159
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js"() {
|
|
160
|
+
"use strict";
|
|
161
|
+
init_esm_shims();
|
|
162
|
+
init_platform();
|
|
163
|
+
init_version();
|
|
164
|
+
init_semver();
|
|
165
|
+
major = VERSION.split(".")[0];
|
|
166
|
+
GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major);
|
|
167
|
+
_global = _globalThis;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
172
|
+
function logProxy(funcName, namespace, args) {
|
|
173
|
+
var logger = getGlobal("diag");
|
|
174
|
+
if (!logger) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
args.unshift(namespace);
|
|
178
|
+
return logger[funcName].apply(logger, __spreadArray([], __read(args), false));
|
|
179
|
+
}
|
|
180
|
+
var __read, __spreadArray, DiagComponentLogger;
|
|
181
|
+
var init_ComponentLogger = __esm({
|
|
182
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js"() {
|
|
183
|
+
"use strict";
|
|
184
|
+
init_esm_shims();
|
|
185
|
+
init_global_utils();
|
|
186
|
+
__read = function(o, n) {
|
|
187
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
188
|
+
if (!m) return o;
|
|
189
|
+
var i = m.call(o), r, ar = [], e;
|
|
190
|
+
try {
|
|
191
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
e = { error };
|
|
194
|
+
} finally {
|
|
195
|
+
try {
|
|
196
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
197
|
+
} finally {
|
|
198
|
+
if (e) throw e.error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return ar;
|
|
202
|
+
};
|
|
203
|
+
__spreadArray = function(to, from, pack) {
|
|
204
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
205
|
+
if (ar || !(i in from)) {
|
|
206
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
207
|
+
ar[i] = from[i];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
211
|
+
};
|
|
212
|
+
DiagComponentLogger = /** @class */
|
|
213
|
+
(function() {
|
|
214
|
+
function DiagComponentLogger2(props) {
|
|
215
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
216
|
+
}
|
|
217
|
+
DiagComponentLogger2.prototype.debug = function() {
|
|
218
|
+
var args = [];
|
|
219
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
220
|
+
args[_i] = arguments[_i];
|
|
221
|
+
}
|
|
222
|
+
return logProxy("debug", this._namespace, args);
|
|
223
|
+
};
|
|
224
|
+
DiagComponentLogger2.prototype.error = function() {
|
|
225
|
+
var args = [];
|
|
226
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
227
|
+
args[_i] = arguments[_i];
|
|
228
|
+
}
|
|
229
|
+
return logProxy("error", this._namespace, args);
|
|
230
|
+
};
|
|
231
|
+
DiagComponentLogger2.prototype.info = function() {
|
|
232
|
+
var args = [];
|
|
233
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
234
|
+
args[_i] = arguments[_i];
|
|
235
|
+
}
|
|
236
|
+
return logProxy("info", this._namespace, args);
|
|
237
|
+
};
|
|
238
|
+
DiagComponentLogger2.prototype.warn = function() {
|
|
239
|
+
var args = [];
|
|
240
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
241
|
+
args[_i] = arguments[_i];
|
|
242
|
+
}
|
|
243
|
+
return logProxy("warn", this._namespace, args);
|
|
244
|
+
};
|
|
245
|
+
DiagComponentLogger2.prototype.verbose = function() {
|
|
246
|
+
var args = [];
|
|
247
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
248
|
+
args[_i] = arguments[_i];
|
|
249
|
+
}
|
|
250
|
+
return logProxy("verbose", this._namespace, args);
|
|
251
|
+
};
|
|
252
|
+
return DiagComponentLogger2;
|
|
253
|
+
})();
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
258
|
+
var DiagLogLevel;
|
|
259
|
+
var init_types = __esm({
|
|
260
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/types.js"() {
|
|
261
|
+
"use strict";
|
|
262
|
+
init_esm_shims();
|
|
263
|
+
(function(DiagLogLevel2) {
|
|
264
|
+
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
265
|
+
DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
|
|
266
|
+
DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
|
|
267
|
+
DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
|
|
268
|
+
DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
|
|
269
|
+
DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
|
|
270
|
+
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
271
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
276
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
277
|
+
if (maxLevel < DiagLogLevel.NONE) {
|
|
278
|
+
maxLevel = DiagLogLevel.NONE;
|
|
279
|
+
} else if (maxLevel > DiagLogLevel.ALL) {
|
|
280
|
+
maxLevel = DiagLogLevel.ALL;
|
|
281
|
+
}
|
|
282
|
+
logger = logger || {};
|
|
283
|
+
function _filterFunc(funcName, theLevel) {
|
|
284
|
+
var theFunc = logger[funcName];
|
|
285
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
286
|
+
return theFunc.bind(logger);
|
|
287
|
+
}
|
|
288
|
+
return function() {
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
error: _filterFunc("error", DiagLogLevel.ERROR),
|
|
293
|
+
warn: _filterFunc("warn", DiagLogLevel.WARN),
|
|
294
|
+
info: _filterFunc("info", DiagLogLevel.INFO),
|
|
295
|
+
debug: _filterFunc("debug", DiagLogLevel.DEBUG),
|
|
296
|
+
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
var init_logLevelLogger = __esm({
|
|
300
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
|
|
301
|
+
"use strict";
|
|
302
|
+
init_esm_shims();
|
|
303
|
+
init_types();
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
308
|
+
var __read2, __spreadArray2, API_NAME, DiagAPI;
|
|
309
|
+
var init_diag = __esm({
|
|
310
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/diag.js"() {
|
|
311
|
+
"use strict";
|
|
312
|
+
init_esm_shims();
|
|
313
|
+
init_ComponentLogger();
|
|
314
|
+
init_logLevelLogger();
|
|
315
|
+
init_types();
|
|
316
|
+
init_global_utils();
|
|
317
|
+
__read2 = function(o, n) {
|
|
318
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
319
|
+
if (!m) return o;
|
|
320
|
+
var i = m.call(o), r, ar = [], e;
|
|
321
|
+
try {
|
|
322
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
e = { error };
|
|
325
|
+
} finally {
|
|
326
|
+
try {
|
|
327
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
328
|
+
} finally {
|
|
329
|
+
if (e) throw e.error;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return ar;
|
|
333
|
+
};
|
|
334
|
+
__spreadArray2 = function(to, from, pack) {
|
|
335
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
336
|
+
if (ar || !(i in from)) {
|
|
337
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
338
|
+
ar[i] = from[i];
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
342
|
+
};
|
|
343
|
+
API_NAME = "diag";
|
|
344
|
+
DiagAPI = /** @class */
|
|
345
|
+
(function() {
|
|
346
|
+
function DiagAPI2() {
|
|
347
|
+
function _logProxy(funcName) {
|
|
348
|
+
return function() {
|
|
349
|
+
var args = [];
|
|
350
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
351
|
+
args[_i] = arguments[_i];
|
|
352
|
+
}
|
|
353
|
+
var logger = getGlobal("diag");
|
|
354
|
+
if (!logger)
|
|
355
|
+
return;
|
|
356
|
+
return logger[funcName].apply(logger, __spreadArray2([], __read2(args), false));
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
var self = this;
|
|
360
|
+
var setLogger = function(logger, optionsOrLogLevel) {
|
|
361
|
+
var _a, _b, _c;
|
|
362
|
+
if (optionsOrLogLevel === void 0) {
|
|
363
|
+
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
364
|
+
}
|
|
365
|
+
if (logger === self) {
|
|
366
|
+
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
367
|
+
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
371
|
+
optionsOrLogLevel = {
|
|
372
|
+
logLevel: optionsOrLogLevel
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
var oldLogger = getGlobal("diag");
|
|
376
|
+
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
377
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
378
|
+
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
379
|
+
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
380
|
+
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
381
|
+
}
|
|
382
|
+
return registerGlobal("diag", newLogger, self, true);
|
|
383
|
+
};
|
|
384
|
+
self.setLogger = setLogger;
|
|
385
|
+
self.disable = function() {
|
|
386
|
+
unregisterGlobal(API_NAME, self);
|
|
387
|
+
};
|
|
388
|
+
self.createComponentLogger = function(options) {
|
|
389
|
+
return new DiagComponentLogger(options);
|
|
390
|
+
};
|
|
391
|
+
self.verbose = _logProxy("verbose");
|
|
392
|
+
self.debug = _logProxy("debug");
|
|
393
|
+
self.info = _logProxy("info");
|
|
394
|
+
self.warn = _logProxy("warn");
|
|
395
|
+
self.error = _logProxy("error");
|
|
396
|
+
}
|
|
397
|
+
DiagAPI2.instance = function() {
|
|
398
|
+
if (!this._instance) {
|
|
399
|
+
this._instance = new DiagAPI2();
|
|
400
|
+
}
|
|
401
|
+
return this._instance;
|
|
402
|
+
};
|
|
403
|
+
return DiagAPI2;
|
|
404
|
+
})();
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag-api.js
|
|
409
|
+
var diag;
|
|
410
|
+
var init_diag_api = __esm({
|
|
411
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag-api.js"() {
|
|
412
|
+
"use strict";
|
|
413
|
+
init_esm_shims();
|
|
414
|
+
init_diag();
|
|
415
|
+
diag = DiagAPI.instance();
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/index.js
|
|
420
|
+
var init_esm = __esm({
|
|
421
|
+
"../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/index.js"() {
|
|
422
|
+
"use strict";
|
|
423
|
+
init_esm_shims();
|
|
424
|
+
init_diag_api();
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
export {
|
|
429
|
+
diag,
|
|
430
|
+
init_esm
|
|
431
|
+
};
|
|
432
|
+
//# sourceMappingURL=chunk-FGP7KUQW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/platform/node/globalThis.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/platform/node/index.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/platform/index.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/version.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/internal/semver.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/internal/global-utils.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/diag/ComponentLogger.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/diag/types.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/diag/internal/logLevelLogger.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/api/diag.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/diag-api.ts","../../../node_modules/.bun/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/src/index.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexport const _globalThis = typeof globalThis === 'object' ? globalThis : global;\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './globalThis';\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './node';\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.0';\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { VERSION } from '../version';\n\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(\n ownVersion: string\n): (globalVersion: string) => boolean {\n const acceptedVersions = new Set<string>([ownVersion]);\n const rejectedVersions = new Set<string>();\n\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion: string): boolean {\n return globalVersion === ownVersion;\n };\n }\n\n function _reject(v: string) {\n rejectedVersions.add(v);\n return false;\n }\n\n function _accept(v: string) {\n acceptedVersions.add(v);\n return true;\n }\n\n return function isCompatible(globalVersion: string): boolean {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.major === 0) {\n if (\n ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch\n ) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n };\n}\n\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MeterProvider } from '../metrics/MeterProvider';\nimport { ContextManager } from '../context/types';\nimport { DiagLogger } from '../diag/types';\nimport { _globalThis } from '../platform';\nimport { TextMapPropagator } from '../propagation/TextMapPropagator';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\n\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\n `opentelemetry.js.api.${major}`\n);\n\nconst _global = _globalThis as OTelGlobal;\n\nexport function registerGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type,\n instance: OTelGlobalAPI[Type],\n diag: DiagLogger,\n allowOverride = false\n): boolean {\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[\n GLOBAL_OPENTELEMETRY_API_KEY\n ] ?? {\n version: VERSION,\n });\n\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(\n `@opentelemetry/api: Attempted duplicate registration of API: ${type}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(\n `@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n api[type] = instance;\n diag.debug(\n `@opentelemetry/api: Registered a global for ${type} v${VERSION}.`\n );\n\n return true;\n}\n\nexport function getGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type\n): OTelGlobalAPI[Type] | undefined {\n const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];\n}\n\nexport function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {\n diag.debug(\n `@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`\n );\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n\n if (api) {\n delete api[type];\n }\n}\n\ntype OTelGlobal = {\n [GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;\n};\n\ntype OTelGlobalAPI = {\n version: string;\n\n diag?: DiagLogger;\n trace?: TracerProvider;\n context?: ContextManager;\n metrics?: MeterProvider;\n propagation?: TextMapPropagator;\n};\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getGlobal } from '../internal/global-utils';\nimport { ComponentLoggerOptions, DiagLogger, DiagLogFunction } from './types';\n\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger implements DiagLogger {\n private _namespace: string;\n\n constructor(props: ComponentLoggerOptions) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n\n public debug(...args: any[]): void {\n return logProxy('debug', this._namespace, args);\n }\n\n public error(...args: any[]): void {\n return logProxy('error', this._namespace, args);\n }\n\n public info(...args: any[]): void {\n return logProxy('info', this._namespace, args);\n }\n\n public warn(...args: any[]): void {\n return logProxy('warn', this._namespace, args);\n }\n\n public verbose(...args: any[]): void {\n return logProxy('verbose', this._namespace, args);\n }\n}\n\nfunction logProxy(\n funcName: keyof DiagLogger,\n namespace: string,\n args: any\n): void {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n\n args.unshift(namespace);\n return logger[funcName](...(args as Parameters<DiagLogFunction>));\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DiagLogFunction = (message: string, ...args: unknown[]) => void;\n\n/**\n * Defines an internal diagnostic logger interface which is used to log internal diagnostic\n * messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.\n * API provided implementations include :-\n * - a No-Op {@link createNoopDiagLogger}\n * - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}\n * - a general Console {@link DiagConsoleLogger} version.\n */\nexport interface DiagLogger {\n /** Log an error scenario that was not expected and caused the requested operation to fail. */\n error: DiagLogFunction;\n\n /**\n * Log a warning scenario to inform the developer of an issues that should be investigated.\n * The requested operation may or may not have succeeded or completed.\n */\n warn: DiagLogFunction;\n\n /**\n * Log a general informational message, this should not affect functionality.\n * This is also the default logging level so this should NOT be used for logging\n * debugging level information.\n */\n info: DiagLogFunction;\n\n /**\n * Log a general debug message that can be useful for identifying a failure.\n * Information logged at this level may include diagnostic details that would\n * help identify a failure scenario.\n * For example: Logging the order of execution of async operations.\n */\n debug: DiagLogFunction;\n\n /**\n * Log a detailed (verbose) trace level logging that can be used to identify failures\n * where debug level logging would be insufficient, this level of tracing can include\n * input and output parameters and as such may include PII information passing through\n * the API. As such it is recommended that this level of tracing should not be enabled\n * in a production environment.\n */\n verbose: DiagLogFunction;\n}\n\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport enum DiagLogLevel {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n NONE = 0,\n\n /** Identifies an error scenario */\n ERROR = 30,\n\n /** Identifies a warning scenario */\n WARN = 50,\n\n /** General informational log message */\n INFO = 60,\n\n /** General debug log message */\n DEBUG = 70,\n\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n VERBOSE = 80,\n\n /** Used to set the logging level to include all logging */\n ALL = 9999,\n}\n\n/**\n * Defines options for ComponentLogger\n */\nexport interface ComponentLoggerOptions {\n namespace: string;\n}\n\nexport interface DiagLoggerOptions {\n /**\n * The {@link DiagLogLevel} used to filter logs sent to the logger.\n *\n * @defaultValue DiagLogLevel.INFO\n */\n logLevel?: DiagLogLevel;\n\n /**\n * Setting this value to `true` will suppress the warning message normally emitted when registering a logger when another logger is already registered.\n */\n suppressOverrideMessage?: boolean;\n}\n\nexport interface DiagLoggerApi {\n /**\n * Set the global DiagLogger and DiagLogLevel.\n * If a global diag logger is already set, this will override it.\n *\n * @param logger - The {@link DiagLogger} instance to set as the default logger.\n * @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.\n * @returns `true` if the logger was successfully registered, else `false`\n */\n setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;\n\n /**\n *\n * @param logger - The {@link DiagLogger} instance to set as the default logger.\n * @param logLevel - The {@link DiagLogLevel} used to filter logs sent to the logger. If not provided it will default to {@link DiagLogLevel.INFO}.\n * @returns `true` if the logger was successfully registered, else `false`\n */\n setLogger(logger: DiagLogger, logLevel?: DiagLogLevel): boolean;\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagLogFunction, DiagLogger, DiagLogLevel } from '../types';\n\nexport function createLogLevelDiagLogger(\n maxLevel: DiagLogLevel,\n logger: DiagLogger\n): DiagLogger {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n } else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n\n // In case the logger is null or undefined\n logger = logger || {};\n\n function _filterFunc(\n funcName: keyof DiagLogger,\n theLevel: DiagLogLevel\n ): DiagLogFunction {\n const theFunc = logger[funcName];\n\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () {};\n }\n\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport {\n ComponentLoggerOptions,\n DiagLogFunction,\n DiagLogger,\n DiagLoggerApi,\n DiagLogLevel,\n} from '../diag/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\n\nconst API_NAME = 'diag';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nexport class DiagAPI implements DiagLogger, DiagLoggerApi {\n private static _instance?: DiagAPI;\n\n /** Get the singleton instance of the DiagAPI API */\n public static instance(): DiagAPI {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Private internal constructor\n * @private\n */\n private constructor() {\n function _logProxy(funcName: keyof DiagLogger): DiagLogFunction {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) return;\n return logger[funcName](...args);\n };\n }\n\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n\n // DiagAPI specific functions\n\n const setLogger: DiagLoggerApi['setLogger'] = (\n logger,\n optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }\n ) => {\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error(\n 'Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'\n );\n self.error(err.stack ?? err.message);\n return false;\n }\n\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger(\n optionsOrLogLevel.logLevel ?? DiagLogLevel.INFO,\n logger\n );\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = new Error().stack ?? '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(\n `Current logger will overwrite one already registered from ${stack}`\n );\n }\n\n return registerGlobal('diag', newLogger, self, true);\n };\n\n self.setLogger = setLogger;\n\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n\n self.createComponentLogger = (options: ComponentLoggerOptions) => {\n return new DiagComponentLogger(options);\n };\n\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n\n public setLogger!: DiagLoggerApi['setLogger'];\n /**\n *\n */\n public createComponentLogger!: (\n options: ComponentLoggerOptions\n ) => DiagLogger;\n\n // DiagLogger implementation\n public verbose!: DiagLogFunction;\n public debug!: DiagLogFunction;\n public info!: DiagLogFunction;\n public warn!: DiagLogFunction;\n public error!: DiagLogFunction;\n\n /**\n * Unregister the global logger and return to Noop\n */\n public disable!: () => void;\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexport const diag = DiagAPI.instance();\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport { Exception } from './common/Exception';\nexport { HrTime, TimeInput } from './common/Time';\nexport { Attributes, AttributeValue } from './common/Attributes';\n\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\nexport { Context, ContextManager } from './context/types';\nexport type { ContextAPI } from './api/context';\n\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport {\n DiagLogFunction,\n DiagLogger,\n DiagLogLevel,\n ComponentLoggerOptions,\n DiagLoggerOptions,\n} from './diag/types';\nexport type { DiagAPI } from './api/diag';\n\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { MeterOptions, Meter } from './metrics/Meter';\nexport { MeterProvider } from './metrics/MeterProvider';\nexport {\n ValueType,\n Counter,\n Gauge,\n Histogram,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n BatchObservableCallback,\n MetricAdvice,\n MetricAttributes,\n MetricAttributeValue,\n ObservableCallback,\n} from './metrics/Metric';\nexport {\n BatchObservableResult,\n ObservableResult,\n} from './metrics/ObservableResult';\nexport type { MetricsAPI } from './api/metrics';\n\n// Propagation APIs\nexport {\n TextMapPropagator,\n TextMapSetter,\n TextMapGetter,\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from './propagation/TextMapPropagator';\nexport type { PropagationAPI } from './api/propagation';\n\n// Trace APIs\nexport { SpanAttributes, SpanAttributeValue } from './trace/attributes';\nexport { Link } from './trace/link';\nexport { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { Sampler } from './trace/Sampler';\nexport { SamplingDecision, SamplingResult } from './trace/SamplingResult';\nexport { SpanContext } from './trace/span_context';\nexport { SpanKind } from './trace/span_kind';\nexport { Span } from './trace/span';\nexport { SpanOptions } from './trace/SpanOptions';\nexport { SpanStatus, SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { TraceState } from './trace/trace_state';\nexport { createTraceState } from './trace/internal/utils';\nexport { TracerProvider } from './trace/tracer_provider';\nexport { Tracer } from './trace/tracer';\nexport { TracerOptions } from './trace/tracer_options';\nexport {\n isSpanContextValid,\n isValidTraceId,\n isValidSpanId,\n} from './trace/spancontext-utils';\nexport {\n INVALID_SPANID,\n INVALID_TRACEID,\n INVALID_SPAN_CONTEXT,\n} from './trace/invalid-span-constants';\nexport type { TraceAPI } from './api/trace';\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n"],"mappings":";;;;;;AAAA,IAkBa;AAlBb;;;;AAkBO,IAAM,cAAc,OAAO,eAAe,WAAW,aAAa;;;;;AClBzE;;;;AAgBA;;;;;AChBA;;;;AAgBA;;;;;AChBA,IAiBa;AAjBb;;;;AAiBO,IAAM,UAAU;;;;;ACmBjB,SAAU,wBACd,YAAkB;AAElB,MAAM,mBAAmB,oBAAI,IAAY,CAAC,UAAU,CAAC;AACrD,MAAM,mBAAmB,oBAAI,IAAG;AAEhC,MAAM,iBAAiB,WAAW,MAAM,EAAE;AAC1C,MAAI,CAAC,gBAAgB;AAEnB,WAAO,WAAA;AAAM,aAAA;IAAA;;AAGf,MAAM,mBAAmB;IACvB,OAAO,CAAC,eAAe,CAAC;IACxB,OAAO,CAAC,eAAe,CAAC;IACxB,OAAO,CAAC,eAAe,CAAC;IACxB,YAAY,eAAe,CAAC;;AAI9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