@probelabs/visor 0.1.96 → 0.1.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +6 -5
  2. package/dist/{168.index.js → 136.index.js} +5 -5
  3. package/dist/{272.index.js → 146.index.js} +5 -5
  4. package/dist/{13.index.js → 160.index.js} +5 -5
  5. package/dist/{421.index.js → 179.index.js} +3 -3
  6. package/dist/{85.index.js → 191.index.js} +5 -5
  7. package/dist/{544.index.js → 384.index.js} +3 -3
  8. package/dist/{861.index.js → 405.index.js} +3 -3
  9. package/dist/{320.index.js → 42.index.js} +3 -3
  10. package/dist/448.index.js +48 -0
  11. package/dist/{878.index.js → 491.index.js} +5 -5
  12. package/dist/663.index.js +321 -0
  13. package/dist/69.index.js +38 -0
  14. package/dist/{54.index.js → 760.index.js} +5 -5
  15. package/dist/80.index.js +263 -0
  16. package/dist/886.index.js +81 -0
  17. package/dist/917.index.js +82 -0
  18. package/dist/955.index.js +82 -0
  19. package/dist/ai-review-service.d.ts +2 -3
  20. package/dist/ai-review-service.d.ts.map +1 -1
  21. package/dist/cli.d.ts.map +1 -1
  22. package/dist/generated/config-schema.d.ts +18 -1
  23. package/dist/generated/config-schema.d.ts.map +1 -1
  24. package/dist/generated/config-schema.json +23 -1
  25. package/dist/index.js +191599 -155303
  26. package/dist/proto/protoc-gen-validate/LICENSE +202 -0
  27. package/dist/proto/protoc-gen-validate/validate/validate.proto +797 -0
  28. package/dist/proto/xds/LICENSE +201 -0
  29. package/dist/proto/xds/xds/data/orca/v3/orca_load_report.proto +58 -0
  30. package/dist/proto/xds/xds/service/orca/v3/orca.proto +36 -0
  31. package/dist/protoc-gen-validate/LICENSE +202 -0
  32. package/dist/protoc-gen-validate/validate/validate.proto +797 -0
  33. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  34. package/dist/providers/index.d.ts +1 -0
  35. package/dist/providers/index.d.ts.map +1 -1
  36. package/dist/providers/mcp-check-provider.d.ts +102 -0
  37. package/dist/providers/mcp-check-provider.d.ts.map +1 -0
  38. package/dist/sdk/check-execution-engine-S7BFPVWA.mjs +11 -0
  39. package/dist/sdk/{chunk-Q4S5A5TO.mjs → chunk-4VK6WTYU.mjs} +610 -21
  40. package/dist/sdk/chunk-4VK6WTYU.mjs.map +1 -0
  41. package/dist/sdk/chunk-IG3BFIIN.mjs +174 -0
  42. package/dist/sdk/chunk-IG3BFIIN.mjs.map +1 -0
  43. package/dist/sdk/chunk-YXOWIDEF.mjs +60 -0
  44. package/dist/sdk/chunk-YXOWIDEF.mjs.map +1 -0
  45. package/dist/sdk/{mermaid-telemetry-LZGDD35I.mjs → mermaid-telemetry-4DUEYCLE.mjs} +2 -2
  46. package/dist/sdk/sdk.d.mts +12 -1
  47. package/dist/sdk/sdk.d.ts +12 -1
  48. package/dist/sdk/sdk.js +1019 -1577
  49. package/dist/sdk/sdk.js.map +1 -1
  50. package/dist/sdk/sdk.mjs +22 -4
  51. package/dist/sdk/sdk.mjs.map +1 -1
  52. package/dist/sdk/{tracer-init-O7RLXMJ3.mjs → tracer-init-RJGAIOBP.mjs} +2 -2
  53. package/dist/session-registry.d.ts +2 -3
  54. package/dist/session-registry.d.ts.map +1 -1
  55. package/dist/traces/run-2025-10-19T14-24-36-341Z.ndjson +40 -0
  56. package/dist/traces/run-2025-10-19T14-24-48-674Z.ndjson +40 -0
  57. package/dist/traces/run-2025-10-19T14-24-49-238Z.ndjson +40 -0
  58. package/dist/traces/run-2025-10-19T14-24-49-761Z.ndjson +40 -0
  59. package/dist/traces/run-2025-10-19T14-24-50-279Z.ndjson +12 -0
  60. package/dist/types/config.d.ts +12 -1
  61. package/dist/types/config.d.ts.map +1 -1
  62. package/dist/utils/tracer-init.d.ts +3 -4
  63. package/dist/utils/tracer-init.d.ts.map +1 -1
  64. package/dist/xds/LICENSE +201 -0
  65. package/dist/xds/xds/data/orca/v3/orca_load_report.proto +58 -0
  66. package/dist/xds/xds/service/orca/v3/orca.proto +36 -0
  67. package/package.json +15 -8
  68. package/dist/sdk/check-execution-engine-NMPXJ7FQ.mjs +0 -11
  69. package/dist/sdk/chunk-KVHVCGY6.mjs +0 -103
  70. package/dist/sdk/chunk-KVHVCGY6.mjs.map +0 -1
  71. package/dist/sdk/chunk-Q4S5A5TO.mjs.map +0 -1
  72. package/dist/sdk/chunk-TWJKAYT6.mjs +0 -1124
  73. package/dist/sdk/chunk-TWJKAYT6.mjs.map +0 -1
  74. /package/dist/{traces/run-2025-10-18T20-24-27-886Z.ndjson → output/traces/run-2025-10-19T14-24-36-341Z.ndjson} +0 -0
  75. /package/dist/{traces/run-2025-10-18T20-24-38-817Z.ndjson → output/traces/run-2025-10-19T14-24-48-674Z.ndjson} +0 -0
  76. /package/dist/{traces/run-2025-10-18T20-24-39-361Z.ndjson → output/traces/run-2025-10-19T14-24-49-238Z.ndjson} +0 -0
  77. /package/dist/{traces/run-2025-10-18T20-24-39-852Z.ndjson → output/traces/run-2025-10-19T14-24-49-761Z.ndjson} +0 -0
  78. /package/dist/{traces/run-2025-10-18T20-24-40-335Z.ndjson → output/traces/run-2025-10-19T14-24-50-279Z.ndjson} +0 -0
  79. /package/dist/sdk/{check-execution-engine-NMPXJ7FQ.mjs.map → check-execution-engine-S7BFPVWA.mjs.map} +0 -0
  80. /package/dist/sdk/{mermaid-telemetry-LZGDD35I.mjs.map → mermaid-telemetry-4DUEYCLE.mjs.map} +0 -0
  81. /package/dist/sdk/{tracer-init-O7RLXMJ3.mjs.map → tracer-init-RJGAIOBP.mjs.map} +0 -0
package/README.md CHANGED
@@ -130,7 +130,7 @@ Additional guides:
130
130
  - Schema – JSON shape checks return (e.g., `code-review`).
131
131
  - Template – renders results (tables/markdown).
132
132
  - Group – which comment a check is posted into.
133
- - Provider – how a check runs (`ai`, `http`, `http_client`, `command`, `log`, `github`, `claude-code`).
133
+ - Provider – how a check runs (`ai`, `mcp`, `http`, `http_client`, `command`, `log`, `github`, `claude-code`).
134
134
  - Dependencies – `depends_on` controls order; independents run in parallel.
135
135
  - Tags – label checks (`fast`, `local`, `comprehensive`) and filter with `--tags`.
136
136
  - Events – PRs, issues, `/review` comments, webhooks, or cron schedules.
@@ -188,11 +188,11 @@ Visor is a general SDLC automation framework:
188
188
  - Config‑first: One `.visor.yaml` defines checks, prompts, schemas, and templates — no hidden logic.
189
189
  - Structured outputs: JSON Schema validation drives deterministic rendering, annotations, and SARIF.
190
190
  - Orchestrated pipelines: Dependencies, parallelism, and tag‑based profiles; run in Actions or any CI.
191
- - Multi‑provider AI: Google Gemini, Anthropic Claude, OpenAI, AWS Bedrock — plus MCP tools and Claude Code SDK.
191
+ - Multi‑provider AI: Google Gemini, Anthropic Claude, OpenAI, AWS Bedrock — plus MCP tools, standalone MCP provider, and Claude Code SDK.
192
192
  - Author permissions: Built-in functions to customize workflows based on contributor trust level (owner, member, collaborator, etc).
193
193
  - Assistants & commands: `/review` to rerun checks, `/visor …` for Q&A, predictable comment groups.
194
194
  - HTTP & schedules: Receive webhooks, call external APIs, and run cron‑scheduled audits and reports.
195
- - Extensible providers: `ai`, `http`, `http_client`, `log`, `command`, `github`, `claude-code` — or add your own.
195
+ - Extensible providers: `ai`, `mcp`, `http`, `http_client`, `log`, `command`, `github`, `claude-code` — or add your own.
196
196
  - Security by default: GitHub App support, scoped tokens, remote‑extends allowlist, opt‑in network usage.
197
197
  - Observability & control: JSON/SARIF outputs, fail‑fast and timeouts, parallelism and cost control.
198
198
 
@@ -622,10 +622,11 @@ Learn more: [docs/http.md](docs/http.md)
622
622
 
623
623
  ## 🔧 Pluggable Architecture
624
624
 
625
- Mix providers (`ai`, `http`, `http_client`, `log`, `command`, `claude-code`) or add your own.
625
+ Mix providers (`ai`, `mcp`, `http`, `http_client`, `log`, `command`, `github`, `claude-code`) or add your own.
626
626
 
627
627
  - **Command Provider**: Execute shell commands with templating and security - [docs/command-provider.md](docs/command-provider.md)
628
- - **MCP Tools**: Leverage the Model Context Protocol for external tools - [docs/mcp.md](docs/mcp.md)
628
+ - **MCP Provider**: Call MCP tools directly via stdio, SSE, or HTTP transports - [docs/mcp-provider.md](docs/mcp-provider.md)
629
+ - **MCP Tools for AI**: Enhance AI providers with MCP context - [docs/mcp.md](docs/mcp.md)
629
630
  - **Custom Providers**: Build your own providers - [docs/pluggable.md](docs/pluggable.md)
630
631
 
631
632
  ## 🎯 GitHub Action Reference
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 168;
3
- exports.ids = [168];
2
+ exports.id = 136;
3
+ exports.ids = [136];
4
4
  exports.modules = {
5
5
 
6
- /***/ 14239:
6
+ /***/ 95023:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -31,7 +31,7 @@ exports.execAsync = util.promisify(child_process.exec);
31
31
 
32
32
  /***/ }),
33
33
 
34
- /***/ 17168:
34
+ /***/ 43136:
35
35
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
36
36
 
37
37
 
@@ -52,7 +52,7 @@ exports.execAsync = util.promisify(child_process.exec);
52
52
  */
53
53
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54
54
  exports.getMachineId = void 0;
55
- const execAsync_1 = __webpack_require__(14239);
55
+ const execAsync_1 = __webpack_require__(95023);
56
56
  const api_1 = __webpack_require__(63914);
57
57
  async function getMachineId() {
58
58
  try {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 272;
3
- exports.ids = [272];
2
+ exports.id = 146;
3
+ exports.ids = [146];
4
4
  exports.modules = {
5
5
 
6
- /***/ 31223:
6
+ /***/ 67049:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -31,7 +31,7 @@ exports.execAsync = util.promisify(child_process.exec);
31
31
 
32
32
  /***/ }),
33
33
 
34
- /***/ 37272:
34
+ /***/ 29146:
35
35
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
36
36
 
37
37
 
@@ -52,7 +52,7 @@ exports.execAsync = util.promisify(child_process.exec);
52
52
  */
53
53
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54
54
  exports.getMachineId = void 0;
55
- const execAsync_1 = __webpack_require__(31223);
55
+ const execAsync_1 = __webpack_require__(67049);
56
56
  const api_1 = __webpack_require__(63914);
57
57
  async function getMachineId() {
58
58
  try {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 13;
3
- exports.ids = [13];
2
+ exports.id = 160;
3
+ exports.ids = [160];
4
4
  exports.modules = {
5
5
 
6
- /***/ 31223:
6
+ /***/ 66272:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -31,7 +31,7 @@ exports.execAsync = util.promisify(child_process.exec);
31
31
 
32
32
  /***/ }),
33
33
 
34
- /***/ 80013:
34
+ /***/ 51160:
35
35
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
36
36
 
37
37
 
@@ -53,7 +53,7 @@ exports.execAsync = util.promisify(child_process.exec);
53
53
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54
54
  exports.getMachineId = void 0;
55
55
  const process = __webpack_require__(932);
56
- const execAsync_1 = __webpack_require__(31223);
56
+ const execAsync_1 = __webpack_require__(66272);
57
57
  const api_1 = __webpack_require__(63914);
58
58
  async function getMachineId() {
59
59
  const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 421;
3
- exports.ids = [421];
2
+ exports.id = 179;
3
+ exports.ids = [179];
4
4
  exports.modules = {
5
5
 
6
- /***/ 10421:
6
+ /***/ 70179:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 85;
3
- exports.ids = [85];
2
+ exports.id = 191;
3
+ exports.ids = [191];
4
4
  exports.modules = {
5
5
 
6
- /***/ 14239:
6
+ /***/ 67049:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -31,7 +31,7 @@ exports.execAsync = util.promisify(child_process.exec);
31
31
 
32
32
  /***/ }),
33
33
 
34
- /***/ 36085:
34
+ /***/ 53191:
35
35
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
36
36
 
37
37
 
@@ -53,7 +53,7 @@ exports.execAsync = util.promisify(child_process.exec);
53
53
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54
54
  exports.getMachineId = void 0;
55
55
  const process = __webpack_require__(932);
56
- const execAsync_1 = __webpack_require__(14239);
56
+ const execAsync_1 = __webpack_require__(67049);
57
57
  const api_1 = __webpack_require__(63914);
58
58
  async function getMachineId() {
59
59
  const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 544;
3
- exports.ids = [544];
2
+ exports.id = 384;
3
+ exports.ids = [384];
4
4
  exports.modules = {
5
5
 
6
- /***/ 15544:
6
+ /***/ 5384:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 861;
3
- exports.ids = [861];
2
+ exports.id = 405;
3
+ exports.ids = [405];
4
4
  exports.modules = {
5
5
 
6
- /***/ 44861:
6
+ /***/ 11405:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 320;
3
- exports.ids = [320];
2
+ exports.id = 42;
3
+ exports.ids = [42];
4
4
  exports.modules = {
5
5
 
6
- /***/ 74320:
6
+ /***/ 37042:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ exports.id = 448;
3
+ exports.ids = [448];
4
+ exports.modules = {
5
+
6
+ /***/ 26448:
7
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
+
9
+
10
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
11
+ exports.getMachineId = void 0;
12
+ /*
13
+ * Copyright The OpenTelemetry Authors
14
+ *
15
+ * Licensed under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License.
17
+ * You may obtain a copy of the License at
18
+ *
19
+ * https://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software
22
+ * distributed under the License is distributed on an "AS IS" BASIS,
23
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ * See the License for the specific language governing permissions and
25
+ * limitations under the License.
26
+ */
27
+ const fs_1 = __webpack_require__(79896);
28
+ const api_1 = __webpack_require__(63914);
29
+ async function getMachineId() {
30
+ const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];
31
+ for (const path of paths) {
32
+ try {
33
+ const result = await fs_1.promises.readFile(path, { encoding: 'utf8' });
34
+ return result.trim();
35
+ }
36
+ catch (e) {
37
+ api_1.diag.debug(`error reading machine id: ${e}`);
38
+ }
39
+ }
40
+ return undefined;
41
+ }
42
+ exports.getMachineId = getMachineId;
43
+ //# sourceMappingURL=getMachineId-linux.js.map
44
+
45
+ /***/ })
46
+
47
+ };
48
+ ;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- exports.id = 878;
3
- exports.ids = [878];
2
+ exports.id = 491;
3
+ exports.ids = [491];
4
4
  exports.modules = {
5
5
 
6
- /***/ 31223:
6
+ /***/ 66272:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
9
 
@@ -31,7 +31,7 @@ exports.execAsync = util.promisify(child_process.exec);
31
31
 
32
32
  /***/ }),
33
33
 
34
- /***/ 30878:
34
+ /***/ 94491:
35
35
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
36
36
 
37
37
 
@@ -53,7 +53,7 @@ exports.execAsync = util.promisify(child_process.exec);
53
53
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54
54
  exports.getMachineId = void 0;
55
55
  const fs_1 = __webpack_require__(79896);
56
- const execAsync_1 = __webpack_require__(31223);
56
+ const execAsync_1 = __webpack_require__(66272);
57
57
  const api_1 = __webpack_require__(63914);
58
58
  async function getMachineId() {
59
59
  try {
@@ -0,0 +1,321 @@
1
+ "use strict";
2
+ exports.id = 663;
3
+ exports.ids = [663,80];
4
+ exports.modules = {
5
+
6
+ /***/ 76492:
7
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8
+
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var token_io_exports = {};
38
+ __export(token_io_exports, {
39
+ findRootDir: () => findRootDir,
40
+ getUserDataDir: () => getUserDataDir
41
+ });
42
+ module.exports = __toCommonJS(token_io_exports);
43
+ var import_path = __toESM(__webpack_require__(16928));
44
+ var import_fs = __toESM(__webpack_require__(79896));
45
+ var import_os = __toESM(__webpack_require__(70857));
46
+ var import_token_error = __webpack_require__(19988);
47
+ function findRootDir() {
48
+ try {
49
+ let dir = process.cwd();
50
+ while (dir !== import_path.default.dirname(dir)) {
51
+ const pkgPath = import_path.default.join(dir, ".vercel");
52
+ if (import_fs.default.existsSync(pkgPath)) {
53
+ return dir;
54
+ }
55
+ dir = import_path.default.dirname(dir);
56
+ }
57
+ } catch (e) {
58
+ throw new import_token_error.VercelOidcTokenError(
59
+ "Token refresh only supported in node server environments"
60
+ );
61
+ }
62
+ throw new import_token_error.VercelOidcTokenError("Unable to find root directory");
63
+ }
64
+ function getUserDataDir() {
65
+ if (process.env.XDG_DATA_HOME) {
66
+ return process.env.XDG_DATA_HOME;
67
+ }
68
+ switch (import_os.default.platform()) {
69
+ case "darwin":
70
+ return import_path.default.join(import_os.default.homedir(), "Library/Application Support");
71
+ case "linux":
72
+ return import_path.default.join(import_os.default.homedir(), ".local/share");
73
+ case "win32":
74
+ if (process.env.LOCALAPPDATA) {
75
+ return process.env.LOCALAPPDATA;
76
+ }
77
+ return null;
78
+ default:
79
+ return null;
80
+ }
81
+ }
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (0);
84
+
85
+
86
+ /***/ }),
87
+
88
+ /***/ 61080:
89
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
90
+
91
+
92
+ var __create = Object.create;
93
+ var __defProp = Object.defineProperty;
94
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
95
+ var __getOwnPropNames = Object.getOwnPropertyNames;
96
+ var __getProtoOf = Object.getPrototypeOf;
97
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
98
+ var __export = (target, all) => {
99
+ for (var name in all)
100
+ __defProp(target, name, { get: all[name], enumerable: true });
101
+ };
102
+ var __copyProps = (to, from, except, desc) => {
103
+ if (from && typeof from === "object" || typeof from === "function") {
104
+ for (let key of __getOwnPropNames(from))
105
+ if (!__hasOwnProp.call(to, key) && key !== except)
106
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
107
+ }
108
+ return to;
109
+ };
110
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
111
+ // If the importer is in node compatibility mode or this is not an ESM
112
+ // file that has been converted to a CommonJS file using a Babel-
113
+ // compatible transform (i.e. "__esModule" has not been set), then set
114
+ // "default" to the CommonJS "module.exports" for node compatibility.
115
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
116
+ mod
117
+ ));
118
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
119
+ var token_util_exports = {};
120
+ __export(token_util_exports, {
121
+ assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse,
122
+ findProjectInfo: () => findProjectInfo,
123
+ getTokenPayload: () => getTokenPayload,
124
+ getVercelCliToken: () => getVercelCliToken,
125
+ getVercelDataDir: () => getVercelDataDir,
126
+ getVercelOidcToken: () => getVercelOidcToken,
127
+ isExpired: () => isExpired,
128
+ loadToken: () => loadToken,
129
+ saveToken: () => saveToken
130
+ });
131
+ module.exports = __toCommonJS(token_util_exports);
132
+ var path = __toESM(__webpack_require__(16928));
133
+ var fs = __toESM(__webpack_require__(79896));
134
+ var import_token_error = __webpack_require__(19988);
135
+ var import_token_io = __webpack_require__(76492);
136
+ function getVercelDataDir() {
137
+ const vercelFolder = "com.vercel.cli";
138
+ const dataDir = (0, import_token_io.getUserDataDir)();
139
+ if (!dataDir) {
140
+ return null;
141
+ }
142
+ return path.join(dataDir, vercelFolder);
143
+ }
144
+ function getVercelCliToken() {
145
+ const dataDir = getVercelDataDir();
146
+ if (!dataDir) {
147
+ return null;
148
+ }
149
+ const tokenPath = path.join(dataDir, "auth.json");
150
+ if (!fs.existsSync(tokenPath)) {
151
+ return null;
152
+ }
153
+ const token = fs.readFileSync(tokenPath, "utf8");
154
+ if (!token) {
155
+ return null;
156
+ }
157
+ return JSON.parse(token).token;
158
+ }
159
+ async function getVercelOidcToken(authToken, projectId, teamId) {
160
+ try {
161
+ const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
162
+ const res = await fetch(url, {
163
+ method: "POST",
164
+ headers: {
165
+ Authorization: `Bearer ${authToken}`
166
+ }
167
+ });
168
+ if (!res.ok) {
169
+ throw new import_token_error.VercelOidcTokenError(
170
+ `Failed to refresh OIDC token: ${res.statusText}`
171
+ );
172
+ }
173
+ const tokenRes = await res.json();
174
+ assertVercelOidcTokenResponse(tokenRes);
175
+ return tokenRes;
176
+ } catch (e) {
177
+ throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, e);
178
+ }
179
+ }
180
+ function assertVercelOidcTokenResponse(res) {
181
+ if (!res || typeof res !== "object") {
182
+ throw new TypeError("Expected an object");
183
+ }
184
+ if (!("token" in res) || typeof res.token !== "string") {
185
+ throw new TypeError("Expected a string-valued token property");
186
+ }
187
+ }
188
+ function findProjectInfo() {
189
+ const dir = (0, import_token_io.findRootDir)();
190
+ if (!dir) {
191
+ throw new import_token_error.VercelOidcTokenError("Unable to find root directory");
192
+ }
193
+ try {
194
+ const prjPath = path.join(dir, ".vercel", "project.json");
195
+ if (!fs.existsSync(prjPath)) {
196
+ throw new import_token_error.VercelOidcTokenError("project.json not found");
197
+ }
198
+ const prj = JSON.parse(fs.readFileSync(prjPath, "utf8"));
199
+ if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
200
+ throw new TypeError("Expected a string-valued projectId property");
201
+ }
202
+ return { projectId: prj.projectId, teamId: prj.orgId };
203
+ } catch (e) {
204
+ throw new import_token_error.VercelOidcTokenError(`Unable to find project ID`, e);
205
+ }
206
+ }
207
+ function saveToken(token, projectId) {
208
+ try {
209
+ const dir = (0, import_token_io.getUserDataDir)();
210
+ if (!dir) {
211
+ throw new import_token_error.VercelOidcTokenError("Unable to find user data directory");
212
+ }
213
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
214
+ const tokenJson = JSON.stringify(token);
215
+ fs.mkdirSync(path.dirname(tokenPath), { mode: 432, recursive: true });
216
+ fs.writeFileSync(tokenPath, tokenJson);
217
+ fs.chmodSync(tokenPath, 432);
218
+ return;
219
+ } catch (e) {
220
+ throw new import_token_error.VercelOidcTokenError(`Failed to save token`, e);
221
+ }
222
+ }
223
+ function loadToken(projectId) {
224
+ try {
225
+ const dir = (0, import_token_io.getUserDataDir)();
226
+ if (!dir) {
227
+ return null;
228
+ }
229
+ const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
230
+ if (!fs.existsSync(tokenPath)) {
231
+ return null;
232
+ }
233
+ const token = JSON.parse(fs.readFileSync(tokenPath, "utf8"));
234
+ assertVercelOidcTokenResponse(token);
235
+ return token;
236
+ } catch (e) {
237
+ throw new import_token_error.VercelOidcTokenError(`Failed to load token`, e);
238
+ }
239
+ }
240
+ function getTokenPayload(token) {
241
+ const tokenParts = token.split(".");
242
+ if (tokenParts.length !== 3) {
243
+ throw new import_token_error.VercelOidcTokenError("Invalid token");
244
+ }
245
+ const base64 = tokenParts[1].replace(/-/g, "+").replace(/_/g, "/");
246
+ const padded = base64.padEnd(
247
+ base64.length + (4 - base64.length % 4) % 4,
248
+ "="
249
+ );
250
+ return JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
251
+ }
252
+ const TIME_15_MINUTES_IN_MS = 15 * 60 * 1e3;
253
+ function isExpired(token) {
254
+ return token.exp * 1e3 < Date.now() + TIME_15_MINUTES_IN_MS;
255
+ }
256
+ // Annotate the CommonJS export names for ESM import in node:
257
+ 0 && (0);
258
+
259
+
260
+ /***/ }),
261
+
262
+ /***/ 36663:
263
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
264
+
265
+
266
+ var __defProp = Object.defineProperty;
267
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
268
+ var __getOwnPropNames = Object.getOwnPropertyNames;
269
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
270
+ var __export = (target, all) => {
271
+ for (var name in all)
272
+ __defProp(target, name, { get: all[name], enumerable: true });
273
+ };
274
+ var __copyProps = (to, from, except, desc) => {
275
+ if (from && typeof from === "object" || typeof from === "function") {
276
+ for (let key of __getOwnPropNames(from))
277
+ if (!__hasOwnProp.call(to, key) && key !== except)
278
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
279
+ }
280
+ return to;
281
+ };
282
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
283
+ var token_exports = {};
284
+ __export(token_exports, {
285
+ refreshToken: () => refreshToken
286
+ });
287
+ module.exports = __toCommonJS(token_exports);
288
+ var import_token_error = __webpack_require__(19988);
289
+ var import_token_util = __webpack_require__(61080);
290
+ async function refreshToken() {
291
+ const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
292
+ let maybeToken = (0, import_token_util.loadToken)(projectId);
293
+ if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
294
+ const authToken = (0, import_token_util.getVercelCliToken)();
295
+ if (!authToken) {
296
+ throw new import_token_error.VercelOidcTokenError(
297
+ "Failed to refresh OIDC token: login to vercel cli"
298
+ );
299
+ }
300
+ if (!projectId) {
301
+ throw new import_token_error.VercelOidcTokenError(
302
+ "Failed to refresh OIDC token: project id not found"
303
+ );
304
+ }
305
+ maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
306
+ if (!maybeToken) {
307
+ throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
308
+ }
309
+ (0, import_token_util.saveToken)(maybeToken, projectId);
310
+ }
311
+ process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
312
+ return;
313
+ }
314
+ // Annotate the CommonJS export names for ESM import in node:
315
+ 0 && (0);
316
+
317
+
318
+ /***/ })
319
+
320
+ };
321
+ ;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ exports.id = 69;
3
+ exports.ids = [69];
4
+ exports.modules = {
5
+
6
+ /***/ 72069:
7
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
+
9
+
10
+ /*
11
+ * Copyright The OpenTelemetry Authors
12
+ *
13
+ * Licensed under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this file except in compliance with the License.
15
+ * You may obtain a copy of the License at
16
+ *
17
+ * https://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
26
+ exports.getMachineId = void 0;
27
+ const api_1 = __webpack_require__(63914);
28
+ async function getMachineId() {
29
+ api_1.diag.debug('could not read machine-id: unsupported platform');
30
+ return undefined;
31
+ }
32
+ exports.getMachineId = getMachineId;
33
+ //# sourceMappingURL=getMachineId-unsupported.js.map
34
+
35
+ /***/ })
36
+
37
+ };
38
+ ;