@runa-ai/runa-cli 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ZWDWFMOX.js → chunk-HWR5NUUZ.js} +24 -3
- package/dist/{chunk-JQXOVCOP.js → chunk-NIS77243.js} +8 -5
- package/dist/{chunk-URWDB7YL.js → chunk-O3M7A73M.js} +58 -2
- package/dist/{chunk-QDOR3GTD.js → chunk-XRLIZKB2.js} +80 -12
- package/dist/{chunk-IEKYTCYA.js → chunk-YTQS2O4H.js} +59 -0
- package/dist/{chunk-OXQISY3J.js → chunk-ZPE52NEK.js} +1 -1
- package/dist/{ci-FLTJ2UXB.js → ci-3HZWUQFN.js} +4 -4
- package/dist/{cli-THEA6T7N.js → cli-RES5QRC2.js} +12 -12
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +6 -0
- package/dist/commands/db/commands/db-sync/production-precheck.d.ts +0 -8
- package/dist/commands/db/sync/schema-guardrail-graph-guidance.d.ts +18 -1
- package/dist/commands/db/sync/schema-guardrail-graph-nodes.d.ts +1 -1
- package/dist/commands/db/sync/schema-guardrail-graph-sql-helpers.d.ts +1 -1
- package/dist/commands/db/sync/schema-guardrail-types.d.ts +4 -2
- package/dist/commands/db/utils/changed-files-detector.d.ts +21 -0
- package/dist/commands/db/utils/schema-sync.d.ts +12 -0
- package/dist/commands/db/utils/sql-boundary-parser.d.ts +13 -0
- package/dist/commands/db/utils/sql-file-collector.d.ts +2 -0
- package/dist/constants/versions.d.ts +9 -0
- package/dist/{db-IDKQ44VX.js → db-PRGL7PBX.js} +587 -76
- package/dist/{dev-LGSMDFJN.js → dev-QR55VDNZ.js} +1 -1
- package/dist/{error-handler-YRQWRDEF.js → error-handler-XUQOP4TU.js} +1 -2
- package/dist/{hotfix-RJIAPLAM.js → hotfix-JYHDY2M6.js} +1 -2
- package/dist/index.js +4 -4
- package/dist/{init-2O6ODG5Z.js → init-4UAWYY75.js} +1 -1
- package/dist/{license-OB7GVJQ2.js → license-M6ODBV4X.js} +140 -154
- package/dist/pg-schema-diff-helpers-JZO4GAQG.js +7 -0
- package/dist/{upgrade-QZKEI3NJ.js → upgrade-LBO3Z3J7.js} +1 -1
- package/dist/utils/license/index.d.ts +15 -24
- package/dist/utils/license/types.d.ts +3 -4
- package/dist/utils/template-access.d.ts +20 -0
- package/dist/utils/template-fetcher.d.ts +10 -7
- package/dist/{vuln-check-JRPMUHLF.js → vuln-check-5JJ2YAJW.js} +1 -1
- package/dist/{vuln-checker-Q7LSHUHJ.js → vuln-checker-JF5234BL.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZZOXM6Q4.js +0 -8
- package/dist/pg-schema-diff-helpers-7377FS2D.js +0 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { startAppBackground, waitForAppReady, detectApp } from './chunk-EXR4J2JT.js';
|
|
4
4
|
import { writeEnvLocalBridge } from './chunk-KUH3G522.js';
|
|
5
|
-
import { generateTablesManifest } from './chunk-
|
|
5
|
+
import { generateTablesManifest } from './chunk-O3M7A73M.js';
|
|
6
6
|
import './chunk-A6A7JIRD.js';
|
|
7
7
|
import { manifestActor, supabaseStartActor, envCheckActor, depsInstallActor, detectManifestTask, detectDatabase } from './chunk-MAFJAA2P.js';
|
|
8
8
|
import { findRepoRoot } from './chunk-3WDV32GA.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { ERROR_CATALOG } from './chunk-JQXOVCOP.js';
|
|
3
|
+
import { ERROR_CATALOG } from './chunk-NIS77243.js';
|
|
5
4
|
import { ErrorEnvelopeSchema, CLI_CONTRACT_VERSION, writeJsonEnvelope } from './chunk-WJXC4MVY.js';
|
|
6
5
|
import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
|
|
7
6
|
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { createError } from './chunk-JQXOVCOP.js';
|
|
3
|
+
import { createError } from './chunk-NIS77243.js';
|
|
5
4
|
import { tryResolveDatabaseUrl } from './chunk-WGRVAGSR.js';
|
|
6
5
|
import './chunk-UHDAYPHH.js';
|
|
7
6
|
import { loadEnvFiles } from './chunk-IWVXI5O4.js';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { getRequestedCommandNameFromArgv } from './chunk-UWWSAPDR.js';
|
|
4
|
-
import { CLI_VERSION } from './chunk-
|
|
4
|
+
import { CLI_VERSION } from './chunk-ZPE52NEK.js';
|
|
5
5
|
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
6
6
|
import { realpathSync } from 'fs';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
@@ -36,7 +36,7 @@ async function getProgram(options) {
|
|
|
36
36
|
};
|
|
37
37
|
const nextKey = getProgramCacheKey(resolvedOptions);
|
|
38
38
|
if (!programInstance || programCacheKey !== nextKey) {
|
|
39
|
-
const { createProgram } = await import('./cli-
|
|
39
|
+
const { createProgram } = await import('./cli-RES5QRC2.js');
|
|
40
40
|
programInstance = await createProgram(resolvedOptions);
|
|
41
41
|
programCacheKey = nextKey;
|
|
42
42
|
}
|
|
@@ -60,7 +60,7 @@ async function runCliFromProcessArgv() {
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const { setupSignalHandlers } = await import('./signal-handler-DO3OANW5.js');
|
|
63
|
-
const { executeProgram } = await import('./cli-
|
|
63
|
+
const { executeProgram } = await import('./cli-RES5QRC2.js');
|
|
64
64
|
setupSignalHandlers();
|
|
65
65
|
const options = getProgramLoadOptions(argv);
|
|
66
66
|
const program = await getProgram(options);
|
|
@@ -68,7 +68,7 @@ async function runCliFromProcessArgv() {
|
|
|
68
68
|
}
|
|
69
69
|
if (isDirectlyExecuted()) {
|
|
70
70
|
runCliFromProcessArgv().catch(async (error) => {
|
|
71
|
-
const { handleCLIError } = await import('./error-handler-
|
|
71
|
+
const { handleCLIError } = await import('./error-handler-XUQOP4TU.js');
|
|
72
72
|
handleCLIError(error);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { diagnoseInitFailure } from './chunk-AAIE4F2U.js';
|
|
4
4
|
import { getVercelRootDirectory } from './chunk-MXRWBNIY.js';
|
|
5
|
-
import { fetchTemplates } from './chunk-
|
|
5
|
+
import { fetchTemplates } from './chunk-YTQS2O4H.js';
|
|
6
6
|
import { syncRunaConfigWithVercel } from './chunk-6AALH2ED.js';
|
|
7
7
|
import './chunk-B7C7CLW2.js';
|
|
8
8
|
import './chunk-RZLYEO4U.js';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import { createError } from './chunk-JQXOVCOP.js';
|
|
4
3
|
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
5
|
-
import { createCLILogger as createCLILogger$1 } from '@runa-ai/runa/cli-runtime';
|
|
6
4
|
import { createCLILogger, CLIError } from '@runa-ai/runa';
|
|
7
5
|
import { execa } from 'execa';
|
|
8
6
|
|
|
@@ -11,6 +9,140 @@ createRequire(import.meta.url);
|
|
|
11
9
|
// src/utils/license/index.ts
|
|
12
10
|
init_esm_shims();
|
|
13
11
|
|
|
12
|
+
// src/utils/license/ci-detector.ts
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var CI_PROVIDERS = {
|
|
15
|
+
// GitHub Actions
|
|
16
|
+
GITHUB_ACTIONS: "github-actions",
|
|
17
|
+
// GitLab CI
|
|
18
|
+
GITLAB_CI: "gitlab-ci",
|
|
19
|
+
// CircleCI
|
|
20
|
+
CIRCLECI: "circleci",
|
|
21
|
+
// Jenkins
|
|
22
|
+
JENKINS_URL: "jenkins",
|
|
23
|
+
// Travis CI
|
|
24
|
+
TRAVIS: "travis-ci",
|
|
25
|
+
// Bitbucket Pipelines
|
|
26
|
+
BITBUCKET_BUILD_NUMBER: "bitbucket-pipelines",
|
|
27
|
+
// Azure Pipelines
|
|
28
|
+
TF_BUILD: "azure-pipelines",
|
|
29
|
+
// AWS CodeBuild
|
|
30
|
+
CODEBUILD_BUILD_ID: "aws-codebuild",
|
|
31
|
+
// Google Cloud Build
|
|
32
|
+
CLOUD_BUILD_PROJECT: "google-cloud-build",
|
|
33
|
+
// Vercel
|
|
34
|
+
VERCEL: "vercel",
|
|
35
|
+
// Netlify
|
|
36
|
+
NETLIFY: "netlify"
|
|
37
|
+
};
|
|
38
|
+
function isCI() {
|
|
39
|
+
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
for (const envVar of Object.keys(CI_PROVIDERS)) {
|
|
43
|
+
if (process.env[envVar]) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
function detectCIProvider() {
|
|
50
|
+
for (const [envVar, provider] of Object.entries(CI_PROVIDERS)) {
|
|
51
|
+
if (process.env[envVar]) {
|
|
52
|
+
return provider;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
56
|
+
return "generic-ci";
|
|
57
|
+
}
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
function detectCI() {
|
|
61
|
+
const provider = detectCIProvider();
|
|
62
|
+
return {
|
|
63
|
+
isCI: provider !== void 0,
|
|
64
|
+
provider
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/utils/license/owner-resolver.ts
|
|
69
|
+
init_esm_shims();
|
|
70
|
+
function parseGitRemoteUrl(url) {
|
|
71
|
+
const sshMatch = url.match(/git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
72
|
+
if (sshMatch?.[1] && sshMatch[2]) {
|
|
73
|
+
return { owner: sshMatch[1], repo: sshMatch[2] };
|
|
74
|
+
}
|
|
75
|
+
const httpsMatch = url.match(/https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
76
|
+
if (httpsMatch?.[1] && httpsMatch[2]) {
|
|
77
|
+
return { owner: httpsMatch[1], repo: httpsMatch[2] };
|
|
78
|
+
}
|
|
79
|
+
const gitlabSshMatch = url.match(/git@gitlab\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
80
|
+
if (gitlabSshMatch?.[1] && gitlabSshMatch[2]) {
|
|
81
|
+
return { owner: gitlabSshMatch[1], repo: gitlabSshMatch[2] };
|
|
82
|
+
}
|
|
83
|
+
const gitlabHttpsMatch = url.match(/https?:\/\/gitlab\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
84
|
+
if (gitlabHttpsMatch?.[1] && gitlabHttpsMatch[2]) {
|
|
85
|
+
return { owner: gitlabHttpsMatch[1], repo: gitlabHttpsMatch[2] };
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
function resolveFromGitHubActions() {
|
|
90
|
+
const githubRepo = process.env.GITHUB_REPOSITORY;
|
|
91
|
+
if (!githubRepo) return null;
|
|
92
|
+
if (process.env.GITHUB_ACTIONS !== "true") {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const [owner, repo] = githubRepo.split("/");
|
|
96
|
+
if (!owner) return null;
|
|
97
|
+
return { owner, repo, source: "github-env" };
|
|
98
|
+
}
|
|
99
|
+
function resolveFromGitLabCI() {
|
|
100
|
+
const projectPath = process.env.CI_PROJECT_PATH;
|
|
101
|
+
if (!projectPath) return null;
|
|
102
|
+
if (process.env.GITLAB_CI !== "true") {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const [owner, ...repoParts] = projectPath.split("/");
|
|
106
|
+
if (!owner) return null;
|
|
107
|
+
return {
|
|
108
|
+
owner,
|
|
109
|
+
repo: repoParts.join("/") || void 0,
|
|
110
|
+
source: "gitlab-env"
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function resolveFromCircleCI() {
|
|
114
|
+
const owner = process.env.CIRCLE_PROJECT_USERNAME;
|
|
115
|
+
const repo = process.env.CIRCLE_PROJECT_REPONAME;
|
|
116
|
+
if (!owner) return null;
|
|
117
|
+
if (process.env.CIRCLECI !== "true") {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return { owner, repo: repo || void 0, source: "circleci-env" };
|
|
121
|
+
}
|
|
122
|
+
async function resolveFromGitRemote() {
|
|
123
|
+
try {
|
|
124
|
+
const { stdout } = await execa("git", ["remote", "get-url", "origin"], {
|
|
125
|
+
timeout: 5e3
|
|
126
|
+
});
|
|
127
|
+
const result = parseGitRemoteUrl(stdout.trim());
|
|
128
|
+
if (!result) return null;
|
|
129
|
+
return { owner: result.owner, repo: result.repo, source: "git-remote" };
|
|
130
|
+
} catch {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function resolveGitHubOwner() {
|
|
135
|
+
const gitRemoteResult = await resolveFromGitRemote();
|
|
136
|
+
if (gitRemoteResult) return gitRemoteResult;
|
|
137
|
+
const githubResult = resolveFromGitHubActions();
|
|
138
|
+
if (githubResult) return githubResult;
|
|
139
|
+
const gitlabResult = resolveFromGitLabCI();
|
|
140
|
+
if (gitlabResult) return gitlabResult;
|
|
141
|
+
const circleciResult = resolveFromCircleCI();
|
|
142
|
+
if (circleciResult) return circleciResult;
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
14
146
|
// src/utils/license/allowlist-checker.ts
|
|
15
147
|
init_esm_shims();
|
|
16
148
|
var DEFAULT_ALLOWLIST_API_URL = "https://api.runa.dev/api/license/check";
|
|
@@ -151,140 +283,6 @@ function getAllowlistCacheStats() {
|
|
|
151
283
|
};
|
|
152
284
|
}
|
|
153
285
|
|
|
154
|
-
// src/utils/license/ci-detector.ts
|
|
155
|
-
init_esm_shims();
|
|
156
|
-
var CI_PROVIDERS = {
|
|
157
|
-
// GitHub Actions
|
|
158
|
-
GITHUB_ACTIONS: "github-actions",
|
|
159
|
-
// GitLab CI
|
|
160
|
-
GITLAB_CI: "gitlab-ci",
|
|
161
|
-
// CircleCI
|
|
162
|
-
CIRCLECI: "circleci",
|
|
163
|
-
// Jenkins
|
|
164
|
-
JENKINS_URL: "jenkins",
|
|
165
|
-
// Travis CI
|
|
166
|
-
TRAVIS: "travis-ci",
|
|
167
|
-
// Bitbucket Pipelines
|
|
168
|
-
BITBUCKET_BUILD_NUMBER: "bitbucket-pipelines",
|
|
169
|
-
// Azure Pipelines
|
|
170
|
-
TF_BUILD: "azure-pipelines",
|
|
171
|
-
// AWS CodeBuild
|
|
172
|
-
CODEBUILD_BUILD_ID: "aws-codebuild",
|
|
173
|
-
// Google Cloud Build
|
|
174
|
-
CLOUD_BUILD_PROJECT: "google-cloud-build",
|
|
175
|
-
// Vercel
|
|
176
|
-
VERCEL: "vercel",
|
|
177
|
-
// Netlify
|
|
178
|
-
NETLIFY: "netlify"
|
|
179
|
-
};
|
|
180
|
-
function isCI() {
|
|
181
|
-
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
for (const envVar of Object.keys(CI_PROVIDERS)) {
|
|
185
|
-
if (process.env[envVar]) {
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
function detectCIProvider() {
|
|
192
|
-
for (const [envVar, provider] of Object.entries(CI_PROVIDERS)) {
|
|
193
|
-
if (process.env[envVar]) {
|
|
194
|
-
return provider;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
if (process.env.CI === "true" || process.env.CI === "1") {
|
|
198
|
-
return "generic-ci";
|
|
199
|
-
}
|
|
200
|
-
return void 0;
|
|
201
|
-
}
|
|
202
|
-
function detectCI() {
|
|
203
|
-
const provider = detectCIProvider();
|
|
204
|
-
return {
|
|
205
|
-
isCI: provider !== void 0,
|
|
206
|
-
provider
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// src/utils/license/owner-resolver.ts
|
|
211
|
-
init_esm_shims();
|
|
212
|
-
function parseGitRemoteUrl(url) {
|
|
213
|
-
const sshMatch = url.match(/git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
214
|
-
if (sshMatch?.[1] && sshMatch[2]) {
|
|
215
|
-
return { owner: sshMatch[1], repo: sshMatch[2] };
|
|
216
|
-
}
|
|
217
|
-
const httpsMatch = url.match(/https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
218
|
-
if (httpsMatch?.[1] && httpsMatch[2]) {
|
|
219
|
-
return { owner: httpsMatch[1], repo: httpsMatch[2] };
|
|
220
|
-
}
|
|
221
|
-
const gitlabSshMatch = url.match(/git@gitlab\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
222
|
-
if (gitlabSshMatch?.[1] && gitlabSshMatch[2]) {
|
|
223
|
-
return { owner: gitlabSshMatch[1], repo: gitlabSshMatch[2] };
|
|
224
|
-
}
|
|
225
|
-
const gitlabHttpsMatch = url.match(/https?:\/\/gitlab\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
226
|
-
if (gitlabHttpsMatch?.[1] && gitlabHttpsMatch[2]) {
|
|
227
|
-
return { owner: gitlabHttpsMatch[1], repo: gitlabHttpsMatch[2] };
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
function resolveFromGitHubActions() {
|
|
232
|
-
const githubRepo = process.env.GITHUB_REPOSITORY;
|
|
233
|
-
if (!githubRepo) return null;
|
|
234
|
-
if (process.env.GITHUB_ACTIONS !== "true") {
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
237
|
-
const [owner, repo] = githubRepo.split("/");
|
|
238
|
-
if (!owner) return null;
|
|
239
|
-
return { owner, repo, source: "github-env" };
|
|
240
|
-
}
|
|
241
|
-
function resolveFromGitLabCI() {
|
|
242
|
-
const projectPath = process.env.CI_PROJECT_PATH;
|
|
243
|
-
if (!projectPath) return null;
|
|
244
|
-
if (process.env.GITLAB_CI !== "true") {
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
|
-
const [owner, ...repoParts] = projectPath.split("/");
|
|
248
|
-
if (!owner) return null;
|
|
249
|
-
return {
|
|
250
|
-
owner,
|
|
251
|
-
repo: repoParts.join("/") || void 0,
|
|
252
|
-
source: "gitlab-env"
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
function resolveFromCircleCI() {
|
|
256
|
-
const owner = process.env.CIRCLE_PROJECT_USERNAME;
|
|
257
|
-
const repo = process.env.CIRCLE_PROJECT_REPONAME;
|
|
258
|
-
if (!owner) return null;
|
|
259
|
-
if (process.env.CIRCLECI !== "true") {
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
262
|
-
return { owner, repo: repo || void 0, source: "circleci-env" };
|
|
263
|
-
}
|
|
264
|
-
async function resolveFromGitRemote() {
|
|
265
|
-
try {
|
|
266
|
-
const { stdout } = await execa("git", ["remote", "get-url", "origin"], {
|
|
267
|
-
timeout: 5e3
|
|
268
|
-
});
|
|
269
|
-
const result = parseGitRemoteUrl(stdout.trim());
|
|
270
|
-
if (!result) return null;
|
|
271
|
-
return { owner: result.owner, repo: result.repo, source: "git-remote" };
|
|
272
|
-
} catch {
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
async function resolveGitHubOwner() {
|
|
277
|
-
const gitRemoteResult = await resolveFromGitRemote();
|
|
278
|
-
if (gitRemoteResult) return gitRemoteResult;
|
|
279
|
-
const githubResult = resolveFromGitHubActions();
|
|
280
|
-
if (githubResult) return githubResult;
|
|
281
|
-
const gitlabResult = resolveFromGitLabCI();
|
|
282
|
-
if (gitlabResult) return gitlabResult;
|
|
283
|
-
const circleciResult = resolveFromCircleCI();
|
|
284
|
-
if (circleciResult) return circleciResult;
|
|
285
|
-
return null;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
286
|
// src/utils/license/validate-owner.ts
|
|
289
287
|
init_esm_shims();
|
|
290
288
|
var GITHUB_OWNER_PATTERN = /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;
|
|
@@ -422,7 +420,7 @@ function clearAdminAuthCache() {
|
|
|
422
420
|
|
|
423
421
|
// src/utils/license/index.ts
|
|
424
422
|
var TRUSTED_ORG = "r06-dev";
|
|
425
|
-
var logger2 = createCLILogger
|
|
423
|
+
var logger2 = createCLILogger("license");
|
|
426
424
|
function isTrustedOrg(owner) {
|
|
427
425
|
return owner.toLowerCase() === TRUSTED_ORG.toLowerCase();
|
|
428
426
|
}
|
|
@@ -439,30 +437,18 @@ async function checkLicense() {
|
|
|
439
437
|
}
|
|
440
438
|
const result = await resolveGitHubOwner();
|
|
441
439
|
if (!result?.owner) {
|
|
442
|
-
logger2.
|
|
443
|
-
return { allowed:
|
|
440
|
+
logger2.debug("[license] Could not determine repository owner; allowing CI execution");
|
|
441
|
+
return { allowed: true, reason: "ci-allowed" };
|
|
444
442
|
}
|
|
445
443
|
const owner = result.owner;
|
|
446
444
|
if (isTrustedOrg(owner)) {
|
|
447
445
|
return { allowed: true, reason: "trusted-org", owner };
|
|
448
446
|
}
|
|
449
|
-
logger2.debug(`[license] External org detected: ${owner}`);
|
|
450
|
-
|
|
451
|
-
const isAllowed = await checkAllowlist(owner);
|
|
452
|
-
if (isAllowed) {
|
|
453
|
-
return { allowed: true, reason: "allowlist", owner };
|
|
454
|
-
}
|
|
455
|
-
return { allowed: false, reason: "not-found", owner };
|
|
456
|
-
} catch (error) {
|
|
457
|
-
logger2.debug(`[license] Allowlist check failed with no fallback: ${error}`);
|
|
458
|
-
return { allowed: false, reason: "error", owner };
|
|
459
|
-
}
|
|
447
|
+
logger2.debug(`[license] External org detected: ${owner}; allowing CI execution`);
|
|
448
|
+
return { allowed: true, reason: "ci-allowed", owner };
|
|
460
449
|
}
|
|
461
450
|
async function enforceLicenseInCI() {
|
|
462
|
-
|
|
463
|
-
if (!result.allowed) {
|
|
464
|
-
throw createError("LICENSE_UNAUTHORIZED", { owner: result.owner ?? "unknown" });
|
|
465
|
-
}
|
|
451
|
+
await checkLicense();
|
|
466
452
|
}
|
|
467
453
|
|
|
468
454
|
export { checkAllowlist, checkLicense, clearAdminAuthCache, clearAllowlistCache, detectCI, detectCIProvider, enforceLicenseInCI, getAllowlistCacheStats, getGitHubUserEmail, isCI, isValidOwner, resolveGitHubOwner, validateOwner, verifyAdminAuth };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
export { PG_SCHEMA_DIFF_APPLY_TIMEOUT_MS, buildIdleConnectionCleanupSql, detectDropTableStatements, detectExtensionFilePath, detectMissingExtensionType, detectMissingQualifiedFunction, detectPartitionPrivilegeError, executePgSchemaDiffPlan, formatDeclarativeDependencyBoundaryHint, formatExtensionErrorHint, formatPartitionPrivilegeHint, freeConnectionSlotsForPgSchemaDiff, startConnectionCleanupDaemon, stopConnectionCleanupDaemon, verifyDatabaseConnection, verifyPgSchemaDiffBinary } from './chunk-HWR5NUUZ.js';
|
|
4
|
+
import './chunk-A6A7JIRD.js';
|
|
5
|
+
import './chunk-VRXHCR5K.js';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import { fetchTemplates } from './chunk-
|
|
3
|
+
import { fetchTemplates } from './chunk-YTQS2O4H.js';
|
|
4
4
|
import { updateRunaConfigSdkVersion } from './chunk-6AALH2ED.js';
|
|
5
5
|
import './chunk-B7C7CLW2.js';
|
|
6
6
|
import './chunk-RZLYEO4U.js';
|
|
@@ -1,45 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AI HINT: License Enforcement Module
|
|
3
3
|
*
|
|
4
|
-
* Purpose: CI
|
|
5
|
-
* Pattern:
|
|
4
|
+
* Purpose: CI compatibility guard for runa CLI
|
|
5
|
+
* Pattern: Public CLI/SDK/plugin commands are allowed in CI for any owner
|
|
6
6
|
*
|
|
7
7
|
* Design decisions:
|
|
8
|
-
* - r06-dev: Instant allow, NO
|
|
9
|
-
* - External org:
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* - API available: Use live response
|
|
13
|
-
* - API error + cached: Use last-known-good (24h window)
|
|
14
|
-
* - API error + no cache: Deny access (new orgs blocked during outage)
|
|
15
|
-
* - Escape hatch: RUNA_SKIP_LICENSE_CHECK=1 bypasses all checks (local only)
|
|
8
|
+
* - r06-dev: Instant allow, NO extra checks, NO log (zero-impact)
|
|
9
|
+
* - External org: Also allowed for normal CLI usage in CI
|
|
10
|
+
* - Owner resolution failures: Do not block CI execution
|
|
11
|
+
* - Escape hatch: RUNA_SKIP_LICENSE_CHECK=1 still bypasses checks in local dev
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - Known orgs protected during outages (last-known-good)
|
|
20
|
-
* - Unknown orgs cannot bypass by causing errors (fail closed)
|
|
13
|
+
* Template access is intentionally NOT handled here.
|
|
14
|
+
* `runa init` / `runa upgrade` remain restricted by private GitHub Packages auth.
|
|
21
15
|
*/
|
|
22
16
|
import type { LicenseCheckResult } from './types.js';
|
|
23
17
|
/**
|
|
24
|
-
* Perform
|
|
18
|
+
* Perform CI compatibility check and return result
|
|
25
19
|
*
|
|
26
|
-
*
|
|
20
|
+
* This no longer blocks external organizations. The result is retained so callers
|
|
21
|
+
* can inspect whether the run happened in local dev, trusted org CI, or general CI.
|
|
27
22
|
*/
|
|
28
23
|
export declare function checkLicense(): Promise<LicenseCheckResult>;
|
|
29
24
|
/**
|
|
30
|
-
* Enforce
|
|
25
|
+
* Enforce CI compatibility check in CI environments
|
|
31
26
|
*
|
|
32
|
-
* Call this at CLI startup
|
|
27
|
+
* Call this at CLI startup so the runtime behavior stays centralized.
|
|
33
28
|
*
|
|
34
29
|
* Behavior:
|
|
35
30
|
* - Local dev: Skip silently
|
|
36
31
|
* - r06-dev: Skip silently (no API, no log)
|
|
37
|
-
* - External org
|
|
38
|
-
* -
|
|
39
|
-
* - API error + last-known-good: Use cached result (24h window)
|
|
40
|
-
* - API error + no cache: Block (fail closed for unknown orgs)
|
|
41
|
-
*
|
|
42
|
-
* @throws CLIError when access is denied
|
|
32
|
+
* - External org: Allow for normal CLI usage in CI
|
|
33
|
+
* - Template commands still rely on private package auth in their own code paths
|
|
43
34
|
*/
|
|
44
35
|
export declare function enforceLicenseInCI(): Promise<void>;
|
|
45
36
|
export type { LicenseCheckResult, OwnerResolutionResult, CIDetectionResult } from './types.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AI HINT: License Check Type Definitions
|
|
3
3
|
*
|
|
4
|
-
* Purpose: Type definitions for CI access
|
|
5
|
-
* Pattern:
|
|
4
|
+
* Purpose: Type definitions for CI access compatibility checks
|
|
5
|
+
* Pattern: CI is always allowed; reasons document how the decision was made
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Result of CI environment detection
|
|
@@ -38,7 +38,6 @@ export interface LicenseCheckResult {
|
|
|
38
38
|
/**
|
|
39
39
|
* Reasons for license check decisions
|
|
40
40
|
*
|
|
41
|
-
* SECURITY (Issue #542): Fail-closed design - errors result in denial
|
|
42
41
|
*/
|
|
43
|
-
export type LicenseCheckReason = 'not-ci' | 'trusted-org' | '
|
|
42
|
+
export type LicenseCheckReason = 'not-ci' | 'trusted-org' | 'ci-allowed' | 'skip-flag';
|
|
44
43
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Template Access Verification
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Ensure template operations are limited to users who can access the
|
|
5
|
+
* private runa source repository.
|
|
6
|
+
*
|
|
7
|
+
* Design:
|
|
8
|
+
* - Access is checked before cached templates are returned
|
|
9
|
+
* - NODE_AUTH_TOKEN and GitHub CLI auth are both accepted proof sources
|
|
10
|
+
* - Normal CLI/SDK/plugin commands are not gated by this module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Verify the current user can access the private runa source repository.
|
|
14
|
+
*
|
|
15
|
+
* This check is intentionally separate from CI compatibility checks:
|
|
16
|
+
* - Normal CLI/SDK/plugin commands remain public
|
|
17
|
+
* - Template operations stay restricted to authorized users
|
|
18
|
+
*/
|
|
19
|
+
export declare function verifyTemplateRepoAccess(): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=template-access.d.ts.map
|
|
@@ -17,19 +17,22 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Authentication Flow:
|
|
19
19
|
* ┌─────────────────────────────────────────────────────────────────┐
|
|
20
|
-
* │ 1.
|
|
21
|
-
* │ └─
|
|
20
|
+
* │ 1. Verify access to r06-dev/runa │
|
|
21
|
+
* │ └─ Required before workspace/cache/fetch paths │
|
|
22
22
|
* │ │
|
|
23
|
-
* │ 2.
|
|
23
|
+
* │ 2. Check workspace (runa-repo development) │
|
|
24
|
+
* │ └─ Found → Use local packages/runa-templates/ │
|
|
25
|
+
* │ │
|
|
26
|
+
* │ 3. Check cache (~/.cache/runa/templates/{version}/) │
|
|
27
|
+
* │ └─ Hit → Return cached path (no network) │
|
|
28
|
+
* │ │
|
|
29
|
+
* │ 4. Try auto-detect NODE_AUTH_TOKEN │
|
|
24
30
|
* │ ├─ Already set → Continue │
|
|
25
31
|
* │ └─ Not set → Try `gh auth token` command │
|
|
26
32
|
* │ ├─ Success → Set NODE_AUTH_TOKEN and continue │
|
|
27
33
|
* │ └─ Fail → CLIError with setup instructions │
|
|
28
34
|
* │ │
|
|
29
|
-
* │
|
|
30
|
-
* │ └─ Hit → Return cached path (no network) │
|
|
31
|
-
* │ │
|
|
32
|
-
* │ 4. Fetch from GitHub Packages │
|
|
35
|
+
* │ 5. Fetch from GitHub Packages │
|
|
33
36
|
* │ └─ Success → Cache and return path │
|
|
34
37
|
* └─────────────────────────────────────────────────────────────────┘
|
|
35
38
|
*
|
|
@@ -71,7 +71,7 @@ var vulnCheckCommand = new Command("vuln-check").description("Run comprehensive
|
|
|
71
71
|
const logger = createCLILogger("vuln-check");
|
|
72
72
|
const isJsonMode = getOutputFormatFromEnv() === "json" || options.format === "json";
|
|
73
73
|
try {
|
|
74
|
-
const { VulnChecker } = await import('./vuln-checker-
|
|
74
|
+
const { VulnChecker } = await import('./vuln-checker-JF5234BL.js');
|
|
75
75
|
const categoryMap = {
|
|
76
76
|
code: ["injection", "auth", "crypto"],
|
|
77
77
|
deps: ["dependency"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import { CLI_VERSION } from './chunk-
|
|
3
|
+
import { CLI_VERSION } from './chunk-ZPE52NEK.js';
|
|
4
4
|
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
5
5
|
import { glob } from 'glob';
|
|
6
6
|
import { exec } from 'child_process';
|
package/package.json
CHANGED
package/dist/chunk-ZZOXM6Q4.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'module';
|
|
3
|
-
export { PG_SCHEMA_DIFF_APPLY_TIMEOUT_MS, buildIdleConnectionCleanupSql, detectDropTableStatements, detectMissingExtensionType, detectMissingQualifiedFunction, detectPartitionPrivilegeError, executePgSchemaDiffPlan, formatDeclarativeDependencyBoundaryHint, formatExtensionErrorHint, formatPartitionPrivilegeHint, freeConnectionSlotsForPgSchemaDiff, startConnectionCleanupDaemon, stopConnectionCleanupDaemon, verifyDatabaseConnection, verifyPgSchemaDiffBinary } from './chunk-ZWDWFMOX.js';
|
|
4
|
-
import './chunk-A6A7JIRD.js';
|
|
5
|
-
import './chunk-VRXHCR5K.js';
|
|
6
|
-
|
|
7
|
-
createRequire(import.meta.url);
|