binary-collections 2.0.14 → 2.0.15

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 (145) hide show
  1. package/.opencode/plugins/opencode-request-logger/README.md +44 -0
  2. package/.venv/Lib/site-packages/pyarrow/tests/data/orc/README.md +22 -0
  3. package/docs-src/install-opencode-plugins.md +86 -0
  4. package/docs-src/opencode-cli.md +38 -10
  5. package/lib/binary-collections/config-types.cjs +17 -0
  6. package/lib/binary-collections/config-types.d.ts +12 -0
  7. package/lib/binary-collections/config-types.js +2 -0
  8. package/lib/binary-collections/config-types.mjs +7 -0
  9. package/lib/binary-collections/config.cjs +16 -8
  10. package/lib/binary-collections/config.d.cts +18 -10
  11. package/lib/binary-collections/config.mjs +1 -1
  12. package/lib/binary-collections/findScript.cjs +8 -6
  13. package/lib/binary-collections/findScript.mjs +2 -2
  14. package/lib/binary-collections/listScript.cjs +8 -6
  15. package/lib/binary-collections/listScript.mjs +2 -2
  16. package/lib/binary-collections.cjs +8 -6
  17. package/lib/binary-collections.mjs +3 -3
  18. package/lib/changelog.cjs +142 -4
  19. package/lib/changelog.mjs +9 -5
  20. package/lib/{chunk-SARIXFHP.mjs → chunk-3T6AMFI3.mjs} +16 -8
  21. package/lib/{chunk-3F6EIHYG.mjs → chunk-3ZF2QMDK.mjs} +3 -3
  22. package/lib/chunk-B77D3SR4.mjs +28 -0
  23. package/lib/chunk-BPED62FN.mjs +115 -0
  24. package/lib/{chunk-XI67TI46.mjs → chunk-DHFRWM2W.mjs} +1 -1
  25. package/lib/{chunk-2SJKVOTN.mjs → chunk-DPEE3FBB.mjs} +1 -1
  26. package/lib/{chunk-UYNBNLV5.mjs → chunk-H7AE4IO3.mjs} +1 -1
  27. package/lib/{chunk-YWSLMAQ7.mjs → chunk-KCJYREA2.mjs} +14 -12
  28. package/lib/{chunk-JK3MG2KF.mjs → chunk-NHD4HLSU.mjs} +1 -1
  29. package/lib/{chunk-I3O5ZRYU.mjs → chunk-OWNVMKAA.mjs} +1 -1
  30. package/lib/chunk-SKVF4TMD.mjs +59 -0
  31. package/lib/{chunk-SJYP66BO.mjs → chunk-TDUUOAQD.mjs} +1 -1
  32. package/lib/{chunk-D42YBRZW.mjs → chunk-UAEKSLAX.mjs} +1 -1
  33. package/lib/chunk-V6PTSDW5.mjs +82 -0
  34. package/lib/{chunk-AJ3OIYYP.mjs → chunk-WNUEY6VJ.mjs} +8 -6
  35. package/lib/{chunk-YLV4QATP.mjs → chunk-Z53IUBUN.mjs} +6 -5
  36. package/lib/{chunk-JMUFQSPE.mjs → chunk-Z7RM46Q4.mjs} +1 -1
  37. package/lib/cross-env/index.mjs +3 -3
  38. package/lib/git/git-diff-cli.cjs +16 -8
  39. package/lib/git/git-diff-cli.mjs +3 -3
  40. package/lib/git/git-diff.cjs +16 -8
  41. package/lib/git/git-diff.mjs +3 -3
  42. package/lib/git/git-fix.cjs +16 -8
  43. package/lib/git/git-fix.mjs +2 -2
  44. package/lib/git/user-config.cjs +16 -8
  45. package/lib/git/user-config.mjs +2 -2
  46. package/lib/github-workflows/clean-github-actions-caches-cli.cjs +16 -8
  47. package/lib/github-workflows/clean-github-actions-caches-cli.mjs +2 -2
  48. package/lib/github-workflows/clean-github-actions-caches.cjs +16 -8
  49. package/lib/github-workflows/clean-github-actions-caches.mjs +2 -2
  50. package/lib/github-workflows/get-latest-workflow-status-cli.cjs +16 -8
  51. package/lib/github-workflows/get-latest-workflow-status-cli.mjs +2 -2
  52. package/lib/github-workflows/utils.cjs +16 -8
  53. package/lib/github-workflows/utils.mjs +2 -2
  54. package/lib/github-workflows/workflow-badge-cli.cjs +16 -8
  55. package/lib/github-workflows/workflow-badge-cli.mjs +4 -4
  56. package/lib/node-cache-cleaner-cli.mjs +3 -3
  57. package/lib/opencode/cli/auth-rotate.cjs +343 -28
  58. package/lib/opencode/cli/auth-rotate.d.ts +3 -1
  59. package/lib/opencode/cli/auth-rotate.js +10 -15
  60. package/lib/opencode/cli/auth-rotate.mjs +6 -2
  61. package/lib/opencode/cli/auth-rotate.runner.cjs +454 -0
  62. package/lib/opencode/cli/auth-rotate.runner.d.ts +1 -0
  63. package/lib/opencode/cli/auth-rotate.runner.js +8 -0
  64. package/lib/opencode/cli/auth-rotate.runner.mjs +21 -0
  65. package/lib/opencode/install-opencode-plugins-cli.cjs +82 -0
  66. package/lib/opencode/install-opencode-plugins-cli.d.ts +1 -0
  67. package/lib/opencode/install-opencode-plugins-cli.js +78 -0
  68. package/lib/opencode/install-opencode-plugins-cli.mjs +65 -0
  69. package/lib/opencode/utils/check-api.cjs +332 -18
  70. package/lib/opencode/utils/check-api.d.ts +5 -1
  71. package/lib/opencode/utils/check-api.js +101 -15
  72. package/lib/opencode/utils/check-api.mjs +5 -1
  73. package/lib/opencode/utils/check-api.runner.cjs +0 -0
  74. package/lib/opencode/utils/check-api.runner.d.ts +0 -0
  75. package/lib/opencode/utils/check-api.runner.js +1 -0
  76. package/lib/opencode/utils/check-api.runner.mjs +7 -0
  77. package/lib/opencode-cli.cjs +352 -29
  78. package/lib/opencode-cli.js +3 -2
  79. package/lib/opencode-cli.mjs +11 -6
  80. package/lib/package-resolutions-updater-cli.cjs +16 -8
  81. package/lib/package-resolutions-updater-cli.mjs +2 -2
  82. package/lib/package-resolutions-updater.cjs +16 -8
  83. package/lib/package-resolutions-updater.mjs +2 -2
  84. package/lib/print-directory-tree.cjs +16 -8
  85. package/lib/print-directory-tree.mjs +1 -1
  86. package/lib/print-tarball-tree-cli.cjs +305 -0
  87. package/lib/print-tarball-tree-cli.d.mts +2 -0
  88. package/lib/print-tarball-tree-cli.mjs +54 -0
  89. package/lib/print-tarball-tree.cjs +43 -216
  90. package/lib/print-tarball-tree.d.mts +4 -1
  91. package/lib/print-tarball-tree.mjs +12 -66
  92. package/lib/rmpath-cli.cjs +16 -8
  93. package/lib/rmpath-cli.mjs +2 -2
  94. package/lib/rmpath.cjs +16 -8
  95. package/lib/rmpath.mjs +2 -2
  96. package/lib/run-by-checksum/hash.cjs +45 -67
  97. package/lib/run-by-checksum/{hash.d.ts → hash.d.cts} +9 -2
  98. package/lib/run-by-checksum/hash.mjs +3 -7
  99. package/lib/run-by-checksum/run.cjs +95 -58
  100. package/lib/run-by-checksum/run.js +3 -3
  101. package/lib/run-by-checksum/run.mjs +2 -2
  102. package/lib/run-by-checksum-cli.cjs +96 -74
  103. package/lib/run-by-checksum-cli.mjs +2 -2
  104. package/lib/submodule-install.cjs +16 -8
  105. package/lib/submodule-install.mjs +1 -1
  106. package/lib/submodule-remove-cli.cjs +16 -8
  107. package/lib/submodule-remove-cli.mjs +2 -2
  108. package/lib/submodule-remove.cjs +16 -8
  109. package/lib/submodule-remove.mjs +2 -2
  110. package/lib/utils/isDebug.cjs +13 -0
  111. package/lib/utils/isDebug.d.cts +9 -0
  112. package/lib/utils/isDebug.mjs +6 -0
  113. package/package.json +9 -7
  114. package/readme.md +63 -0
  115. package/releases/readme.md +1 -1
  116. package/lib/chunk-546KAIYT.mjs +0 -113
  117. package/lib/chunk-5WAOOOGZ.mjs +0 -77
  118. package/lib/chunk-72XTQ3CK.mjs +0 -45
  119. package/lib/chunk-7Q6YEUQF.mjs +0 -246
  120. package/lib/chunk-AQZ7LMFS.mjs +0 -100
  121. package/lib/chunk-BDCMTOZI.mjs +0 -246
  122. package/lib/chunk-BEUM4LH4.mjs +0 -184
  123. package/lib/chunk-BO4TZS4Q.mjs +0 -246
  124. package/lib/chunk-BZWVHODJ.mjs +0 -62
  125. package/lib/chunk-CM3IC5YC.mjs +0 -226
  126. package/lib/chunk-FR3DMHJC.mjs +0 -146
  127. package/lib/chunk-H44UWUFY.mjs +0 -105
  128. package/lib/chunk-JVMLKHD2.mjs +0 -62
  129. package/lib/chunk-KAT2JNLZ.mjs +0 -146
  130. package/lib/chunk-KRCPFWIF.mjs +0 -193
  131. package/lib/chunk-LVSPEFU2.mjs +0 -86
  132. package/lib/chunk-MCCMMZSM.mjs +0 -60
  133. package/lib/chunk-MGPYPKIE.mjs +0 -109
  134. package/lib/chunk-OA2RKEY3.mjs +0 -162
  135. package/lib/chunk-PAZH45HS.mjs +0 -41
  136. package/lib/chunk-QZMGBDSA.mjs +0 -32
  137. package/lib/chunk-RDGDLSPD.mjs +0 -76
  138. package/lib/chunk-RKPIBGKE.mjs +0 -61
  139. package/lib/chunk-SWUAEY4H.mjs +0 -44
  140. package/lib/chunk-UAIF5VIA.mjs +0 -89
  141. package/lib/chunk-UHPFLJXH.mjs +0 -227
  142. package/lib/chunk-WOC4FZ6F.mjs +0 -164
  143. package/lib/chunk-WSHVPGNM.mjs +0 -44
  144. package/lib/run-by-checksum/hash.js +0 -119
  145. package/readme.html +0 -784
@@ -1,109 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- require_utils as require_utils2
4
- } from "./chunk-A3VUZEJK.mjs";
5
- import {
6
- require_utils
7
- } from "./chunk-6RK5UCTP.mjs";
8
- import {
9
- __commonJS,
10
- __require,
11
- init_esm_shims
12
- } from "./chunk-QQ4A6DLD.mjs";
13
-
14
- // src/git/user-config.cjs
15
- var require_user_config = __commonJS({
16
- "src/git/user-config.cjs"(exports, module) {
17
- init_esm_shims();
18
- var gch = __require("git-command-helper");
19
- var { runGitCommand, runGitCommandOutput } = require_utils2();
20
- var { getArgs } = require_utils();
21
- __require("dotenv").config({ path: __require("upath").join(process.cwd(), ".env"), quiet: true });
22
- function configureGitUser(cliUser = null, cliEmail = null, options = {}) {
23
- console.log("\n=== Configuring Git User ===");
24
- let username, email;
25
- if (cliUser && cliEmail) {
26
- username = cliUser.trim();
27
- email = cliEmail.trim();
28
- console.log("[i] Using CLI-provided user configuration");
29
- } else {
30
- username = process.env.GITHUB_USER ? process.env.GITHUB_USER.trim() : void 0;
31
- email = process.env.GITHUB_EMAIL ? process.env.GITHUB_EMAIL.trim() : void 0;
32
- if (username || email) {
33
- console.log("[i] Using environment variable user configuration");
34
- }
35
- }
36
- if (!username && !email) {
37
- console.log("[i] No Git user configuration needed (no CLI args or environment variables set)");
38
- return;
39
- }
40
- if (username) {
41
- const success = runGitCommand(["config", "user.name", username], `Set Git username to "${username}"`);
42
- if (!success) {
43
- console.log("[i] Failed to set Git username, but continuing...");
44
- }
45
- } else {
46
- console.log("[i] No username provided, skipping username configuration");
47
- }
48
- if (email) {
49
- const success = runGitCommand(["config", "user.email", email], `Set Git email to "${email}"`);
50
- if (!success) {
51
- console.log("[i] Failed to set Git email, but continuing...");
52
- }
53
- } else {
54
- console.log("[i] No email provided, skipping email configuration");
55
- }
56
- if (username || email) {
57
- console.log("[\u2713] Git user configuration completed");
58
- }
59
- if (username) {
60
- const remoteUrl = runGitCommandOutput(["remote", "get-url", "origin"], "Fetching remote URL for verification");
61
- if (remoteUrl) {
62
- console.log(`[i] Remote URL: ${remoteUrl}`);
63
- const parsedUrl = gch.parseGitHubUrl(remoteUrl);
64
- if (parsedUrl && parsedUrl.owner && username && parsedUrl.owner.toLowerCase() !== username.toLowerCase()) {
65
- console.warn(
66
- `
67
- [!] The GitHub remote owner ("${parsedUrl.owner}") does not match the configured username ("${username}").`
68
- );
69
- console.warn(`[!] If this is not intentional, consider updating the remote URL to use your username.`);
70
- console.warn(`[!] Example: git remote set-url origin https://github.com/${username}/<repo>.git
71
- `);
72
- const args = getArgs();
73
- const updateRemote = options.updateRemote || args["update-remote"] === true;
74
- if (updateRemote) {
75
- let newUrl = remoteUrl;
76
- if (/^https:\/\//.test(remoteUrl)) {
77
- newUrl = remoteUrl.replace(/https:\/\/(?:[^@]+@)?github.com/, `https://${username}@github.com`);
78
- } else if (/^git@github.com:/.test(remoteUrl)) {
79
- console.warn(
80
- `[!] For SSH remotes, set your SSH config or use HTTPS with username if you want to change authentication user.`
81
- );
82
- return;
83
- }
84
- if (newUrl !== remoteUrl) {
85
- const updated = runGitCommand(["remote", "set-url", "origin", newUrl], `Set origin to ${newUrl}`);
86
- if (updated) {
87
- console.log(`[\u2713] Remote URL updated to: ${newUrl}`);
88
- } else {
89
- console.warn(`[!] Failed to update remote URL. Please update it manually if needed.`);
90
- }
91
- } else {
92
- console.log(`[i] Remote URL does not use HTTPS or already contains the username.`);
93
- }
94
- } else {
95
- console.log(`[i] Remote URL not changed. Use --update-remote to update automatically.`);
96
- }
97
- }
98
- }
99
- }
100
- }
101
- module.exports = {
102
- configureGitUser
103
- };
104
- }
105
- });
106
-
107
- export {
108
- require_user_config
109
- };
@@ -1,162 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- require_config
4
- } from "./chunk-PAZH45HS.mjs";
5
- import {
6
- __toESM,
7
- init_esm_shims
8
- } from "./chunk-QQ4A6DLD.mjs";
9
-
10
- // src/github-workflows/get-latest-workflow-status.mjs
11
- init_esm_shims();
12
- var import_config = __toESM(require_config(), 1);
13
- import axios from "axios";
14
- import { spawn } from "cross-spawn";
15
- if (!import_config.GITHUB_ACCESS_TOKEN) {
16
- console.error("Missing env var: ACCESS_TOKEN or GITHUB_TOKEN");
17
- process.exit(1);
18
- }
19
- var BASE = "https://api.github.com";
20
- var headers = {
21
- Authorization: `Bearer ${import_config.GITHUB_ACCESS_TOKEN}`,
22
- Accept: "application/vnd.github+json",
23
- "X-GitHub-Api-Version": "2022-11-28"
24
- };
25
- async function request(url) {
26
- try {
27
- const res = await axios.get(url, { headers });
28
- return res.data;
29
- } catch (err) {
30
- if (err == null ? void 0 : err.response) {
31
- const statusText = err.response.statusText || "Request failed";
32
- const responseText = typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data);
33
- throw new Error(`${err.response.status} ${statusText}
34
- ${responseText}`);
35
- }
36
- throw err;
37
- }
38
- }
39
- function runGit(args) {
40
- return new Promise((resolve, reject) => {
41
- var _a, _b;
42
- const child = spawn("git", args, {
43
- cwd: process.cwd(),
44
- stdio: ["ignore", "pipe", "pipe"]
45
- });
46
- let stdout = "";
47
- let stderr = "";
48
- (_a = child.stdout) == null ? void 0 : _a.on("data", (chunk) => {
49
- stdout += chunk.toString();
50
- });
51
- (_b = child.stderr) == null ? void 0 : _b.on("data", (chunk) => {
52
- stderr += chunk.toString();
53
- });
54
- child.on("error", reject);
55
- child.on("close", (code) => {
56
- if (code === 0) {
57
- resolve(stdout.trim());
58
- return;
59
- }
60
- reject(new Error(stderr.trim() || `git ${args.join(" ")} exited with code ${code}`));
61
- });
62
- });
63
- }
64
- function getOwnerFromRemoteUrl(remoteUrl) {
65
- var _a;
66
- const normalized = remoteUrl.trim().replace(/\.git$/i, "");
67
- const match = normalized.match(/github\.com[:/](?<owner>[^/]+)\/(?<repo>[^/]+)$/i);
68
- return ((_a = match == null ? void 0 : match.groups) == null ? void 0 : _a.owner) || null;
69
- }
70
- function getRepoFromRemoteUrl(remoteUrl) {
71
- var _a;
72
- const normalized = remoteUrl.trim().replace(/\.git$/i, "");
73
- const match = normalized.match(/github\.com[:/](?<owner>[^/]+)\/(?<repo>[^/]+)$/i);
74
- return ((_a = match == null ? void 0 : match.groups) == null ? void 0 : _a.repo) || null;
75
- }
76
- async function getCurrentOwner() {
77
- const commands = [
78
- ["config", "--local", "--get", "remote.origin.url"],
79
- ["remote", "get-url", "origin"]
80
- ];
81
- for (const args of commands) {
82
- try {
83
- const remoteUrl = await runGit(args);
84
- const owner = getOwnerFromRemoteUrl(remoteUrl);
85
- if (owner) {
86
- return owner;
87
- }
88
- } catch {
89
- }
90
- }
91
- throw new Error("Unable to determine repository owner from git remote.origin.url");
92
- }
93
- async function getCurrentRepo() {
94
- const commands = [
95
- ["config", "--local", "--get", "remote.origin.url"],
96
- ["remote", "get-url", "origin"]
97
- ];
98
- for (const args of commands) {
99
- try {
100
- const remoteUrl = await runGit(args);
101
- const repo = getRepoFromRemoteUrl(remoteUrl);
102
- if (repo) {
103
- return repo;
104
- }
105
- } catch {
106
- }
107
- }
108
- throw new Error("Unable to determine repository name from git remote.origin.url");
109
- }
110
- async function getLatestRun(owner, repo, workflowId) {
111
- var _a;
112
- let url = `${BASE}/repos/${owner}/${repo}/actions/runs?per_page=1`;
113
- if (workflowId) {
114
- url += `&workflow_id=${encodeURIComponent(workflowId)}`;
115
- }
116
- const data = await request(url);
117
- return (_a = data.workflow_runs) == null ? void 0 : _a[0];
118
- }
119
- async function getJobs(owner, repo, runId) {
120
- const url = `${BASE}/repos/${owner}/${repo}/actions/runs/${runId}/jobs`;
121
- const data = await request(url);
122
- return data.jobs || [];
123
- }
124
- function printReport(run, jobs) {
125
- var _a;
126
- console.log("\n==============================");
127
- console.log("\u{1F680} Latest Workflow Run");
128
- console.log("==============================");
129
- console.log(`Name : ${run.name}`);
130
- console.log(`Status : ${run.status}`);
131
- console.log(`Conclusion: ${run.conclusion}`);
132
- console.log(`Branch : ${run.head_branch}`);
133
- console.log(`Run ID : ${run.id}`);
134
- console.log(`URL : ${run.html_url}`);
135
- console.log("\n==============================");
136
- console.log("\u{1F9E9} Jobs & Steps");
137
- console.log("==============================\n");
138
- for (const job of jobs) {
139
- console.log(`\u{1F9F1} Job: ${job.name}`);
140
- console.log(` Status: ${job.status} | Conclusion: ${job.conclusion}`);
141
- if (!((_a = job.steps) == null ? void 0 : _a.length)) {
142
- console.log(" (no steps found)\n");
143
- continue;
144
- }
145
- for (const step of job.steps) {
146
- const icon = step.conclusion === "success" ? "\u2705" : step.conclusion === "failure" ? "\u274C" : step.conclusion === "skipped" ? "\u23ED\uFE0F" : "\u26AA";
147
- console.log(` ${icon} ${step.name} -> ${step.conclusion} (${step.status})`);
148
- }
149
- console.log("");
150
- }
151
- }
152
-
153
- export {
154
- request,
155
- getOwnerFromRemoteUrl,
156
- getRepoFromRemoteUrl,
157
- getCurrentOwner,
158
- getCurrentRepo,
159
- getLatestRun,
160
- getJobs,
161
- printReport
162
- };
@@ -1,41 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- require_findEnvFiles
4
- } from "./chunk-H44UWUFY.mjs";
5
- import {
6
- __commonJS,
7
- __require,
8
- init_esm_shims
9
- } from "./chunk-QQ4A6DLD.mjs";
10
-
11
- // src/binary-collections/config.cjs
12
- var require_config = __commonJS({
13
- "src/binary-collections/config.cjs"(exports, module) {
14
- init_esm_shims();
15
- var path = __require("upath");
16
- var minimistLib = __require("minimist");
17
- var { findEnvWithToken } = require_findEnvFiles();
18
- __require("dotenv").config({ path: findEnvWithToken(), quiet: true, overwrite: true });
19
- var cliArgv = minimistLib(process.argv.slice(2), {
20
- string: ["token"]
21
- });
22
- var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
23
- function getTempDir() {
24
- return process.env.TEMP_DIR || path.join(process.cwd(), "tmp");
25
- }
26
- function getTempPath(...segments) {
27
- return path.join(getTempDir(), ...segments);
28
- }
29
- var TEMP_BASE_DIR = getTempDir();
30
- module.exports = {
31
- getTempDir,
32
- getTempPath,
33
- TEMP_BASE_DIR,
34
- GITHUB_ACCESS_TOKEN
35
- };
36
- }
37
- });
38
-
39
- export {
40
- require_config
41
- };
@@ -1,32 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- init_esm_shims
4
- } from "./chunk-QQ4A6DLD.mjs";
5
-
6
- // src/opencode/utils/check-api.ts
7
- init_esm_shims();
8
- import axios from "axios";
9
- import { writefile } from "sbg-utility";
10
- async function checkOpenCodeApi(prompt, apiKey, model = "deepseek-v4-flash-free") {
11
- const res = await axios.post(
12
- "https://opencode.ai/zen/v1/chat/completions",
13
- {
14
- model,
15
- messages: [{ role: "user", content: prompt }],
16
- max_tokens: 512
17
- },
18
- {
19
- headers: { Authorization: `Bearer ${apiKey}` }
20
- }
21
- );
22
- const filePath = `tmp/logs/opencode-api-check-${Date.now()}.json`;
23
- writefile(filePath, JSON.stringify(res.data, null, 2));
24
- const message = res.data.choices[0].message;
25
- const output = message.content || message.reasoning_content;
26
- const notEmptyOutput = output && output.trim().length > 0;
27
- return notEmptyOutput;
28
- }
29
-
30
- export {
31
- checkOpenCodeApi
32
- };
@@ -1,76 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- init_esm_shims
4
- } from "./chunk-QQ4A6DLD.mjs";
5
-
6
- // src/rmpath.mjs
7
- init_esm_shims();
8
- import dotenv from "dotenv";
9
- import fs from "fs-extra";
10
- import * as glob from "glob";
11
- import path from "upath";
12
- import { fileURLToPath } from "url";
13
- var __filename = fileURLToPath(import.meta.url);
14
- var __dirname = path.dirname(__filename);
15
- var dotenvPath = path.resolve(process.cwd(), ".env");
16
- if (fs.existsSync(dotenvPath)) {
17
- dotenv.config({ path: dotenvPath, override: true, quiet: true });
18
- }
19
- var deletePatterns = [];
20
- function resolveDeletePatterns(targetPath) {
21
- if (fs.existsSync(targetPath) && fs.lstatSync(targetPath).isFile()) {
22
- deletePatterns.push(targetPath);
23
- return;
24
- }
25
- const vowels = ["a", "i", "u", "e", "o", "A", "I", "U", "E", "O"];
26
- const letters = [];
27
- for (let i = 97; i <= 122; i++) letters.push(String.fromCharCode(i));
28
- for (let i = 65; i <= 90; i++) letters.push(String.fromCharCode(i));
29
- for (const letter of letters) {
30
- for (const vowel of vowels) {
31
- deletePatterns.push(
32
- `.${letter}*`,
33
- `@${letter}*`,
34
- `${letter}*`,
35
- `@${letter}${vowel}*`,
36
- `.${letter}${vowel}*`,
37
- `${letter}${vowel}*`
38
- );
39
- }
40
- }
41
- }
42
- async function deleteMatchingFiles(baseDir) {
43
- for (const pattern of deletePatterns) {
44
- if (fs.existsSync(pattern)) {
45
- fs.rmSync(pattern, { recursive: true, force: true });
46
- continue;
47
- }
48
- const matches = glob.sync(path.join(baseDir, pattern), { dot: true, nocase: true });
49
- for (const fpath of matches) {
50
- try {
51
- console.log(`deleting ${fpath}`);
52
- fs.rmSync(fpath, { recursive: true, force: true });
53
- } catch (_e) {
54
- console.error(`cannot delete ${fpath}`);
55
- }
56
- }
57
- }
58
- }
59
- async function deleteMainScript(targetPath) {
60
- if (!fs.existsSync(targetPath)) {
61
- targetPath = path.resolve(process.cwd(), targetPath);
62
- }
63
- resolveDeletePatterns(targetPath);
64
- await deleteMatchingFiles(targetPath);
65
- console.log(`cleaning ${targetPath}`);
66
- try {
67
- fs.rmSync(targetPath, { recursive: true, force: true });
68
- } catch (_e) {
69
- }
70
- }
71
-
72
- export {
73
- resolveDeletePatterns,
74
- deleteMatchingFiles,
75
- deleteMainScript
76
- };
@@ -1,61 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- checkOpenCodeApi
4
- } from "./chunk-QZMGBDSA.mjs";
5
- import {
6
- getOpenCodeAuth,
7
- readJson,
8
- saveOpenCodeAuth
9
- } from "./chunk-XW5NZAKI.mjs";
10
- import {
11
- init_esm_shims
12
- } from "./chunk-QQ4A6DLD.mjs";
13
-
14
- // src/opencode/cli/auth-rotate.ts
15
- init_esm_shims();
16
- import path from "upath";
17
- async function handleAuthRotate() {
18
- let keysFile = path.join(process.cwd(), ".opencode.keys.jsonc");
19
- let keys = await readJson(keysFile);
20
- if (!keys) {
21
- keysFile = path.join(process.cwd(), ".opencode.keys.json");
22
- keys = await readJson(keysFile);
23
- }
24
- if (!keys || !Array.isArray(keys) || keys.length === 0) {
25
- console.error("No valid .opencode.keys.json or .opencode.keys.jsonc found in current directory");
26
- process.exit(1);
27
- }
28
- const auth = await getOpenCodeAuth();
29
- if (!auth) {
30
- console.error("No auth file found. Run configure first.");
31
- process.exit(1);
32
- }
33
- const currentKey = auth.opencode.key;
34
- const candidates = keys.filter((k) => k.key !== currentKey);
35
- if (candidates.length === 0) {
36
- console.error("No other keys available to rotate to");
37
- process.exit(1);
38
- }
39
- let chosen = null;
40
- for (const candidate of candidates) {
41
- try {
42
- const ok = await checkOpenCodeApi("Hello", candidate.key);
43
- if (ok) {
44
- chosen = candidate;
45
- break;
46
- }
47
- } catch {
48
- }
49
- }
50
- if (!chosen) {
51
- console.error("No working key found among available keys");
52
- process.exit(1);
53
- }
54
- auth.opencode.key = chosen.key;
55
- await saveOpenCodeAuth(auth);
56
- console.log(`Rotated OpenCode API key to: ${chosen.name}`);
57
- }
58
-
59
- export {
60
- handleAuthRotate
61
- };
@@ -1,44 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- require_findEnvFiles
4
- } from "./chunk-J4M5EL5P.mjs";
5
- import {
6
- __commonJS,
7
- __require,
8
- init_esm_shims
9
- } from "./chunk-QQ4A6DLD.mjs";
10
-
11
- // src/binary-collections/config.cjs
12
- var require_config = __commonJS({
13
- "src/binary-collections/config.cjs"(exports, module) {
14
- init_esm_shims();
15
- var path = __require("upath");
16
- var minimistLib = __require("minimist");
17
- var { findEnvWithToken } = require_findEnvFiles();
18
- var dotenv = __require("dotenv");
19
- var loadDotenv = () => dotenv.config({ path: findEnvWithToken(), quiet: true, overwrite: true });
20
- loadDotenv();
21
- var cliArgv = minimistLib(process.argv.slice(2), {
22
- string: ["token"]
23
- });
24
- var GITHUB_ACCESS_TOKEN = cliArgv.token || process.env.ACCESS_TOKEN || process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
25
- function getTempDir() {
26
- return process.env.TEMP_DIR || path.join(process.cwd(), "tmp");
27
- }
28
- function getTempPath(...segments) {
29
- return path.join(getTempDir(), ...segments);
30
- }
31
- var TEMP_BASE_DIR = getTempDir();
32
- module.exports = {
33
- getTempDir,
34
- getTempPath,
35
- TEMP_BASE_DIR,
36
- GITHUB_ACCESS_TOKEN,
37
- loadDotenv
38
- };
39
- }
40
- });
41
-
42
- export {
43
- require_config
44
- };
@@ -1,89 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import {
3
- __commonJS,
4
- init_esm_shims
5
- } from "./chunk-QQ4A6DLD.mjs";
6
-
7
- // src/github-workflows/workflow-test-data.cjs
8
- var require_workflow_test_data = __commonJS({
9
- "src/github-workflows/workflow-test-data.cjs"(exports, module) {
10
- init_esm_shims();
11
- var workflow = {
12
- name: "Node.js Package Test",
13
- concurrency: {
14
- group: "test-${{ github.event_name }}",
15
- "cancel-in-progress": true
16
- },
17
- on: {
18
- workflow_dispatch: {},
19
- push: {
20
- paths: ["**/test*/**", "**/test*", "**/src/**"]
21
- }
22
- },
23
- env: {
24
- CI_NODE_VERSION: "24.16.0",
25
- CI_PYTHON_VERSION: "3.11",
26
- ACCESS_TOKEN: "${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}",
27
- GH_TOKEN: "${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}"
28
- },
29
- jobs: {
30
- ci: {
31
- name: "\u{1F528} Build, Pack & Test",
32
- "runs-on": "ubuntu-latest",
33
- steps: [
34
- {
35
- name: "\u2B07\uFE0F Checkout workflow repository",
36
- uses: "actions/checkout@v6"
37
- },
38
- {
39
- name: "\u2B07\uFE0F Setup CI Environment",
40
- uses: "./.github/actions/setup-environments",
41
- with: {
42
- "node-version": "${{ env.CI_NODE_VERSION }}",
43
- "python-version": "${{ env.CI_PYTHON_VERSION }}",
44
- token: "${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}",
45
- "prefix-cache-key": "${{ runner.os }}-test-"
46
- }
47
- },
48
- {
49
- name: "\u{1F4E6} Install dependencies",
50
- run: `touch yarn.lock
51
- corepack yarn install`
52
- },
53
- {
54
- name: "\u{1F528} Build project",
55
- run: "corepack yarn build"
56
- },
57
- {
58
- name: "\u{1F4E6} Pack project",
59
- run: "corepack yarn pack"
60
- },
61
- // {
62
- // name: '🧪 Run committed composite tests action',
63
- // uses: './.github/actions/run-tests',
64
- // env: {
65
- // ACCESS_TOKEN: '${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}',
66
- // GH_TOKEN: '${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}'
67
- // }
68
- // },
69
- {
70
- name: "\u{1F9F9} Clean GitHub Actions Cache",
71
- // if: 'always()',
72
- "continue-on-error": true,
73
- env: {
74
- GH_TOKEN: "${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN || github.token }}"
75
- },
76
- shell: "bash",
77
- run: `npx --legacy-peer-deps -y binary-collections@https://raw.githubusercontent.com/dimaslanjaka/bin/master/releases/bin.tgz clean-github-actions-caches --repo "\${{ github.repository }}" --sha "\${{ github.sha }}"`
78
- }
79
- ]
80
- }
81
- }
82
- };
83
- module.exports = workflow;
84
- }
85
- });
86
-
87
- export {
88
- require_workflow_test_data
89
- };