@ora-ai/cli 0.21.0 → 0.23.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/README.md +96 -1
- package/dist/auth-commands.d.ts.map +1 -1
- package/dist/auth-commands.js +12 -1
- package/dist/auth-commands.js.map +1 -1
- package/dist/core/auth.d.ts +24 -13
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +26 -15
- package/dist/core/auth.js.map +1 -1
- package/dist/core/credential-sources.d.ts +45 -0
- package/dist/core/credential-sources.d.ts.map +1 -0
- package/dist/core/credential-sources.js +65 -0
- package/dist/core/credential-sources.js.map +1 -0
- package/dist/core/github-actions-sign-in.d.ts +33 -0
- package/dist/core/github-actions-sign-in.d.ts.map +1 -0
- package/dist/core/github-actions-sign-in.js +54 -0
- package/dist/core/github-actions-sign-in.js.map +1 -0
- package/dist/core/output.js +14 -1
- package/dist/core/output.js.map +1 -1
- package/dist/core/run-operation.d.ts +11 -4
- package/dist/core/run-operation.d.ts.map +1 -1
- package/dist/core/run-operation.js +14 -9
- package/dist/core/run-operation.js.map +1 -1
- package/dist/core/sign-in.d.ts +34 -0
- package/dist/core/sign-in.d.ts.map +1 -0
- package/dist/core/sign-in.js +21 -0
- package/dist/core/sign-in.js.map +1 -0
- package/dist/generated/operations.d.ts +1 -1
- package/dist/generated/operations.d.ts.map +1 -1
- package/dist/generated/operations.js +1274 -73
- package/dist/generated/operations.js.map +1 -1
- package/dist/generated/types.d.ts +1445 -10
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/generated/types.js +1 -1
- package/dist/mcp/mcp-call.d.ts +25 -0
- package/dist/mcp/mcp-call.d.ts.map +1 -0
- package/dist/mcp/mcp-call.js +44 -0
- package/dist/mcp/mcp-call.js.map +1 -0
- package/dist/mcp/mcp-command.d.ts +26 -0
- package/dist/mcp/mcp-command.d.ts.map +1 -0
- package/dist/mcp/mcp-command.js +91 -0
- package/dist/mcp/mcp-command.js.map +1 -0
- package/dist/mcp/mcp-install.d.ts +50 -0
- package/dist/mcp/mcp-install.d.ts.map +1 -0
- package/dist/mcp/mcp-install.js +71 -0
- package/dist/mcp/mcp-install.js.map +1 -0
- package/dist/mcp/mcp-protocol.d.ts +69 -0
- package/dist/mcp/mcp-protocol.d.ts.map +1 -0
- package/dist/mcp/mcp-protocol.js +96 -0
- package/dist/mcp/mcp-protocol.js.map +1 -0
- package/dist/mcp/mcp-stdio.d.ts +17 -0
- package/dist/mcp/mcp-stdio.d.ts.map +1 -0
- package/dist/mcp/mcp-stdio.js +39 -0
- package/dist/mcp/mcp-stdio.js.map +1 -0
- package/dist/mcp/mcp-tools.d.ts +81 -0
- package/dist/mcp/mcp-tools.d.ts.map +1 -0
- package/dist/mcp/mcp-tools.js +134 -0
- package/dist/mcp/mcp-tools.js.map +1 -0
- package/dist/program.d.ts +4 -9
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +9 -3
- package/dist/program.js.map +1 -1
- package/dist/render/index.js +6 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/study/counting-views.d.ts +46 -0
- package/dist/render/study/counting-views.d.ts.map +1 -0
- package/dist/render/study/counting-views.js +49 -0
- package/dist/render/study/counting-views.js.map +1 -0
- package/dist/render/study/gate-views.d.ts +56 -0
- package/dist/render/study/gate-views.d.ts.map +1 -0
- package/dist/render/study/gate-views.js +64 -0
- package/dist/render/study/gate-views.js.map +1 -0
- package/dist/render/study/renderers.d.ts +8 -0
- package/dist/render/study/renderers.d.ts.map +1 -0
- package/dist/render/study/renderers.js +31 -0
- package/dist/render/study/renderers.js.map +1 -0
- package/dist/render/study/series-views.d.ts +65 -0
- package/dist/render/study/series-views.d.ts.map +1 -0
- package/dist/render/study/series-views.js +116 -0
- package/dist/render/study/series-views.js.map +1 -0
- package/dist/render/study/study-format.d.ts +24 -0
- package/dist/render/study/study-format.d.ts.map +1 -0
- package/dist/render/study/study-format.js +42 -0
- package/dist/render/study/study-format.js.map +1 -0
- package/dist/study-ci/ci-command.d.ts +40 -0
- package/dist/study-ci/ci-command.d.ts.map +1 -0
- package/dist/study-ci/ci-command.js +151 -0
- package/dist/study-ci/ci-command.js.map +1 -0
- package/dist/study-ci/ci-rehearse-command.d.ts +11 -0
- package/dist/study-ci/ci-rehearse-command.d.ts.map +1 -0
- package/dist/study-ci/ci-rehearse-command.js +83 -0
- package/dist/study-ci/ci-rehearse-command.js.map +1 -0
- package/dist/study-ci/ci-rehearse.d.ts +62 -0
- package/dist/study-ci/ci-rehearse.d.ts.map +1 -0
- package/dist/study-ci/ci-rehearse.js +49 -0
- package/dist/study-ci/ci-rehearse.js.map +1 -0
- package/dist/study-ci/ci-run.d.ts +87 -0
- package/dist/study-ci/ci-run.d.ts.map +1 -0
- package/dist/study-ci/ci-run.js +131 -0
- package/dist/study-ci/ci-run.js.map +1 -0
- package/dist/study-ci/gate-report.d.ts +64 -0
- package/dist/study-ci/gate-report.d.ts.map +1 -0
- package/dist/study-ci/gate-report.js +80 -0
- package/dist/study-ci/gate-report.js.map +1 -0
- package/dist/study-ci/params.d.ts +8 -0
- package/dist/study-ci/params.d.ts.map +1 -0
- package/dist/study-ci/params.js +72 -0
- package/dist/study-ci/params.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--param name=value` — the values a study body file is filled with at run
|
|
3
|
+
* time: the commit under test, a build's URL, a branch name.
|
|
4
|
+
*
|
|
5
|
+
* A body file names a parameter as `${name}` inside any JSON STRING. The file
|
|
6
|
+
* stays valid JSON and reviewable in a pull request; the substitution is on
|
|
7
|
+
* parsed strings, never on the file's text, so a value can never change the
|
|
8
|
+
* body's structure (a quote or a brace in a branch name stays a character).
|
|
9
|
+
*
|
|
10
|
+
* STRICT BOTH WAYS, because a CI run that silently tested the wrong thing is
|
|
11
|
+
* worse than one that refused to start:
|
|
12
|
+
* - a placeholder with no `--param` is an error (the body would be sent with
|
|
13
|
+
* a literal `${ref}` in it);
|
|
14
|
+
* - a `--param` no placeholder uses is an error (a typo in either one would
|
|
15
|
+
* otherwise run the study without the value its author meant).
|
|
16
|
+
*/
|
|
17
|
+
const PLACEHOLDER = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
18
|
+
export class StudyParamError extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "StudyParamError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** `["ref=abc", "build=https://…"]` as a map. The value may itself contain `=`. */
|
|
25
|
+
export function parseParams(pairs) {
|
|
26
|
+
const params = new Map();
|
|
27
|
+
for (const pair of pairs) {
|
|
28
|
+
const at = pair.indexOf("=");
|
|
29
|
+
const name = at === -1 ? "" : pair.slice(0, at);
|
|
30
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
31
|
+
throw new StudyParamError(`--param takes name=value (got '${pair}'); a name is letters, digits and underscores`);
|
|
32
|
+
}
|
|
33
|
+
if (params.has(name))
|
|
34
|
+
throw new StudyParamError(`--param '${name}' is given twice`);
|
|
35
|
+
params.set(name, pair.slice(at + 1));
|
|
36
|
+
}
|
|
37
|
+
return params;
|
|
38
|
+
}
|
|
39
|
+
/** The body with every `${name}` in every string filled in. Never mutates `body`. */
|
|
40
|
+
export function applyParams(body, params) {
|
|
41
|
+
const used = new Set();
|
|
42
|
+
const missing = new Set();
|
|
43
|
+
const fill = (value) => {
|
|
44
|
+
if (typeof value === "string") {
|
|
45
|
+
return value.replace(PLACEHOLDER, (whole, name) => {
|
|
46
|
+
const replacement = params.get(name);
|
|
47
|
+
if (replacement === undefined) {
|
|
48
|
+
missing.add(name);
|
|
49
|
+
return whole;
|
|
50
|
+
}
|
|
51
|
+
used.add(name);
|
|
52
|
+
return replacement;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value))
|
|
56
|
+
return value.map(fill);
|
|
57
|
+
if (value !== null && typeof value === "object") {
|
|
58
|
+
return Object.fromEntries(Object.entries(value).map(([key, inner]) => [key, fill(inner)]));
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
const filled = fill(body);
|
|
63
|
+
if (missing.size > 0) {
|
|
64
|
+
throw new StudyParamError(`the body names ${[...missing].sort().map((n) => `\${${n}}`).join(", ")} but no --param fills it`);
|
|
65
|
+
}
|
|
66
|
+
const unused = [...params.keys()].filter((name) => !used.has(name)).sort();
|
|
67
|
+
if (unused.length > 0) {
|
|
68
|
+
throw new StudyParamError(`--param ${unused.join(", ")} is not used by the body (it names no \${${unused[0]}})`);
|
|
69
|
+
}
|
|
70
|
+
return filled;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/study-ci/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,UAAU,WAAW,CAAC,KAAwB;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,eAAe,C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