omniqa 0.8.0 → 0.9.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/.tsbuildinfo +1 -1
- package/dist/auth.d.ts +17 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +29 -1
- package/dist/auth.js.map +1 -1
- package/dist/cli.js +13 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/chat.js +1 -1
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/crawl.d.ts.map +1 -1
- package/dist/commands/crawl.js +17 -5
- package/dist/commands/crawl.js.map +1 -1
- package/dist/commands/doctor.d.ts +16 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +124 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.js +1 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +137 -45
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/knowledge.d.ts +61 -1
- package/dist/commands/knowledge.d.ts.map +1 -1
- package/dist/commands/knowledge.js +232 -50
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/persist.d.ts +6 -0
- package/dist/commands/persist.d.ts.map +1 -1
- package/dist/commands/persist.js +9 -2
- package/dist/commands/persist.js.map +1 -1
- package/dist/commands/plan-add.d.ts.map +1 -1
- package/dist/commands/plan-add.js +13 -3
- package/dist/commands/plan-add.js.map +1 -1
- package/dist/commands/plan-review.d.ts +6 -2
- package/dist/commands/plan-review.d.ts.map +1 -1
- package/dist/commands/plan-review.js +16 -5
- package/dist/commands/plan-review.js.map +1 -1
- package/dist/commands/plan.d.ts +15 -0
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +100 -30
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/reindex.d.ts +1 -1
- package/dist/commands/reindex.d.ts.map +1 -1
- package/dist/commands/reindex.js +15 -1
- package/dist/commands/reindex.js.map +1 -1
- package/dist/commands/security.d.ts +2 -0
- package/dist/commands/security.d.ts.map +1 -1
- package/dist/commands/security.js +5 -1
- package/dist/commands/security.js.map +1 -1
- package/dist/commands/serve.d.ts +2 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +126 -30
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +19 -2
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/test.d.ts +0 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +58 -5
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/write.d.ts +8 -2
- package/dist/commands/write.d.ts.map +1 -1
- package/dist/commands/write.js +76 -19
- package/dist/commands/write.js.map +1 -1
- package/dist/devices.d.ts +3 -1
- package/dist/devices.d.ts.map +1 -1
- package/dist/devices.js +5 -3
- package/dist/devices.js.map +1 -1
- package/dist/fixer.d.ts.map +1 -1
- package/dist/fixer.js +19 -9
- package/dist/fixer.js.map +1 -1
- package/dist/jobs.d.ts +6 -0
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +10 -1
- package/dist/jobs.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +7 -7
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +8 -6
- package/dist/mcp/tools.js.map +1 -1
- package/dist/page.d.ts +1 -1
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +11 -0
- package/dist/page.js.map +1 -1
- package/dist/planner.d.ts.map +1 -1
- package/dist/planner.js +8 -4
- package/dist/planner.js.map +1 -1
- package/dist/prompt.d.ts +7 -1
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +23 -4
- package/dist/prompt.js.map +1 -1
- package/dist/qa.d.ts +7 -0
- package/dist/qa.d.ts.map +1 -1
- package/dist/qa.js +33 -9
- package/dist/qa.js.map +1 -1
- package/dist/runner.d.ts +7 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +28 -8
- package/dist/runner.js.map +1 -1
- package/dist/security-checks.d.ts +46 -4
- package/dist/security-checks.d.ts.map +1 -1
- package/dist/security-checks.js +114 -39
- package/dist/security-checks.js.map +1 -1
- package/dist/security-gates.d.ts +52 -4
- package/dist/security-gates.d.ts.map +1 -1
- package/dist/security-gates.js +115 -12
- package/dist/security-gates.js.map +1 -1
- package/dist/security-report.d.ts +22 -0
- package/dist/security-report.d.ts.map +1 -1
- package/dist/security-report.js +22 -4
- package/dist/security-report.js.map +1 -1
- package/dist/security-request.d.ts +27 -4
- package/dist/security-request.d.ts.map +1 -1
- package/dist/security-request.js +56 -14
- package/dist/security-request.js.map +1 -1
- package/dist/security-research.d.ts +2 -1
- package/dist/security-research.d.ts.map +1 -1
- package/dist/security-research.js +33 -15
- package/dist/security-research.js.map +1 -1
- package/dist/security-scan.d.ts +7 -7
- package/dist/security-scan.d.ts.map +1 -1
- package/dist/security-scan.js +66 -18
- package/dist/security-scan.js.map +1 -1
- package/dist/security.d.ts +15 -3
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +180 -36
- package/dist/security.js.map +1 -1
- package/dist/sync.d.ts +55 -3
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +403 -54
- package/dist/sync.js.map +1 -1
- package/dist/test.d.ts +19 -2
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js +143 -27
- package/dist/test.js.map +1 -1
- package/dist/writer.d.ts +29 -10
- package/dist/writer.d.ts.map +1 -1
- package/dist/writer.js +116 -36
- package/dist/writer.js.map +1 -1
- package/package.json +7 -7
- package/skills/knowledge.md +1 -1
- package/skills/onboarding.md +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot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C1F,IAAI,CAAC,SAAS;QAAE,OAAO,CAAC,CAAC;IACzB,OAAO,cAAc,CAAC;QACpB,GAAG;QACH,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACzE,KAAK,EAAE,GAAG,EAAE,CAAC,kBAAkB,MAAM,EAAE;QACvC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC,SAAS,KAAK,IAAI;QACpC,GAAG;KACJ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAA6L,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAwB,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAC7U,OAAO,EAAe,KAAK,UAAU,EAAoB,MAAM,oBAAoB,CAAC;AAGpF,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAK3D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB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AAO,EAAE,KAAK,GAAE,SAAiC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6HnG;AAwHD,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiOvE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -3,9 +3,9 @@ import { basename, dirname, join, relative, resolve, sep as pathSep } from "node
|
|
|
3
3
|
import { stderr, stdout } from "node:process";
|
|
4
4
|
import { parseArgs, styleText } from "node:util";
|
|
5
5
|
import { installInterceptor, INTERCEPTOR_VERSION } from "@omniqa/browser";
|
|
6
|
-
import { DEFAULT_KEY_ENV, DEVICE_PLATFORMS, git, loadConfig, parseRemote, PRODUCT_FILE, readmeHasBlock, readState, README_FILE, recordOnboarding, remoteUrl, writeReadme } from "@omniqa/core";
|
|
6
|
+
import { DEFAULT_KEY_ENV, DEVICE_PLATFORMS, git, loadConfig, parseRemote, PRODUCT_FILE, readmeHasBlock, readState, README_FILE, recordOnboarding, remoteUrl, RUNS_DIR, transcriptName, writeReadme } from "@omniqa/core";
|
|
7
7
|
import { deploySetup } from "../deploy-setup.js";
|
|
8
|
-
import { DEPLOY_WORKFLOW, GITLAB_CI, hasWriteJob, WRITE_WORKFLOW, writeJobGitlab, writeWorkflow } from "../jobs.js";
|
|
8
|
+
import { DEPLOY_WORKFLOW, GITLAB_CI, GITLAB_PUSH, hasWriteJob, WRITE_WORKFLOW, writeJobGitlab, writeWorkflow } from "../jobs.js";
|
|
9
9
|
import { linkOmniqa, PACKAGE_DIR } from "../link.js";
|
|
10
10
|
import { lineReader } from "../prompt.js";
|
|
11
11
|
import { projectCi } from "./doctor.js";
|
|
@@ -82,7 +82,8 @@ function ciTest(a) {
|
|
|
82
82
|
*/
|
|
83
83
|
const secEnvironment = (a) => (a.security === true ? a.environments.find((e) => e.tier === "production" && e.explore && !onThisMachine(e.url))?.name : undefined);
|
|
84
84
|
/** What the CI test job runs with security tests on: they are the `sec` job's, so the other job leaves them out. The tag as a whole word: a tag of the user's that starts like it (@security) stays in. */
|
|
85
|
-
|
|
85
|
+
// --pass-with-no-tests: a tier, or a project, that has no test yet is no red job (a pattern that matches nothing fails a run otherwise).
|
|
86
|
+
const ciTestCommand = (a) => `${ciTest(a).command}${a.security === true ? ' --grep-invert "@sec\\b"' : ""} --pass-with-no-tests`;
|
|
86
87
|
/** Under a CI file, with the kind on: the job that runs the security tests, or why there is none yet. */
|
|
87
88
|
const secNote = (a) => {
|
|
88
89
|
if (a.security !== true)
|
|
@@ -122,9 +123,9 @@ const exploreComment = (env) => `true: the model plans a step without a recordin
|
|
|
122
123
|
const REPLAY = "true: replay the recordings, model calls only for a step without one or one that misses; false: every run plans each step and verifies each assert through the models, the recordings stay the reference (omniqa test --replay or --no-replay switches one run)";
|
|
123
124
|
const DENY = "url substrings and control texts the agent never acts on here";
|
|
124
125
|
const PHONE = "a test number of your product's own: the security tests type it into a field that takes a phone number; without it such a field stays empty (any other number may be somebody's)";
|
|
125
|
-
const SECURITY = "off: the security tests alone,
|
|
126
|
+
const SECURITY = "off: the security tests alone, which send the product's forms and requests again with probe values and a few probes of their own (well-known files, wrong passwords), changing data only where mutations is true; on: an agent scan follows them here, sending requests of its own (model calls on every such run)";
|
|
126
127
|
const KINDS_QUESTION = "Testing kinds (1. e2e, 2. API, 3. security, 4. all; several as 2,3; e2e is always included)";
|
|
127
|
-
const SECURITY_QUESTION = "Agent scan on production (securityScan): 1. off (the security tests alone: the guard and the basic checks,
|
|
128
|
+
const SECURITY_QUESTION = "Agent scan on production (securityScan): 1. off (the security tests alone: the guard and the basic checks, which send the product's forms and requests again with probe values and a few probes of their own, such as wrong passwords; they change data only where mutations is true), 2. on (omniqa test and omniqa security go on to an agent scan there: a researcher that sends requests of its own and a reviewer that checks its claims; model calls on every such run)";
|
|
128
129
|
/** What each of the scan's roles is, in its model question. */
|
|
129
130
|
const SCAN_ROLE = {
|
|
130
131
|
security: "the researcher of the agent scan: it reads the product's traffic and sends requests of its own",
|
|
@@ -153,7 +154,8 @@ const USAGE = `omniqa init [folder] [options]
|
|
|
153
154
|
folder Create it (and its parents) and set the project up inside; the product name defaults to its name, and the
|
|
154
155
|
output ends by saying cd <folder>
|
|
155
156
|
--yes, -y Use defaults for every prompt and stop after the files
|
|
156
|
-
--force
|
|
157
|
+
--force Ask the interview again, the earlier answers as its defaults, and write the files again (one changed by
|
|
158
|
+
hand since is kept under .omniqa/runs/)
|
|
157
159
|
--jobs For a project set up by an older OmniQA: add the CI job it is missing and change nothing else. Today that is the
|
|
158
160
|
job that writes the tests you tick on a pull request OmniQA opened after a deploy (.github/workflows/omniqa-write.yml,
|
|
159
161
|
or the manual job omniqa write selected in .omniqa/ci/gitlab-ci.yml); then commit and push it
|
|
@@ -185,6 +187,20 @@ const USAGE = `omniqa init [folder] [options]
|
|
|
185
187
|
async function exists(path) {
|
|
186
188
|
return access(path).then(() => true, () => false);
|
|
187
189
|
}
|
|
190
|
+
/** The flags that answer the interview: read where it is asked or taken as answered (--yes), never by an init that resumes at a later stage. */
|
|
191
|
+
const ANSWER_FLAGS = ["name", "url", "prod-url", "provider", "model", "base-url", "key-env", "test-id", "ci", "pages", "repo", "deploy-from"];
|
|
192
|
+
/** The answers state.json keeps, when they are ones the interview can offer again: what it reads of them is there and of its kind. */
|
|
193
|
+
function storedAnswers(v) {
|
|
194
|
+
const a = v;
|
|
195
|
+
const strings = (x) => Array.isArray(x) && x.every((item) => typeof item === "string");
|
|
196
|
+
const record = (x) => typeof x === "object" && x !== null && !Array.isArray(x);
|
|
197
|
+
const ok = record(a) && typeof a.name === "string" && typeof a.provider === "string" && typeof a.keyEnv === "string" && typeof a.testId === "string" && typeof a.ci === "string" &&
|
|
198
|
+
Array.isArray(a.environments) && a.environments.length > 0 && a.environments.every((e) => record(e) && typeof e.name === "string" && typeof e.url === "string") &&
|
|
199
|
+
strings(a.repos) && strings(a.docs) && strings(a.notes) && record(a.apps) &&
|
|
200
|
+
Array.isArray(a.accounts) && a.accounts.every((acc) => record(acc) && typeof acc.name === "string" && typeof acc.role === "string" && record(acc.fields)) &&
|
|
201
|
+
record(a.models) && Object.values(a.models).every((m) => record(m) && typeof m.model === "string");
|
|
202
|
+
return ok ? a : undefined;
|
|
203
|
+
}
|
|
188
204
|
/** Today's `--yes` defaults, from the flags. */
|
|
189
205
|
export function defaultsFrom(cwd, flags, remote, repos = []) {
|
|
190
206
|
const ci = flags.ci ?? ciDefault(repos, remote);
|
|
@@ -206,7 +222,7 @@ export function defaultsFrom(cwd, flags, remote, repos = []) {
|
|
|
206
222
|
throw new Error(`--key-env takes ${keyEnvHint(choice.keyEnv)}`);
|
|
207
223
|
for (const flag of ["url", "prod-url"])
|
|
208
224
|
if (flags[flag] !== undefined && !isEnvironmentUrl(flags[flag]))
|
|
209
|
-
throw new Error(`--${flag} takes ${
|
|
225
|
+
throw new Error(`--${flag} takes ${environmentUrlHint(flags[flag])}`);
|
|
210
226
|
// ponytail: --yes without --url scaffolds the placeholder, which the interview never offers and the plan stage cannot crawl; make --url required there if that bites.
|
|
211
227
|
const environments = [{ name: "staging", url: flags.url ?? "https://staging.example.com", tier: "dev", explore: true, mutations: true }];
|
|
212
228
|
if (flags["prod-url"] !== undefined)
|
|
@@ -225,15 +241,30 @@ export function defaultsFrom(cwd, flags, remote, repos = []) {
|
|
|
225
241
|
const envName = (s) => s.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
226
242
|
/** What an environment's url is: where the product is running now, so the groundwork crawl reaches it. example.com is the documentation's illustration; nothing runs there. */
|
|
227
243
|
const URL_HINT = "an http:// or https:// url where the product is running (a local run too, e.g. http://127.0.0.1:9000); not example.com, the documentation's placeholder";
|
|
228
|
-
|
|
244
|
+
/** The url is written to product.yaml and state.json, printed by `omniqa status` and put into the prompts: it holds no secret. */
|
|
245
|
+
const URL_KEPT = `${PRODUCT_FILE} and .omniqa/state.json, which git keeps`;
|
|
246
|
+
/** Why a url is not an environment's, as the hint that says what one is; undefined when it is one. The hint never repeats the answer. */
|
|
247
|
+
const environmentUrlHint = (url) => {
|
|
248
|
+
let u;
|
|
229
249
|
try {
|
|
230
|
-
|
|
231
|
-
return /^https?:$/.test(u.protocol) && !/(^|\.)example\.com$/i.test(u.hostname);
|
|
250
|
+
u = new URL(url);
|
|
232
251
|
}
|
|
233
252
|
catch {
|
|
234
|
-
return
|
|
253
|
+
return URL_HINT;
|
|
235
254
|
}
|
|
255
|
+
if (!/^https?:$/.test(u.protocol) || /(^|\.)example\.com$/i.test(u.hostname))
|
|
256
|
+
return URL_HINT;
|
|
257
|
+
if (u.username !== "" || u.password !== "")
|
|
258
|
+
return `a url without a name and a password before its host (user:password@): the url is written to ${URL_KEPT}, printed by omniqa status and shown to the models. A site behind an HTTP sign-in gets its url as it is here, and httpAuth: { username, password: $VAR } on its environment in ${PRODUCT_FILE} afterwards`;
|
|
259
|
+
if (u.search !== "" || u.hash !== "")
|
|
260
|
+
return `a url without a query or a fragment: pages are opened under the url and neither is carried to them, and a token there would be written to ${URL_KEPT}, and shown to the models`;
|
|
261
|
+
return undefined;
|
|
236
262
|
};
|
|
263
|
+
const isEnvironmentUrl = (url) => environmentUrlHint(url) === undefined;
|
|
264
|
+
/** An environment's name is a key of product.yaml, what --env takes and a word of the CI jobs' commands. */
|
|
265
|
+
const ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
266
|
+
/** An account's name is a key of product.yaml and a folder of the crawl, its role an item of the roles list; in any script. */
|
|
267
|
+
const ACCOUNT_NAME = /^[\p{L}\p{N}][\p{L}\p{N} ._-]*$/u;
|
|
237
268
|
const ENV_NAME = /^[A-Z_][A-Z0-9_]*$/;
|
|
238
269
|
/** What a key name is: the variable's name, never the key. A key pasted in its place would be written to the config, .env.example, the CI workflow and state.json, so nothing built from this repeats the value. */
|
|
239
270
|
const keyEnvHint = (example) => `the name of the env var that holds the model key (A-Z, 0-9 and _, e.g. ${example}), not the key itself`;
|
|
@@ -250,12 +281,13 @@ export async function interview(reader, d, o = {}) {
|
|
|
250
281
|
/** Asks until `parse` takes the answer; input that has ended would give the same answer forever, so it stops the interview there. */
|
|
251
282
|
const askUntil = async (label, def, parse, hint) => {
|
|
252
283
|
for (;;) {
|
|
253
|
-
const
|
|
284
|
+
const answer = await ask(label, def);
|
|
285
|
+
const value = parse(answer);
|
|
254
286
|
if (value !== undefined)
|
|
255
287
|
return value;
|
|
256
288
|
if (ended)
|
|
257
289
|
throw new Error(`omniqa init: the input ended before "${label.trim()}" was answered`);
|
|
258
|
-
stdout.write(` ${hint}\n`);
|
|
290
|
+
stdout.write(` ${typeof hint === "string" ? hint : hint(answer)}\n`);
|
|
259
291
|
}
|
|
260
292
|
};
|
|
261
293
|
const yes = async (label, def) => /^y(es)?$/i.test(await ask(label, def ? "y" : "n"));
|
|
@@ -282,12 +314,13 @@ export async function interview(reader, d, o = {}) {
|
|
|
282
314
|
const environments = [];
|
|
283
315
|
for (let i = 1;; i++) {
|
|
284
316
|
const given = d.environments[i - 1];
|
|
285
|
-
|
|
317
|
+
// Two keys of one name, or a name that ends at its colon, are a product.yaml no command loads.
|
|
318
|
+
const envNameAnswer = await askUntil(`Environment ${i} name${i === 1 ? "" : ", empty when done"}`, given?.name ?? "", (n) => (n === "" || (ENVIRONMENT_NAME.test(n) && !environments.some((e) => e.name === n)) ? n : undefined), `a name of letters, digits, ., _ and - that no other environment has (a key of ${PRODUCT_FILE}, and what --env takes)`);
|
|
286
319
|
if (envNameAnswer === "")
|
|
287
320
|
break;
|
|
288
321
|
const defTier = given?.tier ?? (envNameAnswer === "production" ? "production" : "dev");
|
|
289
322
|
// No placeholder to take with Enter: a url from the flags is the default, the --yes scaffold's example.com is not.
|
|
290
|
-
const url = await askUntil(" url where the product is running (a local run too, e.g. http://127.0.0.1:9000)", given !== undefined && isEnvironmentUrl(given.url) ? given.url : "", (u) => (isEnvironmentUrl(u) ? u : undefined), URL_HINT);
|
|
323
|
+
const url = await askUntil(" url where the product is running (a local run too, e.g. http://127.0.0.1:9000)", given !== undefined && isEnvironmentUrl(given.url) ? given.url : "", (u) => (isEnvironmentUrl(u) ? u : undefined), (u) => environmentUrlHint(u) ?? URL_HINT);
|
|
291
324
|
const tier = await choice(" tier, dev or production", ["dev", "production"], defTier);
|
|
292
325
|
const explore = await yes(" allow exploration (y: the model plans a step without a recording and heals a stale one, on production too; n: replay only)", given?.explore ?? true);
|
|
293
326
|
const mutations = await yes(` allow mutations: n makes the environment ${READ_ONLY}`, given?.mutations ?? true);
|
|
@@ -334,11 +367,13 @@ export async function interview(reader, d, o = {}) {
|
|
|
334
367
|
const accounts = [];
|
|
335
368
|
for (;;) {
|
|
336
369
|
const given = d.accounts[accounts.length];
|
|
337
|
-
const accountName = await
|
|
370
|
+
const accountName = await askUntil("Account name, empty when done", given?.name ?? "", (n) => (n === "" || (ACCOUNT_NAME.test(n) && !accounts.some((acc) => acc.name === n)) ? n : undefined), `a name of letters, digits, spaces, ., _ and - that no other account has (a key of ${PRODUCT_FILE} and a folder of the crawl)`);
|
|
338
371
|
if (accountName === "")
|
|
339
372
|
break;
|
|
340
|
-
const role = await
|
|
341
|
-
|
|
373
|
+
const role = await askUntil(" role", given?.role ?? "member", (n) => (ACCOUNT_NAME.test(n) ? n : undefined), `a name of letters, digits, spaces, ., _ and - (an item of roles: in ${PRODUCT_FILE})`);
|
|
374
|
+
// A name that gives no variable name (another script), or the one an earlier account's fields have, is suggested by its place.
|
|
375
|
+
const stem = `OMNIQA_${envName(accountName)}`;
|
|
376
|
+
const prefix = stem === "OMNIQA_" || accounts.some((acc) => Object.values(acc.fields).some((v) => v.startsWith(`${stem}_`))) ? `OMNIQA_ACCOUNT_${accounts.length + 1}` : stem;
|
|
342
377
|
const defFields = given === undefined ? `email=${prefix}_EMAIL password=${prefix}_PASSWORD` : Object.entries(given.fields).map(([k, v]) => `${k}=${v}`).join(" ");
|
|
343
378
|
let fields;
|
|
344
379
|
while (fields === undefined) {
|
|
@@ -446,6 +481,7 @@ function environmentBlock(e, first, a) {
|
|
|
446
481
|
if (e.tier === "production" && a.security === true)
|
|
447
482
|
lines.push(` # phone: "+15550100" # ${PHONE}`);
|
|
448
483
|
if (first) {
|
|
484
|
+
lines.push(" # httpAuth: { username: preview, password: $STAGING_PASSWORD } # the site sits behind an HTTP sign-in (a staging server's prompt): answered on this environment's host alone, the password by a variable's name", " # ownCertificate: true # the site's certificate is its own (self-signed, an authority this machine does not know): taken for this environment, refused for every other");
|
|
449
485
|
lines.push(' # cookies: [{ name: cookiesAccepted, value: "1" }] # seeded on every browser context before the first page: what the product stores when its cookie banner is answered', ' # localStorage: [{ key: hideNewsModal, value: "1" }] # likewise for a news or promo modal; values may be $VAR references');
|
|
450
486
|
lines.push(" # apps: # the build each device project opens here, by platform (omniqa.config.ts projects with a platform)", " # ios: com.example.app", " # android: com.example.app");
|
|
451
487
|
}
|
|
@@ -474,7 +510,7 @@ const described = (rel, ci, names, pages, changelog, ciNote, sec) => {
|
|
|
474
510
|
if (rel.endsWith(WRITE_WORKFLOW))
|
|
475
511
|
return [`${rel} (the tests you tick on a pull request OmniQA opened are written into it)`];
|
|
476
512
|
if (rel.endsWith(".github/workflows/omniqa.yml"))
|
|
477
|
-
return [`${rel} (the tests on every push
|
|
513
|
+
return [`${rel} (the tests on every push that touches a test file, and by hand from the Actions tab; heals and the refreshed coverage come back as a commit, or a pull request on a protected branch)`, ...note, ...secrets, ...(changelog === undefined ? [` ${bold("allow GitHub Actions to create and approve pull requests under Settings → Actions → General → Workflow permissions (heals come as pull requests on a protected branch or from a production environment)")}`] : [])];
|
|
478
514
|
if (rel.endsWith(".github/workflows/omniqa-pages.yml"))
|
|
479
515
|
return [`${rel} (the scheme page on GitHub Pages after every push to the default branch that changes it)`, ` ${bold("enable Pages under Settings → Pages with GitHub Actions as the source; the site is public unless the organization is on GitHub Enterprise")}`];
|
|
480
516
|
if (rel === ".omniqa/ci/gitlab-ci.yml")
|
|
@@ -482,6 +518,8 @@ const described = (rel, ci, names, pages, changelog, ciNote, sec) => {
|
|
|
482
518
|
return [rel];
|
|
483
519
|
};
|
|
484
520
|
const NPM_COMMENT = "The newest OmniQA from npm (pin omniqa@<version> here to hold CI on one).";
|
|
521
|
+
/** What the sec job says on a public repository, where the scan does not run (omniqa security sees to that itself, and says so in its own line). A plain YAML scalar inside an echo: no colon followed by a space, no dollar sign. */
|
|
522
|
+
const PUBLIC_NOTICE = "this repository is public, so the agent scan does not run here (its report could be kept neither as an artifact nor in the cache, where anyone could read it). omniqa security on your machine runs the scan and writes the report to .omniqa/security/report.md.";
|
|
485
523
|
const CI_COMMENT = `${NPM_COMMENT} Heals and the refreshed coverage are committed on the branch under test, or opened as a`;
|
|
486
524
|
// ponytail: a push or merge request runs the tests only when it touches a test file; everything else (recordings, the config, the knowledge, a README) waits for a run by hand. Widen the list here if a project wants more.
|
|
487
525
|
const RUN_ON = (dir) => [`${dir}tests/**/*.ts`];
|
|
@@ -495,7 +533,9 @@ function ciFiles(a, place, secretNames) {
|
|
|
495
533
|
/**
|
|
496
534
|
* The GitHub job of the security tests: the steps of the other job and Interceptor, read-only, with no `needs`. Where the
|
|
497
535
|
* scan runs, the last report is restored from the cache before the run (what makes a confirmed claim new or known), saved
|
|
498
|
-
* after it whatever its outcome, and kept as an artifact on every run: what the scan found is in no log.
|
|
536
|
+
* after it whatever its outcome, and kept as an artifact on every run: what the scan found is in no log. The three steps run
|
|
537
|
+
* on a private repository alone: an artifact of a public one is anyone's to download, and its cache a fork's pull request's
|
|
538
|
+
* to restore, so there the job keeps no report, omniqa security makes no scan, and a notice says so. No artifact step
|
|
499
539
|
* here needs `include-hidden-files`: upload-artifact leaves out the dot-named entries inside a path it is given, and a path
|
|
500
540
|
* that leads through `.omniqa` is searched like any other (its v7 code, read on 2026-11-17; OmniQA writes no dot-named file there).
|
|
501
541
|
*/
|
|
@@ -513,7 +553,8 @@ ${place.dir === "" ? "" : ` defaults:\n run:\n working-directory:
|
|
|
513
553
|
npm install -g omniqa@latest
|
|
514
554
|
omniqa install --with-deps
|
|
515
555
|
omniqa install interceptor
|
|
516
|
-
${scans ? ` -
|
|
556
|
+
${scans ? ` - if: github.event.repository.private
|
|
557
|
+
uses: actions/cache/restore@v6
|
|
517
558
|
with:
|
|
518
559
|
path: ${dir}.omniqa/security
|
|
519
560
|
key: omniqa-security-\${{ github.run_id }}
|
|
@@ -521,17 +562,19 @@ ${scans ? ` - uses: actions/cache/restore@v6
|
|
|
521
562
|
` : ""} - run: ${command}
|
|
522
563
|
env:
|
|
523
564
|
${env}${secretNames.map((n) => ` ${n}: \${{ secrets.${n} }}\n`).join("")}${scans ? ` SLACK_WEBHOOK_URL: \${{ secrets.SLACK_WEBHOOK_URL }}
|
|
524
|
-
- if: always()
|
|
565
|
+
- if: always() && github.event.repository.private
|
|
525
566
|
uses: actions/cache/save@v6
|
|
526
567
|
with:
|
|
527
568
|
path: ${dir}.omniqa/security
|
|
528
569
|
key: omniqa-security-\${{ github.run_id }}
|
|
529
|
-
- if: always()
|
|
570
|
+
- if: always() && github.event.repository.private
|
|
530
571
|
uses: actions/upload-artifact@v7
|
|
531
572
|
with:
|
|
532
573
|
name: omniqa-security-report
|
|
533
574
|
path: ${dir}.omniqa/security
|
|
534
575
|
if-no-files-found: ignore
|
|
576
|
+
- if: always() && !github.event.repository.private
|
|
577
|
+
run: echo "::notice::${PUBLIC_NOTICE}"
|
|
535
578
|
` : ""} - if: failure()
|
|
536
579
|
uses: actions/upload-artifact@v7
|
|
537
580
|
with:
|
|
@@ -543,8 +586,10 @@ ${env}${secretNames.map((n) => ` ${n}: \${{ secrets.${n} }}\n`).join(""
|
|
|
543
586
|
`;
|
|
544
587
|
if (a.ci === "github") {
|
|
545
588
|
return {
|
|
546
|
-
[`${at}.github/workflows/omniqa.yml`]: `# OmniQA: the tests on every push
|
|
547
|
-
# workflow); anything else, a README, the recordings, the config or the knowledge, runs nothing on its own.
|
|
589
|
+
[`${at}.github/workflows/omniqa.yml`]: `# OmniQA: the tests on every push that touches a test file (tests/**/*.ts), and by hand from the Actions tab (Run
|
|
590
|
+
# workflow); anything else, a README, the recordings, the config or the knowledge, runs nothing on its own. A pull request
|
|
591
|
+
# is checked by the run of its branch's push: a pull_request trigger beside it would run the branch twice, the second
|
|
592
|
+
# time on GitHub's merge commit, which a heal must not be committed on. ${CI_COMMENT}
|
|
548
593
|
# pull request when the branch is protected or the environment is production: allow GitHub Actions to create and approve pull
|
|
549
594
|
# requests under Settings → Actions → General → Workflow permissions. A failed run keeps its screenshots, report and transcripts
|
|
550
595
|
# as the omniqa-test-results artifact. Every secret below has the name and the value it has in .env (Settings, Secrets and
|
|
@@ -554,14 +599,13 @@ ${env}${secretNames.map((n) => ` ${n}: \${{ secrets.${n} }}\n`).join(""
|
|
|
554
599
|
# ${sec} says securityScan: on, so the sec job's run ends with the agent scan (model calls on every run; --no-scan on its
|
|
555
600
|
# line keeps a run to the tests). The scan's report says where the product is open and is in no log: the job restores the
|
|
556
601
|
# last one from the cache (a finding it already listed does not fail the run again), saves the new one, and keeps it as
|
|
557
|
-
# the omniqa-security-report artifact
|
|
558
|
-
#
|
|
602
|
+
# the omniqa-security-report artifact. On a public repository anyone could download either, so there the scan does not run
|
|
603
|
+
# (omniqa security says so in one line) and the report is the one omniqa security writes on your machine.
|
|
604
|
+
# SLACK_WEBHOOK_URL, when it is set, gets one line with the counts when a scan confirms something new.` : ""}`}
|
|
559
605
|
name: omniqa
|
|
560
606
|
on:
|
|
561
607
|
push:
|
|
562
608
|
paths:
|
|
563
|
-
${RUN_ON(place.dir === "" ? "" : `${place.dir}/`).map((p) => ` - ${p}\n`).join("")} pull_request:
|
|
564
|
-
paths:
|
|
565
609
|
${RUN_ON(place.dir === "" ? "" : `${place.dir}/`).map((p) => ` - ${p}\n`).join("")} workflow_dispatch:
|
|
566
610
|
permissions:
|
|
567
611
|
contents: write # heals and the refreshed coverage are committed on the branch under test
|
|
@@ -592,8 +636,9 @@ ${secretNames.map((n) => ` ${n}: \${{ secrets.${n} }}\n`).join("")}
|
|
|
592
636
|
${sec === undefined ? "" : secJob(`omniqa security --env ${sec}`, "")}`,
|
|
593
637
|
...(a.changelog === undefined ? {} : { [`${at}.github/workflows/omniqa-deploy.yml`]: `# OmniQA: after a product deploy. The product's deploy pipeline starts this workflow (repository_dispatch omniqa-deploy, a
|
|
594
638
|
# curl with no payload); it runs the suite on the deployed environment, posts the failures to the team channel and fixes
|
|
595
|
-
# them behind the reviewers, rewrites the knowledge where the change lands and commits
|
|
596
|
-
# production environment or a protected branch
|
|
639
|
+
# them behind the reviewers, rewrites the knowledge where the change lands and commits what it changed (a pull request on a
|
|
640
|
+
# production environment or a protected branch; nothing when no test changed). The run is red when a test ended as a
|
|
641
|
+
# regression or still fails. Run workflow in the Actions tab runs it by hand. The three setup steps
|
|
597
642
|
# (secrets, the product's hook, a first run): omniqa doctor. A failed run keeps its screenshots, report and transcripts as
|
|
598
643
|
# the omniqa-deploy-results artifact. ${NPM_COMMENT}
|
|
599
644
|
name: omniqa deploy
|
|
@@ -693,7 +738,7 @@ ${RUN_ON(place.dir === "" ? "" : `${place.dir}/`).map((p) => ` - ${p}\n`)
|
|
|
693
738
|
- if: $CI_COMMIT_BRANCH
|
|
694
739
|
changes:
|
|
695
740
|
${RUN_ON(place.dir === "" ? "" : `${place.dir}/`).map((p) => ` - ${p}\n`).join("")} before_script:
|
|
696
|
-
|
|
741
|
+
${GITLAB_PUSH}
|
|
697
742
|
- npm install -g omniqa@latest
|
|
698
743
|
- omniqa install --with-deps
|
|
699
744
|
script:
|
|
@@ -710,8 +755,9 @@ ${sec === undefined ? "" : `
|
|
|
710
755
|
# ${sec} says securityScan: on, so the job's run ends with the agent scan (model calls on every run; --no-scan on its line
|
|
711
756
|
# keeps a run to the tests). The scan's report says where the product is open and is in no log: the job's cache carries the
|
|
712
757
|
# last one to the next run (a finding it already listed does not fail the run again), and every run keeps it among its
|
|
713
|
-
# artifacts,
|
|
714
|
-
#
|
|
758
|
+
# artifacts, which the project's members alone can download (public: false; a self-managed GitLab before 16.7 takes the
|
|
759
|
+
# keyword and does nothing with it unless its non_public_artifacts feature flag is on). SLACK_WEBHOOK_URL, when it is set,
|
|
760
|
+
# gets one line with the counts when a scan confirms something new.` : ""}
|
|
715
761
|
omniqa sec:
|
|
716
762
|
image: node:26
|
|
717
763
|
rules:
|
|
@@ -735,23 +781,26 @@ ${scans ? ` cache:
|
|
|
735
781
|
when: always
|
|
736
782
|
` : ""} artifacts:
|
|
737
783
|
when: ${scans ? "always" : "on_failure"}
|
|
738
|
-
paths:
|
|
784
|
+
${scans ? " public: false\n" : ""} paths:
|
|
739
785
|
- ${dir}test-results
|
|
740
786
|
- ${dir}.omniqa/runs
|
|
741
787
|
${scans ? ` - ${dir}.omniqa/security\n` : ""}`}${a.changelog === undefined ? "" : `
|
|
742
788
|
# After a product deploy: the product's deploy pipeline starts this one (a pipeline trigger token, a curl with no payload);
|
|
743
789
|
# the job runs the suite on the deployed environment, posts the failures to the team channel and fixes them behind the
|
|
744
|
-
# reviewers, rewrites the knowledge where the change lands and commits
|
|
745
|
-
# on a production environment or a protected branch).
|
|
790
|
+
# reviewers, rewrites the knowledge where the change lands and commits what it changed through GITLAB_TOKEN (a merge request
|
|
791
|
+
# on a production environment or a protected branch; nothing when no test changed). The job is red when a test ended as a
|
|
792
|
+
# regression or still fails. New pipeline (Build → Pipelines) with a variable OMNIQA_ENV (the
|
|
746
793
|
# environment, e.g. ${deployEnvironment(a)}; OMNIQA_SHA names a commit other than the branch head) runs it by hand. The
|
|
747
|
-
# three setup steps (variables, the product's hook, a first run): omniqa doctor.
|
|
794
|
+
# three setup steps (variables, the product's hook, a first run): omniqa doctor. One deploy's job at a time
|
|
795
|
+
# (resource_group): two that ran side by side each moved the last synced commit, and the one that ended last won.
|
|
748
796
|
omniqa deploy:
|
|
749
797
|
image: node:26
|
|
798
|
+
resource_group: omniqa-deploy
|
|
750
799
|
rules:
|
|
751
800
|
- if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "pipeline"
|
|
752
801
|
- if: $CI_PIPELINE_SOURCE == "web" && ($OMNIQA_ENV || $OMNIQA_SHA)
|
|
753
802
|
before_script:
|
|
754
|
-
|
|
803
|
+
${GITLAB_PUSH}
|
|
755
804
|
- npm install -g omniqa@latest
|
|
756
805
|
- omniqa install --with-deps
|
|
757
806
|
script:
|
|
@@ -854,7 +903,7 @@ ${scopeLine}});
|
|
|
854
903
|
`,
|
|
855
904
|
".omniqa/product.yaml": `name: ${JSON.stringify(a.name)}
|
|
856
905
|
environments:
|
|
857
|
-
${a.environments.map((e, i) => environmentBlock(e, i === 0, a)).join("")}${productionExample}${accountLines}${sources}# crawl: # omniqa crawl
|
|
906
|
+
${a.environments.map((e, i) => environmentBlock(e, i === 0, a)).join("")}${productionExample}${accountLines}${sources}# crawl: # omniqa crawl and the knowledge build's walks; omniqa crawl logs in as \`account\` (default: the first account)
|
|
858
907
|
# max_pages: 50
|
|
859
908
|
# max_depth: 3
|
|
860
909
|
# exclude: [/admin] # path substrings, on top of logout, delete and payment routes
|
|
@@ -1093,11 +1142,22 @@ export async function init(args, cwd) {
|
|
|
1093
1142
|
return code;
|
|
1094
1143
|
};
|
|
1095
1144
|
try {
|
|
1096
|
-
const
|
|
1145
|
+
const onboarding = (await readState(cwd)).onboarding;
|
|
1146
|
+
const stage = onboarding?.stage;
|
|
1147
|
+
const stored = storedAnswers(onboarding?.answers);
|
|
1148
|
+
const answeredOn = (onboarding?.updatedAt ?? "").slice(0, 10);
|
|
1149
|
+
const flagged = ANSWER_FLAGS.filter((flag) => v[flag] !== undefined);
|
|
1097
1150
|
if (reader !== undefined && v.force !== true && stage !== undefined && stage !== "interview") {
|
|
1151
|
+
// A flag answers the interview, which is not asked here: read and dropped, the stages ran on the earlier answers.
|
|
1152
|
+
if (flagged.length > 0) {
|
|
1153
|
+
stderr.write(`omniqa init: --${flagged[0]} answers the interview, and this project is past it (stage ${stage}): omniqa init goes on from that stage, omniqa init --force asks the interview again\n`);
|
|
1154
|
+
return 1;
|
|
1155
|
+
}
|
|
1098
1156
|
out(`omniqa init: resuming at stage ${stage}`);
|
|
1099
1157
|
return await stages(stage, reader);
|
|
1100
1158
|
}
|
|
1159
|
+
// Stage interview is an init that took its answers and was stopped while it set the project up: it goes on from them.
|
|
1160
|
+
const goOn = reader !== undefined && v.force !== true && stage === "interview" && stored !== undefined && flagged.length === 0;
|
|
1101
1161
|
// The CI file goes to the repository's root (a qa/ folder's job runs in the folder); a folder in no repository becomes one below.
|
|
1102
1162
|
const top = await git(cwd, ["rev-parse", "--show-toplevel"]).catch(() => undefined);
|
|
1103
1163
|
const here = await realpath(cwd);
|
|
@@ -1109,14 +1169,34 @@ export async function init(args, cwd) {
|
|
|
1109
1169
|
defaults.pages = v.pages === true && defaults.ci !== "none";
|
|
1110
1170
|
if (reader === undefined && defaults.models.default.model === "")
|
|
1111
1171
|
throw new Error(`--model is required with --base-url ${defaults.baseUrl}: only OpenAI's and OpenRouter's urls come with suggested models`);
|
|
1112
|
-
|
|
1172
|
+
if (goOn) {
|
|
1173
|
+
out(`omniqa init: going on from the interview answered on ${answeredOn} (omniqa init --force asks it again)`);
|
|
1174
|
+
answers = stored;
|
|
1175
|
+
}
|
|
1176
|
+
else if (reader === undefined)
|
|
1177
|
+
answers = defaults;
|
|
1178
|
+
else {
|
|
1179
|
+
// A project that is there is said before the first question, by the files every project has whatever the answers.
|
|
1180
|
+
const there = [];
|
|
1181
|
+
if (v.force !== true)
|
|
1182
|
+
for (const rel of Object.keys(render({ ...defaults, ci: "none", pages: false }, place)))
|
|
1183
|
+
if (await exists(join(cwd, rel)))
|
|
1184
|
+
there.push(rel);
|
|
1185
|
+
if (there.length > 0)
|
|
1186
|
+
throw new Error(`omniqa init: ${there.join(", ")} already exists. Re-run with --force to overwrite.`);
|
|
1187
|
+
// Asked again, the earlier answers are the defaults; flags name others, as on a first init.
|
|
1188
|
+
const again = v.force === true && stored !== undefined && flagged.length === 0;
|
|
1189
|
+
if (again)
|
|
1190
|
+
out(`omniqa init --force: your answers of ${answeredOn} are the defaults (Enter keeps each)`);
|
|
1191
|
+
answers = await interview(reader, again ? { ...defaults, ...stored } : defaults, { ...(remote === undefined ? {} : { remote }), ...(strings.ci === undefined ? {} : { ciFlag: strings.ci }) });
|
|
1192
|
+
}
|
|
1113
1193
|
}
|
|
1114
1194
|
catch (err) {
|
|
1115
1195
|
stderr.write(`${err.message}\n`);
|
|
1116
1196
|
return 1;
|
|
1117
1197
|
}
|
|
1118
1198
|
const files = render(answers, place);
|
|
1119
|
-
if (v.force !== true) {
|
|
1199
|
+
if (v.force !== true && !goOn) {
|
|
1120
1200
|
const clashes = [];
|
|
1121
1201
|
for (const rel of Object.keys(files))
|
|
1122
1202
|
if (await exists(join(cwd, rel)))
|
|
@@ -1127,9 +1207,21 @@ export async function init(args, cwd) {
|
|
|
1127
1207
|
}
|
|
1128
1208
|
}
|
|
1129
1209
|
// init appends the block to a README of the user's only when it creates the project: one without the markers stays the user's on a later init --force
|
|
1130
|
-
const fresh = !(await exists(join(cwd, PRODUCT_FILE)));
|
|
1210
|
+
const fresh = goOn || !(await exists(join(cwd, PRODUCT_FILE)));
|
|
1211
|
+
// The answers first: an init stopped from here on (the proxy's install takes a minute) goes on from them, asking nothing.
|
|
1212
|
+
await recordOnboarding(cwd, "interview", answers);
|
|
1213
|
+
// A file that is neither what the earlier answers wrote nor what these write was changed by hand: it is kept beside the runs.
|
|
1214
|
+
const own = stored === undefined ? {} : render(stored, place);
|
|
1215
|
+
const keptIn = join(RUNS_DIR, transcriptName("init").replace(/\.jsonl$/, ""));
|
|
1216
|
+
const kept = [];
|
|
1131
1217
|
for (const [rel, content] of Object.entries(files)) {
|
|
1132
1218
|
const path = join(cwd, rel);
|
|
1219
|
+
const before = await readFile(path, "utf8").catch(() => undefined);
|
|
1220
|
+
if (before !== undefined && before !== content && before !== own[rel]) {
|
|
1221
|
+
await mkdir(dirname(join(cwd, keptIn, rel)), { recursive: true });
|
|
1222
|
+
await writeFile(join(cwd, keptIn, rel), before);
|
|
1223
|
+
kept.push(`${rel} as it was is kept in ${keptIn}/ (what was changed in it by hand is there, not in the new file)`);
|
|
1224
|
+
}
|
|
1133
1225
|
await mkdir(dirname(path), { recursive: true });
|
|
1134
1226
|
await writeFile(path, content);
|
|
1135
1227
|
}
|
|
@@ -1161,7 +1253,7 @@ export async function init(args, cwd) {
|
|
|
1161
1253
|
gitlabLine = current.includes(job) ? `${shown} (includes it already)` : `${shown} left as is: add \`include: [{ local: ${job} }]\` to it`;
|
|
1162
1254
|
}
|
|
1163
1255
|
const names = secretNamesOf(answers);
|
|
1164
|
-
const listed = [...Object.keys(files).flatMap((rel) => [...described(rel, answers.ci, names, answers.pages, answers.changelog, ciTest(answers).note, secNote(answers)), ...(rel === ".omniqa/ci/gitlab-ci.yml" && gitlabLine !== undefined ? [gitlabLine] : [])]), ".mcp.json (the omniqa MCP server for Claude Code; Cursor reads the same shape from .cursor/mcp.json)"];
|
|
1256
|
+
const listed = [...kept, ...Object.keys(files).flatMap((rel) => [...described(rel, answers.ci, names, answers.pages, answers.changelog, ciTest(answers).note, secNote(answers)), ...(rel === ".omniqa/ci/gitlab-ci.yml" && gitlabLine !== undefined ? [gitlabLine] : [])]), ".mcp.json (the omniqa MCP server for Claude Code; Cursor reads the same shape from .cursor/mcp.json)"];
|
|
1165
1257
|
const pkg = await modulePackage(cwd);
|
|
1166
1258
|
if (pkg !== undefined)
|
|
1167
1259
|
listed.push(pkg);
|