@introspection-ai/recipes 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inspect.d.ts +1 -0
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +3 -0
- package/dist/inspect.js.map +1 -1
- package/dist/mcp-chunks/{auth-command-ZLGYIEUY.js → auth-command-3K7V3VCW.js} +31 -35
- package/dist/mcp-chunks/call-arguments-TX3F2TEE.js +15 -0
- package/dist/mcp-chunks/{call-command-LKTKSYTH.js → call-command-OFPHPFM5.js} +36 -34
- package/dist/mcp-chunks/chunk-2FSDGCHW.js +3299 -0
- package/dist/mcp-chunks/{chunk-BV56DXPW.js → chunk-2JHHONW4.js} +1 -1
- package/dist/mcp-chunks/chunk-2MEHGB7D.js +63 -0
- package/dist/mcp-chunks/chunk-3IZQW4H4.js +929 -0
- package/dist/mcp-chunks/{chunk-MZ2NARG7.js → chunk-54EWGONA.js} +5 -5
- package/dist/mcp-chunks/{chunk-LQQEYD76.js → chunk-55JIHDU3.js} +1 -1
- package/dist/mcp-chunks/chunk-64EP2BVO.js +39 -0
- package/dist/mcp-chunks/{chunk-LS7PMWSR.js → chunk-6D6KPSXN.js} +1 -1
- package/dist/mcp-chunks/{chunk-2XL7MG7R.js → chunk-7A63PAGP.js} +15 -9
- package/dist/mcp-chunks/chunk-7DH57OKF.js +28 -0
- package/dist/mcp-chunks/{chunk-BTLAWHTA.js → chunk-7RDLPFIO.js} +2 -2
- package/dist/mcp-chunks/chunk-C2PQFLWS.js +422 -0
- package/dist/mcp-chunks/chunk-CA5WFJZA.js +197 -0
- package/dist/mcp-chunks/{chunk-LNH5LAJD.js → chunk-CNDY7WB4.js} +2 -2
- package/dist/mcp-chunks/{chunk-UKYNQGNE.js → chunk-DEUU7WSN.js} +34 -8
- package/dist/mcp-chunks/{chunk-LKIBAYKU.js → chunk-DXPHJFSA.js} +25 -35
- package/dist/mcp-chunks/{chunk-J6LYIZXN.js → chunk-E6RVTWJY.js} +1 -1
- package/dist/mcp-chunks/{chunk-7FHEBT5G.js → chunk-E6T37ED6.js} +18 -13
- package/dist/mcp-chunks/chunk-ETWN4IIA.js +57 -0
- package/dist/mcp-chunks/{chunk-YVZKMV5H.js → chunk-F3LL4EBL.js} +1 -1
- package/dist/mcp-chunks/chunk-FWP4RACK.js +42 -0
- package/dist/mcp-chunks/{chunk-6W5QFASN.js → chunk-GFYTST6N.js} +1 -1
- package/dist/mcp-chunks/{chunk-TEUKFFQL.js → chunk-GIF7LOYU.js} +2 -2
- package/dist/mcp-chunks/{chunk-QXJUA3ND.js → chunk-GSZOK5TS.js} +828 -7
- package/dist/mcp-chunks/chunk-H7F5RZXS.js +26 -0
- package/dist/mcp-chunks/{chunk-ECIVB7P4.js → chunk-HAO6PL7Z.js} +2 -37
- package/dist/mcp-chunks/{chunk-WQJZMCJN.js → chunk-HTZ2URXW.js} +5 -3
- package/dist/mcp-chunks/{chunk-BWHIA4PC.js → chunk-JAKI24KR.js} +1 -1
- package/dist/mcp-chunks/{chunk-PWYFKGKG.js → chunk-KSGYBW3F.js} +180 -89
- package/dist/mcp-chunks/{chunk-SJCCBNZ4.js → chunk-KSMY7PXI.js} +1 -1
- package/dist/mcp-chunks/{chunk-2U4BSDC4.js → chunk-L4VKBFYI.js} +48 -29
- package/dist/mcp-chunks/{chunk-LEZSACDE.js → chunk-LICH4Q7A.js} +4 -4
- package/dist/mcp-chunks/{chunk-PIIYJR44.js → chunk-LNSUME65.js} +29 -33
- package/dist/mcp-chunks/{chunk-D3MRAZ6H.js → chunk-LWVFSQYX.js} +13974 -15562
- package/dist/mcp-chunks/{chunk-7KA2VJVZ.js → chunk-NCXEJ35U.js} +10 -5
- package/dist/mcp-chunks/{chunk-5QOSCSQB.js → chunk-NZOIX6XW.js} +2 -2
- package/dist/mcp-chunks/{chunk-XANPGTLI.js → chunk-P3RN22HQ.js} +11 -4
- package/dist/mcp-chunks/{chunk-IABRYROW.js → chunk-PKOJCYNA.js} +3 -3
- package/dist/mcp-chunks/{chunk-BNV3TPE4.js → chunk-QJACOI2W.js} +5 -13
- package/dist/mcp-chunks/{chunk-UNKB4SBV.js → chunk-RBVYCKCD.js} +2 -2
- package/dist/mcp-chunks/{chunk-DHBE7UBH.js → chunk-SB2UUURE.js} +12 -42
- package/dist/mcp-chunks/{chunk-4SQKWYFF.js → chunk-SFREPU3D.js} +1 -1
- package/dist/mcp-chunks/{chunk-BZIQOWE6.js → chunk-SRZZQ6TL.js} +35 -36
- package/dist/mcp-chunks/{chunk-M3TPODXI.js → chunk-UENXT3NE.js} +1 -1
- package/dist/mcp-chunks/chunk-UHOKCTZT.js +37 -0
- package/dist/mcp-chunks/{chunk-E22DYOW5.js → chunk-WWO5WGH5.js} +5 -5
- package/dist/mcp-chunks/{chunk-6XCZGU3G.js → chunk-WXBPMFSN.js} +149 -192
- package/dist/mcp-chunks/{chunk-XQK2JSW4.js → chunk-XRGLP3Z2.js} +14 -2
- package/dist/mcp-chunks/{chunk-L7NTQVYN.js → chunk-XTL4MHFH.js} +28 -10
- package/dist/mcp-chunks/{chunk-N46NEFAF.js → chunk-XUF6KARU.js} +1 -1
- package/dist/mcp-chunks/{chunk-WD6BOD24.js → chunk-YCYSQA5V.js} +23 -4
- package/dist/mcp-chunks/chunk-YPJ5EHXR.js +17394 -0
- package/dist/mcp-chunks/{chunk-NRAJX5E4.js → chunk-YSPT6F7K.js} +3 -3
- package/dist/mcp-chunks/{chunk-7UDVSOOF.js → chunk-YTKRAHO6.js} +54 -46
- package/dist/mcp-chunks/chunk-ZBFZ5UFE.js +67 -0
- package/dist/mcp-chunks/{cli-UV4QJZZM.js → cli-E4P6SZLQ.js} +89 -76
- package/dist/mcp-chunks/client-2EJC4PLL.js +18 -0
- package/dist/mcp-chunks/{config-command-NLAGKID5.js → config-command-MWF3RHPQ.js} +38 -59
- package/dist/mcp-chunks/daemon-command-6CJ26MKI.js +33 -0
- package/dist/mcp-chunks/{dist-LK3SHAMX.js → dist-ZIPUENTM.js} +527 -469
- package/dist/mcp-chunks/{emit-ts-command-VBXVXO6V.js → emit-ts-command-GOVJJ64A.js} +16 -13
- package/dist/mcp-chunks/{generate-cli-runner-6CAZZA3P.js → generate-cli-runner-L5OQIMEY.js} +242 -247
- package/dist/mcp-chunks/{inspect-cli-command-3ZORTOR7.js → inspect-cli-command-7OMMREPE.js} +10 -9
- package/dist/mcp-chunks/{launch-YKRXHXJI.js → launch-BWXPLPB7.js} +1 -1
- package/dist/mcp-chunks/{lifecycle-XVKRHPH3.js → lifecycle-B5UC65PT.js} +1 -1
- package/dist/mcp-chunks/{list-command-2MEGGNFQ.js → list-command-ZO4HVFQK.js} +74 -43
- package/dist/mcp-chunks/{output-utils-NKESLAJ6.js → output-utils-M3TJ2N4M.js} +3 -3
- package/dist/mcp-chunks/{prompt-B1Yc1NPt-VGOTWJMN.js → prompt-CH6TK0bC-C7OTKGRD.js} +1 -3
- package/dist/mcp-chunks/{record-command-YXHTTTT5.js → record-command-VD3HUQIC.js} +5 -4
- package/dist/mcp-chunks/replay-command-AX6IN7YD.js +42 -0
- package/dist/mcp-chunks/{resource-command-OO4NYF5C.js → resource-command-JEZ2DW2G.js} +10 -10
- package/dist/mcp-chunks/{result-utils-MOHHLNM7.js → result-utils-3YHYGS45.js} +4 -4
- package/dist/mcp-chunks/runtime-HSYVOME7.js +37 -0
- package/dist/mcp-chunks/{runtime-wrapper-RPWDIDBF.js → runtime-wrapper-UREU7GC3.js} +7 -3
- package/dist/mcp-chunks/serve-command-M47YZ6JN.js +16018 -0
- package/dist/mcp-chunks/{timeouts-W2XWCCXR.js → timeouts-THZRYP4B.js} +3 -1
- package/dist/mcp-chunks/{vault-command-PIYIUEZL.js → vault-command-53P7MLCB.js} +7 -6
- package/dist/mcp-chunks/webapi-PHEQZQKH.js +3316 -0
- package/dist/mcp-client.js +11 -1
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-daemon-client.d.ts.map +1 -1
- package/dist/mcp-daemon-client.js +3 -0
- package/dist/mcp-daemon-client.js.map +1 -1
- package/dist/mcp-daemon-protocol.d.ts +6 -0
- package/dist/mcp-daemon-protocol.d.ts.map +1 -1
- package/dist/mcp-daemon-protocol.js.map +1 -1
- package/dist/mcp-daemon.js +43 -22
- package/dist/mcp-daemon.js.map +1 -1
- package/dist/mcp-run-worker.js +29 -22
- package/dist/mcp-trace-context.d.ts +6 -0
- package/dist/mcp-trace-context.d.ts.map +1 -0
- package/dist/mcp-trace-context.js +31 -0
- package/dist/mcp-trace-context.js.map +1 -0
- package/dist/model-binding.d.ts.map +1 -1
- package/dist/model-binding.js +8 -4
- package/dist/model-binding.js.map +1 -1
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +12 -0
- package/dist/pi-extension.js.map +1 -1
- package/dist/recipe/resolve.d.ts +2 -0
- package/dist/recipe/resolve.d.ts.map +1 -1
- package/dist/recipe/resolve.js +2 -1
- package/dist/recipe/resolve.js.map +1 -1
- package/dist/recipe-agent.d.ts +5 -2
- package/dist/recipe-agent.d.ts.map +1 -1
- package/dist/recipe-agent.js +20 -4
- package/dist/recipe-agent.js.map +1 -1
- package/dist/recipe-model.d.ts +7 -1
- package/dist/recipe-model.d.ts.map +1 -1
- package/dist/recipe-model.js +89 -20
- package/dist/recipe-model.js.map +1 -1
- package/dist/recipe-session.d.ts +14 -0
- package/dist/recipe-session.d.ts.map +1 -0
- package/dist/recipe-session.js +181 -0
- package/dist/recipe-session.js.map +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +23 -1
- package/dist/session.js.map +1 -1
- package/docs/agent-composition.md +46 -22
- package/docs/pi-extension.md +9 -3
- package/docs/recipe-format.md +41 -5
- package/package.json +7 -7
- package/vendor/introspection-recipe-check/darwin-arm64/introspection-recipe-check +0 -0
- package/vendor/introspection-recipe-check/darwin-x64/introspection-recipe-check +0 -0
- package/vendor/introspection-recipe-check/linux-arm64/introspection-recipe-check +0 -0
- package/vendor/introspection-recipe-check/linux-x64/introspection-recipe-check +0 -0
- package/vendor/introspection-recipe-check/linux-x64-musl/introspection-recipe-check +0 -0
- package/vendor/introspection-recipe-check/win32-x64/introspection-recipe-check.exe +0 -0
- package/dist/mcp-chunks/call-arguments-LU3W6D3K.js +0 -13
- package/dist/mcp-chunks/chunk-HKRJ6O36.js +0 -1076
- package/dist/mcp-chunks/chunk-NNOEGEUZ.js +0 -17273
- package/dist/mcp-chunks/chunk-P3PSC54P.js +0 -869
- package/dist/mcp-chunks/chunk-TATVT5IT.js +0 -194
- package/dist/mcp-chunks/chunk-YHQUTU6L.js +0 -571
- package/dist/mcp-chunks/client-S7RQUG5U.js +0 -13
- package/dist/mcp-chunks/daemon-command-U242Z6VY.js +0 -26
- package/dist/mcp-chunks/replay-command-25HJ6AQU.js +0 -85
- package/dist/mcp-chunks/runtime-5WJ3G25Y.js +0 -33
- package/dist/mcp-chunks/serve-command-DHXJZMMN.js +0 -3302
|
@@ -2,10 +2,811 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
createCallResult,
|
|
4
4
|
describeConnectionIssue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NZOIX6XW.js";
|
|
6
6
|
import {
|
|
7
7
|
createRuntime
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2FSDGCHW.js";
|
|
9
|
+
|
|
10
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
11
|
+
function createContextKey(description) {
|
|
12
|
+
return Symbol.for(description);
|
|
13
|
+
}
|
|
14
|
+
var BaseContext = class _BaseContext {
|
|
15
|
+
/**
|
|
16
|
+
* Construct a new context which inherits values from an optional parent context.
|
|
17
|
+
*
|
|
18
|
+
* @param parentContext a context from which to inherit values
|
|
19
|
+
*/
|
|
20
|
+
constructor(parentContext) {
|
|
21
|
+
const self2 = this;
|
|
22
|
+
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
23
|
+
self2.getValue = (key) => self2._currentContext.get(key);
|
|
24
|
+
self2.setValue = (key, value) => {
|
|
25
|
+
const context2 = new _BaseContext(self2._currentContext);
|
|
26
|
+
context2._currentContext.set(key, value);
|
|
27
|
+
return context2;
|
|
28
|
+
};
|
|
29
|
+
self2.deleteValue = (key) => {
|
|
30
|
+
const context2 = new _BaseContext(self2._currentContext);
|
|
31
|
+
context2._currentContext.delete(key);
|
|
32
|
+
return context2;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var ROOT_CONTEXT = new BaseContext();
|
|
37
|
+
|
|
38
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
39
|
+
var NoopContextManager = class {
|
|
40
|
+
active() {
|
|
41
|
+
return ROOT_CONTEXT;
|
|
42
|
+
}
|
|
43
|
+
with(_context, fn, thisArg, ...args) {
|
|
44
|
+
return fn.call(thisArg, ...args);
|
|
45
|
+
}
|
|
46
|
+
bind(_context, target) {
|
|
47
|
+
return target;
|
|
48
|
+
}
|
|
49
|
+
enable() {
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
disable() {
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js
|
|
58
|
+
var VERSION = "1.9.1";
|
|
59
|
+
|
|
60
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
61
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
62
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
63
|
+
const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
64
|
+
const rejectedVersions = /* @__PURE__ */ new Set();
|
|
65
|
+
const myVersionMatch = ownVersion.match(re);
|
|
66
|
+
if (!myVersionMatch) {
|
|
67
|
+
return () => false;
|
|
68
|
+
}
|
|
69
|
+
const ownVersionParsed = {
|
|
70
|
+
major: +myVersionMatch[1],
|
|
71
|
+
minor: +myVersionMatch[2],
|
|
72
|
+
patch: +myVersionMatch[3],
|
|
73
|
+
prerelease: myVersionMatch[4]
|
|
74
|
+
};
|
|
75
|
+
if (ownVersionParsed.prerelease != null) {
|
|
76
|
+
return function isExactmatch(globalVersion) {
|
|
77
|
+
return globalVersion === ownVersion;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function _reject(v) {
|
|
81
|
+
rejectedVersions.add(v);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
function _accept(v) {
|
|
85
|
+
acceptedVersions.add(v);
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return function isCompatible2(globalVersion) {
|
|
89
|
+
if (acceptedVersions.has(globalVersion)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (rejectedVersions.has(globalVersion)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const globalVersionMatch = globalVersion.match(re);
|
|
96
|
+
if (!globalVersionMatch) {
|
|
97
|
+
return _reject(globalVersion);
|
|
98
|
+
}
|
|
99
|
+
const globalVersionParsed = {
|
|
100
|
+
major: +globalVersionMatch[1],
|
|
101
|
+
minor: +globalVersionMatch[2],
|
|
102
|
+
patch: +globalVersionMatch[3],
|
|
103
|
+
prerelease: globalVersionMatch[4]
|
|
104
|
+
};
|
|
105
|
+
if (globalVersionParsed.prerelease != null) {
|
|
106
|
+
return _reject(globalVersion);
|
|
107
|
+
}
|
|
108
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
109
|
+
return _reject(globalVersion);
|
|
110
|
+
}
|
|
111
|
+
if (ownVersionParsed.major === 0) {
|
|
112
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
113
|
+
return _accept(globalVersion);
|
|
114
|
+
}
|
|
115
|
+
return _reject(globalVersion);
|
|
116
|
+
}
|
|
117
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
118
|
+
return _accept(globalVersion);
|
|
119
|
+
}
|
|
120
|
+
return _reject(globalVersion);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
124
|
+
|
|
125
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
126
|
+
var major = VERSION.split(".")[0];
|
|
127
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for(`opentelemetry.js.api.${major}`);
|
|
128
|
+
var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
129
|
+
function registerGlobal(type, instance, diag, allowOverride = false) {
|
|
130
|
+
var _a;
|
|
131
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
132
|
+
version: VERSION
|
|
133
|
+
};
|
|
134
|
+
if (!allowOverride && api[type]) {
|
|
135
|
+
const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
|
|
136
|
+
diag.error(err.stack || err.message);
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
if (api.version !== VERSION) {
|
|
140
|
+
const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
|
|
141
|
+
diag.error(err.stack || err.message);
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
api[type] = instance;
|
|
145
|
+
diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
function getGlobal(type) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
151
|
+
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
155
|
+
}
|
|
156
|
+
function unregisterGlobal(type, diag) {
|
|
157
|
+
diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
|
|
158
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
159
|
+
if (api) {
|
|
160
|
+
delete api[type];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
165
|
+
var DiagComponentLogger = class {
|
|
166
|
+
constructor(props) {
|
|
167
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
168
|
+
}
|
|
169
|
+
debug(...args) {
|
|
170
|
+
return logProxy("debug", this._namespace, args);
|
|
171
|
+
}
|
|
172
|
+
error(...args) {
|
|
173
|
+
return logProxy("error", this._namespace, args);
|
|
174
|
+
}
|
|
175
|
+
info(...args) {
|
|
176
|
+
return logProxy("info", this._namespace, args);
|
|
177
|
+
}
|
|
178
|
+
warn(...args) {
|
|
179
|
+
return logProxy("warn", this._namespace, args);
|
|
180
|
+
}
|
|
181
|
+
verbose(...args) {
|
|
182
|
+
return logProxy("verbose", this._namespace, args);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
function logProxy(funcName, namespace, args) {
|
|
186
|
+
const logger = getGlobal("diag");
|
|
187
|
+
if (!logger) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
return logger[funcName](namespace, ...args);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
194
|
+
var DiagLogLevel;
|
|
195
|
+
(function(DiagLogLevel2) {
|
|
196
|
+
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
197
|
+
DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
|
|
198
|
+
DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
|
|
199
|
+
DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
|
|
200
|
+
DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
|
|
201
|
+
DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
|
|
202
|
+
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
203
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
204
|
+
|
|
205
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
206
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
207
|
+
if (maxLevel < DiagLogLevel.NONE) {
|
|
208
|
+
maxLevel = DiagLogLevel.NONE;
|
|
209
|
+
} else if (maxLevel > DiagLogLevel.ALL) {
|
|
210
|
+
maxLevel = DiagLogLevel.ALL;
|
|
211
|
+
}
|
|
212
|
+
logger = logger || {};
|
|
213
|
+
function _filterFunc(funcName, theLevel) {
|
|
214
|
+
const theFunc = logger[funcName];
|
|
215
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
216
|
+
return theFunc.bind(logger);
|
|
217
|
+
}
|
|
218
|
+
return function() {
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
error: _filterFunc("error", DiagLogLevel.ERROR),
|
|
223
|
+
warn: _filterFunc("warn", DiagLogLevel.WARN),
|
|
224
|
+
info: _filterFunc("info", DiagLogLevel.INFO),
|
|
225
|
+
debug: _filterFunc("debug", DiagLogLevel.DEBUG),
|
|
226
|
+
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
231
|
+
var API_NAME = "diag";
|
|
232
|
+
var DiagAPI = class _DiagAPI {
|
|
233
|
+
/** Get the singleton instance of the DiagAPI API */
|
|
234
|
+
static instance() {
|
|
235
|
+
if (!this._instance) {
|
|
236
|
+
this._instance = new _DiagAPI();
|
|
237
|
+
}
|
|
238
|
+
return this._instance;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Private internal constructor
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
constructor() {
|
|
245
|
+
function _logProxy(funcName) {
|
|
246
|
+
return function(...args) {
|
|
247
|
+
const logger = getGlobal("diag");
|
|
248
|
+
if (!logger)
|
|
249
|
+
return;
|
|
250
|
+
return logger[funcName](...args);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
const self2 = this;
|
|
254
|
+
const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
|
|
255
|
+
var _a, _b, _c;
|
|
256
|
+
if (logger === self2) {
|
|
257
|
+
const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
258
|
+
self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
262
|
+
optionsOrLogLevel = {
|
|
263
|
+
logLevel: optionsOrLogLevel
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const oldLogger = getGlobal("diag");
|
|
267
|
+
const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
268
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
269
|
+
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
270
|
+
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
271
|
+
newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
|
|
272
|
+
}
|
|
273
|
+
return registerGlobal("diag", newLogger, self2, true);
|
|
274
|
+
};
|
|
275
|
+
self2.setLogger = setLogger;
|
|
276
|
+
self2.disable = () => {
|
|
277
|
+
unregisterGlobal(API_NAME, self2);
|
|
278
|
+
};
|
|
279
|
+
self2.createComponentLogger = (options) => {
|
|
280
|
+
return new DiagComponentLogger(options);
|
|
281
|
+
};
|
|
282
|
+
self2.verbose = _logProxy("verbose");
|
|
283
|
+
self2.debug = _logProxy("debug");
|
|
284
|
+
self2.info = _logProxy("info");
|
|
285
|
+
self2.warn = _logProxy("warn");
|
|
286
|
+
self2.error = _logProxy("error");
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
291
|
+
var API_NAME2 = "context";
|
|
292
|
+
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
293
|
+
var ContextAPI = class _ContextAPI {
|
|
294
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
295
|
+
constructor() {
|
|
296
|
+
}
|
|
297
|
+
/** Get the singleton instance of the Context API */
|
|
298
|
+
static getInstance() {
|
|
299
|
+
if (!this._instance) {
|
|
300
|
+
this._instance = new _ContextAPI();
|
|
301
|
+
}
|
|
302
|
+
return this._instance;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Set the current context manager.
|
|
306
|
+
*
|
|
307
|
+
* @returns true if the context manager was successfully registered, else false
|
|
308
|
+
*/
|
|
309
|
+
setGlobalContextManager(contextManager) {
|
|
310
|
+
return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Get the currently active context
|
|
314
|
+
*/
|
|
315
|
+
active() {
|
|
316
|
+
return this._getContextManager().active();
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Execute a function with an active context
|
|
320
|
+
*
|
|
321
|
+
* @param context context to be active during function execution
|
|
322
|
+
* @param fn function to execute in a context
|
|
323
|
+
* @param thisArg optional receiver to be used for calling fn
|
|
324
|
+
* @param args optional arguments forwarded to fn
|
|
325
|
+
*/
|
|
326
|
+
with(context2, fn, thisArg, ...args) {
|
|
327
|
+
return this._getContextManager().with(context2, fn, thisArg, ...args);
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Bind a context to a target function or event emitter
|
|
331
|
+
*
|
|
332
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
333
|
+
* @param target function or event emitter to bind
|
|
334
|
+
*/
|
|
335
|
+
bind(context2, target) {
|
|
336
|
+
return this._getContextManager().bind(context2, target);
|
|
337
|
+
}
|
|
338
|
+
_getContextManager() {
|
|
339
|
+
return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
|
|
340
|
+
}
|
|
341
|
+
/** Disable and remove the global context manager */
|
|
342
|
+
disable() {
|
|
343
|
+
this._getContextManager().disable();
|
|
344
|
+
unregisterGlobal(API_NAME2, DiagAPI.instance());
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js
|
|
349
|
+
var context = ContextAPI.getInstance();
|
|
350
|
+
|
|
351
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
352
|
+
var TraceFlags;
|
|
353
|
+
(function(TraceFlags2) {
|
|
354
|
+
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
355
|
+
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
356
|
+
})(TraceFlags || (TraceFlags = {}));
|
|
357
|
+
|
|
358
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
|
|
359
|
+
var INVALID_SPANID = "0000000000000000";
|
|
360
|
+
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
361
|
+
var INVALID_SPAN_CONTEXT = {
|
|
362
|
+
traceId: INVALID_TRACEID,
|
|
363
|
+
spanId: INVALID_SPANID,
|
|
364
|
+
traceFlags: TraceFlags.NONE
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
|
|
368
|
+
var NonRecordingSpan = class {
|
|
369
|
+
constructor(spanContext = INVALID_SPAN_CONTEXT) {
|
|
370
|
+
this._spanContext = spanContext;
|
|
371
|
+
}
|
|
372
|
+
// Returns a SpanContext.
|
|
373
|
+
spanContext() {
|
|
374
|
+
return this._spanContext;
|
|
375
|
+
}
|
|
376
|
+
// By default does nothing
|
|
377
|
+
setAttribute(_key, _value) {
|
|
378
|
+
return this;
|
|
379
|
+
}
|
|
380
|
+
// By default does nothing
|
|
381
|
+
setAttributes(_attributes) {
|
|
382
|
+
return this;
|
|
383
|
+
}
|
|
384
|
+
// By default does nothing
|
|
385
|
+
addEvent(_name, _attributes) {
|
|
386
|
+
return this;
|
|
387
|
+
}
|
|
388
|
+
addLink(_link) {
|
|
389
|
+
return this;
|
|
390
|
+
}
|
|
391
|
+
addLinks(_links) {
|
|
392
|
+
return this;
|
|
393
|
+
}
|
|
394
|
+
// By default does nothing
|
|
395
|
+
setStatus(_status) {
|
|
396
|
+
return this;
|
|
397
|
+
}
|
|
398
|
+
// By default does nothing
|
|
399
|
+
updateName(_name) {
|
|
400
|
+
return this;
|
|
401
|
+
}
|
|
402
|
+
// By default does nothing
|
|
403
|
+
end(_endTime) {
|
|
404
|
+
}
|
|
405
|
+
// isRecording always returns false for NonRecordingSpan.
|
|
406
|
+
isRecording() {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
// By default does nothing
|
|
410
|
+
recordException(_exception, _time) {
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
|
|
415
|
+
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
416
|
+
function getSpan(context2) {
|
|
417
|
+
return context2.getValue(SPAN_KEY) || void 0;
|
|
418
|
+
}
|
|
419
|
+
function getActiveSpan() {
|
|
420
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
421
|
+
}
|
|
422
|
+
function setSpan(context2, span) {
|
|
423
|
+
return context2.setValue(SPAN_KEY, span);
|
|
424
|
+
}
|
|
425
|
+
function deleteSpan(context2) {
|
|
426
|
+
return context2.deleteValue(SPAN_KEY);
|
|
427
|
+
}
|
|
428
|
+
function setSpanContext(context2, spanContext) {
|
|
429
|
+
return setSpan(context2, new NonRecordingSpan(spanContext));
|
|
430
|
+
}
|
|
431
|
+
function getSpanContext(context2) {
|
|
432
|
+
var _a;
|
|
433
|
+
return (_a = getSpan(context2)) === null || _a === void 0 ? void 0 : _a.spanContext();
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
|
|
437
|
+
var isHex = new Uint8Array([
|
|
438
|
+
0,
|
|
439
|
+
0,
|
|
440
|
+
0,
|
|
441
|
+
0,
|
|
442
|
+
0,
|
|
443
|
+
0,
|
|
444
|
+
0,
|
|
445
|
+
0,
|
|
446
|
+
0,
|
|
447
|
+
0,
|
|
448
|
+
0,
|
|
449
|
+
0,
|
|
450
|
+
0,
|
|
451
|
+
0,
|
|
452
|
+
0,
|
|
453
|
+
0,
|
|
454
|
+
0,
|
|
455
|
+
0,
|
|
456
|
+
0,
|
|
457
|
+
0,
|
|
458
|
+
0,
|
|
459
|
+
0,
|
|
460
|
+
0,
|
|
461
|
+
0,
|
|
462
|
+
0,
|
|
463
|
+
0,
|
|
464
|
+
0,
|
|
465
|
+
0,
|
|
466
|
+
0,
|
|
467
|
+
0,
|
|
468
|
+
0,
|
|
469
|
+
0,
|
|
470
|
+
0,
|
|
471
|
+
0,
|
|
472
|
+
0,
|
|
473
|
+
0,
|
|
474
|
+
0,
|
|
475
|
+
0,
|
|
476
|
+
0,
|
|
477
|
+
0,
|
|
478
|
+
0,
|
|
479
|
+
0,
|
|
480
|
+
0,
|
|
481
|
+
0,
|
|
482
|
+
0,
|
|
483
|
+
0,
|
|
484
|
+
0,
|
|
485
|
+
0,
|
|
486
|
+
1,
|
|
487
|
+
1,
|
|
488
|
+
1,
|
|
489
|
+
1,
|
|
490
|
+
1,
|
|
491
|
+
1,
|
|
492
|
+
1,
|
|
493
|
+
1,
|
|
494
|
+
1,
|
|
495
|
+
1,
|
|
496
|
+
0,
|
|
497
|
+
0,
|
|
498
|
+
0,
|
|
499
|
+
0,
|
|
500
|
+
0,
|
|
501
|
+
0,
|
|
502
|
+
0,
|
|
503
|
+
1,
|
|
504
|
+
1,
|
|
505
|
+
1,
|
|
506
|
+
1,
|
|
507
|
+
1,
|
|
508
|
+
1,
|
|
509
|
+
0,
|
|
510
|
+
0,
|
|
511
|
+
0,
|
|
512
|
+
0,
|
|
513
|
+
0,
|
|
514
|
+
0,
|
|
515
|
+
0,
|
|
516
|
+
0,
|
|
517
|
+
0,
|
|
518
|
+
0,
|
|
519
|
+
0,
|
|
520
|
+
0,
|
|
521
|
+
0,
|
|
522
|
+
0,
|
|
523
|
+
0,
|
|
524
|
+
0,
|
|
525
|
+
0,
|
|
526
|
+
0,
|
|
527
|
+
0,
|
|
528
|
+
0,
|
|
529
|
+
0,
|
|
530
|
+
0,
|
|
531
|
+
0,
|
|
532
|
+
0,
|
|
533
|
+
0,
|
|
534
|
+
0,
|
|
535
|
+
1,
|
|
536
|
+
1,
|
|
537
|
+
1,
|
|
538
|
+
1,
|
|
539
|
+
1,
|
|
540
|
+
1
|
|
541
|
+
]);
|
|
542
|
+
function isValidHex(id, length) {
|
|
543
|
+
if (typeof id !== "string" || id.length !== length)
|
|
544
|
+
return false;
|
|
545
|
+
let r = 0;
|
|
546
|
+
for (let i = 0; i < id.length; i += 4) {
|
|
547
|
+
r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0);
|
|
548
|
+
}
|
|
549
|
+
return r === length;
|
|
550
|
+
}
|
|
551
|
+
function isValidTraceId(traceId) {
|
|
552
|
+
return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
|
|
553
|
+
}
|
|
554
|
+
function isValidSpanId(spanId) {
|
|
555
|
+
return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
|
|
556
|
+
}
|
|
557
|
+
function isSpanContextValid(spanContext) {
|
|
558
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
559
|
+
}
|
|
560
|
+
function wrapSpanContext(spanContext) {
|
|
561
|
+
return new NonRecordingSpan(spanContext);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
|
|
565
|
+
var contextApi = ContextAPI.getInstance();
|
|
566
|
+
var NoopTracer = class {
|
|
567
|
+
// startSpan starts a noop span.
|
|
568
|
+
startSpan(name, options, context2 = contextApi.active()) {
|
|
569
|
+
const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
570
|
+
if (root) {
|
|
571
|
+
return new NonRecordingSpan();
|
|
572
|
+
}
|
|
573
|
+
const parentFromContext = context2 && getSpanContext(context2);
|
|
574
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
575
|
+
return new NonRecordingSpan(parentFromContext);
|
|
576
|
+
} else {
|
|
577
|
+
return new NonRecordingSpan();
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
581
|
+
let opts;
|
|
582
|
+
let ctx;
|
|
583
|
+
let fn;
|
|
584
|
+
if (arguments.length < 2) {
|
|
585
|
+
return;
|
|
586
|
+
} else if (arguments.length === 2) {
|
|
587
|
+
fn = arg2;
|
|
588
|
+
} else if (arguments.length === 3) {
|
|
589
|
+
opts = arg2;
|
|
590
|
+
fn = arg3;
|
|
591
|
+
} else {
|
|
592
|
+
opts = arg2;
|
|
593
|
+
ctx = arg3;
|
|
594
|
+
fn = arg4;
|
|
595
|
+
}
|
|
596
|
+
const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
597
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
598
|
+
const contextWithSpanSet = setSpan(parentContext, span);
|
|
599
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
function isSpanContext(spanContext) {
|
|
603
|
+
return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number";
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
|
|
607
|
+
var NOOP_TRACER = new NoopTracer();
|
|
608
|
+
var ProxyTracer = class {
|
|
609
|
+
constructor(provider, name, version, options) {
|
|
610
|
+
this._provider = provider;
|
|
611
|
+
this.name = name;
|
|
612
|
+
this.version = version;
|
|
613
|
+
this.options = options;
|
|
614
|
+
}
|
|
615
|
+
startSpan(name, options, context2) {
|
|
616
|
+
return this._getTracer().startSpan(name, options, context2);
|
|
617
|
+
}
|
|
618
|
+
startActiveSpan(_name, _options, _context, _fn) {
|
|
619
|
+
const tracer = this._getTracer();
|
|
620
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
624
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
625
|
+
*/
|
|
626
|
+
_getTracer() {
|
|
627
|
+
if (this._delegate) {
|
|
628
|
+
return this._delegate;
|
|
629
|
+
}
|
|
630
|
+
const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
631
|
+
if (!tracer) {
|
|
632
|
+
return NOOP_TRACER;
|
|
633
|
+
}
|
|
634
|
+
this._delegate = tracer;
|
|
635
|
+
return this._delegate;
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
|
|
640
|
+
var NoopTracerProvider = class {
|
|
641
|
+
getTracer(_name, _version, _options) {
|
|
642
|
+
return new NoopTracer();
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
|
|
647
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
648
|
+
var ProxyTracerProvider = class {
|
|
649
|
+
/**
|
|
650
|
+
* Get a {@link ProxyTracer}
|
|
651
|
+
*/
|
|
652
|
+
getTracer(name, version, options) {
|
|
653
|
+
var _a;
|
|
654
|
+
return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
|
|
655
|
+
}
|
|
656
|
+
getDelegate() {
|
|
657
|
+
var _a;
|
|
658
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Set the delegate tracer provider
|
|
662
|
+
*/
|
|
663
|
+
setDelegate(delegate) {
|
|
664
|
+
this._delegate = delegate;
|
|
665
|
+
}
|
|
666
|
+
getDelegateTracer(name, version, options) {
|
|
667
|
+
var _a;
|
|
668
|
+
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js
|
|
673
|
+
var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]";
|
|
674
|
+
var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;
|
|
675
|
+
var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;
|
|
676
|
+
var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);
|
|
677
|
+
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
678
|
+
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
679
|
+
function validateKey(key) {
|
|
680
|
+
return VALID_KEY_REGEX.test(key);
|
|
681
|
+
}
|
|
682
|
+
function validateValue(value) {
|
|
683
|
+
return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js
|
|
687
|
+
var MAX_TRACE_STATE_ITEMS = 32;
|
|
688
|
+
var MAX_TRACE_STATE_LEN = 512;
|
|
689
|
+
var LIST_MEMBERS_SEPARATOR = ",";
|
|
690
|
+
var LIST_MEMBER_KEY_VALUE_SPLITTER = "=";
|
|
691
|
+
var TraceStateImpl = class _TraceStateImpl {
|
|
692
|
+
constructor(rawTraceState) {
|
|
693
|
+
this._internalState = /* @__PURE__ */ new Map();
|
|
694
|
+
if (rawTraceState)
|
|
695
|
+
this._parse(rawTraceState);
|
|
696
|
+
}
|
|
697
|
+
set(key, value) {
|
|
698
|
+
const traceState = this._clone();
|
|
699
|
+
if (traceState._internalState.has(key)) {
|
|
700
|
+
traceState._internalState.delete(key);
|
|
701
|
+
}
|
|
702
|
+
traceState._internalState.set(key, value);
|
|
703
|
+
return traceState;
|
|
704
|
+
}
|
|
705
|
+
unset(key) {
|
|
706
|
+
const traceState = this._clone();
|
|
707
|
+
traceState._internalState.delete(key);
|
|
708
|
+
return traceState;
|
|
709
|
+
}
|
|
710
|
+
get(key) {
|
|
711
|
+
return this._internalState.get(key);
|
|
712
|
+
}
|
|
713
|
+
serialize() {
|
|
714
|
+
return Array.from(this._internalState.keys()).reduceRight((agg, key) => {
|
|
715
|
+
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));
|
|
716
|
+
return agg;
|
|
717
|
+
}, []).join(LIST_MEMBERS_SEPARATOR);
|
|
718
|
+
}
|
|
719
|
+
_parse(rawTraceState) {
|
|
720
|
+
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
|
|
721
|
+
return;
|
|
722
|
+
this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => {
|
|
723
|
+
const listMember = part.trim();
|
|
724
|
+
const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
725
|
+
if (i !== -1) {
|
|
726
|
+
const key = listMember.slice(0, i);
|
|
727
|
+
const value = listMember.slice(i + 1, part.length);
|
|
728
|
+
if (validateKey(key) && validateValue(value)) {
|
|
729
|
+
agg.set(key, value);
|
|
730
|
+
} else {
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
return agg;
|
|
734
|
+
}, /* @__PURE__ */ new Map());
|
|
735
|
+
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
|
|
736
|
+
this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
// @ts-expect-error TS6133 Accessed in tests only.
|
|
740
|
+
_keys() {
|
|
741
|
+
return Array.from(this._internalState.keys()).reverse();
|
|
742
|
+
}
|
|
743
|
+
_clone() {
|
|
744
|
+
const traceState = new _TraceStateImpl();
|
|
745
|
+
traceState._internalState = new Map(this._internalState);
|
|
746
|
+
return traceState;
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js
|
|
751
|
+
function createTraceState(rawTraceState) {
|
|
752
|
+
return new TraceStateImpl(rawTraceState);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
756
|
+
var API_NAME3 = "trace";
|
|
757
|
+
var TraceAPI = class _TraceAPI {
|
|
758
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
759
|
+
constructor() {
|
|
760
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
761
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
762
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
763
|
+
this.deleteSpan = deleteSpan;
|
|
764
|
+
this.getSpan = getSpan;
|
|
765
|
+
this.getActiveSpan = getActiveSpan;
|
|
766
|
+
this.getSpanContext = getSpanContext;
|
|
767
|
+
this.setSpan = setSpan;
|
|
768
|
+
this.setSpanContext = setSpanContext;
|
|
769
|
+
}
|
|
770
|
+
/** Get the singleton instance of the Trace API */
|
|
771
|
+
static getInstance() {
|
|
772
|
+
if (!this._instance) {
|
|
773
|
+
this._instance = new _TraceAPI();
|
|
774
|
+
}
|
|
775
|
+
return this._instance;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Set the current global tracer.
|
|
779
|
+
*
|
|
780
|
+
* @returns true if the tracer provider was successfully registered, else false
|
|
781
|
+
*/
|
|
782
|
+
setGlobalTracerProvider(provider) {
|
|
783
|
+
const success = registerGlobal(API_NAME3, this._proxyTracerProvider, DiagAPI.instance());
|
|
784
|
+
if (success) {
|
|
785
|
+
this._proxyTracerProvider.setDelegate(provider);
|
|
786
|
+
}
|
|
787
|
+
return success;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Returns the global tracer provider.
|
|
791
|
+
*/
|
|
792
|
+
getTracerProvider() {
|
|
793
|
+
return getGlobal(API_NAME3) || this._proxyTracerProvider;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Returns a tracer from the global tracer provider.
|
|
797
|
+
*/
|
|
798
|
+
getTracer(name, version) {
|
|
799
|
+
return this.getTracerProvider().getTracer(name, version);
|
|
800
|
+
}
|
|
801
|
+
/** Remove the global tracer provider */
|
|
802
|
+
disable() {
|
|
803
|
+
unregisterGlobal(API_NAME3, DiagAPI.instance());
|
|
804
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
// node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
809
|
+
var trace = TraceAPI.getInstance();
|
|
9
810
|
|
|
10
811
|
// src/mcp-command-context.ts
|
|
11
812
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -13,8 +814,8 @@ var storage = new AsyncLocalStorage();
|
|
|
13
814
|
function currentMcpCommandContext() {
|
|
14
815
|
return storage.getStore();
|
|
15
816
|
}
|
|
16
|
-
function runWithMcpCommandContext(
|
|
17
|
-
return storage.run(
|
|
817
|
+
function runWithMcpCommandContext(context2, task) {
|
|
818
|
+
return storage.run(context2, task);
|
|
18
819
|
}
|
|
19
820
|
function installMcpCommandIoRouting() {
|
|
20
821
|
const stdoutWrite = process.stdout.write.bind(process.stdout);
|
|
@@ -66,6 +867,24 @@ function serializeMcpDaemonEnvelope(envelope, maxBytes = MCP_DAEMON_MAX_FRAME_BY
|
|
|
66
867
|
`;
|
|
67
868
|
}
|
|
68
869
|
|
|
870
|
+
// src/mcp-trace-context.ts
|
|
871
|
+
var TRACEPARENT = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/i;
|
|
872
|
+
function mcpDaemonRequestContext(carrier, base = ROOT_CONTEXT) {
|
|
873
|
+
const match = carrier?.traceparent.match(TRACEPARENT);
|
|
874
|
+
if (!match) return base;
|
|
875
|
+
const [, version, traceId, spanId, flags] = match;
|
|
876
|
+
if (version?.toLowerCase() === "ff" || traceId === "0".repeat(32) || spanId === "0".repeat(16)) {
|
|
877
|
+
return base;
|
|
878
|
+
}
|
|
879
|
+
return trace.setSpanContext(base, {
|
|
880
|
+
traceId: traceId.toLowerCase(),
|
|
881
|
+
spanId: spanId.toLowerCase(),
|
|
882
|
+
traceFlags: Number.parseInt(flags, 16),
|
|
883
|
+
isRemote: true,
|
|
884
|
+
...carrier?.tracestate ? { traceState: createTraceState(carrier.tracestate) } : {}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
|
|
69
888
|
// src/mcp-cli-core.ts
|
|
70
889
|
import { createHash, randomUUID } from "node:crypto";
|
|
71
890
|
import { existsSync } from "node:fs";
|
|
@@ -686,7 +1505,7 @@ function loadMcporterCli() {
|
|
|
686
1505
|
if (mcporterCliPromise) return mcporterCliPromise;
|
|
687
1506
|
const previousDisableAutorun = process.env.MCPORTER_DISABLE_AUTORUN;
|
|
688
1507
|
process.env.MCPORTER_DISABLE_AUTORUN = "1";
|
|
689
|
-
mcporterCliPromise = import("./cli-
|
|
1508
|
+
mcporterCliPromise = import("./cli-E4P6SZLQ.js").finally(() => {
|
|
690
1509
|
if (previousDisableAutorun === void 0) {
|
|
691
1510
|
delete process.env.MCPORTER_DISABLE_AUTORUN;
|
|
692
1511
|
} else {
|
|
@@ -2414,17 +3233,18 @@ async function main(args = process.argv.slice(2)) {
|
|
|
2414
3233
|
return 2;
|
|
2415
3234
|
}
|
|
2416
3235
|
async function executeMcpCommand(opts) {
|
|
2417
|
-
const
|
|
3236
|
+
const context2 = {
|
|
2418
3237
|
runtime: opts.runtime,
|
|
2419
3238
|
stdin: opts.stdin,
|
|
2420
3239
|
stdout: opts.stdout,
|
|
2421
3240
|
stderr: opts.stderr,
|
|
2422
3241
|
signal: opts.signal
|
|
2423
3242
|
};
|
|
2424
|
-
return runWithMcpCommandContext(
|
|
3243
|
+
return runWithMcpCommandContext(context2, () => main(opts.args));
|
|
2425
3244
|
}
|
|
2426
3245
|
|
|
2427
3246
|
export {
|
|
3247
|
+
context,
|
|
2428
3248
|
installMcpCommandIoRouting,
|
|
2429
3249
|
MCP_DAEMON_SOCKET_ENV,
|
|
2430
3250
|
MCP_DAEMON_TOKEN_ENV,
|
|
@@ -2432,6 +3252,7 @@ export {
|
|
|
2432
3252
|
MCP_DAEMON_PARENT_PID_ENV,
|
|
2433
3253
|
MCP_DAEMON_MAX_FRAME_BYTES,
|
|
2434
3254
|
serializeMcpDaemonEnvelope,
|
|
3255
|
+
mcpDaemonRequestContext,
|
|
2435
3256
|
discoverMcpCatalogs,
|
|
2436
3257
|
executeMcpCommand
|
|
2437
3258
|
};
|